[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.
Re: [Release] V62 VIP Teleport rocks
Re: [Release] V62 VIP Teleport rocks
Nice release <3
PS: It's still incomplete
Re: [Release] V62 VIP Teleport rocks
Lawl the file name for the handler = TeleportRockHandler.java...
Re: [Release] V62 VIP Teleport rocks
Quote:
Originally Posted by
Lanny
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 :/...
Re: [Release] V62 VIP Teleport rocks
Quote:
Originally Posted by
Supiangel
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()
Re: [Release] V62 VIP Teleport rocks
Quote:
Originally Posted by
MrMysterious
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.
Re: [Release] V62 VIP Teleport rocks
Quote:
Originally Posted by
Supiangel
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...
Re: [Release] V62 VIP Teleport rocks
lol i use the 999999 o____o I guess i'll just remove it from mine :D:
Re: [Release] V62 VIP Teleport rocks
Quote:
Originally Posted by
MrMysterious
lol i use the 999999 o____o I guess i'll just remove it from mine :D:
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.
Re: [Release] V62 VIP Teleport rocks
Yay!! Steve felt like being nice today! =]
Re: [Release] V62 VIP Teleport rocks
Quote:
Originally Posted by
Lanny
Lawl the file name for the handler = TeleportRockHandler.java...
You made my day.
@Steve. Nice release :)
Re: [Release] V62 VIP Teleport rocks
Quote:
Originally Posted by
candyman4444
Like yours are much better?.
Yeah, personally, i spend alot of time cleaning my files...
Re: [Release] V62 VIP Teleport rocks
Quote:
Originally Posted by
candyman4444
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...
Re: [Release] V62 VIP Teleport rocks