Example #1
0
        public static void RefreshCharacterSprite(ICharacter character, IMap map, PacketHitList hitlist)
        {
            PacketHitList.MethodStart(ref hitlist);
            //sprite
            ExtraStatus status;

            int sprite = character.Sprite;

            character.CalculateOriginalSprite();

            if (character.HasActiveItem(259) && character.HeldItem.Num == 259 && map != null && map.Moral == Enums.MapMoral.House) {
                character.Sprite = character.HeldItem.Tag.ToInt();
            }

            status = character.VolatileStatus.GetStatus("Illusion");
            if (status != null) {
                character.Sprite = status.Counter;
            }

            if (character.VolatileStatus.GetStatus("Substitute") != null) {
                character.Sprite = 0;
                character.Form = 3;
            }

            if (character.VolatileStatus.GetStatus("SemiInvul") != null ||
                character.VolatileStatus.GetStatus("SkyDrop:0") != null ||
                character.VolatileStatus.GetStatus("SkyDrop:1") != null) {
                character.Sprite = 0;
                character.Form = 2;
            }
            if (sprite != character.Sprite) {
                if (character.CharacterType == Enums.CharacterType.Recruit) {
                    PacketBuilder.AppendSprite(((Recruit)character).Owner, hitlist);
                } else {

                    PacketBuilder.AppendNpcSprite(map, hitlist, ((MapNpc)character).MapSlot);
                }
            }
            PacketHitList.MethodEnded(ref hitlist);
        }