Abracadabra2.0
Member
I'm working on adding a little something to Forensics Eval to make it more useful/fun. When the player uses forensics eval on the ForensicBody item and they have the requisite skill level, a monster will appear (the murderer has returned to the scene of the crime!) and they have to kill it to get the reward. This also sets the m_Detective to them (similar to m_Forensicist as defined in Corpse.cs).
The part I'm struggling with is, if the body has already been researched by a Detective, I want it to return the name of the detective that solved the crime and not have a monster spawn. However as it is now, whether someone has or hasn't researched the body, the monster always spawns. How can I get it to return null if the body has already been researched?
Btw, the body will be on a spawner and work similarly to locked dungeon chests in that way. Otherwise I'd just delete the body after research.
The part I'm struggling with is, if the body has already been researched by a Detective, I want it to return the name of the detective that solved the crime and not have a monster spawn. However as it is now, whether someone has or hasn't researched the body, the monster always spawns. How can I get it to return null if the body has already been researched?
Btw, the body will be on a spawner and work similarly to locked dungeon chests in that way. Otherwise I'd just delete the body after research.
Code:
else if ( target is ForensicsBody )
{
if (from.CheckTargetSkill(SkillName.Forensics, target, 50.0, 100.0))
{
ForensicsBody fb = (ForensicsBody)target;
if (fb.m_Detective != null)
from.SendLocalizedMessage(1042750, fb.m_Detective); // The detective ~1_NAME~ has already discovered that:
else
fb.m_Detective = from.Name;
{
switch (Utility.Random(3))
{
case 0:
{
from.SendMessage("The murderer has returned to the scene of the crime!");
Mobile spawn01 = new Ettin();
spawn01.MoveToWorld(new Point3D(from.X + 15, from.Y, from.Z), from.Map);
break;
}
case 1:
{
from.SendMessage("The murderer has returned to the scene of the crime!");
Mobile spawn01 = new Orc();
spawn01.MoveToWorld(new Point3D(from.X + 15, from.Y, from.Z), from.Map);
break;
}
case 2:
{
from.SendMessage("The murderer has returned to the scene of the crime!");
Mobile spawn01 = new Troll();
spawn01.MoveToWorld(new Point3D(from.X + 15, from.Y, from.Z), from.Map);
break;
}
}
}
}