darksiam
Member
Friends I do not understand how I can solve this error but I know which is the file that occiona I hope they can help me
Server Crash Report
===================
RunUO Version 2.2, Build 4782.3756
Operating System: Microsoft Windows NT 6.1.7601 Service Pack 1
.NET Framework: 2.0.50727.5420
Time: 20/01/2017 23:29:18
Mobiles: 2517
Items: 19454
Exception:
System.NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.
en Server.Spells.Custom.BanishEvilSpell.Target(Mobile m)
en Server.Spells.Custom.BanishEvilSpell.InternalTarget.OnTarget(Mobile from, Object o)
en Server.Targeting.Target.Invoke(Mobile from, Object targeted)
en Server.Network.PacketHandlers.TargetResponse(NetState state, PacketReader pvSrc)
en Server.Network.MessagePump.HandleReceive(NetState ns)
en Server.Network.MessagePump.Slice()
en Server.Core.Main(String[] args)
Clients:
- Count: 2
+ 127.0.0.1: (account = darksiam) (mobile = 0x1 'EmudeX')
+ 127.0.0.1: (account = darksiam1) (mobile = 0x9BB 'Espadachin Oscur')
Code:
using System;
using System.Collections;
using Server.Targeting;
using Server.Network;
using Server.Mobiles;
using Server.Items;
using Server.Gumps;
namespace Server.Spells.Custom
{
public class BanishEvilSpell : ClericSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Banish Evil", "Abigo Malus",
//SpellCircle.Sixth,
212,
9041
);
public override int RequiredTithing{ get{ return 30; } }
public override double RequiredSkill{ get{ return 60.0; } }
public override int RequiredMana { get { return 0; } }
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 0.25 ); } }
public BanishEvilSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override void OnCast()
{
Caster.Target = new InternalTarget( this );
}
public void Target( Mobile m )
{
SlayerEntry undead = SlayerGroup.GetEntryByName( SlayerName.Silver );
SlayerEntry demon = SlayerGroup.GetEntryByName( SlayerName.DaemonDismissal );
if ( !Caster.CanSee( m ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( !undead.Slays( m ) && !demon.Slays( m ) )
{
Caster.SendMessage( "This spell cannot be used on this type of creature." );
}
else if ( CheckHSequence( m ) )
{
SpellHelper.Turn( Caster, m );
m.FixedParticles( 0x3709, 10, 30, 5052, 0x480, 0, EffectLayer.LeftFoot );
m.PlaySound( 0x208 );
m.Say( "No! I musn't be banished!" );
new InternalTimer( m ).Start();
}
FinishSequence();
}
private class InternalTimer : Timer
{
Mobile m_Owner;
public InternalTimer( Mobile owner ) : base( TimeSpan.FromSeconds( 1.5 ) )
{
m_Owner = owner;
}
protected override void OnTick()
{
if ( m_Owner != null && m_Owner.CheckAlive() )
{
m_Owner.Delete();
}
}
}
private class InternalTarget : Target
{
private BanishEvilSpell m_Owner;
public InternalTarget( BanishEvilSpell owner ) : base( 12, false, TargetFlags.Harmful )
{
m_Owner = owner;
}
protected override void OnTarget( Mobile from, object o )
{
if ( o is Mobile )
{
m_Owner.Target( (Mobile)o );
}
}
protected override void OnTargetFinish( Mobile from )
{
m_Owner.FinishSequence();
}
}
}
}
Last edited: