コード例 #1
0
        public override bool CheckCast()
        {
            if (Caster.MagicDamageAbsorb > 0)
            {
                Caster.SendLocalizedMessage(1005559);                   // This spell is already in effect.
                return(false);
            }
            else if (!Caster.CanBeginAction(typeof(DefensiveSpell)))
            {
                Caster.SendLocalizedMessage(1005385);                   // The spell will not adhere to you at this time.
                return(false);
            }
            else if (Caster.Backpack.FindItemByType(typeof(Diamond)) == null)
            {
                Caster.SendMessage("You need a diamond to cast this spell!");
                return(false);
            }

            return(true);
        }
コード例 #2
0
ファイル: Protection.cs プロジェクト: avatar21/runuo
        public override bool CheckCast()
        {
            if (Core.AOS)
            {
                return(true);
            }

            if (m_Registry.ContainsKey(Caster))
            {
                Caster.SendLocalizedMessage(1005559);                   // This spell is already in effect.
                return(false);
            }
            else if (!Caster.CanBeginAction(typeof(DefensiveSpell)))
            {
                Caster.SendLocalizedMessage(1005385);                   // The spell will not adhere to you at this time.
                return(false);
            }

            return(true);
        }
コード例 #3
0
        public override bool CheckCast()
        {
            if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                Caster.SendLocalizedMessage(1061628);                   // You can't do that while polymorphed.
                return(false);
            }
            else if (TransformationSpellHelper.UnderTransformation(Caster))
            {
                Caster.SendLocalizedMessage(1063219);                   // You cannot mimic an animal while in that form.
                return(false);
            }
            else if (DisguiseTimers.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(1061631);                   // You can't do that while disguised.
                return(false);
            }

            return(base.CheckCast());
        }
コード例 #4
0
        public override bool CheckCast()
        {
            if (Factions.Sigil.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1010445);                   // You cannot incognito if you have a sigil
                return(false);
            }
            else if (!Caster.CanBeginAction(typeof(IncognitoSpell)))
            {
                Caster.SendLocalizedMessage(1005559);                   // This spell is already in effect.
                return(false);
            }
            else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendLocalizedMessage(1042402);                   // You cannot use incognito while wearing body paint
                return(false);
            }

            return(true);
        }
コード例 #5
0
        public override bool CheckCast()
        {
            if (Core.AOS)
            {
                return(true);
            }

            if (Caster.MagicDamageAbsorb > 0)
            {
                Caster.SendMessage("Your mind is already protected!");
                return(false);
            }
            else if (!Caster.CanBeginAction(typeof(DefensiveSpell)))
            {
                Caster.SendMessage("Your mind cannot be shielded at this time!");
                return(false);
            }

            return(true);
        }
コード例 #6
0
        public override bool CheckCast()
        {
            if (m_Table.ContainsKey(Caster))
            {
                Caster.SendLocalizedMessage(501775); // This spell is already in effect.
                return(false);
            }
            else if (!Caster.CanBeginAction(typeof(AttuneWeaponSpell)))
            {
                Caster.SendLocalizedMessage(1075124); // You must wait before casting that spell again.
                return(false);
            }
            else if (SpiritualityVirtue.IsEmbracee(Caster))
            {
                Caster.SendLocalizedMessage(1156040); // You may not cast Attunement whilst a Spirituality Shield is active!
                return(false);
            }

            return(base.CheckCast());
        }
コード例 #7
0
        public override bool CheckCast()
        {
            /*if ( Caster.Mounted )
             * {
             *      Caster.SendAsciiMessage( "Please dismount first." );
             *      return false;
             * }
             * else */
            if (Factions.Sigil.ExistsOn(Caster))
            {
                Caster.SendAsciiMessage("You cannot polymorph while you have a Town Sigil.");
                return(false);
            }
            else if (Necromancy.TransformationSpell.UnderTransformation(Caster))
            {
                Caster.SendAsciiMessage("You cannot polymorph while in that form.");
                return(false);
            }
            else if (DisguiseGump.IsDisguised(Caster))
            {
                Caster.SendAsciiMessage("You cannot polymorph while disguised.");
                return(false);
            }
            else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendAsciiMessage("You cannot polymorph while wearing body paint.");
                return(false);
            }
            else if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                Caster.SendAsciiMessage("This spell is already in effect.");
                return(false);
            }
            else if (m_NewBody == 0)
            {
                Caster.SendGump(new PolymorphGump(Caster, Scroll));
                return(false);
            }

            return(true);
        }
