From bc3dec3429be161212d6707c9b26c39d2f9252e1 Mon Sep 17 00:00:00 2001 From: trickerer Date: Wed, 20 Mar 2024 08:08:41 +0700 Subject: [PATCH] NPCBots: Add AoE evasion logic for `Shirrak the Dead Watcher` (Auchenai Crypts) --- src/server/game/AI/NpcBots/bot_ai.cpp | 17 +++++++++++++++++ src/server/game/AI/NpcBots/botcommon.h | 2 ++ .../boss_shirrak_the_dead_watcher.cpp | 7 +++++++ 3 files changed, 26 insertions(+) diff --git a/src/server/game/AI/NpcBots/bot_ai.cpp b/src/server/game/AI/NpcBots/bot_ai.cpp index 7ef996bf71281..0992d62feaa0c 100644 --- a/src/server/game/AI/NpcBots/bot_ai.cpp +++ b/src/server/game/AI/NpcBots/bot_ai.cpp @@ -4990,6 +4990,23 @@ void bot_ai::CalculateAoeSpots(Unit const* unit, AoeSpotsVec& spots) //Additional: aoe coming from spawned npcs + //Aucheai Crypts + else if (unit->GetMapId() == 558) + { + Creature* creature = nullptr; + static const auto focus_fire_check = [](Creature const* c) { + return (c->GetEntry() == CREATURE_FOCUS_FIRE_N || c->GetEntry() == CREATURE_FOCUS_FIRE_H); + }; + Trinity::CreatureSearcher searcher2(unit, creature, focus_fire_check); + Cell::VisitAllObjects(unit, searcher2, 50.f); + + if (creature) + { + spellInfo = sSpellMgr->GetSpellInfo(32302); //Fiery Blast + float radius = spellInfo->_effects[0].CalcRadius() + DEFAULT_PLAYER_COMBAT_REACH * 2.0f; + spots.push_back(AoeSpotsVec::value_type(*creature, radius)); + } + } //The Eye of Eternity if (unit->GetMapId() == 616 && unit->GetVehicle()) { diff --git a/src/server/game/AI/NpcBots/botcommon.h b/src/server/game/AI/NpcBots/botcommon.h index 8fb711f8af81f..8ef1b46f65c00 100644 --- a/src/server/game/AI/NpcBots/botcommon.h +++ b/src/server/game/AI/NpcBots/botcommon.h @@ -85,6 +85,8 @@ enum BotCommonValues CREATURE_ICC_MUTATED_ABOMINATION7 = 38786, CREATURE_ICC_MUTATED_ABOMINATION8 = 38787, //COMMON AOE TRIGGERS + CREATURE_FOCUS_FIRE_N = 18374, + CREATURE_FOCUS_FIRE_H = 20308, CREATURE_ZA_FIRE_BOMB = 23920, CREATURE_UK_SHADOW_AXE_N = 23997, CREATURE_UK_SHADOW_AXE_H = 31835, diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp index 14458a22ce076..20ca16a775e4c 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp @@ -141,7 +141,14 @@ struct boss_shirrak_the_dead_watcher : public BossAI { // Summon Focus Fire & Emote Unit* target = SelectTarget(SelectTargetMethod::Random, 1); + //npcbot + /* + //end npcbot if (target && target->GetTypeId() == TYPEID_PLAYER && target->IsAlive()) + //npcbot + */ + if (target && target->IsAlive()) + //end npcbot { FocusedTargetGUID = target->GetGUID(); me->SummonCreature(NPC_FOCUS_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 5500ms);