Search in sources :

Example 6 with LifeMovementFragment

use of server.movement.LifeMovementFragment in project HeavenMS by ronancpl.

the class MoveSummonHandler method handlePacket.

@Override
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
    int oid = slea.readInt();
    Point startPos = new Point(slea.readShort(), slea.readShort());
    List<LifeMovementFragment> res = parseMovement(slea);
    MapleCharacter player = c.getPlayer();
    Collection<MapleSummon> summons = player.getSummonsValues();
    MapleSummon summon = null;
    for (MapleSummon sum : summons) {
        if (sum.getObjectId() == oid) {
            summon = sum;
            break;
        }
    }
    if (summon != null) {
        updatePosition(res, summon, 0);
        player.getMap().broadcastMessage(player, MaplePacketCreator.moveSummon(player.getId(), oid, startPos, res), summon.getPosition());
    }
}
Also used : MapleCharacter(client.MapleCharacter) LifeMovementFragment(server.movement.LifeMovementFragment) Point(java.awt.Point) Point(java.awt.Point) MapleSummon(server.maps.MapleSummon)

Aggregations

LifeMovementFragment (server.movement.LifeMovementFragment)6 Point (java.awt.Point)5 MapleCharacter (client.MapleCharacter)4 ArrayList (java.util.ArrayList)2 AbsoluteLifeMovement (server.movement.AbsoluteLifeMovement)2 RelativeLifeMovement (server.movement.RelativeLifeMovement)2 MapleMonster (server.life.MapleMonster)1 MobAttackInfo (server.life.MobAttackInfo)1 MobSkill (server.life.MobSkill)1 MapleDragon (server.maps.MapleDragon)1 MapleMapObject (server.maps.MapleMapObject)1 MapleSummon (server.maps.MapleSummon)1 ChangeEquip (server.movement.ChangeEquip)1 JumpDownMovement (server.movement.JumpDownMovement)1 LifeMovement (server.movement.LifeMovement)1 TeleportMovement (server.movement.TeleportMovement)1