コード例 #8
0
        public override void OnCast()
        {
            if (Caster.MeleeDamageAbsorb > 0)
            {
                Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
            }
            else if (!Caster.CanBeginAction(typeof(DefensiveSpell)))
            {
                Caster.SendLocalizedMessage(1005385); // The spell will not adhere to you at this time.
            }
            else if (CheckSequence())
            {
                if (Caster.BeginAction(typeof(DefensiveSpell)))
                {
                    var value = (int)(Caster.Skills[SkillName.Magery].Value +
                                      Caster.Skills[SkillName.Meditation].Value +
                                      Caster.Skills[SkillName.Inscribe].Value);
                    value /= 3;

                    if (value < 0)
                    {
                        value = 1;
                    }
                    else if (value > 75)
                    {
                        value = 75;
                    }

                    Caster.MeleeDamageAbsorb = value;

                    Caster.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist);
                    Caster.PlaySound(0x1F2);
                }
                else
                {
                    Caster.SendLocalizedMessage(1005385); // The spell will not adhere to you at this time.
                }
            }

            FinishSequence();
        }
コード例 #9
0
        public override bool CheckCast()
        {
            /*if ( Caster.Mounted )
             * {
             *      Caster.SendLocalizedMessage( 1042561 ); //Please dismount first.
             *      return false;
             * }
             * else */
            if (Factions.Sigil.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1010521);                   // You cannot polymorph while you have a Town Sigil
                return(false);
            }
            else if (Necromancy.TransformationSpell.UnderTransformation(Caster))
            {
                Caster.SendLocalizedMessage(1061633);                   // You cannot polymorph while in that form.
                return(false);
            }
            else if (DisguiseGump.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(502167);                   // You cannot polymorph while disguised.
                return(false);
            }
            else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendLocalizedMessage(1042512);                   // You cannot polymorph while wearing body paint
                return(false);
            }
            else if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                Caster.SendLocalizedMessage(1005559);                   // This spell is already in effect.
                return(false);
            }
            else if (m_NewBody == 0)
            {
                Caster.SendGump(new PolymorphGump(Caster, Scroll));
                return(false);
            }

            return(true);
        }
コード例 #10
0
        public override bool CheckCast()
        {
            /*if ( Caster.Mounted )
             * {
             *      Caster.SendLocalizedMessage( 1042561 ); // Please dismount first.
             *      return false;
             * }
             * else */
            if (Factions.Sigil.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1061632);                   // You can't do that while carrying the sigil.
                return(false);
            }
            else if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                Caster.SendLocalizedMessage(1061628);                   // You can't do that while polymorphed.
                return(false);
            }

            return(base.CheckCast());
        }
コード例 #11
0
ファイル: MagicReflect.cs プロジェクト: silky/ModernUO
        public override bool CheckCast()
        {
            if (Core.AOS)
            {
                return(true);
            }

            if (Caster.MagicDamageAbsorb > 0)
            {
                Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
                return(false);
            }

            if (!Caster.CanBeginAction <DefensiveSpell>())
            {
                Caster.SendLocalizedMessage(1005385); // The spell will not adhere to you at this time.
                return(false);
            }

            return(true);
        }
コード例 #12
0
        public override bool CheckCast()
        {
            if (TransformationSpellHelper.UnderTransformation(Caster, typeof(EtherealVoyageSpell)))
            {
                Caster.SendLocalizedMessage(501775); // This spell is already in effect.
            }
            else if (!Caster.CanBeginAction <EtherealVoyageSpell>())
            {
                Caster.SendLocalizedMessage(1075124); // You must wait before casting that spell again.
            }
            else if (Caster.Combatant != null)
            {
                Caster.SendLocalizedMessage(1072586); // You cannot cast Ethereal Voyage while you are in combat.
            }
            else
            {
                return(base.CheckCast());
            }

            return(false);
        }
コード例 #13
0
        public override bool CheckCast()
        {
            if (!base.CheckCast())
            {
                return(false);
            }

            if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                Caster.SendLocalizedMessage(1061628);                   // You can't do that while polymorphed.
                return(false);
            }

            if (Necromancy.TransformationSpell.UnderTransformation(Caster))
            {
                Caster.SendLocalizedMessage(1063219);                   // You cannot mimic an animal while in that form.
                return(false);
            }

            return(true);
        }
