dragon slayer2
Member
Okay here is crash report
RunUO Version 0.5, Build 5368.35672
Operating System: Microsoft Windows NT 6.2.9200.0
.NET Framework: 4.0.30319.34014
Time: 10/1/2014 10:51:34 PM
Mobiles: 20
Items: 476
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Mobiles.PlayerMobile.Damage(Int32 amount, Mobile from)
at Server.Mobiles.PlayerMobile.SickTimer.OnTick()
at Server.Timer.Slice()
at Server.Core.Main(String[] args)
here is the ontick im getting crash from
RunUO Version 0.5, Build 5368.35672
Operating System: Microsoft Windows NT 6.2.9200.0
.NET Framework: 4.0.30319.34014
Time: 10/1/2014 10:51:34 PM
Mobiles: 20
Items: 476
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Mobiles.PlayerMobile.Damage(Int32 amount, Mobile from)
at Server.Mobiles.PlayerMobile.SickTimer.OnTick()
at Server.Timer.Slice()
at Server.Core.Main(String[] args)
here is the ontick im getting crash from
Code:
publicclassSickTimer : Timer
{
private PlayerMobile m_defender;
privateint cnt = 0;
privateint m_count = 0;
privateint m_countmax;
public SickTimer(PlayerMobile defender, int count)
: base(TimeSpan.Zero, TimeSpan.FromSeconds(defender.SD), count)
{
this.Priority = TimerPriority.TenMS;
m_defender = (PlayerMobile)defender;
m_countmax = count;
}
protectedoverridevoid OnTick()
{
if (m_defender == null)
{
m_defender.Sick = false;
m_defender.Contagious = false;
Stop();
}
if (!m_defender.Alive)
{
m_defender.Sick = false;
m_defender.Contagious = false;
m_defender.SendMessage("You are no longer sick!");
Stop();
}
if ((!m_defender.Sick) || (m_defender.SicknessType == SickType.None))
Stop();
if (m_defender.SicknessType == SickType.Headache)
{
cnt += 1;
m_count += 1;
m_defender.Damage(Utility.Random(m_defender.HMN, m_defender.HMX));
//m_defender.Mana -= 1;
if (cnt > 2)
{
m_defender.SendMessage("You have a bad headache!");
m_defender.Emote("*head throbbing*");
if (!m_defender.Female)
m_defender.PlaySound(0x42B);
else
m_defender.PlaySound(0x31B);
cnt = 0;
}
m_defender.CloseGump(typeof(HeadacheBlue));
if (m_defender.HasGump(typeof(HeadacheRed)))
{
m_defender.CloseGump(typeof(HeadacheRed));
m_defender.SendGump(new HeadacheBlue());
return;
}
m_defender.SendGump(new HeadacheRed());
}
if (m_defender.SicknessType == SickType.Cold)
{
cnt += 1;
m_count += 1;
m_defender.Damage(Utility.Random(m_defender.CMN, m_defender.CMX));
m_defender.Stam -= 2;
m_defender.Mana -= 1;
if (cnt > 2)
{
m_defender.SendMessage("You have a cold!");
m_defender.Emote("cough*cough");
if (!m_defender.Female)
m_defender.PlaySound(0x420);
else
m_defender.PlaySound(0x311);
cnt = 0;
}
m_defender.CloseGump(typeof(ColdBlue));
if (m_defender.HasGump(typeof(ColdRed)))
{
m_defender.CloseGump(typeof(ColdRed));
m_defender.SendGump(new ColdBlue());
return;
}
m_defender.SendGump(new ColdRed());
}
if (m_defender.SicknessType == SickType.Flu)
{
cnt += 1;
m_count += 1;
m_defender.Damage(Utility.Random(m_defender.FMN, m_defender.FMX));
m_defender.Stam -= 4;
m_defender.Mana -= 2;
if (cnt > 2)
{
m_defender.SendMessage("You have influenza!");
m_defender.Emote("*feels feverish*");
if (!m_defender.Female)
m_defender.PlaySound(0x42B);
else
m_defender.PlaySound(0x31B);
cnt = 0;
}
m_defender.CloseGump(typeof(FluBlue));
if (m_defender.HasGump(typeof(FluRed)))
{
m_defender.CloseGump(typeof(FluRed));
m_defender.SendGump(new FluBlue());
return;
}
m_defender.SendGump(new FluRed());
}
if (m_defender.SicknessType == SickType.Virus)
{
cnt += 1;
m_count += 1;
m_defender.Damage(Utility.Random(m_defender.VMN, m_defender.VMX));
m_defender.Stam -= 8;
m_defender.Mana -= 4;
if (cnt > 2)
{
m_defender.SendMessage("You have a bad virus, you need medical attention!");
m_defender.Emote("*cold chills run your spine*");
m_defender.PlaySound(m_defender.Female ? 813 : 1087);
m_defender.Say("*vomits*");
if (!m_defender.Mounted)
{
m_defender.Animate(32, 5, 1, true, false, 0);
}
Point3D p = new Point3D(m_defender.Location);
p.Z = m_defender.Map.GetAverageZ(p.X, p.Y);
Vomit vomit = new Vomit();
vomit.Map = m_defender.Map;
vomit.Location = p;
cnt = 0;
}
m_defender.CloseGump(typeof(VirusBlue));
if (m_defender.HasGump(typeof(VirusRed)))
{
m_defender.CloseGump(typeof(VirusRed));
m_defender.SendGump(new VirusBlue());
return;
}
m_defender.SendGump(new VirusRed());
}
if (m_defender.SicknessType == SickType.Plague)
{
cnt += 1;
m_count += 1;
m_defender.Damage(Utility.Random(m_defender.PMN, m_defender.PMX));
m_defender.Stam -= 20;
m_defender.Mana -= 10;
if (cnt > 2)
{
m_defender.SendMessage("You have the plague, you'll infect others upon contact!");
m_defender.Emote("*hot flashes make you dizzy*");
m_defender.PlaySound(m_defender.Female ? 813 : 1087);
m_defender.Say("*pukes*");
if (!m_defender.Mounted)
{
m_defender.Animate(32, 5, 1, true, false, 0);
}
Point3D p = new Point3D(m_defender.Location);
p.Z = m_defender.Map.GetAverageZ(p.X, p.Y);
Puke puke = new Puke();
puke.Map = m_defender.Map;
puke.Location = p;
cnt = 0;
}
m_defender.CloseGump(typeof(PlagueBlue));
if (m_defender.HasGump(typeof(PlagueRed)))
{
m_defender.CloseGump(typeof(PlagueRed));
m_defender.SendGump(new PlagueBlue());
return;
}
m_defender.SendGump(new PlagueRed());
}
if (m_defender.SicknessType == SickType.Disease)
{
cnt += 1;
m_count += 1;
m_defender.Damage(Utility.Random(m_defender.DMN, m_defender.DMX));
m_defender.Stam -= 20;
m_defender.Mana -= 10;
if (cnt > 2)
{
m_defender.SendMessage("You have a bad disease, seek medical attention!");
m_defender.Emote("*feels deathly ill*");
m_defender.PlaySound(m_defender.Female ? 813 : 1087);
m_defender.Say("*pukes*");
if (!m_defender.Mounted)
{
m_defender.Animate(32, 5, 1, true, false, 0);
}
Point3D p = new Point3D(m_defender.Location);
p.Z = m_defender.Map.GetAverageZ(p.X, p.Y);
Puke puke = new Puke();
puke.Map = m_defender.Map;
puke.Location = p;
cnt = 0;
}
m_defender.CloseGump(typeof(DiseaseBlue));
if (m_defender.HasGump(typeof(DiseaseRed)))
{
m_defender.CloseGump(typeof(DiseaseRed));
m_defender.SendGump(new DiseaseBlue());
return;
}
m_defender.SendGump(new DiseaseRed());
}
if (m_count == m_countmax)
{
m_defender.SicknessType = SickType.None;
m_defender.Sick = false;
SickGumpCheck(m_defender);
Stop();
return;
}
int randominfect = Utility.Random(1, 99);
ArrayList RI = newArrayList();
foreach (Mobile o in m_defender.Map.GetMobilesInRange(m_defender.Location, m_defender.CTR))
{
RI.Add(o);
}
for (int i = 0; i < RI.Count; i++)
{
Mobile o = RI[i] as Mobile;
if (o is PlayerMobile && m_defender != o && m_defender.SicknessType == SickType.Plague)
{
PlayerMobile mob = (PlayerMobile)o;
if ((!mob.Contagious) || (mob.Sick == true))
{
}
elseif (mob.SicknessType == SickType.None)
{
if (randominfect > 5 && randominfect < 95)
mob.SicknessType = m_defender.SicknessType;
}
}
if (o is PlayerMobile && m_defender != o)
{
PlayerMobile mob = (PlayerMobile)o;
if ((!mob.Contagious) || (mob.Sick == true))
{
}
elseif (mob.SicknessType == SickType.None)
{
if (randominfect > 43 && randominfect < 50)
mob.SicknessType = m_defender.SicknessType;
}
}
}
}
}
[code]