26/02-23:48 2006-02-26 23:48:29,824 FATAL System.NullReferenceException: Object reference not set to an instance of an object
in <0x0002f> Server.Items.CannonComponent:Damage (Server.Mobile from, Int32 damage)
in <0x0065d> Server.Items.CannonComponent:Explode (Server.Mobile from, Point3D loc, Server.Map map)
in <0x00b60> Server.Items.CannonComponent:CheckFiringAngle (Point3D p, Server.Mobile from)
in <0x00106> Server.Mobiles.BaseCannonGuard:FireCannon (Server.Mobile target)
in <0x0002f> Server.Mobiles.BaseCannonGuard:OnCombatantChange ()
in <0x001f9> Server.Mobile:set_Combatant (Server.Mobile value)
in <0x000e5> Server.Mobiles.ArcherAI:DoActionGuard ()
in <0x000c3> Server.Mobiles.BaseAI:Think ()
in <0x0037f> Server.Mobiles.BaseAI:DoOrderAttack ()
in <0x000ab> Server.Mobiles.BaseAI:Obey ()
in <0x0024b> Server.Mobiles.BaseAI+AITimer:OnTick ()
in <0x000bd> Server.Timer:Slice ()
in <0x005c6> Server.Core:Start (Server.Config.Root _config, Boolean debug, Boolean _service, Boolean _profiling)
Crash: Backing up...done
26/02-23:48 Crash: Generating report...done
26/02-23:48 Crash: Sending email...failed
26/02-23:48 Crash: Restarting...done
Anvil said:This has been a bug with this for a long time. I've removed out the cannons that have guards will them. The cannons without guards work just fine. I'm working on the cannons since after I removed the guards scripts now I'm having a problem where the cannons won't fire, but you need to remove the cannons with the guards to prevent your crashing.
Dragon Slayer said:greystar can you post you fix for this please and thanks
public override double GetValueFrom( Mobile m, FightMode acqType, bool bPlayerOnly )
{
bPlayerOnly = false;
return base.GetValueFrom(m, acqType, bPlayerOnly);
}
Anvil said:So does your fix actually still have them attack criminals or do they not attack on sight at all anymore? Just curious...
public override bool IsEnemy( Mobile m )
{
if (m == null)
return false;
// If you add in this line it will be not an enemy
if ( m is BaseGuard || m is BaseVendor || m is BaseHealer || m is TownCrier )
return false;
GuardedRegion rgn = null;
if (m.Region != null)
rgn = m.Region as GuardedRegion;
if (rgn != null)
{
// If you add in this line it will be not an enemy
//if ( m is PlayerMobile && ( !m.Criminal || ( m.Kills >= 5 && rgn.AllowReds) ) )
// return false;
// If you add in this line it will be an enemy
return ( m.Criminal || ( m.Kills >= 5 && !rgn.AllowReds) );
}
BaseCreature c = m as BaseCreature;
// This section is entirely for things based on BaseCreature
if ( c != null )
{
if (c.Region != null )
rgn = c.Region as GuardedRegion;
if (rgn != null)
{
if ( c.Criminal || (( c.Kills >= 5 || c.AlwaysMurderer ) && !rgn.AllowReds ) )
{
return true;
}
}
}
return false; //If you can figure out how to connect this back to basecreatures without a crash, post it please.
}
Dragon Slayer said:I get this error in game keeps saying that im right next to cannon i even telported on top still gives me this saying
you are to far away from cannon
if( !from.InRange( m_cannon.Location, 3 ) )
{
from.SendLocalizedMessage( 500295 ); // You are too far away to do that.
return;
}
else if ( from.Backpack.GetAmount( typeof( CannonBall )) == 0)
from.Say("You don't have any cannon balls!");
else if ( from.Backpack.GetAmount( typeof( SulfurousAsh )) < 3)
from.SendLocalizedMessage( 1049617 ); // You do not have enough sulfurous ash.
else if ( from.Mounted )
from.SendLocalizedMessage( 1010097 ); // You cannot use this while mounted.
else
from.Say("You are too far from cannon!");
Liacs said:little question: are you going to work on a catapult script in this way too?
*hops around in excitement and claps hands*
That would be awsome. Anyway: great work on the script!