Turn item id magic numbers into constants

This commit is contained in:
P0nk
2021-11-07 11:38:32 +01:00
parent a4c079c2e8
commit 4efd356cbf
50 changed files with 790 additions and 346 deletions

View File

@@ -25,6 +25,7 @@ import client.Character;
import client.Client;
import client.inventory.InventoryType;
import client.inventory.manipulator.InventoryManipulator;
import constants.id.ItemId;
import net.AbstractPacketHandler;
import net.packet.InPacket;
import server.Trade;
@@ -91,11 +92,11 @@ public final class ChangeMapHandler extends AbstractPacketHandler {
if (targetid != -1) {
if (!chr.isAlive()) {
MapleMap map = chr.getMap();
if (wheel && chr.haveItemWithId(5510000, false)) {
if (wheel && chr.haveItemWithId(ItemId.WHEEL_OF_FORTUNE, false)) {
// thanks lucasziron (lziron) for showing revivePlayer() triggering by Wheel
InventoryManipulator.removeById(c, InventoryType.CASH, 5510000, 1, true, false);
chr.sendPacket(PacketCreator.showWheelsLeft(chr.getItemQuantity(5510000, false)));
InventoryManipulator.removeById(c, InventoryType.CASH, ItemId.WHEEL_OF_FORTUNE, 1, true, false);
chr.sendPacket(PacketCreator.showWheelsLeft(chr.getItemQuantity(ItemId.WHEEL_OF_FORTUNE, false)));
chr.updateHp(50);
chr.changeMap(map, map.findClosestPlayerSpawnpoint(chr.getPosition()));