[Release]@Rebirth command (0.61)
- Reborns Function *IMPORTANT* - (Must add this first)
Open MapleCharacter.java.
Ctrl + F and search for :
PHP Code:
private int level;
Under it, add :
PHP Code:
private int reborns;
Ctrl + F and search for :
PHP Code:
ret.level = rs.getInt("level");
Under it add :
PHP Code:
ret.reborns = rs.getInt("reborns");
Ctrl + F and search for :
Under it add :
PHP Code:
ret.reborns = 0;
Ctrl + F and find something that looks like this:
PHP Code:
if (update) {
ps = con.prepareStatement("UPDATE characters SET level = ?, fame = ?, str = ?, dex = ?, luk = ?, `int` = ?, exp = ?, hp = ?, mp = ?, maxhp = ?, maxmp = ?, sp = ?, ap = ?, gm = ?, skincolor = ?, gender = ?, job = ?, hair = ?, face = ?, map = ?, meso = ?, hpApUsed = ?, mpApUsed = ?, spawnpoint = ?, party = ?, buddyCapacity = ?, messengerid = ?,[B] messengerposition = ?[/B] , WHERE id = ?");
} else {
ps = con.prepareStatement("INSERT INTO characters (level, fame, str, dex, luk, `int`, exp, hp, mp, maxhp, maxmp, sp, ap, gm, skincolor, gender, job, hair, face, map, meso, hpApUsed, mpApUsed, spawnpoint, party, buddyCapacity, messengerid, [B]messengerposition, [/B]accountid, name, world) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
}
After the first bolded part, add in:
After the second bolded part, add in:
Ctrl + F and search find some thing that look like this :
PHP Code:
if (update) {
ps.setInt(29, id);
} else {
ps.setInt(29, accountid);
ps.setString(30, name);
ps.setInt(31, world); // TODO store world somewhere ;)
}
and replace this part soo it will be look like this:
PHP Code:
if (update) {
ps.setInt(29, id);
} else {
ps.setInt(29, accountid);
ps.setString(30, name);
ps.setInt(31, world); // TODO store world somewhere ;)
ps.setInt(32, reborns);
}
Ctrl + F and search :
PHP Code:
public int getLevel() {
return level;
}
Under it add :
PHP Code:
public int getReborns() {
return reborns;
}
Finally, Ctrl + F and search :
PHP Code:
public void setLevel(int level) {
this.level = level-1;
}
Under it add:
PHP Code:
public void setReborns(int reborns) {
this.reborns = reborns;
}
Compile and you're done !!!
and the command
add this import:
PHP Code:
import net.sf.odinms.client.MapleJob;
add this in the end of PlayerCommands.java :
PHP Code:
}
} else if (splitted[0].equals("@rebirth")) {
int negexp;
if (c.getPlayer().getLevel() >= 200) {
c.getPlayer().setLevel(1);
c.getPlayer().setReborns(c.getPlayer().getReborns( ) + 1);
c.getPlayer().changeJob(MapleJob.getById(0));
negexp = c.getPlayer().getExp();
c.getPlayer().gainExp(-negexp, false, false); // Fixes negative exp
c.getPlayer().updateSingleStat(MapleStat.EXP, c.getPlayer().getExp());
} else {
mc.dropMessage("Train harder and get to level 200.");
}
}
}
and this at the end of the file too:
PHP Code:
new CommandDefinition("rebirth", "", "reborn!!", 0),
and last run this sql (if you already have this you dont have to run it)
PHP Code:
ALTER TABLE `characters` ADD COLUMN `reborns` int(11) NOT NULL default '0' AFTER `messengerposition`
and if you do all fine it shuold work :)
all the credt go to this man:
xazerrx
orginal script: http://forum.ragezone.com/f427/relea...st-see-471853/
airflow0
http://forum.ragezone.com/f427/relea...d-odin-427589/
i just change some lines and that it
Re: [Release]@Rebirth command (0.61)
and you should give credits to airflow0 too..
for releasing real reborn method
Re: [Release]@Rebirth command (0.61)
Re: [Release]@Rebirth command (0.61)
wont this work for 0.60 too
Re: [Release]@Rebirth command (0.61)
yea i think soo but I tested it 0.61 only soo I dont know but it work for 0.60 too
Re: [Release]@Rebirth command (0.61)
not working
the command works but the reborn times is not getting saved in the db
nvm fixed :D
oh and ty felixxex
Re: [Release]@Rebirth command (0.61)
Re: [Release]@Rebirth command (0.61)
People are seriously getting more stupid than before..
Releasing something that was release so many times?
Rebirth doesnt care about the version..
Things like this doesnt even have special packets or etc..
So whats the point?
Dont post this when its almost 90% the same as the others..
And where the bolded part? You copied the whole thing... Except for the command part..
And
Code:
if (update) {
ps.setInt(29, id);
} else {
ps.setInt(29, accountid);
ps.setString(30, name);
ps.setInt(31, world); // TODO store world somewhere ;)
ps.setInt(32, reborns);
}
Wont that be saving the wrong thing?
Based on what you typed... It should be
Code:
ps.setInt(29, reborns);
Isnt it?
And one more thing.. Stop spaming posts by saying nice release / great release without even seeing what it is please
Re: [Release]@Rebirth command (0.61)
PHP Code:
if (update) {
ps.setInt(29, reborns);
ps.setInt(30, id);
} else {
ps.setInt(30, accountid);
ps.setString(31, name);
ps.setInt(32, world); // TODO store world somewhere ;)
}
Why isnt reborns in the update section ?, I'm almost certain it wont save on exit.
PHP Code:
public void setReborns(int reborns) {
this.reborns += reborns;
}
Might aswell add + to the = so you wont have to call getReborns() in the command.
PHP Code:
} else if (splitted[0].equals("@rebirth")) {
int negexp = c.getPlayer().getExp();
if (c.getPlayer().getLevel() >= 200) {
c.getPlayer().setLevel(2);
c.getPlayer().setReborns(1);
c.getPlayer().changeJob(MapleJob.getById(0));
if (negexp < 0)
c.getPlayer().gainExp(-negexp, false, false); // Fixes negative exp
c.getPlayer().updateSingleStat(MapleStat.EXP, c.getPlayer().getExp());
} else {
mc.dropMessage("Train harder and get to level 200.");
}
}
}
What if the player doesnt have negative exp ?,
Re: [Release]@Rebirth command (0.61)
Look at wat it says at the negative exp.. If (negexp < 0)
And..
Code:
public void setReborns(int reborns) {
this.reborns += reborns;
}
It should be addReborns instead of set
Re: [Release]@Rebirth command (0.61)
Quote:
Originally Posted by
Xerixe
Look at wat it says at the negative exp.. If (negexp < 0)
I actually put that. His script doesnt have it -- All those scripts I just posted were the fixed version
Quote:
Originally Posted by
Xerixe
public void setReborns(int reborns) {
this.reborns += reborns;
}
It should be addReborns instead of set
Does it matter ? It does exactly the same thing
Re: [Release]@Rebirth command (0.61)
Define set and add..
And since rebirth makes you level 1
Code:
c.getPlayer().setLevel(1);
Using that would make you level 0.
It should be
Code:
c.getPlayer().setLevel(2);
Oh and i just remembered. Why should it have negative exp fix? When you rebirth / reborn your suppose to have 0 exp..
Here's a better command.
Code:
} else if (splitted[0].equals("@rebirth")) {
int negexp;
if (c.getPlayer().getLevel() >= 200) {
c.getPlayer().setLevel(2);
c.getPlayer().setReborns(c.getPlayer().getReborns( ) + 1);
c.getPlayer().changeJob(MapleJob.getById(0));
c.getPlayer().setExp(0);
c.getPlayer().updateSingleStat(MapleStat.EXP, c.getPlayer().getExp());
} else {
mc.dropMessage("Train harder and get to level 200.");
}
}
}
Re: [Release]@Rebirth command (0.61)
Quote:
Originally Posted by
Xerixe
Define set and add..
And since rebirth makes you level 1
Code:
c.getPlayer().setLevel(1);
Using that would make you level 0.
It should be
Code:
c.getPlayer().setLevel(2);
Oh and i just remembered. Why should it have negative exp fix? When you rebirth / reborn your suppose to have 0 exp..
Here's a better command.
Code:
} else if (splitted[0].equals("@rebirth")) {
int negexp;
if (c.getPlayer().getLevel() >= 200) {
c.getPlayer().setLevel(2);
c.getPlayer().setReborns(c.getPlayer().getReborns( ) + 1);
c.getPlayer().changeJob(MapleJob.getById(0));
c.getPlayer().setExp(0);
c.getPlayer().updateSingleStat(MapleStat.EXP, c.getPlayer().getExp());
} else {
mc.dropMessage("Train harder and get to level 200.");
}
}
}
You are one picky guy --.. Tell me, does the function setReborns() and AddReborns() make a difference if the body is the same.
Since you're so picky here's an example.
Quote:
c.getPlayer().updateSingleStat(MapleStat.EXP, c.getPlayer().getExp()); <-- Your script
Quote:
c.getPlayer().updateSingleStat(MapleStat.EXP, 0); <-- Mine
Does it make a difference ? No buddy.
Re: [Release]@Rebirth command (0.61)
Of course there is. You didnt set the exp to 0?
And you want to update it with 0?
So this is better
Code:
c.getPlayer().updateSingleStat(MapleStat.EXP, c.getPlayer().getExp());
Lol. And you changed your command after i say set level should be 2?
Lol XD....
And as for set and add there is. Lets say you have a reborn cap and a persons already at the max.
And you're lazy to rebirth the person. You can make a command to set his reborns to 0. =)
Re: [Release]@Rebirth command (0.61)
well i tested it fulley and it works but doesnt save
soo or someone fix it i dont have time
and my computer with the server files are at fixes soo
someone fix it and i will edit and give credits