예제 #1
0
 private static void appendHitUpdate(Player p, PacketBuilder updateBlock)
 {
     int ratio = p.getSkills().getCurLevel(Skills.SKILL.HITPOINTS) * 255 / p.getSkills().getMaxLevel(Skills.SKILL.HITPOINTS);
     if (p.getSkills().getCurLevel(Skills.SKILL.HITPOINTS) > p.getSkills().getMaxLevel(Skills.SKILL.HITPOINTS))
     {
         ratio = p.getSkills().getMaxLevel(3) * 255 / p.getSkills().getCurLevel(Skills.SKILL.HITPOINTS);
     }
     if(p.getHits().getHitDamage1() < 128) //damage can be either addByte [for damage less then 128 otherwise UShort]
         updateBlock.addByte((byte)p.getHits().getHitDamage1());
     else
         updateBlock.addUShort(p.getHits().getHitDamage1() + 0x8000);
     updateBlock.addByteA((byte)p.getHits().getHitType1());
     updateBlock.addByteS(ratio);
 }
예제 #2
0
 private static void appendHit2Update(Player p, PacketBuilder updateBlock)
 {
     updateBlock.addByte((byte)p.getHits().getHitDamage2());
     updateBlock.addByteS((byte)p.getHits().getHitType2());
 }