Ejemplo n.º 1
0
            private static AnimationDirection GetMobileAnimationDirection(ushort graphic, ref ushort hue, byte dirIndex)
            {
                if (graphic >= Constants.MAX_ANIMATIONS_DATA_INDEX_COUNT)
                {
                    return(null);
                }

                byte           group = GetAnimGroup(graphic);
                IndexAnimation index = AnimationsLoader.Instance.DataIndex[graphic];

                AnimationDirection direction = index.Groups[group].Direction[dirIndex];

                for (int i = 0; i < 2 && direction.FrameCount == 0; i++)
                {
                    if (!AnimationsLoader.Instance.LoadAnimationFrames(graphic, group, dirIndex, ref direction))
                    {
                        //direction = AnimationsLoader.Instance.GetCorpseAnimationGroup(ref graphic, ref group, ref hue2).Direction[dirIndex];
                        //graphic = item.ItemData.AnimID;
                        //group = GetAnimGroup(graphic);
                        //index = AnimationsLoader.Instance.DataIndex[graphic];
                        //direction = AnimationsLoader.Instance.GetBodyAnimationGroup(ref graphic, ref group, ref hue2, true).Direction[dirIndex];
                        ////direction = index.Groups[group].Direction[1];
                        //AnimationsLoader.Instance.AnimID = graphic;
                        //AnimationsLoader.Instance.AnimGroup = group;
                        //AnimationsLoader.Instance.Direction = dirIndex;
                    }
                }

                return(direction);
            }
Ejemplo n.º 2
0
        private static byte GetObjectNewAnimationType_0(Mobile mobile, ushort action, byte mode)
        {
            if (action <= 10)
            {
                ref IndexAnimation    ia   = ref FileManager.Animations.DataIndex[mobile.Graphic];
                ANIMATION_GROUPS_TYPE type = ANIMATION_GROUPS_TYPE.MONSTER;
                if ((ia.Flags & 0x80000000) != 0)
                {
                    type = ia.Type;
                }

                if (type == ANIMATION_GROUPS_TYPE.MONSTER)
                {
                    switch (mode % 4)
                    {
                    case 1:

                        return(5);

                    case 2:

                        return(6);

                    case 3:

                        if ((ia.Flags & 1) != 0)
                        {
                            return(12);
                        }
                        goto case 0;

                    case 0:

                        return(4);
                    }
                }
                else if (type == ANIMATION_GROUPS_TYPE.SEA_MONSTER)
                {
                    if (mode % 2 != 0)
                    {
                        return(6);
                    }

                    return(5);
                }
                else if (type != ANIMATION_GROUPS_TYPE.ANIMAL)
                {
                    if (mobile.Equipment[(int)Layer.Mount] != null)
                    {
                        if (action > 0)
                        {
                            if (action == 1)
                            {
                                return(27);
                            }
                            if (action == 2)
                            {
                                return(28);
                            }

                            return(26);
                        }

                        return(29);
                    }

                    switch (action)
                    {
                    default:

                        return(31);

                    case 1:

                        return(18);

                    case 2:

                        return(19);

                    case 6:

                        return(12);

                    case 7:

                        return(13);

                    case 8:

                        return(14);

                    case 3:

                        return(11);

                    case 4:

                        return(9);

                    case 5:

                        return(10);
                    }
                }

                if (mode % 2 != 0)
                {
                    return(6);
                }

                return(5);
            }
Ejemplo n.º 3
0
        private bool DrawCorpse(Batcher2D batcher, Vector3 position, MouseOverList objectList)
        {
            if (IsDisposed)
            {
                return(false);
            }

            byte dir    = (byte)((byte)Layer & 0x7F & 7);
            bool mirror = false;

            FileManager.Animations.GetAnimDirection(ref dir, ref mirror);
            IsFlipped = mirror;
            FileManager.Animations.Direction = dir;
            byte animIndex = (byte)AnimIndex;


            for (int i = 0; i < Constants.USED_LAYER_COUNT; i++)
            {
                Layer layer = LayerOrder.UsedLayers[dir, i];

                if (layer == Layer.Mount)
                {
                    continue;
                }
                Graphic graphic;
                Hue     color;
                bool    isequip = false;

                if (layer == Layer.Invalid)
                {
                    graphic = GetGraphicForAnimation();
                    FileManager.Animations.AnimGroup = FileManager.Animations.GetDieGroupIndex(GetGraphicForAnimation(), UsedLayer);
                    color = Hue;
                }
                else if (HasEquipment)
                {
                    Item itemEquip = Equipment[(int)layer];

                    if (itemEquip == null)
                    {
                        continue;
                    }
                    graphic = itemEquip.ItemData.AnimID;

                    if (graphic == 1069)
                    {
                    }

                    if (FileManager.Animations.EquipConversions.TryGetValue(Amount, out Dictionary <ushort, EquipConvData> map))
                    {
                        if (map.TryGetValue(graphic, out EquipConvData data))
                        {
                            graphic = data.Graphic;
                        }
                    }

                    isequip = true;
                    color   = itemEquip.Hue;
                }
                else
                {
                    continue;
                }

                FileManager.Animations.AnimID = graphic;
                ref IndexAnimation index = ref FileManager.Animations.DataIndex[FileManager.Animations.AnimID];

                ref AnimationDirection direction = ref index.Groups[FileManager.Animations.AnimGroup].Direction[FileManager.Animations.Direction].IsUOP && !isequip ?