Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Help] Tough NPC coding question. Web 

Newbie Spellweaver
Joined
Dec 31, 2012
Messages
28
Reaction score
0
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
 
butt > Tits
Loyal Member
Joined
Feb 16, 2009
Messages
658
Reaction score
96
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!
 
Upvote 0
Custom Title Activated
Loyal Member
Joined
Nov 14, 2008
Messages
1,025
Reaction score
641
PHP:
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
 
Upvote 0
Newbie Spellweaver
Joined
Dec 31, 2012
Messages
28
Reaction score
0
PHP:
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
 
Upvote 0
Back
Top