BeginHeal() public static method

public static BeginHeal ( Mobile healer, Mobile patient ) : BandageContext
healer Mobile
patient Mobile
return BandageContext
Ejemplo n.º 1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Bandage.Deleted)
                {
                    return;
                }

                if (targeted is Mobile)
                {
                    Mobile m = targeted as Mobile;

                    if (Bandage.ProximityCheck(from, m, Core.AOS ? 2 : 1) == false)
                    {
                        from.SendLocalizedMessage(501043);                         // Target is not close enough.
                    }
                    else if (from.InRange(m_Bandage.GetWorldLocation(), Core.AOS ? 2 : 1))
                    {
                        if (BandageContext.BeginHeal(from, (Mobile)targeted) != null)
                        {
                            m_Bandage.Consume();
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(500295);                         // You are too far away to do that.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500970);                     // Bandages can not be used on that.
                }
            }
Ejemplo n.º 2
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Bandage.Deleted)
                {
                    return;
                }

                if (targeted is Mobile)
                {
                    if (from.InRange(m_Bandage.GetWorldLocation(), Range))
                    {
                        BandageContext context;

                        if ((context = BandageContext.BeginHeal(from, (Mobile)targeted, m_Bandage)) != null)
                        {
                            m_Bandage.OnHealStarted(context);
                            m_Bandage.Consume();
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(500295);                           // You are too far away to do that.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500970);                       // Bandages can not be used on that.
                }
            }
Ejemplo n.º 3
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Bandage.Deleted)
                {
                    return;
                }

                if (targeted is Mobile)
                {
                    if (from.InRange(m_Bandage.GetWorldLocation(), Bandage.Range))
                    {
                        if (BandageContext.BeginHeal(from, (Mobile)targeted, m_Bandage is EnhancedBandage) != null)
                        {
                            m_Bandage.Consume();
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(500295);                           // You are too far away to do that.
                    }
                }
                else if (targeted is PlagueBeastInnard)
                {
                    if (((PlagueBeastInnard)targeted).OnBandage(from))
                    {
                        m_Bandage.Consume();
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500970);                       // Bandages can not be used on that.
                }
            }
Ejemplo n.º 4
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Bandage.Deleted)
                {
                    return;
                }

                if (targeted is Mobile)
                {
                    if (from.InRange(m_Bandage.GetWorldLocation(), Bandage.Range))
                    {
                        if (BandageContext.BeginHeal(from, (Mobile)targeted) != null)
                        {
                            m_Bandage.Consume();
                        }
                    }
                    else
                    {
                        from.SendAsciiMessage("You are too far away to do that.");
                        //from.SendLocalizedMessage( 500295 ); //
                    }
                }
                else
                {
                    from.SendAsciiMessage("Bandages can not be used on that.");
                    //from.SendLocalizedMessage( 500970 ); //
                }
            }
Ejemplo n.º 5
0
        //This method added for [bandself command to call.
        public static void BandSelfCommandCall(Mobile from, Item m_Bandage)
        {
            from.RevealingAction();

            if (BandageContext.BeginHeal(from, from) != null)
            {
                m_Bandage.Consume();
            }
        }
Ejemplo n.º 6
0
        // Scriptiz : ajout d'une méthode pour la commande .bandself
        public static void BandSelfCommandCall(Mobile from, Item m_Bandage)
        {
            from.RevealingAction();

            if (BandageContext.BeginHeal(from, from) != null && !Engines.ConPVP.DuelContext.IsFreeConsume(from))
            {
                m_Bandage.Consume();
            }
        }
Ejemplo n.º 7
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Bandage.Deleted)
                {
                    return;
                }

                if (targeted is Mobile)
                {
                    Mobile target = targeted as Mobile;

                    if (target.Hidden)
                    {
                        from.SendMessage("That cannot be seen.");
                        return;
                    }

                    else if (from.InRange(m_Bandage.GetWorldLocation(), Bandage.Range))
                    {
                        PlayerMobile playerTarget = targeted as PlayerMobile;

                        if (BandageContext.BeginHeal(from, (Mobile)targeted) != null)
                        {
                            if (!Engines.ConPVP.DuelContext.IsFreeConsume(from))
                            {
                                m_Bandage.Consume();
                            }
                        }
                    }

                    else
                    {
                        from.SendLocalizedMessage(500295); // You are too far away to do that.
                    }
                }

                else if (targeted is PlagueBeastInnard)
                {
                    if (((PlagueBeastInnard)targeted).OnBandage(from))
                    {
                        m_Bandage.Consume();
                    }
                }

                else
                {
                    from.SendLocalizedMessage(500970); // Bandages can not be used on that.
                }
            }
