Skip to content

Commit

Permalink
Auriaya: Move Enrage to SpellScript, Fix Defender death count
Browse files Browse the repository at this point in the history
  • Loading branch information
insunaa committed Oct 29, 2024
1 parent 5384577 commit 12f214e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
1 change: 1 addition & 0 deletions sql/scriptdev2/spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

/*######
Expand All @@ -70,7 +72,6 @@ enum

enum AuriayaActions
{
AURIAYA_ENRAGE,
AURIAYA_DEFENDER,
AURIAYA_ACTIONS_MAX,
};
Expand All @@ -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);
}

Expand All @@ -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
Expand All @@ -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;
}
}
}
};
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -283,4 +290,5 @@ void AddSC_boss_auriaya()
pNewScript->RegisterSelf();

RegisterSpellScript<TerrifyingScreech>("spell_terrifying_screech");
RegisterSpellScript<FeralEssanceRemoval>("spell_feral_essence_removal");
}
9 changes: 0 additions & 9 deletions src/game/Spells/SpellEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 12f214e

Please sign in to comment.