コード例 #1
0
        public static void RemoveContext(Mobile m, AnimalFormContext context, bool resetGraphics)
        {
            m_Table.Remove(m);

            if (context.SpeedBoost)
            {
                m.Send(SpeedControl.Disable);
            }

            SkillMod mod = context.Mod;

            if (mod != null)
            {
                m.RemoveSkillMod(mod);
            }

            mod = context.StealingMod;

            if (mod != null)
            {
                m.RemoveSkillMod(mod);
            }

            if (resetGraphics)
            {
                m.HueMod  = -1;
                m.BodyMod = 0;
            }

            m.FixedParticles(0x3728, 10, 13, 2023, EffectLayer.Waist);

            context.Timer.Stop();
        }
コード例 #2
0
        public static void RemoveContext(Mobile m, bool resetGraphics)
        {
            AnimalFormContext context = GetContext(m);

            if (context != null)
            {
                RemoveContext(m, context, resetGraphics);
            }
        }
コード例 #3
0
        public static void AddContext(Mobile m, AnimalFormContext context)
        {
            m_Table[m] = context;

            if (context.Type == typeof(BakeKitsune) || context.Type == typeof(GreyWolf))
            {
                m.CheckStatTimers();
            }
        }
コード例 #4
0
        public static void OnLogin(LoginEventArgs e)
        {
            AnimalFormContext context = AnimalForm.GetContext(e.Mobile);

            if (context != null && context.SpeedBoost)
            {
                e.Mobile.Send(SpeedControl.MountSpeed);
            }
        }
コード例 #5
0
        public static bool UnderTransformation(Mobile m, Type type)
        {
            AnimalFormContext context = GetContext(m);

            return(context != null && context.Type == type);
        }
コード例 #6
0
        public override void OnCast()
        {
            if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                Caster.SendLocalizedMessage(1061628); // You can't do that while polymorphed.
            }
            else if (TransformationSpellHelper.UnderTransformation(Caster))
            {
                Caster.SendLocalizedMessage(1063219); // You cannot mimic an animal while in that form.
            }
            else if (!Caster.CanBeginAction(typeof(IncognitoSpell)) || (Caster.IsBodyMod && GetContext(Caster) == null))
            {
                DoFizzle();
            }
            else if (CheckSequence())
            {
                AnimalFormContext context = GetContext(Caster);

                int mana = ScaleMana(RequiredMana);
                if (mana > Caster.Mana)
                {
                    Caster.SendLocalizedMessage(1060174, mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
                }
                else if (context != null)
                {
                    RemoveContext(Caster, context, true);
                    Caster.Mana -= mana;
                }
                else if (Caster is PlayerMobile)
                {
                    bool skipGump = (m_WasMoving || CasterIsMoving());

                    if (GetLastAnimalForm(Caster) == -1 || !skipGump)
                    {
                        Caster.CloseGump(typeof(AnimalFormGump));
                        Caster.SendGump(new AnimalFormGump(Caster, m_Entries, this));
                    }
                    else
                    {
                        if (Morph(Caster, GetLastAnimalForm(Caster)) == MorphResult.Fail)
                        {
                            DoFizzle();
                        }
                        else
                        {
                            Caster.FixedParticles(0x3728, 10, 13, 2023, EffectLayer.Waist);
                            Caster.Mana -= mana;
                        }
                    }
                }
                else
                {
                    if (Morph(Caster, GetLastAnimalForm(Caster)) == MorphResult.Fail)
                    {
                        DoFizzle();
                    }
                    else
                    {
                        Caster.FixedParticles(0x3728, 10, 13, 2023, EffectLayer.Waist);
                        Caster.Mana -= mana;
                    }
                }
            }

            FinishSequence();
        }