Esempio n. 1
0
        private static bool BandageSelf(string command, Argument[] args, bool quiet, bool force)
        {
            Item pack = World.Player.Backpack;

            if (pack != null)
            {
                if (!UseItem(pack, 3617))
                {
                    World.Player.SendMessage(MsgLevel.Warning, LocString.NoBandages);
                }
                else
                {
                    if (force)
                    {
                        Targeting.ClearQueue();
                        Targeting.TargetSelf(true);
                    }
                    else
                    {
                        Targeting.TargetSelf(true);
                    }
                }
            }

            return(true);
        }
Esempio n. 2
0
        private static bool BandageSelf(ref ASTNode node, bool quiet, bool force)
        {
            node = node.Next();

            if (World.Player == null)
            {
                return(true);
            }

            Item pack = World.Player.Backpack;

            if (pack != null)
            {
                if (!UseItem(pack, 3617))
                {
                    World.Player.SendMessage(MsgLevel.Warning, LocString.NoBandages);
                }
                else
                {
                    if (force)
                    {
                        Targeting.ClearQueue();
                        Targeting.TargetSelf(true);
                    }
                    else
                    {
                        Targeting.TargetSelf(true);
                    }
                }
            }

            return(true);
        }
Esempio n. 3
0
 private static void AllKill(string cmd, ushort keyword, bool lastTarget)
 {
     Targeting.ClearQueue();
     PetCommand(cmd, keyword);
     if (lastTarget)
     {
         Targeting.LastTarget(true);
     }
 }
Esempio n. 4
0
        public static bool Cast(string command, Argument[] args, bool quiet, bool force)
        {
            if (args.Length == 0)
            {
                ScriptUtilities.ScriptErrorMsg("Usage: cast 'spell' [serial]");
                return(true);
            }

            if (!Client.Instance.ClientRunning)
            {
                return(true);
            }

            Spell spell;

            if (int.TryParse(args[0].AsString(), out int spellnum))
            {
                spell = Spell.Get(spellnum);
            }
            else
            {
                spell = Spell.GetByName(args[0].AsString());
            }
            if (spell != null)
            {
                if (args.Length > 1)
                {
                    Serial s = args[1].AsSerial();
                    if (force)
                    {
                        Targeting.ClearQueue();
                    }
                    if (s > Serial.Zero && s != Serial.MinusOne)
                    {
                        Targeting.Target(s);
                    }
                    else if (!quiet)
                    {
                        ScriptUtilities.ScriptErrorMsg("cast - invalid serial or alias");
                    }
                }
            }
            else if (!quiet)
            {
                ScriptUtilities.ScriptErrorMsg("cast - spell name or number not valid");
            }

            return(true);
        }
Esempio n. 5
0
        public static void BandageSelf()
        {
            Item pack = World.Player.Backpack;

            if (pack != null)
            {
                if (!UseItem(pack, 3617))
                {
                    World.Player.SendMessage(MsgLevel.Warning, LocString.NoBandages);
                }
                else
                {
                    Targeting.ClearQueue();
                    Targeting.TargetSelf(true);                      //force a targetself to be queued
                    BandageTimer.Start();
                }
            }
        }
Esempio n. 6
0
        public static void BandageSelf()
        {
            Item pack = World.Player.Backpack;

            if (pack != null)
            {
                if (!World.Player.UseItem(pack, 3617))
                {
                    World.Player.SendMessage(MsgLevel.Warning, LocString.NoBandages);
                }
                else
                {
                    Targeting.ClearQueue();
                    Targeting.TargetSelf(true); //force a targetself to be queued
                    //BandageTimer.Start(); // Bandage timer will be started automatically after the "You begin applying the bandages." message
                }
            }
        }