- Joined
- Jul 16, 2010
- Messages
- 318
- Reaction score
- 116
The misspelling in the title is intentional, because that's the way Nexon spelled it. Go figure.
This packet, when written to the client, spawns a moving projectile object that does damage if it collides with a player. It's used to spawn the bombs in Magnus, Hekaton, Chaos Root Abyss (Von Bon's final phase), and a few other things.
You can send the packet on any map, though. It's not at all limited or hardcoded. Useful for custom stuff.
Opcode is 0x17F in v155 I believe. Not sure what it is in lower versions, can't be assed to pop open IDA and find out. Doesn't exist in any version before Magnus release (v125 or so).
Comments should be sufficient to explain the packet structure.
This packet, when written to the client, spawns a moving projectile object that does damage if it collides with a player. It's used to spawn the bombs in Magnus, Hekaton, Chaos Root Abyss (Von Bon's final phase), and a few other things.
You can send the packet on any map, though. It's not at all limited or hardcoded. Useful for custom stuff.
Opcode is 0x17F in v155 I believe. Not sure what it is in lower versions, can't be assed to pop open IDA and find out. Doesn't exist in any version before Magnus release (v125 or so).
Comments should be sufficient to explain the packet structure.
PHP:
public static byte[] spawnObtacleAtomBomb(List<ObtacleAtom> bombs){
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendPacketOpcode.SPAWN_OBTACLE_ATOM.getValue());
//Number of bomb objects to spawn. You can also just send multiple packets instead of putting them all in one packet.
mplew.writeInt(bombs.size());
//Unknown, this part is from IDA.
byte unk = 0;
mplew.write(unk); //animation data or some poop
if(unk == 1){
mplew.writeInt(300); //from Effect.img/BasicEff/ObtacleAtomCreate/%d
mplew.write(0); //rest idk
mplew.writeInt(0);
mplew.writeInt(0);
mplew.writeInt(0);
mplew.writeInt(0);
}
for(ObtacleAtom bomb : bombs){
mplew.write(1);
//Bomb type. Determines the graphics used as well as the projectile's hitbox.
//Pointer to an entry in Effect.wz/BasicEff.img/ObtacleAtom/
mplew.writeInt(bomb.getType());
//This must be unique for every bomb you spawn on the map. Give it an ObjectID, or something.
mplew.writeInt(bomb.getUniqueID());
//Spawnpoint, X origin.
mplew.writeInt(bomb.getPosition().x);
//Spawnpoint, Y origin.
mplew.writeInt(bomb.getPosition().y);
//Maximum movement speed. Roughly 2 * pixels per second.
mplew.writeInt(bomb.getMaxSpeed());
//Acceleration. Always below 5 in GMS, unsure exactly how it's calculated. Setting this to 0 makes a permanent, stationary bomb.
mplew.writeInt(bomb.getAcceleration());
//No idea, set it to 0. If you find out what this does, please let me know.
mplew.writeInt(bomb.getUnk());
//Affects exploding, the higher the number, the quicker it explodes. 25 is the value GMS uses.
mplew.writeInt(bomb.getExplodeSpeed());
//Percent of the character's Max HP to deal as damage. You can set this to negative values, which will heal the player.
//Damage dealt by projectiles ignores all defenses, resistances, and evasion. Your source must support damage type -5, which is what these projectiles use.
mplew.writeInt(bomb.getDamagePercent());
//Time, in milliseconds, to wait until actually spawning the projectile.
mplew.writeInt(bomb.getSpawnDelay());
//The maximum distance the projectile will move before exploding. Measured in pixels.
mplew.writeInt(bomb.getDistance());
//Direction. Behaves oddly; from 0 upwards, the angle goes clock wise, until it hits 80, then you add 80 and it'll continue going clockwise, until it hits 240, add 80 and it'll continue to go clockwise until 360 is hit then it starts over.
//Varies among different projectile types.
mplew.writeInt(bomb.getAngle());
}
return mplew.getPacket();
}
Last edited: