- Joined
- Dec 4, 2010
- Messages
- 48
- Reaction score
- 8
This is my first release, and quite simple. Please don't flame.
This code will make it so that every few levels of your designation the player will receive an item / some items.
Credits:
Me (barely)
BloodAngel13 & NemesisToKill for helping me
RpViet for trying to help, but giving inaccurate info
This code will make it so that every few levels of your designation the player will receive an item / some items.
Open MapleCharacter.java.
In between
and
paste this:
to customize the item ID, just change
in
to whatever you want. change the last number (75 in this case) to the amount you want.
if you want more consecutive levels, just copy and paste the else if and modify the values. example:
Edit:
actually, where i put it, you have to put the level before. 24 to gain it on level 25, 74 on 75, etc.
In between
Code:
public void levelUp(boolean takeexp) {
ISkill improvingMaxHP = null;
ISkill improvingMaxMP = null;
int improvingMaxHPLevel = 0;
int improvingMaxMPLevel = 0;
Code:
if (isBeginnerJob()) {
remainingAp = 0;
if (getLevel() < 6) {
str += 5;
} else {
str += 4;
dex += 1;
}
} else {
remainingAp += 5;
if (isCygnus() && level < 70) {
remainingAp++;
}
}
if (job == MapleJob.BEGINNER || job == MapleJob.NOBLESSE || job == MapleJob.LEGEND) {
maxhp += Randomizer.rand(12, 16);
maxmp += Randomizer.rand(10, 12);
} else if (job.isA(MapleJob.WARRIOR) || job.isA(MapleJob.DAWNWARRIOR1)) {
improvingMaxHP = isCygnus() ? SkillFactory.getSkill(DawnWarrior.MAX_HP_INCREASE) : SkillFactory.getSkill(Swordsman.IMPROVED_MAX_HP_INCREASE);
if (job.isA(MapleJob.CRUSADER)) {
improvingMaxMP = SkillFactory.getSkill(1210000);
} else if (job.isA(MapleJob.DAWNWARRIOR2)) {
improvingMaxMP = SkillFactory.getSkill(11110000);
}
improvingMaxHPLevel = getSkillLevel(improvingMaxHP);
maxhp += Randomizer.rand(24, 28);
maxmp += Randomizer.rand(4, 6);
} else if (job.isA(MapleJob.MAGICIAN) || job.isA(MapleJob.BLAZEWIZARD1)) {
improvingMaxMP = isCygnus() ? SkillFactory.getSkill(BlazeWizard.INCREASING_MAX_MP) : SkillFactory.getSkill(Magician.IMPROVED_MAX_MP_INCREASE);
improvingMaxMPLevel = getSkillLevel(improvingMaxMP);
maxhp += Randomizer.rand(10, 14);
maxmp += Randomizer.rand(22, 24);
} else if (job.isA(MapleJob.BOWMAN) || job.isA(MapleJob.THIEF) || (job.getId() > 1299 && job.getId() < 1500)) {
maxhp += Randomizer.rand(20, 24);
maxmp += Randomizer.rand(14, 16);
} else if (job.isA(MapleJob.GM)) {
maxhp = 30000;
maxmp = 30000;
} else if (job.isA(MapleJob.PIRATE) || job.isA(MapleJob.THUNDERBREAKER1)) {
improvingMaxHP = isCygnus() ? SkillFactory.getSkill(ThunderBreaker.IMPROVE_MAX_HP) : SkillFactory.getSkill(5100000);
improvingMaxHPLevel = getSkillLevel(improvingMaxHP);
maxhp += Randomizer.rand(22, 28);
maxmp += Randomizer.rand(18, 23);
} else if (job.isA(MapleJob.ARAN1)) {
maxhp += Randomizer.rand(44, 48);
int aids = Randomizer.rand(4, 8);
maxmp += aids + Math.floor(aids * 0.1);
}
if (improvingMaxHPLevel > 0 && (job.isA(MapleJob.WARRIOR) || job.isA(MapleJob.PIRATE) || job.isA(MapleJob.DAWNWARRIOR1))) {
maxhp += improvingMaxHP.getEffect(improvingMaxHPLevel).getX();
}
if (improvingMaxMPLevel > 0 && (job.isA(MapleJob.MAGICIAN) || job.isA(MapleJob.CRUSADER) || job.isA(MapleJob.BLAZEWIZARD1))) {
maxmp += improvingMaxMP.getEffect(improvingMaxMPLevel).getX();
}
maxmp += localint_ / 10;
if (takeexp) {
exp.addAndGet(-ExpTable.getExpNeededForLevel(level));
if (exp.get() < 0) {
exp.set(0);
}
}
level++;
if (level >= getMaxLevel()) {
exp.set(0);
}
maxhp = Math.min(30000, maxhp);
maxmp = Math.min(30000, maxmp);
if (level == 200) {
exp.set(0);
}
hp = maxhp;
mp = maxmp;
recalcLocalStats();
List<Pair<MapleStat, Integer>> statup = new ArrayList<Pair<MapleStat, Integer>>(10);
statup.add(new Pair<MapleStat, Integer>(MapleStat.AVAILABLEAP, remainingAp));
statup.add(new Pair<MapleStat, Integer>(MapleStat.HP, localmaxhp));
statup.add(new Pair<MapleStat, Integer>(MapleStat.MP, localmaxmp));
statup.add(new Pair<MapleStat, Integer>(MapleStat.EXP, exp.get()));
statup.add(new Pair<MapleStat, Integer>(MapleStat.LEVEL, level));
statup.add(new Pair<MapleStat, Integer>(MapleStat.MAXHP, maxhp));
statup.add(new Pair<MapleStat, Integer>(MapleStat.MAXMP, maxmp));
statup.add(new Pair<MapleStat, Integer>(MapleStat.STR, str));
statup.add(new Pair<MapleStat, Integer>(MapleStat.DEX, dex));
if (job.getId() % 1000 > 0) {
remainingSp += 3;
statup.add(new Pair<MapleStat, Integer>(MapleStat.AVAILABLESP, remainingSp));
}
client.announce(MaplePacketCreator.updatePlayerStats(statup));
getMap().broadcastMessage(this, MaplePacketCreator.showForeignEffect(getId(), 0), false);
recalcLocalStats();
silentPartyUpdate();
if (this.guildid > 0) {
getGuild().broadcast(MaplePacketCreator.levelUpMessage(2, level, name), this.getId());
}
if (MapleInventoryManipulator.checkSpace(client, 4310000, (short) 1, "")) MapleInventoryManipulator.addById(client, 4310000, (short) 1);
guildUpdate();
if (ServerConstants.GMS_LIKE) saveToDB(true);
}
Code:
if (getLevel() == 24) {
server.MapleInventoryManipulator.addById(getClient(), 4030002, (short)75);
} else if (getLevel() == 49) {
server.MapleInventoryManipulator.addById(getClient(), 4030002, (short)125);
}
Code:
4030002
Code:
server.MapleInventoryManipulator.addById(getClient(), 4030002, (short)75);
if you want more consecutive levels, just copy and paste the else if and modify the values. example:
Code:
if (getLevel() == 24) {
server.MapleInventoryManipulator.addById(getClient(), 4030002, (short)75);
} else if (getLevel() == 49) {
server.MapleInventoryManipulator.addById(getClient(), 4030002, (short)125);
} else if (getLevel() == 74) {
server.MapleInventoryManipulator.addById(getClient(), 4030002, (short)200);
} else if (getLevel() == 99) {
server.MapleInventoryManipulator.addById(getClient(), 4030002, (short)300);
} else if (getLevel() == 124) {
server.MapleInventoryManipulator.addById(getClient(), 4030002, (short)425);
} else if (getLevel() == 149) {
server.MapleInventoryManipulator.addById(getClient(), 4030002, (short)550);
} else if (getLevel() == 174) {
server.MapleInventoryManipulator.addById(getClient(), 4030002, (short)700);
} else if (getLevel() == 199) {
server.MapleInventoryManipulator.addById(getClient(), 4030002, (short)850);
}
actually, where i put it, you have to put the level before. 24 to gain it on level 25, 74 on 75, etc.
Credits:
Me (barely)
BloodAngel13 & NemesisToKill for helping me
RpViet for trying to help, but giving inaccurate info
Last edited: