Ress One

Datum: 21/06/2012 14:56:28

Staženo: 334x

Popis:

Ressne nejbližší tělo ..


Hodnocení: 3.3/10 (69 hlasy)

Download file:cs

Příkazy:

  • ,ress "bool nearby"
  • ,ressivm "bool nearby"

Kód:

using Phoenix.WorldData;

namespace Phoenix.Plugins
{
    public static partial class Commands
    {
        [Command]
        public static void Ress(bool nearby) { RessInternal(false, nearby); }

        [Command]
        public static void RessIVM(bool nearby) { RessInternal(true, nearby); }

        private static void RessInternal(bool ivm, bool nearby)
        {
            UOItem bandage = World.Player.Backpack.AllItems.FindType(0x0E21);
            if (!bandage.Exist)
                ScriptErrorException.Throw("Bandages not found.");

            UOCharacter ch = nearby ? findGhost() : new UOCharacter(UIManager.TargetObject());
            if (!ch.Exist)
                ScriptErrorException.Throw("Invalid target");

            if (ivm)
            {
                UO.Cast(StandardSpell.GreaterHeal, ch);
                UO.Wait(1500);
            }

            ch.WaitTarget();
            bandage.Use();
        }

        private static UOCharacter findGhost()
        {
            UOCharacter output = new UOCharacter(Serial.Invalid);
            foreach (UOCharacter ch in World.Characters)
                if (ch.Model == 0x192 || ch.Model == 0x0193)
                    if (ch.Distance < 3 && ch.Distance < output.Distance)
                        output = ch;
            return output;
        }
    }
}
Zde ještě není žádný komentář.

Nový komentář