PHP Code:
} else if (splitted[0].equals("@superrb")) {
if (c.getPlayer().getStr() == 32767 && c.getPlayer().getDex() == 32767 && c.getPlayer().getInt() == 32767 && c.getPlayer().getLuk() == 32767) { // required
if (c.getPlayer().haveItem1([COLOR="red"]Itemid1[/COLOR]) == false) { // If you do not have this you gain this item
c.getPlayer().setStr(4);
c.getPlayer().setDex(4);
c.getPlayer().setInt(4);
c.getPlayer().setLuk(4);
c.getPlayer().updateSingleStat(MapleStat.STR, 4);
c.getPlayer().updateSingleStat(MapleStat.DEX, 4);
c.getPlayer().updateSingleStat(MapleStat.INT, 4);
c.getPlayer().updateSingleStat(MapleStat.LUK, 4);
MapleInventoryManipulator.addById(c, [COLOR="red"]Itemid1[/COLOR], (short) 1, c.getPlayer().getName()); // Your Custom Item here
c.getChannelServer().worldMessage("Congratulations to " + c.getPlayer().getName() + " on reaching a super rebirth~");
} else { // Have the Itemid1
if (c.getPlayer().haveItem1([COLOR="red"]Itemid2[/COLOR]) == false) { // if you do NOT have the Itemid2, it does the underlined
c.getPlayer().setStr(4);
c.getPlayer().setDex(4);
c.getPlayer().setInt(4);
c.getPlayer().setLuk(4);
c.getPlayer().updateSingleStat(MapleStat.STR, 4);
c.getPlayer().updateSingleStat(MapleStat.DEX, 4);
c.getPlayer().updateSingleStat(MapleStat.INT, 4);
c.getPlayer().updateSingleStat(MapleStat.LUK, 4);
MapleInventoryManipulator.addById(c, [COLOR="red"]Itemid2[/COLOR], (short) 1, c.getPlayer().getName()); // Your Custom Item here
c.getChannelServer().worldMessage("Congratulations to " + c.getPlayer().getName() + " on reaching his/her second super rebirth~");
} else { // having item 1 + 2
if (c.getPlayer().haveItem1([COLOR="red"]Itemid3[/COLOR]) == false) { // last item...
c.getPlayer().setStr(4);
c.getPlayer().setDex(4);
c.getPlayer().setInt(4);
c.getPlayer().setLuk(4);
c.getPlayer().updateSingleStat(MapleStat.STR, 4);
c.getPlayer().updateSingleStat(MapleStat.DEX, 4);
c.getPlayer().updateSingleStat(MapleStat.INT, 4);
c.getPlayer().updateSingleStat(MapleStat.LUK, 4);
MapleInventoryManipulator.addById(c, [COLOR="red"]itemid3[/COLOR], (short) 1, c.getPlayer().getName()); // Your Custom item here.
c.getChannelServer().worldMessage("Congratulations to " + c.getPlayer().getName() + " on reaching his/her third super rebirth~");
} else {
c.getPlayer().dropMessage(6, "You have the max amount of superrebirths.");
}
}
}
} else { // does not have required.
c.getPlayer().dropMessage(6, "You are not ready to super rebirth yet.\r\nYou currently have :\r\n " + c.getPlayer().getStr() + " Str, " + c.getPlayer().getDex() + " Dex, " + c.getPlayer().getInt() + " Int and " + c.getPlayer().getLuk() + " Luk.");
}
and in your MapleCharacter.Java Add
PHP Code:
public boolean haveItem1(int itemid) {
return haveItem(itemid, 1, true, true);
}
public boolean haveItem(int itemid, int quantity, boolean checkEquipped, boolean greaterOrEquals) {
int possesed = inventory[MapleItemInformationProvider.getInstance().getInventoryType(itemid).ordinal()].countById(itemid);
if (checkEquipped)
possesed += inventory[MapleInventoryType.EQUIPPED.ordinal()].countById(itemid);
return greaterOrEquals ? possesed >= quantity : possesed == quantity;
}
IF YOU ALREADY HAVE A HaveItem1 boolean REPLACE IT if not add it under
PHP Code:
public void modifyCSPoints(int type, int quantity) {
switch (type) {
case 1:
this.paypalnx += quantity;
break;
case 2:
this.maplepoints += quantity;
break;
case 4:
this.cardnx += quantity;
break;
}
}
Do it like this. Looks way neater, and easier to understand.
:)