[Release] V62 VIP Teleport rocks

Results 1 to 21 of 21
  1. #1
    Account Upgraded | Title Enabled! iamSTEVE is offline
    MemberRank
    Jul 2008 Join Date
    528Posts

    [Release] V62 VIP Teleport rocks

    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:
    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;
    [code]
    Add this in MaplePacketCreator
    Code:
    	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();
        }
    Add this in sendops
    Code:
    TROCK_LOCATIONS = 0x27
    this in recvops
    Code:
    TROCK_ADD_MAP = 0x5E
    Add them to the sendops/recvops javas too

    Make this new handler in the channel packet handlers
    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));
            }
        }
    }
    You can find out the name of the file yourself.

    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.


  2. #2
    GoldMember XkelvinchiaX is offline
    MemberRank
    Sep 2006 Join Date
    MalaysiaLocation
    286Posts

    Re: [Release] V62 VIP Teleport rocks

    Nicely Good Job~

  3. #3
    Infraction Banned MrMysterious is offline
    MemberRank
    Dec 2008 Join Date
    In a treeLocation
    752Posts

    Re: [Release] V62 VIP Teleport rocks

    Nice release <3


    PS: It's still incomplete

  4. #4
    Account Upgraded | Title Enabled! Lanny is offline
    MemberRank
    Aug 2008 Join Date
    In your screen!Location
    399Posts

    Re: [Release] V62 VIP Teleport rocks

    Lawl the file name for the handler = TeleportRockHandler.java...

  5. #5
    Account Upgraded | Title Enabled! Supiangel is offline
    MemberRank
    Feb 2008 Join Date
    436Posts

    Re: [Release] V62 VIP Teleport rocks

    Quote Originally Posted by Lanny View Post
    Lawl the file name for the handler = TeleportRockHandler.java...
    Not really.

    public class TrockAddMapHandler extends AbstractMaplePacketHandler {

    @MrMysterious :

    Yeah, i know... he forgot to add the hugest part of the MaplePacketCreator method and it's still not fully decrypted :/... Plus, his "boolean vip" doesn't make any sense... We can't check if the player is using a VIP or a Normal rock...

    @iamSTEVE :

    Dude, freaking learn to clean up codes :/...

  6. #6
    Infraction Banned MrMysterious is offline
    MemberRank
    Dec 2008 Join Date
    In a treeLocation
    752Posts

    Re: [Release] V62 VIP Teleport rocks

    Quote Originally Posted by Supiangel View Post
    Yeah, i know... he forgot to add the hugest part of the MaplePacketCreator method and it's still not fully decrypted :/... Plus, his "boolean vip" doesn't make any sense... We can't check if the player is using a VIP or a Normal rock...
    Yeah we can See the last byte in trockaddmap ? that determines the type
    He's also missing something in getCharInfo()

  7. #7
    Account Upgraded | Title Enabled! Supiangel is offline
    MemberRank
    Feb 2008 Join Date
    436Posts

    Re: [Release] V62 VIP Teleport rocks

    Quote Originally Posted by MrMysterious View Post
    Yeah we can See the last byte in trockaddmap ? that determines the type
    He's also missing something in getCharInfo()
    Oh, didn't know that... I just sniffed VIP Ones.

  8. #8
    Account Upgraded | Title Enabled! iamSTEVE is offline
    MemberRank
    Jul 2008 Join Date
    528Posts

    Re: [Release] V62 VIP Teleport rocks

    Quote Originally Posted by Supiangel View Post
    Not really.

    public class TrockAddMapHandler extends AbstractMaplePacketHandler {

    @MrMysterious :

    Yeah, i know... he forgot to add the hugest part of the MaplePacketCreator method and it's still not fully decrypted :/... Plus, his "boolean vip" doesn't make any sense... We can't check if the player is using a VIP or a Normal rock...

    @iamSTEVE :

    Dude, freaking learn to clean up codes :/...
    Yeah Supi anyways you just told me it was 03, which is weird because I thought it was 02 or 00, whatever.
    Anyways Mysterious is right, I had that done earlier but I guess I forgot to commit it and it got overridden, whatever.
    Anyways what's the hugest part? the 9999999's? Those arent even needed...

  9. #9
    Infraction Banned MrMysterious is offline
    MemberRank
    Dec 2008 Join Date
    In a treeLocation
    752Posts

    Re: [Release] V62 VIP Teleport rocks

    lol i use the 999999 o____o I guess i'll just remove it from mine

  10. #10
    Account Upgraded | Title Enabled! Supiangel is offline
    MemberRank
    Feb 2008 Join Date
    436Posts

    Re: [Release] V62 VIP Teleport rocks

    Quote Originally Posted by MrMysterious View Post
    lol i use the 999999 o____o I guess i'll just remove it from mine
    Don't remove it, if you do, your script wouldn't be GMS-alike; because as you know, GMS sent those packets and we started to tak about it.

  11. #11
    Infraction Banned Maple1134 is offline
    MemberRank
    Jun 2008 Join Date
    564Posts

    Re: [Release] V62 VIP Teleport rocks

    Yay!! Steve felt like being nice today! =]

  12. #12
    Alpha Member Anujan is offline
    MemberRank
    May 2008 Join Date
    Ontario, CanadaLocation
    1,633Posts

    Re: [Release] V62 VIP Teleport rocks

    Quote Originally Posted by Lanny View Post
    Lawl the file name for the handler = TeleportRockHandler.java...
    You made my day.

    @Steve. Nice release :)

  13. #13
    Account Upgraded | Title Enabled! Supiangel is offline
    MemberRank
    Feb 2008 Join Date
    436Posts

    Re: [Release] V62 VIP Teleport rocks

    Quote Originally Posted by candyman4444 View Post
    Like yours are much better?.
    Yeah, personally, i spend alot of time cleaning my files...

  14. #14
    Account Upgraded | Title Enabled! iamSTEVE is offline
    MemberRank
    Jul 2008 Join Date
    528Posts

    Re: [Release] V62 VIP Teleport rocks

    Quote Originally Posted by candyman4444 View Post
    Like yours are much better?


    I feel like being nice today, don't bother going to this thread again and you won't verbally be raped.

    Also to iamsteve, i suggest you stop attempting to act pro. You released something that is still incomplete and aren't providing support.
    Lol Im not trying to act pro, most of this is done by matze anyways....
    Anyways Supi's probably is better than mine, it's different from the one on Prometheus anyways....and why is it not full o.o
    Tell me what's not there and Ill add it, besides the 9999999s. I didnt add the registerhandler stuff and the sendops because anyone with half a brain can do it themselves, plus Im lazy. You can use simple logic to find it...

  15. #15
    Alpha Member watzmename is offline
    MemberRank
    Aug 2008 Join Date
    2,835Posts

    Re: [Release] V62 VIP Teleport rocks

    great job on this.

  16. #16
    Account Upgraded | Title Enabled! RMZero213 is offline
    MemberRank
    Apr 2008 Join Date
    Far, far awayLocation
    1,280Posts

    Re: [Release] V62 VIP Teleport rocks

    You're missing a getCharInfo() bit and the 999999999 thing in trockrefresh..

    And there's more bits to it, like the VIP/regular thing, the delete/add thing in trockrefresh, and you might wanna add autoban for map jumping there in usecashitemhandler..
    Last edited by RMZero213; 25-01-09 at 06:22 PM.

  17. #17
    Account Upgraded | Title Enabled! lxCrAzYsEl is offline
    MemberRank
    May 2008 Join Date
    Her heart :)Location
    281Posts

    Re: [Release] V62 VIP Teleport rocks

    Ah finally .

  18. #18
    Account Upgraded | Title Enabled! AuroX is offline
    MemberRank
    Sep 2008 Join Date
    1,431Posts

    Re: [Release] V62 VIP Teleport rocks

    when you click add map you dc...

  19. #19
    Novice ubd2000 is offline
    MemberRank
    Jan 2009 Join Date
    3Posts

    Re: [Release] V62 VIP Teleport rocks

    when you click add map you dc...

    help me..

  20. #20
    Infraction Banned MrMysterious is offline
    MemberRank
    Dec 2008 Join Date
    In a treeLocation
    752Posts

    Re: [Release] V62 VIP Teleport rocks

    PHP Code:
     while (rs.next()) {
                    
    mplew.writeInt(rs.getInt("mapid"));
                } 
    change that to
    PHP Code:
    int i 0;
                while (
    rs.next()) {
                    
    mplew.writeInt(rs.getInt("mapid"));
    i++;
                }
    for (; 
    10i++)
    mplew.write(CHAR_INFO_MAGIC); 
    NOTE: I did that all in the reply box so stfu.

  21. #21
    Novice ubd2000 is offline
    MemberRank
    Jan 2009 Join Date
    3Posts

    Re: [Release] V62 VIP Teleport rocks

    MrMysterious Thank you~~~ ^^ nice ,but not map delete ioi



Advertisement