mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
fix(Scripts/TempleOfAhnQiraj): Fix double spawns during Cthun phase 2 and several other fixes (#13413)
* fix(Scripts/TempleOfAhnQiraj): Fix double spawns during Cthun phase 2 * Update boss_cthun.cpp * dont teleport if you move away from the teleport pad * clear events * prevent portals from chasing pets * fix the jump tele timer * update eye combat reach * delay the transition slightly * Update boss_cthun.cpp * Update boss_cthun.cpp * make exit trigger cast rubble rocky * Update boss_cthun.cpp * fix tentacle animations * Update rev_1665784753998414100.sql * eye tentacle animations * only spit out if alive * Update rev_1665784753998414100.sql * Update rev_1665784753998414100.sql
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
--
|
||||||
|
UPDATE `creature_template` SET `unit_flags` = `unit_flags` |256|512 WHERE `entry` IN (15910, 15904, 15896);
|
||||||
|
UPDATE `creature_model_info` SET `CombatReach` = 15 WHERE `displayID` IN (15556, 15790, 15793);
|
||||||
|
UPDATE `creature_summon_groups` SET `summonType` = 6, `summonTime` = 500 WHERE `summonerId` = 15589 AND `summonerType` = 0;
|
||||||
@@ -102,6 +102,7 @@ enum Misc
|
|||||||
{
|
{
|
||||||
MAX_TENTACLE_GROUPS = 5,
|
MAX_TENTACLE_GROUPS = 5,
|
||||||
NPC_TRIGGER = 15384,
|
NPC_TRIGGER = 15384,
|
||||||
|
NPC_EXIT_TRIGGER = 15800
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Yells
|
enum Yells
|
||||||
@@ -260,7 +261,7 @@ struct boss_eye_of_cthun : public BossAI
|
|||||||
{
|
{
|
||||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
|
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
|
||||||
{
|
{
|
||||||
if (Creature* tentacle = me->SummonCreature(NPC_CLAW_TENTACLE, *target, TEMPSUMMON_CORPSE_DESPAWN, 1000))
|
if (Creature* tentacle = me->SummonCreature(NPC_CLAW_TENTACLE, *target, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000))
|
||||||
{
|
{
|
||||||
tentacle->AI()->AttackStart(target);
|
tentacle->AI()->AttackStart(target);
|
||||||
}
|
}
|
||||||
@@ -310,17 +311,9 @@ struct boss_eye_of_cthun : public BossAI
|
|||||||
me->SetTarget(ObjectGuid::Empty);
|
me->SetTarget(ObjectGuid::Empty);
|
||||||
me->StopMoving();
|
me->StopMoving();
|
||||||
|
|
||||||
if (ClockWise)
|
float angle = ClockWise ? DarkGlareAngle + DarkGlareTick * float(M_PI) / 35 : DarkGlareAngle - DarkGlareTick * float(M_PI) / 35;
|
||||||
{
|
me->SetFacingTo(angle);
|
||||||
me->SetFacingTo(DarkGlareAngle + DarkGlareTick * float(M_PI) / 35);
|
me->SetOrientation(angle);
|
||||||
me->SetOrientation(DarkGlareAngle + DarkGlareTick * float(M_PI) / 35);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
me->SetFacingTo(DarkGlareAngle - DarkGlareTick * float(M_PI) / 35);
|
|
||||||
me->SetOrientation(DarkGlareAngle - DarkGlareTick * float(M_PI) / 35);
|
|
||||||
}
|
|
||||||
|
|
||||||
DoCastSelf(SPELL_DARK_GLARE);
|
DoCastSelf(SPELL_DARK_GLARE);
|
||||||
|
|
||||||
@@ -354,7 +347,7 @@ struct boss_eye_of_cthun : public BossAI
|
|||||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
|
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
|
||||||
{
|
{
|
||||||
//Only if it will kill
|
//Only if it will kill
|
||||||
if (damage < me->GetHealth())
|
if (damage < me->GetHealth() || !me->GetHealth())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//Fake death in phase 0 or 1 (green beam or dark glare phase)
|
//Fake death in phase 0 or 1 (green beam or dark glare phase)
|
||||||
@@ -376,10 +369,13 @@ struct boss_eye_of_cthun : public BossAI
|
|||||||
me->RemoveAllAuras();
|
me->RemoveAllAuras();
|
||||||
_scheduler.CancelAll();
|
_scheduler.CancelAll();
|
||||||
|
|
||||||
if (Creature* cthun = instance->GetCreature(DATA_CTHUN))
|
me->m_Events.AddEventAtOffset([this]()
|
||||||
{
|
{
|
||||||
cthun->AI()->DoAction(ACTION_START_PHASE_TWO);
|
if (Creature* cthun = instance->GetCreature(DATA_CTHUN))
|
||||||
}
|
{
|
||||||
|
cthun->AI()->DoAction(ACTION_START_PHASE_TWO);
|
||||||
|
}
|
||||||
|
}, 3s);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -476,7 +472,7 @@ struct boss_cthun : public BossAI
|
|||||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, -SPELL_DIGESTIVE_ACID))
|
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, -SPELL_DIGESTIVE_ACID))
|
||||||
{
|
{
|
||||||
//Spawn claw tentacle on the random target
|
//Spawn claw tentacle on the random target
|
||||||
if (Creature* spawned = me->SummonCreature(NPC_GIANT_CLAW_TENTACLE, *target, TEMPSUMMON_CORPSE_DESPAWN, 500))
|
if (Creature* spawned = me->SummonCreature(NPC_GIANT_CLAW_TENTACLE, *target, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000))
|
||||||
{
|
{
|
||||||
spawned->AI()->AttackStart(target);
|
spawned->AI()->AttackStart(target);
|
||||||
}
|
}
|
||||||
@@ -488,7 +484,7 @@ struct boss_cthun : public BossAI
|
|||||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, -SPELL_DIGESTIVE_ACID))
|
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, -SPELL_DIGESTIVE_ACID))
|
||||||
{
|
{
|
||||||
//Spawn claw tentacle on the random target
|
//Spawn claw tentacle on the random target
|
||||||
if (Creature* spawned = me->SummonCreature(NPC_GIANT_EYE_TENTACLE, *target, TEMPSUMMON_CORPSE_DESPAWN, 500))
|
if (Creature* spawned = me->SummonCreature(NPC_GIANT_EYE_TENTACLE, *target, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000))
|
||||||
{
|
{
|
||||||
spawned->AI()->AttackStart(target);
|
spawned->AI()->AttackStart(target);
|
||||||
}
|
}
|
||||||
@@ -579,7 +575,7 @@ struct boss_cthun : public BossAI
|
|||||||
//Spawn flesh tentacle
|
//Spawn flesh tentacle
|
||||||
for (uint8 i = 0; i < 2; i++)
|
for (uint8 i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
me->SummonCreature(NPC_FLESH_TENTACLE, FleshTentaclePos[i], TEMPSUMMON_CORPSE_DESPAWN);
|
me->SummonCreature(NPC_FLESH_TENTACLE, FleshTentaclePos[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -985,30 +981,37 @@ public:
|
|||||||
{
|
{
|
||||||
if (Creature* cthun = instance->GetCreature(DATA_CTHUN))
|
if (Creature* cthun = instance->GetCreature(DATA_CTHUN))
|
||||||
{
|
{
|
||||||
player->CastSpell(player, SPELL_RUBBLE_ROCKY, true);
|
if (Creature* trigger = player->FindNearestCreature(NPC_TRIGGER, 15.0f))
|
||||||
|
|
||||||
player->m_Events.AddEventAtOffset([player]()
|
|
||||||
{
|
{
|
||||||
if (Creature* trigger = player->FindNearestCreature(NPC_TRIGGER, 15.0f))
|
trigger->CastSpell(player, SPELL_EXIT_STOMACH, true);
|
||||||
|
|
||||||
|
if (Creature* exittrigger = player->FindNearestCreature(NPC_EXIT_TRIGGER, 15.0f))
|
||||||
{
|
{
|
||||||
trigger->CastSpell(player, SPELL_EXIT_STOMACH, true);
|
exittrigger->CastSpell(player, SPELL_RUBBLE_ROCKY, true);
|
||||||
}
|
}
|
||||||
}, 3s);
|
}
|
||||||
|
|
||||||
player->m_Events.AddEventAtOffset([player]()
|
|
||||||
{
|
|
||||||
player->JumpTo(0.0f, 80.0f, false);
|
|
||||||
}, 5s);
|
|
||||||
|
|
||||||
player->m_Events.AddEventAtOffset([player, cthun]()
|
player->m_Events.AddEventAtOffset([player, cthun]()
|
||||||
{
|
{
|
||||||
if (cthun)
|
if (Creature* trigger = player->FindNearestCreature(NPC_EXIT_TRIGGER, 10.0f))
|
||||||
{
|
{
|
||||||
player->NearTeleportTo(cthun->GetPositionX(), cthun->GetPositionY(), cthun->GetPositionZ() + 10, float(rand32() % 6));
|
player->JumpTo(0.0f, 80.0f, false);
|
||||||
}
|
|
||||||
|
|
||||||
player->RemoveAurasDueToSpell(SPELL_DIGESTIVE_ACID);
|
player->m_Events.AddEventAtOffset([player, cthun]()
|
||||||
}, 6s);
|
{
|
||||||
|
if (cthun)
|
||||||
|
{
|
||||||
|
player->NearTeleportTo(cthun->GetPositionX(), cthun->GetPositionY(), cthun->GetPositionZ() + 10, float(rand32() % 6));
|
||||||
|
}
|
||||||
|
|
||||||
|
player->RemoveAurasDueToSpell(SPELL_DIGESTIVE_ACID);
|
||||||
|
}, 1s);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player->m_Events.KillAllEvents(false);
|
||||||
|
}
|
||||||
|
}, 3s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1027,7 +1030,10 @@ public:
|
|||||||
{
|
{
|
||||||
if (Creature* cthun = instance->GetCreature(DATA_CTHUN))
|
if (Creature* cthun = instance->GetCreature(DATA_CTHUN))
|
||||||
{
|
{
|
||||||
cthun->CastSpell(player, SPELL_SPIT_OUT, true);
|
if (cthun->IsAlive())
|
||||||
|
{
|
||||||
|
cthun->CastSpell(player, SPELL_SPIT_OUT, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user