Ejemplo n.º 8
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Bandage.Deleted)
                {
                    return;
                }

                if (targeted is Mobile)
                {
                    if (!HasFreeHand(from))
                    {
                        from.SendMessage("Vous devez avoir les mains libres pour pouvoir soigner.");
                    }
                    else if (from.Mounted)
                    {
                        from.SendMessage("Vous ne pouvez soigner sur une monture.");
                    }
                    else if (targeted is PlayerMobile && ((PlayerMobile)targeted).MortEngine.RisqueDeMort)
                    {
                        from.SendMessage("Cette personne est trop affaiblie pour être soignée.");
                    }
                    else if (HasChestArmor((Mobile)targeted))
                    {
                        from.SendMessage("Vous ne pouvez soigner si la personne porte un plastron.");
                    }
                    else if (from.InRange(m_Bandage.GetWorldLocation(), 1))
                    {
                        BandageContext context = BandageContext.GetContext((Mobile)targeted);

                        if (context != null)
                        {
                            from.SendMessage("Vous devez attendre avant de soigner à nouveau cette personne.");
                        }
                        else if (BandageContext.BeginHeal(from, (Mobile)targeted) != null)
                        {
                            m_Bandage.Consume();
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(500295); // You are too far away to do that.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500970); // Bandages can not be used on that.
                }
            }
Ejemplo n.º 9
0
        // This method added for [bandself command to call.
        public static void BandSelfCommandCall(Mobile from, Item m_Bandage)
        {
            if (from.Blessed)
            {
                from.SendMessage("You cannot use bandages while in this state.");
                return;
            }

            from.RevealingAction();

            if (BandageContext.BeginHeal(from, from) != null)
            {
                m_Bandage.Consume();
            }
            Server.Gumps.QuickBar.RefreshQuickBar(from);
        }
Ejemplo n.º 10
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Bandage.Deleted)
                {
                    return;
                }

                if (targeted is PlayerMobile && ((PlayerMobile)targeted).Undead)
                {
                    if (from == targeted)
                    {
                        from.SendMessage("You have no need for the healing techniques of mortals.");
                    }
                    else
                    {
                        from.SendLocalizedMessage(500970);                           // Bandages can not be used on that.
                    }
                    return;
                }

                if (targeted is Mobile)
                {
                    if (from.InRange(m_Bandage.GetWorldLocation(), Bandage.Range))
                    {
                        if (BandageContext.BeginHeal(from, (Mobile)targeted) != null)
                        {
                            m_Bandage.Consume();
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(500295);                           // You are too far away to do that.
                    }
                }
                else if (targeted is PlagueBeastInnard)
                {
                    if (((PlagueBeastInnard)targeted).OnBandage(from))
                    {
                        m_Bandage.Consume();
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500970);                       // Bandages can not be used on that.
                }
            }
Ejemplo n.º 11
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Bandage.Deleted)
                {
                    return;
                }

                if (targeted is Mobile)
                {
                    if (from.InRange(m_Bandage.GetWorldLocation(), Bandage.Range))
                    {
                        if (BandageContext.BeginHeal(from, (Mobile)targeted) != null)
                        {
                            bool consume = true;

                            if (from.Player)
                            {
                                Medic med = Perk.GetByType <Medic>((Player)from);

                                if (med != null)
                                {
                                    consume = !med.TryRecoverBandage();
                                    from.SendMessage("You manage to salvage some of the bandage.");
                                }
                            }

                            if (consume)
                            {
                                m_Bandage.Consume();
                            }
                        }
                    }

                    else
                    {
                        from.SendLocalizedMessage(500295); // You are too far away to do that.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500970); // Bandages can not be used on that.
                }
            }
