コード例 #1
0
        public override bool CheckCast()
        {
            if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                Caster.SendLocalizedMessage(1061628);                   // You can't do that while polymorphed.
                return(false);
            }
            else if (Necromancy.TransformationSpell.UnderTransformation(Caster))
            {
                Caster.SendLocalizedMessage(1063219);                   // You cannot mimic an animal while in that form.
                return(false);
            }
            else if (!BaseMount.CheckMountAllowed(Caster, false))
            {
                Caster.SendLocalizedMessage(1063108);                   // You cannot use this ability right now.
                return(false);
            }
            else if (Caster.Flying)
            {
                Caster.SendLocalizedMessage(1113415);                   // You cannot use this ability while flying.
                return(false);
            }

            return(base.CheckCast());
        }
コード例 #2
0
        public override void OnCast()
        {
            if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                Caster.SendLocalizedMessage(1061628);                   // You can't do that while polymorphed.
            }
            else if (Necromancy.TransformationSpell.UnderTransformation(Caster))
            {
                Caster.SendLocalizedMessage(1063219);                   // You cannot mimic an animal while in that form.
            }
            else if (!BaseMount.CheckMountAllowed(Caster, false))
            {
                Caster.SendLocalizedMessage(1063108);                   // You cannot use this ability right now.
            }
            else if (!Caster.CanBeginAction(typeof(IncognitoSpell)) || (Caster.IsBodyMod && GetContext(Caster) == null))
            {
                DoFizzle();
            }
            else if (CheckSequence())
            {
                AnimalFormContext context = GetContext(Caster);

                if (context != null)
                {
                    RemoveContext(Caster, context, true);

                    Effects.SendLocationParticles(EffectItem.Create(Caster.Location, Caster.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x7F3);

                    ConsumeMana();
                }
                else
                {
                    if (Caster.IsPlayer)
                    {
                        Caster.CloseGump(typeof(AnimalFormGump));
                        Caster.SendGump(new AnimalFormGump(Caster, m_Entries, this));
                    }
                    else
                    {
                        if (Morph(Caster, GetLastAnimalForm(Caster)) == MorphResult.Fail)
                        {
                            DoFizzle();
                        }
                        else
                        {
                            ConsumeMana();
                        }
                    }
                }
            }

            FinishSequence();
        }