示例#1
0
        /// <summary>
        /// Prompt a target in-game, wait for the Player to select the ground. Can also specific a text message for prompt.
        /// </summary>
        /// <param name="message">Hint on what to select.</param>
        /// <param name="color">Color of the message. (default: 945, gray)</param>
        /// <returns>A Point3D object, containing the X,Y,Z coordinate</returns>
        public Point3D PromptGroundTarget(string message = "Select Ground Position", int color = 945)
        {
            m_pgtarget = Point3D.MinusOne;

            Misc.SendMessage(message, color, true);
            Targeting.OneTimeTarget(true, new Targeting.TargetResponseCallback(PromptGroundTargetExex_Callback));

            while (!Targeting.HasTarget)
            {
                Thread.Sleep(30);
            }

            while (m_pgtarget.X == -1 && Targeting.HasTarget)
            {
                Thread.Sleep(30);
            }

            Thread.Sleep(100);

            if (m_pgtarget.X == -1)
            {
                Misc.SendMessage("Prompt Gorund Target Cancelled", color, true);
            }

            return(m_pgtarget);
        }
示例#2
0
 private void PromptGroundTargetExex_Callback(bool loc, Assistant.Serial serial, Assistant.Point3D pt, ushort itemid)
 {
     if (!loc)
     {
         Mobile target = Mobiles.FindBySerial(serial);
         if (target == null)
         {
             m_pgtarget = Point3D.MinusOne;
         }
         else
         {
             m_pgtarget = target.Position;
         }
     }
     else
     {
         m_pgtarget = new Point3D(pt.X, pt.Y, pt.Z);
     }
 }
示例#3
0
 public Point3D GetWorldPosition()
 {
     Assistant.Point3D     assistantPoint = m_AssistantItem.GetWorldPosition();
     RazorEnhanced.Point3D enhancedPoint  = new RazorEnhanced.Point3D(assistantPoint);
     return(enhancedPoint);
 }