Ejemplo n.º 12
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Bandage.Deleted)
                {
                    return;
                }

                //para tratar de um corpo caido
                if (targeted is Corpse)
                {
                    Corpse corpo = (Corpse)targeted;
                    if (corpo.Owner != null && corpo.Owner is Jogador)
                    {
                        targeted = corpo.Owner;
                    }
                    else
                    {
                        from.SendLocalizedMessage(500970); // Bandages can not be used on that.
                    }
                }

                if (targeted is Mobile)
                {
                    if (from.InRange(m_Bandage.GetWorldLocation(), Bandage.Range))
                    {
                        if (BandageContext.BeginHeal(from, (Mobile)targeted) != null)
                        {
                            m_Bandage.Consume();
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(500295);                           // You are too far away to do that.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500970);                       // Bandages can not be used on that.
                }
            }
Ejemplo n.º 13
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Bandage.Deleted)
                {
                    return;
                }

                if (targeted is Mobile)
                {
                    Mobile targetedMobile = (Mobile)targeted;

                    if (from.InRange(m_Bandage.GetWorldLocation(), 3) && from.InRange(targetedMobile.Location, Bandage.Range))
                    {
                        if (from is PlayerMobile)
                        {
                            ((PlayerMobile)from).SpellCheck();
                        }

                        from.PlaySound(0x57);
                        //ClearHandsBandage(from);

                        BandageContext.BeginHeal(from, targetedMobile, m_Bandage);
                    }
                    else
                    {
                        from.SendAsciiMessage("You are too far away to do that.");
                    }
                }
                else if (targeted is PlagueBeastInnard)
                {
                    if (((PlagueBeastInnard)targeted).OnBandage(from))
                    {
                        m_Bandage.Consume();
                    }
                }
                else
                {
                    from.SendAsciiMessage("Bandages can not be used on that.");
                }
            }
Ejemplo n.º 14
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Bandage.Deleted)
                {
                    return;
                }

                if (targeted is Mobile)
                {
                    if (from.InRange(m_Bandage.GetWorldLocation(), Bandage.Range))
                    {
                        if (BandageContext.BeginHeal(from, (Mobile)targeted) != null)
                        {
                            from.PublicOverheadMessage(MessageType.Regular, 0x22, true, "** Begins healing with bandages! **");
                            from.Freeze(TimeSpan.FromSeconds(1.5));
                            if (!Engines.ConPVP.DuelContext.IsFreeConsume(from))
                            {
                                m_Bandage.Consume();
                            }
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(500295);                           // You are too far away to do that.
                    }
                }
                else if (targeted is PlagueBeastInnard)
                {
                    if (((PlagueBeastInnard)targeted).OnBandage(from))
                    {
                        m_Bandage.Consume();
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500970);                       // Bandages can not be used on that.
                }
            }
Ejemplo n.º 15
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Bandage.Deleted)
                {
                    return;
                }

                var entity = targeted as IEntity;

                if (XmlScript.HasTrigger(entity, TriggerName.onTargeted) &&
                    UberScriptTriggers.Trigger(entity, from, TriggerName.onTargeted, m_Bandage))
                {
                    return;
                }

                if (targeted is BaseCreature &&
                    (((BaseCreature)targeted).Pseu_CanBeHealed == false || ((BaseCreature)targeted).ChampSpawn != null))
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500951);                     // You cannot heal that.
                }
                else if (targeted is Mobile)
                {
                    if (from.InRange(m_Bandage.GetWorldLocation(), GetRange(from.Expansion)))
                    {
                        if (BandageContext.BeginHeal(from, (Mobile)targeted) != null)
                        {
                            var region1 = from.Region as CustomRegion;

                            if (!DuelContext.IsFreeConsume(from) && (region1 == null || !region1.PlayingGame(from)))
                            {
                                IUOFBattle battle = null;

                                if (from is PlayerMobile)
                                {
                                    battle = AutoPvP.FindBattleI <IUOFBattle>((PlayerMobile)from);
                                }

                                if (battle == null || !battle.NoConsume)
                                {
                                    m_Bandage.Consume();
                                }
                            }
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(500295);                         // You are too far away to do that.
                    }
                }
                else if (targeted is PlagueBeastInnard)
                {
                    if (((PlagueBeastInnard)targeted).OnBandage(from))
                    {
                        m_Bandage.Consume();
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500970);                     // Bandages can not be used on that.
                }
            }