コード例 #14
0
        public override void OnCast()
        {
            if (m_Registry.ContainsKey(Caster))
            {
                Caster.SendLocalizedMessage(1005559);                   // This spell is already in effect.
            }
            else if (!Caster.CanBeginAction(typeof(DefensiveSpell)))
            {
                Caster.SendLocalizedMessage(1005385);                   // The spell will not adhere to you at this time.
            }
            else if (CheckSequence())
            {
                if (Caster.BeginAction(typeof(DefensiveSpell)))
                {
                    double value = (int)(Caster.Skills[SkillName.EvalInt].Value + Caster.Skills[SkillName.Meditation].Value + Caster.Skills[SkillName.Inscribe].Value);
                    value /= 4;

                    if (value < 0)
                    {
                        value = 0;
                    }
                    else if (value > 75)
                    {
                        value = 75.0;
                    }

                    Registry.Add(Caster, value);
                    new InternalTimer(Caster).Start();

                    Caster.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist);
                    Caster.PlaySound(0x1ED);
                }
                else
                {
                    Caster.SendLocalizedMessage(1005385);                       // The spell will not adhere to you at this time.
                }
            }

            FinishSequence();
        }
コード例 #15
0
ファイル: Incognito.cs プロジェクト: Zilmerx/Temrael2
        public override bool CheckCast()
        {
            if (!Caster.CanBeginAction(typeof(IncognitoSpell)))
            {
                Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
                return(false);
            }
            else if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                Caster.SendMessage("Vous ne pouvez faire ce sort en étant transformé.");
                return(false);
            }
            else if (TransformationSpell.UnderTransformation(Caster))
            {
                Caster.SendMessage("Vous ne pouvez faire ce sort en étant transformé.");
                return(false);
            }

            /*else if (!Caster.CanBeginAction(typeof(ChauveSouris)))
             * {
             *  Caster.SendMessage("Vous ne pouvez vous transformer en étant sous la forme d'une chauve-souris.");
             *  return false;
             * }*/
            else if (m_Name == null || m_Name == "")
            {
                if (Caster is PlayerMobile)
                {
                    //((PlayerMobile)Caster).Incognito = true;
                }
                else
                {
                    Caster.SendMessage("Entrez le nouveau nom que vous désirez avoir (Minimum 3 lettres, ESC pour annuler).");
                    Caster.Prompt = new NamePrompt(Scroll);
                }
                return(false);
            }

            return(true);
        }
コード例 #16
0
        public override bool CheckCast()
        {
            /*if ( Caster.Mounted )
             * {
             *      Caster.SendLocalizedMessage( 1042561 ); //Please dismount first.
             *      return false;
             * }
             * else */
            if (TransformationSpellHelper.UnderTransformation(Caster))
            {
                Caster.SendLocalizedMessage(1061633);                   // You cannot polymorph while in that form.
                return(false);
            }
            else if (DisguiseTimers.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(502167);                   // You cannot polymorph while disguised.
                return(false);
            }
            else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendLocalizedMessage(1042512);                   // You cannot polymorph while wearing body paint
                return(false);
            }
            else if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                Caster.SendLocalizedMessage(1005559);                   // This spell is already in effect.
                return(false);
            }
            else if (m_NewBody == 0)
            {
                Gump gump = new PolymorphGump(Caster, Scroll);

                Caster.SendGump(gump);
                return(false);
            }

            return(true);
        }
コード例 #17
0
        public override void OnCast()
        {
            if (!Caster.CanBeginAction(typeof(RangerHuntersAimSpell)))
            {
                Caster.SendLocalizedMessage(1005559);
            }

            else if (CheckSequence())
            {
                object[] mods = new object[]
                {
                    new StatMod(StatType.Dex, "[Ranger] Dex Offset", 5, TimeSpan.Zero),
                    new StatMod(StatType.Str, "[Ranger] Str Offset", 5, TimeSpan.Zero),
                    new DefaultSkillMod(SkillName.Archery, true, 20),
                    new DefaultSkillMod(SkillName.Tactics, true, 20),
                };

                m_Table[Caster] = mods;

                Caster.AddStatMod((StatMod)mods[0]);
                Caster.AddStatMod((StatMod)mods[1]);
                Caster.AddSkillMod((SkillMod)mods[2]);
                Caster.AddSkillMod((SkillMod)mods[3]);

                double span = 1.0 * RangerHuntersAimSpell.GetScalar(Caster);
                new InternalTimer(Caster, TimeSpan.FromMinutes((int)span)).Start();

                IMount mount = Caster.Mount;

                if (mount != null)
                {
                    mount.Rider = null;
                }


                Caster.BeginAction(typeof(RangerHuntersAimSpell));
            }
        }
