aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKillyana <morphone1@gmail.com>2019-01-12 00:11:59 +0100
committerShauren <shauren.trinity@gmail.com>2021-11-21 14:38:17 +0100
commitd8b76a6e6d03b731ad89ea2e91ea93852a44162f (patch)
tree0ff04be747e31689a1d3c3d639668c61c61c57b1 /src
parentc2eff8fabcc348d20bcbde19b5db0f76c3d7738e (diff)
DB/Creature: Wrath Corruptor
Thanks to Keader for the spell_script Original sql by Tobschinski https://github.com/cmangos/tbc-db/commit/c8f1753834ba3dba4c6263346afe29cd363c2431 (cherry picked from commit fb28083b3b2966952b1227f6585b48fcc70dbe7a)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 724eda0a266..d7b86b77253 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -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);