mirror of
https://gitcode.com/GitHub_Trending/az/azerothcore-wotlk.git
synced 2026-07-10 19:03:11 +00:00
fix(Scripts/Ulduar): Improve Freya's Detonating Lashers spawn behaviour (#26263)
Co-authored-by: zaganzg <176078186+zaganzg@users.noreply.github.com> Co-authored-by: sogladev <sogladev@gmail.com>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
-- Freya - Detonating Lashers: submerge visual + no-crit auras on spawn (issue #26255)
|
||||
DELETE FROM `creature_template_addon` WHERE `entry` IN (32918, 33399);
|
||||
INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES
|
||||
(32918, 0, 0, 0, 0, 0, 0, '28819 64481'),
|
||||
(33399, 0, 0, 0, 0, 0, 0, '28819 64481');
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_gen_submerge_visual' AND `spell_id`=28819;
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(28819, 'spell_gen_submerge_visual');
|
||||
@@ -102,6 +102,7 @@ enum FreyaSpells
|
||||
// DETONATING LASHER
|
||||
SPELL_DETONATE = 62598,
|
||||
SPELL_FLAME_LASH = 62608,
|
||||
SPELL_SUBMERGE_VISUAL = 28819,
|
||||
|
||||
// ACHIEVEMENT
|
||||
SPELL_DEFORESTATION_CREDIT = 65015,
|
||||
@@ -345,8 +346,16 @@ struct boss_freya : public BossAI
|
||||
else if (_waveNumber == 3)
|
||||
{
|
||||
Talk(SAY_SUMMON_LASHERS);
|
||||
// Spread the lashers evenly in a ring around Freya instead of
|
||||
// clustering them in one spot, matching retail.
|
||||
for (uint8 i = 0; i < 10; ++i)
|
||||
me->SummonCreature(NPC_DETONATING_LASHER, me->GetPositionX() + urand(5, 20), me->GetPositionY() + urand(5, 20), me->GetMapHeight(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()), 0, TEMPSUMMON_CORPSE_DESPAWN);
|
||||
{
|
||||
float angle = i * 2.0f * float(M_PI) / 10.0f + frand(-0.35f, 0.35f);
|
||||
float dist = frand(18.0f, 28.0f);
|
||||
float x = me->GetPositionX() + dist * std::cos(angle);
|
||||
float y = me->GetPositionY() + dist * std::sin(angle);
|
||||
me->SummonCreature(NPC_DETONATING_LASHER, x, y, me->GetMapHeight(x, y, me->GetPositionZ()), 0, TEMPSUMMON_CORPSE_DESPAWN);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -969,6 +978,29 @@ struct boss_freya_summons : public ScriptedAI
|
||||
{
|
||||
_stackCount = 0;
|
||||
events.Reset();
|
||||
|
||||
// Detonating Lashers spawn submerged in the ground and stay passive for a
|
||||
// few seconds, then burst out with the emerge/birth animation (driven by
|
||||
// the SUBMERGED -> STAND stand state change, like XT-002) and only start
|
||||
// attacking once it has played out, so the jump is not cut short by
|
||||
// combat movement (see issue #26255). They remain hostile and attackable
|
||||
// while submerged, matching retail.
|
||||
if (me->GetEntry() == NPC_DETONATING_LASHER)
|
||||
{
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->m_Events.AddEventAtOffset([this]()
|
||||
{
|
||||
me->RemoveAurasDueToSpell(SPELL_SUBMERGE_VISUAL);
|
||||
}, 4s);
|
||||
me->m_Events.AddEventAtOffset([this]()
|
||||
{
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
if (Unit* target = SelectTargetFromPlayerList(70))
|
||||
AttackStart(target);
|
||||
}, 5s);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Unit* target = SelectTargetFromPlayerList(70))
|
||||
AttackStart(target);
|
||||
}
|
||||
|
||||
@@ -171,7 +171,6 @@ struct boss_the_lurker_below : public BossAI
|
||||
scheduler.CancelAll();
|
||||
DoCastSelf(SPELL_SUBMERGE_VISUAL);
|
||||
DoCastSelf(SPELL_CLEAR_ALL_DEBUFFS, true);
|
||||
me->SetStandState(UNIT_STAND_STATE_SUBMERGED);
|
||||
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
for (uint8 i = 0; i < MAX_SUMMONS; ++i)
|
||||
{
|
||||
@@ -187,7 +186,7 @@ struct boss_the_lurker_below : public BossAI
|
||||
scheduler.Schedule(timer, [this](TaskContext)
|
||||
{
|
||||
me->setAttackTimer(BASE_ATTACK, 6000);
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
me->RemoveAurasDueToSpell(SPELL_SUBMERGE_VISUAL);
|
||||
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
scheduler.CancelAll();
|
||||
|
||||
@@ -6100,6 +6100,33 @@ class spell_gen_filter_party_level_80 : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
// 28819 Submerge Visual
|
||||
class spell_gen_submerge_visual : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_gen_submerge_visual);
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
return GetUnitOwner()->IsCreature();
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->SetStandState(UNIT_STAND_STATE_SUBMERGED);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_gen_submerge_visual::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_gen_submerge_visual::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_generic_spell_scripts()
|
||||
{
|
||||
RegisterSpellScript(spell_silithyst);
|
||||
@@ -6287,4 +6314,5 @@ void AddSC_generic_spell_scripts()
|
||||
RegisterSpellScript(spell_gen_mirrored_soul);
|
||||
RegisterSpellScript(spell_gen_black_bow_of_the_betrayer);
|
||||
RegisterSpellScript(spell_gen_filter_party_level_80);
|
||||
RegisterSpellScript(spell_gen_submerge_visual);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user