public static void RemoveEffect( Mobile m ) { object[] mods = (object[])m_Table[m]; if ( mods != null ) { m.RemoveStatMod( ((StatMod)mods[0]).Name ); m.RemoveStatMod( ((StatMod)mods[1]).Name ); m.RemoveStatMod( ((StatMod)mods[2]).Name ); m.RemoveSkillMod( (SkillMod)mods[3] ); m.RemoveSkillMod( (SkillMod)mods[4] ); m.RemoveSkillMod( (SkillMod)mods[5] ); } m_Table.Remove( m ); m.EndAction( typeof( ClericAngelicFaithSpell ) ); m.BodyMod = 0; }
public static void EndProtection(Mobile m) { if (m_Table.Contains(m)) { object[] mods = (object[])m_Table[m]; m_Table.Remove(m); Registry.Remove(m); m.RemoveResistanceMod((ResistanceMod)mods[0]); m.RemoveSkillMod((SkillMod)mods[1]); BuffInfo.RemoveBuff(m, BuffIcon.Protection); } }
public static void Toggle(Mobile caster, Mobile target) { /* Players under the protection spell effect can no longer have their spells "disrupted" when hit. * Players under the protection spell have decreased physical resistance stat value (-15 + (Inscription/20), * a decreased "resisting spells" skill value by -35 + (Inscription/20), * and a slower casting speed modifier (technically, a negative "faster cast speed") of 2 points. * The protection 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. */ object[] mods = (object[])m_Table[target]; if (mods == null) { target.PlaySound(0x1E9); target.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist); mods = new object[2] { new ResistanceMod(ResistanceType.Physical, -15 + Math.Min((int)(caster.Skills[SkillName.Inscribe].Value / 20), 15)), new DefaultSkillMod(SkillName.MagicResist, true, -35 + Math.Min((int)(caster.Skills[SkillName.Inscribe].Value / 20), 35)) }; m_Table[target] = mods; Registry[target] = 100.0; target.AddResistanceMod((ResistanceMod)mods[0]); target.AddSkillMod((SkillMod)mods[1]); int physloss = -15 + (int)(caster.Skills[SkillName.Inscribe].Value / 20); int resistloss = -35 + (int)(caster.Skills[SkillName.Inscribe].Value / 20); string args = String.Format("{0}\t{1}", physloss, resistloss); BuffInfo.AddBuff(target, new BuffInfo(BuffIcon.Protection, 1075814, 1075815, args.ToString())); } else { target.PlaySound(0x1ED); target.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist); m_Table.Remove(target); Registry.Remove(target); target.RemoveResistanceMod((ResistanceMod)mods[0]); target.RemoveSkillMod((SkillMod)mods[1]); BuffInfo.RemoveBuff(target, BuffIcon.Protection); } }
public static void RemoveWard( Mobile target ) { object[] mods = (object[]) m_Table[target]; if ( mods != null ) { m_Table.Remove( target ); Registry.Remove( target ); target.RemoveResistanceMod( (ResistanceMod) mods[0] ); target.RemoveSkillMod( (SkillMod) mods[1] ); BuffInfo.RemoveBuff( target, BuffIcon.Protection ); BuffInfo.RemoveBuff( target, BuffIcon.ArchProtection ); } }
public static void Toggle( Mobile caster, Mobile target ) { /* Players under the protection spell effect can no longer have their spells "disrupted" when hit. * Players under the protection spell have decreased physical resistance stat value, * a decreased "resisting spells" skill value by -35, * and a slower casting speed modifier (technically, a negative "faster cast speed") of 2 points. * The protection 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. */ object[] mods = (object[])m_Table[target]; if ( mods == null ) { target.PlaySound( 0x1E9 ); target.FixedParticles( 0x375A, 9, 20, 5016, EffectLayer.Waist ); mods = new object[2] { new ResistanceMod( ResistanceType.Physical, -15 + (int)(caster.Skills[SkillName.Inscribe].Value / 20) ), new DefaultSkillMod( SkillName.MagicResist, true, -35 + (int)(caster.Skills[SkillName.Inscribe].Value / 20) ) }; m_Table[target] = mods; Registry[target] = 100.0; target.AddResistanceMod( (ResistanceMod)mods[0] ); target.AddSkillMod( (SkillMod)mods[1] ); } else { target.PlaySound( 0x1ED ); target.FixedParticles( 0x375A, 9, 20, 5016, EffectLayer.Waist ); m_Table.Remove( target ); Registry.Remove( target ); target.RemoveResistanceMod( (ResistanceMod)mods[0] ); target.RemoveSkillMod( (SkillMod)mods[1] ); } }
public void Clear() { if (m_Mods == null) { return; } for (int i = 0; i < m_Mods.Count; ++i) { object mod = m_Mods[i]; if (mod is ResistanceMod) { m_Mobile.RemoveResistanceMod((ResistanceMod)mod); } else if (mod is SkillMod) { m_Mobile.RemoveSkillMod((SkillMod)mod); } } }
public void Clear() { if (m_Mods == null) { return; } for (var i = 0; i < m_Mods.Count; ++i) { var mod = m_Mods[i]; if (mod is ResistanceMod resistanceMod) { m_Mobile.RemoveResistanceMod(resistanceMod); } else if (mod is SkillMod skillMod) { m_Mobile.RemoveSkillMod(skillMod); } } }
public static void Toggle(Mobile caster, Mobile target) { /* Players under the protection spell effect can no longer have their spells "disrupted" when hit. * Players under the protection spell have decreased physical resistance stat value, * a decreased "resisting spells" skill value by -35, * and a slower casting speed modifier (technically, a negative "faster cast speed") of 2 points. * The protection 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. */ object[] mods = (object[])m_Table[target]; if (mods == null) { target.PlaySound(0x1E9); target.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist); mods = new object[2] { new ResistanceMod(ResistanceType.Physical, -15 + (int)(caster.Skills[SkillName.Inscribe].Value / 20)), new DefaultSkillMod(SkillName.MagicResist, true, -35 + (int)(caster.Skills[SkillName.Inscribe].Value / 20)) }; m_Table[target] = mods; Registry[target] = 100.0; target.AddResistanceMod((ResistanceMod)mods[0]); target.AddSkillMod((SkillMod)mods[1]); } else { target.PlaySound(0x1ED); target.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist); m_Table.Remove(target); Registry.Remove(target); target.RemoveResistanceMod((ResistanceMod)mods[0]); target.RemoveSkillMod((SkillMod)mods[1]); } }
public static bool ClearSkillLoss(Mobile mob) { SkillLossContext context = (SkillLossContext)m_SkillLoss[mob]; if (context == null) { return(false); } m_SkillLoss.Remove(mob); ArrayList mods = context.m_Mods; for (int i = 0; i < mods.Count; ++i) { mob.RemoveSkillMod((SkillMod)mods[i]); } context.m_Timer.Stop(); return(true); }
public static bool ClearSkillLoss(Mobile mob) { SkillLossContext context; if (!m_SkillLoss.TryGetValue(mob, out context)) { return(false); } m_SkillLoss.Remove(mob); List <SkillMod> mods = context.m_Mods; for (int i = 0; i < mods.Count; ++i) { mob.RemoveSkillMod(mods[i]); } context.m_Timer.Stop(); return(true); }
public void Clear() { if (m_PVP) { Timer.DelayCall(() => { foreach (var item in m_Target.Items) { var bonuses = RunicReforging.GetAosSkillBonuses(item); if (bonuses != null) { bonuses.AddTo(m_Target); } } }); } else { for (int i = 0; i < m_Mods.Count; ++i) { object mod = m_Mods[i]; if (mod is ResistanceMod) { m_Target.RemoveResistanceMod((ResistanceMod)mod); } else if (mod is StatMod) { m_Target.RemoveStatMod(((StatMod)mod).Name); } else if (mod is SkillMod) { m_Target.RemoveSkillMod((SkillMod)mod); } } } }
public static void RemoveContext(Mobile m, AnimalFormContext context, bool resetGraphics) { m_Table.Remove(m); if (context.SpeedBoost) { m.Send(SpeedControl.Disable); } SkillMod mod = context.Mod; if (mod != null) { m.RemoveSkillMod(mod); } if (resetGraphics) { m.HueMod = -1; m.BodyMod = 0; } context.Timer.Stop(); }
private static void RemoveEffect(Mobile m) { if (m_Table.ContainsKey(m)) { BonusContext context = m_Table[m]; if (context != null) { if (context.Timer != null) { context.Timer.Stop(); } if (context.Mod != null) { m.RemoveSkillMod(context.Mod); } } m.SendLocalizedMessage(1071146); // Your sense goes to normal. m_Table.Remove(m); } }
public static bool ClearSkillLoss(Mobile mob) { SkillLossContext context = (SkillLossContext)m_SkillLoss[mob]; if (context == null) { return(false); } m_SkillLoss.Remove(mob); ArrayList mods = context.m_Mods; for (int i = 0; i < mods.Count; ++i) { mob.RemoveSkillMod((SkillMod)mods[i]); } context.m_Timer.Stop(); mob.SendLocalizedMessage(500912); // You have recovered from the impure life force absorbtion. return(true); }
protected override void OnTarget(Mobile from, object o) { if (!(o is Mobile)) { from.SendLocalizedMessage(1046439); // That is not a valid target. return; } Mobile target = (Mobile)o; switch (m_Talisman.Removal) { case TalismanRemoval.Curse: target.PlaySound(0xF6); target.PlaySound(0x1F7); target.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head); IEntity mfrom = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z - 10), from.Map); IEntity mto = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z + 50), from.Map); Effects.SendMovingParticles(mfrom, mto, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100); StatMod mod; mod = target.GetStatMod("[Magic] Str Offset"); if (mod != null && mod.Offset < 0) { target.RemoveStatMod("[Magic] Str Offset"); } mod = target.GetStatMod("[Magic] Dex Offset"); if (mod != null && mod.Offset < 0) { target.RemoveStatMod("[Magic] Dex Offset"); } mod = target.GetStatMod("[Magic] Int Offset"); if (mod != null && mod.Offset < 0) { target.RemoveStatMod("[Magic] Int Offset"); } target.Paralyzed = false; EvilOmenSpell.CheckEffect(target); StrangleSpell.RemoveCurse(target); CorpseSkinSpell.RemoveCurse(target); CurseSpell.RemoveEffect(target); BuffInfo.RemoveBuff(target, BuffIcon.Clumsy); BuffInfo.RemoveBuff(target, BuffIcon.FeebleMind); BuffInfo.RemoveBuff(target, BuffIcon.Weaken); BuffInfo.RemoveBuff(target, BuffIcon.MassCurse); if (target == from) { from.SendLocalizedMessage(1072408); // Any curses on you have been lifted } else { from.SendLocalizedMessage(1072409); // Your targets curses have been lifted target.SendLocalizedMessage(1072408); // Any curses on you have been lifted } break; case TalismanRemoval.Damage: target.PlaySound(0x201); Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0); BleedAttack.EndBleed(target, false); MortalStrike.EndWound(target); BuffInfo.RemoveBuff(target, BuffIcon.Bleed); BuffInfo.RemoveBuff(target, BuffIcon.MortalStrike); if (target == from) { from.SendLocalizedMessage(1072405); // Your lasting damage effects have been removed! } else { from.SendLocalizedMessage(1072406); // Your Targets lasting damage effects have been removed! target.SendLocalizedMessage(1072405); // Your lasting damage effects have been removed! } break; case TalismanRemoval.Ward: target.PlaySound(0x201); Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0); // Magic reflect Hashtable m_Table = MagicReflectSpell.m_Table; if (m_Table == null) { return; } ResistanceMod[] mods = (ResistanceMod[])m_Table[target]; m_Table.Remove(target); if (mods != null) { for (int i = 0; i < mods.Length; ++i) { target.RemoveResistanceMod(mods[i]); } } BuffInfo.RemoveBuff(target, BuffIcon.MagicReflection); // Reactive armor m_Table = ReactiveArmorSpell.m_Table; if (m_Table == null) { return; } mods = (ResistanceMod[])m_Table[target]; if (mods != null) { m_Table.Remove(target); for (int i = 0; i < mods.Length; ++i) { target.RemoveResistanceMod(mods[i]); } } BuffInfo.RemoveBuff(target, BuffIcon.ReactiveArmor); // Protection m_Table = ProtectionSpell.m_Table; if (m_Table == null) { return; } object[] pmods = (object[])m_Table[target]; if (mods != null) { m_Table.Remove(target); ProtectionSpell.Registry.Remove(target); target.RemoveResistanceMod((ResistanceMod)pmods[0]); target.RemoveSkillMod((SkillMod)pmods[1]); } BuffInfo.RemoveBuff(target, BuffIcon.Protection); if (target == from) { from.SendLocalizedMessage(1072402); // Your wards have been removed! } else { from.SendLocalizedMessage(1072403); // Your target's wards have been removed! target.SendLocalizedMessage(1072402); // Your wards have been removed! } break; } m_Talisman.ChargeTime = m_Talisman.MaxChargeTime; if (m_Talisman.Charges > 0) { m_Talisman.Charges -= 1; } m_Talisman.StartTimer(); m_Talisman.InvalidateProperties(); }
public static bool ClearSkillLoss(Mobile mob) { try { SkillLossContext context; if (m_SkillLoss.TryGetValue(mob, out context) && context != null) { m_SkillLoss.Remove(mob); List<SkillMod> mods = context.m_SkillMods; foreach (SkillMod t in mods) { mob.RemoveSkillMod(t); } context.m_Timer.Stop(); mob.RemoveStatMod("Murder Penalty Str"); mob.RemoveStatMod("Murder Penalty Dex"); mob.RemoveStatMod("Murder Penalty Int"); return true; } } catch { } return false; }
public static void RemoveContext(Mobile m, AnimalFormContext context, bool resetGraphics) { m_Table.Remove(m); if (context.SpeedBoost) m.Send(SpeedControl.Disable); SkillMod mod = context.Mod; if (mod != null) m.RemoveSkillMod(mod); mod = context.StealingMod; if (mod != null) m.RemoveSkillMod(mod); if (resetGraphics) { m.HueMod = -1; m.BodyMod = 0; m.NameMod = null; // vinds retour au nom d'origine lorsque reprise de la forme humaine } m.FixedParticles(0x3728, 10, 13, 2023, EffectLayer.Waist); context.Timer.Stop(); }
public static void RemoveContext(Mobile m, AnimalFormContext context, bool resetGraphics) { m_Table.Remove(m); if (context.SpeedBoost) m.Send(SpeedControl.Disable); SkillMod mod = context.Mod; if (mod != null) m.RemoveSkillMod(mod); mod = context.StealingMod; if (mod != null) m.RemoveSkillMod(mod); if (resetGraphics) { m.HueMod = -1; m.BodyMod = 0; } m.FixedParticles(0x3728, 10, 13, 2023, EffectLayer.Waist); context.Timer.Stop(); }
public static bool ClearSkillLoss(Mobile mob) { SkillLossContext context; if (!m_SkillLoss.TryGetValue(mob, out context)) return false; m_SkillLoss.Remove(mob); List<SkillMod> mods = context.m_Mods; for (int i = 0; i < mods.Count; ++i) mob.RemoveSkillMod(mods[i]); context.m_Timer.Stop(); return true; }
public static bool ClearSkillLoss(Mobile mob) { SkillLossContext context; m_SkillLoss.TryGetValue(mob, out context); if (context != null) { m_SkillLoss.Remove(mob); List<SkillMod> mods = context.m_Mods; foreach (SkillMod sm in mods) { mob.RemoveSkillMod(sm); } context.m_Timer.Stop(); return true; } return false; }
public static void RemoveBonus( Mobile m ) { BaseArmor armor; if ( ( armor = m.FindItemOnLayer( Layer.Neck ) as BaseArmor ) is PlateOfHonorGorget ) RemoveBonus( armor ); if ( ( armor = m.FindItemOnLayer( Layer.Helm ) as BaseArmor ) is PlateOfHonorHelm ) RemoveBonus( armor ); if ( ( armor = m.FindItemOnLayer( Layer.Pants ) as BaseArmor ) is PlateOfHonorLegs ) RemoveBonus( armor ); if ( ( armor = m.FindItemOnLayer( Layer.Arms ) as BaseArmor ) is PlateOfHonorArms ) RemoveBonus( armor ); if ( ( armor = m.FindItemOnLayer( Layer.Gloves ) as BaseArmor ) is PlateOfHonorGloves ) RemoveBonus( armor ); if ( ( armor = m.FindItemOnLayer( Layer.InnerTorso ) as BaseArmor ) is PlateOfHonorChest ) RemoveBonus( armor ); if ( m_Bonus.ContainsKey( m ) ) { List<AttributeMod> mods = m_Bonus[m]; RemoveMods( m, mods ); m_Bonus.Remove( m ); } SkillMod skillmod = m_Table[m] as SkillMod; if ( skillmod != null ) { m.RemoveSkillMod( skillmod ); m_Table.Remove( m ); } }
public static void RemoveBonus( Mobile m ) { BaseArmor armor; if ( ( armor = m.FindItemOnLayer( Layer.Gloves ) as BaseArmor ) is AssassinGloves ) RemoveBonus( armor ); if ( ( armor = m.FindItemOnLayer( Layer.Pants ) as BaseArmor ) is AssassinLeggings ) RemoveBonus( armor ); if ( ( armor = m.FindItemOnLayer( Layer.Arms ) as BaseArmor ) is AssassinSleeves ) RemoveBonus( armor ); if ( ( armor = m.FindItemOnLayer( Layer.InnerTorso ) as BaseArmor ) is AssassinTunic ) RemoveBonus( armor ); m.RemoveStatMod( "AssassinSetDex" ); SkillMod skillmod = m_Table[m] as SkillMod; if ( skillmod != null ) { m.RemoveSkillMod( skillmod ); m_Table.Remove( m ); } }
public static void RemoveBonus( Mobile m ) { BaseArmor armor; if ( ( armor = m.FindItemOnLayer( Layer.Gloves ) as BaseArmor ) is DeathsEssenceGloves ) RemoveBonus( armor ); if ( ( armor = m.FindItemOnLayer( Layer.Pants ) as BaseArmor ) is DeathsEssenceLeggings ) RemoveBonus( armor ); if ( ( armor = m.FindItemOnLayer( Layer.Arms ) as BaseArmor ) is DeathsEssenceSleeves ) RemoveBonus( armor ); if ( ( armor = m.FindItemOnLayer( Layer.Helm ) as BaseArmor ) is DeathsEssenceHelm ) RemoveBonus( armor ); if ( ( armor = m.FindItemOnLayer( Layer.InnerTorso ) as BaseArmor ) is DeathsEssenceTunic ) RemoveBonus( armor ); if ( m_Bonus.ContainsKey( m ) ) { List<AttributeMod> mods = m_Bonus[m]; RemoveMods( m, mods ); m_Bonus.Remove( m ); } SkillMod skillmod = m_Table[m] as SkillMod; if ( skillmod != null ) { m.RemoveSkillMod( skillmod ); m_Table.Remove( m ); } }