- Joined
- Jan 4, 2010
- Messages
- 123
- Reaction score
- 9
MAX HP/ MP, AP points & Fame Exchanger.
This is just a small release, I'm sure somebody will use this as I've saw a few people asking for this sort of thing.
No additional methods are needed unless you want the fakeRelog method which I will add.
Basically, the merchant exchanges a currency of your choice for .. well the title says it all.
This is ideal for low rate servers, or those who would like to keep HP washing optional.
Use it as you wish~
Here's the NPC script:
fakeRelog Method:
special thanks to izarooni for helping with some things that I ran into!
Merry Christmas to everyone, happy holidays!~
This is just a small release, I'm sure somebody will use this as I've saw a few people asking for this sort of thing.
No additional methods are needed unless you want the fakeRelog method which I will add.
Basically, the merchant exchanges a currency of your choice for .. well the title says it all.
This is ideal for low rate servers, or those who would like to keep HP washing optional.
Use it as you wish~
Here's the NPC script:
PHP:
var status = -1;
var choice;
var fee;
var result;
var heal;
var MapleStat = Java.type('client.MapleStat');
var item = 4310000; //Change this to an item of your choice.
function start() {
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode != 1) {
cm.dispose();
return;
} else
status++;
if (status == 0) {
cm.sendSimple("What would you like to do?\r\n\r\n"
+ "#L0#Increase my MAX #rHP#k\r\n"
+ "#L1#Increase my MAX #bMP#k\r\n"
+"\t#fUI/UIWindow.img/SkillMacro/line02#\r\n\r\n"
+ "#L2##kPurchase Ability Points\r\n"
+ "#L3##kPurchase Fame\r\n"
);
} else if (status == 1) {
choice = selection;
if (selection == 0) {
cm.sendGetText("How many #z" + item + "#(s) do you want to use to increase your MAX#rHP#k?\r\n\n #r100#k points = #r1#k #z" + item + "#.\r\n");
} else if (selection == 1) {
cm.sendGetText("How many #z" + item + "#(s) do you want to use to increase your MAX#bMP#k?\r\n\n #b100#k points = #r1#k #z" + item + "#.\r\n");
} else if (selection == 2) {
cm.sendGetText("How many #z" + item + "#s do you want to trade for #gAbility Points#k\r\n\r\n\r\n#r200#k points = #r1#k #z" + item + "#.\r\n");
} else if (selection == 3) {
cm.sendGetText("How many #z" + item + "#s do you want to trade for #gFame#k?\r\n\r\n\r\n#r100#k Fame = #r1#k #z" + item + "#.\r\n");
}
} else if (status == 2) {
if (choice == 0) {
fee = cm.getText();
cm.sendYesNo("Are you sure you want to trade #r" + fee + "#k #z" + item + "#(s) to add #rHP#k points?");
} else if (choice == 1) {
fee0 = cm.getText();
cm.sendYesNo("Are you sure you want to trade #r" + fee0 + "#k #z" + item + "#(s) to add #bMP#k points?");
} else if (choice == 2) {
fee1 = cm.getText();
result = fee1 * 200
cm.sendYesNo("Are you sure you want to trade #r" + fee1 + "#k #z" + item + "#(s) to add\r\n#r" + result + "#k #gAbility Points#k?");
} else if (choice == 3) {
fee2 = cm.getText();
result = fee2 * 100
cm.sendYesNo("Are you sure you want to trade #r" + fee2 + "#k #z" + item + "#(s) to add\r\n#r" + result + "#k #eFame#n#k?");
}
} else if (status == 3) {
if (choice == 0) {
heal = cm.getClient().getPlayer().healHpMp();
result = fee * 100
if (!cm.haveItem(item, fee)) {
cm.sendOk("You cannot trade #z" + item + "#(s) that you do not have.\r\nCome back when you have the required amount!\r\n");
cm.dispose();
} else if (cm.getText() < 1) {
cm.sendOk("You need to have atleast #r1#k #z" + item + "# to trade!");
cm.dispose();
} else if (!cm.haveItem(item, fee) + fee * 2 > 640) {
cm.sendOk("You can only trade #r320#k #z" + item + "# maximum!");
cm.dispose();
} else if (cm.getClient().getPlayer().getMaxHp() + result > 33000) {
cm.sendOk("I'm sorry you cannot have more than 32,000 of this stat");
cm.dispose();
} else {
cm.gainItem(item, -fee);
cm.getClient().getPlayer().addMaxHP(fee * 100);
cm.getClient().getPlayer().updateSingleStat(MapleStat.MAXHP, cm.getClient().getPlayer().getMaxHP());
heal();
cm.sendOk("Thanks!");
cm.dispose();
}
} else if (choice == 1) {
heal = cm.getClient().getPlayer().healHpMp();
result = fee0 * 100
if (!cm.haveItem(item, fee0)) {
cm.sendOk("You cannot trade #z" + item + "#(s) that you do not have.\r\nCome back when you have the required amount!\r\n");
cm.dispose();
} else if (cm.getText() < 1) {
cm.sendOk("You need to have atleast #r1#k #z" + item + "# to trade!");
cm.dispose();
} else if (!cm.haveItem(item, fee0) + fee0 * 2 > 640) {
cm.sendOk("You can only trade #r320#k #z" + item + "# maximum!");
cm.dispose();
} else if (cm.getClient().getPlayer().getMaxMp() + result > 33000) {
cm.sendOk("I'm sorry you cannot have more than 32,000 of this stat");
cm.dispose();
} else {
cm.gainItem(item, -fee0);
cm.getClient().getPlayer().addMaxMP(fee0 * 100);
cm.getClient().getPlayer().updateSingleStat(MapleStat.MAXMP, cm.getClient().getPlayer().getMaxMP());
heal();
cm.sendOk("Thanks!");
cm.dispose();
}
} else if (choice == 2) {
result = fee1 * 200
if (!cm.haveItem(item, fee1)) {
cm.sendOk("You cannot trade #z" + item + "#(s) that you do not have.\r\nCome back when you have the required amount!\r\n");
cm.dispose();
} else if (cm.getText() < 1) {
cm.sendOk("You need to have atleast #r1#k #z" + item + "# to trade!");
cm.dispose();
} else if (!cm.haveItem(item, fee1) + fee1 * 2 > 640) {
cm.sendOk("You can only trade #r320#k #z" + item + "# maximum!");
cm.dispose();
} else {
cm.gainItem(item, -fee1);
cm.getPlayer().gainAp(result, true);
cm.getPlayer().fakeRelog();
cm.sendOk("Thanks! Your points have been added.");
cm.getClient().getPlayer().updateSingleStat(MapleStat.AVAILABLEAP, cm.getClient().getPlayer().gainAp());
cm.dispose();
}
} else if (choice == 3) {
result = fee2 * 100
if (!cm.haveItem(item, fee2)) {
cm.sendOk("You cannot trade #z" + item + "#(s) that you do not have.\r\nCome back when you have the required amount!\r\n");
cm.dispose();
} else if (cm.getText() < 1) {
cm.sendOk("You need to have atleast #r1#k #z" + item + "# to trade!");
cm.dispose();
} else if (!cm.haveItem(item, fee2) + fee2 * 2 > 2000) {
cm.sendOk("You can only trade #r1000#k #z" + item + "# maximum!");
cm.dispose();
} else {
cm.gainItem(item, -fee2);
cm.getClient().getPlayer().addFame(fee2 * 100);
cm.sendOk("Thanks!");
cm.dispose();
}
}
}
}
fakeRelog Method:
In MapleCharacter somewhere add..
PHP:
public void fakeRelog() {
changeMapInternal(getMap(), getPosition(), MaplePacketCreator.getCharInfo(this));
}
special thanks to izarooni for helping with some things that I ran into!
Merry Christmas to everyone, happy holidays!~
Last edited: