From 12f214e598f52c61b328a956284339230979b889 Mon Sep 17 00:00:00 2001 From: insunaa Date: Tue, 29 Oct 2024 15:31:21 +0100 Subject: [PATCH] Auriaya: Move Enrage to SpellScript, Fix Defender death count --- sql/scriptdev2/spell.sql | 1 + .../northrend/ulduar/ulduar/boss_auriaya.cpp | 32 ++++++++++++------- src/game/Spells/SpellEffects.cpp | 9 ------ 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/sql/scriptdev2/spell.sql b/sql/scriptdev2/spell.sql index aed0072fa87..ea127f7444b 100644 --- a/sql/scriptdev2/spell.sql +++ b/sql/scriptdev2/spell.sql @@ -986,6 +986,7 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (64235,'spell_void_zone_xt'), (64411,'spell_blessing_of_ancient_kings'), (64415,'spell_valanyr_equip_effect'), +(64456,'spell_feral_essence_removal'), (64475,'spell_ignis_remove_strength'), (64503,'spell_ignis_water'), (64386,'spell_terrifying_screech'), diff --git a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_auriaya.cpp b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_auriaya.cpp index 5262713e115..48982a42375 100644 --- a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_auriaya.cpp +++ b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_auriaya.cpp @@ -62,6 +62,8 @@ enum NPC_SEEPING_FERAL_ESSENCE = 34098, // summoned by the feral defender on feign death // NPC_GUARDIAN_SWARN = 34034, // summoned by spell NPC_FERAL_DEFENDER_STALKER = 34096, + + SOUND_DEATH = 15476, }; /*###### @@ -70,7 +72,6 @@ enum enum AuriayaActions { - AURIAYA_ENRAGE, AURIAYA_DEFENDER, AURIAYA_ACTIONS_MAX, }; @@ -84,7 +85,6 @@ struct boss_auriayaAI : public BossAI SetDataType(TYPE_AURIAYA); AddOnAggroText(SAY_AGGRO); AddOnKillText(SAY_SLAY_1, SAY_SLAY_2); - AddCombatAction(AURIAYA_ENRAGE, 10min); AddCombatAction(AURIAYA_DEFENDER, 1min); } @@ -94,7 +94,7 @@ struct boss_auriayaAI : public BossAI void JustDied(Unit* killer) override { BossAI::JustDied(killer); - m_creature->PlayDirectSound(15476); + m_creature->PlayDirectSound(SOUND_DEATH); } void JustSummoned(Creature* summoned) override @@ -114,15 +114,8 @@ struct boss_auriayaAI : public BossAI DisableCombatAction(action); return; } - case AURIAYA_ENRAGE: - { - if (DoCastSpellIfCan(m_creature, SPELL_BERSERK) == CAST_OK) - { - DoBroadcastText(SAY_BERSERK, m_creature); - ResetCombatAction(action, 10min); - } + default: return; - } } } }; @@ -188,7 +181,7 @@ struct boss_feral_defenderAI : public BossAI void JustPreventedDeath(Unit* attacker) override { - if (m_deathCount >= 8) + if (m_deathCount >= 7) SetDeathPrevention(false); DoCastSpellIfCan(m_creature, SPELL_FERAL_ESSENCE_REMOVAL, CAST_TRIGGERED); DoCastSpellIfCan(m_creature, SPELL_SEEPING_FERAL_ESSENCE_SUMMON, CAST_TRIGGERED); @@ -270,6 +263,20 @@ struct TerrifyingScreech : public SpellScript } }; +// 64456 - Feral Essence Application Removal +struct FeralEssanceRemoval : public SpellScript +{ + void OnEffectExecute(Spell* spell, SpellEffectIndex /*effIdx*/) const override + { + Unit* unitTarget = spell->GetUnitTarget(); + if (!unitTarget) + return; + + uint32 spellId = spell->m_spellInfo->CalculateSimpleValue(EFFECT_INDEX_0); + unitTarget->RemoveAuraHolderFromStack(spellId); + } +}; + void AddSC_boss_auriaya() { Script* pNewScript = new Script; @@ -283,4 +290,5 @@ void AddSC_boss_auriaya() pNewScript->RegisterSelf(); RegisterSpellScript("spell_terrifying_screech"); + RegisterSpellScript("spell_feral_essence_removal"); } diff --git a/src/game/Spells/SpellEffects.cpp b/src/game/Spells/SpellEffects.cpp index 33aed1bb91f..f847cdcffac 100644 --- a/src/game/Spells/SpellEffects.cpp +++ b/src/game/Spells/SpellEffects.cpp @@ -10207,15 +10207,6 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx) unitTarget->CastSpell(m_caster, m_spellInfo->CalculateSimpleValue(eff_idx), TRIGGERED_OLD_TRIGGERED); return; } - case 64456: // Feral Essence Application Removal - { - if (!unitTarget) - return; - - uint32 spellId = m_spellInfo->CalculateSimpleValue(eff_idx); - unitTarget->RemoveAuraHolderFromStack(spellId); - return; - } case 64466: // Empowering Shadows { if (!unitTarget)