Merge pull request #260 from jellemeeus/fixAnub

Anub'Arak no longer triggers Locust Swarm before cast, scale damage p…
This commit is contained in:
ZhengPeiRu21
2024-04-24 21:57:58 -06:00
committed by GitHub
2 changed files with 47 additions and 5 deletions

View File

@@ -4,3 +4,8 @@ INSERT INTO spell_dbc (`ID`,`Category`,`DispelType`,`Mechanic`,`Attributes`,`Att
(90001,0,0,0,8388864,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,101,0,0,0,0,21,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,28,0,0,1,0,0,0,0,0,4,0,0,0,0,0,18,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,351083,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7626,0,1,0,0,'Summon Corpse Scarabs (5)','','','','','','','','','','','','','','','',16712190,'','','','','','','','','','','','','','','','',16712172,'','','','','','','','','','','','','','','','',16712188,'','','','','','','','','','','','','','','','',16712188,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0), # 29105 - Corpse Scarabs (5)
(90002,0,0,0,8388864,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,101,0,0,0,0,21,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,28,0,0,1,0,0,0,0,0,9,0,0,0,0,0,18,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,351083,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7626,0,1,0,0,'Summon Corpse Scarabs (10)','','','','','','','','','','','','','','','',16712190,'','','','','','','','','','','','','','','','',16712172,'','','','','','','','','','','','','','','','',16712188,'','','','','','','','','','','','','','','','',16712188,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0); # 28864 - Corpse Scarabs (10
-- Anub'Arak
-- Locust Swarm: Reduce damage ~1500 to ~1000, increase radius 25yd to 30yd
DELETE FROM `spell_script_names` WHERE `spell_id` = 28785;
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`)
VALUES(28785, 'spell_anub_locust_swarm_40');

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();
}