Ejemplo n.º 1
0
        /// <summary>
        /// Wakes up a monster if it can be alerted
        /// </summary>
        private bool PetAlertMonster(Creature monster)
        {
            if (!monster.Attackable || monster.MonsterState != State.Idle || (monster.Tolerance & PlayerCombatPat_MoveExclude) != 0)
            {
                return(false);
            }

            // if the combat pet's owner belongs to a faction,
            // and the monster also belongs to the same faction, don't aggro the monster?
            if (SameFaction(monster))
            {
                // unless the pet owner or the pet is being retaliated against?
                if (!monster.HasRetaliateTarget(P_PetOwner) && !monster.HasRetaliateTarget(this))
                {
                    return(false);
                }

                monster.AddRetaliateTarget(this);
            }

            monster.AttackTarget = this;
            monster.WakeUp();

            return(true);
        }