Server Crash Report
===================
RunUO Version 2.0, Build 2864.17588
Operating System: Microsoft Windows NT 5.1.2600 Service Pack 2
.NET Framework: 2.0.50727.832
Time: 1/5/2008 12:29:04 PM
Mobiles: 2908
Items: 134081
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Spells.Custom.BanishEvilSpell.Target(Mobile m)
at Server.Spells.Custom.BanishEvilSpell.InternalTarget.OnTarget(Mobile from, Object o)
at Server.Targeting.Target.Invoke(Mobile from, Object targeted)
at Server.Network.PacketHandlers.TargetResponse(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
Vythic;821406 said:I searched and found out piety is just tithing points. Was hoping for a new skill.
Well, bad news, as soon as I cast one of these spells, it crashed my server.
Anyone have this working for runUO 2.0, latest svn?
using System;
using System.Collections;
using Server.Mobiles;
using Server.Gumps;
using Server.Targeting;
using Server.Items;
using Server.Prompts;
namespace Server
{
public class ClericCommands
{
public static void Initialize()
{
EventSink.Speech += new SpeechEventHandler( Speech_Event );
}
public static void Speech_Event( SpeechEventArgs e )
{
if ( e.Speech.ToLower().IndexOf( "i pray to the gods" ) != -1 )
{
if ( !e.Mobile.CheckAlive() )
{
e.Mobile.SendMessage( "You begin praying to the Gods for help..." );
if (e.Mobile.Karma < 250 && e.Mobile.Str < 10 && e.Mobile.Skills[SkillName.Necromancy].Base<=0.1)
e.Mobile.SendMessage( "You lack the Strentgh of Conviction to plead with the Gods!" );
else
e.Mobile.SendMessage( "The Gods grant you the gift of life at the cost of Karma and Strength!" );
e.Mobile.Karma = e.Mobile.Karma - 200;
e.Mobile.SendMessage( "You lost 200 Karma." );
e.Mobile.Str = e.Mobile.Str-1;
e.Mobile.SendMessage( "You lost 1 Strength Point." );
e.Mobile.Resurrect();
}
else if(e.Mobile.Skills[SkillName.Necromancy].Base>=0.1)
{
e.Mobile.SendMessage( "The Gods will not listen to you!" );
}
else
{
e.Mobile.CloseGump( typeof ( ClericGump ) );
e.Mobile.SendGump( new ClericGump( e.Mobile ) );
}
}
if ( e.Speech.ToLower().IndexOf( "i summon the spirits of the underworld" ) != -1 )
{
e.Mobile.SendMessage( "You cry havoc of past sins to the underworld..." );
if (e.Mobile.Karma > -250 && e.Mobile.Str < 10)
{
e.Mobile.SendMessage( "You lack the essence to trade your soul for life!" );
}
else if ( !(e.Mobile.Alive) )
{
e.Mobile.SendMessage( "The unerworld grants you the gift of life at the cost of Karma and Strength!" );
e.Mobile.Karma = e.Mobile.Karma + 250;
e.Mobile.SendMessage( "You gain 200 Karma." );
e.Mobile.Str = e.Mobile.Str-1;
e.Mobile.SendMessage( "You lost 1 Strength Point." );
e.Mobile.Resurrect();
}
else
{
e.Mobile.SendMessage( "You aren't dead fool!" );
}
}
}
}
}
using System;
using System.Collections;
using Server.Targeting;
using Server.Network;
using Server.Mobiles;
using Server.Items;
using Server.Spells.Seventh;
using Server.Gumps;
namespace Server.Spells.Custom
{
public class AngelicFaithSpell : ClericSpell
{
private static SpellInfo m_Info = new SpellInfo(
"Angelic Faith", "Angelus Terum",
//SpellCircle.Eighth,
212,
9041
);
public override int RequiredTithing{ get{ return 100; } }
public override double RequiredSkill{ get{ return 80.0; } }
public override int RequiredMana { get { return 0; } }
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 0.25 ); } }
private static Hashtable m_Table = new Hashtable();
public AngelicFaithSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public static bool HasEffect( Mobile m )
{
return ( m_Table[m] != null );
}
public static void RemoveEffect( Mobile m )
{
object[] mods = (object[])m_Table[m];
if ( mods != null )
{
m.RemoveStatMod( ((StatMod)mods[0]).Name );
m.RemoveStatMod( ((StatMod)mods[1]).Name );
m.RemoveStatMod( ((StatMod)mods[2]).Name );
m.RemoveSkillMod( (SkillMod)mods[3] );
m.RemoveSkillMod( (SkillMod)mods[4] );
m.RemoveSkillMod( (SkillMod)mods[5] );
}
m_Table.Remove( m );
m.EndAction( typeof( AngelicFaithSpell ) );
m.BodyMod = 0;
}
public override bool CheckCast()
{
if ( !base.CheckCast() )
{
return false;
}
else if ( !Caster.CanBeginAction( typeof( AngelicFaithSpell ) ) )
{
Caster.SendLocalizedMessage( 1005559 );
return false;
}
else if( Caster.BodyMod != 0 )
//else if ( Necromancy.TransformationSpell.UnderTransformation( Caster ) )
{
Caster.SendMessage( "You cannot transform while in that form." );
return false;
}
else if ( DisguiseTimers.IsDisguised( Caster ) )
{
Caster.SendMessage( "You cannot transform while disguised." );
return false;
}
else if ( Caster.BodyMod == 183 || Caster.BodyMod == 184 )
{
Caster.SendMessage( "You cannot transform while wearing body paint." );
return false;
}
else if ( !Caster.CanBeginAction( typeof( PolymorphSpell ) ) )
{
Caster.SendMessage( "You cannot transform while polymorphed." );
return false;
}
return true;
}
public override void OnCast()
{
if ( !Caster.CanBeginAction( typeof( AngelicFaithSpell ) ) )
{
Caster.SendLocalizedMessage( 1005559 );
}
else if( Caster.BodyMod != 0 )
//else if ( Necromancy.TransformationSpell.UnderTransformation( Caster ) )
{
Caster.SendMessage( "You cannot transform while in that form." );
}
else if ( DisguiseTimers.IsDisguised( Caster ) )
{
Caster.SendMessage( "You cannot transform while disguised." );
}
else if ( Caster.BodyMod == 183 || Caster.BodyMod == 184 )
{
Caster.SendMessage( "You cannot transform while wearing body paint." );
}
else if ( !Caster.CanBeginAction( typeof( PolymorphSpell ) ) )
{
Caster.SendMessage( "You cannot transform while polymorphed." );
}
else if ( CheckSequence() )
{
object[] mods = new object[]
{
new StatMod( StatType.Str, "[Cleric] Str Offset", 20, TimeSpan.Zero ),
new StatMod( StatType.Dex, "[Cleric] Dex Offset", 20, TimeSpan.Zero ),
new StatMod( StatType.Int, "[Cleric] Int Offset", 20, TimeSpan.Zero ),
new DefaultSkillMod( SkillName.Macing, true, 20 ),
new DefaultSkillMod( SkillName.Healing, true, 20 ),
new DefaultSkillMod( SkillName.Anatomy, true, 20 )
};
m_Table[Caster] = mods;
Caster.AddStatMod( (StatMod)mods[0] );
Caster.AddStatMod( (StatMod)mods[1] );
Caster.AddStatMod( (StatMod)mods[2] );
Caster.AddSkillMod( (SkillMod)mods[3] );
Caster.AddSkillMod( (SkillMod)mods[4] );
Caster.AddSkillMod( (SkillMod)mods[5] );
double span = 10.0 * DivineFocusSpell.GetScalar( Caster );
new InternalTimer( Caster, TimeSpan.FromMinutes( (int)span ) ).Start();
IMount mount = Caster.Mount;
if ( mount != null )
mount.Rider = null;
Caster.BodyMod = 123;
Caster.BeginAction( typeof( AngelicFaithSpell ) );
Caster.PlaySound( 0x165 );
Caster.FixedParticles( 0x3728, 1, 13, 0x480, 92, 3, EffectLayer.Head );
}
}
private class InternalTimer : Timer
{
private Mobile m_Owner;
private DateTime m_Expire;
public InternalTimer( Mobile owner, TimeSpan duration ) : base( TimeSpan.Zero, TimeSpan.FromSeconds( 0.1 ) )
{
m_Owner = owner;
m_Expire = DateTime.Now + duration;
}
protected override void OnTick()
{
if ( DateTime.Now >= m_Expire )
{
AngelicFaithSpell.RemoveEffect( m_Owner );
Stop();
}
}
}
}
}