fix(Scripts/TempleOfAhnQiraj): Prevent tentacles from spawning inside… (#13864)

fix(Scripts/TempleOfAhnQiraj): Prevent tentacles from spawning inside C'thun's stomach
This commit is contained in:
Skjalf
2022-11-19 08:18:32 -03:00
committed by GitHub
parent 2ae3f40847
commit afebbb816c

View File

@@ -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);
}