コード例 #18
0
 public override bool CheckCast()
 {
     if (Caster.Mounted)
     {
         Caster.SendLocalizedMessage(1042561); //Please dismount first.
         return(false);
     }
     else if (TransformationSpellHelper.UnderTransformation(Caster))
     {
         Caster.SendMessage("You cannot enter the realm of the dead while in that form.");
         return(false);
     }
     else if (DisguiseTimers.IsDisguised(Caster))
     {
         Caster.SendMessage("You cannot enter the realm of the dead while disguised.");
         return(false);
     }
     else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
     {
         Caster.SendMessage("You cannot enter the realm of the dead without removing your paint.");
         return(false);
     }
     else if (!Caster.CanBeginAction(typeof(AncientSeanceSpell)))
     {
         Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
         return(false);
     }
     else if (Caster.Female)
     {
         m_NewBody = 403;
     }
     else
     {
         m_NewBody = 402;
     }
     m_OldBody = Caster.Body;
     return(true);
 }
コード例 #19
0
 public override void OnCast()
 {
     if (CheckSequence())
     {
         if (!Caster.CanBeginAction(typeof(ClericSacrificeSpell)))
         {
             Caster.EndAction(typeof(ClericSacrificeSpell));
             Caster.PlaySound(0x244);
             Caster.FixedParticles(0x3709, 1, 30, 9965, 1152, 0, EffectLayer.Waist);
             Caster.FixedParticles(0x376A, 1, 30, 9502, 1152, 0, EffectLayer.Waist);
             Caster.SendMessage("You stop sacrificing your essence for the well being of others.");
         }
         else
         {
             Caster.BeginAction(typeof(ClericSacrificeSpell));
             Caster.FixedParticles(0x3709, 1, 30, 9965, 1153, 7, EffectLayer.Waist);
             Caster.FixedParticles(0x376A, 1, 30, 9502, 1153, 3, EffectLayer.Waist);
             Caster.PlaySound(0x244);
             Caster.SendMessage("You begin sacrificing your essence for the well being of others.");
         }
     }
     FinishSequence();
 }
コード例 #20
0
        public override void OnCast()
        {
            if (!Caster.CanBeginAction(typeof(WoodlandProtectionSpell)))
            {
                Caster.SendLocalizedMessage(1005559);
            }

            else if (CheckSequence())
            {
                int MyResist = (int)(Caster.Skills[SkillName.AnimalTaming].Value) / 5;

                object[] mods = new object[]
                {
                    new ResistanceMod(ResistanceType.Physical, MyResist),
                    new ResistanceMod(ResistanceType.Fire, MyResist),
                    new ResistanceMod(ResistanceType.Cold, MyResist),
                    new ResistanceMod(ResistanceType.Poison, MyResist),
                    new ResistanceMod(ResistanceType.Energy, MyResist)
                };

                m_Table[Caster] = mods;

                Caster.AddResistanceMod((ResistanceMod)mods[0]);
                Caster.AddResistanceMod((ResistanceMod)mods[1]);
                Caster.AddResistanceMod((ResistanceMod)mods[2]);
                Caster.AddResistanceMod((ResistanceMod)mods[3]);
                Caster.AddResistanceMod((ResistanceMod)mods[4]);

                double span = (Caster.Skills[SkillName.AnimalLore].Value / 2) * 60;

                new InternalTimer(Caster, TimeSpan.FromSeconds((int)span)).Start();
                Caster.PlaySound(0x19);
                Effects.SendLocationParticles(Caster, 0xC87, 9, 10, 5025);
                Caster.BeginAction(typeof(WoodlandProtectionSpell));
            }
            FinishSequence();
        }
