| CODE |
| using System; using System.Collections; using Server.Network; using Server.Items; using Server.Mobiles; namespace Server.Spells.Chivalry { public class DispelEvilSpell : PaladinSpell { private static SpellInfo m_Info = new SpellInfo( "DispelEvil", "Dispiro Malas", SpellCircle.Third, -1, 9002 ); public override double RequiredSkill{ get{ return 35.0; } } public override int RequiredMana{ get{ return 15; } } public override int RequiredTithing{ get{ return 10; } } public override int MantraNumber{ get{ return 1060721; } } // Dispel Evil public override bool BlocksMovement{ get{ return false; } } public DispelEvilSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info ) { } public override void OnCast() { Mobile caster = Caster; if ( caster.GetMobilesInRange( 7 ) != null ) { foreach ( Mobile m in caster.GetMobilesInRange( 7 ) ) { BaseCreature f = m as BaseCreature; if ( f.Summoned == true ) { Mobile summoner = f.SummonMaster; if ( f is HordeMinionFamiliar || f is ShadowWispFamiliar || f is DarkWolfFamiliar || f is DeathAdderFamiliar || f is VampireBatFamiliar || ((BaseCreature)f).IsAnimatedDead || f is Revenant ) { double chance = Utility.Random( 0,100 ); if ( ( ( (caster.Karma + caster.Skills[SkillName.Chivalry].Value) + (summoner.Fame + summoner.Skills[SkillName.Necromancy].Value) )/404.8) > chance ) { Effects.SendLocationParticles( EffectItem.Create( f.Location, f.Map, EffectItem.DefaultDuration ), 0x3728, 8, 20, 5042 ); Effects.PlaySound( f, f.Map, 0x201 ); f.Delete(); } } } if ( Necromancy.TransformationSpell.UnderTransformation( m ) ) { m.FixedEffect( 0x3779, 10, 20 ); int Stam = (m.StamMax)*(40/100); int Mana = (m.ManaMax)*(40/100); m.Stam = (m.Stam)-Stam; m.Mana = (m.Mana)-Mana; } if ( f is Shade || f is Spectre || f is Wraith || f is SkeletalMage ) { f.FixedEffect( 0x3779, 10, 20 ); f.AI = AIType.AI_Flee; TimeSpan.FromSeconds (4.0); f.AI = AIType.AI_Mage; } if ( f is BoneKnight || f is ChaosDaemon || f is Ghoul || f is HordeMinion || f is Mummy || f is RestlessSoul || f is SkeletalKnight || f is Skeleton || f is SpectralArmour || f is Zombie ) { f.FixedEffect( 0x3779, 10, 20 ); f.AI = AIType.AI_Flee; TimeSpan.FromSeconds (4.0); f.AI = AIType.AI_Melee; } } } } } } |
| CODE |
| Exception: System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet. at Server.Spells.Chivalry.DispelEvilSpell.OnCast() at Server.Spells.CastTimer.OnTick() at Server.Timer.Slice() at Server.Core.Main(String[] args) |