Ejemplo n.º 16
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Bandage.Deleted)
                {
                    return;
                }

                if (targeted is Mobile)
                {
                    if (from.InRange(m_Bandage.GetWorldLocation(), Bandage.Range))
                    {
                        if (BandageContext.BeginHeal(from, (Mobile)targeted) != null)
                        {
                            m_Bandage.Consume();
                            Server.Gumps.QuickBar.RefreshQuickBar(from);
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(500295);                           // You are too far away to do that.
                    }
                }
                else if (targeted is HenchmanFighterItem && from.Skills[SkillName.Anatomy].Value >= 80 && from.Skills[SkillName.Healing].Value >= 80)
                {
                    HenchmanFighterItem friend = (HenchmanFighterItem)targeted;

                    if (friend.HenchDead > 0)
                    {
                        friend.Name      = "fighter henchman";
                        friend.HenchDead = 0;
                        friend.InvalidateProperties();
                        m_Bandage.Consume();
                    }
                    else
                    {
                        from.SendMessage("They are not dead.");
                    }
                }
                else if (targeted is HenchmanWizardItem && from.Skills[SkillName.Anatomy].Value >= 80 && from.Skills[SkillName.Healing].Value >= 80)
                {
                    HenchmanWizardItem friend = (HenchmanWizardItem)targeted;

                    if (friend.HenchDead > 0)
                    {
                        friend.Name      = "wizard henchman";
                        friend.HenchDead = 0;
                        friend.InvalidateProperties();
                        m_Bandage.Consume();
                    }
                    else
                    {
                        from.SendMessage("They are not dead.");
                    }
                }
                else if (targeted is HenchmanArcherItem && from.Skills[SkillName.Anatomy].Value >= 80 && from.Skills[SkillName.Healing].Value >= 80)
                {
                    HenchmanArcherItem friend = (HenchmanArcherItem)targeted;

                    if (friend.HenchDead > 0)
                    {
                        friend.Name      = "archer henchman";
                        friend.HenchDead = 0;
                        friend.InvalidateProperties();
                        m_Bandage.Consume();
                    }
                    else
                    {
                        from.SendMessage("They are not dead.");
                    }
                }
                else if (targeted is HenchmanMonsterItem && from.Skills[SkillName.Anatomy].Value >= 80 && from.Skills[SkillName.Healing].Value >= 80)
                {
                    HenchmanMonsterItem friend = (HenchmanMonsterItem)targeted;

                    if (friend.HenchDead > 0)
                    {
                        friend.Name      = "creature henchman";
                        friend.HenchDead = 0;
                        friend.InvalidateProperties();
                        m_Bandage.Consume();
                    }
                    else
                    {
                        from.SendMessage("They are not dead.");
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500970);                       // Bandages can not be used on that.
                }
            }
Ejemplo n.º 17
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Bandage.Deleted)
                {
                    return;
                }

                if (targeted is Corpse)
                {
                    Corpse c     = targeted as Corpse;
                    bool   found = false;
                    Mobile owner = c.Owner;
                    Timer  m_Revive;

                    Mobile ghost = null;

                    if (owner == null || owner.Deleted || (owner is TeiravonMobile && ((TeiravonMobile)owner).IsUndead()) || c.ItemID != 0x2006)
                    {
                        from.SendMessage("You cannot revive that!");
                        return;
                    }

                    IPooledEnumerable eable = c.Map.GetMobilesInRange(c.Location, 1);

                    foreach (Mobile m in eable)
                    {
                        if (m == c.Owner)
                        {
                            found = true;
                            ghost = m;
                        }
                    }
                    eable.Free();
                    if (!found && c.Owner != null)
                    {
                        from.SendMessage("The body is cold and unresponsive as if the spirit has left it.");
                        c.Owner.SendMessage("You feel drawn to your body.");
                        return;
                    }
                    if (found && ghost != null && !ghost.Alive)
                    {
                        from.SendMessage("You attempt to revive the fallen.");
                        m_Revive = new ReviveTimer(from, c, ghost);
                        SpellHelper.Turn(from, c);
                        BandageClearHands(from);
                        from.Animate(32, 5, 1, true, false, 0);
                        m_Bandage.Consume();
                        m_Revive.Start();
                        return;
                    }
                }

                if (targeted is Mobile)
                {
                    if (from.InRange(m_Bandage.GetWorldLocation(), Core.AOS ? 2 : 1))
                    {
                        TeiravonMobile m_Player = targeted as TeiravonMobile;
                        Mobile         m        = targeted as Mobile;
                        if (targeted is TeiravonMobile && m_Player.PlayerRace == TeiravonMobile.Race.Undead)
                        {
                            from.SendMessage("The dead cannot be bandaged.");
                            return;
                        }


                        if (m_Slayer.Slays(m))
                        {
                            from.SendLocalizedMessage(1060177); // You cannot heal a creature that is already dead!
                            return;
                        }

                        if (m_Player != null && m_Player.NextHeal - DateTime.Now > new TimeSpan(0, 0, 3))
                        {
                            m_Player.SendMessage("It's too soon to do this again.");

                            return;
                        }

                        if (BandageContext.BeginHeal(from, (Mobile)targeted) != null)
                        {
                            m_Bandage.Consume();
                            //from.ClearHands();
                            BandageClearHands(from);

                            if (m_Player != null)
                            {
                                m_Player.NextHeal = DateTime.Now + TimeSpan.FromSeconds(2.0);
                            }
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(500295);                           // You are too far away to do that.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500970);                       // Bandages can not be used on that.
                }
            }