コード例 #21
0
        public override bool CheckCast()
        {
            /*if ( Caster.Mounted )
             * {
             *  Caster.SendLocalizedMessage( 1042561 ); //Please dismount first.
             *  return false;
             * }
             * else */
            /*if ( Necromancy.TransformationSpell.UnderTransformation( Caster ) )
             * {
             *  Caster.SendLocalizedMessage( 1061633 ); // You cannot polymorph while in that form.
             *  return false;
             * }
             * else*/
            if (DisguiseGump.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(502167); // You cannot polymorph while disguised.
                return(false);
            }
            else if (Caster is PlayerMobile && ((PlayerMobile)Caster).SavagePaintExpiration != TimeSpan.Zero)
            {
                Caster.SendLocalizedMessage(1042512); // You cannot polymorph while wearing body paint
                return(false);
            }
            else if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
                return(false);
            }
            else if (m_NewBody == 0)
            {
                Caster.SendGump(new PolymorphGump(Caster, Scroll));
                return(false);
            }

            return(true);
        }
コード例 #22
0
        public override bool CheckCast()
        {
            if (Caster.Flying)
            {
                Caster.SendLocalizedMessage(1113415); // You cannot use this ability while flying.
                return(false);
            }
            else if (TransformationSpellHelper.UnderTransformation(Caster))
            {
                Caster.SendLocalizedMessage(1061633); // You cannot polymorph while in that form.
                return(false);
            }
            else if (DisguiseTimers.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(502167); // You cannot polymorph while disguised.
                return(false);
            }
            else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendLocalizedMessage(1042512); // You cannot polymorph while wearing body paint
                return(false);
            }
            else if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                EndPolymorph(Caster);
                return(false);
            }
            else if (m_NewBody == 0)
            {
                Gump gump = new NewPolymorphGump(Caster, Scroll);

                Caster.SendGump(gump);
                return(false);
            }

            return(true);
        }
コード例 #23
0
ファイル: StoneForm.cs プロジェクト: twiztedpsycho1/JustUO
        public override bool CheckCast()
        {
            if (!base.CheckCast())
            {
                return(false);
            }
            if (!Caster.CanBeginAction(typeof(StoneFormSpell)))
            {
                RemoveEffect(Caster);
                Caster.SendMessage("You are no longer in Stone Form.");
                return(false);
            }
            if (Caster.BodyMod != 0)
            {
                Caster.SendMessage("You cannot transform while in that form.");
                return(false);
            }
            if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendMessage("You cannot transform while wearing body paint.");
                return(false);
            }
            if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                Caster.SendMessage("You cannot transform while polymorphed.");
                return(false);
            }

            /* else if ( !Caster.CanBeginAction( typeof( StoneFormSpell ) ) )
             * {
             *  StoneFormSpell.RemoveEffect( Caster );
             *  Caster.SendMessage( "You are no longer in Stone Form." );
             *                  return false;
             *          }*/

            return(true);
        }
コード例 #24
0
        public override void OnCast()
        {
            if (Caster.CanBeginAction(typeof(RogueSlyFoxSpell)) && CheckSequence())
            {
                Caster.BeginAction(typeof(RogueSlyFoxSpell));
                new InternalTimer(Caster, TimeSpan.FromMinutes(1)).Start();

                object[] mods = new object[]
                {
                    new StatMod(StatType.Dex, "SlyFoxSpellStatMod", 20, TimeSpan.Zero),
                    new DefaultSkillMod(SkillName.Hiding, true, 20),
                    new DefaultSkillMod(SkillName.Stealth, true, 20)
                };

                m_Table[Caster] = mods;

                Caster.AddStatMod((StatMod)mods[0]);
                Caster.AddSkillMod((SkillMod)mods[1]);
                Caster.AddSkillMod((SkillMod)mods[2]);


                IMount mount = Caster.Mount;

                if (mount != null)
                {
                    mount.Rider = null;
                }

                Caster.BodyMod = 225;
                Caster.PlaySound(0xE5);
                Caster.FixedParticles(0x3728, 1, 13, 0x480, 92, 3, EffectLayer.Head);
            }
            else
            {
                Caster.SendMessage("You cannot become a sly fox in that state!");
            }
        }
コード例 #25
0
 public override bool CheckCast()
 {
     if (Caster.Mounted)
     {
         Caster.SendLocalizedMessage(1042561); //Please dismount first.
         return(false);
     }
     else if (TransformationSpellHelper.UnderTransformation(Caster))
     {
         Caster.SendMessage("You cannot enter the astral plane while in that form.");
         return(false);
     }
     else if (DisguiseTimers.IsDisguised(Caster))
     {
         Caster.SendMessage("You cannot enter the astral plane while disguised.");
         return(false);
     }
     else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
     {
         Caster.SendMessage("You cannot enter the astral plane without removing your paint.");
         return(false);
     }
     else if (!Caster.CanBeginAction(typeof(AstralProjection)))
     {
         Caster.SendMessage("You are already in the astral plane.");
         return(false);
     }
     else
     {
         m_NewBody = 970;
         m_NewHue  = 0x4001;
     }
     m_OldBody = Caster.Body;
     m_OldHue  = Caster.Hue;
     return(true);
 }
