Newbie Spellweaver
- Joined
- Dec 21, 2009
- Messages
- 43
- Reaction score
- 9
open maplecharacter.java
Add this anywhere
find
below It Put
For Add Buddy And Gain Medal Open BuddylistModifyHandler.java
find
Below it Put
Add this anywhere
PHP:
public boolean gainItem(int id, short quantity, boolean randomStats, boolean show) {
if (quantity >= 0) {
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
IItem item = ii.getEquipById(id);
MapleInventoryType type = ii.getInventoryType(id);
if (type.equals(MapleInventoryType.EQUIP) && !ii.isThrowingStar(item.getItemId()) && !ii.isBullet(item.getItemId())) {
if (!getInventory(type).isFull()) {
if (randomStats) {
MapleInventoryManipulator.addFromDrop(getClient(), ii.randomizeStats(getClient(), (Equip) item), false);
} else {
MapleInventoryManipulator.addFromDrop(getClient(), (Equip) item, false);
}
} else {
dropMessage(1, "Your inventory is full. Please remove an item from your " + type.name().toLowerCase() + " inventory.");
return false;
}
} else if (MapleInventoryManipulator.checkSpace(getClient(), id, quantity, "")) {
if (id >= 5000000 && id <= 5000100) {
if (quantity > 1) {
quantity = 1;
}
int petId = MaplePet.createPet(id);
MapleInventoryManipulator.addById(getClient(), id, (short) 1, null, petId);
if (show) {
this.getClient().getSession().write(MaplePacketCreator.getShowItemGain(id, quantity));
}
} else {
MapleInventoryManipulator.addById(getClient(), id, quantity, "");
}
} else {
dropMessage(1, "Your inventory is full. Please remove an item from your " + type.name().toLowerCase() + " inventory.");
return false;
}
if (show) {
this.getClient().getSession().write(MaplePacketCreator.getShowItemGain(id, quantity, true));
}
} else {
MapleInventoryManipulator.removeById(getClient(), MapleItemInformationProvider.getInstance().getInventoryType(id), id, -quantity, false, false);
}
return true;
}
find
PHP:
setHp(maxhp);
setMp(maxmp);
client.getSession().write(MaplePacketCreator.updatePlayerStats(statup));
getMap().broadcastMessage(this, MaplePacketCreator.showForeignEffect(getId(), 0), false);
recalcLocalStats();
silentPartyUpdate();
guildUpdate();
below It Put
PHP:
if (level == 10 && isCygnus()) {
this.gainItem(1142066, (short) 1, false, false);
dropMessage("You have obtained an Training Knight Medal for reaching level 10");
}
if (level == 30 && isCygnus()) {
this.gainItem(1142067, (short) 1, false, false);
dropMessage("You have obtained an Official Cygnus Medal for reaching level 30");
}
if (level == 70 && isCygnus()) {
this.gainItem(1142068, (short) 1, false, false);
dropMessage("You have obtained an Advanced Cygnus Medal for reaching level 70");
}
if (level == 120 && isCygnus()) {
this.gainItem(1142069, (short) 1, false, false);
dropMessage("You have obtained a Captain Knight Medal for reaching level 120");
}
}
For Add Buddy And Gain Medal Open BuddylistModifyHandler.java
find
PHP:
c.getSession().write(MaplePacketCreator.updateBuddylist(buddylist.getBuddies()));
Below it Put
PHP:
if (!c.getPlayer().haveItem(1142073, 1, true, true)) {
c.getPlayer().gainItem(1142073, (short) 1, false, false);
c.getPlayer().dropMessage("You have obtained the 'Be my Friend Medal'");
Last edited: