[HELP] Reborn without stats reset
Hello,
I found here this script for reborn:
PHP Code:
public void doRebornExplorer() {
setReborns(getReborns() + 1);
List<Pair<MapleStat, Integer>> reborn = new ArrayList<Pair<MapleStat, Integer>>(4);
setLevel(1);
setExp(0);
setJob(MapleJob.BEGINNER);
}
And the NPC execute this 'public'. and resets job, level and status, but I don't want reset status.
Could someone help me?
Thanks.
Re: [HELP] Reborn without stats reset
Which repack do you use?
Can you show me the NPC script?
Re: [HELP] Reborn without stats reset
I don't understand what you mean by "status".
If you meant stats, then show the NPC script. Commonly, the function used would be resetAllStats. Some repacks don't use that however! So, it could be...
PHP Code:
cm.getPlayer().setStr(4);
cm.getPlayer().setDex(4);
cm.getPlayer().setInt(4);
cm.getPlayer().setLuk(4);
Re: [HELP] Reborn without stats reset
@above He said he DOESN'T want to reset the stats.
OT: This is not the complete code. I mean, the variable 'reborn' is what's used to reset the stats, but I don't see any piece of code to assign stats to that variable or assign the stats to the player.
Complete code, please.
Re: [HELP] Reborn without stats reset
PHP Code:
List<Pair<MapleStat, Integer>> reborn = new ArrayList<Pair<MapleStat, Integer>>(4);
Well, I know this means that it changes the AP to 4 so..I guess you should just remove this part? or change it aleast.
Edit: Fuck, I'm an idiot.
Re: [HELP] Reborn without stats reset
Quote:
Originally Posted by
TestMS
PHP Code:
List<Pair<MapleStat, Integer>> reborn = new ArrayList<Pair<MapleStat, Integer>>(4);
Well, I know this means that it changes the AP to 4 so..I guess you should just remove this part? or change it aleast.
What the hell are you talking about...
Re: [HELP] Reborn without stats reset
Quote:
Originally Posted by
TestMS
PHP Code:
List<Pair<MapleStat, Integer>> reborn = new ArrayList<Pair<MapleStat, Integer>>(4);
Well, I know this means that it changes the AP to 4 so..I guess you should just remove this part? or change it aleast.
That doesn't do anything unless he's using the variable reborn in his reborn
Re: [HELP] Reborn without stats reset
Quote:
Originally Posted by
TestMS
PHP Code:
List<Pair<MapleStat, Integer>> reborn = new ArrayList<Pair<MapleStat, Integer>>(4);
Well, I know this means that it changes the AP to 4 so..I guess you should just remove this part? or change it aleast.
That's actually not what that code does. That code is unused, at least, as far as I can tell. He creates an ArrayList of Pairs of MapleStats and Integers, which you presume would be to update stats. He calls the constructor for ArrayList that includes a supplied initial capacity of 4. However, he never adds any entries to the List. Nothing is ever done with it. It just is assigned to reborn, a variable also being declared in the scope of this method. Once the method reaches it's end, the object is destroyed by the garbage collector (or eventually is, anyway).
Now, on topic, I'm not completely sure if this will work, but you can try it: (It assumes this method is in MapleCharacter, which it should be)
PHP Code:
public void doRebornExplorer() {
setReborns(getReborns() + 1);
List<Pair<MapleStat, Integer>> initialStats = new ArrayList<Pair<MapleStat, Integer>>(4);
initialStats.add(new Pair<MapleStat, Integer>(MapleStat.STR, str));
initialStats.add(new Pair<MapleStat, Integer>(MapleStat.DEX, dex));
initialStats.add(new Pair<MapleStat, Integer>(MapleStat.INT, int_));
initialStats.add(new Pair<MapleStat, Integer>(MapleStat.LUK, luk));
setLevel(1);
setExp(0);
setJob(MapleJob.BEGINNER);
for (int i = 0; i < intialStats.size(); i++) {
updateSingleStat(initialStats.get(i).getLeft(), initialStats.get(i).getRight());
}
}
EDIT: Got ninja'd twice on the first part because I was writing a possible solution. Ah well.
Re: [HELP] Reborn without stats reset
But how can I make all the stats become AP?
Thanks to all :D.
Re: [HELP] Reborn without stats reset
What do you mean? You want that when a player does reborn and for example he have 304 str, 104 dex, 104 luk, 104 int than is stats will become 4, 4, 4, 4 and he will have 600 AP to add?
Re: [HELP] Reborn without stats reset
But stats don't became AP.
Re: [HELP] Reborn without stats reset
I'm asking you what do you want that will happen -.-
If you tell me what you want, it will be easier to help you ...
Re: [HELP] Reborn without stats reset
I want that player becomes level and job 0 and all stats becomes AP.
Re: [HELP] Reborn without stats reset
Great!
Which repack do you use?
Re: [HELP] Reborn without stats reset
Quote:
Originally Posted by
AngryPepe
Great!
Which repack do you use?
MoopleDEV