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());
}
}
}
Aggregations