メルでスキルをかけてもらうNPC

Go down

メルでスキルをかけてもらうNPC

投稿 by 構築さん on 2014-05-30, 09:12

Code:
var price = 1;
var skills = [1001003, 1101006, 1101007, 1301007, 1301006, 1311008,
2001002, 2101001, 2111005, 2121004, 2121002, 2301003, 2311003,
3001003, 3101004, 3121002,
4001003, 4111001, 4211005];

function start() {
status = -1;
action(1, 0, 0);
}

function action(mode, type, selection) {
if (mode == -1)
cm.dispose();
else {
if (mode == 0)
cm.dispose();
if (mode == 1)
status++;
else
status--;
if (status == 0) {
var seleskill = "#r#eNote#n: #kyour need cost #bMP#kand#b" + price + "#kmesos to buy buff.\r\n#b";
for (var i = 0; i < skills.length; i++) {
if (i%6==0) {
seleskill += "\r\n";
}
seleskill += "#L" + i + "##s" + skills[i] +"##l" ;
}
cm.sendSimple(seleskill);
} else if (status == 1) {
if (cm.getMeso() < price) {
cm.sendOk("your mesos is not enough!#h #.");
cm.dispose();
} else {
var buff = SkillFactory.getSkill(skills[selection]);
cm.gainMeso(-price);
giveBuff(skills[selection], buff.getMaxLevel());
action(2, 0, 0);
}
}
}
}

function giveBuff(buff, level) {
SkillFactory.getSkill(buff).getEffect(level).applyTo(cm.getChar());
}
avatar
構築さん
Admin

Posts : 193
Join date : 2014/05/29

http://maplescience.forumjap.com

トップに戻る Go down

トップに戻る


 
Permissions in this forum:
返信投稿: 不可