コード例 #26
0
        public override void OnCast()
        {
            if (Caster.MagicDamageAbsorb > 0)
            {
                Caster.SendLocalizedMessage(1005559);                   // This spell is already in effect.
            }
            else if (!Caster.CanBeginAction(typeof(DefensiveSpell)))
            {
                Caster.SendLocalizedMessage(1005385);                   // The spell will not adhere to you at this time.
            }
            else if (Caster.Backpack.FindItemByType(typeof(Diamond)) == null)
            {
                Caster.SendMessage("You need a diamond to cast this spell!");
            }
            else if (CheckSequence())
            {
                if (Caster.BeginAction(typeof(DefensiveSpell)))
                {
                    int value = (int)((Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.EvalInt].Value) / 4);
                    Caster.MagicDamageAbsorb = value;
                    Item diamond = Caster.Backpack.FindItemByType(typeof(Diamond));
                    if (diamond != null)
                    {
                        diamond.Consume();
                    }
                    Caster.PlaySound(0x1ED);
                    Caster.FixedParticles(0x375A, 10, 15, 5037, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0), 0, EffectLayer.Waist);
                }
                else
                {
                    Caster.SendLocalizedMessage(1005385);                       // The spell will not adhere to you at this time.
                }

                FinishSequence();
            }
        }
コード例 #27
0
ファイル: Polymorph.cs プロジェクト: proxeeus/UORebirth
        public override void OnCast()
        {
            if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                Caster.SendLocalizedMessage(1005559);                   // This spell is already in effect.
            }
            else if (DisguiseGump.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(502167);                   // You cannot polymorph while disguised.
            }
            else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendLocalizedMessage(1042512);                   // You cannot polymorph while wearing body paint
            }
            else if (!Caster.CanBeginAction(typeof(IncognitoSpell)) || Caster.IsBodyMod)
            {
                DoFizzle();
            }
            else if (CheckSequence())
            {
                if (Caster.BeginAction(typeof(PolymorphSpell)))
                {
                    if (m_NewBody != 0)
                    {
                        if (!((Body)m_NewBody).IsHuman)
                        {
                            Mobiles.IMount mt = Caster.Mount;

                            if (mt != null)
                            {
                                mt.Rider = null;
                            }
                        }

                        Caster.BodyMod = m_NewBody;

                        if (m_NewBody == 400 || m_NewBody == 401)
                        {
                            Caster.HueMod = Utility.RandomSkinHue();
                        }
                        else
                        {
                            Caster.HueMod = 0;
                        }

                        BaseArmor.ValidateMobile(Caster);

                        StopTimer(Caster);

                        Timer t = new InternalTimer(Caster);

                        m_Timers[Caster] = t;

                        t.Start();
                    }
                }
                else
                {
                    Caster.SendLocalizedMessage(1005559);                       // This spell is already in effect.
                }
            }

            FinishSequence();
        }
コード例 #28
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();
        }
