Search in sources :

Example 1 with MapleDragon

use of server.maps.MapleDragon in project HeavenMS by ronancpl.

the class MoveDragonHandler method handlePacket.

@Override
public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
    final MapleCharacter chr = c.getPlayer();
    final Point startPos = new Point(slea.readShort(), slea.readShort());
    List<LifeMovementFragment> res = parseMovement(slea);
    final MapleDragon dragon = chr.getDragon();
    if (dragon != null && res != null && res.size() > 0) {
        updatePosition(res, dragon, 0);
        if (chr.isHidden()) {
            chr.getMap().broadcastGMMessage(chr, MaplePacketCreator.moveDragon(dragon, startPos, res));
        } else {
            chr.getMap().broadcastMessage(chr, MaplePacketCreator.moveDragon(dragon, startPos, res), dragon.getPosition());
        }
    }
}
Also used : MapleCharacter(client.MapleCharacter) LifeMovementFragment(server.movement.LifeMovementFragment) MapleDragon(server.maps.MapleDragon) Point(java.awt.Point)

Aggregations

MapleCharacter (client.MapleCharacter)1 Point (java.awt.Point)1 MapleDragon (server.maps.MapleDragon)1 LifeMovementFragment (server.movement.LifeMovementFragment)1