示例#1
0
        //---------------------------------------------------------------------------------------------

        public static HealInfo BandSafe(Serial serial, bool isAutoHeal)
        {
            HealInfo hInfo = new HealInfo();

            hInfo.HasBandages = Healing.CleanBandage.Exist;

            if (hInfo.HasBandages)
            {
                if (isAutoHeal && Game.CheckRunning())
                {
                    return(hInfo);
                }

                UOCharacter ch = new UOCharacter(serial);

                ch.PrintHitsMessage("[Banding...]");
                int ohits = new UOCharacter(serial).Hits;

                Game.RunScriptCheck(250);
                Journal.Clear();
                Targeting.ResetTarget();
                Healing.CleanBandage.Use();
                UO.WaitTargetObject(serial);

                DateTime start = DateTime.Now;
                //Vylecil jsi otravu!
                hInfo.Used = Journal.WaitForText(true, 3500, "You must be able to reach the target", "Chces vytvorit mumii?", "You put the bloody bandagess in your pack.", "You apply the bandages, but they barely help.", "Your target is already fully healed", "Vylecil jsi otravu!");
                int time = Convert.ToInt32((DateTime.Now - start).TotalMilliseconds);
                int wait = 2550 - time;

                if (Journal.Contains(true, "Nemuzes pouzit bandy na summona!"))
                {
                    hInfo.TryHealSummon = true;
                }
                if (Journal.Contains(true, "You must be able to reach the target"))
                {
                    hInfo.CantReach = true;
                }
                if (Journal.Contains(true, "Chces vytvorit mumii?") || Journal.Contains(true, "Your target is already fully healed"))
                {
                    hInfo.FullHealed = true;
                }
                if (Journal.Contains(true, "Vylecil jsi otravu!"))
                {
                    hInfo.CuredPoison = true;
                }

                hInfo.Success = Journal.Contains(true, "You put the bloody bandagess in your pack");
                hInfo.Failed  = Journal.Contains(true, "You apply the bandages, but they barely help");

                if (hInfo.CuredPoison)
                {
                    wait = 250;
                }

                wait += 1;

                if (wait > 0)
                {
                    Game.Wait(wait);
                }

                if (hInfo.CantReach)
                {
                    ch.PrintMessage("[Can't reach Band]" + (serial == World.Player.Serial ? " Self" : ""), Game.Val_LightGreen);
                }

                int hits = new UOCharacter(serial).Hits;
                int incr = hits - ohits;

                if (hInfo.Success && incr > 0)
                {
                    hInfo.Gain = incr;
                }
            }

            return(hInfo);
        }