Gm scrolls work, don't take slots.

Status
Not open for further replies.
Newbie Spellweaver
Joined
Jun 22, 2008
Messages
36
Reaction score
0
I've seen a few people asking for this, so I'll post it again. It makes it so that when GM's scroll, it always works and doesn't take slots.

In ScrollHandler.java, which is located in net.sf.odinms.net.channel.handler, find these lines:
if (scroll.getQuantity() <= 0) {
throw new InventoryException("<= 0 quantity when scrolling");
}
Below that, add this line:
boolean checkIfGM = c.getPlayer().isGM();
---------------------------------------------------------------------------------------------

In the same file, find this line (right below the edit you just made):
IEquip scrolled = (IEquip) ii.scrollEquipWithId(toScroll, scroll.getItemId(), whiteScroll);
Change it to this (the modified part is bolded):
IEquip scrolled = (IEquip) ii.scrollEquipWithId(toScroll, scroll.getItemId(), whiteScroll, checkIfGM);
---------------------------------------------------------------------------------------------

In MapleItemInformationProvider.java, which is located in net.sf.odinms.server, find this line:
public IItem scrollEquipWithId(IItem equip, int scrollId, boolean usingWhiteScroll) {
Change it to this (modified part in bold):
public IItem scrollEquipWithId(IItem equip, int scrollId, boolean usingWhiteScroll, boolean checkIfGM) {
---------------------------------------------------------------------------------------------

Also in MapleItemInformationProvider.java, find this line (a couple of lines down):
if (nEquip.getUpgradeSlots() > 0 && Math.ceil(Math.random() * 100.0) <= stats.get("success")) {
Change that to this:
if (nEquip.getUpgradeSlots() > 0 && ((Math.ceil(Math.random() * 100.0) <= stats.get("success")) || (checkIfGM == true))) {
---------------------------------------------------------------------------------------------
Last thing, also in MapleItemInformationProvider.java, find this
Find
nEquip.setUpgradeSlots((byte) (nEquip.getUpgradeSlots() - 1));
nEquip.setLevel((byte) (nEquip.getLevel() + 1));

Replace it with this
if (checkIfGM == false) {
nEquip.setUpgradeSlots((byte) (nEquip.getUpgradeSlots() - 1));
}
nEquip.setLevel((byte) (nEquip.getLevel() + 1));

Credits to Sathon for the thing I based this on:
http://forum.ragezone.com/showthread.php?t=407179

Hopefully, someone notices that lovely link in my sig ;)
 
Re: [Re-Release] Gm scrolls work, don't take slots.

could you tell me how to make it so gms lose slots aswell

thanks
 
Status
Not open for further replies.
Back