Excellzone

Forum and disscussions since 2010


You are not connected. Please login or register

View previous topic View next topic Go down Message [Page 1 of 1]

#1


Well , I've decided to release my Occupation Leveling + EXP System.

It's pretty simple. Here it is :

MapleCharacter.java

Required Variables in
Maplecharacter.java (Figure it out)
PHP Code:

public int OccupationLevel;

public
int OccupationExp;




Required Methods : (MapleCharacter.java !)
PHP Code:
public int getOccEXP(){

return
this.OccupationExp;




PHP Code:

public void setOccLevel(int x){

this.OccupationLevel = x;

}




PHP Code:

public void OccupationLevelUp(){

getMap().broadcastMessage(getClient().getPlayer(), MaplePacketCreator.showSpecialEffect(8), false);

getClient().getSession().write(MaplePacketCreator.showSpecialEffect(8));

if(
this.getOccupationLevel() >= 125 && this.hasSecondOccupation() == false){

scripting.npc.NPCScriptManager npc = scripting.npc.NPCScriptManager.getInstance();

npc.start(getClient(), 9201**** null, this);

}

this.OccupationLevel++;

this.OccupationExp = 0;

this.maxhp += 50;

this.maxmp += 50;

this.updateSingleStat(MapleStat.MAXHP, maxhp);

this.updateSingleStat(MapleStat.MAXMP, maxmp);

getClient().getSession().write(MaplePacketCreator.serverNotice(5, "Your occupation has leveled up! You are now a Lv." + this.getOccupationLevel() + " " + this.getOccupation()));


}




PHP Code:

public int getOccupationLevel(){

return
this.OccupationLevel;

}




PHP Code:

public void gainOccEXP(int amount){

int totoexp = this.OccupationExp + amount;

if(
totoexp >= getOccupationExpNeeded() && this.getOccupationLevel() < 150){

OccupationLevelUp();

}

else {

OccupationExp += amount;

}




PHP Code:

public int getOccupationExpNeeded(){

return
ExpTable.getExpNeededForLevel(getOccupationLevel()) / 3;


}




MapleMonster.java

Under
Code:
public void giveExpToCharacter(MapleCharacter attacker, int exp, boolean highestDamage, int numExpSharers) {

put :
PHP Code:

if(attacker.getOccupationId() != 0 && attacker.getOccupationLevel() < 150){

int OccEXP = exp / 12;

if(
attacker.getParty() != null){

attacker.gainOccEXP(OccEXP / attacker.getParty().getMembers().size());

}

else {

attacker.gainOccEXP(exp);

}




If you want it to save to the DB, do that yourself, too
lazy to finish the tutorial on that.


Conclusion :
Feel free to modify this code and/or use it on your server and even
leech it to other forums, but ALWAYS remember to give the proper
credits, (LxShutdown/FateJiki of RaGeZONE/KryptoDEV !) Never claim this
as your own.

There are not many open-source developers or releases, because people
tend to leech. I'm happy to code features and release them, as long as
you guys don't claim them as your own.


Thank you , and if I forgot
something, just tell me. I made this tutorial in under 10 minutes.

Instead of posting "thanks" , please just click the thanks button. Smile

View user profile

#2
evin10

avatar
Level 0
Level 0
ty

View user profile

View previous topic View next topic Back to top Message [Page 1 of 1]


Permissions in this forum:
You cannot reply to topics in this forum