public override void OnSpellEffect(SpellPacketBody spell) { Logger.Info("Delay Poison OnSpellEffect"); spell.duration = 600 * spell.casterLevel; var target_item = spell.Targets[0]; if (target_item.Object.IsFriendly(spell.caster)) { // Neutralise any Hezrou Stench effects. Stench.neutraliseStench(target_item.Object, spell.duration); target_item.Object.AddCondition("sp-Delay Poison", spell.spellId, spell.duration, 0); target_item.ParticleSystem = AttachParticles("sp-Delay Poison", target_item.Object); } else { if (!target_item.Object.SavingThrowSpell(spell.dc, SavingThrowType.Fortitude, D20SavingThrowFlag.NONE, spell.caster, spell.spellId)) { // saving throw unsuccesful target_item.Object.FloatMesFileLine("mes/spell.mes", 30002); // Neutralise any Hezrou Stench effects. Stench.neutraliseStench(target_item.Object, spell.duration); target_item.Object.AddCondition("sp-Delay Poison", spell.spellId, spell.duration, 0); target_item.ParticleSystem = AttachParticles("sp-Delay Poison", target_item.Object); } else { // saving throw successful target_item.Object.FloatMesFileLine("mes/spell.mes", 30001); AttachParticles("Fizzle", target_item.Object); spell.RemoveTarget(target_item.Object); } } spell.EndSpell(); }
public override void OnSpellEffect(SpellPacketBody spell) { Logger.Info("Neutralize Poison OnSpellEffect"); if (spell.spellClass == 13) // added to check for proper paladin slot level (darmagon) { if (spell.spellKnownSlotLevel < 4) { spell.caster.FloatMesFileLine("mes/spell.mes", 16008); spell.EndSpell(); return; } } if (spell.spellClass == 14) { if (spell.spellKnownSlotLevel < 3) // added to check for proper ranger slot level (darmagon) { spell.caster.FloatMesFileLine("mes/spell.mes", 16008); spell.EndSpell(); return; } } spell.duration = 0; var target = spell.Targets[0]; if (target.Object.IsFriendly(spell.caster)) { // Neutralise any Hezrou Stench effects. Stench.neutraliseStench(target.Object, 600 * spell.casterLevel); target.Object.AddCondition("sp-Neutralize Poison", spell.spellId, spell.duration, 0); target.ParticleSystem = AttachParticles("sp-Neutralize Poison", target.Object); } else if (!target.Object.SavingThrowSpell(spell.dc, SavingThrowType.Will, D20SavingThrowFlag.NONE, spell.caster, spell.spellId)) { // saving throw unsuccesful target.Object.FloatMesFileLine("mes/spell.mes", 30002); // Neutralise any Hezrou Stench effects. Stench.neutraliseStench(target.Object, 600 * spell.casterLevel); target.Object.AddCondition("sp-Neutralize Poison", spell.spellId, spell.duration, 0); target.ParticleSystem = AttachParticles("sp-Neutralize Poison", target.Object); } else { // saving throw succesful target.Object.FloatMesFileLine("mes/spell.mes", 30001); AttachParticles("Fizzle", target.Object); spell.RemoveTarget(target.Object); } spell.EndSpell(); }