mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-03-07 09:30:29 +00:00
Warnings PR 2 clean unused variables (#2107)
# Pull Request
Removed unused variables and fixed styling issues.
## How to Test the Changes
- Step-by-step instructions to test the change
- Any required setup (e.g. multiple players, bots, specific
configuration)
- Expected behavior and how to verify it
## Complexity & Impact
- Does this change add new decision branches?
- [x] No
- [] Yes (**explain below**)
- Does this change increase per-bot or per-tick processing?
- [x] No
- [ ] Yes (**describe and justify impact**)
- Could this logic scale poorly under load?
- [x] No
- [ ] Yes (**explain why**)
---
## Defaults & Configuration
- Does this change modify default bot behavior?
- [x] No
- [ ] Yes (**explain why**)
If this introduces more advanced or AI-heavy logic:
- [ ] Lightweight mode remains the default
- [ ] More complex behavior is optional and thereby configurable
---
## AI Assistance
- Was AI assistance (e.g. ChatGPT or similar tools) used while working
on this change?
- [x] No
- [ ] Yes (**explain below**)
---
## Final Checklist
- [x] Stability is not compromised
- [x] Performance impact is understood, tested, and acceptable
- [x] Added logic complexity is justified and explained
- [x] Documentation updated if needed
---
## Notes for Reviewers
This was filtered from the code provided by SmashingQuasar. Eliminated
variables were confirmed to be not used, but unclear at times if that is
due to mistakes in writing.
---------
Co-authored-by: bashermens <31279994+hermensbas@users.noreply.github.com>
This commit is contained in:
@@ -24,8 +24,6 @@ bool BGJoinAction::Execute(Event /*event*/)
|
||||
|
||||
BattlegroundQueueTypeId queueTypeId = (BattlegroundQueueTypeId)bgList[urand(0, bgList.size() - 1)];
|
||||
BattlegroundTypeId bgTypeId = BattlegroundMgr::BGTemplateId(queueTypeId);
|
||||
BattlegroundBracketId bracketId;
|
||||
bool isArena = false;
|
||||
bool isRated = false;
|
||||
|
||||
Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId);
|
||||
@@ -37,12 +35,8 @@ bool BGJoinAction::Execute(Event /*event*/)
|
||||
if (!pvpDiff)
|
||||
return false;
|
||||
|
||||
bracketId = pvpDiff->GetBracketId();
|
||||
|
||||
if (ArenaType type = ArenaType(BattlegroundMgr::BGArenaType(queueTypeId)))
|
||||
{
|
||||
isArena = true;
|
||||
|
||||
std::vector<uint32>::iterator i = find(ratedList.begin(), ratedList.end(), queueTypeId);
|
||||
if (i != ratedList.end())
|
||||
isRated = true;
|
||||
@@ -408,8 +402,6 @@ bool BGJoinAction::JoinQueue(uint32 type)
|
||||
|
||||
bracketId = pvpDiff->GetBracketId();
|
||||
|
||||
uint32 BracketSize = bg->GetMaxPlayersPerTeam() * 2;
|
||||
uint32 TeamSize = bg->GetMaxPlayersPerTeam();
|
||||
TeamId teamId = bot->GetTeamId();
|
||||
|
||||
// check if already in queue
|
||||
@@ -486,8 +478,6 @@ bool BGJoinAction::JoinQueue(uint32 type)
|
||||
if (isArena)
|
||||
{
|
||||
isArena = true;
|
||||
BracketSize = type * 2;
|
||||
TeamSize = type;
|
||||
isRated = botAI->GetAiObjectContext()->GetValue<uint32>("arena type")->Get();
|
||||
|
||||
if (joinAsGroup)
|
||||
|
||||
@@ -2497,7 +2497,6 @@ bool BGTactics::selectObjective(bool reset)
|
||||
EYBotStrategy strategyHorde = static_cast<EYBotStrategy>(GetBotStrategyForTeam(bg, TEAM_HORDE));
|
||||
EYBotStrategy strategyAlliance = static_cast<EYBotStrategy>(GetBotStrategyForTeam(bg, TEAM_ALLIANCE));
|
||||
EYBotStrategy strategy = (team == TEAM_ALLIANCE) ? strategyAlliance : strategyHorde;
|
||||
EYBotStrategy enemyStrategy = (team == TEAM_ALLIANCE) ? strategyHorde : strategyAlliance;
|
||||
|
||||
auto IsOwned = [&](uint32 nodeId) -> bool
|
||||
{ return eyeOfTheStormBG->GetCapturePointInfo(nodeId)._ownerTeamId == team; };
|
||||
@@ -3231,7 +3230,6 @@ bool BGTactics::selectObjectiveWp(std::vector<BattleBotPath*> const& vPaths)
|
||||
if (bgType == BATTLEGROUND_RB)
|
||||
bgType = bg->GetBgTypeID(true);
|
||||
|
||||
PositionMap& posMap = context->GetValue<PositionMap&>("position")->Get();
|
||||
PositionInfo pos = context->GetValue<PositionMap&>("position")->Get()["bg objective"];
|
||||
if (!pos.isSet())
|
||||
return false;
|
||||
|
||||
@@ -68,9 +68,7 @@ bool FollowChatShortcutAction::Execute(Event /*event*/)
|
||||
std::string const target = formation->GetTargetName();
|
||||
bool moved = false;
|
||||
if (!target.empty())
|
||||
{
|
||||
moved = Follow(AI_VALUE(Unit*, target));
|
||||
}
|
||||
else
|
||||
{
|
||||
WorldLocation loc = formation->GetLocation();
|
||||
@@ -83,9 +81,7 @@ bool FollowChatShortcutAction::Execute(Event /*event*/)
|
||||
}
|
||||
|
||||
if (Pet* pet = bot->GetPet())
|
||||
{
|
||||
botAI->PetFollow();
|
||||
}
|
||||
|
||||
if (moved)
|
||||
{
|
||||
|
||||
@@ -112,7 +112,6 @@ float ChooseRpgTargetAction::getMaxRelevance(GuidPosition guidP)
|
||||
|
||||
bool ChooseRpgTargetAction::Execute(Event /*event*/)
|
||||
{
|
||||
//TravelTarget* travelTarget = AI_VALUE(TravelTarget*, "travel target"); //not used, line marked for removal.
|
||||
Player* master = botAI->GetMaster();
|
||||
GuidPosition masterRpgTarget;
|
||||
if (master && master != bot && GET_PLAYERBOT_AI(master) && master->GetMapId() == bot->GetMapId() && !master->IsBeingTeleported())
|
||||
@@ -124,7 +123,6 @@ bool ChooseRpgTargetAction::Execute(Event /*event*/)
|
||||
master = nullptr;
|
||||
|
||||
std::unordered_map<ObjectGuid, uint32> targets;
|
||||
// uint32 num = 0; //not used, line marked for removal.
|
||||
GuidVector possibleTargets = AI_VALUE(GuidVector, "possible rpg targets");
|
||||
GuidVector possibleObjects = AI_VALUE(GuidVector, "nearest game objects no los");
|
||||
GuidVector possiblePlayers = AI_VALUE(GuidVector, "nearest friendly players");
|
||||
|
||||
@@ -232,15 +232,6 @@ void ChooseTravelTargetAction::ReportTravelTarget(TravelTarget* newTarget, Trave
|
||||
QuestTravelDestination* QuestDestination = (QuestTravelDestination*)destination;
|
||||
Quest const* quest = QuestDestination->GetQuestTemplate();
|
||||
WorldPosition botLocation(bot);
|
||||
|
||||
CreatureTemplate const* cInfo = nullptr;
|
||||
GameObjectTemplate const* gInfo = nullptr;
|
||||
|
||||
if (destination->getEntry() > 0)
|
||||
cInfo = sObjectMgr->GetCreatureTemplate(destination->getEntry());
|
||||
else
|
||||
gInfo = sObjectMgr->GetGameObjectTemplate(destination->getEntry() * -1);
|
||||
|
||||
std::string Sub;
|
||||
|
||||
if (newTarget->isGroupCopy())
|
||||
@@ -823,10 +814,6 @@ char* strstri(char const* haystack, char const* needle);
|
||||
|
||||
TravelDestination* ChooseTravelTargetAction::FindDestination(Player* bot, std::string const name, bool zones, bool npcs, bool quests, bool mobs, bool bosses)
|
||||
{
|
||||
PlayerbotAI* botAI = GET_PLAYERBOT_AI(bot);
|
||||
|
||||
// AiObjectContext* context = botAI->GetAiObjectContext(); //not used, line marked for removal.
|
||||
|
||||
std::vector<TravelDestination*> dests;
|
||||
|
||||
//Quests
|
||||
|
||||
@@ -520,8 +520,8 @@ bool DebugAction::Execute(Event event)
|
||||
botPos.setY(botPos.GetPositionY() + (dy - 5) * 5);
|
||||
botPos.setZ(botPos.getHeight());
|
||||
|
||||
Creature* wpCreature = bot->SummonCreature(effect, botPos.GetPositionX(), botPos.GetPositionY(), botPos.GetPositionZ(), 0,
|
||||
TEMPSUMMON_TIMED_DESPAWN, 10000.0f);
|
||||
bot->SummonCreature(effect, botPos.GetPositionX(), botPos.GetPositionY(), botPos.GetPositionZ(), 0,
|
||||
TEMPSUMMON_TIMED_DESPAWN, 10000.0f);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -85,8 +85,8 @@ void EquipAction::EquipItem(Item* item)
|
||||
if (itemProto->Class == ITEM_CLASS_CONTAINER)
|
||||
{
|
||||
// Attempt to equip as a bag
|
||||
Bag* pBag = reinterpret_cast<Bag*>(item);
|
||||
uint8 newBagSlot = GetSmallestBagSlot();
|
||||
|
||||
if (newBagSlot > 0)
|
||||
{
|
||||
uint16 src = ((bagIndex << 8) | slot);
|
||||
|
||||
@@ -292,7 +292,6 @@ bool MoveNearWaterAction::isPossible()
|
||||
// Water spot is out of range, lets look for a spot to move to for the fishing hole.
|
||||
if (distance > MAX_DISTANCE_TO_WATER || distance < MIN_DISTANCE_TO_WATER)
|
||||
{
|
||||
float angle = bot->GetAngle(fishingHole.GetPositionX(), fishingHole.GetPositionY());
|
||||
WorldPosition landSpot = FindLandRadialFromPosition(botAI, fishingHole, MIN_DISTANCE_TO_WATER, MAX_DISTANCE_TO_WATER, SEARCH_INCREMENT, fishingSearchWindow, 32);
|
||||
if (landSpot.IsValid())
|
||||
{
|
||||
@@ -323,7 +322,6 @@ bool MoveNearWaterAction::isPossible()
|
||||
if (!water.IsValid())
|
||||
return false;
|
||||
|
||||
bool hasLOS = bot->IsWithinLOS(water.GetPositionX(), water.GetPositionY(), water.GetPositionZ());
|
||||
float angle = bot->GetAngle(water.GetPositionX(), water.GetPositionY());
|
||||
WorldPosition landSpot =
|
||||
FindLandFromPosition(botAI, 0.0f, MAX_DISTANCE_TO_WATER, 1.0f, angle, water, fishingSearchWindow, false);
|
||||
|
||||
@@ -28,7 +28,6 @@ bool GiveItemAction::Execute(Event /*event*/)
|
||||
if (receiverAi->GetAiObjectContext()->GetValue<uint32>("item count", item)->Get())
|
||||
return true;
|
||||
|
||||
bool moved = false;
|
||||
std::vector<Item*> items = InventoryAction::parseItems(item, ITERATE_ITEMS_IN_BAGS);
|
||||
for (Item* item : items)
|
||||
{
|
||||
@@ -42,7 +41,6 @@ bool GiveItemAction::Execute(Event /*event*/)
|
||||
bot->MoveItemFromInventory(item->GetBagSlot(), item->GetSlot(), true);
|
||||
item->SetOwnerGUID(target->GetGUID());
|
||||
receiver->MoveItemToInventory(dest, item, true);
|
||||
moved = true;
|
||||
|
||||
std::ostringstream out;
|
||||
out << "Got " << chat->FormatItem(item->GetTemplate(), item->GetCount()) << " from " << bot->GetName();
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
bool BuyPetitionAction::Execute(Event /*event*/)
|
||||
{
|
||||
GuidVector vendors = botAI->GetAiObjectContext()->GetValue<GuidVector>("nearest npcs")->Get();
|
||||
bool vendored = false, result = false;
|
||||
for (GuidVector::iterator i = vendors.begin(); i != vendors.end(); ++i)
|
||||
{
|
||||
ObjectGuid vendorguid = *i;
|
||||
@@ -97,7 +96,6 @@ bool BuyPetitionAction::canBuyPetition(Player* bot)
|
||||
|
||||
bool PetitionOfferAction::Execute(Event event)
|
||||
{
|
||||
uint32 petitionEntry = 5863; // GUILD_CHARTER
|
||||
std::vector<Item*> petitions = AI_VALUE2(std::vector<Item*>, "inventory items", chat->FormatQItem(5863));
|
||||
|
||||
if (petitions.empty())
|
||||
@@ -212,7 +210,6 @@ bool PetitionOfferNearbyAction::isUseful()
|
||||
bool PetitionTurnInAction::Execute(Event /*event*/)
|
||||
{
|
||||
GuidVector vendors = botAI->GetAiObjectContext()->GetValue<GuidVector>("nearest npcs")->Get();
|
||||
bool vendored = false, result = false;
|
||||
std::vector<Item*> petitions = AI_VALUE2(std::vector<Item*>, "inventory items", chat->FormatQItem(5863));
|
||||
|
||||
if (petitions.empty())
|
||||
|
||||
@@ -167,8 +167,6 @@ std::vector<Player*> InviteGuildToGroupAction::getGuildMembers()
|
||||
|
||||
bool InviteGuildToGroupAction::Execute(Event /*event*/)
|
||||
{
|
||||
Guild* guild = sGuildMgr->GetGuildById(bot->GetGuildId());
|
||||
|
||||
for (auto& member : getGuildMembers())
|
||||
{
|
||||
Player* player = member;
|
||||
|
||||
@@ -27,7 +27,6 @@ bool LootRollAction::Execute(Event /*event*/)
|
||||
continue;
|
||||
}
|
||||
ObjectGuid guid = roll->itemGUID;
|
||||
uint32 slot = roll->itemSlot;
|
||||
uint32 itemId = roll->itemid;
|
||||
int32 randomProperty = 0;
|
||||
if (roll->itemRandomPropId)
|
||||
@@ -184,7 +183,6 @@ bool MasterLootRollAction::Execute(Event event)
|
||||
if (!group)
|
||||
return false;
|
||||
|
||||
RollVote vote = CalculateRollVote(proto);
|
||||
group->CountRollVote(bot->GetGUID(), creatureGuid, CalculateRollVote(proto));
|
||||
|
||||
return true;
|
||||
|
||||
@@ -16,7 +16,6 @@ bool LootStrategyAction::Execute(Event event)
|
||||
{
|
||||
std::string const strategy = event.getParam();
|
||||
|
||||
LootObjectStack* lootItems = AI_VALUE(LootObjectStack*, "available loot");
|
||||
std::set<uint32>& alwaysLootItems = AI_VALUE(std::set<uint32>&, "always loot list");
|
||||
Value<LootStrategy*>* lootStrategy = context->GetValue<LootStrategy*>("loot strategy");
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ public:
|
||||
private:
|
||||
bool CheckBagSpace(Player* bot)
|
||||
{
|
||||
uint32 totalused = 0, total = 16;
|
||||
uint32 totalused = 0;
|
||||
for (uint8 slot = INVENTORY_SLOT_ITEM_START; slot < INVENTORY_SLOT_ITEM_END; slot++)
|
||||
if (bot->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
|
||||
++totalused;
|
||||
|
||||
@@ -93,9 +93,6 @@ bool MovementAction::MoveNear(WorldObject* target, float distance, MovementPrior
|
||||
|
||||
distance += target->GetCombatReach();
|
||||
|
||||
float x = target->GetPositionX();
|
||||
float y = target->GetPositionY();
|
||||
float z = target->GetPositionZ();
|
||||
float followAngle = GetFollowAngle();
|
||||
|
||||
for (float angle = followAngle; angle <= followAngle + static_cast<float>(2 * M_PI);
|
||||
@@ -113,7 +110,6 @@ bool MovementAction::MoveNear(WorldObject* target, float distance, MovementPrior
|
||||
return true;
|
||||
}
|
||||
|
||||
// botAI->TellError("All paths not in LOS");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -122,9 +118,6 @@ bool MovementAction::MoveToLOS(WorldObject* target, bool ranged)
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
// std::ostringstream out; out << "Moving to LOS!";
|
||||
// bot->Say(out.str(), LANG_UNIVERSAL);
|
||||
|
||||
float x = target->GetPositionX();
|
||||
float y = target->GetPositionY();
|
||||
float z = target->GetPositionZ();
|
||||
@@ -257,7 +250,6 @@ bool MovementAction::MoveTo(uint32 mapId, float x, float y, float z, bool idle,
|
||||
// bot->CastStop();
|
||||
// botAI->InterruptSpell();
|
||||
// }
|
||||
G3D::Vector3 endP = path.back();
|
||||
DoMovePoint(bot, x, y, z, generatePath, backwards);
|
||||
float delay = 1000.0f * MoveDelay(distance, backwards);
|
||||
if (lessDelay)
|
||||
@@ -772,8 +764,6 @@ bool MovementAction::MoveTo(WorldObject* target, float distance, MovementPriorit
|
||||
float by = bot->GetPositionY();
|
||||
float bz = bot->GetPositionZ();
|
||||
|
||||
float tx = target->GetPositionX();
|
||||
float ty = target->GetPositionY();
|
||||
float tz = target->GetPositionZ();
|
||||
|
||||
float distanceToTarget = bot->GetDistance(target);
|
||||
@@ -805,10 +795,6 @@ bool MovementAction::ReachCombatTo(Unit* target, float distance)
|
||||
if (!IsMovingAllowed(target))
|
||||
return false;
|
||||
|
||||
float bx = bot->GetPositionX();
|
||||
float by = bot->GetPositionY();
|
||||
float bz = bot->GetPositionZ();
|
||||
|
||||
float tx = target->GetPositionX();
|
||||
float ty = target->GetPositionY();
|
||||
float tz = target->GetPositionZ();
|
||||
@@ -1413,7 +1399,6 @@ bool MovementAction::Flee(Unit* target)
|
||||
if (botAI->IsTank(player))
|
||||
{
|
||||
float distanceToTank = ServerFacade::instance().GetDistance2d(bot, player);
|
||||
float distanceToTarget = ServerFacade::instance().GetDistance2d(bot, target);
|
||||
if (distanceToTank < fleeDistance)
|
||||
{
|
||||
fleeTarget = player;
|
||||
@@ -1434,8 +1419,6 @@ bool MovementAction::Flee(Unit* target)
|
||||
else // bot is not targeted, try to flee dps/healers
|
||||
{
|
||||
bool isHealer = botAI->IsHeal(bot);
|
||||
bool isDps = !isHealer && !botAI->IsTank(bot);
|
||||
bool isTank = botAI->IsTank(bot);
|
||||
bool needHealer = !isHealer && AI_VALUE2(uint8, "health", "self target") < 50;
|
||||
bool isRanged = botAI->IsRanged(bot);
|
||||
|
||||
@@ -2771,9 +2754,7 @@ bool MoveRandomAction::Execute(Event /*event*/)
|
||||
float angle = (float)rand_norm() * static_cast<float>(M_PI);
|
||||
x += urand(0, distance) * cos(angle);
|
||||
y += urand(0, distance) * sin(angle);
|
||||
float ox = x;
|
||||
float oy = y;
|
||||
float oz = z;
|
||||
|
||||
if (!bot->GetMap()->CheckCollisionAndGetValidCoords(bot, bot->GetPositionX(), bot->GetPositionY(),
|
||||
bot->GetPositionZ(), x, y, z))
|
||||
continue;
|
||||
@@ -2894,10 +2875,8 @@ bool MoveAwayFromCreatureAction::isPossible() { return bot->CanFreeMove(); }
|
||||
|
||||
bool MoveAwayFromPlayerWithDebuffAction::Execute(Event /*event*/)
|
||||
{
|
||||
Player* closestPlayer = nullptr;
|
||||
float minDistance = 0.0f;
|
||||
Group* const group = bot->GetGroup();
|
||||
|
||||
Group* group = bot->GetGroup();
|
||||
if (!group)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -332,7 +332,6 @@ public:
|
||||
private:
|
||||
uint32 spellId;
|
||||
float range;
|
||||
bool alive;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,7 +20,6 @@ public:
|
||||
bool Execute(Event event) override;
|
||||
|
||||
private:
|
||||
bool warningEnabled = true;
|
||||
std::string defaultCmd;
|
||||
};
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ void QueryQuestAction::TellObjective(std::string const name, uint32 available, u
|
||||
|
||||
bool QueryQuestAction::Execute(Event event)
|
||||
{
|
||||
Player* requester = event.getOwner() ? event.getOwner() : GetMaster();
|
||||
Player* bot = botAI->GetBot();
|
||||
WorldPosition botPos(bot);
|
||||
WorldPosition* ptr_botpos = &botPos;
|
||||
|
||||
@@ -352,7 +352,6 @@ bool QuestUpdateAddItemAction::Execute(Event event)
|
||||
uint32 itemId, count;
|
||||
p >> itemId >> count;
|
||||
|
||||
Player* requester = event.getOwner() ? event.getOwner() : GetMaster();
|
||||
auto const* itemPrototype = sObjectMgr->GetItemTemplate(itemId);
|
||||
if (itemPrototype)
|
||||
{
|
||||
@@ -407,8 +406,6 @@ bool QuestItemPushResultAction::Execute(Event event)
|
||||
if (!quest)
|
||||
return false;
|
||||
|
||||
const QuestStatusData& q_status = bot->getQuestStatusMap().at(questId);
|
||||
|
||||
for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++)
|
||||
{
|
||||
uint32 itemId = quest->RequiredItemId[i];
|
||||
@@ -448,8 +445,6 @@ bool QuestUpdateFailedTimerAction::Execute(Event event)
|
||||
uint32 questId;
|
||||
p >> questId;
|
||||
|
||||
Player* requester = event.getOwner() ? event.getOwner() : GetMaster();
|
||||
|
||||
Quest const* qInfo = sObjectMgr->GetQuestTemplate(questId);
|
||||
|
||||
if (qInfo)
|
||||
|
||||
@@ -28,7 +28,7 @@ bool RememberTaxiAction::Execute(Event event)
|
||||
case CMSG_ACTIVATETAXIEXPRESS:
|
||||
{
|
||||
ObjectGuid guid;
|
||||
uint32 node_count, totalcost;
|
||||
uint32 node_count;
|
||||
p >> guid >> node_count;
|
||||
|
||||
LastMovement& movement = context->GetValue<LastMovement&>("last taxi")->Get();
|
||||
|
||||
@@ -156,7 +156,6 @@ bool SayAction::isUseful()
|
||||
|
||||
void ChatReplyAction::ChatReplyDo(Player* bot, uint32& type, uint32& guid1, uint32& guid2, std::string& msg, std::string& chanName, std::string& name)
|
||||
{
|
||||
ChatReplyType replyType = REPLY_NOT_UNDERSTAND; // default not understand
|
||||
std::string respondsText = "";
|
||||
|
||||
// if we're just commanding bots around, don't respond...
|
||||
|
||||
@@ -10,8 +10,10 @@
|
||||
|
||||
bool SecurityCheckAction::isUseful()
|
||||
{
|
||||
return sRandomPlayerbotMgr.IsRandomBot(bot) && botAI->GetMaster() &&
|
||||
botAI->GetMaster()->GetSession()->GetSecurity() < SEC_GAMEMASTER && !GET_PLAYERBOT_AI(botAI->GetMaster());
|
||||
return RandomPlayerbotMgr::instance().IsRandomBot(bot)
|
||||
&& botAI->GetMaster()
|
||||
&& botAI->GetMaster()->GetSession()->GetSecurity() < SEC_GAMEMASTER
|
||||
&& !GET_PLAYERBOT_AI(botAI->GetMaster());
|
||||
}
|
||||
|
||||
bool SecurityCheckAction::Execute(Event /*event*/)
|
||||
|
||||
@@ -66,7 +66,8 @@ bool SetCraftAction::Execute(Event event)
|
||||
if (!spellInfo)
|
||||
continue;
|
||||
|
||||
if (SkillLineAbilityEntry const* skillLine = skillSpells[spellId])
|
||||
SkillLineAbilityEntry const* skillLine = skillSpells[spellId];
|
||||
if (skillLine != nullptr)
|
||||
{
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
|
||||
@@ -26,20 +26,10 @@ bool SetHomeAction::Execute(Event /*event*/)
|
||||
if (Unit* unit = botAI->GetUnit(selection))
|
||||
if (unit->HasNpcFlag(UNIT_NPC_FLAG_INNKEEPER))
|
||||
{
|
||||
if (isRpgAction)
|
||||
{
|
||||
Creature* creature = botAI->GetCreature(selection);
|
||||
bot->GetSession()->SendBindPoint(creature);
|
||||
botAI->TellMaster("This inn is my new home");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Creature* creature = botAI->GetCreature(selection);
|
||||
bot->GetSession()->SendBindPoint(creature);
|
||||
botAI->TellMaster("This inn is my new home");
|
||||
return true;
|
||||
}
|
||||
Creature* creature = botAI->GetCreature(selection);
|
||||
bot->GetSession()->SendBindPoint(creature);
|
||||
botAI->TellMaster("This inn is my new home");
|
||||
return true;
|
||||
}
|
||||
|
||||
GuidVector npcs = AI_VALUE(GuidVector, "nearest npcs");
|
||||
|
||||
@@ -40,9 +40,8 @@ bool ShareQuestAction::Execute(Event event)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AutoShareQuestAction::Execute(Event event)
|
||||
bool AutoShareQuestAction::Execute(Event /*event*/)
|
||||
{
|
||||
Player* requester = event.getOwner() ? event.getOwner() : GetMaster();
|
||||
bool shared = false;
|
||||
|
||||
for (uint8 slot = 0; slot < MAX_QUEST_LOG_SIZE; ++slot)
|
||||
|
||||
@@ -47,7 +47,6 @@ bool StayAction::isUseful()
|
||||
PositionInfo stayPosition = AI_VALUE(PositionMap&, "position")["stay"];
|
||||
if (stayPosition.isSet())
|
||||
{
|
||||
const float distance = bot->GetDistance(stayPosition.x, stayPosition.y, stayPosition.z);
|
||||
if (sPlayerbotAIConfig.followDistance)
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,6 @@ bool SuggestWhatToDoAction::Execute(Event /*event*/)
|
||||
fnct_ptr();
|
||||
|
||||
std::string const qualifier = "suggest what to do";
|
||||
time_t lastSaid = AI_VALUE2(time_t, "last said", qualifier);
|
||||
botAI->GetAiObjectContext()->GetValue<time_t>("last said", qualifier)->Set(time(nullptr) + urand(1, 60));
|
||||
|
||||
return true;
|
||||
@@ -221,7 +220,7 @@ void SuggestWhatToDoAction::thunderfury()
|
||||
class FindTradeItemsVisitor : public IterateItemsVisitor
|
||||
{
|
||||
public:
|
||||
FindTradeItemsVisitor(uint32 quality) : quality(quality), IterateItemsVisitor() {}
|
||||
FindTradeItemsVisitor(uint32 quality) : IterateItemsVisitor(), quality(quality) {}
|
||||
|
||||
bool Visit(Item* item) override
|
||||
{
|
||||
|
||||
@@ -231,7 +231,6 @@ void TalkToQuestGiverAction::AskToSelectReward(Quest const* quest, std::ostrings
|
||||
for (uint8 i = 0; i < quest->GetRewChoiceItemsCount(); ++i)
|
||||
{
|
||||
ItemTemplate const* item = sObjectMgr->GetItemTemplate(quest->RewardChoiceItemId[i]);
|
||||
ItemUsage usage = AI_VALUE2(ItemUsage, "item usage", quest->RewardChoiceItemId[i]);
|
||||
|
||||
if (!forEquip || BestRewards(quest).count(i) > 0)
|
||||
{
|
||||
@@ -248,7 +247,6 @@ bool TurnInQueryQuestAction::Execute(Event event)
|
||||
WorldPacket pakcet = event.getPacket();
|
||||
ObjectGuid guid;
|
||||
uint32 questId;
|
||||
ObjectGuid unk1;
|
||||
pakcet >> guid >> questId;
|
||||
Object* object =
|
||||
ObjectAccessor::GetObjectByTypeMask(*bot, guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT | TYPEMASK_ITEM);
|
||||
|
||||
@@ -51,7 +51,6 @@ bool TameAction::Execute(Event event)
|
||||
{
|
||||
std::set<std::string> normalFamilies;
|
||||
std::set<std::string> exoticFamilies;
|
||||
Player* bot = botAI->GetBot();
|
||||
|
||||
// Loop over all creature templates and collect tameable families
|
||||
CreatureTemplateContainer const* creatures = sObjectMgr->GetCreatureTemplates();
|
||||
|
||||
@@ -95,7 +95,6 @@ bool TellAuraAction::Execute(Event /*event*/)
|
||||
std::string caster_name = caster ? caster->GetName() : "unknown";
|
||||
bool is_area = aura->IsArea();
|
||||
int32 duration = aura->GetDuration();
|
||||
const SpellInfo* spellInfo = aura->GetSpellInfo();
|
||||
int32 spellId = aura->GetSpellInfo()->Id;
|
||||
bool isPositive = aura->GetSpellInfo()->IsPositive();
|
||||
sLog->outMessage("playerbot", LOG_LEVEL_DEBUG,
|
||||
|
||||
@@ -64,8 +64,6 @@ bool TradeStatusAction::Execute(Event event)
|
||||
uint32 discount = sRandomPlayerbotMgr.GetTradeDiscount(bot, trader);
|
||||
if (CheckTrade())
|
||||
{
|
||||
int32 botMoney = CalculateCost(bot, true);
|
||||
|
||||
std::map<uint32, uint32> givenItemIds, takenItemIds;
|
||||
for (uint32 slot = 0; slot < TRADE_SLOT_TRADED_COUNT; ++slot)
|
||||
{
|
||||
@@ -161,15 +159,11 @@ bool TradeStatusAction::CheckTrade()
|
||||
|
||||
if (!botAI->HasActivePlayerMaster() && GET_PLAYERBOT_AI(bot->GetTrader()))
|
||||
{
|
||||
bool isGivingItem = false;
|
||||
for (uint32 slot = 0; slot < TRADE_SLOT_TRADED_COUNT; ++slot)
|
||||
{
|
||||
Item* item = bot->GetTradeData()->GetItem((TradeSlots)slot);
|
||||
if (item)
|
||||
{
|
||||
isGivingItem = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
bool isGettingItem = false;
|
||||
for (uint32 slot = 0; slot < TRADE_SLOT_TRADED_COUNT; ++slot)
|
||||
|
||||
@@ -134,8 +134,6 @@ bool MoveFromDarkPortalAction::Execute(Event /*event*/)
|
||||
|
||||
if (bot->GetTeamId() == TEAM_ALLIANCE)
|
||||
return MoveTo(530, -319.261f, 1027.213, 54.172638f, false, true);
|
||||
else
|
||||
return MoveTo(530, -180.444f, 1027.947, 54.181538f, false, true);
|
||||
|
||||
return false;
|
||||
return MoveTo(530, -180.444f, 1027.947, 54.181538f, false, true);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,6 @@ bool UseItemAction::UseItem(Item* item, ObjectGuid goGuid, Item* itemTarget, Uni
|
||||
|
||||
uint8 bagIndex = item->GetBagSlot();
|
||||
uint8 slot = item->GetSlot();
|
||||
uint8 spell_index = 0;
|
||||
uint8 cast_count = 1;
|
||||
ObjectGuid item_guid = item->GetGUID();
|
||||
uint32 glyphIndex = 0;
|
||||
|
||||
@@ -108,7 +108,7 @@ std::string const WhoAction::QuerySkill(std::string const text)
|
||||
return out.str();
|
||||
}
|
||||
|
||||
std::string const WhoAction::QuerySpec(std::string const text)
|
||||
std::string const WhoAction::QuerySpec(std::string const /*text*/)
|
||||
{
|
||||
std::ostringstream out;
|
||||
|
||||
|
||||
@@ -8,11 +8,13 @@
|
||||
|
||||
bool WipeAction::Execute(Event event)
|
||||
{
|
||||
Player* master = event.getOwner();
|
||||
Player* const owner = event.getOwner();
|
||||
Player* const master = this->botAI->GetMaster();
|
||||
|
||||
if (botAI->GetMaster()->GetGUID() != event.getOwner()->GetGUID())
|
||||
if (owner != nullptr && master != nullptr && master->GetGUID() != owner->GetGUID())
|
||||
return false;
|
||||
|
||||
bot->Kill(bot, bot);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "LootValues.h"
|
||||
#include "NamedObjectContext.h"
|
||||
#include "Playerbots.h"
|
||||
#include "PlayerbotAI.h"
|
||||
#include "PvpValues.h"
|
||||
#include "QuestValues.h"
|
||||
|
||||
|
||||
@@ -11,11 +11,6 @@
|
||||
#include "ServerFacade.h"
|
||||
#include "SharedDefines.h"
|
||||
|
||||
static float GetSpeedInMotion(Unit* target)
|
||||
{
|
||||
return target->GetSpeed(Movement::SelectSpeedType(target->GetUnitMovementFlags()));
|
||||
}
|
||||
|
||||
bool EnemyTooCloseForSpellTrigger::IsActive()
|
||||
{
|
||||
Unit* target = AI_VALUE(Unit*, "current target");
|
||||
|
||||
@@ -144,8 +144,6 @@ UnitPosition MultiLineUnitPlacer::Place(FormationUnit* unit, uint32 index, uint3
|
||||
uint32 lineNo = index / 6;
|
||||
uint32 indexInLine = index % 6;
|
||||
uint32 lineSize = std::max(count - lineNo * 6, uint32(6));
|
||||
float x = cos(orientation) * sPlayerbotAIConfig.followDistance * lineNo;
|
||||
float y = sin(orientation) * sPlayerbotAIConfig.followDistance * lineNo;
|
||||
return placer.Place(unit, indexInLine, lineSize);
|
||||
}
|
||||
|
||||
@@ -160,17 +158,13 @@ UnitPosition SingleLineUnitPlacer::Place(FormationUnit* unit, uint32 index, uint
|
||||
void FormationSlot::Move(float dx, float dy)
|
||||
{
|
||||
for (FormationUnit* unit : units)
|
||||
{
|
||||
unit->SetLocation(unit->GetX() + dx, unit->GetY() + dy);
|
||||
}
|
||||
}
|
||||
|
||||
FormationSlot::~FormationSlot()
|
||||
{
|
||||
for (FormationUnit* unit : units)
|
||||
{
|
||||
delete unit;
|
||||
}
|
||||
|
||||
units.clear();
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ Unit* GrindTargetValue::Calculate()
|
||||
|
||||
Unit* GrindTargetValue::FindTargetForGrinding(uint32 assistCount)
|
||||
{
|
||||
uint32 memberCount = 1;
|
||||
Group* group = bot->GetGroup();
|
||||
Player* master = GetMaster();
|
||||
|
||||
@@ -65,7 +64,6 @@ Unit* GrindTargetValue::FindTargetForGrinding(uint32 assistCount)
|
||||
if (!unit->IsInWorld() || unit->IsDuringRemoveFromWorld())
|
||||
continue;
|
||||
|
||||
auto& rep = bot->ToPlayer()->GetReputationMgr();
|
||||
if (unit->ToCreature() && !unit->ToCreature()->GetCreatureTemplate()->lootid &&
|
||||
bot->GetReactionTo(unit) >= REP_NEUTRAL)
|
||||
continue;
|
||||
|
||||
@@ -69,8 +69,10 @@ ItemUsage ItemUsageValue::Calculate()
|
||||
if (proto->Class == ITEM_CLASS_KEY)
|
||||
return ITEM_USAGE_USE;
|
||||
|
||||
const uint32_t maxCount = proto->MaxCount;
|
||||
|
||||
if (proto->Class == ITEM_CLASS_CONSUMABLE &&
|
||||
(proto->MaxCount == 0 || bot->GetItemCount(itemId, false) < proto->MaxCount))
|
||||
(maxCount == 0 || bot->GetItemCount(itemId, false) < maxCount))
|
||||
{
|
||||
std::string const foodType = GetConsumableType(proto, bot->GetPower(POWER_MANA));
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "LeastHpTargetValue.h"
|
||||
|
||||
#include "AttackersValue.h"
|
||||
#include "PlayerbotAI.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
class FindLeastHpTargetStrategy : public FindNonCcTargetStrategy
|
||||
{
|
||||
@@ -15,7 +15,6 @@ public:
|
||||
|
||||
void CheckAttacker(Unit* attacker, ThreatMgr* threatMgr) override
|
||||
{
|
||||
Player* bot = botAI->GetBot();
|
||||
if (IsCcTarget(attacker))
|
||||
return;
|
||||
|
||||
@@ -30,5 +29,6 @@ protected:
|
||||
Unit* LeastHpTargetValue::Calculate()
|
||||
{
|
||||
FindLeastHpTargetStrategy strategy(botAI);
|
||||
|
||||
return FindTarget(&strategy);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
#include "NamedObjectContext.h"
|
||||
#include "PartyMemberValue.h"
|
||||
#include "PlayerbotAIConfig.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
class Unit;
|
||||
@@ -16,8 +15,7 @@ class Unit;
|
||||
class PartyMemberWithoutAuraValue : public PartyMemberValue, public Qualified
|
||||
{
|
||||
public:
|
||||
PartyMemberWithoutAuraValue(PlayerbotAI* botAI, std::string const name = "party member without aura",
|
||||
float range = sPlayerbotAIConfig.sightDistance)
|
||||
PartyMemberWithoutAuraValue(PlayerbotAI* botAI, std::string const name = "party member without aura")
|
||||
: PartyMemberValue(botAI, name)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -5,15 +5,14 @@
|
||||
|
||||
#include "PossibleRpgTargetsValue.h"
|
||||
|
||||
#include "AiObjectContext.h"
|
||||
#include "CellImpl.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "ObjectGuid.h"
|
||||
#include "Playerbots.h"
|
||||
#include "ServerFacade.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "NearestGameObjects.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "CellImpl.h"
|
||||
#include "TravelMgr.h"
|
||||
|
||||
std::vector<uint32> PossibleRpgTargetsValue::allowedNpcFlags;
|
||||
|
||||
@@ -74,15 +73,9 @@ bool PossibleRpgTargetsValue::AcceptUnit(Unit* unit)
|
||||
}
|
||||
|
||||
TravelTarget* travelTarget = context->GetValue<TravelTarget*>("travel target")->Get();
|
||||
|
||||
if (
|
||||
travelTarget != nullptr
|
||||
&& travelTarget->getDestination()
|
||||
&& (uint32_t)travelTarget->getDestination()->getEntry() == unit->GetEntry()
|
||||
)
|
||||
{
|
||||
if (travelTarget && travelTarget->getDestination() &&
|
||||
travelTarget->getDestination()->getEntry() == unit->GetEntry())
|
||||
return true;
|
||||
}
|
||||
|
||||
if (urand(1, 100) < 25 && unit->IsFriendlyTo(bot))
|
||||
return true;
|
||||
|
||||
@@ -14,7 +14,6 @@ Unit* SnareTargetValue::Calculate()
|
||||
std::string const spell = qualifier;
|
||||
|
||||
GuidVector attackers = botAI->GetAiObjectContext()->GetValue<GuidVector>("attackers")->Get();
|
||||
Unit* target = botAI->GetAiObjectContext()->GetValue<Unit*>("current target")->Get();
|
||||
for (ObjectGuid const guid : attackers)
|
||||
{
|
||||
Unit* unit = botAI->GetUnit(guid);
|
||||
|
||||
@@ -208,7 +208,6 @@ uint8 BagSpaceValue::Calculate()
|
||||
++totalused;
|
||||
}
|
||||
|
||||
uint32 totalfree = 16 - totalused;
|
||||
for (uint8 bag = INVENTORY_SLOT_BAG_START; bag < INVENTORY_SLOT_BAG_END; ++bag)
|
||||
{
|
||||
const Bag* const pBag = (Bag*)bot->GetItemByPos(INVENTORY_SLOT_BAG_0, bag);
|
||||
@@ -218,7 +217,6 @@ uint8 BagSpaceValue::Calculate()
|
||||
if (pBagProto->Class == ITEM_CLASS_CONTAINER && pBagProto->SubClass == ITEM_SUBCLASS_CONTAINER)
|
||||
{
|
||||
total += pBag->GetBagSize();
|
||||
totalfree += pBag->GetFreeSlots();
|
||||
totalused += pBag->GetBagSize() - pBag->GetFreeSlots();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "ObjectAccessor.h"
|
||||
|
||||
using ai::buff::MakeAuraQualifierForBuff;
|
||||
using ai::buff::UpgradeToGroupIfAppropriate;
|
||||
|
||||
// Helper : detect tank role on the target (player bot or not) return true if spec is tank or if the bot have tank strategies (bear/tank/tank face).
|
||||
static inline bool IsTankRole(Player* p)
|
||||
@@ -53,11 +52,6 @@ static inline bool IsOnlyPaladinInGroup(Player* bot)
|
||||
return pals == 1u;
|
||||
}
|
||||
|
||||
static inline bool GroupHasTankOfClass(Group* g, uint8 classId)
|
||||
{
|
||||
return GroupHasTankOfClass(g, static_cast<Classes>(classId));
|
||||
}
|
||||
|
||||
inline std::string const GetActualBlessingOfMight(Unit* target)
|
||||
{
|
||||
if (!target->ToPlayer())
|
||||
|
||||
@@ -283,20 +283,6 @@ static uint32 GetRequiredTotemSpellId(PlayerbotAI* ai, const char* strategies[],
|
||||
return 0; // No relevant strategy active, or bot doesn't know any rank
|
||||
}
|
||||
|
||||
// Get the spellId of the currently summoned totem in the slot
|
||||
static uint32 GetSummonedTotemSpellId(Player* bot, uint8 slot)
|
||||
{
|
||||
ObjectGuid guid = bot->m_SummonSlot[slot];
|
||||
if (guid.IsEmpty())
|
||||
return 0;
|
||||
|
||||
Creature* totem = bot->GetMap()->GetCreature(guid);
|
||||
if (!totem)
|
||||
return 0;
|
||||
|
||||
return totem->GetUInt32Value(UNIT_CREATED_BY_SPELL);
|
||||
}
|
||||
|
||||
bool NoEarthTotemTrigger::IsActive()
|
||||
{
|
||||
// Check if the bot has Stoneskin Totem (required level 4) and prevents the trigger firing if it doesn't
|
||||
|
||||
@@ -359,10 +359,8 @@ class SetTotemTrigger : public Trigger
|
||||
public:
|
||||
// Template constructor: infers N (size of the id array) at compile time
|
||||
template <size_t N>
|
||||
SetTotemTrigger(PlayerbotAI* ai, std::string const& spellName, uint32 requiredSpellId,
|
||||
const uint32 (&ids)[N], int actionButtonId)
|
||||
SetTotemTrigger(PlayerbotAI* ai, std::string const& spellName, const uint32 (&ids)[N], int actionButtonId)
|
||||
: Trigger(ai, "set " + spellName)
|
||||
, requiredSpellId(requiredSpellId)
|
||||
, totemSpellIds(ids)
|
||||
, totemSpellIdsCount(N)
|
||||
, actionButtonId(actionButtonId)
|
||||
@@ -370,7 +368,6 @@ public:
|
||||
bool IsActive() override;
|
||||
|
||||
private:
|
||||
uint32 requiredSpellId;
|
||||
uint32 const* totemSpellIds;
|
||||
size_t totemSpellIdsCount;
|
||||
int actionButtonId;
|
||||
@@ -380,119 +377,119 @@ class SetStrengthOfEarthTotemTrigger : public SetTotemTrigger
|
||||
{
|
||||
public:
|
||||
SetStrengthOfEarthTotemTrigger(PlayerbotAI* ai)
|
||||
: SetTotemTrigger(ai, "strength of earth totem", SPELL_STRENGTH_OF_EARTH_TOTEM_RANK_1, STRENGTH_OF_EARTH_TOTEM, TOTEM_BAR_SLOT_EARTH) {}
|
||||
: SetTotemTrigger(ai, "strength of earth totem", STRENGTH_OF_EARTH_TOTEM, TOTEM_BAR_SLOT_EARTH) {}
|
||||
};
|
||||
|
||||
class SetStoneskinTotemTrigger : public SetTotemTrigger
|
||||
{
|
||||
public:
|
||||
SetStoneskinTotemTrigger(PlayerbotAI* ai)
|
||||
: SetTotemTrigger(ai, "stoneskin totem", SPELL_STONESKIN_TOTEM_RANK_1, STONESKIN_TOTEM, TOTEM_BAR_SLOT_EARTH) {}
|
||||
: SetTotemTrigger(ai, "stoneskin totem", STONESKIN_TOTEM, TOTEM_BAR_SLOT_EARTH) {}
|
||||
};
|
||||
|
||||
class SetTremorTotemTrigger : public SetTotemTrigger
|
||||
{
|
||||
public:
|
||||
SetTremorTotemTrigger(PlayerbotAI* ai)
|
||||
: SetTotemTrigger(ai, "tremor totem", SPELL_TREMOR_TOTEM_RANK_1, TREMOR_TOTEM, TOTEM_BAR_SLOT_EARTH) {}
|
||||
: SetTotemTrigger(ai, "tremor totem", TREMOR_TOTEM, TOTEM_BAR_SLOT_EARTH) {}
|
||||
};
|
||||
|
||||
class SetEarthbindTotemTrigger : public SetTotemTrigger
|
||||
{
|
||||
public:
|
||||
SetEarthbindTotemTrigger(PlayerbotAI* ai)
|
||||
: SetTotemTrigger(ai, "earthbind totem", SPELL_EARTHBIND_TOTEM_RANK_1, EARTHBIND_TOTEM, TOTEM_BAR_SLOT_EARTH) {}
|
||||
: SetTotemTrigger(ai, "earthbind totem", EARTHBIND_TOTEM, TOTEM_BAR_SLOT_EARTH) {}
|
||||
};
|
||||
|
||||
class SetSearingTotemTrigger : public SetTotemTrigger
|
||||
{
|
||||
public:
|
||||
SetSearingTotemTrigger(PlayerbotAI* ai)
|
||||
: SetTotemTrigger(ai, "searing totem", SPELL_SEARING_TOTEM_RANK_1, SEARING_TOTEM, TOTEM_BAR_SLOT_FIRE) {}
|
||||
: SetTotemTrigger(ai, "searing totem", SEARING_TOTEM, TOTEM_BAR_SLOT_FIRE) {}
|
||||
};
|
||||
|
||||
class SetMagmaTotemTrigger : public SetTotemTrigger
|
||||
{
|
||||
public:
|
||||
SetMagmaTotemTrigger(PlayerbotAI* ai)
|
||||
: SetTotemTrigger(ai, "magma totem", SPELL_MAGMA_TOTEM_RANK_1, MAGMA_TOTEM, TOTEM_BAR_SLOT_FIRE) {}
|
||||
: SetTotemTrigger(ai, "magma totem", MAGMA_TOTEM, TOTEM_BAR_SLOT_FIRE) {}
|
||||
};
|
||||
|
||||
class SetFlametongueTotemTrigger : public SetTotemTrigger
|
||||
{
|
||||
public:
|
||||
SetFlametongueTotemTrigger(PlayerbotAI* ai)
|
||||
: SetTotemTrigger(ai, "flametongue totem", SPELL_FLAMETONGUE_TOTEM_RANK_1, FLAMETONGUE_TOTEM, TOTEM_BAR_SLOT_FIRE) {}
|
||||
: SetTotemTrigger(ai, "flametongue totem", FLAMETONGUE_TOTEM, TOTEM_BAR_SLOT_FIRE) {}
|
||||
};
|
||||
|
||||
class SetTotemOfWrathTrigger : public SetTotemTrigger
|
||||
{
|
||||
public:
|
||||
SetTotemOfWrathTrigger(PlayerbotAI* ai)
|
||||
: SetTotemTrigger(ai, "totem of wrath", SPELL_TOTEM_OF_WRATH_RANK_1, TOTEM_OF_WRATH, TOTEM_BAR_SLOT_FIRE) {}
|
||||
: SetTotemTrigger(ai, "totem of wrath", TOTEM_OF_WRATH, TOTEM_BAR_SLOT_FIRE) {}
|
||||
};
|
||||
|
||||
class SetFrostResistanceTotemTrigger : public SetTotemTrigger
|
||||
{
|
||||
public:
|
||||
SetFrostResistanceTotemTrigger(PlayerbotAI* ai)
|
||||
: SetTotemTrigger(ai, "frost resistance totem", SPELL_FROST_RESISTANCE_TOTEM_RANK_1, FROST_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_FIRE) {}
|
||||
: SetTotemTrigger(ai, "frost resistance totem", FROST_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_FIRE) {}
|
||||
};
|
||||
|
||||
class SetHealingStreamTotemTrigger : public SetTotemTrigger
|
||||
{
|
||||
public:
|
||||
SetHealingStreamTotemTrigger(PlayerbotAI* ai)
|
||||
: SetTotemTrigger(ai, "healing stream totem", SPELL_HEALING_STREAM_TOTEM_RANK_1, HEALING_STREAM_TOTEM, TOTEM_BAR_SLOT_WATER) {}
|
||||
: SetTotemTrigger(ai, "healing stream totem", HEALING_STREAM_TOTEM, TOTEM_BAR_SLOT_WATER) {}
|
||||
};
|
||||
|
||||
class SetManaSpringTotemTrigger : public SetTotemTrigger
|
||||
{
|
||||
public:
|
||||
SetManaSpringTotemTrigger(PlayerbotAI* ai)
|
||||
: SetTotemTrigger(ai, "mana spring totem", SPELL_MANA_SPRING_TOTEM_RANK_1, MANA_SPRING_TOTEM, TOTEM_BAR_SLOT_WATER) {}
|
||||
: SetTotemTrigger(ai, "mana spring totem", MANA_SPRING_TOTEM, TOTEM_BAR_SLOT_WATER) {}
|
||||
};
|
||||
|
||||
class SetCleansingTotemTrigger : public SetTotemTrigger
|
||||
{
|
||||
public:
|
||||
SetCleansingTotemTrigger(PlayerbotAI* ai)
|
||||
: SetTotemTrigger(ai, "cleansing totem", SPELL_CLEANSING_TOTEM_RANK_1, CLEANSING_TOTEM, TOTEM_BAR_SLOT_WATER) {}
|
||||
: SetTotemTrigger(ai, "cleansing totem", CLEANSING_TOTEM, TOTEM_BAR_SLOT_WATER) {}
|
||||
};
|
||||
|
||||
class SetFireResistanceTotemTrigger : public SetTotemTrigger
|
||||
{
|
||||
public:
|
||||
SetFireResistanceTotemTrigger(PlayerbotAI* ai)
|
||||
: SetTotemTrigger(ai, "fire resistance totem", SPELL_FIRE_RESISTANCE_TOTEM_RANK_1, FIRE_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_WATER) {}
|
||||
: SetTotemTrigger(ai, "fire resistance totem", FIRE_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_WATER) {}
|
||||
};
|
||||
|
||||
class SetWrathOfAirTotemTrigger : public SetTotemTrigger
|
||||
{
|
||||
public:
|
||||
SetWrathOfAirTotemTrigger(PlayerbotAI* ai)
|
||||
: SetTotemTrigger(ai, "wrath of air totem", SPELL_WRATH_OF_AIR_TOTEM_RANK_1, WRATH_OF_AIR_TOTEM, TOTEM_BAR_SLOT_AIR) {}
|
||||
: SetTotemTrigger(ai, "wrath of air totem", WRATH_OF_AIR_TOTEM, TOTEM_BAR_SLOT_AIR) {}
|
||||
};
|
||||
|
||||
class SetWindfuryTotemTrigger : public SetTotemTrigger
|
||||
{
|
||||
public:
|
||||
SetWindfuryTotemTrigger(PlayerbotAI* ai)
|
||||
: SetTotemTrigger(ai, "windfury totem", SPELL_WINDFURY_TOTEM_RANK_1, WINDFURY_TOTEM, TOTEM_BAR_SLOT_AIR) {}
|
||||
: SetTotemTrigger(ai, "windfury totem", WINDFURY_TOTEM, TOTEM_BAR_SLOT_AIR) {}
|
||||
};
|
||||
|
||||
class SetNatureResistanceTotemTrigger : public SetTotemTrigger
|
||||
{
|
||||
public:
|
||||
SetNatureResistanceTotemTrigger(PlayerbotAI* ai)
|
||||
: SetTotemTrigger(ai, "nature resistance totem", SPELL_NATURE_RESISTANCE_TOTEM_RANK_1, NATURE_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_AIR) {}
|
||||
: SetTotemTrigger(ai, "nature resistance totem", NATURE_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_AIR) {}
|
||||
};
|
||||
|
||||
class SetGroundingTotemTrigger : public SetTotemTrigger
|
||||
{
|
||||
public:
|
||||
SetGroundingTotemTrigger(PlayerbotAI* ai)
|
||||
: SetTotemTrigger(ai, "grounding totem", SPELL_GROUNDING_TOTEM_RANK_1, GROUNDING_TOTEM, TOTEM_BAR_SLOT_AIR) {}
|
||||
: SetTotemTrigger(ai, "grounding totem", GROUNDING_TOTEM, TOTEM_BAR_SLOT_AIR) {}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -17,11 +17,9 @@ bool MoveFromBronjahmAction::Execute(Event /*event*/)
|
||||
|
||||
bool AttackCorruptedSoulFragmentAction::Execute(Event /*event*/)
|
||||
{
|
||||
Unit* currentTarget = AI_VALUE(Unit*, "current target");
|
||||
GuidVector targets = AI_VALUE(GuidVector, "possible targets");
|
||||
|
||||
// If no valid skull target, search for corrupted soul fragment
|
||||
Unit* empoweredPrince = nullptr;
|
||||
for (auto i = targets.begin(); i != targets.end(); ++i)
|
||||
{
|
||||
Unit* unit = botAI->GetUnit(*i);
|
||||
@@ -30,8 +28,6 @@ bool AttackCorruptedSoulFragmentAction::Execute(Event /*event*/)
|
||||
|
||||
if (unit->GetEntry() == NPC_CORRUPTED_SOUL_FRAGMENT)
|
||||
{
|
||||
empoweredPrince = unit;
|
||||
|
||||
// Mark corrupted soul fragment with skull if in group and not already marked
|
||||
if (Group* group = bot->GetGroup())
|
||||
{
|
||||
|
||||
@@ -23,7 +23,6 @@ bool AttackSnakeWrapAction::Execute(Event /*event*/)
|
||||
Unit* boss = AI_VALUE2(Unit*, "find target", "slad'ran");
|
||||
if (!boss) { return false; }
|
||||
|
||||
Unit* snakeWrap = nullptr;
|
||||
// Target is not findable from threat table using AI_VALUE2(),
|
||||
// therefore need to search manually for the unit name
|
||||
GuidVector targets = AI_VALUE(GuidVector, "possible targets no los");
|
||||
|
||||
@@ -55,10 +55,6 @@ bool ToCLanceAction::Execute(Event /*event*/)
|
||||
// If we found the lance, equip it
|
||||
if (lanceItem)
|
||||
{
|
||||
// Store the lance's current position
|
||||
uint8 srcBag = lanceItem->GetBagSlot();
|
||||
uint8 srcSlot = lanceItem->GetSlot();
|
||||
|
||||
// First unequip current weapon if it exists
|
||||
if (oldWeapon)
|
||||
bot->SwapItem(oldWeapon->GetPos(), lanceItem->GetPos());
|
||||
|
||||
@@ -399,7 +399,9 @@ bool HighKingMaulgarBanishFelstalkerAction::Execute(Event /*event*/)
|
||||
}
|
||||
}
|
||||
|
||||
if (warlockIndex >= 0 && warlockIndex < felStalkers.size())
|
||||
const int64_t felStalkersSize = felStalkers.size();
|
||||
|
||||
if (warlockIndex >= 0 && warlockIndex < felStalkersSize)
|
||||
{
|
||||
Unit* assignedFelStalker = felStalkers[warlockIndex];
|
||||
if (!botAI->HasAura("banish", assignedFelStalker) && botAI->CanCastSpell("banish", assignedFelStalker))
|
||||
@@ -511,7 +513,6 @@ bool GruulTheDragonkillerTanksPositionBossAction::Execute(Event /*event*/)
|
||||
|
||||
if (distanceToTankPosition > maxDistance)
|
||||
{
|
||||
float step = std::min(maxDistance, distanceToTankPosition);
|
||||
float moveX = bot->GetPositionX() + (dX / distanceToTankPosition) * maxDistance;
|
||||
float moveY = bot->GetPositionY() + (dY / distanceToTankPosition) * maxDistance;
|
||||
const float moveZ = position.GetPositionZ();
|
||||
|
||||
@@ -1034,8 +1034,6 @@ bool IccDbsTankPositionAction::CrowdControlBloodBeasts()
|
||||
NPC_BLOOD_BEAST4};
|
||||
const GuidVector npcs = AI_VALUE(GuidVector, "nearest hostile npcs");
|
||||
|
||||
bool appliedCC = false;
|
||||
|
||||
for (auto const& npc : npcs)
|
||||
{
|
||||
Unit* unit = botAI->GetUnit(npc);
|
||||
@@ -1054,73 +1052,43 @@ bool IccDbsTankPositionAction::CrowdControlBloodBeasts()
|
||||
{
|
||||
case CLASS_MAGE:
|
||||
if (!botAI->HasAura("Frost Nova", unit))
|
||||
{
|
||||
botAI->CastSpell("Frost Nova", unit);
|
||||
appliedCC = true;
|
||||
}
|
||||
break;
|
||||
case CLASS_DRUID:
|
||||
if (!botAI->HasAura("Entangling Roots", unit))
|
||||
{
|
||||
botAI->CastSpell("Entangling Roots", unit);
|
||||
appliedCC = true;
|
||||
}
|
||||
break;
|
||||
case CLASS_PALADIN:
|
||||
if (!botAI->HasAura("Hammer of Justice", unit))
|
||||
{
|
||||
botAI->CastSpell("Hammer of Justice", unit);
|
||||
appliedCC = true;
|
||||
}
|
||||
break;
|
||||
case CLASS_WARRIOR:
|
||||
if (!botAI->HasAura("Hamstring", unit))
|
||||
{
|
||||
botAI->CastSpell("Hamstring", unit);
|
||||
appliedCC = true;
|
||||
}
|
||||
break;
|
||||
case CLASS_HUNTER:
|
||||
if (!botAI->HasAura("Concussive Shot", unit))
|
||||
{
|
||||
botAI->CastSpell("Concussive Shot", unit);
|
||||
appliedCC = true;
|
||||
}
|
||||
break;
|
||||
case CLASS_ROGUE:
|
||||
if (!botAI->HasAura("Kidney Shot", unit))
|
||||
{
|
||||
botAI->CastSpell("Kidney Shot", unit);
|
||||
appliedCC = true;
|
||||
}
|
||||
break;
|
||||
case CLASS_SHAMAN:
|
||||
if (!botAI->HasAura("Frost Shock", unit))
|
||||
{
|
||||
botAI->CastSpell("Frost Shock", unit);
|
||||
appliedCC = true;
|
||||
}
|
||||
break;
|
||||
case CLASS_DEATH_KNIGHT:
|
||||
if (!botAI->HasAura("Chains of Ice", unit))
|
||||
{
|
||||
botAI->CastSpell("Chains of Ice", unit);
|
||||
appliedCC = true;
|
||||
}
|
||||
break;
|
||||
case CLASS_PRIEST:
|
||||
if (!botAI->HasAura("Psychic Scream", unit))
|
||||
{
|
||||
botAI->CastSpell("Psychic Scream", unit);
|
||||
appliedCC = true;
|
||||
}
|
||||
break;
|
||||
case CLASS_WARLOCK:
|
||||
if (!botAI->HasAura("Fear", unit))
|
||||
{
|
||||
botAI->CastSpell("Fear", unit);
|
||||
appliedCC = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -1464,7 +1432,6 @@ int IccFestergutGroupPositionAction::CalculatePositionIndex(Group* group)
|
||||
else
|
||||
{
|
||||
// Fill remaining spots in second row
|
||||
int spotsInFirstRow = 6;
|
||||
int spotsInSecondRow = healerSpotsUsed - 6;
|
||||
int remainingInSecondRow = 6 - spotsInSecondRow;
|
||||
|
||||
@@ -1511,7 +1478,6 @@ int IccFestergutGroupPositionAction::CalculatePositionIndex(Group* group)
|
||||
bool IccFestergutSporeAction::Execute(Event /*event*/)
|
||||
{
|
||||
constexpr float POSITION_TOLERANCE = 4.0f;
|
||||
constexpr float SPREAD_RADIUS = 2.0f;
|
||||
|
||||
// Check if bot has spore
|
||||
bool hasSpore = bot->HasAura(SPELL_GAS_SPORE); // gas spore
|
||||
@@ -1661,7 +1627,7 @@ bool IccRotfaceTankPositionAction::PositionMainTankAndMelee(Unit* boss)
|
||||
{
|
||||
bool isBossCasting = false;
|
||||
if (boss && boss->HasUnitState(UNIT_STATE_CASTING) && boss->GetCurrentSpell(SPELL_SLIME_SPRAY))
|
||||
bool isBossCasting = true;
|
||||
isBossCasting = true;
|
||||
|
||||
if (bot->GetExactDist2d(ICC_ROTFACE_CENTER_POSITION) > 7.0f && botAI->HasAggro(boss) && botAI->IsMainTank(bot))
|
||||
MoveTo(bot->GetMapId(), ICC_ROTFACE_CENTER_POSITION.GetPositionX(),
|
||||
@@ -1829,21 +1795,7 @@ bool IccRotfaceGroupPositionAction::Execute(Event /*event*/)
|
||||
return false;
|
||||
|
||||
const GuidVector npcs = AI_VALUE(GuidVector, "nearest hostile npcs");
|
||||
bool floodPresent = false;
|
||||
|
||||
for (auto const& npc : npcs)
|
||||
{
|
||||
Unit* unit = botAI->GetUnit(npc);
|
||||
if (!unit || !botAI->HasAura("Ooze Flood", unit))
|
||||
continue;
|
||||
|
||||
float puddleDistance = bot->GetExactDist2d(unit);
|
||||
|
||||
if (puddleDistance < 30.0f)
|
||||
floodPresent = true;
|
||||
}
|
||||
|
||||
Unit* bigOoze = AI_VALUE2(Unit*, "find target", "big ooze");
|
||||
bool hasOozeFlood = botAI->HasAura("Ooze Flood", bot);
|
||||
Unit* smallOoze = AI_VALUE2(Unit*, "find target", "little ooze");
|
||||
bool hasMutatedInfection = botAI->HasAura("Mutated Infection", bot);
|
||||
@@ -2014,7 +1966,7 @@ bool IccRotfaceGroupPositionAction::PositionRangedAndHealers(Unit* boss,Unit *sm
|
||||
Difficulty diff = bot->GetRaidDifficulty();
|
||||
bool isBossCasting = false;
|
||||
if (boss && boss->HasUnitState(UNIT_STATE_CASTING) && boss->GetCurrentSpell(SPELL_SLIME_SPRAY))
|
||||
bool isBossCasting = true;
|
||||
isBossCasting = true;
|
||||
|
||||
bool isHeroic = (diff == RAID_DIFFICULTY_10MAN_HEROIC || diff == RAID_DIFFICULTY_25MAN_HEROIC);
|
||||
|
||||
@@ -2070,7 +2022,6 @@ bool IccRotfaceGroupPositionAction::FindAndMoveFromClosestMember(Unit* boss, Uni
|
||||
const float maxMoveDistance = 12.0f; // Limit maximum movement distance
|
||||
const float puddleSafeDistance = 30.0f; // Minimum distance to stay away from puddle
|
||||
const float minCenterDistance = 20.0f; // Minimum distance from center position
|
||||
const bool isRanged = botAI->IsRanged(bot) || botAI->IsHeal(bot);
|
||||
|
||||
// Ranged: spread from other members
|
||||
const GuidVector members = AI_VALUE(GuidVector, "group members");
|
||||
@@ -2233,7 +2184,6 @@ bool IccRotfaceMoveAwayFromExplosionAction::MoveToRandomSafeLocation()
|
||||
// Move in increments of 5.0f towards the calculated position
|
||||
float currentX = bot->GetPositionX();
|
||||
float currentY = bot->GetPositionY();
|
||||
float currentZ = bot->GetPositionZ();
|
||||
|
||||
float directionX = moveX - currentX;
|
||||
float directionY = moveY - currentY;
|
||||
@@ -2276,7 +2226,6 @@ Unit* IccPutricideGrowingOozePuddleAction::FindClosestThreateningPuddle()
|
||||
|
||||
Unit* closestPuddle = nullptr;
|
||||
float closestDistance = FLT_MAX;
|
||||
float closestSafeDistance = BASE_RADIUS;
|
||||
|
||||
for (auto const& npc : npcs)
|
||||
{
|
||||
@@ -2293,7 +2242,6 @@ Unit* IccPutricideGrowingOozePuddleAction::FindClosestThreateningPuddle()
|
||||
if (currentDistance < safeDistance && currentDistance < closestDistance)
|
||||
{
|
||||
closestDistance = currentDistance;
|
||||
closestSafeDistance = safeDistance;
|
||||
closestPuddle = unit;
|
||||
}
|
||||
}
|
||||
@@ -3648,7 +3596,6 @@ bool IccBpcKineticBombAction::Execute(Event /*event*/)
|
||||
|
||||
Unit* IccBpcKineticBombAction::FindOptimalKineticBomb()
|
||||
{
|
||||
static constexpr float MAX_HEIGHT_DIFF = 20.0f;
|
||||
static constexpr std::array<uint32_t, 4> KINETIC_BOMB_ENTRIES = {NPC_KINETIC_BOMB1, NPC_KINETIC_BOMB2,
|
||||
NPC_KINETIC_BOMB3, NPC_KINETIC_BOMB4};
|
||||
|
||||
@@ -4012,7 +3959,6 @@ bool IccBqlGroupPositionAction::HandleShadowsMovement()
|
||||
|
||||
// Find closest safe point by searching in both directions from closest point
|
||||
Position safeMoveTarget = closestPoint;
|
||||
float safeMoveTargetDist = FLT_MAX;
|
||||
bool foundSafe = closestIsSafe;
|
||||
|
||||
// Only search for safe spots if the closest point isn't already safe
|
||||
@@ -4083,7 +4029,6 @@ bool IccBqlGroupPositionAction::HandleShadowsMovement()
|
||||
if (foundSafe)
|
||||
{
|
||||
// If we found a safe point, penalize based on travel distance along the curve to reach it
|
||||
float stepsToCurve = minDist / 2.0f; // Approximate steps to reach the curve
|
||||
float safeDist = bot->GetExactDist2d(safeMoveTarget);
|
||||
|
||||
// Add distance penalty based on how far we need to move along the curve
|
||||
@@ -4364,7 +4309,6 @@ bool IccBqlGroupPositionAction::HandleGroupPosition(Unit* boss, Aura* frenzyAura
|
||||
rangedBots.erase(std::remove(rangedBots.begin(), rangedBots.end(), h), rangedBots.end());
|
||||
|
||||
// Distribute remaining ranged evenly
|
||||
size_t totalRanged = leftSide.size() + rightSide.size() + rangedBots.size();
|
||||
size_t leftCount = leftSide.size();
|
||||
size_t rightCount = rightSide.size();
|
||||
for (Player* p : rangedBots)
|
||||
@@ -5562,7 +5506,6 @@ bool IccValithriaDreamCloudAction::Execute(Event /*event*/)
|
||||
auto it = std::find(dreamBots.begin(), dreamBots.end(), bot);
|
||||
if (it == dreamBots.end())
|
||||
return false;
|
||||
size_t myIndex = std::distance(dreamBots.begin(), it);
|
||||
|
||||
// Check if all dream bots are stacked within 3f of the current leader (lowest guid)
|
||||
constexpr float STACK_RADIUS = 2.0f;
|
||||
@@ -6699,7 +6642,6 @@ bool IccSindragosaFrostBombAction::Execute(Event /*event*/)
|
||||
}
|
||||
}
|
||||
Unit* losTomb = myTombs[bestIdx];
|
||||
ObjectGuid losTombGuid = myTombGuids[bestIdx];
|
||||
|
||||
// Calculate position for LOS (stand at least 6.5f behind the tomb from the bomb)
|
||||
float angle = marker->GetAngle(losTomb);
|
||||
@@ -6782,7 +6724,6 @@ bool IccSindragosaFrostBombAction::Execute(Event /*event*/)
|
||||
// Clear the marker for our group's icon
|
||||
group->SetTargetIcon(iconIndex, bot->GetGUID(), ObjectGuid::Empty);
|
||||
}
|
||||
Unit* boss = AI_VALUE2(Unit*, "find target", "sindragosa");
|
||||
bot->AttackStop();
|
||||
return true;
|
||||
}
|
||||
@@ -7021,10 +6962,7 @@ bool IccLichKingWinterAction::Execute(Event /*event*/)
|
||||
{
|
||||
const ObjectGuid currentSkullTarget = group->GetTargetIcon(7);
|
||||
if (!currentSkullTarget.IsEmpty())
|
||||
{
|
||||
Unit* skullTarget = ObjectAccessor::GetUnit(*bot, currentSkullTarget);
|
||||
group->SetTargetIcon(7, bot->GetGUID(), ObjectGuid::Empty);
|
||||
}
|
||||
}
|
||||
|
||||
if (isVictim)
|
||||
@@ -7802,7 +7740,6 @@ bool IccLichKingAddsAction::Execute(Event /*event*/)
|
||||
//------CHEAT-------
|
||||
}
|
||||
|
||||
Unit* spiritWarden = AI_VALUE2(Unit*, "find target", "spirit warden");
|
||||
bool hasPlague = botAI->HasAura("Necrotic Plague", bot);
|
||||
Unit* terenasMenethilHC = bot->FindNearestCreature(NPC_TERENAS_MENETHIL_HC, 55.0f);
|
||||
|
||||
@@ -8475,8 +8412,6 @@ bool IccLichKingAddsAction::HandleAssistTankAddManagement(Unit* boss, Difficulty
|
||||
// In heroic mode, stay at melee position
|
||||
if (diff && (diff == RAID_DIFFICULTY_10MAN_HEROIC || diff == RAID_DIFFICULTY_25MAN_HEROIC))
|
||||
{
|
||||
Unit* mainTank = AI_VALUE(Unit*, "main tank");
|
||||
|
||||
if (bot->GetExactDist2d(ICC_LICH_KING_ASSISTHC_POSITION.GetPositionX(),
|
||||
ICC_LICH_KING_ASSISTHC_POSITION.GetPositionY()) > 2.0f)
|
||||
{
|
||||
@@ -8713,7 +8648,6 @@ void IccLichKingAddsAction::HandleDefileMechanics(Unit* boss, Difficulty diff)
|
||||
|
||||
// Gather all defile units
|
||||
std::vector<Unit*> defiles;
|
||||
Unit* closestDefile = nullptr;
|
||||
float closestDistance = std::numeric_limits<float>::max();
|
||||
|
||||
GuidVector npcs = AI_VALUE(GuidVector, "nearest hostile npcs");
|
||||
@@ -8725,10 +8659,7 @@ void IccLichKingAddsAction::HandleDefileMechanics(Unit* boss, Difficulty diff)
|
||||
defiles.push_back(unit);
|
||||
float dist = bot->GetDistance(unit);
|
||||
if (dist < closestDistance)
|
||||
{
|
||||
closestDistance = dist;
|
||||
closestDefile = unit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9068,7 +8999,6 @@ void IccLichKingAddsAction::HandleValkyrMarking(const std::vector<Unit*>& grabbi
|
||||
std::sort(sortedValkyrs.begin(), sortedValkyrs.end(), [](Unit* a, Unit* b) { return a->GetGUID() < b->GetGUID(); });
|
||||
|
||||
static constexpr uint8_t ICON_INDICES[] = {7, 6, 0}; // Skull, Cross, Star
|
||||
static constexpr const char* ICON_NAMES[] = {"skull", "cross", "star"};
|
||||
|
||||
// In heroic mode, clean up invalid markers for all possible icons
|
||||
if (diff && (diff == RAID_DIFFICULTY_10MAN_HEROIC || diff == RAID_DIFFICULTY_25MAN_HEROIC))
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
// LK global variables
|
||||
namespace
|
||||
{
|
||||
uint32 g_lastPlagueTime = 0;
|
||||
bool g_plagueAllowedToCure = false;
|
||||
std::map<ObjectGuid, uint32> g_plagueTimes;
|
||||
std::map<ObjectGuid, bool> g_allowCure;
|
||||
std::mutex g_plagueMutex; // Lock before accessing shared variables
|
||||
|
||||
@@ -1102,7 +1102,6 @@ bool IccLichKingShadowTrapTrigger::IsActive()
|
||||
// search for all nearby traps
|
||||
GuidVector npcs = AI_VALUE(GuidVector, "nearest hostile npcs");
|
||||
std::vector<Unit*> nearbyTraps;
|
||||
bool needToMove = false;
|
||||
|
||||
for (auto& npc : npcs)
|
||||
{
|
||||
|
||||
@@ -870,7 +870,6 @@ bool NetherspiteAvoidBeamAndVoidZoneAction::Execute(Event /*event*/)
|
||||
if (!netherspite)
|
||||
return false;
|
||||
|
||||
auto [redBlocker, greenBlocker, blueBlocker] = GetCurrentBeamBlockers(botAI, bot);
|
||||
std::vector<Unit*> voidZones = GetAllVoidZones(botAI, bot);
|
||||
|
||||
bool nearVoidZone = !IsSafePosition(bot->GetPositionX(), bot->GetPositionY(),
|
||||
|
||||
@@ -8,9 +8,6 @@ bool SartharionTankPositionAction::Execute(Event /*event*/)
|
||||
Unit* boss = AI_VALUE2(Unit*, "find target", "sartharion");
|
||||
if (!boss) { return false; }
|
||||
|
||||
// Unit* shadron = AI_VALUE2(Unit*, "find target", "shadron");
|
||||
// Unit* tenebron = AI_VALUE2(Unit*, "find target", "tenebron");
|
||||
// Unit* vesperon = AI_VALUE2(Unit*, "find target", "vesperon");
|
||||
Unit* shadron = nullptr;
|
||||
Unit* tenebron = nullptr;
|
||||
Unit* vesperon = nullptr;
|
||||
@@ -96,9 +93,7 @@ bool AvoidTwilightFissureAction::Execute(Event /*event*/)
|
||||
{
|
||||
float currentDistance = bot->GetDistance2d(unit);
|
||||
if (currentDistance < radius)
|
||||
{
|
||||
return MoveAway(unit, radius - currentDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -127,39 +122,29 @@ bool AvoidFlameTsunamiAction::Execute(Event /*event*/)
|
||||
{
|
||||
bool wavePassed = currentPos.GetPositionX() > unit->GetPositionX();
|
||||
if (wavePassed)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (bot->GetExactDist2d(currentPos.GetPositionX(), TSUNAMI_RIGHT_SAFE_ALL) > looseDistance)
|
||||
{
|
||||
return MoveTo(OS_MAP_ID, currentPos.GetPositionX(), TSUNAMI_RIGHT_SAFE_ALL, currentPos.GetPositionZ(),
|
||||
false, false, false, false, MovementPriority::MOVEMENT_COMBAT);
|
||||
}
|
||||
}
|
||||
else // LEFT WAVE
|
||||
{
|
||||
bool wavePassed = currentPos.GetPositionX() < unit->GetPositionX();
|
||||
if (wavePassed)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (botAI->IsMelee(bot))
|
||||
{
|
||||
if (bot->GetExactDist2d(currentPos.GetPositionX(), TSUNAMI_LEFT_SAFE_MELEE) > looseDistance)
|
||||
{
|
||||
return MoveTo(OS_MAP_ID, currentPos.GetPositionX(), TSUNAMI_LEFT_SAFE_MELEE, currentPos.GetPositionZ(),
|
||||
false, false, false, false, MovementPriority::MOVEMENT_COMBAT);
|
||||
}
|
||||
}
|
||||
else // Ranged/healers
|
||||
{
|
||||
if (bot->GetExactDist2d(currentPos.GetPositionX(), TSUNAMI_LEFT_SAFE_RANGED) > looseDistance)
|
||||
{
|
||||
return MoveTo(OS_MAP_ID, currentPos.GetPositionX(), TSUNAMI_LEFT_SAFE_RANGED, currentPos.GetPositionZ(),
|
||||
false, false, false, false, MovementPriority::MOVEMENT_COMBAT);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -178,30 +163,18 @@ bool SartharionAttackPriorityAction::Execute(Event /*event*/)
|
||||
Unit* target = nullptr;
|
||||
|
||||
if (acolyte)
|
||||
{
|
||||
target = acolyte;
|
||||
}
|
||||
else if (vesperon)
|
||||
{
|
||||
target = vesperon;
|
||||
}
|
||||
else if (tenebron)
|
||||
{
|
||||
target = tenebron;
|
||||
}
|
||||
else if (shadron)
|
||||
{
|
||||
target = shadron;
|
||||
}
|
||||
else if (sartharion)
|
||||
{
|
||||
target = sartharion;
|
||||
}
|
||||
|
||||
if (target && AI_VALUE(Unit*, "current target") != target)
|
||||
{
|
||||
return Attack(target);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -215,9 +188,7 @@ bool EnterTwilightPortalAction::Execute(Event /*event*/)
|
||||
if (!portal) { return false; }
|
||||
|
||||
if (!portal->IsAtInteractDistance(bot))
|
||||
{
|
||||
return MoveTo(portal, fmaxf(portal->GetInteractionDistance() - 1.0f, 0.0f));
|
||||
}
|
||||
|
||||
// Go through portal
|
||||
WorldPacket data1(CMSG_GAMEOBJ_USE);
|
||||
@@ -230,12 +201,11 @@ bool EnterTwilightPortalAction::Execute(Event /*event*/)
|
||||
bool ExitTwilightPortalAction::Execute(Event /*event*/)
|
||||
{
|
||||
GameObject* portal = bot->FindNearestGameObject(GO_NORMAL_PORTAL, 100.0f);
|
||||
if (!portal) { return false; }
|
||||
if (!portal)
|
||||
return false;
|
||||
|
||||
if (!portal->IsAtInteractDistance(bot))
|
||||
{
|
||||
return MoveTo(portal, fmaxf(portal->GetInteractionDistance() - 1.0f, 0.0f));
|
||||
}
|
||||
|
||||
// Go through portal
|
||||
WorldPacket data1(CMSG_GAMEOBJ_USE);
|
||||
|
||||
@@ -72,9 +72,7 @@ bool FlameLeviathanVehicleAction::Execute(Event /*event*/)
|
||||
continue;
|
||||
}
|
||||
if (!target || bot->GetExactDist(target) > bot->GetExactDist(unit))
|
||||
{
|
||||
target = unit;
|
||||
}
|
||||
}
|
||||
// Flame Leviathan is chasing me
|
||||
if (flame && flame->GetVictim() == vehicleBase_)
|
||||
@@ -419,9 +417,7 @@ bool RazorscaleAvoidDevouringFlameAction::Execute(Event /*event*/)
|
||||
RazorscaleBossHelper razorscaleHelper(botAI);
|
||||
|
||||
if (!razorscaleHelper.UpdateBossAI())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isMainTank = botAI->IsMainTank(bot);
|
||||
const float flameRadius = 3.5f;
|
||||
@@ -433,9 +429,7 @@ bool RazorscaleAvoidDevouringFlameAction::Execute(Event /*event*/)
|
||||
// Get the boss
|
||||
Unit* boss = AI_VALUE2(Unit*, "find target", "razorscale");
|
||||
if (!boss)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
GuidVector npcs = AI_VALUE(GuidVector, "nearest hostile npcs");
|
||||
Unit* closestFlame = nullptr;
|
||||
@@ -458,15 +452,12 @@ bool RazorscaleAvoidDevouringFlameAction::Execute(Event /*event*/)
|
||||
|
||||
// Off tanks are following the main tank during grounded and should prioritise stacking
|
||||
if (razorscaleHelper.IsGroundPhase() && (botAI->IsTank(bot) && !botAI->IsMainTank(bot)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Handle movement from flames
|
||||
if (closestDistance < safeDistance)
|
||||
{
|
||||
return MoveAway(closestFlame, safeDistance);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -486,9 +477,7 @@ bool RazorscaleAvoidDevouringFlameAction::isUseful()
|
||||
{
|
||||
float distance = bot->GetDistance2d(unit);
|
||||
if (distance < safeDistance)
|
||||
{
|
||||
return true; // Bot is within the danger distance
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -522,9 +511,7 @@ bool RazorscaleAvoidSentinelAction::Execute(Event /*event*/)
|
||||
|
||||
// Move away if ranged and too close
|
||||
if (isRanged && bot->GetDistance2d(unit) < radius)
|
||||
{
|
||||
movedAway = MoveAway(unit, radius) || movedAway;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -547,9 +534,7 @@ bool RazorscaleAvoidSentinelAction::Execute(Event /*event*/)
|
||||
|
||||
// If there's no skull set yet, or the skull is on a different target, set the sentinel
|
||||
if (!currentSkullTarget || (lowestHealthSentinel->GetGUID() != currentSkullTarget))
|
||||
{
|
||||
group->SetTargetIcon(skullIndex, bot->GetGUID(), lowestHealthSentinel->GetGUID());
|
||||
}
|
||||
}
|
||||
break; // Stop after finding the first valid bot tank
|
||||
}
|
||||
@@ -565,9 +550,7 @@ bool RazorscaleAvoidSentinelAction::Execute(Event /*event*/)
|
||||
|
||||
// If there's no skull set yet, or the skull is on a different target, set the sentinel
|
||||
if (!currentSkullTarget || (lowestHealthSentinel->GetGUID() != currentSkullTarget))
|
||||
{
|
||||
group->SetTargetIcon(skullIndex, bot->GetGUID(), lowestHealthSentinel->GetGUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -582,9 +565,7 @@ bool RazorscaleAvoidSentinelAction::isUseful()
|
||||
|
||||
// If this bot is the main tank, it should always try to mark
|
||||
if (isMainTank)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// If the main tank is a human, check if this bot is one of the first three valid bot tanks
|
||||
if (mainTank && !GET_PLAYERBOT_AI(mainTank)) // Main tank is a human player
|
||||
@@ -592,9 +573,7 @@ bool RazorscaleAvoidSentinelAction::isUseful()
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
if (botAI->IsAssistTankOfIndex(bot, i) && GET_PLAYERBOT_AI(bot)) // Bot is a valid tank
|
||||
{
|
||||
return true; // This bot should assist with marking
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -608,9 +587,7 @@ bool RazorscaleAvoidSentinelAction::isUseful()
|
||||
if (unit && unit->GetEntry() == RazorscaleBossHelper::UNIT_DARK_RUNE_SENTINEL)
|
||||
{
|
||||
if (isRanged && bot->GetDistance2d(unit) < radius)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -633,9 +610,7 @@ bool RazorscaleAvoidWhirlwindAction::Execute(Event /*event*/)
|
||||
{
|
||||
float currentDistance = bot->GetDistance2d(unit);
|
||||
if (currentDistance < radius)
|
||||
{
|
||||
return MoveAway(unit, radius);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -690,23 +665,17 @@ bool RazorscaleIgnoreBossAction::isUseful()
|
||||
}
|
||||
|
||||
if (!botAI->IsTank(bot))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Group* group = bot->GetGroup();
|
||||
if (!group)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if the boss is already set as the moon marker
|
||||
int8 moonIndex = 4; // Moon marker index
|
||||
ObjectGuid currentMoonTarget = group->GetTargetIcon(moonIndex);
|
||||
if (currentMoonTarget == boss->GetGUID())
|
||||
{
|
||||
return false; // Moon marker is already correctly set, no further action needed
|
||||
}
|
||||
|
||||
// Proceed to tank-specific logic
|
||||
Unit* mainTankUnit = AI_VALUE(Unit*, "main tank");
|
||||
@@ -714,9 +683,7 @@ bool RazorscaleIgnoreBossAction::isUseful()
|
||||
|
||||
// If this bot is the main tank, it needs to set the moon marker
|
||||
if (mainTankUnit == bot)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// If the main tank is a human, check if this bot is the lowest-indexed bot tank
|
||||
if (mainTank && !GET_PLAYERBOT_AI(mainTank)) // Main tank is a human player
|
||||
@@ -724,9 +691,7 @@ bool RazorscaleIgnoreBossAction::isUseful()
|
||||
for (int i = 0; i < 3; ++i) // Only iterate through the first 3 indexes
|
||||
{
|
||||
if (botAI->IsAssistTankOfIndex(bot, i) && GET_PLAYERBOT_AI(bot)) // Valid bot tank
|
||||
{
|
||||
return true; // This bot should assign the marker
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1156,9 +1121,7 @@ bool IronAssemblyLightningTendrilsAction::Execute(Event /*event*/)
|
||||
float currentDistance = bot->GetDistance2d(boss);
|
||||
|
||||
if (currentDistance < radius)
|
||||
{
|
||||
return MoveAway(boss, radius - currentDistance);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1180,9 +1143,7 @@ bool IronAssemblyOverloadAction::Execute(Event /*event*/)
|
||||
float currentDistance = bot->GetDistance2d(boss);
|
||||
|
||||
if (currentDistance < radius)
|
||||
{
|
||||
return MoveAway(boss, radius - currentDistance);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1230,7 +1191,6 @@ bool KologarnMarkDpsTargetAction::Execute(Event /*event*/)
|
||||
if (!target)
|
||||
continue;
|
||||
|
||||
uint32 creatureId = target->GetEntry();
|
||||
if (target->GetEntry() == NPC_RUBBLE && target->IsAlive())
|
||||
{
|
||||
targetToMark = target;
|
||||
@@ -1252,21 +1212,15 @@ bool KologarnMarkDpsTargetAction::Execute(Event /*event*/)
|
||||
{
|
||||
Unit* boss = AI_VALUE2(Unit*, "find target", "kologarn");
|
||||
if (boss && boss->IsAlive())
|
||||
{
|
||||
targetToMark = boss;
|
||||
}
|
||||
}
|
||||
|
||||
if (!targetToMark)
|
||||
{
|
||||
return false; // No target to mark
|
||||
}
|
||||
|
||||
Unit* leftArm = AI_VALUE2(Unit*, "find target", "left arm");
|
||||
if (leftArm && leftArm->IsAlive())
|
||||
{
|
||||
targetToCcMark = leftArm;
|
||||
}
|
||||
|
||||
bool isMainTank = botAI->IsMainTank(bot);
|
||||
Unit* mainTankUnit = AI_VALUE(Unit*, "main tank");
|
||||
@@ -1284,13 +1238,10 @@ bool KologarnMarkDpsTargetAction::Execute(Event /*event*/)
|
||||
{
|
||||
group->SetTargetIcon(skullIndex, bot->GetGUID(), targetToMark->GetGUID());
|
||||
if (targetToCcMark)
|
||||
{
|
||||
group->SetTargetIcon(moonIndex, bot->GetGUID(), targetToCcMark->GetGUID());
|
||||
}
|
||||
|
||||
if (additionalTargetToMark)
|
||||
{
|
||||
group->SetTargetIcon(crossIndex, bot->GetGUID(), additionalTargetToMark->GetGUID());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1305,13 +1256,11 @@ bool KologarnMarkDpsTargetAction::Execute(Event /*event*/)
|
||||
{
|
||||
group->SetTargetIcon(skullIndex, bot->GetGUID(), targetToMark->GetGUID());
|
||||
if (targetToCcMark)
|
||||
{
|
||||
group->SetTargetIcon(moonIndex, bot->GetGUID(), targetToCcMark->GetGUID());
|
||||
}
|
||||
|
||||
if (additionalTargetToMark)
|
||||
{
|
||||
group->SetTargetIcon(crossIndex, bot->GetGUID(), additionalTargetToMark->GetGUID());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1326,13 +1275,11 @@ bool KologarnMarkDpsTargetAction::Execute(Event /*event*/)
|
||||
{
|
||||
group->SetTargetIcon(skullIndex, bot->GetGUID(), targetToMark->GetGUID());
|
||||
if (targetToCcMark)
|
||||
{
|
||||
group->SetTargetIcon(moonIndex, bot->GetGUID(), targetToCcMark->GetGUID());
|
||||
}
|
||||
|
||||
if (additionalTargetToMark)
|
||||
{
|
||||
group->SetTargetIcon(crossIndex, bot->GetGUID(), additionalTargetToMark->GetGUID());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
break; // Stop after finding the first valid bot tank
|
||||
@@ -1379,17 +1326,11 @@ bool KologarnEyebeamAction::Execute(Event /*event*/)
|
||||
|
||||
bool runToLeftSide;
|
||||
if (!distanceToLeftPoint)
|
||||
{
|
||||
runToLeftSide = true;
|
||||
}
|
||||
else if (!distanceToRightPoint)
|
||||
{
|
||||
runToLeftSide = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
runToLeftSide = distanceToRightPoint > distanceToLeftPoint;
|
||||
}
|
||||
|
||||
bool teleportedToPoint;
|
||||
KologarnEyebeamTrigger kologarnEyebeamTrigger(botAI);
|
||||
@@ -1418,9 +1359,7 @@ bool KologarnEyebeamAction::isUseful()
|
||||
{
|
||||
KologarnEyebeamTrigger kologarnEyebeamTrigger(botAI);
|
||||
if (!kologarnEyebeamTrigger.IsActive())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return botAI->HasCheat(BotCheatMask::raid);
|
||||
}
|
||||
@@ -1447,9 +1386,7 @@ bool KologarnCrunchArmorAction::isUseful()
|
||||
{
|
||||
KologarnCrunchArmorTrigger kologarnCrunchArmorTrigger(botAI);
|
||||
if (!kologarnCrunchArmorTrigger.IsActive())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return botAI->HasCheat(BotCheatMask::raid);
|
||||
}
|
||||
@@ -1482,15 +1419,11 @@ bool HodirMoveSnowpackedIcicleAction::isUseful()
|
||||
// Check boss and it is alive
|
||||
Unit* boss = AI_VALUE2(Unit*, "find target", "hodir");
|
||||
if (!boss || !boss->IsAlive())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if boss is casting Flash Freeze
|
||||
if (!boss->HasUnitState(UNIT_STATE_CASTING) || !boss->FindCurrentSpellBySpellId(SPELL_FLASH_FREEZE))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Find the nearest Snowpacked Icicle Target
|
||||
Creature* target = bot->FindNearestCreature(NPC_SNOWPACKED_ICICLE, 100.0f);
|
||||
@@ -1499,9 +1432,7 @@ bool HodirMoveSnowpackedIcicleAction::isUseful()
|
||||
|
||||
// Check that bot is stacked on Snowpacked Icicle
|
||||
if (bot->GetDistance2d(target->GetPositionX(), target->GetPositionY()) <= 5.0f)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1612,42 +1543,26 @@ bool FreyaMarkDpsTargetAction::Execute(Event /*event*/)
|
||||
continue;
|
||||
|
||||
if (target->GetEntry() == NPC_EONARS_GIFT)
|
||||
{
|
||||
eonarsGift = target;
|
||||
}
|
||||
else if (target->GetEntry() == NPC_ANCIENT_CONSERVATOR)
|
||||
{
|
||||
ancientConservator = target;
|
||||
}
|
||||
else if (target->GetEntry() == NPC_SNAPLASHER)
|
||||
{
|
||||
snaplasher = target;
|
||||
}
|
||||
else if (target->GetEntry() == NPC_ANCIENT_WATER_SPIRIT)
|
||||
{
|
||||
ancientWaterSpirit = target;
|
||||
}
|
||||
else if (target->GetEntry() == NPC_STORM_LASHER)
|
||||
{
|
||||
stormLasher = target;
|
||||
}
|
||||
else if (target->GetEntry() == NPC_DETONATING_LASHER && !firstDetonatingLasher)
|
||||
{
|
||||
firstDetonatingLasher = target;
|
||||
}
|
||||
}
|
||||
|
||||
// Check that eonars gift is need to be mark
|
||||
if (eonarsGift)
|
||||
{
|
||||
targetToMark = eonarsGift;
|
||||
}
|
||||
|
||||
// Check that ancient conservator is need to be mark
|
||||
if (ancientConservator && !targetToMark)
|
||||
{
|
||||
targetToMark = ancientConservator;
|
||||
}
|
||||
|
||||
// Check that trio of adds is need to be mark
|
||||
if ((snaplasher || ancientWaterSpirit || stormLasher) && !targetToMark)
|
||||
@@ -1679,14 +1594,10 @@ bool FreyaMarkDpsTargetAction::Execute(Event /*event*/)
|
||||
|
||||
// Check that detonating lasher is need to be mark
|
||||
if (firstDetonatingLasher && !targetToMark)
|
||||
{
|
||||
targetToMark = firstDetonatingLasher;
|
||||
}
|
||||
|
||||
if (!targetToMark)
|
||||
{
|
||||
return false; // No target to mark
|
||||
}
|
||||
|
||||
bool isMainTank = botAI->IsMainTank(bot);
|
||||
Unit* mainTankUnit = AI_VALUE(Unit*, "main tank");
|
||||
@@ -1778,9 +1689,7 @@ bool ThorimUnbalancingStrikeAction::isUseful()
|
||||
{
|
||||
ThorimUnbalancingStrikeTrigger thorimUnbalancingStrikeTrigger(botAI);
|
||||
if (!thorimUnbalancingStrikeTrigger.IsActive())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return botAI->HasCheat(BotCheatMask::raid);
|
||||
}
|
||||
@@ -2188,23 +2097,15 @@ bool MimironShockBlastAction::Execute(Event /*event*/)
|
||||
continue;
|
||||
|
||||
if (target->GetEntry() == NPC_LEVIATHAN_MKII)
|
||||
{
|
||||
leviathanMkII = target;
|
||||
}
|
||||
else if (target->GetEntry() == NPC_VX001)
|
||||
{
|
||||
vx001 = target;
|
||||
}
|
||||
else if (target->GetEntry() == NPC_AERIAL_COMMAND_UNIT)
|
||||
{
|
||||
aerialCommandUnit = target;
|
||||
}
|
||||
}
|
||||
|
||||
if (!leviathanMkII)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!vx001 && !aerialCommandUnit)
|
||||
{
|
||||
@@ -2213,9 +2114,8 @@ bool MimironShockBlastAction::Execute(Event /*event*/)
|
||||
MoveAway(leviathanMkII, radius - currentDistance);
|
||||
|
||||
if (botAI->IsMelee(bot))
|
||||
{
|
||||
botAI->SetNextCheckDelay(100);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -2261,15 +2161,11 @@ bool MimironP3Wx2LaserBarrageAction::Execute(Event /*event*/)
|
||||
{
|
||||
auto master = botAI->GetMaster();
|
||||
if (!master || !master->IsAlive())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (bot->GetDistance2d(master) > 15.0f)
|
||||
{
|
||||
return bot->TeleportTo(master->GetMapId(), master->GetPositionX(), master->GetPositionY(),
|
||||
master->GetPositionZ(), master->GetOrientation());
|
||||
}
|
||||
|
||||
return MoveTo(master->GetMapId(), master->GetPositionX(), master->GetPositionY(), master->GetPositionZ(), false,
|
||||
false, false, true, MovementPriority::MOVEMENT_COMBAT, true);
|
||||
@@ -2294,18 +2190,14 @@ bool MimironRapidBurstAction::Execute(Event /*event*/)
|
||||
continue;
|
||||
|
||||
if (target->GetEntry() == NPC_LEVIATHAN_MKII)
|
||||
{
|
||||
leviathanMkII = target;
|
||||
}
|
||||
}
|
||||
|
||||
Position targetPosition;
|
||||
|
||||
Group* group = bot->GetGroup();
|
||||
if (!group)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 memberSpotNumber = 0;
|
||||
for (GroupReference* gref = group->GetFirstMember(); gref; gref = gref->next())
|
||||
@@ -2359,28 +2251,21 @@ bool MimironRapidBurstAction::Execute(Event /*event*/)
|
||||
memberSpotNumber++;
|
||||
|
||||
if (memberSpotNumber == 3)
|
||||
{
|
||||
memberSpotNumber = 0;
|
||||
}
|
||||
}
|
||||
|
||||
MoveTo(bot->GetMapId(), targetPosition.GetPositionX(), targetPosition.GetPositionY(), targetPosition.GetPositionZ(),
|
||||
false, false, false, true, MovementPriority::MOVEMENT_FORCED, true, false);
|
||||
|
||||
if (AI_VALUE(float, "disperse distance") != 0.0f)
|
||||
{
|
||||
SET_AI_VALUE(float, "disperse distance", 0.0f);
|
||||
}
|
||||
|
||||
TankFaceStrategy tankFaceStrategy(botAI);
|
||||
if (botAI->HasStrategy(tankFaceStrategy.getName(), BotState::BOT_STATE_COMBAT))
|
||||
{
|
||||
botAI->ChangeStrategy(REMOVE_STRATEGY_CHAR + tankFaceStrategy.getName(), BotState::BOT_STATE_COMBAT);
|
||||
}
|
||||
|
||||
if (botAI->HasStrategy(tankFaceStrategy.getName(), BotState::BOT_STATE_NON_COMBAT))
|
||||
{
|
||||
botAI->ChangeStrategy(REMOVE_STRATEGY_CHAR + tankFaceStrategy.getName(), BotState::BOT_STATE_NON_COMBAT);
|
||||
}
|
||||
|
||||
if (bot->GetDistance(targetPosition) > 1.0f)
|
||||
return false;
|
||||
@@ -2403,53 +2288,38 @@ bool MimironAerialCommandUnitAction::Execute(Event /*event*/)
|
||||
continue;
|
||||
|
||||
if (target->GetEntry() == NPC_AERIAL_COMMAND_UNIT)
|
||||
{
|
||||
boss = target;
|
||||
}
|
||||
else if (target->GetEntry() == NPC_BOMB_BOT)
|
||||
{
|
||||
bombBot = target;
|
||||
}
|
||||
else if (target->GetEntry() == NPC_ASSAULT_BOT)
|
||||
{
|
||||
assaultBot = target;
|
||||
}
|
||||
}
|
||||
|
||||
if (botAI->IsMainTank(bot) || botAI->IsAssistTankOfIndex(bot, 0))
|
||||
{
|
||||
Group* group = bot->GetGroup();
|
||||
if (!group)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (bombBot)
|
||||
{
|
||||
group->SetTargetIcon(RtiTargetValue::crossIndex, bot->GetGUID(), bombBot->GetGUID());
|
||||
}
|
||||
else if (boss)
|
||||
{
|
||||
group->SetTargetIcon(RtiTargetValue::crossIndex, bot->GetGUID(), boss->GetGUID());
|
||||
}
|
||||
|
||||
if (assaultBot)
|
||||
{
|
||||
ObjectGuid skullTarget = group->GetTargetIcon(RtiTargetValue::skullIndex);
|
||||
Unit* skullUnit = botAI->GetUnit(skullTarget);
|
||||
if (!skullTarget || !skullUnit || !skullUnit->IsAlive())
|
||||
{
|
||||
group->SetTargetIcon(RtiTargetValue::skullIndex, bot->GetGUID(), assaultBot->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (AI_VALUE(float, "disperse distance") != 5.0f)
|
||||
{
|
||||
SET_AI_VALUE(float, "disperse distance", 5.0f);
|
||||
}
|
||||
|
||||
botAI->GetAiObjectContext()->GetValue<std::string>("rti")->Set("cross");
|
||||
return true;
|
||||
}
|
||||
@@ -2476,10 +2346,8 @@ bool MimironRocketStrikeAction::Execute(Event /*event*/)
|
||||
|
||||
if (target->GetEntry() == NPC_LEVIATHAN_MKII)
|
||||
leviathanMkII = target;
|
||||
|
||||
else if (target->GetEntry() == NPC_VX001)
|
||||
vx001 = target;
|
||||
|
||||
else if (target->GetEntry() == NPC_AERIAL_COMMAND_UNIT)
|
||||
aerialCommandUnit = target;
|
||||
}
|
||||
@@ -2536,23 +2404,15 @@ bool MimironPhase4MarkDpsAction::Execute(Event /*event*/)
|
||||
continue;
|
||||
|
||||
if (target->GetEntry() == NPC_LEVIATHAN_MKII)
|
||||
{
|
||||
leviathanMkII = target;
|
||||
}
|
||||
else if (target->GetEntry() == NPC_VX001)
|
||||
{
|
||||
vx001 = target;
|
||||
}
|
||||
else if (target->GetEntry() == NPC_AERIAL_COMMAND_UNIT)
|
||||
{
|
||||
aerialCommandUnit = target;
|
||||
}
|
||||
}
|
||||
|
||||
if (!leviathanMkII || !vx001 || !aerialCommandUnit)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (botAI->IsMainTank(bot))
|
||||
{
|
||||
@@ -2563,31 +2423,27 @@ bool MimironPhase4MarkDpsAction::Execute(Event /*event*/)
|
||||
highestHealth = leviathanMkII->GetHealth();
|
||||
highestHealthUnit = leviathanMkII;
|
||||
}
|
||||
|
||||
if (vx001 && vx001->GetHealth() > highestHealth)
|
||||
{
|
||||
highestHealth = vx001->GetHealth();
|
||||
highestHealthUnit = vx001;
|
||||
}
|
||||
|
||||
if (aerialCommandUnit && aerialCommandUnit->GetHealth() > highestHealth)
|
||||
{
|
||||
highestHealthUnit = aerialCommandUnit;
|
||||
}
|
||||
|
||||
group->SetTargetIcon(RtiTargetValue::skullIndex, bot->GetGUID(), highestHealthUnit->GetGUID());
|
||||
if (highestHealthUnit == leviathanMkII)
|
||||
{
|
||||
if (AI_VALUE(std::string, "rti") == "skull")
|
||||
{
|
||||
botAI->GetAiObjectContext()->GetValue<std::string>("rti")->Set("skull");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
group->SetTargetIcon(RtiTargetValue::crossIndex, bot->GetGUID(), leviathanMkII->GetGUID());
|
||||
if (AI_VALUE(std::string, "rti") != "cross")
|
||||
{
|
||||
botAI->GetAiObjectContext()->GetValue<std::string>("rti")->Set("cross");
|
||||
}
|
||||
}
|
||||
|
||||
botAI->DoSpecificAction("attack rti target");
|
||||
@@ -2614,13 +2470,9 @@ bool MimironCheatAction::Execute(Event /*event*/)
|
||||
continue;
|
||||
|
||||
if (unit->GetEntry() == NPC_PROXIMITY_MINE)
|
||||
{
|
||||
unit->Kill(bot, unit);
|
||||
}
|
||||
else if (unit->GetEntry() == NPC_BOMB_BOT)
|
||||
{
|
||||
unit->Kill(bot, unit);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -2631,9 +2483,7 @@ bool VezaxCheatAction::Execute(Event /*event*/)
|
||||
// Restore bot's mana to full
|
||||
uint32 maxMana = bot->GetMaxPower(POWER_MANA);
|
||||
if (maxMana > 0)
|
||||
{
|
||||
bot->SetPower(POWER_MANA, maxMana);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -2643,9 +2493,7 @@ bool VezaxShadowCrashAction::Execute(Event /*event*/)
|
||||
// Find General Vezax boss
|
||||
Unit* boss = AI_VALUE2(Unit*, "find target", "general vezax");
|
||||
if (!boss || !boss->IsAlive())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get bot's current position relative to boss
|
||||
float bossX = boss->GetPositionX();
|
||||
@@ -2664,9 +2512,7 @@ bool VezaxShadowCrashAction::Execute(Event /*event*/)
|
||||
|
||||
// If too close or too far, adjust distance first
|
||||
if (currentDistance < desiredDistance - 2.0f || currentDistance > desiredDistance + 2.0f)
|
||||
{
|
||||
currentDistance = desiredDistance;
|
||||
}
|
||||
|
||||
// Calculate movement increment - move in increments around the boss
|
||||
float angleIncrement = M_PI / 10;
|
||||
@@ -2696,15 +2542,11 @@ bool YoggSaronOminousCloudCheatAction::Execute(Event /*event*/)
|
||||
|
||||
Unit* boss = yoggSaronTrigger.GetSaraIfAlive();
|
||||
if (!boss)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Creature* target = boss->FindNearestCreature(NPC_OMINOUS_CLOUD, 25.0f);
|
||||
if (!target || !target->IsAlive())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
target->Kill(bot, target);
|
||||
return true;
|
||||
@@ -2730,9 +2572,7 @@ bool YoggSaronMarkTargetAction::Execute(Event /*event*/)
|
||||
{
|
||||
Group* group = bot->GetGroup();
|
||||
if (!group)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
YoggSaronTrigger yoggSaronTrigger(botAI);
|
||||
if (yoggSaronTrigger.IsPhase2())
|
||||
@@ -2741,9 +2581,7 @@ bool YoggSaronMarkTargetAction::Execute(Event /*event*/)
|
||||
{
|
||||
Unit* crusherTentacle = bot->FindNearestCreature(NPC_CRUSHER_TENTACLE, 200.0f, true);
|
||||
if (crusherTentacle)
|
||||
{
|
||||
crusherTentacle->Kill(bot, crusherTentacle);
|
||||
}
|
||||
}
|
||||
|
||||
ObjectGuid currentMoonTarget = group->GetTargetIcon(RtiTargetValue::moonIndex);
|
||||
@@ -2761,9 +2599,7 @@ bool YoggSaronMarkTargetAction::Execute(Event /*event*/)
|
||||
{
|
||||
nextPossibleTarget = bot->FindNearestCreature(NPC_CORRUPTOR_TENTACLE, 200.0f, true);
|
||||
if (!nextPossibleTarget)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentSkullTarget)
|
||||
@@ -2772,9 +2608,7 @@ bool YoggSaronMarkTargetAction::Execute(Event /*event*/)
|
||||
|
||||
if (currentSkullUnit && currentSkullUnit->IsAlive() &&
|
||||
currentSkullUnit->GetGUID() == nextPossibleTarget->GetGUID())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
group->SetTargetIcon(RtiTargetValue::skullIndex, bot->GetGUID(), nextPossibleTarget->GetGUID());
|
||||
@@ -2783,15 +2617,11 @@ bool YoggSaronMarkTargetAction::Execute(Event /*event*/)
|
||||
{
|
||||
TankFaceStrategy tankFaceStrategy(botAI);
|
||||
if (botAI->HasStrategy(tankFaceStrategy.getName(), BotState::BOT_STATE_COMBAT))
|
||||
{
|
||||
botAI->ChangeStrategy(REMOVE_STRATEGY_CHAR + tankFaceStrategy.getName(), BotState::BOT_STATE_COMBAT);
|
||||
}
|
||||
|
||||
TankAssistStrategy tankAssistStrategy(botAI);
|
||||
if (!botAI->HasStrategy(tankAssistStrategy.getName(), BotState::BOT_STATE_COMBAT))
|
||||
{
|
||||
botAI->ChangeStrategy(ADD_STRATEGY_CHAR + tankAssistStrategy.getName(), BotState::BOT_STATE_COMBAT);
|
||||
}
|
||||
|
||||
GuidVector targets = AI_VALUE(GuidVector, "nearest npcs");
|
||||
|
||||
@@ -2801,9 +2631,7 @@ bool YoggSaronMarkTargetAction::Execute(Event /*event*/)
|
||||
{
|
||||
Unit* unit = botAI->GetUnit(guid);
|
||||
if (!unit || !unit->IsAlive())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((unit->GetEntry() == NPC_IMMORTAL_GUARDIAN || unit->GetEntry() == NPC_MARKED_IMMORTAL_GUARDIAN) &&
|
||||
unit->GetHealthPct() > 10)
|
||||
@@ -2821,13 +2649,9 @@ bool YoggSaronMarkTargetAction::Execute(Event /*event*/)
|
||||
// Added because lunatic gaze freeze all bots and they can't attack
|
||||
// If someone fix it then this cheat can be removed
|
||||
if (botAI->HasCheat(BotCheatMask::raid))
|
||||
{
|
||||
lowestHealthUnit->Kill(bot, lowestHealthUnit);
|
||||
}
|
||||
else
|
||||
{
|
||||
group->SetTargetIcon(RtiTargetValue::skullIndex, bot->GetGUID(), lowestHealthUnit->GetGUID());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -2835,9 +2659,7 @@ bool YoggSaronMarkTargetAction::Execute(Event /*event*/)
|
||||
ObjectGuid currentSkullTarget = group->GetTargetIcon(RtiTargetValue::skullIndex);
|
||||
Unit* currentSkullUnit = nullptr;
|
||||
if (currentSkullTarget)
|
||||
{
|
||||
currentSkullUnit = botAI->GetUnit(currentSkullTarget);
|
||||
}
|
||||
|
||||
if (!currentSkullUnit || currentSkullUnit->GetEntry() != NPC_YOGG_SARON)
|
||||
{
|
||||
@@ -2859,17 +2681,13 @@ bool YoggSaronBrainLinkAction::Execute(Event /*event*/)
|
||||
{
|
||||
Group* group = bot->GetGroup();
|
||||
if (!group)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (GroupReference* gref = group->GetFirstMember(); gref; gref = gref->next())
|
||||
{
|
||||
Player* player = gref->GetSource();
|
||||
if (player && player->IsAlive() && player->HasAura(SPELL_BRAIN_LINK) && player->GetGUID() != bot->GetGUID())
|
||||
{
|
||||
return MoveNear(player, 10.0f, MovementPriority::MOVEMENT_FORCED);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -2879,17 +2697,13 @@ bool YoggSaronMoveToEnterPortalAction::Execute(Event /*event*/)
|
||||
{
|
||||
Group* group = bot->GetGroup();
|
||||
if (!group)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isInBrainRoomTeam = false;
|
||||
int portalNumber = 0;
|
||||
int brainRoomTeamCount = 10;
|
||||
if (bot->GetRaidDifficulty() == Difficulty::RAID_DIFFICULTY_10MAN_NORMAL)
|
||||
{
|
||||
brainRoomTeamCount = 4;
|
||||
}
|
||||
|
||||
Player* master = botAI->GetMaster();
|
||||
if (master && !botAI->IsTank(master))
|
||||
@@ -2902,9 +2716,7 @@ bool YoggSaronMoveToEnterPortalAction::Execute(Event /*event*/)
|
||||
{
|
||||
Player* member = gref->GetSource();
|
||||
if (!member || !member->IsAlive() || botAI->IsTank(member) || botAI->GetMaster()->GetGUID() == member->GetGUID())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
portalNumber++;
|
||||
if (member->GetGUID() == bot->GetGUID())
|
||||
@@ -2915,15 +2727,11 @@ bool YoggSaronMoveToEnterPortalAction::Execute(Event /*event*/)
|
||||
|
||||
brainRoomTeamCount--;
|
||||
if (brainRoomTeamCount == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isInBrainRoomTeam)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Position assignedPortalPosition = yoggPortalLoc[portalNumber - 1];
|
||||
|
||||
@@ -2980,33 +2788,24 @@ bool YoggSaronBossRoomMovementCheatAction::Execute(Event /*event*/)
|
||||
{
|
||||
FollowMasterStrategy followMasterStrategy(botAI);
|
||||
if (botAI->HasStrategy(followMasterStrategy.getName(), BotState::BOT_STATE_NON_COMBAT))
|
||||
{
|
||||
botAI->ChangeStrategy(REMOVE_STRATEGY_CHAR + followMasterStrategy.getName(), BotState::BOT_STATE_NON_COMBAT);
|
||||
}
|
||||
|
||||
if (!botAI->HasCheat(BotCheatMask::raid))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Group* group = bot->GetGroup();
|
||||
if (!group)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ObjectGuid currentSkullTarget = group->GetTargetIcon(RtiTargetValue::skullIndex);
|
||||
|
||||
if (!currentSkullTarget)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Unit* currentSkullUnit = botAI->GetUnit(currentSkullTarget);
|
||||
|
||||
if (!currentSkullUnit || !currentSkullUnit->IsAlive())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return bot->TeleportTo(bot->GetMapId(), currentSkullUnit->GetPositionX(), currentSkullUnit->GetPositionY(),
|
||||
currentSkullUnit->GetPositionZ(), bot->GetOrientation());
|
||||
@@ -3014,19 +2813,15 @@ bool YoggSaronBossRoomMovementCheatAction::Execute(Event /*event*/)
|
||||
|
||||
bool YoggSaronUsePortalAction::Execute(Event /*event*/)
|
||||
{
|
||||
Creature* assignedPortal = bot->FindNearestCreature(NPC_DESCEND_INTO_MADNESS, 2.0f, true);
|
||||
if (!assignedPortal)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Creature* assignedPortal = bot->FindNearestCreature(NPC_DESCEND_INTO_MADNESS, 2.0f, true);
|
||||
if (!assignedPortal)
|
||||
return false;
|
||||
|
||||
FollowMasterStrategy followMasterStrategy(botAI);
|
||||
if (botAI->HasStrategy(followMasterStrategy.getName(), BotState::BOT_STATE_NON_COMBAT))
|
||||
{
|
||||
botAI->ChangeStrategy(ADD_STRATEGY_CHAR + followMasterStrategy.getName(), BotState::BOT_STATE_NON_COMBAT);
|
||||
}
|
||||
FollowMasterStrategy followMasterStrategy(botAI);
|
||||
if (botAI->HasStrategy(followMasterStrategy.getName(), BotState::BOT_STATE_NON_COMBAT))
|
||||
botAI->ChangeStrategy(ADD_STRATEGY_CHAR + followMasterStrategy.getName(), BotState::BOT_STATE_NON_COMBAT);
|
||||
|
||||
return assignedPortal->HandleSpellClick(bot);
|
||||
return assignedPortal->HandleSpellClick(bot);
|
||||
}
|
||||
|
||||
bool YoggSaronIllusionRoomAction::Execute(Event /*event*/)
|
||||
@@ -3067,15 +2862,11 @@ bool YoggSaronIllusionRoomAction::SetIllusionRtiTarget(YoggSaronTrigger yoggSaro
|
||||
{
|
||||
Unit* currentRtiTarget = yoggSaronTrigger.GetIllusionRoomRtiTarget();
|
||||
if (currentRtiTarget)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Unit* nextRtiTarget = yoggSaronTrigger.GetNextIllusionRoomRtiTarget();
|
||||
if (!nextRtiTarget)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// If proper adds handling in illusion room will be implemented, then this can be removed
|
||||
if (botAI->HasCheat(BotCheatMask::raid))
|
||||
@@ -3090,9 +2881,7 @@ bool YoggSaronIllusionRoomAction::SetIllusionRtiTarget(YoggSaronTrigger yoggSaro
|
||||
{
|
||||
Group* group = bot->GetGroup();
|
||||
if (!group)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8 rtiIndex = RtiTargetValue::GetRtiIndex(AI_VALUE(std::string, "rti"));
|
||||
group->SetTargetIcon(rtiIndex, bot->GetGUID(), nextRtiTarget->GetGUID());
|
||||
@@ -3104,23 +2893,17 @@ bool YoggSaronIllusionRoomAction::SetIllusionRtiTarget(YoggSaronTrigger yoggSaro
|
||||
bool YoggSaronIllusionRoomAction::SetBrainRtiTarget(YoggSaronTrigger yoggSaronTrigger)
|
||||
{
|
||||
if (AI_VALUE(std::string, "rti") == "square" || !yoggSaronTrigger.IsMasterIsInBrainRoom())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
botAI->GetAiObjectContext()->GetValue<std::string>("rti")->Set("square");
|
||||
|
||||
Group* group = bot->GetGroup();
|
||||
if (!group)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Creature* brain = bot->FindNearestCreature(NPC_BRAIN, 200.0f, true);
|
||||
if (!brain)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
group->SetTargetIcon(RtiTargetValue::squareIndex, bot->GetGUID(), brain->GetGUID());
|
||||
|
||||
@@ -3160,7 +2943,6 @@ bool YoggSaronMoveToExitPortalAction::Execute(Event /*event*/)
|
||||
if (botAI->HasCheat(BotCheatMask::raid))
|
||||
bot->TeleportTo(bot->GetMapId(), portal->GetPositionX(), portal->GetPositionY(), portal->GetPositionZ(),
|
||||
bot->GetOrientation());
|
||||
|
||||
else
|
||||
MoveTo(bot->GetMapId(), portal->GetPositionX(), portal->GetPositionY(), portal->GetPositionZ(), false,
|
||||
false, false, true, MovementPriority::MOVEMENT_FORCED,
|
||||
@@ -3189,9 +2971,7 @@ bool YoggSaronLunaticGazeAction::Execute(Event /*event*/)
|
||||
{
|
||||
if (AI_VALUE(std::string, "rti") != "cross")
|
||||
botAI->GetAiObjectContext()->GetValue<std::string>("rti")->Set("cross");
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -852,8 +852,6 @@ bool ThorimMarkDpsTargetTrigger::IsActive()
|
||||
|
||||
Unit* runicColossus = AI_VALUE2(Unit*, "find target", "runic colossus");
|
||||
Unit* ancientRuneGiant = AI_VALUE2(Unit*, "find target", "ancient rune giant");
|
||||
Unit* ironHonorGuard = AI_VALUE2(Unit*, "find target", "iron ring guard");
|
||||
Unit* ironRingGuard = AI_VALUE2(Unit*, "find target", "iron honor guard");
|
||||
|
||||
if (acolyte && acolyte->IsAlive() && (!currentCrossUnit || currentCrossUnit->GetEntry() != acolyte->GetEntry()))
|
||||
return true;
|
||||
@@ -1179,8 +1177,6 @@ bool MimironPhase1PositioningTrigger::IsActive()
|
||||
}
|
||||
|
||||
Unit* leviathanMkII = nullptr;
|
||||
Unit* vx001 = nullptr;
|
||||
Unit* aerialCommandUnit = nullptr;
|
||||
|
||||
GuidVector targets = AI_VALUE(GuidVector, "possible targets");
|
||||
Unit* target = nullptr;
|
||||
@@ -1192,19 +1188,14 @@ bool MimironPhase1PositioningTrigger::IsActive()
|
||||
|
||||
if (target->GetEntry() == NPC_LEVIATHAN_MKII)
|
||||
leviathanMkII = target;
|
||||
|
||||
else if (target->GetEntry() == NPC_VX001)
|
||||
return false;
|
||||
|
||||
else if (target->GetEntry() == NPC_AERIAL_COMMAND_UNIT)
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
if (!leviathanMkII || !leviathanMkII->IsAlive())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return AI_VALUE(float, "disperse distance") != 6.0f;
|
||||
}
|
||||
@@ -1215,9 +1206,7 @@ bool MimironP3Wx2LaserBarrageTrigger::IsActive()
|
||||
|
||||
// Check boss and it is alive
|
||||
if (!boss || !boss->IsAlive())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isCasting = boss->HasUnitState(UNIT_STATE_CASTING);
|
||||
bool isP3WX2LaserBarrage = boss->FindCurrentSpellBySpellId(SPELL_SPINNING_UP) ||
|
||||
@@ -1230,9 +1219,7 @@ bool MimironP3Wx2LaserBarrageTrigger::IsActive()
|
||||
boss->HasAura(SPELL_P3WX2_LASER_BARRAGE_AURA_1) || boss->HasAura(SPELL_P3WX2_LASER_BARRAGE_AURA_2);
|
||||
|
||||
if ((!isCasting && !hasP3WX2LaserBarrageAura) || !isP3WX2LaserBarrage)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1252,51 +1239,33 @@ bool MimironRapidBurstTrigger::IsActive()
|
||||
continue;
|
||||
|
||||
if (target->GetEntry() == NPC_LEVIATHAN_MKII)
|
||||
{
|
||||
leviathanMkII = target;
|
||||
}
|
||||
else if (target->GetEntry() == NPC_VX001)
|
||||
{
|
||||
vx001 = target;
|
||||
}
|
||||
else if (target->GetEntry() == NPC_AERIAL_COMMAND_UNIT)
|
||||
{
|
||||
aerialCommandUnit = target;
|
||||
}
|
||||
}
|
||||
|
||||
if (!vx001 || !vx001->IsAlive())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (leviathanMkII && leviathanMkII->HasUnitState(UNIT_STATE_CASTING) &&
|
||||
leviathanMkII->FindCurrentSpellBySpellId(SPELL_SHOCK_BLAST))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (botAI->IsMainTank(bot) && leviathanMkII && leviathanMkII->IsAlive() && leviathanMkII->GetVictim() != bot)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (botAI->IsMelee(bot) && !botAI->IsMainTank(bot) && leviathanMkII && aerialCommandUnit)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
MimironP3Wx2LaserBarrageTrigger mimironP3Wx2LaserBarrageTrigger(botAI);
|
||||
if (mimironP3Wx2LaserBarrageTrigger.IsActive())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Group* group = bot->GetGroup();
|
||||
if (!group)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 memberSpotNumber = 0;
|
||||
Position memberPosition;
|
||||
@@ -1355,9 +1324,7 @@ bool MimironRapidBurstTrigger::IsActive()
|
||||
memberSpotNumber++;
|
||||
|
||||
if (memberSpotNumber == 3)
|
||||
{
|
||||
memberSpotNumber = 0;
|
||||
}
|
||||
}
|
||||
|
||||
GuidVector npcs = AI_VALUE(GuidVector, "nearest npcs");
|
||||
@@ -1390,7 +1357,6 @@ bool MimironAerialCommandUnitTrigger::IsActive()
|
||||
Unit* leviathanMkII = nullptr;
|
||||
Unit* vx001 = nullptr;
|
||||
Unit* aerialCommandUnit = nullptr;
|
||||
//Unit* bombBot = nullptr;
|
||||
Unit* assaultBot = nullptr;
|
||||
|
||||
GuidVector targets = AI_VALUE(GuidVector, "possible targets");
|
||||
@@ -1402,69 +1368,41 @@ bool MimironAerialCommandUnitTrigger::IsActive()
|
||||
continue;
|
||||
|
||||
if (target->GetEntry() == NPC_LEVIATHAN_MKII)
|
||||
{
|
||||
leviathanMkII = target;
|
||||
}
|
||||
else if (target->GetEntry() == NPC_VX001)
|
||||
{
|
||||
vx001 = target;
|
||||
}
|
||||
else if (target->GetEntry() == NPC_AERIAL_COMMAND_UNIT)
|
||||
{
|
||||
aerialCommandUnit = target;
|
||||
}
|
||||
//else if (target->GetEntry() == NPC_BOMB_BOT)
|
||||
//{
|
||||
// bombBot = target;
|
||||
//}
|
||||
else if (target->GetEntry() == NPC_ASSAULT_BOT)
|
||||
{
|
||||
assaultBot = target;
|
||||
}
|
||||
}
|
||||
|
||||
if (!aerialCommandUnit || !aerialCommandUnit->IsAlive() || leviathanMkII || vx001)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!botAI->IsRanged(bot) && !botAI->IsMainTank(bot) && !botAI->IsAssistTankOfIndex(bot, 0))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (botAI->IsMainTank(bot) || botAI->IsAssistTankOfIndex(bot, 0))
|
||||
{
|
||||
Group* group = bot->GetGroup();
|
||||
if (!group)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ObjectGuid skullTarget = group->GetTargetIcon(RtiTargetValue::skullIndex);
|
||||
ObjectGuid crossTarget = group->GetTargetIcon(RtiTargetValue::crossIndex);
|
||||
|
||||
//if (bombBot && bombBot->GetGUID() != crossTarget)
|
||||
//{
|
||||
// return true;
|
||||
//}
|
||||
if (!crossTarget || aerialCommandUnit->GetGUID() != crossTarget)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (assaultBot && (!skullTarget || assaultBot->GetGUID() != skullTarget))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string rtiMark = AI_VALUE(std::string, "rti");
|
||||
if (rtiMark != "cross")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1475,16 +1413,12 @@ bool MimironRocketStrikeTrigger::IsActive()
|
||||
|
||||
// Check boss and it is alive
|
||||
if (!boss || !boss->IsAlive())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Creature* rocketStrikeN = bot->FindNearestCreature(NPC_ROCKET_STRIKE_N, 100.0f);
|
||||
|
||||
if (!rocketStrikeN)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return bot->GetDistance2d(rocketStrikeN->GetPositionX(), rocketStrikeN->GetPositionY()) <= 10.0f;
|
||||
}
|
||||
@@ -1497,9 +1431,7 @@ bool MimironPhase4MarkDpsTrigger::IsActive()
|
||||
|
||||
Group* group = bot->GetGroup();
|
||||
if (!group)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
GuidVector targets = AI_VALUE(GuidVector, "possible targets");
|
||||
Unit* target = nullptr;
|
||||
@@ -1510,23 +1442,15 @@ bool MimironPhase4MarkDpsTrigger::IsActive()
|
||||
continue;
|
||||
|
||||
if (target->GetEntry() == NPC_LEVIATHAN_MKII)
|
||||
{
|
||||
leviathanMkII = target;
|
||||
}
|
||||
else if (target->GetEntry() == NPC_VX001)
|
||||
{
|
||||
vx001 = target;
|
||||
}
|
||||
else if (target->GetEntry() == NPC_AERIAL_COMMAND_UNIT)
|
||||
{
|
||||
aerialCommandUnit = target;
|
||||
}
|
||||
}
|
||||
|
||||
if (!leviathanMkII || !vx001 || !aerialCommandUnit)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (botAI->IsMainTank(bot))
|
||||
{
|
||||
@@ -1544,22 +1468,16 @@ bool MimironPhase4MarkDpsTrigger::IsActive()
|
||||
highestHealthUnit = vx001;
|
||||
}
|
||||
if (aerialCommandUnit && aerialCommandUnit->GetHealth() > highestHealth)
|
||||
{
|
||||
highestHealthUnit = aerialCommandUnit;
|
||||
}
|
||||
|
||||
ObjectGuid skullTarget = group->GetTargetIcon(RtiTargetValue::skullIndex);
|
||||
if (!skullTarget)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return highestHealthUnit->GetGUID() != skullTarget;
|
||||
}
|
||||
else
|
||||
{
|
||||
return AI_VALUE(std::string, "rti") != "skull";
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1567,14 +1485,10 @@ bool MimironPhase4MarkDpsTrigger::IsActive()
|
||||
bool MimironCheatTrigger::IsActive()
|
||||
{
|
||||
if (!botAI->HasCheat(BotCheatMask::raid))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!botAI->IsMainTank(bot))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
GuidVector targets = AI_VALUE(GuidVector, "nearest npcs");
|
||||
for (const ObjectGuid& guid : targets)
|
||||
@@ -1584,13 +1498,9 @@ bool MimironCheatTrigger::IsActive()
|
||||
continue;
|
||||
|
||||
if (unit->GetEntry() == NPC_PROXIMITY_MINE)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (unit->GetEntry() == NPC_BOMB_BOT)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -1599,22 +1509,16 @@ bool MimironCheatTrigger::IsActive()
|
||||
bool VezaxCheatTrigger::IsActive()
|
||||
{
|
||||
if (!botAI->HasCheat(BotCheatMask::raid))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Unit* boss = AI_VALUE2(Unit*, "find target", "general vezax");
|
||||
|
||||
// Check boss and it is alive
|
||||
if (!boss || !boss->IsAlive())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!AI_VALUE2(bool, "has mana", "self target"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return AI_VALUE2(uint8, "mana", "self target") < sPlayerbotAIConfig.lowMana;
|
||||
}
|
||||
@@ -1625,9 +1529,7 @@ bool VezaxShadowCrashTrigger::IsActive()
|
||||
|
||||
// Check boss and it is alive
|
||||
if (!boss || !boss->IsAlive())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return botAI->HasAura(SPELL_VEZAX_SHADOW_CRASH, bot);
|
||||
}
|
||||
@@ -1638,14 +1540,10 @@ bool VezaxMarkOfTheFacelessTrigger::IsActive()
|
||||
|
||||
// Check boss and it is alive
|
||||
if (!boss || !boss->IsAlive())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!botAI->HasAura(SPELL_MARK_OF_THE_FACELESS, bot))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
float distance = bot->GetDistance2d(ULDUAR_VEZAX_MARK_OF_THE_FACELESS_SPOT.GetPositionX(),
|
||||
ULDUAR_VEZAX_MARK_OF_THE_FACELESS_SPOT.GetPositionY());
|
||||
@@ -1657,9 +1555,8 @@ Unit* YoggSaronTrigger::GetSaraIfAlive()
|
||||
{
|
||||
Unit* sara = AI_VALUE2(Unit*, "find target", "sara");
|
||||
if (!sara || !sara->IsAlive())
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return sara;
|
||||
}
|
||||
|
||||
@@ -1689,9 +1586,7 @@ bool YoggSaronTrigger::IsYoggSaronFight()
|
||||
Unit* yoggsaron = AI_VALUE2(Unit*, "find target", "yogg-saron");
|
||||
|
||||
if ((sara && sara->IsAlive()) || (yoggsaron && yoggsaron->IsAlive()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1699,24 +1594,16 @@ bool YoggSaronTrigger::IsYoggSaronFight()
|
||||
bool YoggSaronTrigger::IsInIllusionRoom()
|
||||
{
|
||||
if (!IsInBrainLevel())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (IsInStormwindKeeperIllusion())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (IsInIcecrownKeeperIllusion())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (IsInChamberOfTheAspectsIllusion())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1753,9 +1640,7 @@ bool YoggSaronTrigger::IsMasterIsInBrainRoom()
|
||||
Player* master = botAI->GetMaster();
|
||||
|
||||
if (!master)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return master->GetDistance2d(ULDUAR_YOGG_SARON_BRAIN_ROOM_MIDDLE.GetPositionX(),
|
||||
ULDUAR_YOGG_SARON_BRAIN_ROOM_MIDDLE.GetPositionY()) <
|
||||
@@ -1766,43 +1651,29 @@ bool YoggSaronTrigger::IsMasterIsInBrainRoom()
|
||||
Position YoggSaronTrigger::GetIllusionRoomEntrancePosition()
|
||||
{
|
||||
if (IsInChamberOfTheAspectsIllusion())
|
||||
{
|
||||
return ULDUAR_YOGG_SARON_CHAMBER_OF_ASPECTS_ENTRANCE;
|
||||
}
|
||||
else if (IsInIcecrownKeeperIllusion())
|
||||
{
|
||||
return ULDUAR_YOGG_SARON_ICECROWN_CITADEL_ENTRANCE;
|
||||
}
|
||||
else if (IsInStormwindKeeperIllusion())
|
||||
{
|
||||
return ULDUAR_YOGG_SARON_STORMWIND_KEEPER_ENTRANCE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Position();
|
||||
}
|
||||
}
|
||||
|
||||
Unit* YoggSaronTrigger::GetIllusionRoomRtiTarget()
|
||||
{
|
||||
Group* group = bot->GetGroup();
|
||||
if (!group)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int32_t rtiIndex = RtiTargetValue::GetRtiIndex(AI_VALUE(std::string, "rti"));
|
||||
if (rtiIndex == -1)
|
||||
{
|
||||
return nullptr; // Invalid RTI mark
|
||||
}
|
||||
|
||||
ObjectGuid currentRtiTarget = group->GetTargetIcon(rtiIndex);
|
||||
Unit* currentRtiTargetUnit = botAI->GetUnit(currentRtiTarget);
|
||||
if (!currentRtiTargetUnit || !currentRtiTargetUnit->IsAlive())
|
||||
{
|
||||
currentRtiTargetUnit = nullptr;
|
||||
}
|
||||
|
||||
return currentRtiTargetUnit;
|
||||
}
|
||||
@@ -1812,13 +1683,10 @@ Unit* YoggSaronTrigger::GetNextIllusionRoomRtiTarget()
|
||||
float detectionRadius = 0.0f;
|
||||
if (IsInStormwindKeeperIllusion())
|
||||
detectionRadius = ULDUAR_YOGG_SARON_STORMWIND_KEEPER_RADIUS;
|
||||
|
||||
else if (IsInIcecrownKeeperIllusion())
|
||||
detectionRadius = ULDUAR_YOGG_SARON_ICECROWN_CITADEL_RADIUS;
|
||||
|
||||
else if (IsInChamberOfTheAspectsIllusion())
|
||||
detectionRadius = ULDUAR_YOGG_SARON_CHAMBER_OF_ASPECTS_RADIUS;
|
||||
|
||||
else
|
||||
return nullptr;
|
||||
|
||||
@@ -1855,9 +1723,7 @@ Unit* YoggSaronTrigger::GetNextIllusionRoomRtiTarget()
|
||||
}
|
||||
|
||||
if (nextIllusionRoomRtiTarget)
|
||||
{
|
||||
return nextIllusionRoomRtiTarget;
|
||||
}
|
||||
|
||||
if (IsInStormwindKeeperIllusion())
|
||||
{
|
||||
@@ -1969,9 +1835,7 @@ bool YoggSaronMarkTargetTrigger::IsActive()
|
||||
ObjectGuid currentMoonTarget = group->GetTargetIcon(RtiTargetValue::moonIndex);
|
||||
Creature* yogg_saron = bot->FindNearestCreature(NPC_YOGG_SARON, 200.0f, true);
|
||||
if (!currentMoonTarget || currentMoonTarget != yogg_saron->GetGUID())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
ObjectGuid currentSkullTarget = group->GetTargetIcon(RtiTargetValue::skullIndex);
|
||||
|
||||
@@ -2234,9 +2098,7 @@ bool YoggSaronPhase3PositioningTrigger::IsActive()
|
||||
|
||||
if (botAI->IsRanged(bot) && bot->GetDistance2d(ULDUAR_YOGG_SARON_PHASE_3_RANGED_SPOT.GetPositionX(),
|
||||
ULDUAR_YOGG_SARON_PHASE_3_RANGED_SPOT.GetPositionY()) > 15.0f)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (botAI->IsMelee(bot) && !botAI->IsTank(bot) &&
|
||||
bot->GetDistance2d(ULDUAR_YOGG_SARON_PHASE_3_MELEE_SPOT.GetPositionX(),
|
||||
|
||||
@@ -435,7 +435,6 @@ bool NewRpgTravelFlightAction::Execute(Event /*event*/)
|
||||
botAI->rpgInfo.ChangeToIdle();
|
||||
return true;
|
||||
}
|
||||
const TaxiNodesEntry* entry = sTaxiNodesStore.LookupEntry(data.toNode);
|
||||
if (bot->GetDistance(flightMaster) > INTERACTION_DISTANCE)
|
||||
return MoveFarTo(flightMaster);
|
||||
|
||||
|
||||
@@ -360,7 +360,6 @@ bool NewRpgBaseAction::IsWithinInteractionDist(Object* questGiver)
|
||||
case TYPEID_GAMEOBJECT:
|
||||
{
|
||||
ObjectGuid guid = questGiver->GetGUID();
|
||||
GameobjectTypes type = GAMEOBJECT_TYPE_QUESTGIVER;
|
||||
if (GameObject* go = bot->GetMap()->GetGameObject(guid))
|
||||
{
|
||||
if (go->IsWithinDistInMap(bot))
|
||||
@@ -546,7 +545,9 @@ bool NewRpgBaseAction::OrganizeQuestLog()
|
||||
continue;
|
||||
|
||||
const Quest* quest = sObjectMgr->GetQuestTemplate(questId);
|
||||
if (quest->GetZoneOrSort() < 0 || (quest->GetZoneOrSort() > 0 && quest->GetZoneOrSort() != bot->GetZoneId()))
|
||||
const int64_t botZoneId = this->bot->GetZoneId();
|
||||
|
||||
if (quest->GetZoneOrSort() < 0 || (quest->GetZoneOrSort() > 0 && quest->GetZoneOrSort() != botZoneId))
|
||||
{
|
||||
LOG_DEBUG("playerbots", "[New RPG] {} drop quest {}", bot->GetName(), questId);
|
||||
WorldPacket packet(CMSG_QUESTLOG_REMOVE_QUEST);
|
||||
|
||||
@@ -60,7 +60,10 @@ void NewRpgInfo::ChangeToIdle()
|
||||
data = Idle{};
|
||||
}
|
||||
|
||||
bool NewRpgInfo::CanChangeTo(NewRpgStatus status) { return true; }
|
||||
bool NewRpgInfo::CanChangeTo(NewRpgStatus)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void NewRpgInfo::Reset()
|
||||
{
|
||||
|
||||
@@ -948,8 +948,6 @@ void PlayerbotFactory::InitPet()
|
||||
continue;
|
||||
if (co->Name.size() > 21)
|
||||
continue;
|
||||
uint32 guid = map->GenerateLowGuid<HighGuid::Pet>();
|
||||
uint32 pet_number = sObjectMgr->GeneratePetNumber();
|
||||
if (bot->GetPetStable() && bot->GetPetStable()->CurrentPet)
|
||||
{
|
||||
auto petGuid = bot->GetPetStable()->CurrentPet.value(); // To correct the build warnin in VS
|
||||
@@ -1905,7 +1903,7 @@ void PlayerbotFactory::InitEquipment(bool incremental, bool second_chance)
|
||||
if (oldItem)
|
||||
continue;
|
||||
|
||||
Item* newItem = bot->EquipNewItem(dest, bestItemForSlot, true);
|
||||
bot->EquipNewItem(dest, bestItemForSlot, true);
|
||||
bot->AutoUnequipOffhandIfNeed();
|
||||
// if (newItem)
|
||||
// {
|
||||
@@ -1936,7 +1934,7 @@ void PlayerbotFactory::InitEquipment(bool incremental, bool second_chance)
|
||||
(slot != EQUIPMENT_SLOT_RANGED))
|
||||
continue;
|
||||
|
||||
if (Item* oldItem = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
|
||||
if (bot->GetItemByPos(INVENTORY_SLOT_BAG_0, slot) != nullptr)
|
||||
bot->DestroyItem(INVENTORY_SLOT_BAG_0, slot, true);
|
||||
|
||||
std::vector<uint32>& ids = items[slot];
|
||||
@@ -1973,12 +1971,9 @@ void PlayerbotFactory::InitEquipment(bool incremental, bool second_chance)
|
||||
continue;
|
||||
|
||||
Item* newItem = bot->EquipNewItem(dest, bestItemForSlot, true);
|
||||
|
||||
bot->EquipNewItem(dest, bestItemForSlot, true);
|
||||
bot->AutoUnequipOffhandIfNeed();
|
||||
// if (newItem)
|
||||
// {
|
||||
// newItem->AddToWorld();
|
||||
// newItem->AddToUpdateQueueOf(bot);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1991,16 +1986,10 @@ bool PlayerbotFactory::IsDesiredReplacement(Item* item)
|
||||
ItemTemplate const* proto = item->GetTemplate();
|
||||
uint32 requiredLevel = proto->RequiredLevel;
|
||||
if (!requiredLevel)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// if (!requiredLevel)
|
||||
// {
|
||||
// requiredLevel = sRandomItemMgr.GetMinLevelFromCache(proto->ItemId);
|
||||
// }
|
||||
|
||||
uint32 delta = 1 + (80 - bot->GetLevel()) / 10;
|
||||
return proto->Quality < ITEM_QUALITY_RARE || int32(bot->GetLevel() - requiredLevel) > delta;
|
||||
return proto->Quality < ITEM_QUALITY_RARE || (bot->GetLevel() - requiredLevel) > delta;
|
||||
}
|
||||
|
||||
inline Item* StoreNewItemInInventorySlot(Player* player, uint32 newItemId, uint32 count)
|
||||
@@ -2010,9 +1999,7 @@ inline Item* StoreNewItemInInventorySlot(Player* player, uint32 newItemId, uint3
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
{
|
||||
if (Item* newItem = player->StoreNewItem(vDest, newItemId, true, Item::GenerateItemRandomPropertyId(newItemId)))
|
||||
{
|
||||
return newItem;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
@@ -2875,7 +2862,6 @@ void PlayerbotFactory::AddPrevQuests(uint32 questId, std::list<uint32>& questIds
|
||||
|
||||
void PlayerbotFactory::InitQuests(std::list<uint32>& questMap, bool withRewardItem)
|
||||
{
|
||||
uint32 count = 0;
|
||||
for (std::list<uint32>::iterator i = questMap.begin(); i != questMap.end(); ++i)
|
||||
{
|
||||
uint32 questId = *i;
|
||||
@@ -3280,7 +3266,6 @@ void PlayerbotFactory::InitFood()
|
||||
|
||||
void PlayerbotFactory::InitReagents()
|
||||
{
|
||||
int specTab = AiFactory::GetPlayerSpecTab(bot);
|
||||
std::vector<std::pair<uint32, uint32>> items;
|
||||
switch (bot->getClass())
|
||||
{
|
||||
@@ -4336,15 +4321,11 @@ void PlayerbotFactory::ApplyEnchantAndGemsNew(bool destroyOld)
|
||||
continue;
|
||||
|
||||
if (!item->IsFitToSpellRequirements(spellInfo))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
uint32 requiredLevel = spellInfo->BaseLevel;
|
||||
if (requiredLevel > bot->GetLevel())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// disable next expansion enchantments
|
||||
if (sPlayerbotAIConfig.limitEnchantExpansion && bot->GetLevel() <= 60 && enchantSpell >= 27899)
|
||||
@@ -4364,9 +4345,8 @@ void PlayerbotFactory::ApplyEnchantAndGemsNew(bool destroyOld)
|
||||
|
||||
SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
|
||||
if (!enchant || (enchant->slot != PERM_ENCHANTMENT_SLOT && enchant->slot != TEMP_ENCHANTMENT_SLOT))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (enchant->requiredSkill &&
|
||||
(!bot->HasSkill(enchant->requiredSkill) ||
|
||||
(bot->GetSkillValue(enchant->requiredSkill) < enchant->requiredSkillValue)))
|
||||
@@ -4374,9 +4354,8 @@ void PlayerbotFactory::ApplyEnchantAndGemsNew(bool destroyOld)
|
||||
continue;
|
||||
}
|
||||
if (enchant->requiredLevel > bot->GetLevel())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
float score = calculator.CalculateEnchant(enchant_id);
|
||||
if (score >= bestScore)
|
||||
{
|
||||
@@ -4399,11 +4378,9 @@ void PlayerbotFactory::ApplyEnchantAndGemsNew(bool destroyOld)
|
||||
{
|
||||
uint8 socketColor = item->GetTemplate()->Socket[enchant_slot - SOCK_ENCHANTMENT_SLOT].Color;
|
||||
if (!socketColor)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int32 enchantIdChosen = -1;
|
||||
int32 colorChosen;
|
||||
bool jewelersGemChosen;
|
||||
float bestGemScore = -1;
|
||||
for (uint32& enchantGem : availableGems)
|
||||
@@ -4448,7 +4425,6 @@ void PlayerbotFactory::ApplyEnchantAndGemsNew(bool destroyOld)
|
||||
if (score > bestGemScore)
|
||||
{
|
||||
enchantIdChosen = enchant_id;
|
||||
colorChosen = gemProperties->color;
|
||||
bestGemScore = score;
|
||||
jewelersGemChosen = isJewelersGem;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,6 @@ class PlayerbotLoginQueryHolder : public LoginQueryHolder
|
||||
{
|
||||
private:
|
||||
uint32 masterAccountId;
|
||||
PlayerbotHolder* playerbotHolder;
|
||||
public:
|
||||
PlayerbotLoginQueryHolder(uint32 masterAccount, uint32 accountId, ObjectGuid guid)
|
||||
: LoginQueryHolder(accountId, guid), masterAccountId(masterAccount)
|
||||
|
||||
@@ -994,7 +994,7 @@ void RandomPlayerbotMgr::CheckBgQueue()
|
||||
|
||||
// Arena logic
|
||||
bool isRated = false;
|
||||
if (uint8 arenaType = BattlegroundMgr::BGArenaType(queueTypeId))
|
||||
if (BattlegroundMgr::BGArenaType(queueTypeId))
|
||||
{
|
||||
BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(queueTypeId);
|
||||
GroupQueueInfo ginfo;
|
||||
@@ -1081,7 +1081,7 @@ void RandomPlayerbotMgr::CheckBgQueue()
|
||||
BattlegroundData[queueTypeId][bracketId].minLevel = pvpDiff->minLevel;
|
||||
BattlegroundData[queueTypeId][bracketId].maxLevel = pvpDiff->maxLevel;
|
||||
|
||||
if (uint8 arenaType = BattlegroundMgr::BGArenaType(queueTypeId))
|
||||
if (BattlegroundMgr::BGArenaType(queueTypeId))
|
||||
{
|
||||
bool isRated = false;
|
||||
BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(queueTypeId);
|
||||
@@ -1986,13 +1986,9 @@ void RandomPlayerbotMgr::PrepareTeleportCache()
|
||||
for (int i = bracket.low; i <= bracket.high; i++)
|
||||
{
|
||||
if (forHorde)
|
||||
{
|
||||
hordeStarterPerLevelCache[i].push_back(loc);
|
||||
}
|
||||
if (forAlliance)
|
||||
{
|
||||
allianceStarterPerLevelCache[i].push_back(loc);
|
||||
}
|
||||
}
|
||||
|
||||
} while (results->NextRow());
|
||||
@@ -3146,10 +3142,10 @@ void RandomPlayerbotMgr::PrintStats()
|
||||
uint32 heal = 0;
|
||||
uint32 tank = 0;
|
||||
uint32 active = 0;
|
||||
uint32 update = 0;
|
||||
/* uint32 update = 0;
|
||||
uint32 randomize = 0;
|
||||
uint32 teleport = 0;
|
||||
uint32 changeStrategy = 0;
|
||||
uint32 changeStrategy = 0;*/
|
||||
uint32 dead = 0;
|
||||
uint32 combat = 0;
|
||||
// uint32 revive = 0; //not used, line marked for removal.
|
||||
@@ -3189,7 +3185,7 @@ void RandomPlayerbotMgr::PrintStats()
|
||||
|
||||
if (botAI->AllowActivity())
|
||||
++active;
|
||||
|
||||
/* TODO: Review statistics on rpg merge
|
||||
if (botAI->GetAiObjectContext()->GetValue<bool>("random bot update")->Get())
|
||||
++update;
|
||||
|
||||
@@ -3202,7 +3198,7 @@ void RandomPlayerbotMgr::PrintStats()
|
||||
|
||||
if (!GetEventValue(botId, "change_strategy"))
|
||||
++changeStrategy;
|
||||
|
||||
*/
|
||||
if (bot->isDead())
|
||||
{
|
||||
++dead;
|
||||
|
||||
@@ -1832,7 +1832,6 @@ std::vector<uint32> RandomItemMgr::GetUpgradeList(Player* player, std::string sp
|
||||
// get old item statWeight
|
||||
uint32 oldStatWeight = 0;
|
||||
uint32 specId = 0;
|
||||
uint32 closestUpgrade = 0;
|
||||
uint32 closestUpgradeWeight = 0;
|
||||
std::vector<uint32> classspecs;
|
||||
|
||||
@@ -1933,7 +1932,6 @@ std::vector<uint32> RandomItemMgr::GetUpgradeList(Player* player, std::string sp
|
||||
// pick closest upgrade
|
||||
if (info.weights[specId] > closestUpgradeWeight)
|
||||
{
|
||||
closestUpgrade = info.itemId;
|
||||
closestUpgradeWeight = info.weights[specId];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user