[Help] Tough NPC coding question.
hi
i'm trying to make a NPC to reset all AP/SP points and give you points based on what you spent.
say I have 4000 str, and my 1st job skills are all maxed (say the total of them is 60), and i have 3 unused sp points, itwill give me 63 sp points, and 3996 str (since i have 4 at the beginning)
how can i do that
Re: [Help] Tough NPC coding question.
Firstly, get the current str/dex/int/luk, minus 4 and add that together. That makes your total AP. Easy.
Now for the SP. For each skill the user has (compare it with the job) check how far the skill is filled, add all that together and that will be how much SP points will be returned. AP can be done in MapleCharacter, SP I'm not really sure, but my guess would be somewhere in a file named skill something. Bit of searching will get you there. Good luck!
Re: [Help] Tough NPC coding question.
PHP Code:
function resetS() {
var chr = cm.getPlayer();
var total = chr.getStr() + chr.getDex() + chr.getLuk() + chr.getInt() + chr.getRemainingAp();
total -= 16;
chr.setStr(4);
chr.setDex(4);
chr.setInt(4);
chr.setLuk(4);
chr.setRemainingAp(total);
chr.updateSingleStat(MapleStat.STR, 4);
chr.updateSingleStat(MapleStat.DEX, 4);
chr.updateSingleStat(MapleStat.INT, 4);
chr.updateSingleStat(MapleStat.LUK, 4);
chr.updateSingleStat(MapleStat.AVAILABLEAP, chr.getRemainingAp());
}
cheer
Re: [Help] Tough NPC coding question.
Quote:
Originally Posted by
oxysoft
PHP Code:
function resetS() {
var chr = cm.getPlayer();
var total = chr.getStr() + chr.getDex() + chr.getLuk() + chr.getInt() + chr.getRemainingAp();
total -= 16;
chr.setStr(4);
chr.setDex(4);
chr.setInt(4);
chr.setLuk(4);
chr.setRemainingAp(total);
chr.updateSingleStat(MapleStat.STR, 4);
chr.updateSingleStat(MapleStat.DEX, 4);
chr.updateSingleStat(MapleStat.INT, 4);
chr.updateSingleStat(MapleStat.LUK, 4);
chr.updateSingleStat(MapleStat.AVAILABLEAP, chr.getRemainingAp());
}
cheer
Ty. What about the AP? I think instead of SP spent I can do it per level but idk how to start counting from te fright level