Ejemplo n.º 1
0
        /// <summary> Gets score for a unit. </summary>
        /// <remarks> Nesox, 2013-06-29. </remarks>
        /// <param name="unit"> The unit. </param>
        /// <returns> The score for unit. </returns>

        private double GetScoreForUnit(BattleCharacter unit)
        {
            double weight = 200 - (2 * unit.Distance());

            weight += unit.MaxHealth; // asuming that bosses have huge health this should make us target a boss

            if (unit.CurrentTargetId == Core.Player.CurrentTargetId)
            {
                // Little extra weight on current targets.
                weight += 120;
            }

            //weight -= (int)npc.Toughness * 50;

            // Force 100 weight on any in-combat NPCs.
            if (_aggroedBattleCharacters.Contains(unit))
            {
                weight += 100;
            }

            //Units that are targeting the player, focus on low health ones so that we can reduce the incoming damage
            if (unit.CurrentTargetId == Core.Player.ObjectId)
            {
                weight += (100 - (unit.CurrentHealthPercent));
            }

            // Less weight on out of combat targets.
            if (!unit.InCombat)
            {
                weight -= 100;
            }

            return(weight);
        }
        private static double GetWeight(BattleCharacter battleCharacter)
        {
            var weight      = 1800f;
            var currentFate = OracleFateManager.GetCurrentFateData();
            var oracleFate  = new Fate();

            if (currentFate != null)
            {
                oracleFate = OracleFateManager.FateDatabase.GetFateFromFateData(currentFate);
            }

            // If FATE has a preferred target, prioritise it if we're out of combat.
            if (oracleFate.PreferredTargetId != null && oracleFate.PreferredTargetId.Contains(battleCharacter.NpcId) && !Core.Player.InCombat)
            {
                weight += 20000;
            }

            if (battleCharacter.Pointer == Core.Player.PrimaryTargetPtr)
            {
                weight += 150;
            }

            if (battleCharacter.HasTarget && battleCharacter.CurrentTargetId == Core.Player.ObjectId)
            {
                weight += 750;
            }

            if (ChocoboManager.Object != null && battleCharacter.HasTarget && battleCharacter.CurrentTargetId == ChocoboManager.Object.ObjectId)
            {
                weight += 400;
            }

            if (!battleCharacter.TappedByOther)
            {
                weight += 200;
            }

            if (battleCharacter.CurrentTargetId == Core.Player.ObjectId)
            {
                weight += 1000 / Convert.ToSingle(battleCharacter.CurrentHealth) * 3000;
            }

            if (!battleCharacter.InCombat)
            {
                weight += 130;
            }

            // Prefer nearer targets in combat if melee, and always out of combat.
            if (OracleClassManager.IsMeleeDpsClassJob(Core.Player.CurrentJob) || OracleClassManager.IsTankClassJob(Core.Player.CurrentJob) ||
                !Core.Player.InCombat)
            {
                weight -= battleCharacter.Distance(Core.Player) * 30;
            }

            return(weight);
        }
Ejemplo n.º 3
0
        private double GetWeight(BattleCharacter battleCharacter)
        {
            // Math.Max(battleCharacter.Distance() - battleCharacter.CombatReach, 0f) prevents enemies from walking on top of us becoming a lot more important than just using Distance();
            // Weight by distance [0 = 2000, 50 = 0];
            var weight = Math.Max(battleCharacter.Distance() - battleCharacter.CombatReach, 0f) * -40 + 2000;

            // we are targetting the enemy, add 150
            if (battleCharacter.Pointer == Core.Player.PrimaryTargetPtr)
            {
                weight += 150;
            }

            // the enemy is targetting us, add 50, add (100 - %hp) times 2
            if (battleCharacter.HasTarget && battleCharacter.CurrentTargetId == Core.Player.ObjectId)
            {
                weight += 50 + (100f - battleCharacter.CurrentHealthPercent) * 2;
            }

            // enemy is part of our fate, add 190
            if (ExFateBot.FateData != null && battleCharacter.FateId == ExFateBot.FateData.Id)
            {
                weight += 190;
            }

            // enemy is on our attackers list, add 60
            if (this.attackers.Contains(battleCharacter))
            {
                weight += 60;
            }

            // enemy is not in combat, subtract 80
            if (!battleCharacter.InCombat)
            {
                weight -= 80;
            }

            // enemy is Forlorn Maiden or The Forlorn, add 1890 to encourage prioritization
            if (battleCharacter.NpcId == 6737 || battleCharacter.NpcId == 6738)
            {
                weight += 1890;
            }

            return(weight);
        }
        private double GetWeight(BattleCharacter battleCharacter)
        {
            // Math.Max(battleCharacter.Distance() - battleCharacter.CombatReach, 0f) prevents enemies from walking on top of us becoming a lot more important than just using Distance();
            // Weight by distance [0 = 2000, 50 = 0];
            var weight = Math.Max(battleCharacter.Distance() - battleCharacter.CombatReach, 0f)  * -40 + 2000;

            // we are targetting the enemy, add 150
            if (battleCharacter.Pointer == Core.Player.PrimaryTargetPtr)
            {
                weight += 150;
            }

            // the enemy is targetting us, add 50, add (100 - %hp) times 2
            if (battleCharacter.HasTarget && battleCharacter.CurrentTargetId == Core.Player.ObjectId)
            {
                weight += 50 + (100f - battleCharacter.CurrentHealthPercent) * 2;
            }

            // enemy is part of our fate, add 190
            if (ExFateBot.FateData != null && battleCharacter.FateId == ExFateBot.FateData.Id)
            {
                weight += 190;
            }

            // enemy is on our attackers list, add 60
            if (this.attackers.Contains(battleCharacter))
            {
                weight += 60;
            }

            // enemy is not in combat, subtract 80
            if (!battleCharacter.InCombat)
            {
                weight -= 80;
            }

            return weight;
        }
Ejemplo n.º 5
0
        /// <summary> Gets score for a unit. </summary>
        /// <remarks> Nesox, 2013-06-29. </remarks>
        /// <param name="unit"> The unit. </param>
        /// <returns> The score for unit. </returns>
        private double GetScoreForUnit(BattleCharacter unit)
        {
            double weight = 200 - (2 * unit.Distance());

            if (unit.CurrentTargetId == Core.Player.CurrentTargetId)
            {
                // Little extra weight on current targets.
                weight += 120;
            }

            //weight -= (int)npc.Toughness * 50;

            // Force 100 weight on any in-combat NPCs.
            if (_aggroedBattleCharacters.Contains(unit))
            {
                weight += 100;
            }

            //Units that are targeting the player, focus on low health ones so that we can reduce the incoming damage
            if (unit.CurrentTargetId == Core.Player.ObjectId)
            {
                weight += (100 - (unit.CurrentHealthPercent));
            }

            // Less weight on out of combat targets.
            if (!unit.InCombat)
            {
                weight -= 100;
            }

            return weight;
        }