public override void OnCast() { if (CheckSequence()) { Caster.SendLocalizedMessage(1063120); // You feel that you might be able to deflect any attack! Caster.FixedParticles(0x376A, 1, 20, 0x7F5, 0x960, 3, EffectLayer.Waist); Caster.PlaySound(0x51B); OnCastSuccessful(Caster); BeginEvasion(Caster); Caster.BeginAction(typeof(Evasion)); Timer.DelayCall(TimeSpan.FromSeconds(20.0), delegate { Caster.EndAction(typeof(Evasion)); }); } FinishSequence(); }
public override void OnCast() { if (CheckSequence()) { // Values var bonus1 = 2 + (int)(Caster.Skills[SkillName.Mysticism].Value / 20); var bonus = 1 + (int)(Caster.Skills[SkillName.Focus].Value / 20); // Mount var mount = Caster.Mount; if (mount != null) { mount.Rider = null; } // Resists var mods = new List <ResistanceMod>(); mods.Add(new ResistanceMod(ResistanceType.Physical, bonus1 + bonus)); mods.Add(new ResistanceMod(ResistanceType.Fire, bonus1 + bonus)); mods.Add(new ResistanceMod(ResistanceType.Cold, bonus1 + bonus)); mods.Add(new ResistanceMod(ResistanceType.Poison, bonus1 + bonus)); mods.Add(new ResistanceMod(ResistanceType.Energy, bonus1 + bonus)); for (var i = 0; i < mods.Count; i++) { Caster.AddResistanceMod(mods[i]); } // Effects Caster.BodyMod = 705; Caster.PlaySound(0x65A); Caster.FixedParticles(0x3728, 1, 13, 9918, 92, 3, EffectLayer.Head); m_Table.Add(Caster, mods); Enhancement.SetValue(Caster, AosAttribute.CastSpeed, -2, "Stone Form"); Enhancement.SetValue(Caster, AosAttribute.WeaponSpeed, -10, "Stone Form"); Caster.BeginAction(typeof(StoneFormSpell)); } FinishSequence(); }
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)(Math.Min(Caster.Skills[SkillName.EvalInt].Value, 100.0) + Caster.Skills[SkillName.Meditation].Value); if (!Caster.IsT2A) { value += Caster.Skills[SkillName.Inscribe].Value; } value /= 4; if (value < 0) { value = 0; } else if (value > 75) { value = 75.0; } m_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(); }
public override void OnCast() { if (!Caster.CanBeginAction(typeof(ClericDivineFocusSpell))) { Caster.SendMessage("This spell is already in effect"); return; } if (CheckSequence()) { Caster.BeginAction(typeof(ClericDivineFocusSpell)); Timer t = new InternalTimer(Caster); m_Table[Caster] = t; t.Start(); Caster.FixedParticles(0x375A, 1, 15, 0x480, 1, 4, EffectLayer.Waist); } }
public override void OnCast() { if (!Caster.CanBeginAction(typeof(ResearchAirWalk))) { ResearchAirWalk.RemoveEffect(Caster); } int TotalTime = (int)((DamagingSkill(Caster) * 20) / 60); new InternalTimer(Caster, TimeSpan.FromSeconds(TotalTime)).Start(); Caster.BeginAction(typeof(ResearchAirWalk)); Point3D air = new Point3D((Caster.X + 1), (Caster.Y + 1), (Caster.Z + 5)); Effects.SendLocationParticles(EffectItem.Create(air, Caster.Map, EffectItem.DefaultDuration), 0x5590, 9, 32, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0), 0, 5022, 0); Caster.PlaySound(0x014); Server.Misc.Research.ConsumeScroll(Caster, true, spellID, false); FinishSequence(); }
public override void OnCast() { TransformationSpellHelper.OnCast(Caster, this); if ( CheckSequence() ) { RemoveEffect(Caster); object[] mods = new object[] { new StatMod( StatType.Str, "[Cleric] Str Offset", 10, TimeSpan.Zero ), new StatMod( StatType.Dex, "[Cleric] Dex Offset", 10, TimeSpan.Zero ), new StatMod( StatType.Int, "[Cleric] Int Offset", 10, TimeSpan.Zero ), new DefaultSkillMod( SkillName.Macing, true, 10 ), new DefaultSkillMod( SkillName.Healing, true, 10 ), new DefaultSkillMod( SkillName.Anatomy, true, 10 ) }; m_Table[Caster] = mods; Caster.AddStatMod( (StatMod)mods[0] ); Caster.AddStatMod( (StatMod)mods[1] ); Caster.AddStatMod( (StatMod)mods[2] ); Caster.AddSkillMod( (SkillMod)mods[3] ); Caster.AddSkillMod( (SkillMod)mods[4] ); Caster.AddSkillMod( (SkillMod)mods[5] ); double span = 20.0 * ClericDivineFocusSpell.GetScalar( Caster ); new InternalTimer( Caster, TimeSpan.FromMinutes( (int)span ) ).Start(); IMount mount = Caster.Mount; if ( mount != null ) mount.Rider = null; Caster.BodyMod = 123; Caster.BeginAction( typeof( ClericAngelicFaithSpell ) ); Caster.PlaySound( 0x165 ); Caster.FixedParticles( 0x3728, 1, 13, 0x480, 92, 3, EffectLayer.Head ); } FinishSequence(); }
public void Target(Mobile m) { if (!Caster.CanSee(m)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (!CheckLineOfSight(m)) { this.DoFizzle(); Caster.SendAsciiMessage("Target is not in line of sight"); } else { 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 (CheckSequence()) { if (Caster.BeginAction(typeof(DefensiveSpell))) { int value = (int)(Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.Inscribe].Value); value = (int)(8 + (value / 200) * 7.0);//absorb from 8 to 15 "circles" Caster.MagicDamageAbsorb = value; Caster.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist); Caster.PlaySound(0x1E9); } else { Caster.SendLocalizedMessage(1005385); // The spell will not adhere to you at this time. } } FinishSequence(); } }
public override void OnCast() { TransformationSpellHelper.OnCast(Caster, this); if (CheckSequence()) { RemoveEffect(Caster); int modify = (int)((Caster.Skills[SkillName.Healing].Value / 25) + (Caster.Skills[SkillName.SpiritSpeak].Value / 25)); modify = Server.Misc.MyServerSettings.PlayerLevelMod(modify, Caster); object[] mods = new object[] { new StatMod(StatType.Str, "[] Str Offset", modify, TimeSpan.Zero), new StatMod(StatType.Dex, "[] Dex Offset", modify, TimeSpan.Zero), new StatMod(StatType.Int, "[] Int Offset", modify, TimeSpan.Zero), new DefaultSkillMod(SkillName.Parry, true, modify), new DefaultSkillMod(SkillName.Tactics, true, modify), new DefaultSkillMod(SkillName.Anatomy, true, modify) }; m_Table[Caster] = mods; Caster.AddStatMod((StatMod)mods[0]); Caster.AddStatMod((StatMod)mods[1]); Caster.AddStatMod((StatMod)mods[2]); Caster.AddSkillMod((SkillMod)mods[3]); Caster.AddSkillMod((SkillMod)mods[4]); Caster.AddSkillMod((SkillMod)mods[5]); double span = (Caster.Skills[SkillName.Healing].Value + (Caster.Skills[SkillName.SpiritSpeak].Value / 2)); new InternalTimer(Caster, TimeSpan.FromSeconds((int)span)).Start(); Caster.BeginAction(typeof(SanctifySpell)); Caster.PlaySound(0x5C9); Point3D wings = new Point3D(Caster.X + 1, Caster.Y + 1, Caster.Z + 18); Effects.SendLocationEffect(wings, Caster.Map, 0x3FE5, 30, 10, 0, 0); } FinishSequence(); }
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(); }
public override void OnCast() { TransformationSpellHelper.OnCast(Caster, this); if (CheckSequence()) { RemoveEffect(Caster); int modify = (int)((Caster.Skills[SkillName.Healing].Value / 5) + (Caster.Skills[SkillName.SpiritSpeak].Value / 10)); object[] mods = new object[] { new StatMod(StatType.Str, "[] Str Offset", modify, TimeSpan.Zero), new StatMod(StatType.Dex, "[] Dex Offset", modify, TimeSpan.Zero), new StatMod(StatType.Int, "[] Int Offset", modify, TimeSpan.Zero), new DefaultSkillMod(SkillName.Parry, true, modify), new DefaultSkillMod(SkillName.Tactics, true, modify), new DefaultSkillMod(SkillName.Anatomy, true, modify) }; m_Table[Caster] = mods; Caster.AddStatMod((StatMod)mods[0]); Caster.AddStatMod((StatMod)mods[1]); Caster.AddStatMod((StatMod)mods[2]); Caster.AddSkillMod((SkillMod)mods[3]); Caster.AddSkillMod((SkillMod)mods[4]); Caster.AddSkillMod((SkillMod)mods[5]); double span = (Caster.Skills[SkillName.Healing].Value + (Caster.Skills[SkillName.SpiritSpeak].Value / 2)); new InternalTimer(Caster, TimeSpan.FromSeconds((int)span)).Start(); Caster.BeginAction(typeof(SanctifySpell)); Caster.PlaySound(0x5C9); Caster.FixedParticles(0x3FE5, 1, 13, 0, 92, 3, EffectLayer.Head); } FinishSequence(); }
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)); } }
public void Target(Gold weapon) { if (!Caster.CanSee(weapon)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (CheckSequence()) { if (Caster.BeginAction(typeof(AncientFalseCoinSpell))) { if (this.Scroll != null) { Scroll.Consume(); } FakeGold fake = new FakeGold(); fake.m_Amount = weapon.Amount * 5; fake.Name = "" + (weapon.Amount * 5) + " Gold Coins"; m_Fake = fake; Caster.AddToBackpack(fake); Caster.PlaySound(0x2E6); IEntity from = new Entity(Serial.Zero, new Point3D(Caster.X, Caster.Y, Caster.Z + 50), Caster.Map); IEntity to = new Entity(Serial.Zero, new Point3D(Caster.X, Caster.Y, Caster.Z), Caster.Map); Effects.SendMovingParticles(from, to, 0x1EC6, 1, 0, false, false, 33, 3, 9501, 1, 0, EffectLayer.Head, 0x100); StopTimer(Caster); Timer t = new InternalTimer(Caster, m_Fake); m_Timers[Caster] = t; t.Start(); } } FinishSequence(); }
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(); }
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(); }
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!"); } }
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(); } }
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 override void OnCast() { if (Factions.Sigil.ExistsOn(Caster)) { Caster.SendLocalizedMessage(1010445); // You cannot incognito if you have a sigil } else if (!Caster.CanBeginAction(typeof(IncognitoSpell))) { Caster.SendLocalizedMessage(1005559); // This spell is already in effect. } else if (Caster.BodyMod == 183 || Caster.BodyMod == 184) { Caster.SendLocalizedMessage(1042402); // You cannot use incognito while wearing body paint } else if (!Caster.CanBeginAction(typeof(PolymorphSpell)) || Caster.IsBodyMod) { DoFizzle(); } else if (CheckSequence()) { if (Caster.BeginAction(typeof(IncognitoSpell))) { DisguiseGump.StopTimer(Caster); Caster.BodyMod = Utility.RandomList(400, 401); Caster.HueMod = Utility.RandomSkinHue(); Caster.NameMod = Caster.Body.IsFemale ? NameList.RandomName("female") : NameList.RandomName("male"); PlayerMobile pm = Caster as PlayerMobile; if (pm != null) { if (pm.Body.IsFemale) { pm.SetHairMods(Utility.RandomList(m_HairIDs), 0); } else { pm.SetHairMods(Utility.RandomList(m_HairIDs), Utility.RandomList(m_BeardIDs)); } pm.HairHue = Utility.RandomHairHue(); pm.FacialHairHue = Utility.RandomHairHue(); } Caster.FixedParticles(0x373A, 10, 15, 5036, EffectLayer.Head); Caster.PlaySound(0x3BD); BaseArmor.ValidateMobile(Caster); BaseClothing.ValidateMobile(Caster); StopTimer(Caster); int timeVal = ((6 * Caster.Skills.Magery.Fixed) / 50) + 1; if (timeVal > 144) { timeVal = 144; } TimeSpan length = TimeSpan.FromSeconds(timeVal); Timer t = new InternalTimer(Caster, length); m_Timers[Caster] = t; t.Start(); BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.Incognito, 1075819, length, Caster)); } else { Caster.SendLocalizedMessage(1005559); // This spell is already in effect. } } FinishSequence(); }
public override void OnCast() { if (Core.AOS) { /* The magic reflection spell decreases the caster's physical resistance, while increasing the caster's elemental resistances. * Physical decrease = 25 - (Inscription/20). * Elemental resistance = +10 (-20 physical, +10 elemental at GM Inscription) * The magic reflection spell has an indefinite duration, becoming active when cast, and deactivated when re-cast. * Reactive Armor, Protection, and Magic Reflection will stay on�even after logging out, even after dying�until you �turn them off� by casting them again. */ if (CheckSequence()) { var targ = Caster; if (m_Table.TryGetValue(targ, out var mods)) { targ.PlaySound(0x1ED); targ.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist); m_Table.Remove(targ); for (var i = 0; i < mods.Length; ++i) { targ.RemoveResistanceMod(mods[i]); } BuffInfo.RemoveBuff(targ, BuffIcon.MagicReflection); } else { targ.PlaySound(0x1E9); targ.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist); var physiMod = -25 + (int)(targ.Skills.Inscribe.Value / 20); var otherMod = 10; mods = new[] { new ResistanceMod(ResistanceType.Physical, physiMod), new ResistanceMod(ResistanceType.Fire, otherMod), new ResistanceMod(ResistanceType.Cold, otherMod), new ResistanceMod(ResistanceType.Poison, otherMod), new ResistanceMod(ResistanceType.Energy, otherMod) }; m_Table[targ] = mods; for (var i = 0; i < mods.Length; ++i) { targ.AddResistanceMod(mods[i]); } var buffFormat = $"{physiMod}\t+{otherMod}\t+{otherMod}\t+{otherMod}\t+{otherMod}"; BuffInfo.AddBuff(targ, new BuffInfo(BuffIcon.MagicReflection, 1075817, buffFormat, true)); } } FinishSequence(); } else { if (Caster.MagicDamageAbsorb > 0) { Caster.SendLocalizedMessage(1005559); // This spell is already in effect. } else if (!Caster.CanBeginAction <DefensiveSpell>()) { Caster.SendLocalizedMessage(1005385); // The spell will not adhere to you at this time. } else if (CheckSequence()) { if (Caster.BeginAction <DefensiveSpell>()) { var value = (int)(Caster.Skills.Magery.Value + Caster.Skills.Inscribe.Value); value = (int)(8 + value / 200.0 * 7.0); // absorb from 8 to 15 "circles" Caster.MagicDamageAbsorb = value; Caster.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist); Caster.PlaySound(0x1E9); } else { Caster.SendLocalizedMessage(1005385); // The spell will not adhere to you at this time. } } FinishSequence(); } }
public override void OnCast() { if (Core.AOS) { /* The reactive armor spell increases the caster's physical resistance, while lowering the caster's elemental resistances. * 15 + (Inscription/20) Physcial bonus * -5 Elemental * The reactive armor spell has an indefinite duration, becoming active when cast, and deactivated when re-cast. * Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out, even after dying—until you “turn them off” by casting them again. * (+20 physical -5 elemental at 100 Inscription) */ if (CheckSequence()) { Mobile targ = Caster; ResistanceMod[] mods = (ResistanceMod[])m_Table[targ]; if (mods == null) { targ.PlaySound(0x1E9); targ.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist); mods = new ResistanceMod[5] { new ResistanceMod(ResistanceType.Physical, 15 + (int)(targ.Skills[SkillName.Inscribe].Value / 20)), new ResistanceMod(ResistanceType.Fire, -5), new ResistanceMod(ResistanceType.Cold, -5), new ResistanceMod(ResistanceType.Poison, -5), new ResistanceMod(ResistanceType.Energy, -5) }; m_Table[targ] = mods; for (int i = 0; i < mods.Length; ++i) { targ.AddResistanceMod(mods[i]); } int physresist = 15 + (int)(targ.Skills[SkillName.Inscribe].Value / 20); string args = String.Format("{0}\t{1}\t{2}\t{3}\t{4}", physresist, 5, 5, 5, 5); BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.ReactiveArmor, 1075812, 1075813, args.ToString())); } else { targ.PlaySound(0x1ED); targ.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist); m_Table.Remove(targ); for (int i = 0; i < mods.Length; ++i) { targ.RemoveResistanceMod(mods[i]); } BuffInfo.RemoveBuff(Caster, BuffIcon.ReactiveArmor); } } FinishSequence(); } else { 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))) { int 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 > 40) { value = 40; } 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(); } }
public override void OnCast() { if (Sigil.ExistsOn(Caster)) { Caster.SendLocalizedMessage(1010445); // You cannot incognito if you have a sigil } else if (!Caster.CanBeginAction <IncognitoSpell>()) { Caster.SendLocalizedMessage(1005559); // This spell is already in effect. } else if (Caster.BodyMod == 183 || Caster.BodyMod == 184) { Caster.SendLocalizedMessage(1042402); // You cannot use incognito while wearing body paint } else if (DisguiseTimers.IsDisguised(Caster)) { Caster.SendLocalizedMessage(1061631); // You can't do that while disguised. } else if (!Caster.CanBeginAction <PolymorphSpell>() || Caster.IsBodyMod) { DoFizzle(); } else if (CheckSequence()) { if (Caster.BeginAction <IncognitoSpell>()) { DisguiseTimers.StopTimer(Caster); Caster.HueMod = Caster.Race.RandomSkinHue(); Caster.NameMod = Caster.Female ? NameList.RandomName("female") : NameList.RandomName("male"); var pm = Caster as PlayerMobile; if (pm?.Race != null) { pm.SetHairMods(pm.Race.RandomHair(pm.Female), pm.Race.RandomFacialHair(pm.Female)); pm.HairHue = pm.Race.RandomHairHue(); pm.FacialHairHue = pm.Race.RandomHairHue(); } Caster.FixedParticles(0x373A, 10, 15, 5036, EffectLayer.Head); Caster.PlaySound(0x3BD); BaseArmor.ValidateMobile(Caster); BaseClothing.ValidateMobile(Caster); StopTimer(Caster); var timeVal = 6 * Caster.Skills.Magery.Fixed / 50 + 1; if (timeVal > 144) { timeVal = 144; } var length = TimeSpan.FromSeconds(timeVal); var t = new InternalTimer(Caster, length); m_Timers[Caster] = t; t.Start(); BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.Incognito, 1075819, length, Caster)); } else { Caster.SendLocalizedMessage(1079022); // You're already incognitoed! } } FinishSequence(); }
public override void OnCast() { if (!CheckSequence()) { return; } else if (Caster.Mounted) { Caster.SendLocalizedMessage(1042561); //Please dismount first. } else if (!Caster.CanBeginAction(typeof(AncientPeerSpell))) { Caster.SendLocalizedMessage(1005559); // This spell is already in effect. } else if (Server.Spells.TransformationSpellHelper.UnderTransformation(Caster)) { Caster.SendMessage("Your eyes stay firmly inside your body."); } else if (DisguiseTimers.IsDisguised(Caster)) // { Caster.SendMessage("Your eyes stay firmly inside your body."); } else if (Caster.BodyMod == 183 || Caster.BodyMod == 184) { Caster.SendMessage("Your eyes stay firmly inside your body."); } else if (!Caster.CanBeginAction(typeof(IncognitoSpell)) || Caster.IsBodyMod) { DoFizzle(); } else if (CheckSequence()) { if (Caster.BeginAction(typeof(AncientPeerSpell))) { if (this.Scroll != null) { Scroll.Consume(); } Caster.PlaySound(0x2DF); Caster.SendMessage("Your sight leaves your body."); Souless dg = new Souless(this); dg.Body = Caster.Body; dg.Hue = Caster.Hue; dg.Name = Caster.Name; dg.SpeechHue = Caster.SpeechHue; dg.Fame = Caster.Fame; dg.Karma = Caster.Karma; dg.EmoteHue = Caster.EmoteHue; dg.Title = Caster.Title; dg.Criminal = (Caster.Criminal); dg.AccessLevel = Caster.AccessLevel; dg.Str = Caster.Str; dg.Int = Caster.Int; dg.Hits = Caster.Hits; dg.Dex = Caster.Dex; dg.Mana = Caster.Mana; dg.Stam = Caster.Stam; dg.VirtualArmor = (Caster.VirtualArmor); dg.SetSkill(SkillName.Wrestling, Caster.Skills[SkillName.Wrestling].Value); dg.SetSkill(SkillName.Tactics, Caster.Skills[SkillName.Tactics].Value); dg.SetSkill(SkillName.Anatomy, Caster.Skills[SkillName.Anatomy].Value); dg.SetSkill(SkillName.Magery, Caster.Skills[SkillName.Magery].Value); dg.SetSkill(SkillName.MagicResist, Caster.Skills[SkillName.MagicResist].Value); dg.SetSkill(SkillName.Meditation, Caster.Skills[SkillName.Meditation].Value); dg.SetSkill(SkillName.EvalInt, Caster.Skills[SkillName.EvalInt].Value); dg.SetSkill(SkillName.Archery, Caster.Skills[SkillName.Archery].Value); dg.SetSkill(SkillName.Macing, Caster.Skills[SkillName.Macing].Value); dg.SetSkill(SkillName.Swords, Caster.Skills[SkillName.Swords].Value); dg.SetSkill(SkillName.Fencing, Caster.Skills[SkillName.Fencing].Value); dg.SetSkill(SkillName.Lumberjacking, Caster.Skills[SkillName.Lumberjacking].Value); dg.SetSkill(SkillName.Alchemy, Caster.Skills[SkillName.Alchemy].Value); dg.SetSkill(SkillName.Parry, Caster.Skills[SkillName.Parry].Value); dg.SetSkill(SkillName.Focus, Caster.Skills[SkillName.Focus].Value); dg.SetSkill(SkillName.Necromancy, Caster.Skills[SkillName.Necromancy].Value); dg.SetSkill(SkillName.Chivalry, Caster.Skills[SkillName.Chivalry].Value); dg.SetSkill(SkillName.ArmsLore, Caster.Skills[SkillName.ArmsLore].Value); dg.SetSkill(SkillName.Poisoning, Caster.Skills[SkillName.Poisoning].Value); dg.SetSkill(SkillName.SpiritSpeak, Caster.Skills[SkillName.SpiritSpeak].Value); dg.SetSkill(SkillName.Stealing, Caster.Skills[SkillName.Stealing].Value); dg.SetSkill(SkillName.Inscribe, Caster.Skills[SkillName.Inscribe].Value); dg.Kills = (Caster.Kills); m_PeerMod = new ArrayList(); double loss = (0 - Caster.Skills[SkillName.AnimalTaming].Base); SkillMod sk = new DefaultSkillMod(SkillName.AnimalTaming, true, loss); Caster.AddSkillMod(sk); m_PeerMod.Add(sk); double loss1 = (0 - Caster.Skills[SkillName.AnimalLore].Base); SkillMod sk1 = new DefaultSkillMod(SkillName.AnimalLore, true, loss1);// Druidry Caster.AddSkillMod(sk1); m_PeerMod.Add(sk1); double loss3 = (0 - Caster.Skills[SkillName.Necromancy].Base); SkillMod sk3 = new DefaultSkillMod(SkillName.Necromancy, true, loss3); Caster.AddSkillMod(sk3); m_PeerMod.Add(sk3); double loss4 = (0 - Caster.Skills[SkillName.TasteID].Base); SkillMod sk4 = new DefaultSkillMod(SkillName.TasteID, true, loss4); Caster.AddSkillMod(sk4); m_PeerMod.Add(sk4); // Clear Items RemoveFromAllLayers(dg); // Then copy CopyFromLayer(Caster, dg, Layer.FirstValid); CopyFromLayer(Caster, dg, Layer.OneHanded); CopyFromLayer(Caster, dg, Layer.TwoHanded); CopyFromLayer(Caster, dg, Layer.Shoes); CopyFromLayer(Caster, dg, Layer.Pants); CopyFromLayer(Caster, dg, Layer.Shirt); CopyFromLayer(Caster, dg, Layer.Helm); CopyFromLayer(Caster, dg, Layer.Gloves); CopyFromLayer(Caster, dg, Layer.Ring); CopyFromLayer(Caster, dg, Layer.Talisman); CopyFromLayer(Caster, dg, Layer.Neck); CopyFromLayer(Caster, dg, Layer.Hair); CopyFromLayer(Caster, dg, Layer.Waist); CopyFromLayer(Caster, dg, Layer.InnerTorso); CopyFromLayer(Caster, dg, Layer.Bracelet); //CopyFromLayer(Caster, dg, Layer.Unused_xF); CopyFromLayer(Caster, dg, Layer.FacialHair); CopyFromLayer(Caster, dg, Layer.MiddleTorso); CopyFromLayer(Caster, dg, Layer.Earrings); CopyFromLayer(Caster, dg, Layer.Arms); CopyFromLayer(Caster, dg, Layer.Cloak); CopyFromLayer(Caster, dg, Layer.Backpack); CopyFromLayer(Caster, dg, Layer.OuterTorso); CopyFromLayer(Caster, dg, Layer.OuterLegs); CopyFromLayer(Caster, dg, Layer.InnerLegs); CopyFromLayer(Caster, dg, Layer.LastUserValid); CopyFromLayer(Caster, dg, Layer.Mount); dg.Owner = Caster; dg.OldBody = m_OldBody; m_Fake = dg; dg.Map = Caster.Map; dg.Location = Caster.Location; BaseArmor.ValidateMobile(Caster); m_OldBody = Caster.Body; Caster.BodyValue = 903; Caster.Blessed = true; StopTimer(Caster); Timer t = new InternalTimer(Caster, m_OldBody, m_Fake, this); m_Timers[Caster] = t; t.Start(); } else { Caster.SendLocalizedMessage(1005559); // This spell is already in effect. } } FinishSequence(); }
public override void OnCast() { if (Core.AOS) { /* The reactive armor spell increases the caster's physical resistance, while lowering the caster's elemental resistances. * 15 + (Inscription/20) Physcial bonus * -5 Elemental * The reactive armor spell has an indefinite duration, becoming active when cast, and deactivated when re-cast. * Reactive Armor, Protection, and Magic Reflection will stay on�even after logging out, even after dying�until you �turn them off� by casting them again. * (+20 physical -5 elemental at 100 Inscription) */ if (CheckSequence()) { var targ = Caster; if (m_Table.TryGetValue(targ, out var mods)) { targ.PlaySound(0x1ED); targ.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist); m_Table.Remove(targ); for (var i = 0; i < mods.Length; ++i) { targ.RemoveResistanceMod(mods[i]); } BuffInfo.RemoveBuff(Caster, BuffIcon.ReactiveArmor); } else { targ.PlaySound(0x1E9); targ.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist); mods = new[] { new ResistanceMod( ResistanceType.Physical, 15 + (int)(targ.Skills.Inscribe.Value / 20) ), new ResistanceMod(ResistanceType.Fire, -5), new ResistanceMod(ResistanceType.Cold, -5), new ResistanceMod(ResistanceType.Poison, -5), new ResistanceMod(ResistanceType.Energy, -5) }; m_Table[targ] = mods; for (var i = 0; i < mods.Length; ++i) { targ.AddResistanceMod(mods[i]); } var physresist = 15 + (int)(targ.Skills.Inscribe.Value / 20); var args = $"{physresist}\t{5}\t{5}\t{5}\t{5}"; BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.ReactiveArmor, 1075812, 1075813, args)); } } FinishSequence(); } else { if (Caster.MeleeDamageAbsorb > 0) { Caster.SendLocalizedMessage(1005559); // This spell is already in effect. } else if (!Caster.CanBeginAction <DefensiveSpell>()) { Caster.SendLocalizedMessage(1005385); // The spell will not adhere to you at this time. } else if (CheckSequence()) { if (Caster.BeginAction <DefensiveSpell>()) { var value = Math.Clamp( (int)(Caster.Skills.Magery.Value + Caster.Skills.Meditation.Value + Caster.Skills.Inscribe.Value) / 3, 1, 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(); } }
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() { 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 ) ) ) * { * DoFizzle(); * }*/ else if (CheckSequence()) { StopTimer(Caster); //Reset polymorph spell if (Caster.BeginAction(typeof(PolymorphSpell))) { if (m_PolymorphEntry.BodyID != 0) { if (!((Body)m_PolymorphEntry.BodyID).IsHuman) { IMount mt = Caster.Mount; if (mt != null) { mt.Rider = null; } } if (m_PolymorphEntry.BodyID == 0x3B) //Dragon, two different body IDs { Caster.BodyMod = Utility.RandomList(0x3B, 0xC); } else { Caster.BodyMod = m_PolymorphEntry.BodyID; } Caster.PlaySound(Sound); StopTimer(Caster); Timer t = new InternalTimer(Caster, m_PolymorphEntry); m_Timers.Add(Caster, t); t.Start(); BaseArmor.ValidateMobile(Caster); BaseWeapon.ValidateMobile(Caster); BaseJewel.ValidateMobile(Caster); if (Caster.NameMod != null) //Caster has incognito, need to update name { Caster.NameMod = IncognitoSpell.GetNameMod(Caster.BodyValue); } } } else { Caster.SendLocalizedMessage(1005559); // This spell is already in effect. } } FinishSequence(); }
public override void OnCast() { if (Core.AOS) { /* The magic reflection spell decreases the caster's physical resistance, while increasing the caster's elemental resistances. * Physical decrease = 25 - (Inscription/20). * Elemental resistance = +10 (-20 physical, +10 elemental at GM Inscription) * The magic reflection spell has an indefinite duration, becoming active when cast, and deactivated when re-cast. * Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out, even after dying—until you “turn them off” by casting them again. */ if (CheckSequence()) { Mobile targ = Caster; ResistanceMod[] mods = (ResistanceMod[])m_Table[targ]; if (mods == null) { targ.PlaySound(0x1E9); targ.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist); mods = new ResistanceMod[5] { new ResistanceMod(ResistanceType.Physical, -25 + (int)(targ.Skills[SkillName.Inscribe].Value / 20)), new ResistanceMod(ResistanceType.Fire, 10), new ResistanceMod(ResistanceType.Cold, 10), new ResistanceMod(ResistanceType.Poison, 10), new ResistanceMod(ResistanceType.Energy, 10) }; m_Table[targ] = mods; for (int i = 0; i < mods.Length; ++i) { targ.AddResistanceMod(mods[i]); } } else { targ.PlaySound(0x1ED); targ.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist); m_Table.Remove(targ); for (int i = 0; i < mods.Length; ++i) { targ.RemoveResistanceMod(mods[i]); } } } FinishSequence(); } else { if (Caster.MagicDamageAbsorb > 0) { Caster.SendAsciiMessage("This spell is already in effect."); } else if (!Caster.CanBeginAction(typeof(DefensiveSpell))) { Caster.SendAsciiMessage("The spell will not adhere to you at this time."); } else if (CheckSequence()) { if (Caster.BeginAction(typeof(DefensiveSpell))) { int value = (int)(Caster.Skills[SkillName.Magery].Value + Caster.Skills[SkillName.Inscribe].Value); value = (int)(8 + (value / 200) * 7.0); //absorb from 8 to 15 "circles" Caster.MagicDamageAbsorb = value; Caster.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist); Caster.PlaySound(0x1E9); } else { Caster.SendAsciiMessage("The spell will not adhere to you at this time."); } } 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 (Factions.Sigil.ExistsOn(Caster)) { Caster.SendLocalizedMessage(1010445); // You cannot incognito if you have a sigil } else if (!Caster.CanBeginAction(typeof(IncognitoSpell))) { if (Caster is PlayerMobile) { ((PlayerMobile)Caster).SetHairMods(-1, -1); } Caster.BodyMod = 0; Caster.HueMod = -1; Caster.NameMod = null; Caster.EndAction(typeof(IncognitoSpell)); BaseArmor.ValidateMobile(Caster); Caster.FixedParticles(0x373A, 10, 15, 5036, EffectLayer.Head); Caster.PlaySound(0x3BD); StopTimer(Caster); } else if (Caster.BodyMod == 183 || Caster.BodyMod == 184) { Caster.SendLocalizedMessage(1042402); // You cannot use incognito while wearing body paint } else if (!Caster.CanBeginAction(typeof(PolymorphSpell)) || Caster.IsBodyMod) { DoFizzle(); } else if (CheckSequence()) { if (Caster.BeginAction(typeof(IncognitoSpell))) { DisguiseGump.StopTimer(Caster); Caster.BodyMod = Utility.RandomList(400, 401); Caster.HueMod = Utility.RandomSkinHue(); Caster.NameMod = Caster.Body.IsFemale ? NameList.RandomName("female") : NameList.RandomName("male"); PlayerMobile pm = Caster as PlayerMobile; if (pm != null) { if (pm.Body.IsFemale) { pm.SetHairMods(Utility.RandomList(m_HairIDs), 0); } else { pm.SetHairMods(Utility.RandomList(m_HairIDs), Utility.RandomList(m_BeardIDs)); } Item hair = pm.FindItemOnLayer(Layer.Hair); if (hair != null) { hair.Hue = Utility.RandomHairHue(); } hair = pm.FindItemOnLayer(Layer.FacialHair); if (hair != null) { hair.Hue = Utility.RandomHairHue(); } } Caster.FixedParticles(0x373A, 10, 15, 5036, EffectLayer.Head); Caster.PlaySound(0x3BD); 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(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(IncognitoSpell))) { Caster.SendLocalizedMessage(1005559); // This spell is already in effect. } else if (KinPaint.IsWearingKinPaint(Caster)) { Caster.SendMessage("You cannot can incognito while wearing kin paint"); } else if (DisguiseTimers.IsDisguised(Caster)) { Caster.SendLocalizedMessage(1061631); // You can't do that while disguised. } else if (!Caster.CanBeginAction(typeof(PolymorphSpell)) || Caster.IsBodyMod) { DoFizzle(); } else if (CheckSequence()) { if (Caster.BeginAction(typeof(IncognitoSpell))) { DisguiseTimers.StopTimer(Caster); bool shadowSkin = false; //Player Enhancement Customization: Shadowskin if (PlayerEnhancementPersistance.IsCustomizationEntryActive(Caster, CustomizationType.Shadowskin)) { Caster.HueMod = 18999; shadowSkin = true; } else { Caster.HueMod = Caster.Race.RandomSkinHue(); } Caster.NameMod = Caster.Female ? NameList.RandomName("female") : NameList.RandomName("male"); PlayerMobile pm = Caster as PlayerMobile; if (pm != null && pm.Race != null) { pm.SetHairMods(pm.Race.RandomHair(pm.Female), pm.Race.RandomFacialHair(pm.Female)); pm.HairHue = pm.Race.RandomHairHue(); pm.FacialHairHue = pm.Race.RandomHairHue(); } Caster.FixedParticles(0x373A, 10, 15, 5036, EffectLayer.Head); Caster.PlaySound(0x3BD); BaseArmor.ValidateMobile(Caster); StopTimer(Caster); int val = (int)(Caster.Skills[SkillName.Magery].Value * 1.2); if (val > 144) { val = 144; } else if (val < 15) { val = 15; } if (shadowSkin && val > 30) { val = 30; } TimeSpan length = TimeSpan.FromSeconds(val); Timer t = new InternalTimer(Caster, length); m_Timers[Caster] = t; t.Start(); } else { Caster.SendMessage("You are already under the effect of the Incognito spell."); } } FinishSequence(); }