Esempio n. 1
0
 public void Goto(int x, int y, int z)
 {
     if (!AIObject.MoveToDistant(new Point3D(x, y, z), false))
     {
         this.DebugSay("Unable to reach location");
         CurrentSpeed = 3;
     }
 }
Esempio n. 2
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            //base.OnSpeech( e );

            Mobile from = e.Mobile;

            if (from.InRange(this, 20))
            {
                if (from != null)
                {
                    if (e.Speech.ToLower().IndexOf("go") > -1)
                    {
                        string   gostring = e.Speech.ToLower();
                        string[] goprops  = gostring.Split(' ');

                        int x, y, z;
                        if (goprops.Length == 4)
                        {
                            x = GetIntArg(goprops[1]);
                            y = GetIntArg(goprops[2]);
                            z = GetIntArg(goprops[3]);
                        }
                        else if (goprops.Length == 3)
                        {
                            x = GetIntArg(goprops[1]);
                            y = GetIntArg(goprops[2]);
                            z = 0;
                        }
                        else
                        {
                            from.Target = new InternalTarget(this);
                            return;
                        }

                        this.DebugSay("Going to location " + x + "," + y + "," + z);
                        CurrentSpeed = 0.5;
                        if (!AIObject.MoveToDistant(new Point3D(x, y, z), false))
                        {
                            this.DebugSay("Unable to reach location");
                            CurrentSpeed = 3;
                        }
                    }
                    if (e.Speech.ToLower().IndexOf("stop") > -1)
                    {
                        AIObject.StopMove();
                        CurrentSpeed = 3;
                    }
                }
            }
        }