From afebbb816cb7fe84fbec0c46beb532b8b5215dbe Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Sat, 19 Nov 2022 08:18:32 -0300 Subject: [PATCH] =?UTF-8?q?fix(Scripts/TempleOfAhnQiraj):=20Prevent=20tent?= =?UTF-8?q?acles=20from=20spawning=20inside=E2=80=A6=20(#13864)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Scripts/TempleOfAhnQiraj): Prevent tentacles from spawning inside C'thun's stomach --- .../Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index b1d1fc203..e00f2cb7c 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -136,10 +136,7 @@ public: bool operator()(Unit* unit) const { - if (unit->GetTypeId() != TYPEID_PLAYER || unit->HasAura(SPELL_DIGESTIVE_ACID)) - return false; - - return true; + return unit->IsPlayer() && !unit->HasAura(SPELL_DIGESTIVE_ACID) && (unit->GetPositionZ() > 0.0f); } }; @@ -446,7 +443,7 @@ struct boss_cthun : public BossAI { _scheduler.Schedule(13800ms, [this](TaskContext context) { - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, -SPELL_DIGESTIVE_ACID)) + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, NotInStomachSelector())) { target->CastSpell(target, SPELL_MOUTH_TENTACLE, true); @@ -469,7 +466,7 @@ struct boss_cthun : public BossAI context.Repeat(30s); }).Schedule(8s, [this](TaskContext context) { - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, -SPELL_DIGESTIVE_ACID)) + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, NotInStomachSelector())) { //Spawn claw tentacle on the random target if (Creature* spawned = me->SummonCreature(NPC_GIANT_CLAW_TENTACLE, *target, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000)) @@ -481,7 +478,7 @@ struct boss_cthun : public BossAI context.Repeat(1min); }).Schedule(38s, [this](TaskContext context) { - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, -SPELL_DIGESTIVE_ACID)) + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, NotInStomachSelector())) { //Spawn claw tentacle on the random target if (Creature* spawned = me->SummonCreature(NPC_GIANT_EYE_TENTACLE, *target, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000)) @@ -637,7 +634,7 @@ struct npc_eye_tentacle : public ScriptedAI }) .Schedule(1s, 5s, [this](TaskContext context) { - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, [&](Unit* u) { return u && u->GetTypeId() == TYPEID_PLAYER && !u->HasAura(SPELL_DIGESTIVE_ACID) && !u->HasAura(SPELL_MIND_FLAY); })) + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, NotInStomachSelector())) { DoCast(target, SPELL_MIND_FLAY); } @@ -925,7 +922,7 @@ struct npc_giant_eye_tentacle : public ScriptedAI DoCastAOE(SPELL_MASSIVE_GROUND_RUPTURE); }).Schedule(1s, 5s, [this](TaskContext context) { - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, -SPELL_DIGESTIVE_ACID)) + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, NotInStomachSelector())) { DoCast(target, SPELL_GREEN_BEAM); }