private static void appendForceMovement(Player p, PacketBuilder updateBlock)
        {
            Location      myLocation = p.getUpdateFlags().getLastRegion();
            ForceMovement fm         = p.getForceMovement();

            updateBlock.addByteC(fm.getX1());
            updateBlock.addByte((byte)(fm.getY1()));
            updateBlock.addByteA(fm.getX2());
            updateBlock.addByte((byte)fm.getY2());
            updateBlock.addLEShort(fm.getSpeed1());
            updateBlock.addLEShort(fm.getSpeed2());
            updateBlock.addByteC(fm.getDirection());
        }
 private static void appendUnknownMask(Player p, PacketBuilder updateBlock)
 {
     updateBlock.addByteC(1);
     updateBlock.addLEShort(65465);
     updateBlock.addByteA(21);
     updateBlock.addUShort(434454);
 }
Example #3
0
        private static void appendHitUpdate(Npc Npc, PacketBuilder updateBlock)
        {
            NpcData npcDef = NpcData.forId(Npc.getId());
            int     ratio  = 1;

            if (npcDef != null)
            {
                ratio = Npc.getHp() * 255 / npcDef.getHitpoints();
            }
            else
            {
                misc.WriteError("Missing npcDef npcId: " + Npc.getId());
            }
            updateBlock.addByte((byte)Npc.getHits().getHitDamage1());
            updateBlock.addByteC((int)Npc.getHits().getHitType1());
            updateBlock.addByteS((byte)ratio);
        }
 private static void appendHit2Update(Npc Npc, PacketBuilder updateBlock)
 {
     updateBlock.addByteC((byte)Npc.getHits().getHitDamage2());
     updateBlock.addByteS((byte)Npc.getHits().getHitType2());
 }
 private static void appendHitUpdate(Npc Npc, PacketBuilder updateBlock)
 {
     NpcData npcDef = NpcData.forId(Npc.getId());
     int ratio = 1;
     if (npcDef != null)
         ratio = Npc.getHp() * 255 / npcDef.getHitpoints();
     else
         misc.WriteError("Missing npcDef npcId: " + Npc.getId());
     updateBlock.addByte((byte)Npc.getHits().getHitDamage1());
     updateBlock.addByteC((int)Npc.getHits().getHitType1());
     updateBlock.addByteS((byte)ratio);
 }
 private static void appendUnknownMask(Player p, PacketBuilder updateBlock)
 {
     updateBlock.addByteC(1);
     updateBlock.addLEShort(65465);
     updateBlock.addByteA(21);
     updateBlock.addUShort(434454);
 }
 private static void appendForceMovement(Player p, PacketBuilder updateBlock)
 {
     Location myLocation = p.getUpdateFlags().getLastRegion();
     ForceMovement fm = p.getForceMovement();
     updateBlock.addByteC(fm.getX1());
     updateBlock.addByte((byte)(fm.getY1()));
     updateBlock.addByteA(fm.getX2());
     updateBlock.addByte((byte)fm.getY2());
     updateBlock.addLEShort(fm.getSpeed1());
     updateBlock.addLEShort(fm.getSpeed2());
     updateBlock.addByteC(fm.getDirection());
 }
Example #8
0
 private static void appendHit2Update(Npc Npc, PacketBuilder updateBlock)
 {
     updateBlock.addByteC((byte)Npc.getHits().getHitDamage2());
     updateBlock.addByteS((byte)Npc.getHits().getHitType2());
 }