コード例 #29
0
ファイル: Alteration.cs プロジェクト: Zilmerx/Temrael2
        public override void OnCast()
        {
            if (!Caster.CanBeginAction(typeof(AlterationSpell)))
            {
                if (Caster is PlayerMobile)
                {
                    PlayerMobile pm = (PlayerMobile)Caster;
                    pm.Transformation.OnTransformationChange(0, null, -1, true);
                }
                else
                {
                    Caster.BodyMod = 0;
                    Caster.NameMod = null;
                }

                Caster.EndAction(typeof(AlterationSpell));

                Effects.SendTargetParticles(Caster, 0x373A, 10, 15, 5036, EffectLayer.Head);
                Caster.PlaySound(0x3BD);

                if (Caster is PlayerMobile)
                {
                    ((PlayerMobile)Caster).CheckRaceSkin();
                }

                BaseArmor.ValidateMobile(Caster);
            }
            else if (m_NewBody == 0)
            {
                ArrayList entries = new ArrayList();
                entries.Add(new MetamorphoseGump.MetamorphoseEntry("Chien", ShrinkTable.Lookup(0xD9), 0xD9, 1015237, 0, 0, 0, 0, 0));
                entries.Add(new MetamorphoseGump.MetamorphoseEntry("Chat", ShrinkTable.Lookup(0xC9), 0xC9, 1015246, 0, 0, 0, 0, 0));
                entries.Add(new MetamorphoseGump.MetamorphoseEntry("Diablotin", ShrinkTable.Lookup(0x4A), 0x4A, 1015246, 0, 0, 0, 0, 0));
                entries.Add(new MetamorphoseGump.MetamorphoseEntry("Morlask", ShrinkTable.Lookup(0x27), 0x27, 1015246, 0, 0, 0, 0, 0));

                Caster.SendGump(new MetamorphoseGump(Caster, Scroll, entries, 1));
            }
            else if (!CheckTransformation(Caster, Caster))
            {
                DoFizzle();
            }
            else if (CheckSequence())
            {
                if (Caster.BeginAction(typeof(AlterationSpell)))
                {
                    if (m_NewBody != 0)
                    {
                        if (!((Body)m_NewBody).IsHuman)
                        {
                            Mobiles.IMount mt = Caster.Mount;

                            if (mt != null)
                            {
                                mt.Rider = null;
                            }
                        }

                        if (Caster is PlayerMobile)
                        {
                            PlayerMobile pm = (PlayerMobile)Caster;
                            pm.Transformation.OnTransformationChange(m_NewBody, m_NameMod, m_HueMod, true);
                        }
                        else
                        {
                            Caster.BodyMod = m_NewBody;
                            Caster.NameMod = m_NameMod;
                            Caster.HueMod  = m_HueMod;
                        }

                        Effects.SendTargetParticles(Caster, 0x373A, 10, 15, 5036, EffectLayer.Head);
                        Caster.PlaySound(0x3BD);
                    }
                }
            }

            FinishSequence();
        }
コード例 #30
0
ファイル: Polymorph.cs プロジェクト: Drake1187/runuocustom
        public override void OnCast()
        {
            /*if ( Caster.Mounted )
             * {
             *      Caster.SendLocalizedMessage( 1042561 ); //Please dismount first.
             * }
             * else */
            if (Factions.Sigil.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1010521);                   // You cannot polymorph while you have a Town Sigil
            }
            else if (!Caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                if (Core.ML)
                {
                    EndPolymorph(Caster);
                }
                else
                {
                    Caster.SendLocalizedMessage(1005559);                       // This spell is already in effect.
                }
            }
            else if (TransformationSpellHelper.UnderTransformation(Caster))
            {
                Caster.SendLocalizedMessage(1061633);                   // You cannot polymorph while in that form.
            }
            else if (DisguiseTimers.IsDisguised(Caster))
            {
                Caster.SendLocalizedMessage(502167);                   // You cannot polymorph while disguised.
            }
            else if (Caster.BodyMod == 183 || Caster.BodyMod == 184)
            {
                Caster.SendLocalizedMessage(1042512);                   // You cannot polymorph while wearing body paint
            }
            else if (!Caster.CanBeginAction(typeof(IncognitoSpell)) || Caster.IsBodyMod)
            {
                DoFizzle();
            }
            else if (CheckSequence())
            {
                if (Caster.BeginAction(typeof(PolymorphSpell)))
                {
                    if (m_NewBody != 0)
                    {
                        if (!((Body)m_NewBody).IsHuman)
                        {
                            Mobiles.IMount mt = Caster.Mount;

                            if (mt != null)
                            {
                                mt.Rider = null;
                            }
                        }

                        Caster.BodyMod = m_NewBody;

                        if (m_NewBody == 400 || m_NewBody == 401)
                        {
                            Caster.HueMod = Utility.RandomSkinHue();
                        }
                        else
                        {
                            Caster.HueMod = 0;
                        }

                        BaseArmor.ValidateMobile(Caster);
                        BaseClothing.ValidateMobile(Caster);

                        if (!Core.ML)
                        {
                            StopTimer(Caster);

                            Timer t = new InternalTimer(Caster);

                            m_Timers[Caster] = t;

                            t.Start();
                        }
                    }
                }
                else
                {
                    Caster.SendLocalizedMessage(1005559);                       // This spell is already in effect.
                }
            }

            FinishSequence();
        }