diff --git a/playerbot/PlayerbotFactory.cpp b/playerbot/PlayerbotFactory.cpp index 3b02f9f93..8495e623f 100644 --- a/playerbot/PlayerbotFactory.cpp +++ b/playerbot/PlayerbotFactory.cpp @@ -1652,7 +1652,7 @@ void PlayerbotFactory::InitEquipment(bool incremental, bool syncWithMaster) // do not use items that required level is too low compared to bot's level uint32 reqLevel = sRandomItemMgr.GetMinLevelFromCache(newItemId); - if (reqLevel && proto->Quality < ITEM_QUALITY_LEGENDARY && abs((int)bot->GetLevel() - (int)reqLevel) > sPlayerbotAIConfig.randomGearMaxDiff) + if (reqLevel && proto->Quality < ITEM_QUALITY_LEGENDARY && abs((int)bot->GetLevel() - (int)reqLevel) > (int)sPlayerbotAIConfig.randomGearMaxDiff) continue; // filter tank weapons @@ -1913,7 +1913,7 @@ void PlayerbotFactory::InitSecondEquipmentSet() // do not use items that required level is too low compared to bot's level uint32 reqLevel = sRandomItemMgr.GetMinLevelFromCache(itemId); - if (reqLevel && proto->Quality < ITEM_QUALITY_LEGENDARY && abs((int)bot->GetLevel() - (int)reqLevel) > sPlayerbotAIConfig.randomGearMaxDiff) + if (reqLevel && proto->Quality < ITEM_QUALITY_LEGENDARY && abs((int)bot->GetLevel() - (int)reqLevel) > (int)sPlayerbotAIConfig.randomGearMaxDiff) continue; if (!CanEquipItem(proto, desiredQuality)) @@ -3265,7 +3265,7 @@ void PlayerbotFactory::InitInventoryEquip() // do not use items that required level is too low compared to bot's level uint32 reqLevel = sRandomItemMgr.GetMinLevelFromCache(itemId); - if (reqLevel && proto->Quality < ITEM_QUALITY_LEGENDARY && abs((int)bot->GetLevel() - (int)reqLevel) > sPlayerbotAIConfig.randomGearMaxDiff) + if (reqLevel && proto->Quality < ITEM_QUALITY_LEGENDARY && abs((int)bot->GetLevel() - (int)reqLevel) > (int)sPlayerbotAIConfig.randomGearMaxDiff) continue; if ((proto->Class != ITEM_CLASS_ARMOR && proto->Class != ITEM_CLASS_WEAPON) || (proto->Bonding == BIND_WHEN_PICKED_UP || diff --git a/playerbot/strategy/actions/RtiAction.cpp b/playerbot/strategy/actions/RtiAction.cpp index 01bdf2f49..ade2a5827 100644 --- a/playerbot/strategy/actions/RtiAction.cpp +++ b/playerbot/strategy/actions/RtiAction.cpp @@ -84,6 +84,13 @@ bool MarkRtiAction::Execute(Event& event) if (!target) return false; string rti = AI_VALUE(string, "rti"); + + // Add the default rti if the bot is setup to ignore rti targets + if (rti == "none") + { + rti = "skull"; + } + int index = RtiTargetValue::GetRtiIndex(rti); #ifndef MANGOSBOT_TWO group->SetTargetIcon(index, target->GetObjectGuid()); diff --git a/playerbot/strategy/triggers/RtiTriggers.h b/playerbot/strategy/triggers/RtiTriggers.h index a407b20b0..463da0ec1 100644 --- a/playerbot/strategy/triggers/RtiTriggers.h +++ b/playerbot/strategy/triggers/RtiTriggers.h @@ -2,6 +2,7 @@ #include "../Trigger.h" #include "../../PlayerbotAIConfig.h" #include "../../ServerFacade.h" +#include "../values/RtiTargetValue.h" namespace ai { @@ -12,7 +13,33 @@ namespace ai virtual bool IsActive() { - return !AI_VALUE(Unit*, "rti target"); + if (AI_VALUE(Unit*, "rti target")) + { + return false; + } + else + { + // Check for the default rti if the bot is setup to ignore rti targets + string rti = AI_VALUE(string, "rti"); + if (rti == "none") + { + Group* group = bot->GetGroup(); + if (group) + { + const ObjectGuid guid = group->GetTargetIcon(RtiTargetValue::GetRtiIndex("skull")); + if (!guid.IsEmpty()) + { + Unit* unit = ai->GetUnit(ObjectGuid(guid)); + if (unit && !sServerFacade.UnitIsDead(unit) && bot->IsWithinDistInMap(unit, sPlayerbotAIConfig.sightDistance, false)) + { + return false; + } + } + } + } + } + + return true; } }; }