Пример #1
0
        private static void WorldEx_MobileUpdated(Serial serial)
        {
            if (serial != World.Player.Serial && serial != healSerial)
            {
                return;
            }
            if (IsHealing || World.Player.IsGhost || !World.Player.Visible)
            {
                return;
            }

            Mobile target;

            if (enabled && (World.Player.Hits < World.Player.HitsMax * 0.90 || World.Player.Poisoned))
            {
                IsHealing = !Bandages.Valid || Bandages.Enchanced ? ebs.Perform() : BandageSelf();
            }
            else if (healSerial.IsValid && (target = World.FindMobile(healSerial)) != null && target.Hits < target.HitsMax * 0.90 && Utility.Distance(target.Position, World.Player.Position) < 3 && Bandages.Valid)
            {
                prevQueue = Targeting.QueuedTarget;
                Targeting.CancelTarget();
                Targeting.QueuedTarget = () =>
                {
                    Targeting.Target(healSerial);
                    return(true);
                };
                Bandages.Use();
                IsHealing = true;
            }
        }
Пример #2
0
        private static bool BandageSelf()
        {
            if (targetTimer != null && targetTimer.Running)
            {
                return(false);
            }

            if (Targeting.HasTarget)
            {
                targetTimer = Timer.DelayedCallback(TimeSpan.FromSeconds(5), OnTargetTimer);
                targetTimer.Start();
                return(false);
            }

            if (!Bandages.Valid)
            {
                return(false);
            }
            prevQueue = Targeting.QueuedTarget;
            Targeting.CancelTarget();
            Targeting.QueuedTarget = Targeting.DoTargetSelf;
            Bandages.Use();
            return(true);
        }