From 2c426829890d248cbbe1face6afe3e0084797a2d Mon Sep 17 00:00:00 2001 From: Angelo Venturini Date: Fri, 14 Oct 2022 16:28:30 -0300 Subject: [PATCH] fix(Scripts/TempleOfAhnQiraj): Ouro double spawn in 3rd phase, interrupt immunity (#13405) --- .../rev_1665712684667487900.sql | 2 ++ .../Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp | 19 ++++++++++++++----- .../instance_temple_of_ahnqiraj.cpp | 1 + 3 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1665712684667487900.sql diff --git a/data/sql/updates/pending_db_world/rev_1665712684667487900.sql b/data/sql/updates/pending_db_world/rev_1665712684667487900.sql new file mode 100644 index 000000000..ab7cefca1 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1665712684667487900.sql @@ -0,0 +1,2 @@ +-- +UPDATE `creature_template` SET `mechanic_immune_mask` = `mechanic_immune_mask`|33554432 WHERE `entry` = 15517; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp index 126f76c4b..1355b52d1 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp @@ -78,8 +78,15 @@ struct npc_ouro_spawner : public ScriptedAI // Spawn Ouro on LoS check if (!hasSummoned && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 40.0f) && !who->ToPlayer()->IsGameMaster()) { - DoCastSelf(SPELL_SUMMON_OURO); - hasSummoned = true; + if (InstanceScript* instance = me->GetInstanceScript()) + { + Creature* ouro = instance->GetCreature(DATA_OURO); + if (instance->GetBossState(DATA_OURO) != IN_PROGRESS && !ouro) + { + DoCastSelf(SPELL_SUMMON_OURO); + hasSummoned = true; + } + } } ScriptedAI::MoveInLineOfSight(who); @@ -129,7 +136,7 @@ struct boss_ouro : public BossAI void Submerge() { - if (_enraged) + if (_enraged || _submerged) return; me->AttackStop(); @@ -209,6 +216,9 @@ struct boss_ouro : public BossAI }) .Schedule(3s, GROUP_PHASE_TRANSITION, [this](TaskContext context) { + if (_enraged) + return; + if (!IsPlayerWithinMeleeRange() && !_submerged) { if (_submergeMelee < 10) @@ -217,8 +227,7 @@ struct boss_ouro : public BossAI } else { - if (!_enraged) - Submerge(); + Submerge(); _submergeMelee = 0; } } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp index 281d5f53b..749a11e43 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp @@ -30,6 +30,7 @@ ObjectData const creatureData[] = { NPC_SARTURA, DATA_SARTURA }, { NPC_CTHUN, DATA_CTHUN }, { NPC_EYE_OF_CTHUN, DATA_EYE_OF_CTHUN }, + { NPC_OURO, DATA_OURO }, { NPC_OURO_SPAWNER, DATA_OURO_SPAWNER }, { NPC_MASTERS_EYE, DATA_MASTERS_EYE }, { NPC_VEKLOR, DATA_VEKLOR },