public static void Damage(TimeSpan delay, Mobile target, Mobile from, double damage, int phys, int fire, int cold, int pois, int nrgy, DFAlgorithm dfa) { Damage(null, delay, target, from, damage, phys, fire, cold, pois, nrgy, dfa); }
public SpellDamageTimerAOS( Mobile target, Mobile from, int damage, int phys, int fire, int cold, int pois, int nrgy, TimeSpan delay, DFAlgorithm dfa ) : base( delay ) { m_Target = target; m_From = from; m_Damage = damage; m_Phys = phys; m_Fire = fire; m_Cold = cold; m_Pois = pois; m_Nrgy = nrgy; m_DFA = dfa; Priority = TimerPriority.TwentyFiveMS; }
public static void Damage(Spell spell, Mobile target, double damage, int phys, int fire, int cold, int pois, int nrgy, DFAlgorithm dfa) { TimeSpan ts = GetDamageDelayForSpell(spell); Damage(spell, ts, target, spell.Caster, damage, phys, fire, cold, pois, nrgy, dfa); }
public static void Damage( Spell spell, TimeSpan delay, Mobile target, Mobile from, double damage, int phys, int fire, int cold, int pois, int nrgy, DFAlgorithm dfa ) { int iDamage = (int)damage; //CONFIRMED if (target != null && target.Player) iDamage /= 2; bool canattack = false; int noto = Notoriety.Compute(from, target); if (noto == Notoriety.Enemy) canattack = true; else if (((from.FindItemOnLayer(Layer.TwoHanded) is OrderShield) && (target.FindItemOnLayer(Layer.TwoHanded) is ChaosShield)) && target is PlayerMobile) canattack = true; else if (((from.FindItemOnLayer(Layer.TwoHanded) is ChaosShield) && (target.FindItemOnLayer(Layer.TwoHanded) is OrderShield)) && target is PlayerMobile) canattack = true; if (IsTown(target.Location, from) && !canattack) iDamage = 1; if( delay == TimeSpan.Zero ) { if( from is BaseCreature ) ((BaseCreature)from).AlterSpellDamageTo( target, ref iDamage ); if( target is BaseCreature ) ((BaseCreature)target).AlterSpellDamageFrom( from, ref iDamage ); WeightOverloading.DFA = dfa; AOS.Damage( target, from, iDamage, phys, fire, cold, pois, nrgy ); WeightOverloading.DFA = DFAlgorithm.Standard; } else { new SpellDamageTimerAOS( spell, target, from, iDamage, phys, fire, cold, pois, nrgy, delay, dfa ).Start(); } if( target is BaseCreature && from != null && delay == TimeSpan.Zero ) ((BaseCreature)target).OnDamagedBySpell( from ); }
public static void Damage( TimeSpan delay, Mobile target, Mobile from, double damage, int phys, int fire, int cold, int pois, int nrgy, DFAlgorithm dfa ) { double Moddamage = damage; ISpell i = from.Spell; if ( i != null && target is BaseCreature) { Spell s = (Spell)i; ((BaseCreature)target).CheckSpellImmunity(s.DamageType, Moddamage, out Moddamage); //Console.WriteLine("Old Damage {0}, new Damage {1}",damage,Moddamage); } if ( delay == TimeSpan.Zero ) { WeightOverloading.DFA = dfa; AOS.Damage( target, from, (int)Moddamage, phys, fire, cold, pois, nrgy ); WeightOverloading.DFA = DFAlgorithm.Standard; } else { new SpellDamageTimerAOS( target, from, (int)Moddamage, phys, fire, cold, pois, nrgy, delay, dfa ).Start(); } if ( target is BaseCreature && from != null && delay == TimeSpan.Zero ) ((BaseCreature)target).OnDamagedBySpell( from ); }
public SpellDamageTimerAOS(Mobile target, Mobile from, int damage, int phys, int fire, int cold, int pois, int nrgy, TimeSpan delay, DFAlgorithm dfa) : base(delay) { m_Target = target; m_From = from; m_Damage = damage; m_Phys = phys; m_Fire = fire; m_Cold = cold; m_Pois = pois; m_Nrgy = nrgy; m_DFA = dfa; }
public static void Damage( TimeSpan delay, Mobile target, Mobile from, double damage, int phys, int fire, int cold, int pois, int nrgy, DFAlgorithm dfa ) { int iDamage = (int) damage; if ( delay == TimeSpan.Zero ) { if ( from is BaseCreature ) ( (BaseCreature) from ).AlterSpellDamageTo( target, ref iDamage ); if ( target is BaseCreature ) ( (BaseCreature) target ).AlterSpellDamageFrom( from, ref iDamage ); WeightOverloading.DFA = dfa; int damageGiven = AOS.Damage( target, from, iDamage, phys, fire, cold, pois, nrgy ); WeightOverloading.DFA = DFAlgorithm.Standard; SpellPlagueSpell.CheckPlague( target ); if ( target is BaseCreature && from != null ) ( (BaseCreature) target ).OnDamagedBySpell( from ); } else { new SpellDamageTimerAOS( target, from, iDamage, phys, fire, cold, pois, nrgy, delay, dfa ).Start(); } }
public static void Damage( Spell spell, Mobile target, double damage, int phys, int fire, int cold, int pois, int nrgy, DFAlgorithm dfa ) { TimeSpan ts; if ( spell.DelayedDamage ) ts = DamageDelays[(int)spell.Circle]; else ts = TimeSpan.Zero; Damage( ts, target, spell.Caster, damage, phys, fire, cold, pois, nrgy, dfa ); }
public static void Damage( TimeSpan delay, Mobile target, Mobile from, double damage, int phys, int fire, int cold, int pois, int nrgy, DFAlgorithm dfa ) { if ( delay == TimeSpan.Zero ) { WeightOverloading.DFA = dfa; AOS.Damage( target, from, (int)damage, phys, fire, cold, pois, nrgy ); WeightOverloading.DFA = DFAlgorithm.Standard; } else { new SpellDamageTimerAOS( target, from, (int)damage, phys, fire, cold, pois, nrgy, delay, dfa ).Start(); } if ( target is BaseCreature && from != null && delay == TimeSpan.Zero ) ((BaseCreature)target).OnDamagedBySpell( from ); }
public static void Damage(TimeSpan delay, Mobile target, Mobile from, double damage, int phys, int fire, int cold, int pois, int nrgy, DFAlgorithm dfa) { Damage(null, delay, target, from, damage, phys, fire, cold, pois, nrgy, dfa); }
public static void Damage(Spell spell, TimeSpan delay, Mobile target, Mobile from, double damage, int phys, int fire, int cold, int pois, int nrgy, DFAlgorithm dfa) { int iDamage = (int)damage; if (delay == TimeSpan.Zero) { if (from is BaseCreature) { ((BaseCreature)from).AlterSpellDamageTo(target, ref iDamage); } if (target is BaseCreature) { ((BaseCreature)target).AlterSpellDamageFrom(from, ref iDamage); } WeightOverloading.DFA = dfa; int damageGiven = AOS.Damage(target, from, iDamage, phys, fire, cold, pois, nrgy); if (from != null) // sanity check { DoLeech(damageGiven, from, target); } WeightOverloading.DFA = DFAlgorithm.Standard; } else { new SpellDamageTimerAOS(spell, target, from, iDamage, phys, fire, cold, pois, nrgy, delay, dfa).Start(); } if (target is BaseCreature && from != null && delay == TimeSpan.Zero) { ((BaseCreature)target).OnDamagedBySpell(from); } }
public static void Damage(Spell spell, Mobile target, double damage, int phys, int fire, int cold, int pois, int nrgy, DFAlgorithm dfa) { TimeSpan ts = GetDamageDelayForSpell(spell); Damage(spell, ts, target, spell.Caster, damage, phys, fire, cold, pois, nrgy, dfa); }
public SpellDamageTimerAOS(Spell s, Mobile target, Mobile from, int damage, int phys, int fire, int cold, int pois, int nrgy, TimeSpan delay, DFAlgorithm dfa) : base(delay) { m_Target = target; m_From = from; m_Damage = damage; m_Phys = phys; m_Fire = fire; m_Cold = cold; m_Pois = pois; m_Nrgy = nrgy; m_DFA = dfa; m_Spell = s; if (m_Spell != null && m_Spell.DelayedDamage && !m_Spell.DelayedDamageStacking) { m_Spell.StartDelayedDamageContext(from, this); } Priority = TimerPriority.TwentyFiveMS; }
public static void Damage( TimeSpan delay, Mobile target, Mobile from, double damage, int phys, int fire, int cold, int pois, int nrgy, DFAlgorithm dfa ) { if ( damage <= 0 ) return; if ( !target.Player && !target.Body.IsHuman && !Core.AOS ) damage *= 2.0; // Double magery damage to monsters/animals if not AOS damage = (damage + 1.0) / 2.0; if ( delay == TimeSpan.Zero ) { if ( target is BaseCreature && from != null ) ((BaseCreature)target).OnDamagedBySpell( from ); WeightOverloading.DFA = dfa; AOS.Damage( target, from, (int)damage, phys, fire, cold, pois, nrgy ); WeightOverloading.DFA = DFAlgorithm.Standard; } else { new SpellDamageTimerAOS( target, from, (int)damage, phys, fire, cold, pois, nrgy, delay, dfa ).Start(); } }
public static void Damage(Spell spell, TimeSpan delay, Mobile target, Mobile from, double damage, int phys, int fire, int cold, int pois, int nrgy, DFAlgorithm dfa) { int iDamage = (int)damage; if (delay == TimeSpan.Zero) { if (from is BaseCreature) ((BaseCreature)from).AlterSpellDamageTo(target, ref iDamage); if (target is BaseCreature) ((BaseCreature)target).AlterSpellDamageFrom(from, ref iDamage); WeightOverloading.DFA = dfa; int damageGiven = AOS.Damage(target, from, iDamage, phys, fire, cold, pois, nrgy); if (from != null) // sanity check { DoLeech(damageGiven, from, target); } WeightOverloading.DFA = DFAlgorithm.Standard; } else { new SpellDamageTimerAOS(spell, target, from, iDamage, phys, fire, cold, pois, nrgy, delay, dfa).Start(); } if (target is BaseCreature && from != null && delay == TimeSpan.Zero) { BaseCreature c = (BaseCreature)target; c.OnHarmfulSpell(from); c.OnDamagedBySpell(from); } }
public static void Damage( Spell spell, TimeSpan delay, Mobile target, Mobile from, double damage, int phys, int fire, int cold, int pois, int nrgy, DFAlgorithm dfa ) { int iDamage = (int)damage; #region Taran: Spell damage is based on armor difference /* double newDamage = damage; if (target is PlayerMobile && from is PlayerMobile) { World.Broadcast(25, true, "Old damage is: " + iDamage); double defar = ((PlayerMobile) target).BaseArmorRatingSpells; double attar = ((PlayerMobile) from).BaseArmorRatingSpells; double diff = defar - attar; World.Broadcast(50, true, "Difference in armor rating is: " + diff); if (defar - attar > 0) newDamage = iDamage*(1.00 - ((diff * 1.6) / 100)); if (newDamage / iDamage < 0.6) //Don't deal less than 60% damage newDamage = iDamage*0.6; iDamage = (int) newDamage; World.Broadcast(25, true, "New damage is: " + iDamage); } */ #endregion //Maka); if (target == from && from.MagicDamageAbsorb > 0) { from.FixedEffect(0x37B9, 10, 5); from.MagicDamageAbsorb = 0; iDamage = 0; DefensiveSpell.Nullify(from); } if( Evasion.CheckSpellEvasion( target ) ) iDamage = 0; if ( delay == TimeSpan.Zero ) { if( from is BaseCreature ) ((BaseCreature)from).AlterSpellDamageTo( target, ref iDamage ); if( target is BaseCreature ) ((BaseCreature)target).AlterSpellDamageFrom( from, ref iDamage ); //WeightOverloading.DFA = dfa; int damageGiven = AOS.Damage(target, from, iDamage, phys, fire, cold, pois, nrgy); DoLeech(damageGiven, from, target); //WeightOverloading.DFA = DFAlgorithm.Standard; } else { new SpellDamageTimerAOS( spell, target, from, iDamage, phys, fire, cold, pois, nrgy, delay, dfa ).Start(); } if( target is BaseCreature && from != null && delay == TimeSpan.Zero ) { BaseCreature c = (BaseCreature)target; c.OnHarmfulSpell(from); c.OnDamagedBySpell(from); } }
public SpellDamageTimerAOS(Spell s, Mobile target, Mobile from, int damage, int phys, int fire, int cold, int pois, int nrgy, TimeSpan delay, DFAlgorithm dfa) : base(delay) { this.m_Target = target; this.m_From = from; this.m_Damage = damage; this.m_Phys = phys; this.m_Fire = fire; this.m_Cold = cold; this.m_Pois = pois; this.m_Nrgy = nrgy; this.m_DFA = dfa; this.m_Spell = s; if (this.m_Spell != null && this.m_Spell.DelayedDamage && !this.m_Spell.DelayedDamageStacking) this.m_Spell.StartDelayedDamageContext(target, this); this.Priority = TimerPriority.TwentyFiveMS; }
public static void Damage(TimeSpan delay, Mobile target, Mobile from, double damage, int phys, int fire, int cold, int pois, int nrgy, DFAlgorithm dfa) { int iDamage = (int)damage; if (delay == TimeSpan.Zero) { if (from is BaseCreature) { ((BaseCreature)from).AlterSpellDamageTo(target, ref iDamage); } if (target is BaseCreature) { ((BaseCreature)target).AlterSpellDamageFrom(from, ref iDamage); } WeightOverloading.DFA = dfa; AOS.Damage(target, from, iDamage, phys, fire, cold, pois, nrgy); WeightOverloading.DFA = DFAlgorithm.Standard; SpellPlagueSpell.CheckPlague(target); if (target is BaseCreature && from != null) { ((BaseCreature)target).OnDamagedBySpell(from); } } else { new SpellDamageTimerAOS(target, from, iDamage, phys, fire, cold, pois, nrgy, delay, dfa).Start(); } }