Anomaly
Member
Hello, been scratching my head over this for a bit now. This compiles fine, does not crash my shard, and works. EXCEPT in cases regarding a player.
For example, on my admin account if i say bounty it tells me how many kills i have essentially.
If i say pay, it tells me my kills * 2000, which is how much i have to pay to clean up my record.
Do the same on a test account, accesslevel player, no response from NPC. make player accesslevel seer, or anything remotely close to staff, it works. help?
For example, on my admin account if i say bounty it tells me how many kills i have essentially.
If i say pay, it tells me my kills * 2000, which is how much i have to pay to clean up my record.
Do the same on a test account, accesslevel player, no response from NPC. make player accesslevel seer, or anything remotely close to staff, it works. help?
Code:
using System;
using Server.Items;
namespace Server.Mobiles
{
public class Crookedguard : BaseCreature
{
[Constructable]
public Crookedguard()
: base(AIType.AI_Animal, FightMode.None, 10, 1, 0.2, 0.4)
{
this.InitStats(31, 41, 51);
this.SpeechHue = Utility.RandomDyedHue();
/* this.SetSkill(SkillName.DetectHidden, 65, 88);
this.SetSkill(SkillName., 65, 88);
this.SetSkill(SkillName.Stealing, 65, 88);*/
this.Hue = Utility.RandomSkinHue();
if (this.Female = Utility.RandomBool())
{
this.Body = 0x191;
this.Name = NameList.RandomName("female");
this.Title = "the crooked guard";
}
else
{
this.Body = 0x190;
this.Name = NameList.RandomName("male");
this.Title = "the crooked guard";
}
this.AddItem(new Bandana(Utility.RandomDyedHue()));
this.AddItem(new Longsword());
this.AddItem(new RingmailArms());
this.AddItem(new RingmailChest());
this.AddItem(new RingmailGloves());
this.AddItem(new RingmailLegs());
Utility.AssignRandomHair(this);
Container pack = new Backpack();
pack.DropItem(new Gold(10, 783));
pack.Movable = false;
this.AddItem(pack);
}
public Crookedguard(Serial serial)
: base(serial)
{
}
public override void OnSpeech( SpeechEventArgs args )
{
PlayerMobile mobile = args.Mobile as PlayerMobile;
//Mobile mobile = args.Mobile as PlayerMobile;
if ( args.Speech.ToLower().IndexOf("bounty") >= 0)
{
this.Direction = GetDirectionTo( args.Mobile.Location );
this.Say("You currently have a bounty for {0} murders...", mobile.Kills); //
}
else if ( args.Speech.ToLower().IndexOf( "pay" ) >= 0)
{
this.Direction = GetDirectionTo( args.Mobile.Location );
this.Say("For {0} gold, I will wipe your slate clean...", mobile.Kills * 2000);
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}