CODE |
public abstract class BaseVendor : BaseCreature, IVendor { //07SEP2006 Talking Vendors by RavonTUS@Yahoo.com *** START *** #region Make Vendors Talk private static bool m_Talked; string[] VendorSay = new string[] { "Greetings", "Hello there", "I have what ye needs.", "Look here!", "Shop ye here!" }; public override void OnMovement(Mobile m, Point3D oldLocation) { if (m_Talked == false) { if (m.InRange(this, 3) && m is PlayerMobile) { m_Talked = true; SayRandom(VendorSay, this); this.Move(GetDirectionTo(m.Location)); SpamTimer t = new SpamTimer(); t.Start(); } } } private class SpamTimer : Timer { public SpamTimer() : base(TimeSpan.FromMinutes(1)) { Priority = TimerPriority.OneMinute; } protected override void OnTick() { m_Talked = false; } } private static void SayRandom(string[] say, Mobile m) { m.Say(say[Utility.Random(say.Length)]); } #endregion //07SEP2006 Talking Vendors by RavonTUS@Yahoo.com *** END *** private const int MaxSell = 500; |
QUOTE (ArteGordon @ October 27, 2007 06:45 pm) |
why not just use an xmldialog for this? No scripting required. |
QUOTE (Erica @ October 27, 2007 09:02 pm) | ||
Ok cant remember how to do that can you show me a link or tell me how i think youve to me this before just forgot Sorry. |