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);
        }
Ejemplo n.º 2
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 != Tolerance.None)
            {
                return(false);
            }

            // if the combat pet's owner belongs to a faction,
            // and the monster also belongs to the same faction, don't attack the monster?
            if (Faction1Bits != null && monster.Faction1Bits != null && (Faction1Bits & monster.Faction1Bits) != 0)
            {
                // unless the pet owner or the pet is being retaliated against?
                if (monster.RetaliateTargets != null && P_PetOwner != null && !monster.RetaliateTargets.Contains(P_PetOwner.Guid.Full) && !monster.RetaliateTargets.Contains(Guid.Full))
                {
                    return(false);
                }
            }

            if (monster.RetaliateTargets != null)
            {
                monster.RetaliateTargets.Add(Guid.Full);
            }

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

            return(true);
        }
Ejemplo n.º 3
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 == Tolerance.None)
     {
         monster.AttackTarget = this;
         monster.WakeUp();
         return(true);
     }
     return(false);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Wakes up a monster if it can be alerted
 /// </summary>
 public bool AlertMonster(Creature monster)
 {
     if ((monster.Attackable || monster.TargetingTactic != TargetingTactic.None) && monster.MonsterState == State.Idle && monster.Tolerance == Tolerance.None)
     {
         //Console.WriteLine($"[{Timers.RunningTime}] - {monster.Name} ({monster.Guid}) - waking up");
         monster.AttackTarget = this;
         monster.WakeUp();
         return(true);
     }
     return(false);
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Called when a combat pet attacks a monster
        /// </summary>
        public void PetOnAttackMonster(Creature monster)
        {
            /*Console.WriteLine($"{Name}.PetOnAttackMonster({monster.Name})");
             * Console.WriteLine($"Attackable: {monster.Attackable}");
             * Console.WriteLine($"Tolerance: {monster.Tolerance}");*/

            if (monster.MonsterState == State.Idle && !monster.Tolerance.HasFlag(Tolerance.NoAttack))
            {
                monster.AttackTarget = this;
                monster.WakeUp();
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Wakes up a monster if it can be alerted
        /// </summary>
        private bool PetAlertMonster(Creature monster)
        {
            var attackable = monster.GetProperty(PropertyBool.Attackable) ?? false;
            var tolerance  = (Tolerance)(monster.GetProperty(PropertyInt.Tolerance) ?? 0);

            if (attackable && monster.MonsterState == State.Idle && tolerance == Tolerance.None)
            {
                monster.AttackTarget = this;
                monster.WakeUp();
                return(true);
            }
            return(false);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Called when this player attacks a monster
        /// </summary>
        public void OnAttackMonster(Creature monster)
        {
            if (!Attackable)
            {
                return;
            }

            /*Console.WriteLine($"{Name}.OnAttackMonster({monster.Name})");
             * Console.WriteLine($"Attackable: {monster.Attackable}");
             * Console.WriteLine($"Tolerance: {monster.Tolerance}");*/

            if (monster.MonsterState != State.Awake && !monster.Tolerance.HasFlag(Tolerance.NoAttack))
            {
                monster.AttackTarget = this;
                monster.WakeUp();
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Called when a combat pet attacks a monster
        /// </summary>
        public void PetOnAttackMonster(Creature monster)
        {
            var attackable   = monster.GetProperty(PropertyBool.Attackable) ?? false;
            var tolerance    = (Tolerance)(monster.GetProperty(PropertyInt.Tolerance) ?? 0);
            var hasTolerance = monster.GetProperty(PropertyInt.Tolerance).HasValue;

            Console.WriteLine("OnAttackMonster(" + monster.Name + ")");
            Console.WriteLine("Attackable: " + attackable);
            Console.WriteLine("Tolerance: " + tolerance);
            Console.WriteLine("HasTolerance: " + hasTolerance);

            if (monster.MonsterState == State.Idle && !tolerance.HasFlag(Tolerance.NoAttack))
            {
                monster.AttackTarget = this;
                monster.WakeUp();
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Called when a combat pet attacks a monster
        /// </summary>
        public void PetOnAttackMonster(Creature monster)
        {
            /*Console.WriteLine($"{Name}.PetOnAttackMonster({monster.Name})");
             * Console.WriteLine($"Attackable: {monster.Attackable}");
             * Console.WriteLine($"Tolerance: {monster.Tolerance}");*/

            // faction mobs will retaliate against combat pets belonging to the same faction
            if (monster.SameFaction(this))
            {
                monster.AddRetaliateTarget(this);
            }

            if (monster.MonsterState == State.Idle && (monster.Tolerance & PlayerCombatPet_RetaliateExclude) == 0)
            {
                monster.AttackTarget = this;
                monster.WakeUp();
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Called when this player attacks a monster
        /// </summary>
        public void OnAttackMonster(Creature monster)
        {
            if (monster == null || !Attackable)
            {
                return;
            }

            /*Console.WriteLine($"{Name}.OnAttackMonster({monster.Name})");
             * Console.WriteLine($"Attackable: {monster.Attackable}");
             * Console.WriteLine($"Tolerance: {monster.Tolerance}");*/

            // faction mobs will retaliate against players belonging to the same faction
            if (SameFaction(monster))
            {
                monster.AddRetaliateTarget(this);
            }

            if (monster.MonsterState != State.Awake && !monster.Tolerance.HasFlag(Tolerance.NoAttack))
            {
                monster.AttackTarget = this;
                monster.WakeUp();
            }
        }