Anub'Arak no longer triggers Locust Swarm before cast, scale damage per tick

This commit is contained in:
Jelle Meeus
2024-04-24 18:24:14 +02:00
parent 2968451770
commit fa7c866389
2 changed files with 47 additions and 5 deletions

View File

@@ -236,12 +236,7 @@ public:
case EVENT_LOCUST_SWARM:
{
Talk(EMOTE_LOCUST);
// Set damage for periodic trigger effect to a random value between 875 and 1125
int32 modifiedLocustSwarmDamage = urand(875, 1125);
me->CastSpell(me, SPELL_LOCUST_SWARM, false);
// Update the periodic trigger effect with custom damage
me->CastCustomSpell(me, SPELL_LOCUST_SWARM_TRIGGER, &modifiedLocustSwarmDamage, nullptr, nullptr, true, nullptr, nullptr, me->GetGUID());
events.ScheduleEvent(EVENT_SPAWN_GUARD, 3000);
events.RepeatEvent(90000);
break;
@@ -258,7 +253,49 @@ public:
};
};
class spell_anub_locust_swarm_40 : public SpellScriptLoader
{
public:
spell_anub_locust_swarm_40() : SpellScriptLoader("spell_anub_locust_swarm_40") { }
class spell_anub_locust_swarm_40_AuraScript : public AuraScript
{
PrepareAuraScript(spell_anub_locust_swarm_40_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_LOCUST_SWARM_TRIGGER });
}
void HandleTriggerSpell(AuraEffect const* /*aurEff*/)
{
Unit* caster = GetCaster();
if (!caster || (caster->GetMap()->GetDifficulty() != RAID_DIFFICULTY_10MAN_HEROIC))
{
return;
}
PreventDefaultAction();
int32 modifiedLocustSwarmDamage = 812;
CustomSpellValues values;
values.AddSpellMod(SPELLVALUE_BASE_POINT0, modifiedLocustSwarmDamage);
values.AddSpellMod(SPELLVALUE_RADIUS_MOD, 3000); // 30yd
caster->CastCustomSpell(SPELL_LOCUST_SWARM_TRIGGER, values, caster, TRIGGERED_FULL_MASK, nullptr, nullptr, GetCasterGUID());
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_anub_locust_swarm_40_AuraScript::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_anub_locust_swarm_40_AuraScript();
}
};
void AddSC_boss_anubrekhan_40()
{
new boss_anubrekhan_40();
new spell_anub_locust_swarm_40();
}