Yup, releasing this to piss of Supi, I made this before him but he's remaking and wants to release,s o I stole his glory.
First run this SQL
[code]Code:DROP TABLE IF EXISTS `trocklocations`; CREATE TABLE `trocklocations` ( `trockid` int(11) NOT NULL auto_increment, `characterid` int(11) NOT NULL, `mapid` int(11) NOT NULL, PRIMARY KEY (`trockid`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Add this in MaplePacketCreator
Add this in sendopsCode:public static MaplePacket TrockRefreshMapList(int characterid, boolean vip) { MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(); Connection con = DatabaseConnection.getConnection(); mplew.writeShort(SendPacketOpcode.TROCK_LOCATIONS.getValue()); mplew.write(3); // unknown at this point mplew.write(vip ? 1: 0); try { PreparedStatement ps = con.prepareStatement("SELECT mapid FROM trocklocations WHERE characterid = ? LIMIT 10"); ps.setInt(1, characterid); ResultSet rs = ps.executeQuery(); while (rs.next()) { mplew.writeInt(rs.getInt("mapid")); } rs.close(); ps.close(); } catch (SQLException se) { } return mplew.getPacket(); }
this in recvopsCode:TROCK_LOCATIONS = 0x27
Add them to the sendops/recvops javas tooCode:TROCK_ADD_MAP = 0x5E
Make this new handler in the channel packet handlers
You can find out the name of the file yourself.Code:/* 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 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 net.sf.odinms.net.channel.handler; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import net.sf.odinms.client.MapleClient; import net.sf.odinms.database.DatabaseConnection; import net.sf.odinms.net.AbstractMaplePacketHandler; import net.sf.odinms.tools.MaplePacketCreator; import net.sf.odinms.tools.data.input.SeekableLittleEndianAccessor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * * @author Matze */ public class TrockAddMapHandler extends AbstractMaplePacketHandler { private static Logger log = LoggerFactory.getLogger(TrockAddMapHandler.class); public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) { Connection con = DatabaseConnection.getConnection(); byte addrem; addrem = slea.readByte(); slea.readByte(); if (addrem == 0x03) { //delete int mapId = slea.readInt(); try { PreparedStatement ps = con.prepareStatement("DELETE FROM trocklocations WHERE characterid = ? AND mapid = ?"); ps.setInt(1, c.getPlayer().getId()); ps.setInt(2, mapId); ps.executeUpdate(); ps.close(); } catch (SQLException se) { log.error("SQL error: " + se.getLocalizedMessage(), se); } c.getSession().write(MaplePacketCreator.TrockRefreshMapList(c.getPlayer().getId(), true)); } else if (addrem == 0x01) { try { PreparedStatement ps = con.prepareStatement("insert into trocklocations (characterid, mapid) VALUES (?, ?)"); ps.setInt(1, c.getPlayer().getId()); ps.setInt(2, c.getPlayer().getMapId()); ps.executeUpdate(); ps.close(); } catch (SQLException se) { log.error("SQL error: " + se.getLocalizedMessage(), se); } c.getSession().write(MaplePacketCreator.TrockRefreshMapList(c.getPlayer().getId(), true)); } } }
Then register the handler in PacketProccessor
And then add this in usecashitemhandler
Code:} else if (itemType == 504) { // vip teleport rock byte rocktype; rocktype = slea.readByte(); MapleInventoryManipulator.removeById(c, MapleInventoryType.CASH, itemId, 1, true, false); if (rocktype == 0x00) { int mapId = slea.readInt(); MapleMap target = c.getChannelServer().getMapFactory().getMap(mapId); MaplePortal targetPortal = target.getPortal(0); if (target.getForcedReturnId() == 999999999) { //Makes sure this map doesn't have a forced return map c.getPlayer().changeMap(target, targetPortal); } else { MapleInventoryManipulator.addById(c, itemId, (short)1, "Teleport Rock Error (Not found)"); new ServernoticeMapleClientMessageCallback(1, c).dropMessage("Either the player could not be found or you were trying to teleport to an illegal location."); c.getSession().write(MaplePacketCreator.enableActions()); } } else { String name = slea.readMapleAsciiString(); MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(name); if (victim != null) { MapleMap target = victim.getMap(); WorldLocation loc = c.getChannelServer().getWorldInterface().getLocation(name); if (c.getChannelServer().getMapFactory().getMap(loc.map).getForcedReturnId() == 999999999) {//This doesn't allow tele to GM map, zakum and etc... if (!victim.isHidden()) { c.getPlayer().changeMap(target, target.findClosestSpawnpoint(victim.getPosition())); }else{ MapleInventoryManipulator.addById(c, itemId, (short)1, "Teleport Rock Error (Not found)"); new ServernoticeMapleClientMessageCallback(1, c).dropMessage("Either the player could not be found or you were trying to teleport to an illegal location."); c.getSession().write(MaplePacketCreator.enableActions()); } }else{ MapleInventoryManipulator.addById(c, itemId, (short)1, "Teleport Rock Error (Can't Teleport)"); new ServernoticeMapleClientMessageCallback(1, c).dropMessage("You cannot teleport to this map."); c.getSession().write(MaplePacketCreator.enableActions()); } } else { MapleInventoryManipulator.addById(c, itemId, (short)1, "Teleport Rock Error (Not found)"); new ServernoticeMapleClientMessageCallback(1, c).dropMessage("Player could not be found."); c.getSession().write(MaplePacketCreator.enableActions()); } }
No support given, cant figure it out? Too bad.


Reply With Quote![[Release] V62 VIP Teleport rocks](http://ragezone.com/hyper728.png)

See the last byte in trockaddmap ? that determines the type

