DB/Creature: Wrath Corruptor

Thanks to Keader for the spell_script
Original sql by Tobschinski c8f1753834

(cherry picked from commit fb28083b3b)
This commit is contained in:
Killyana
2019-01-12 00:11:59 +01:00
committed by Shauren
parent c2eff8fabc
commit d8b76a6e6d
2 changed files with 246 additions and 0 deletions

View File

@@ -4000,6 +4000,66 @@ class spell_gen_pony_mount_check : public AuraScript
}
};
enum CorruptinPlagueEntrys
{
NPC_APEXIS_FLAYER = 22175,
NPC_SHARD_HIDE_BOAR = 22180,
NPC_AETHER_RAY = 22181,
SPELL_CORRUPTING_PLAGUE = 40350
};
// 40350 - Corrupting Plague
class CorruptingPlagueSearcher
{
public:
CorruptingPlagueSearcher(Unit* obj, float distance) : _unit(obj), _distance(distance) { }
bool operator()(Unit* u) const
{
if (_unit->GetDistance2d(u) < _distance &&
(u->GetEntry() == NPC_APEXIS_FLAYER || u->GetEntry() == NPC_SHARD_HIDE_BOAR || u->GetEntry() == NPC_AETHER_RAY) &&
!u->HasAura(SPELL_CORRUPTING_PLAGUE))
return true;
return false;
}
private:
Unit* _unit;
float _distance;
};
// 40349 - Corrupting Plague
class spell_corrupting_plague_aura : public AuraScript
{
PrepareAuraScript(spell_corrupting_plague_aura);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_CORRUPTING_PLAGUE });
}
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
Unit* owner = GetTarget();
std::list<Creature*> targets;
CorruptingPlagueSearcher creature_check(owner, 15.0f);
Trinity::CreatureListSearcher<CorruptingPlagueSearcher> creature_searcher(owner, targets, creature_check);
Cell::VisitGridObjects(owner, creature_searcher, 15.0f);
if (!targets.empty())
return;
PreventDefaultAction();
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_corrupting_plague_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
// 169869 - Transformation Sickness
class spell_gen_decimatus_transformation_sickness : public SpellScript
{
@@ -4363,6 +4423,7 @@ void AddSC_generic_spell_scripts()
RegisterSpellScript(spell_gen_landmine_knockback_achievement);
RegisterSpellScript(spell_gen_clear_debuffs);
RegisterAuraScript(spell_gen_pony_mount_check);
RegisterAuraScript(spell_corrupting_plague_aura);
RegisterSpellScript(spell_gen_decimatus_transformation_sickness);
RegisterSpellScript(spell_gen_anetheron_summon_towering_infernal);
RegisterSpellAndAuraScriptPair(spell_gen_mark_of_kazrogal_hellfire, spell_gen_mark_of_kazrogal_hellfire_aura);