public override void OnCast() { if (!Caster.CanBeginAction(typeof(ResearchRockFlesh))) { ResearchRockFlesh.RemoveEffect(Caster); } ResistanceMod[] mods = (ResistanceMod[])TableStoneFlesh[Caster]; mods = new ResistanceMod[1] { new ResistanceMod(ResistanceType.Physical, 90) }; TableStoneFlesh[Caster] = mods; for (int i = 0; i < mods.Length; ++i) { Caster.AddResistanceMod(mods[i]); } double TotalTime = DamagingSkill(Caster) * 4; new InternalTimer(Caster, TimeSpan.FromSeconds(TotalTime)).Start(); Caster.BodyMod = 14; Caster.HueMod = 0xB31; Mobiles.IMount mt = Caster.Mount; if (mt != null) { Server.Mobiles.EtherealMount.EthyDismount(Caster, true); mt.Rider = null; } Caster.SendMessage("Your flesh turns to stone."); Server.Misc.Research.ConsumeScroll(Caster, true, spellID, false); KarmaMod(Caster, ((int)RequiredSkill + RequiredMana)); Point3D hands = new Point3D((Caster.X + 1), (Caster.Y + 1), (Caster.Z + 8)); Effects.SendLocationParticles(EffectItem.Create(hands, Caster.Map, EffectItem.DefaultDuration), 0x3837, 9, 32, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0xB7F), 0, 5022, 0); Caster.PlaySound(0x65A); FinishSequence(); }
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(); }
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(); }
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(); }
public static bool OnCast(Mobile caster, Spell spell) { ITransformationSpell transformSpell = spell as ITransformationSpell; if (transformSpell == null) { return(false); } if (Factions.Sigil.ExistsOn(caster)) { caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil. } else if (!caster.CanBeginAction(typeof(PolymorphSpell))) { caster.SendLocalizedMessage(1061628); // You can't do that while polymorphed. } else if (DisguiseTimers.IsDisguised(caster)) { caster.SendLocalizedMessage(1061631); // You can't do that while disguised. return(false); } else if (AnimalForm.UnderTransformation(caster)) { caster.SendLocalizedMessage(1061091); // You cannot cast that spell in this form. } else if (!caster.CanBeginAction(typeof(IncognitoSpell)) || (caster.IsBodyMod && GetContext(caster) == null)) { spell.DoFizzle(); } else if (spell.CheckSequence()) { TransformContext context = GetContext(caster); Type ourType = spell.GetType(); bool wasTransformed = (context != null); bool ourTransform = (wasTransformed && context.Type == ourType); if (wasTransformed) { RemoveContext(caster, context, ourTransform); if (ourTransform) { caster.PlaySound(0xFA); caster.FixedParticles(0x3728, 1, 13, 5042, EffectLayer.Waist); } } if (!ourTransform) { List <ResistanceMod> mods = new List <ResistanceMod>(); if (transformSpell.PhysResistOffset != 0) { mods.Add(new ResistanceMod(ResistanceType.Physical, transformSpell.PhysResistOffset)); } if (transformSpell.FireResistOffset != 0) { mods.Add(new ResistanceMod(ResistanceType.Fire, transformSpell.FireResistOffset)); } if (transformSpell.ColdResistOffset != 0) { mods.Add(new ResistanceMod(ResistanceType.Cold, transformSpell.ColdResistOffset)); } if (transformSpell.PoisResistOffset != 0) { mods.Add(new ResistanceMod(ResistanceType.Poison, transformSpell.PoisResistOffset)); } if (transformSpell.NrgyResistOffset != 0) { mods.Add(new ResistanceMod(ResistanceType.Energy, transformSpell.NrgyResistOffset)); } if (!((Body)transformSpell.Body).IsHuman) { Mobiles.IMount mt = caster.Mount; if (mt != null) { mt.Rider = null; } } caster.BodyMod = transformSpell.Body; caster.HueMod = transformSpell.Hue; for (int i = 0; i < mods.Count; ++i) { caster.AddResistanceMod(mods[i]); } transformSpell.DoEffect(caster); Timer timer = new TransformTimer(caster, transformSpell); timer.Start(); AddContext(caster, new TransformContext(timer, mods, ourType, transformSpell)); return(true); } } return(false); }
public override bool OnEquip(Mobile mob) { if (base.OnEquip(mob)) { if (mob.BodyMod > 0) { mob.PublicOverheadMessage(MessageType.Regular, 0x44, false, "This costume will not fit in this form"); mob.AddToBackpack(this); return(false); } else { if (this.Name == "Ghost Costume") { mob.BodyMod = 0x3CA; mob.HueMod = 1150; mob.NameMod = "Spooky Ghost"; } else if (this.Name == "Mummy Costume") { mob.BodyMod = 154; mob.HueMod = 0; mob.NameMod = "Scary Mummy"; } else if (this.Name == "Zombie Costume") { mob.BodyMod = 728; mob.HueMod = 0; mob.NameMod = "Creepy Zombie"; } else if (this.Name == "Vampire Costume") { mob.BodyMod = 125; mob.HueMod = 0; mob.NameMod = "Terrifying Vampire"; } else if (this.Name == "Skeleton Costume") { mob.BodyMod = 90; mob.HueMod = 0; mob.NameMod = "Frightening Skeleton"; } else if (this.Name == "Devil Costume") { mob.BodyMod = 509; mob.HueMod = 0; mob.NameMod = "Horrifying Devil"; } else if (this.Name == "Lizardman Costume") { mob.BodyMod = 534; mob.HueMod = 0; mob.NameMod = "Ugly Lizardman"; } else if (this.Name == "Orc Costume") { mob.BodyMod = 7; mob.HueMod = 0; mob.NameMod = "Foul Orc"; } else if (this.Name == "Goblin Costume") { mob.BodyMod = 632; mob.HueMod = 61; mob.NameMod = "Goofy Goblin"; } else if (this.Name == "Harpy Costume") { mob.BodyMod = 153; mob.HueMod = 0; mob.NameMod = "Unsightly Harpy"; } else if (this.Name == "Gargoyle Costume") { mob.BodyMod = 4; mob.HueMod = 0; mob.NameMod = "Horrid Gargoyle"; } else if (this.Name == "Headless Costume") { mob.BodyMod = 31; mob.HueMod = 0; mob.NameMod = "Freaky Headless One"; } else if (this.Name == "Lich Costume") { mob.BodyMod = 24; mob.HueMod = 0; mob.NameMod = "Dreadful Lich"; } else if (this.Name == "Toad Costume") { mob.BodyMod = 270; mob.HueMod = 268; mob.NameMod = "Decrepit Toad"; } else if (this.Name == "Elemental Costume") { switch (Utility.RandomMinMax(0, 3)) { case 0: mob.BodyMod = 14; break; case 1: mob.BodyMod = 13; break; case 2: mob.BodyMod = 15; break; case 3: mob.BodyMod = 16; break; } mob.HueMod = 0; mob.NameMod = "Monstrous Elemental"; } else if (this.Name == "Centaur Costume") { mob.BodyMod = 101; mob.HueMod = 0; mob.NameMod = "Wild Centaur"; } else if (this.Name == "Succubus Costume") { mob.BodyMod = 149; mob.HueMod = 0; mob.NameMod = "Evil Succubus"; } else if (this.Name == "Dragon Costume") { mob.BodyMod = 59; mob.HueMod = 0; mob.NameMod = "Diabolical Dragon"; } else if (this.Name == "Werewolf Costume") { mob.BodyMod = 708; mob.HueMod = 0; mob.NameMod = "Ravaging Werewolf"; } else if (this.Name == "Ape Costume") { mob.BodyMod = 332; mob.HueMod = 0x902; mob.NameMod = "Primitive Ape"; } else if (this.Name == "Nightmare Costume") { mob.BodyMod = 795; mob.HueMod = 0; mob.NameMod = "Worst Nightmare"; } else if (this.Name == "Treant Costume") { mob.BodyMod = 309; mob.HueMod = 0; mob.NameMod = "Tranquil Treant"; } else if (this.Name == "Minotaur Costume") { mob.BodyMod = 78; mob.HueMod = 0; mob.NameMod = "Mangy Minotaur"; } else if (this.Name == "Frankenstein Costume") { mob.BodyMod = 69; mob.HueMod = 0; mob.NameMod = "Frankenstein's Monster"; } else if (this.Name == "Swamp Thing Costume") { mob.BodyMod = 172; mob.HueMod = 0; mob.NameMod = "Swamp Thing"; } else if (this.Name == "Black Knight Costume") { mob.BodyMod = 311; mob.HueMod = 0; mob.NameMod = "The Black Knight"; } Mobiles.IMount mt = mob.Mount; if (mt != null) { Server.Mobiles.EtherealMount.EthyDismount(mob, true); mt.Rider = null; } return(true); } } return(base.OnEquip(mob)); }
public override void OnCast() { /*if ( Caster.Mounted ) * { * Caster.SendAsciiMessage( "Please dismount first." ); * } * else */ if (Factions.Sigil.ExistsOn(Caster)) { Caster.SendAsciiMessage("You cannot polymorph while you have a Town Sigil."); } else if (!Caster.CanBeginAction(typeof(PolymorphSpell))) { Caster.SendAsciiMessage("This spell is already in effect."); } else if (Necromancy.TransformationSpell.UnderTransformation(Caster)) { Caster.SendAsciiMessage("You cannot polymorph while in that form."); } else if (DisguiseGump.IsDisguised(Caster)) { Caster.SendAsciiMessage("You cannot polymorph while disguised."); } else if (Caster.BodyMod == 183 || Caster.BodyMod == 184) { Caster.SendAsciiMessage("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.SendAsciiMessage("This spell is already in effect."); } } FinishSequence(); }
public override void OnCast() { Mobile caster = this.Caster; if (Factions.Sigil.ExistsOn(Caster)) { Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil. } else if (!caster.CanBeginAction(typeof(PolymorphSpell))) { Caster.SendLocalizedMessage(1061628); // You can't do that while polymorphed. } else if (Spells.Ninjitsu.AnimalForm.UnderTransformation(Caster)) { Caster.SendLocalizedMessage(1061091); // You cannot cast that spell in this form. } else if (!caster.CanBeginAction(typeof(IncognitoSpell)) || (caster.IsBodyMod && GetContext(caster) == null)) { DoFizzle(); } else if (CheckSequence()) { TransformContext context = GetContext(caster); Type ourType = this.GetType(); bool wasTransformed = (context != null); bool ourTransform = (wasTransformed && context.Type == ourType); if (wasTransformed) { RemoveContext(caster, context, true); if (ourTransform) { caster.PlaySound(0xFA); caster.FixedParticles(0x3728, 1, 13, 5042, EffectLayer.Waist); } } if (!ourTransform) { ArrayList mods = new ArrayList(); if (PhysResistOffset != 0) { mods.Add(new ResistanceMod(ResistanceType.Physical, PhysResistOffset)); } if (FireResistOffset != 0) { mods.Add(new ResistanceMod(ResistanceType.Fire, FireResistOffset)); } if (ColdResistOffset != 0) { mods.Add(new ResistanceMod(ResistanceType.Cold, ColdResistOffset)); } if (PoisResistOffset != 0) { mods.Add(new ResistanceMod(ResistanceType.Poison, PoisResistOffset)); } if (NrgyResistOffset != 0) { mods.Add(new ResistanceMod(ResistanceType.Energy, NrgyResistOffset)); } if (!((Body)this.Body).IsHuman) { Mobiles.IMount mt = Caster.Mount; if (mt != null) { mt.Rider = null; } } caster.BodyMod = this.Body; caster.HueMod = this.Hue; for (int i = 0; i < mods.Count; ++i) { caster.AddResistanceMod((ResistanceMod)mods[i]); } PlayEffect(caster); Timer timer = new TransformTimer(caster, this); timer.Start(); AddContext(caster, new TransformContext(timer, mods, ourType)); } } FinishSequence(); }
public override void OnCast() { Mobile caster = this.Caster; /*if ( caster.Mounted ) * { * } * else */ if (Factions.Sigil.ExistsOn(Caster)) { } else if (!caster.CanBeginAction(typeof(PolymorphSpell))) { } else if (!caster.CanBeginAction(typeof(IncognitoSpell)) || !caster.CanBeginAction(typeof(PolymorphSpell)) || (caster.IsBodyMod && GetContext(caster) == null)) { DoFizzle(); } else if (CheckSequence()) { TransformContext context = GetContext(caster); Type ourType = this.GetType(); bool wasTransformed = (context != null); bool ourTransform = (wasTransformed && context.Type == ourType); if (wasTransformed) { RemoveContext(caster, context, ourTransform); if (ourTransform) { caster.PlaySound(0xFA); caster.FixedParticles(0x3728, 1, 13, 5042, EffectLayer.Waist); } } if (!ourTransform) { ArrayList mods = new ArrayList(); if (PhysResistOffset != 0) { mods.Add(new ResistanceMod(ResistanceType.Physical, PhysResistOffset)); } if (FireResistOffset != 0) { mods.Add(new ResistanceMod(ResistanceType.Fire, FireResistOffset)); } if (ColdResistOffset != 0) { mods.Add(new ResistanceMod(ResistanceType.Cold, ColdResistOffset)); } if (PoisResistOffset != 0) { mods.Add(new ResistanceMod(ResistanceType.Poison, PoisResistOffset)); } if (NrgyResistOffset != 0) { mods.Add(new ResistanceMod(ResistanceType.Energy, NrgyResistOffset)); } if (!((Body)this.Body).IsHuman) { Mobiles.IMount mt = Caster.Mount; if (mt != null) { mt.Rider = null; } } caster.BodyMod = this.Body; caster.HueMod = this.Hue; for (int i = 0; i < mods.Count; ++i) { caster.AddResistanceMod((ResistanceMod)mods[i]); } PlayEffect(caster); Timer timer = new TransformTimer(caster, this); timer.Start(); AddContext(caster, new TransformContext(timer, mods, ourType)); } } FinishSequence(); }
public void ToogleMetamorphose() { if (!Caster.CanBeginAction(typeof(MetamorphoseSpell))) { if (Caster is PlayerMobile) { PlayerMobile pm = (PlayerMobile)Caster; pm.Transformation.OnTransformationChange(0, null, -1, true); } else { Caster.BodyMod = 0; Caster.NameMod = null; Caster.HueMod = -1; } Caster.EndAction(typeof(MetamorphoseSpell)); if (Caster is PlayerMobile) { ((PlayerMobile)Caster).CheckRaceSkin(); } BaseArmor.ValidateMobile(Caster); Effects.SendTargetParticles(Caster, 0x373A, 10, 15, 5036, EffectLayer.Head); Caster.PlaySound(0x3BD); string name = String.Format("[Transformation] {0} Offset", StatType.Str); StatMod mod = Caster.GetStatMod(name); if (mod != null) { Caster.RemoveStatMod(name); } name = String.Format("[Transformation] {0} Offset", StatType.Dex); mod = Caster.GetStatMod(name); if (mod != null) { Caster.RemoveStatMod(name); } name = String.Format("[Transformation] {0} Offset", StatType.Int); mod = Caster.GetStatMod(name); if (mod != null) { Caster.RemoveStatMod(name); } } else if (m_NewBody == 0) { ArrayList entries = null; if (Caster is PlayerMobile) { entries = ((PlayerMobile)Caster).Transformation.MetamorphoseList; } if (entries != null) { Caster.SendGump(new MetamorphoseGump(Caster, Scroll, entries, 5)); } } else if (!CheckTransformation(Caster, Caster)) { DoFizzle(); } else if (CheckSequence()) { if (Caster.BeginAction(typeof(MetamorphoseSpell))) { if (m_NewBody != 0) { if (!((Body)m_NewBody).IsHuman) { Mobiles.IMount mt = Caster.Mount; if (mt != null) { mt.Rider = null; } } Caster.AddStatMod(new StatMod(StatType.Str, String.Format("[Transformation] {0} Offset", StatType.Str), m_StrMod, TimeSpan.Zero)); Caster.AddStatMod(new StatMod(StatType.Dex, String.Format("[Transformation] {0} Offset", StatType.Dex), m_DexMod, TimeSpan.Zero)); Caster.AddStatMod(new StatMod(StatType.Int, String.Format("[Transformation] {0} Offset", StatType.Int), m_IntMod, TimeSpan.Zero)); 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(); }
public static bool OnCast(Mobile caster, Spell spell) { ITransformationSpell transformSpell = spell as ITransformationSpell; if (transformSpell == null) { return(false); } if (!caster.CanBeginAction(typeof(PolymorphSpell))) { caster.SendLocalizedMessage(1061628); // You can't do that while polymorphed. } else if (DisguiseTimers.IsDisguised(caster)) { caster.SendLocalizedMessage(1061631); // You can't do that while disguised. return(false); } else if (!caster.CanBeginAction(typeof(IncognitoSpell)) || (caster.IsBodyMod && GetContext(caster) == null)) { spell.DoFizzle(); } else if (spell.CheckSequence()) { TransformContext context = GetContext(caster); Type ourType = spell.GetType(); bool wasTransformed = (context != null); bool ourTransform = (wasTransformed && context.Type == ourType); if (wasTransformed) { RemoveContext(caster, context, ourTransform); if (ourTransform) { caster.PlaySound(0xFA); caster.FixedParticles(0x3728, 1, 13, 5042, EffectLayer.Waist); } } if (!ourTransform) { if (!((Body)transformSpell.Body).IsHuman) { Mobiles.IMount mt = caster.Mount; if (mt != null) { mt.Rider = null; } } caster.BodyMod = transformSpell.Body; caster.HueMod = transformSpell.Hue; transformSpell.DoEffect(caster); Timer timer = new TransformTimer(caster, transformSpell); timer.Start(); AddContext(caster, new TransformContext(timer, ourType, transformSpell)); return(true); } } return(false); }
public override void OnCast() { if (Factions.Sigil.ExistsOn(Caster)) { Caster.SendLocalizedMessage(1010521); // You cannot polymorph while you have a Town Sigil } else if (!Caster.CanBeginAction(typeof(PolymorphSpell))) { Caster.SendLocalizedMessage(1005559); // This spell is already in effect. } else if (Necromancy.TransformationSpell.UnderTransformation(Caster)) { Caster.SendLocalizedMessage(1061633); // You cannot polymorph while in that form. } 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); BaseClothing.ValidateMobile(Caster); StopTimer(Caster); Timer t = new InternalTimer(Caster); m_Timers[Caster] = t; BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.Polymorph, 1075824, 1075823, t.Delay, Caster, String.Format("{0}\t{1}", GetArticleCliloc(m_NewBody), GetFormCliloc(m_NewBody)))); t.Start(); } } else { Caster.SendLocalizedMessage(1005559); // This spell is already in effect. } } FinishSequence(); }
public override void OnCast() { if (!Caster.CanBeginAction(typeof(MutationSpell))) { 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(MutationSpell)); 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("Dragonnet", ShrinkTable.Lookup(12), 12, 1015237, 0, 0, 0, 0, 2174)); entries.Add(new MetamorphoseGump.MetamorphoseEntry("Arbre sylvestre", ShrinkTable.Lookup(301), 301, 1015246, 0, 0, 0, 0, 0)); entries.Add(new MetamorphoseGump.MetamorphoseEntry("Golem d'os", ShrinkTable.Lookup(308), 308, 1015246, 0, 0, 0, 0, 0)); entries.Add(new MetamorphoseGump.MetamorphoseEntry("Golem de chaire", ShrinkTable.Lookup(304), 304, 1015237, 0, 0, 0, 0, 0)); entries.Add(new MetamorphoseGump.MetamorphoseEntry("Demonologue", ShrinkTable.Lookup(318), 318, 1015246, 0, 0, 0, 0, 0)); entries.Add(new MetamorphoseGump.MetamorphoseEntry("Mangeur d'âmes", ShrinkTable.Lookup(303), 303, 1015246, 0, 0, 0, 0, 0)); Caster.SendGump(new MetamorphoseGump(Caster, Scroll, entries, 6)); } else if (!CheckTransformation(Caster, Caster)) { DoFizzle(); } else if (CheckSequence()) { if (Caster.BeginAction(typeof(MutationSpell))) { 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(); }
public override void OnCast() { if (Caster.Flying) { Caster.SendLocalizedMessage(1113415); // You cannot use this ability while flying. } else if (!Caster.CanBeginAction(typeof(PolymorphSpell))) { EndPolymorph(Caster); } 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); } } else { Caster.SendLocalizedMessage(1005559); // This spell is already in effect. } } FinishSequence(); }
public override void OnCast() { if (Factions.Sigil.ExistsOn(Caster)) { Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil. } else if (!Caster.CanBeginAction(typeof(PolymorphSpell))) { Caster.SendLocalizedMessage(1061628); // You can't do that while polymorphed. } else if (!Caster.CanBeginAction(typeof(IncognitoSpell)) || (Caster.IsBodyMod && !UnderEffect(Caster))) { Caster.SendLocalizedMessage(1063218); // You cannot use that ability in this form. } else if (CheckSequence()) { if (UnderEffect(Caster)) { RemoveEffects(Caster); Caster.PlaySound(0xFA); Caster.Delta(MobileDelta.Resistances); } else { Mobiles.IMount mount = Caster.Mount; if (mount != null) { mount.Rider = null; } Caster.BodyMod = 0x2C1; Caster.HueMod = 0; int offset = (int)((GetBaseSkill(Caster) + GetBoostSkill(Caster)) / 24.0); List <ResistanceMod> mods = new List <ResistanceMod> { new ResistanceMod(ResistanceType.Physical, offset), new ResistanceMod(ResistanceType.Fire, offset), new ResistanceMod(ResistanceType.Cold, offset), new ResistanceMod(ResistanceType.Poison, offset), new ResistanceMod(ResistanceType.Energy, offset) }; foreach (ResistanceMod mod in mods) { Caster.AddResistanceMod(mod); } m_Table[Caster] = mods; Caster.PlaySound(0x65A); Caster.Delta(MobileDelta.Resistances); BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.StoneForm, 1080145, 1080146, string.Format("-10\t-2\t{0}\t{1}\t{2}", offset, GetResistCapBonus(Caster), GetDIBonus(Caster)), false)); } } FinishSequence(); }
public override void OnCast() { Mobile caster = this.Caster; if (caster.Mounted) { caster.SendLocalizedMessage(1042561); // Please dismount first. } else if (!caster.CanBeginAction(typeof(IncognitoSpell))) { caster.SendMessage("Vous ne pouvez faire ce sort en étant sous l'effet de l'incognito."); } else if (!caster.CanBeginAction(typeof(PolymorphSpell))) { caster.SendMessage("Vous ne pouvez faire ce sort en étant transformé."); } /*else if (!caster.CanBeginAction(typeof(ChauveSouris))) * { * caster.SendMessage("Vous ne pouvez vous transformer en étant sous la forme d'une chauve-souris."); * } * else if (caster is PlayerMobile && ((PlayerMobile)caster).Disguised) * { * caster.SendMessage("Vous ne pouvez faire ce sort en étant déguisé."); * }*/ else if (CheckSequence()) { TransformContext context = GetContext(caster); Type ourType = this.GetType(); bool wasTransformed = (context != null); bool ourTransform = (wasTransformed && context.Type == ourType); if (wasTransformed) { RemoveContext(caster, context, ourTransform); if (ourTransform) { caster.PlaySound(0xFA); Effects.SendTargetParticles(Caster, 0x3728, 1, 13, 5042, EffectLayer.Waist); } } if (!ourTransform) { ArrayList mods = new ArrayList(); if (StrOffset != 0) { mods.Add(new StatMod(StatType.Str, "TransformationSpell", StrOffset, TimeSpan.FromDays(90.0))); } if (DexOffset != 0) { mods.Add(new StatMod(StatType.Dex, "TransformationSpell", DexOffset, TimeSpan.FromDays(90.0))); } if (IntOffset != 0) { mods.Add(new StatMod(StatType.Int, "TransformationSpell", IntOffset, TimeSpan.FromDays(90.0))); } if (!((Body)this.Body).IsHuman) { Mobiles.IMount mt = Caster.Mount; if (mt != null) { mt.Rider = null; } } caster.BodyMod = this.Body; caster.HueMod = this.Hue; for (int i = 0; i < mods.Count; ++i) { caster.AddStatMod((StatMod)mods[i]); } PlayEffect(caster); Timer timer = new TransformTimer(caster, this); timer.Start(); AddContext(caster, new TransformContext(timer, mods, ourType)); } } FinishSequence(); }