private static void RemoveMorphEffect(Mobile m) { m.BodyMod = 0; string modName = m.Serial + "Polymorph"; m.RemoveStatMod(modName + "Str"); m.RemoveStatMod(modName + "Dex"); m.RemoveStatMod(modName + "Int"); m.VirtualArmorMod = 0; if (m is PlayerMobile) { PlayerMobile pm = ((PlayerMobile)m); // pm.MinDamage = 0; // pm.MaxDamage = 0; // pm.SwingSpeed = 0; } m.EndAction(typeof(PolymorphSpell)); BaseArmor.ValidateMobile(m); if (m.NameMod != null) //Player has incognito, need to update name { m.NameMod = IncognitoSpell.GetNameMod(m.BodyValue); } }
protected override void OnTick() { if (!m_Owner.CanBeginAction(typeof(PolymorphSpell))) { m_Owner.BodyMod = 0; string modName = m_Owner.Serial + "Polymorph"; m_Owner.RemoveStatMod(modName + "Str"); m_Owner.RemoveStatMod(modName + "Dex"); m_Owner.RemoveStatMod(modName + "Int"); m_Owner.VirtualArmorMod = 0; if (m_Owner is MythikPlayerMobile) { MythikPlayerMobile pm = ((MythikPlayerMobile)m_Owner); pm.MinDamage = 0; pm.MaxDamage = 0; pm.SwingSpeed = 0; } m_Owner.EndAction(typeof(PolymorphSpell)); StopTimer(m_Owner); BaseArmor.ValidateMobile(m_Owner); if (m_Owner.NameMod != null) //Player has incognito, need to update name { m_Owner.NameMod = IncognitoSpell.GetNameMod(m_Owner.BodyValue); } } }
public static void RemoveDisguise(Mobile from) { from.HueMod = -1; from.NameMod = null; ((PlayerMobile)from).SavagePaintExpiration = TimeSpan.Zero; ((PlayerMobile)from).SetHairMods(-1, -1); PolymorphSpell.StopTimer(from); IncognitoSpell.StopTimer(from); DisguiseTimers.RemoveTimer(from); from.EndAction(typeof(PolymorphSpell)); from.EndAction(typeof(IncognitoSpell)); }
public static void RemoveAllEffects(Mobile target, Mobile caster) { //Remove magic reflect if (target.MagicDamageAbsorb > 0) { target.MagicDamageAbsorb = 0; } //dispel protection ProtectionSpell.StopTimer(target); //dispell polymorph PolymorphSpell.StopTimer(target); //dispell incognito IncognitoSpell.StopTimer(target); }
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 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 static void NegateEffects(Mobile target, bool curses, bool buffs, bool damage, bool morph) { if (target == null) { return; } if (damage) { if (target.Poisoned) { var p = target.Poison; target.Poison = null; target.OnCured(target, p); } target.Frozen = false; target.Paralyzed = false; target.SetPropertyValue("Asleep", false); BuffInfo.RemoveBuff(target, BuffIcon.Paralyze); BuffInfo.RemoveBuff(target, BuffIcon.Sleep); } if (buffs) { ReactiveArmorSpell.EndArmor(target); MagicReflectSpell.EndReflect(target); } if (curses) { #region Pain Spike IDictionary table; if (typeof(PainSpikeSpell).GetFieldValue("m_Table", out table) && table.Contains(target)) { var t = table[target] as Timer; if (t != null) { t.Stop(); } table.Remove(target); BuffInfo.RemoveBuff(target, BuffIcon.PainSpike); } #endregion CurseSpell.RemoveEffect(target); EvilOmenSpell.TryEndEffect(target); StrangleSpell.RemoveCurse(target); CorpseSkinSpell.RemoveCurse(target); BloodOathSpell.RemoveCurse(target); MindRotSpell.ClearMindRotScalar(target); } if (damage) { MortalStrike.EndWound(target); BleedAttack.EndBleed(target, target.Alive); MeerMage.StopEffect(target, target.Alive); } if (morph) { AnimalForm.RemoveContext(target, true); PolymorphSpell.StopTimer(target); IncognitoSpell.StopTimer(target); target.Send(SpeedControl.Disable); target.EndAction(typeof(PolymorphSpell)); target.EndAction(typeof(IncognitoSpell)); BuffInfo.RemoveBuff(target, BuffIcon.AnimalForm); BuffInfo.RemoveBuff(target, BuffIcon.Polymorph); BuffInfo.RemoveBuff(target, BuffIcon.Incognito); } if (buffs) { RemoveStatBonus(target, StatType.All); } if (curses) { RemoveStatCurse(target, StatType.All); } }
public virtual void Negate(Mobile m) { if (m == null || m.Deleted) { return; } if (m.Frozen) { m.Frozen = false; } if (m.Paralyzed) { m.Paralyzed = false; } if (m.Poisoned) { m.CurePoison(m); } if (BleedAttack.IsBleeding(m)) { BleedAttack.EndBleed(m, true); } if (MortalStrike.IsWounded(m)) { MortalStrike.EndWound(m); } PolymorphSpell.StopTimer(m); IncognitoSpell.StopTimer(m); DisguiseTimers.RemoveTimer(m); m.EndAction(typeof(PolymorphSpell)); m.EndAction(typeof(IncognitoSpell)); MeerMage.StopEffect(m, false); if (DebugMode || m.AccessLevel <= AccessLevel.Counselor) { m.RevealingAction(); m.DisruptiveAction(); } if (m.Target != null) { m.Target.Cancel(m, TargetCancelType.Overriden); } m.Spell = null; if (m.Combatant != null) { #if ServUO var c = m.Combatant as Mobile; #else var c = m.Combatant; #endif if (c != null && c.Combatant == m) { c.Combatant = null; c.Warmode = false; } m.Combatant = null; } if (m.Aggressed != null) { m.Aggressed.Clear(); } if (m.Aggressors != null) { m.Aggressors.Clear(); } m.Warmode = false; m.Criminal = false; m.Delta(MobileDelta.Noto); }