diff options
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
-rw-r--r-- | src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp | 46 | ||||
-rw-r--r-- | src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp | 140 |
2 files changed, 136 insertions, 50 deletions
diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp index 63e753a18ba..676cd7be4f0 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp @@ -27,7 +27,11 @@ EndScriptData */ npc_shadowfang_prisoner EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "SpellScript.h" +#include "SpellAuraEffects.h" #include "ScriptedEscortAI.h" #include "shadowfang_keep.h" @@ -193,8 +197,48 @@ public: }; +class spell_shadowfang_keep_haunting_spirits : public SpellScriptLoader +{ + public: + spell_shadowfang_keep_haunting_spirits() : SpellScriptLoader("spell_shadowfang_keep_haunting_spirits") { } + + class spell_shadowfang_keep_haunting_spirits_AuraScript : public AuraScript + { + PrepareAuraScript(spell_shadowfang_keep_haunting_spirits_AuraScript); + + void CalcPeriodic(AuraEffect const* /*aurEff*/, bool& isPeriodic, int32& amplitude) + { + isPeriodic = true; + amplitude = (irand(0, 60) + 30) * IN_MILLISECONDS; + } + + void HandleDummyTick(AuraEffect const* aurEff) + { + GetTarget()->CastSpell((Unit*)NULL, aurEff->GetAmount(), true); + } + + void HandleUpdatePeriodic(AuraEffect* aurEff) + { + aurEff->CalculatePeriodic(GetCaster()); + } + + void Register() + { + DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_shadowfang_keep_haunting_spirits_AuraScript::CalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_shadowfang_keep_haunting_spirits_AuraScript::HandleDummyTick, EFFECT_0, SPELL_AURA_DUMMY); + OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_shadowfang_keep_haunting_spirits_AuraScript::HandleUpdatePeriodic, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_shadowfang_keep_haunting_spirits_AuraScript(); + } +}; + void AddSC_shadowfang_keep() { new npc_shadowfang_prisoner(); new npc_arugal_voidwalker(); + new spell_shadowfang_keep_haunting_spirits(); } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp index b5698d851f8..4fcfa8a046e 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp @@ -23,7 +23,10 @@ SDComment: SDCategory: Zul'Aman EndScriptData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellScript.h" +#include "SpellAuraEffects.h" #include "zulaman.h" #define YELL_AGGRO "Da shadow gonna fall on you... " @@ -47,54 +50,58 @@ EndScriptData */ //Defines for various powers he uses after using soul drain -//Druid -#define SPELL_DR_LIFEBLOOM 43421 -#define SPELL_DR_THORNS 43420 -#define SPELL_DR_MOONFIRE 43545 - -//Hunter -#define SPELL_HU_EXPLOSIVE_TRAP 43444 -#define SPELL_HU_FREEZING_TRAP 43447 -#define SPELL_HU_SNAKE_TRAP 43449 - -//Mage -#define SPELL_MG_FIREBALL 41383 -#define SPELL_MG_FROSTBOLT 43428 -#define SPELL_MG_FROST_NOVA 43426 -#define SPELL_MG_ICE_LANCE 43427 - -//Paladin -#define SPELL_PA_CONSECRATION 43429 -#define SPELL_PA_HOLY_LIGHT 43451 -#define SPELL_PA_AVENGING_WRATH 43430 - -//Priest -#define SPELL_PR_HEAL 41372 -#define SPELL_PR_MIND_CONTROL 43550 -#define SPELL_PR_MIND_BLAST 41374 -#define SPELL_PR_SW_DEATH 41375 -#define SPELL_PR_PSYCHIC_SCREAM 43432 -#define SPELL_PR_PAIN_SUPP 44416 - -//Rogue -#define SPELL_RO_BLIND 43433 -#define SPELL_RO_SLICE_DICE 43457 -#define SPELL_RO_WOUND_POISON 39665 - -//Shaman -#define SPELL_SH_FIRE_NOVA 43436 -#define SPELL_SH_HEALING_WAVE 43548 -#define SPELL_SH_CHAIN_LIGHT 43435 - -//Warlock -#define SPELL_WL_CURSE_OF_DOOM 43439 -#define SPELL_WL_RAIN_OF_FIRE 43440 -#define SPELL_WL_UNSTABLE_AFFL 35183 - -//Warrior -#define SPELL_WR_SPELL_REFLECT 43443 -#define SPELL_WR_WHIRLWIND 43442 -#define SPELL_WR_MORTAL_STRIKE 43441 +enum Spells +{ + // Druid + SPELL_DR_THORNS = 43420, + SPELL_DR_LIFEBLOOM = 43421, + SPELL_DR_MOONFIRE = 43545, + + // Hunter + SPELL_HU_EXPLOSIVE_TRAP = 43444, + SPELL_HU_FREEZING_TRAP = 43447, + SPELL_HU_SNAKE_TRAP = 43449, + + // Mage + SPELL_MG_FIREBALL = 41383, + SPELL_MG_FROST_NOVA = 43426, + SPELL_MG_ICE_LANCE = 43427, + SPELL_MG_FROSTBOLT = 43428, + + // Paladin + SPELL_PA_CONSECRATION = 43429, + SPELL_PA_AVENGING_WRATH = 43430, + SPELL_PA_HOLY_LIGHT = 43451, + + // Priest + SPELL_PR_HEAL = 41372, + SPELL_PR_MIND_BLAST = 41374, + SPELL_PR_SW_DEATH = 41375, + SPELL_PR_PSYCHIC_SCREAM = 43432, + SPELL_PR_MIND_CONTROL = 43550, + SPELL_PR_PAIN_SUPP = 44416, + + // Rogue + SPELL_RO_BLIND = 43433, + SPELL_RO_SLICE_DICE = 43457, + SPELL_RO_WOUND_POISON = 43461, + + // Shaman + SPELL_SH_CHAIN_LIGHT = 43435, + SPELL_SH_FIRE_NOVA = 43436, + SPELL_SH_HEALING_WAVE = 43548, + + // Warlock + SPELL_WL_CURSE_OF_DOOM = 43439, + SPELL_WL_RAIN_OF_FIRE = 43440, + SPELL_WL_UNSTABLE_AFFL = 43522, + SPELL_WL_UNSTABLE_AFFL_DISPEL = 43523, + + // Warrior + SPELL_WR_MORTAL_STRIKE = 43441, + SPELL_WR_WHIRLWIND = 43442, + SPELL_WR_SPELL_REFLECT = 43443 +}; #define ORIENT 1.5696f #define POS_Y 921.2795f @@ -936,6 +943,40 @@ class boss_koragg : public CreatureScript } }; +class spell_hexlord_unstable_affliction : public SpellScriptLoader +{ + public: + spell_hexlord_unstable_affliction() : SpellScriptLoader("spell_hexlord_unstable_affliction") { } + + class spell_hexlord_unstable_affliction_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hexlord_unstable_affliction_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_WL_UNSTABLE_AFFL_DISPEL)) + return false; + return true; + } + + void HandleDispel(DispelInfo* dispelInfo) + { + if (Unit* caster = GetCaster()) + caster->CastSpell(dispelInfo->GetDispeller(), SPELL_WL_UNSTABLE_AFFL_DISPEL, true, NULL, GetEffect(EFFECT_0)); + } + + void Register() + { + AfterDispel += AuraDispelFn(spell_hexlord_unstable_affliction_AuraScript::HandleDispel); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_hexlord_unstable_affliction_AuraScript(); + } +}; + void AddSC_boss_hex_lord_malacrass() { new boss_hexlord_malacrass(); @@ -947,5 +988,6 @@ void AddSC_boss_hex_lord_malacrass() new boss_fenstalker(); new boss_koragg(); new boss_alyson_antille(); + new spell_hexlord_unstable_affliction(); } |