diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 20 | ||||
-rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedCreature.h | 2 | ||||
-rw-r--r-- | src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp | 2 |
3 files changed, 18 insertions, 6 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 1076b7dd4e4..eb0765e6e19 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -517,14 +517,26 @@ void BossAI::TeleportCheaters() } } -void BossAI::ForceStopCombatForCreature(uint32 entry, float maxSearchRange /*= 250.0f*/) +void BossAI::ForceCombatStopForCreatureEntry(uint32 entry, float maxSearchRange /*= 250.0f*/, bool reset /*= true*/) { - TC_LOG_WARN("scripts.ai", "BossAI::ForceStopCombatForCreature: called on '%s' with creature entry '%u'. This should be fixed in another way than calling this function. Debug info: %s", me->GetName().c_str(), entry, me->GetDebugInfo().c_str()); + TC_LOG_DEBUG("scripts.ai", "BossAI::ForceCombatStopForCreatureEntry: called on '%s'. Debug info: %s", me->GetGUID().ToString().c_str(), me->GetDebugInfo().c_str()); + std::list<Creature*> creatures; me->GetCreatureListWithEntryInGrid(creatures, entry, maxSearchRange); - for (Creature* creature : creatures) - creature->CombatStop(); + for (Creature* creature : creatures) { + creature->CombatStop(true); + creature->DoNotReacquireSpellFocusTarget(); + creature->GetMotionMaster()->Clear(MOTION_PRIORITY_NORMAL); + + if (reset) { + creature->LoadCreaturesAddon(); + creature->SetLootRecipient(nullptr); + creature->ResetPlayerDamageReq(); + creature->SetLastDamagedTime(0); + creature->SetCannotReachTarget(false); + } + } } void BossAI::JustSummoned(Creature* summon) diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index 67fe9da29f3..408ee9ac373 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -336,7 +336,7 @@ class TC_GAME_API BossAI : public ScriptedAI void TeleportCheaters(); - void ForceStopCombatForCreature(uint32 entry, float maxSearchRange = 250.0f); + void ForceCombatStopForCreatureEntry(uint32 entry, float maxSearchRange = 250.0f, bool reset = true); EventMap events; SummonList summons; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp index 58c7ab39f8a..6f5b72af353 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp @@ -151,7 +151,7 @@ class boss_kologarn : public CreatureScript me->GetMotionMaster()->MoveTargetedHome(); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetCorpseDelay(604800); // Prevent corpse from despawning. - ForceStopCombatForCreature(NPC_ARM_SWEEP_STALKER, 500.f); + ForceCombatStopForCreatureEntry(NPC_ARM_SWEEP_STALKER, 500.f); _JustDied(); } |