protected override void OnTick() { if (!m_Owner.CanBeginAction(typeof(AncientPeerSpell))) { if (fake != null && !fake.Deleted) { loc = new Point3D(fake.X, fake.Y, fake.Z); m_Owner.Location = loc; m_Owner.Blessed = fake.Blessed; fake.Delete(); } m_Owner.BodyValue = m_OldBody; m_spell.RemovePeerMod(); m_Owner.EndAction(typeof(AncientPeerSpell)); BaseArmor.ValidateMobile(m_Owner); } }
protected override void OnTick() { if (!this.m_Owner.CanBeginAction(typeof(IncognitoSpell))) { if (this.m_Owner is PlayerMobile) { ((PlayerMobile)this.m_Owner).SetHairMods(-1, -1); } this.m_Owner.BodyMod = 0; this.m_Owner.HueMod = -1; this.m_Owner.NameMod = null; this.m_Owner.EndAction(typeof(IncognitoSpell)); BaseArmor.ValidateMobile(this.m_Owner); BaseClothing.ValidateMobile(this.m_Owner); } }
public void CheckCancelMorph(Mobile m) { if (m == null) { return; } double minSkill, maxSkill; TransformContext context = TransformationSpellHelper.GetContext(m); if (context != null) { var spell = context.Spell as Spell; spell.GetCastSkills(out minSkill, out maxSkill); if (m.Skills[spell.CastSkill].Value < minSkill) { TransformationSpellHelper.RemoveContext(m, context, true); } } if (!m.CanBeginAction(typeof(PolymorphSpell)) && m.Skills[SkillName.Magery].Value < 66.1) { m.BodyMod = 0; m.HueMod = -1; m.NameMod = null; m.EndAction(typeof(PolymorphSpell)); BaseArmor.ValidateMobile(m); BaseClothing.ValidateMobile(m); } if (!m.CanBeginAction(typeof(IncognitoSpell)) && m.Skills[SkillName.Magery].Value < 38.1) { if (m is PlayerMobile) { ((PlayerMobile)m).SetHairMods(-1, -1); } m.BodyMod = 0; m.HueMod = -1; m.NameMod = null; m.EndAction(typeof(IncognitoSpell)); BaseArmor.ValidateMobile(m); BaseClothing.ValidateMobile(m); BuffInfo.RemoveBuff(m, BuffIcon.Incognito); } return; }
public void IncogMode(PlayerMobile pm) { string originalName = pm.Name; pm.HueMod = pm.Race.RandomSkinHue(); pm.NameMod = pm.Female ? NameList.RandomName("female") : NameList.RandomName("male"); LoggingCustom.LogDisguise(DateTime.Now + "\t" + originalName + "\t" + pm.NameMod); 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(); } pm.FixedParticles(0x373A, 10, 15, 5036, EffectLayer.Head); pm.PlaySound(0x3BD); BaseArmor.ValidateMobile(pm); BaseClothing.ValidateMobile(pm); //BuffInfo.AddBuff( Caster, new BuffInfo( BuffIcon.Incognito, 1075819, length, Caster ) ); }
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 (!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 ( 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 (!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(); }
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 static void Trick(BaseCreature creature, PlayerMobile player) { if (creature == null || player == null) { return; } int trickTextHue = 0x22; creature.PublicOverheadMessage(MessageType.Regular, trickTextHue, false, "Trick it is then!"); creature.PlaySound(0x246); double damageAmount = 0; int duration = 0; switch (Utility.RandomMinMax(1, 15)) { case 1: SpecialAbilities.BacklashSpecialAbility(1.0, null, player, .75, 60, -1, true, "", ""); if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Ack! A curse! Causing your spellcasting proficiency to suffer!", player.NetState); } break; case 2: double bleedAmount = (double)player.HitsMax * .66; for (int a = 0; a < 5; a++) { Point3D newLocation = new Point3D(player.Location.X + Utility.RandomList(-1, 1), player.Location.Y + Utility.RandomList(-1, 1), player.Location.Z); new Blood().MoveToWorld(newLocation, player.Map); } SpecialAbilities.BleedSpecialAbility(1.0, null, player, bleedAmount, 8, -1, true, "", "", "-1"); if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Curses! A dagger hidden in an apple!", player.NetState); } break; case 3: Point3D creatureLocation = creature.Location; Point3D playerLocation = player.Location; int projectiles = 15; int particleSpeed = 8; for (int a = 0; a < projectiles; a++) { Point3D newLocation = new Point3D(player.X + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), player.Y + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), player.Z); SpellHelper.AdjustField(ref newLocation, player.Map, 12, false); IEntity effectStartLocation = new Entity(Serial.Zero, new Point3D(newLocation.X, newLocation.Y, newLocation.Z + 10), player.Map); IEntity effectEndLocation = new Entity(Serial.Zero, new Point3D(player.X, player.Y, player.Z + 10), player.Map); Effects.SendMovingParticles(effectStartLocation, effectEndLocation, 0x3818, particleSpeed, 0, false, false, 2603, 0, 9501, 0, 0, 0x100); } player.FixedParticles(0x3967, 10, 40, 5036, 2603, 0, EffectLayer.CenterFeet); int damage = (int)(Math.Round((double)player.HitsMax * .33)); duration = 5; SpecialAbilities.HinderSpecialAbility(1.0, null, player, 1.0, duration, false, -1, false, "", "", "-1"); new Blood().MoveToWorld(player.Location, player.Map); AOS.Damage(player, damage, 0, 100, 0, 0, 0); if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Electric candy! What an age we live in!", player.NetState); } break; case 4: SpecialAbilities.DiseaseSpecialAbility(1.0, null, player, 3, 60, -1, true, "", ""); if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Blast! Expired candy!", player.NetState); } break; case 5: TimedStatic glue = new TimedStatic(4650, 30); glue.Name = "glue"; glue.Hue = 2067; glue.MoveToWorld(player.Location, player.Map); SpecialAbilities.EntangleSpecialAbility(1.0, null, player, 1.0, 30, -1, true, "", "", "-1"); if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Your feet have been glued to the floor!", player.NetState); } break; case 6: damageAmount = (double)player.HitsMax * .5; SpecialAbilities.FlamestrikeSpecialAbility(1.0, null, player, damageAmount, 1, -1, true, "", "Spicy candy! So hot!"); if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Spicy candy! So hot!", player.NetState); } break; case 7: damageAmount = (double)player.HitsMax * .5; Direction direction = Utility.GetDirection(creature.Location, player.Location); int windItemId = 8099; switch (direction) { case Direction.North: windItemId = 8099; break; case Direction.Right: windItemId = 8099; break; case Direction.West: windItemId = 8104; break; case Direction.Up: windItemId = 8104; break; case Direction.East: windItemId = 8109; break; case Direction.Down: windItemId = 8109; break; case Direction.South: windItemId = 8114; break; case Direction.Left: windItemId = 8114; break; } creature.MovingEffect(player, windItemId, 5, 1, false, false, 0, 0); player.PlaySound(0x64C); if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "This candy totally blows...", player.NetState); } SpecialAbilities.KnockbackSpecialAbility(1.0, creature.Location, null, player, damageAmount, 20, -1, "", ""); break; case 8: SpecialAbilities.PetrifySpecialAbility(1.0, null, player, 1.0, 15, -1, true, "", "", "-1"); if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Rock candy!", player.NetState); } break; case 9: if (player.Poison == null) { Poison poison = Poison.GetPoison(2); player.ApplyPoison(null, poison); } player.FixedEffect(0x372A, 10, 30, 2208, 0); Effects.PlaySound(player.Location, player.Map, 0x22F); int residueCount = Utility.RandomMinMax(3, 4); for (int a = 0; a < residueCount; a++) { Point3D poisonPoint = new Point3D(player.Location.X + Utility.RandomList(-1, 1), player.Location.Y + Utility.RandomList(-1, 1), player.Location.Z); SpellHelper.AdjustField(ref poisonPoint, player.Map, 12, false); TimedStatic poisonResidue = new TimedStatic(Utility.RandomList(0x1645, 0x122A, 0x122B, 0x122C, 0x122D, 0x122E, 0x122F), 5); poisonResidue.Hue = 2208; poisonResidue.Name = "poison residue"; poisonResidue.MoveToWorld(poisonPoint, player.Map); } if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Poisoned candy! Who would do such a thing!", player.NetState); } break; case 10: bool canPolymorph = true; if (!player.CanBeginAction(typeof(PolymorphSpell))) { canPolymorph = false; } if (!player.CanBeginAction(typeof(PolymorphPotion))) { canPolymorph = false; } if (!player.CanBeginAction(typeof(IncognitoSpell)) || player.IsBodyMod) { canPolymorph = false; } if (DisguiseTimers.IsDisguised(player)) { canPolymorph = false; } if (KinPaint.IsWearingKinPaint(player)) { canPolymorph = false; } if (!canPolymorph) { player.SendMessage("Hmm...Nothing seems to have happened. Or did it?"); return; } player.FixedParticles(0x373A, 10, 15, 5036, EffectLayer.Head); List <int> m_PossibleBodyValues = new List <int>(); m_PossibleBodyValues.Add(3); //Zombie m_PossibleBodyValues.Add(50); //Skeleton m_PossibleBodyValues.Add(56); //Skeleton m_PossibleBodyValues.Add(153); //Ghoul m_PossibleBodyValues.Add(302); //Skeletal Critter m_PossibleBodyValues.Add(309); //Patchwork Skeleton m_PossibleBodyValues.Add(148); //Necromancer m_PossibleBodyValues.Add(793); //Skeletal Horse m_PossibleBodyValues.Add(317); //Giant Bat m_PossibleBodyValues.Add(252); //Corpse Bride m_PossibleBodyValues.Add(57); //Skeletal Knight m_PossibleBodyValues.Add(116); //Nightmare m_PossibleBodyValues.Add(24); //Lich m_PossibleBodyValues.Add(154); //Mummy m_PossibleBodyValues.Add(104); //Skeletal Drake m_PossibleBodyValues.Add(740); //Skeletal Drake m_PossibleBodyValues.Add(308); //Giant Skeleton player.BodyMod = m_PossibleBodyValues[Utility.RandomMinMax(0, m_PossibleBodyValues.Count - 1)]; player.HueMod = 0; player.PlaySound(0x3BD); BaseArmor.ValidateMobile(player); duration = 120; player.BeginAction(typeof(PolymorphPotion)); Timer.DelayCall(TimeSpan.FromSeconds(duration), delegate { if (player == null) { return; } player.EndAction(typeof(PolymorphPotion)); }); player.BeginAction(typeof(PolymorphSpell)); Timer.DelayCall(TimeSpan.FromSeconds(duration), delegate { if (player == null) { return; } player.BodyMod = 0; player.HueMod = -1; player.EndAction(typeof(PolymorphSpell)); BaseArmor.ValidateMobile(player); }); if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Hmm, something tastes odd about this candy.", player.NetState); } break; case 11: Item innerLegs = player.FindItemOnLayer(Layer.InnerLegs); Item outerLegs = player.FindItemOnLayer(Layer.OuterLegs); Item pants = player.FindItemOnLayer(Layer.Pants); int layersFound = 0; if (innerLegs != null) { player.Backpack.DropItem(innerLegs); layersFound++; } if (outerLegs != null) { player.Backpack.DropItem(outerLegs); layersFound++; } if (pants != null) { player.Backpack.DropItem(pants); layersFound++; } if (layersFound > 0) { player.PlaySound(0x503); if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Your pants appear to have fallen down. How embarrassing!", player.NetState); } } else { player.SendMessage("Nothing seems to have happened. Or did it?..."); } break; case 12: player.FixedParticles(0x374A, 10, 15, 5028, 2604, 0, EffectLayer.Waist); player.PlaySound(0x5DA); player.Animate(22, 6, 1, true, false, 0); //Fall Forward player.Stam = 0; if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "You feel drowsy and fall on your face!", player.NetState); } break; case 13: player.BAC = 60; player.PlaySound(0x5A9); BaseBeverage.CheckHeaveTimer(player); player.Animate(34, 5, 1, true, false, 0); if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "What was in that candy??? *hic*", player.NetState); } break; case 14: Warp(creature, player); break; case 15: Warp(creature, player); break; } }
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 (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 (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 void Target(Mobile m) { Type t = m.GetType(); bool dispellable = false; if (m is BaseCreature) { dispellable = ((BaseCreature)m).Summoned && !((BaseCreature)m).IsAnimatedDead; } else if (m == Caster) { dispellable = true; } if (!Caster.CanSee(m)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (!dispellable) { Caster.SendLocalizedMessage(1005049); // That cannot be dispelled. } else if (CheckHSequence(m)) { if (m == Caster) { //2010.05.24 - Pix - New functionality - if caster casts dispel on himself, void all // magic effects. //Protection if (ProtectionSpell.Registry.Contains(Caster)) { ProtectionSpell.Registry.Remove(Caster); } //Reactive Armor Caster.MeleeDamageAbsorb = 0; //Reflect Caster.MagicDamageAbsorb = 0; //restart defensivespell "timer" DefensiveSpell.Nullify(Caster); //NightSight if (!Caster.CanBeginAction(typeof(LightCycle))) { Caster.EndAction(typeof(LightCycle)); Caster.LightLevel = 0; } //Strength string name = String.Format("[Magic] {0} Offset", StatType.Str); StatMod mod = Caster.GetStatMod(name); if (mod != null /*&& mod.Offset > 0*/) { Caster.RemoveStatMod(name); } //Agility name = String.Format("[Magic] {0} Offset", StatType.Dex); mod = Caster.GetStatMod(name); if (mod != null /*&& mod.Offset > 0*/) { Caster.RemoveStatMod(name); } //Cunning name = String.Format("[Magic] {0} Offset", StatType.Int); mod = Caster.GetStatMod(name); if (mod != null /*&& mod.Offset > 0*/) { Caster.RemoveStatMod(name); } //Bless - handled by above three //Incognito 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); } //ArchProtection if (!Caster.CanBeginAction(typeof(ArchProtectionSpell))) { Caster.VirtualArmorMod = 0; Caster.EndAction(typeof(ArchProtectionSpell)); } //Polymorph if (!Caster.CanBeginAction(typeof(PolymorphSpell))) { Caster.BodyMod = 0; Caster.HueMod = -1; Caster.EndAction(typeof(PolymorphSpell)); BaseArmor.ValidateMobile(Caster); } //Invisibility (shouldn't ever happen, but what the f**k, might as well put it in!) if (Caster.AccessLevel <= AccessLevel.Player) //make sure if we're staff, don't reveal { Caster.Hidden = false; } Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042); Effects.PlaySound(m, m.Map, 0x201); Caster.SendMessage("All beneficial magic effects have been stripped from you."); } else //Normal dispel dispellable creature stuff: { SpellHelper.Turn(Caster, m); BaseCreature bc = m as BaseCreature; double dispelChance = 0; if (bc != null) { // players don't have trouble dispelling the summons of a summoner (magery+spirit speak) if (Caster is PlayerMobile || bc.ControlMaster == null) { dispelChance = (50.0 + ((100 * (Caster.Skills.Magery.Value - bc.DispelDifficulty)) / (bc.DispelFocus * 2))) / 100; } else { double difficulty = bc.DispelDifficulty + bc.ControlMaster.Skills.SpiritSpeak.Value / 2.0; if (difficulty > 125) { difficulty = 125; } dispelChance = (50.0 + ((100 * (Caster.Skills.Magery.Value - difficulty)) / (bc.DispelFocus * 2))) / 100; } } if (dispelChance > Utility.RandomDouble()) { Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042); Effects.PlaySound(m, m.Map, 0x201); bc.OnBeforeDispel(Caster); m.Delete(); } else { m.FixedEffect(0x3779, 10, 20); Caster.SendLocalizedMessage(1010084); // The creature resisted the attempt to dispel it! } } } FinishSequence(); }
public static void WipeMods(Mobile m) { PlayerMobile pm = m as PlayerMobile; m.DisruptiveAction(); foreach (StatType Stat in Enum.GetValues(typeof(StatType))) { string name = String.Format("[Magic] {0} Offset", Stat); if (m.GetStatMod(name) != null) { m.RemoveStatMod(name); } } if (TransformationSpellHelper.UnderTransformation(m)) { TransformationSpellHelper.RemoveContext(m, true); } m.HueMod = -1; m.NameMod = null; PolymorphSpell.StopTimer(m); IncognitoSpell.StopTimer(m); DisguiseGump.StopTimer(m); foreach (Type T in DispelActions) { m.EndAction(T); } m.BodyMod = 0; m.HueMod = -1; if (pm != null) { if (pm.BuffTable != null) { List <BuffInfo> list = new List <BuffInfo>(); foreach (BuffInfo buff in pm.BuffTable.Values) { if (!buff.RetainThroughDeath) { list.Add(buff); } } for (int i = 0; i < list.Count; i++) { pm.RemoveBuff(list[i]); } } pm.SavagePaintExpiration = TimeSpan.Zero; pm.SetHairMods(-1, -1); pm.ResendBuffs(); } m.VirtualArmorMod = 0; BaseArmor.ValidateMobile(m); BaseClothing.ValidateMobile(m); }
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 void CheckCancelMorph(Mobile m) { if (m == null) { return; } double minSkill, maxSkill; AnimalFormContext acontext = AnimalForm.GetContext(m); TransformContext context = TransformationSpellHelper.GetContext(m); if (context != null) { Spell spell = context.Spell as Spell; spell.GetCastSkills(out minSkill, out maxSkill); if (m.Skills[spell.CastSkill].Value < minSkill) { TransformationSpellHelper.RemoveContext(m, context, true); } } if (acontext != null) { int i; for (i = 0; i < AnimalForm.Entries.Length; ++i) { if (AnimalForm.Entries[i].Type == acontext.Type) { break; } } if (m.Skills[SkillName.Ninjitsu].Value < AnimalForm.Entries[i].ReqSkill) { AnimalForm.RemoveContext(m, true); } } if (!m.CanBeginAction(typeof(PolymorphSpell)) && m.Skills[SkillName.Magery].Value < 66.1) { m.BodyMod = 0; m.HueMod = -1; m.NameMod = null; m.EndAction(typeof(PolymorphSpell)); BaseArmor.ValidateMobile(m); BaseClothing.ValidateMobile(m); } if (!m.CanBeginAction(typeof(IncognitoSpell)) && m.Skills[SkillName.Magery].Value < 38.1) { if (m is PlayerMobile) { ((PlayerMobile)m).SetHairMods(-1, -1); } m.BodyMod = 0; m.HueMod = -1; m.NameMod = null; m.EndAction(typeof(IncognitoSpell)); BaseArmor.ValidateMobile(m); BaseClothing.ValidateMobile(m); BuffInfo.RemoveBuff(m, BuffIcon.Incognito); } return; }
public override void OnCast() { if (!this.Caster.CanBeginAction(typeof(IncognitoSpell))) { this.Caster.SendLocalizedMessage(1005559); // This spell is already in effect. } else if (this.Caster.BodyMod == 183 || this.Caster.BodyMod == 184) { this.Caster.SendLocalizedMessage(1042402); // You cannot use incognito while wearing body paint } else if (DisguiseTimers.IsDisguised(this.Caster)) { this.Caster.SendLocalizedMessage(1061631); // You can't do that while disguised. } else if (!this.Caster.CanBeginAction(typeof(PolymorphSpell)) || this.Caster.IsBodyMod) { this.DoFizzle(); } else if (this.CheckSequence()) { if (this.Caster.BeginAction(typeof(IncognitoSpell))) { DisguiseTimers.StopTimer(this.Caster); this.Caster.HueMod = this.Caster.Race.RandomSkinHue(); this.Caster.NameMod = this.Caster.Female ? NameList.RandomName("female") : NameList.RandomName("male"); PlayerMobile pm = this.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(); } this.Caster.FixedParticles(0x373A, 10, 15, 5036, EffectLayer.Head); this.Caster.PlaySound(0x3BD); BaseArmor.ValidateMobile(this.Caster); BaseClothing.ValidateMobile(this.Caster); StopTimer(this.Caster); int timeVal = ((6 * this.Caster.Skills.Magery.Fixed) / 50) + 1; if (timeVal > 144) { timeVal = 144; } TimeSpan length = TimeSpan.FromSeconds(timeVal); Timer t = new InternalTimer(this.Caster, length); m_Timers[this.Caster] = t; t.Start(); BuffInfo.AddBuff(this.Caster, new BuffInfo(BuffIcon.Incognito, 1075819, length, this.Caster)); } else { this.Caster.SendLocalizedMessage(1079022); // You're already incognitoed! } } this.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 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 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 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 (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 (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); m.HueMod = Caster.Race.RandomSkinHue(); m.NameMod = m.Female ? NameList.RandomName("female") : NameList.RandomName("male"); PlayerMobile pm = m 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(m); BaseClothing.ValidateMobile(m); StopTimer(m); int timeVal = ((6 * Caster.Skills.Magery.Fixed) / 50) + 1; if (timeVal > 144) { timeVal = 144; } TimeSpan length = TimeSpan.FromSeconds(timeVal); Timer t = new InternalTimer(m, length); m_Timers[m] = t; t.Start(); BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Incognito, 1075819, length, m)); } else { Caster.SendLocalizedMessage(1079022); // You're already incognitoed! } } FinishSequence(); }