protected override void OnTick() { if (m_Wearer != null) { if (m_Clothing != null) { switch (m_Clothing.MagicType) { case MagicEffect.Invisibility: if (m_Clothing.MagicCharges > 0) { m_Wearer.Hidden = true; m_Clothing.MagicCharges--; Start(); } else { Stop(); m_Wearer.RevealingAction(); } break; case MagicEffect.Bless: case MagicEffect.Agility: case MagicEffect.Clumsy: case MagicEffect.Cunning: case MagicEffect.Curse: case MagicEffect.Feeblemind: case MagicEffect.Strength: case MagicEffect.Weakness: if (m_Clothing.MagicCharges > 0) { m_Clothing.MagicCharges--; Start(); } else { Stop(); string StrName = String.Format("[Magic] {0} Offset:item-{1}", StatType.Str, m_Clothing.Serial); string IntName = String.Format("[Magic] {0} Offset:item-{1}", StatType.Int, m_Clothing.Serial); string DexName = String.Format("[Magic] {0} Offset:item-{1}", StatType.Dex, m_Clothing.Serial); m_Wearer.RemoveStatMod(StrName); m_Wearer.RemoveStatMod(IntName); m_Wearer.RemoveStatMod(DexName); m_Wearer.CheckStatTimers(); } break; default: Stop(); break; } } } }
public override void OnRemoved(object parent) { /*if ( Core.AOS && parent is Mobile ) * { * Mobile from = (Mobile)parent; * * m_AosSkillBonuses.Remove(); * * string modName = this.Serial.ToString(); * * from.RemoveStatMod( modName + "Str" ); * from.RemoveStatMod( modName + "Dex" ); * from.RemoveStatMod( modName + "Int" ); * * from.CheckStatTimers(); * }*/ if (!Core.AOS && parent is PlayerMobile) { PlayerMobile Wearer = (PlayerMobile)parent; if (m_InvisTimer != null) { if (m_InvisTimer.Running) { Wearer.RevealingAction(); m_InvisTimer.Stop(); m_InvisTimer = null; } } if (m_StatEffectTimer != null) { if (m_StatEffectTimer.Running) { string StrName = String.Format("[Magic] {0} Offset:item-{1}", StatType.Str, this.Serial); string IntName = String.Format("[Magic] {0} Offset:item-{1}", StatType.Int, this.Serial); string DexName = String.Format("[Magic] {0} Offset:item-{1}", StatType.Dex, this.Serial); Wearer.RemoveStatMod(StrName); Wearer.RemoveStatMod(IntName); Wearer.RemoveStatMod(DexName); Wearer.CheckStatTimers(); m_StatEffectTimer.Stop(); m_StatEffectTimer = null; } } } }
public override void OnRemoved(object parent) { if (parent is PlayerMobile) { PlayerMobile Wearer = (PlayerMobile)parent; if (m_InvisTimer != null) { if (m_InvisTimer.Running) { Wearer.RevealingAction(); m_InvisTimer.Stop(); m_InvisTimer = null; } } if (this.IOBAlignment != IOBAlignment.None) //Pigpen - Addition for IOB System { ((PlayerMobile)parent).IOBEquipped = false; } if (m_StatEffectTimer != null) { if (m_StatEffectTimer.Running) { string StrName = String.Format("[Magic] {0} Offset:item-{1}", StatType.Str, this.Serial); string IntName = String.Format("[Magic] {0} Offset:item-{1}", StatType.Int, this.Serial); string DexName = String.Format("[Magic] {0} Offset:item-{1}", StatType.Dex, this.Serial); Wearer.RemoveStatMod(StrName); Wearer.RemoveStatMod(IntName); Wearer.RemoveStatMod(DexName); Wearer.CheckStatTimers(); m_StatEffectTimer.Stop(); m_StatEffectTimer = null; } } } }
public void Target(Corpse c) { Mobile m = c.Owner; if (!Caster.CanSee(c)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (m == Caster) { Caster.SendLocalizedMessage(501039); // Thou can not resurrect thyself. } else if (!Caster.InRange(c, 5)) { Caster.SendLocalizedMessage(501042); // Target is not close enough. } else if (!m.Player) { Caster.SendLocalizedMessage(501043); // Target is not a being. } else if (CheckSequence() && m != null) { PlayerMobile pm = m as PlayerMobile; if (pm != null && Caster is PlayerMobile && (pm.MortEngine.MortCurrentState == MortState.Assomage || pm.MortEngine.MortCurrentState == MortState.MortDefinitive)) { SpellHelper.Turn(Caster, pm); /*((PlayerMobile)Caster).AddFatigue(250); * pm.AddFatigue(-250);*/ pm.PlaySound(0x214); Effects.SendTargetEffect(pm, 0x376A, 10, 16); if (pm.MortEngine.TimerEvanouie != null) { pm.MortEngine.TimerEvanouie.Stop(); pm.MortEngine.TimerEvanouie = null; } if (pm.MortEngine.TimerMort != null) { pm.MortEngine.TimerMort.Stop(); pm.MortEngine.TimerMort = null; } pm.Location = c.Location; pm.MortEngine.EndroitMort = c.Location; pm.MortEngine.RisqueDeMort = false; pm.MortEngine.Mort = false; pm.Frozen = false; pm.Direction = c.Direction; pm.Animate(21, 5, 1, false, false, 0); pm.Resurrect(); if (c != null) { ArrayList list = new ArrayList(); foreach (Item item in c.Items) { list.Add(item); } foreach (Item item in list) { if (item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) { item.Delete(); } if (item is RaceSkin || c.EquipItems.Contains(item)) { if (!m.EquipItem(item)) { m.AddToBackpack(item); } } else { m.AddToBackpack(item); } } } pm.CheckRaceSkin(); pm.CheckStatTimers(); pm.MortEngine.MortCurrentState = MortState.Resurrection; } else { Caster.SendMessage("Vous devez cibler le corps d'un joueur MORT !"); } } FinishSequence(); }
public override void OnCast() { if (Caster == null || Caster.Deleted || !Caster.Alive) { return; } foreach (Item itema in Caster.GetItemsInRange(1 + (int)(Caster.Skills[SkillName.ArtMagique].Base / 10))) { if (itema != null && itema is Corpse) { Corpse c = (Corpse)itema; if (c != null && c.Owner != null && c.Owner is PlayerMobile) { PlayerMobile pm = (PlayerMobile)(c.Owner); if (pm.MortEngine.MortCurrentState == MortState.Assomage) { //pm.AddFatigue(-100); SpellHelper.Turn(Caster, pm); pm.PlaySound(0x214); Effects.SendTargetEffect(pm, 0x376A, 10, 16); if (pm.MortEngine.TimerEvanouie != null) { pm.MortEngine.TimerEvanouie.Stop(); pm.MortEngine.TimerEvanouie = null; } if (pm.MortEngine.TimerMort != null) { pm.MortEngine.TimerMort.Stop(); pm.MortEngine.TimerMort = null; } pm.Location = c.Location; pm.MortEngine.EndroitMort = c.Location; pm.MortEngine.RisqueDeMort = false; pm.MortEngine.Mort = false; pm.Frozen = false; pm.Direction = c.Direction; pm.MoveToWorld(c.Location, c.Map); pm.Animate(21, 5, 1, false, false, 0); pm.Resurrect(); if (c != null) { ArrayList list = new ArrayList(); foreach (Item item in c.Items) { list.Add(item); } foreach (Item item in list) { if (item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) { item.Delete(); } if (item is RaceSkin || c.EquipItems.Contains(item)) { if (!pm.EquipItem(item)) { pm.AddToBackpack(item); } } else { pm.AddToBackpack(item); } } } pm.CheckRaceSkin(); pm.CheckStatTimers(); pm.MortEngine.MortCurrentState = MortState.Ebranle; } } } } }
public bool ApplyStatEffect(PlayerMobile Wearer, bool bStr, bool bDex, bool bInt, int change) { Spell spell = null; if (Wearer == null) { return(false); } // Try to apply bless to all stats int BlessOffset = change; bool AppliedStr = false; bool AppliedInt = false; bool AppliedDex = false; if (bStr) { if (BlessOffset > 0) { spell = new StrengthSpell(Wearer, null); } else { spell = new WeakenSpell(Wearer, null); } if (Wearer.Region.OnBeginSpellCast(Wearer, spell) == false) { Wearer.SendMessage("The magic normally within this object seems absent."); return(false); } AppliedStr = AddStatBonus(Wearer, BlessOffset, StatType.Str, TimeSpan.Zero); } if (bInt) { if (BlessOffset > 0) { spell = new CunningSpell(Wearer, null); } else { spell = new FeeblemindSpell(Wearer, null); } if (Wearer.Region.OnBeginSpellCast(Wearer, spell) == false) { Wearer.SendMessage("The magic normally within this object seems absent."); return(false); } AppliedInt = AddStatBonus(Wearer, BlessOffset, StatType.Int, TimeSpan.Zero); } if (bDex) { if (BlessOffset > 0) { spell = new AgilitySpell(Wearer, null); } else { spell = new ClumsySpell(Wearer, null); } if (Wearer.Region.OnBeginSpellCast(Wearer, spell) == false) { Wearer.SendMessage("The magic normally within this object seems absent."); return(false); } AppliedDex = AddStatBonus(Wearer, BlessOffset, StatType.Dex, TimeSpan.Zero); } Wearer.CheckStatTimers(); // If any stats were adjusted, start timer to remove the stats after effect expires // return that spell was successful if (AppliedStr || AppliedInt || AppliedDex) /* 7/25/04 smerX */ { if (m_StatEffectTimer != null) { m_StatEffectTimer.Stop(); m_StatEffectTimer = null; } m_StatEffectTimer = new MagicEffectTimer(Wearer, this, TimeSpan.FromSeconds(120)); m_StatEffectTimer.Start(); return(true); } else { return(false); } }
public override void OnResponse(NetState sender, RelayInfo info) { Mobile from = sender.Mobile; if (from.Deleted) { return; } switch (info.ButtonID) { case 1: if (!(m_From.MortEngine.MortCurrentState == MortState.MortVivant)) { m_From.MortEngine.AmeLastFed = DateTime.Now; m_From.MortEngine.MortVivant = true; m_From.MortEngine.MortCurrentState = MortState.MortVivant; MortVivantEvoTimer timer = new MortVivantEvoTimer(m_From); m_From.MortEngine.MortVivantTimer = timer; timer.Start(); m_From.Hits = (m_From.HitsMax / 2) + Utility.RandomMinMax(-5, 5); m_From.Frozen = true; //if (Temrael.beta) // m_From.Map = Map.Ilshenar; m_From.Location = m_From.MortEngine.EndroitMort; m_From.MortEngine.Mort = false; m_From.Resurrect(); m_From.Frozen = false; if (m_From.Corpse != null) { ArrayList list = new ArrayList(); foreach (Item item in m_From.Corpse.Items) { list.Add(item); } foreach (Item item in list) { if (item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) { item.Delete(); } if (item is RaceSkin || (m_From.Corpse is Corpse && ((Corpse)m_From.Corpse).EquipItems.Contains(item))) { if (!m_From.EquipItem(item)) { m_From.AddToBackpack(item); } } else { m_From.AddToBackpack(item); } } m_From.Corpse.Delete(); } m_From.CheckStatTimers(); m_From.CheckRaceSkin(); } break; } }