Created
March 16, 2014 20:20
Revisions
-
oxysoft created this gist
Mar 16, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,44 @@ /* This file is part of the OdinMS Maple Story Server Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc> Matthias Butz <matze@odinms.de> Jan Christian Meyer <vimes@odinms.de> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation version 3 as published by the Free Software Foundation. You may not use, modify or distribute this program under any other version of the GNU Affero General Public License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ package handling.channel; import client.MapleCharacter; import client.MapleClient; import client.inventory.Item; import client.inventory.MapleInventoryType; import handling.AbstractMaplePacketHandler; import server.MapleInventoryManipulator; import server.maps.FieldLimit; import server.maps.MapleMap; import tools.data.input.SeekableLittleEndianAccessor; import tools.packets.CWvsContext_OnPacket; /* * @author sunnyboy */ public final class TeleportRock extends AbstractMaplePacketHandler { @Override public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {byte slot = (byte) slea.readShort();int itemId = slea.readInt();Item TeleportRock = c.getPlayer().getInventory(MapleInventoryType.CASH).getItem(slot);if (TeleportRock.getQuantity() < 1 || TeleportRock == null || TeleportRock.getItemId() != itemId) {c.announce(CWvsContext_OnPacket.enableActions());return;}byte rocktype = slea.readByte();if (rocktype == 0) {MapleMap target = c.getChannelServer().getMapFactory().getMap(slea.readInt());if (!FieldLimit.VipRock.check(c.getPlayer().getMap().getFieldLimit()) && !FieldLimit.VipRock.check(target.getFieldLimit())) {c.getPlayer().changeMap(target, target.getPortal(0));MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.CASH, slot, (short) 1, false);}}} }