mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 18:36:31 +01:00
Merge pull request #6491
Core/Spells: convert some spell effects to SpellScripts Closes #6491
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
enum Spells
|
||||
{
|
||||
// Druid
|
||||
SPELL_DR_THORNS = 43420,
|
||||
SPELL_DR_LIFEBLOOM = 43421,
|
||||
SPELL_DR_MOONFIRE = 43545,
|
||||
|
||||
//Hunter
|
||||
#define SPELL_HU_EXPLOSIVE_TRAP 43444
|
||||
#define SPELL_HU_FREEZING_TRAP 43447
|
||||
#define SPELL_HU_SNAKE_TRAP 43449
|
||||
// Hunter
|
||||
SPELL_HU_EXPLOSIVE_TRAP = 43444,
|
||||
SPELL_HU_FREEZING_TRAP = 43447,
|
||||
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
|
||||
// Mage
|
||||
SPELL_MG_FIREBALL = 41383,
|
||||
SPELL_MG_FROST_NOVA = 43426,
|
||||
SPELL_MG_ICE_LANCE = 43427,
|
||||
SPELL_MG_FROSTBOLT = 43428,
|
||||
|
||||
//Paladin
|
||||
#define SPELL_PA_CONSECRATION 43429
|
||||
#define SPELL_PA_HOLY_LIGHT 43451
|
||||
#define SPELL_PA_AVENGING_WRATH 43430
|
||||
// Paladin
|
||||
SPELL_PA_CONSECRATION = 43429,
|
||||
SPELL_PA_AVENGING_WRATH = 43430,
|
||||
SPELL_PA_HOLY_LIGHT = 43451,
|
||||
|
||||
//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
|
||||
// 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
|
||||
#define SPELL_RO_BLIND 43433
|
||||
#define SPELL_RO_SLICE_DICE 43457
|
||||
#define SPELL_RO_WOUND_POISON 39665
|
||||
// Rogue
|
||||
SPELL_RO_BLIND = 43433,
|
||||
SPELL_RO_SLICE_DICE = 43457,
|
||||
SPELL_RO_WOUND_POISON = 43461,
|
||||
|
||||
//Shaman
|
||||
#define SPELL_SH_FIRE_NOVA 43436
|
||||
#define SPELL_SH_HEALING_WAVE 43548
|
||||
#define SPELL_SH_CHAIN_LIGHT 43435
|
||||
// Shaman
|
||||
SPELL_SH_CHAIN_LIGHT = 43435,
|
||||
SPELL_SH_FIRE_NOVA = 43436,
|
||||
SPELL_SH_HEALING_WAVE = 43548,
|
||||
|
||||
//Warlock
|
||||
#define SPELL_WL_CURSE_OF_DOOM 43439
|
||||
#define SPELL_WL_RAIN_OF_FIRE 43440
|
||||
#define SPELL_WL_UNSTABLE_AFFL 35183
|
||||
// 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
|
||||
#define SPELL_WR_SPELL_REFLECT 43443
|
||||
#define SPELL_WR_WHIRLWIND 43442
|
||||
#define SPELL_WR_MORTAL_STRIKE 43441
|
||||
// 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();
|
||||
}
|
||||
|
||||
|
||||
@@ -15,13 +15,20 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ScriptPCH.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
#include "hyjal.h"
|
||||
#include "hyjal_trash.h"
|
||||
|
||||
#define SPELL_CLEAVE 31436
|
||||
#define SPELL_WARSTOMP 31480
|
||||
#define SPELL_MARK 31447
|
||||
enum Spells
|
||||
{
|
||||
SPELL_CLEAVE = 31436,
|
||||
SPELL_WARSTOMP = 31480,
|
||||
SPELL_MARK = 31447,
|
||||
SPELL_MARK_DAMAGE = 31463
|
||||
};
|
||||
|
||||
#define SOUND_ONDEATH 11018
|
||||
|
||||
@@ -162,22 +169,10 @@ public:
|
||||
WarStompTimer = 60000;
|
||||
} else WarStompTimer -= diff;
|
||||
|
||||
if (me->HasAura(SPELL_MARK))
|
||||
me->RemoveAurasDueToSpell(SPELL_MARK);
|
||||
if (MarkTimer <= diff)
|
||||
{
|
||||
//cast dummy, useful for bos addons
|
||||
me->CastCustomSpell(me, SPELL_MARK, NULL, NULL, NULL, false, NULL, NULL, me->GetGUID());
|
||||
DoCastAOE(SPELL_MARK);
|
||||
|
||||
std::list<HostileReference*> t_list = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
{
|
||||
Unit* target = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (target && target->GetTypeId() == TYPEID_PLAYER && target->getPowerType() == POWER_MANA)
|
||||
{
|
||||
target->CastSpell(target, SPELL_MARK, true);//only cast on mana users
|
||||
}
|
||||
}
|
||||
MarkTimerBase -= 5000;
|
||||
if (MarkTimerBase < 5500)
|
||||
MarkTimerBase = 5500;
|
||||
@@ -201,7 +196,80 @@ public:
|
||||
|
||||
};
|
||||
|
||||
class MarkTargetFilter
|
||||
{
|
||||
public:
|
||||
bool operator()(Unit* target) const
|
||||
{
|
||||
if (target->getPowerType() != POWER_MANA)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class spell_mark_of_kazrogal : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mark_of_kazrogal() : SpellScriptLoader("spell_mark_of_kazrogal") { }
|
||||
|
||||
class spell_mark_of_kazrogal_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_mark_of_kazrogal_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<Unit*>& unitList)
|
||||
{
|
||||
unitList.remove_if(MarkTargetFilter());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnUnitTargetSelect += SpellUnitTargetFn(spell_mark_of_kazrogal_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_mark_of_kazrogal_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mark_of_kazrogal_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MARK_DAMAGE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
|
||||
if (target->GetPower(POWER_MANA) == 0)
|
||||
{
|
||||
target->CastSpell(target, SPELL_MARK_DAMAGE, true, NULL, aurEff);
|
||||
// Remove aura
|
||||
SetDuration(0);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mark_of_kazrogal_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_MANA_LEECH);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_mark_of_kazrogal_SpellScript();
|
||||
}
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_mark_of_kazrogal_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_kazrogal()
|
||||
{
|
||||
new boss_kazrogal();
|
||||
new spell_mark_of_kazrogal();
|
||||
}
|
||||
|
||||
@@ -27,7 +27,10 @@ EndScriptData */
|
||||
// All - untested
|
||||
// Pets aren't being summoned by their masters
|
||||
|
||||
#include "ScriptPCH.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "trial_of_the_crusader.h"
|
||||
|
||||
enum eYell
|
||||
@@ -945,18 +948,18 @@ public:
|
||||
|
||||
};
|
||||
|
||||
enum eWarlockSpells
|
||||
enum WarlockSpells
|
||||
{
|
||||
SPELL_HELLFIRE = 65816,
|
||||
SPELL_CORRUPTION = 65810,
|
||||
SPELL_CURSE_OF_AGONY = 65814,
|
||||
SPELL_CURSE_OF_EXHAUSTION = 65815,
|
||||
SPELL_FEAR = 65809, //8s
|
||||
SPELL_SEARING_PAIN = 65819,
|
||||
SPELL_SHADOW_BOLT = 65821,
|
||||
SPELL_UNSTABLE_AFFLICTION = 65812,
|
||||
SPELL_SUMMON_FELHUNTER = 67514,
|
||||
H_SPELL_UNSTABLE_AFFLICTION = 68155, //15s
|
||||
SPELL_HELLFIRE = 65816,
|
||||
SPELL_CORRUPTION = 65810,
|
||||
SPELL_CURSE_OF_AGONY = 65814,
|
||||
SPELL_CURSE_OF_EXHAUSTION = 65815,
|
||||
SPELL_FEAR = 65809, // 8s
|
||||
SPELL_SEARING_PAIN = 65819,
|
||||
SPELL_SHADOW_BOLT = 65821,
|
||||
SPELL_UNSTABLE_AFFLICTION = 65812, // 15s
|
||||
SPELL_UNSTABLE_AFFLICTION_DISPEL = 65813,
|
||||
SPELL_SUMMON_FELHUNTER = 67514,
|
||||
};
|
||||
|
||||
class mob_toc_warlock : public CreatureScript
|
||||
@@ -2030,6 +2033,40 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_faction_champion_warl_unstable_affliction : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_faction_champion_warl_unstable_affliction() : SpellScriptLoader("spell_faction_champion_warl_unstable_affliction") { }
|
||||
|
||||
class spell_faction_champion_warl_unstable_affliction_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_faction_champion_warl_unstable_affliction_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_UNSTABLE_AFFLICTION_DISPEL))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDispel(DispelInfo* dispelInfo)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(dispelInfo->GetDispeller(), SPELL_UNSTABLE_AFFLICTION_DISPEL, true, NULL, GetEffect(EFFECT_0));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterDispel += AuraDispelFn(spell_faction_champion_warl_unstable_affliction_AuraScript::HandleDispel);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_faction_champion_warl_unstable_affliction_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_faction_champions()
|
||||
{
|
||||
new boss_toc_champion_controller();
|
||||
@@ -2049,4 +2086,5 @@ void AddSC_boss_faction_champions()
|
||||
new mob_toc_retro_paladin();
|
||||
new mob_toc_pet_warlock();
|
||||
new mob_toc_pet_hunter();
|
||||
new spell_faction_champion_warl_unstable_affliction();
|
||||
}
|
||||
|
||||
@@ -15,7 +15,10 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ScriptPCH.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "naxxramas.h"
|
||||
|
||||
enum Horsemen
|
||||
@@ -26,6 +29,11 @@ enum Horsemen
|
||||
HORSEMEN_SIR,
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_MARK_DAMAGE = 28836
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_NONE,
|
||||
@@ -395,7 +403,63 @@ public:
|
||||
|
||||
};
|
||||
|
||||
class spell_four_horsemen_mark : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_four_horsemen_mark() : SpellScriptLoader("spell_four_horsemen_mark") { }
|
||||
|
||||
class spell_four_horsemen_mark_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_four_horsemen_mark_AuraScript);
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
int32 damage;
|
||||
switch (GetStackAmount())
|
||||
{
|
||||
case 1:
|
||||
damage = 0;
|
||||
break;
|
||||
case 2:
|
||||
damage = 500;
|
||||
break;
|
||||
case 3:
|
||||
damage = 1000;
|
||||
break;
|
||||
case 4:
|
||||
damage = 1500;
|
||||
break;
|
||||
case 5:
|
||||
damage = 4000;
|
||||
break;
|
||||
case 6:
|
||||
damage = 12000;
|
||||
break;
|
||||
default:
|
||||
damage = 20000 + 1000 * (GetStackAmount() - 7);
|
||||
break;
|
||||
}
|
||||
if (damage)
|
||||
caster->CastCustomSpell(SPELL_MARK_DAMAGE, SPELLVALUE_BASE_POINT0, damage, GetTarget());
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_four_horsemen_mark_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_four_horsemen_mark_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_four_horsemen()
|
||||
{
|
||||
new boss_four_horsemen();
|
||||
new spell_four_horsemen_mark();
|
||||
}
|
||||
|
||||
@@ -15,7 +15,11 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ScriptPCH.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "CombatAI.h"
|
||||
#include "naxxramas.h"
|
||||
|
||||
enum Yells
|
||||
@@ -25,6 +29,7 @@ enum Yells
|
||||
SAY_DEATH = -1533042,
|
||||
SAY_TELEPORT = -1533043
|
||||
};
|
||||
|
||||
//Gothik
|
||||
enum Spells
|
||||
{
|
||||
@@ -36,8 +41,11 @@ enum Spells
|
||||
SPELL_INFORM_LIVE_RIDER = 27935,
|
||||
SPELL_INFORM_DEAD_TRAINEE = 27915,
|
||||
SPELL_INFORM_DEAD_KNIGHT = 27931,
|
||||
SPELL_INFORM_DEAD_RIDER = 27937
|
||||
SPELL_INFORM_DEAD_RIDER = 27937,
|
||||
|
||||
SPELL_SHADOW_MARK = 27825
|
||||
};
|
||||
|
||||
enum Creatures
|
||||
{
|
||||
MOB_LIVE_TRAINEE = 16124,
|
||||
@@ -585,8 +593,35 @@ class mob_gothik_minion : public CreatureScript
|
||||
}
|
||||
};
|
||||
|
||||
class spell_gothik_shadow_bolt_volley : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gothik_shadow_bolt_volley() : SpellScriptLoader("spell_gothik_shadow_bolt_volley") { }
|
||||
|
||||
class spell_gothik_shadow_bolt_volley_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gothik_shadow_bolt_volley_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<Unit*>& unitList)
|
||||
{
|
||||
unitList.remove_if(Trinity::UnitAuraCheck(false, SPELL_SHADOW_MARK));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnUnitTargetSelect += SpellUnitTargetFn(spell_gothik_shadow_bolt_volley_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_gothik_shadow_bolt_volley_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_gothik()
|
||||
{
|
||||
new boss_gothik();
|
||||
new mob_gothik_minion();
|
||||
new spell_gothik_shadow_bolt_volley();
|
||||
}
|
||||
|
||||
@@ -86,6 +86,7 @@ enum Spells
|
||||
SPELL_SHADOW_FISURE = 27810,
|
||||
SPELL_VOID_BLAST = 27812,
|
||||
SPELL_MANA_DETONATION = 27819,
|
||||
SPELL_MANA_DETONATION_DAMAGE = 27820,
|
||||
SPELL_FROST_BLAST = 27808,
|
||||
SPELL_CHAINS_OF_KELTHUZAD = 28410, //28408 script effect
|
||||
SPELL_KELTHUZAD_CHANNEL = 29423,
|
||||
@@ -773,6 +774,46 @@ class npc_kelthuzad_abomination : public CreatureScript
|
||||
}
|
||||
};
|
||||
|
||||
class spell_kelthuzad_detonate_mana : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_kelthuzad_detonate_mana() : SpellScriptLoader("spell_kelthuzad_detonate_mana") { }
|
||||
|
||||
class spell_kelthuzad_detonate_mana_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_kelthuzad_detonate_mana_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MANA_DETONATION_DAMAGE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleScript(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
Unit* target = GetTarget();
|
||||
if (int32 mana = int32(target->GetMaxPower(POWER_MANA) / 10))
|
||||
{
|
||||
mana = target->ModifyPower(POWER_MANA, -mana);
|
||||
target->CastCustomSpell(SPELL_MANA_DETONATION_DAMAGE, SPELLVALUE_BASE_POINT0, -mana * 10, target, true, NULL, aurEff);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_kelthuzad_detonate_mana_AuraScript::HandleScript, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_kelthuzad_detonate_mana_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_just_cant_get_enough : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
@@ -796,5 +837,6 @@ void AddSC_boss_kelthuzad()
|
||||
new boss_kelthuzad();
|
||||
new at_kelthuzad_center();
|
||||
new npc_kelthuzad_abomination();
|
||||
new spell_kelthuzad_detonate_mana();
|
||||
new achievement_just_cant_get_enough();
|
||||
}
|
||||
|
||||
@@ -19,11 +19,13 @@
|
||||
/* ScriptData
|
||||
SDName: Boss Loken
|
||||
SD%Complete: 60%
|
||||
SDComment: Missing intro. Remove hack of Pulsing Shockwave when core supports. Aura is not working (59414)
|
||||
SDComment: Missing intro.
|
||||
SDCategory: Halls of Lightning
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptPCH.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "halls_of_lightning.h"
|
||||
|
||||
enum eEnums
|
||||
@@ -73,23 +75,17 @@ public:
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
bool m_bIsAura;
|
||||
|
||||
uint32 m_uiArcLightning_Timer;
|
||||
uint32 m_uiLightningNova_Timer;
|
||||
uint32 m_uiPulsingShockwave_Timer;
|
||||
uint32 m_uiResumePulsingShockwave_Timer;
|
||||
|
||||
uint32 m_uiHealthAmountModifier;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_bIsAura = false;
|
||||
|
||||
m_uiArcLightning_Timer = 15000;
|
||||
m_uiLightningNova_Timer = 20000;
|
||||
m_uiPulsingShockwave_Timer = 2000;
|
||||
m_uiResumePulsingShockwave_Timer = 15000;
|
||||
m_uiResumePulsingShockwave_Timer = 1000;
|
||||
|
||||
m_uiHealthAmountModifier = 1;
|
||||
|
||||
@@ -116,7 +112,10 @@ public:
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
if (instance)
|
||||
{
|
||||
instance->SetData(TYPE_LOKEN, DONE);
|
||||
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_PULSING_SHOCKWAVE_AURA);
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
@@ -130,44 +129,13 @@ public:
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (m_bIsAura)
|
||||
{
|
||||
// workaround for PULSING_SHOCKWAVE
|
||||
if (m_uiPulsingShockwave_Timer <= uiDiff)
|
||||
{
|
||||
Map* map = me->GetMap();
|
||||
if (map->IsDungeon())
|
||||
{
|
||||
Map::PlayerList const &PlayerList = map->GetPlayers();
|
||||
|
||||
if (PlayerList.isEmpty())
|
||||
return;
|
||||
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (i->getSource() && i->getSource()->isAlive() && i->getSource()->isTargetableForAttack())
|
||||
{
|
||||
int32 dmg;
|
||||
float m_fDist = me->GetExactDist(i->getSource()->GetPositionX(), i->getSource()->GetPositionY(), i->getSource()->GetPositionZ());
|
||||
|
||||
dmg = DUNGEON_MODE(100, 150); // need to correct damage
|
||||
if (m_fDist > 1.0f) // Further from 1 yard
|
||||
dmg = int32(dmg*m_fDist);
|
||||
|
||||
me->CastCustomSpell(i->getSource(), DUNGEON_MODE(52942, 59837), &dmg, 0, 0, false);
|
||||
}
|
||||
}
|
||||
m_uiPulsingShockwave_Timer = 2000;
|
||||
} else m_uiPulsingShockwave_Timer -= uiDiff;
|
||||
}
|
||||
else
|
||||
if (m_uiResumePulsingShockwave_Timer)
|
||||
{
|
||||
if (m_uiResumePulsingShockwave_Timer <= uiDiff)
|
||||
{
|
||||
//breaks at movement, can we assume when it's time, this spell is casted and also must stop movement?
|
||||
DoCast(me, SPELL_PULSING_SHOCKWAVE_AURA, true);
|
||||
|
||||
DoCast(me, SPELL_PULSING_SHOCKWAVE_N); // need core support
|
||||
m_bIsAura = true;
|
||||
DoCast(me, SPELL_PULSING_SHOCKWAVE_N, true);
|
||||
m_uiResumePulsingShockwave_Timer = 0;
|
||||
}
|
||||
else
|
||||
@@ -190,7 +158,7 @@ public:
|
||||
Talk(EMOTE_NOVA);
|
||||
DoCast(me, SPELL_LIGHTNING_NOVA_N);
|
||||
|
||||
m_bIsAura = false;
|
||||
me->RemoveAurasDueToSpell(DUNGEON_MODE<uint32>(SPELL_PULSING_SHOCKWAVE_N, SPELL_PULSING_SHOCKWAVE_H));
|
||||
m_uiResumePulsingShockwave_Timer = DUNGEON_MODE(5000, 4000); // Pause Pulsing Shockwave aura
|
||||
m_uiLightningNova_Timer = urand(20000, 21000);
|
||||
}
|
||||
@@ -216,7 +184,39 @@ public:
|
||||
|
||||
};
|
||||
|
||||
class spell_loken_pulsing_shockwave : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_loken_pulsing_shockwave() : SpellScriptLoader("spell_loken_pulsing_shockwave") { }
|
||||
|
||||
class spell_loken_pulsing_shockwave_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_loken_pulsing_shockwave_SpellScript);
|
||||
|
||||
void CalculateDamage()
|
||||
{
|
||||
if (!GetHitUnit())
|
||||
return;
|
||||
|
||||
float distance = GetCaster()->GetDistance2d(GetHitUnit());
|
||||
if (distance > 1.0f)
|
||||
SetHitDamage(int32(GetHitDamage() * distance));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnHit += SpellHitFn(spell_loken_pulsing_shockwave_SpellScript::CalculateDamage);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_loken_pulsing_shockwave_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_loken()
|
||||
{
|
||||
new boss_loken();
|
||||
new spell_loken_pulsing_shockwave();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,9 @@ SDComment:
|
||||
SDCategory:
|
||||
Script Data End */
|
||||
|
||||
#include "ScriptPCH.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "halls_of_stone.h"
|
||||
|
||||
enum Spells
|
||||
@@ -162,12 +164,7 @@ public:
|
||||
//this part should be in the core
|
||||
if (pSpell->Id == SPELL_SHATTER || pSpell->Id == H_SPELL_SHATTER)
|
||||
{
|
||||
//this spell must have custom handling in the core, dealing damage based on distance
|
||||
target->CastSpell(target, DUNGEON_MODE(SPELL_SHATTER_EFFECT, H_SPELL_SHATTER_EFFECT), true);
|
||||
|
||||
if (target->HasAura(SPELL_STONED))
|
||||
target->RemoveAurasDueToSpell(SPELL_STONED);
|
||||
|
||||
// todo: we need eventmap to kill this stuff
|
||||
//clear this, if we are still performing
|
||||
if (bIsSlam)
|
||||
{
|
||||
@@ -186,7 +183,74 @@ public:
|
||||
|
||||
};
|
||||
|
||||
class spell_krystallus_shatter : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_krystallus_shatter() : SpellScriptLoader("spell_krystallus_shatter") { }
|
||||
|
||||
class spell_krystallus_shatter_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_krystallus_shatter_SpellScript);
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
target->RemoveAurasDueToSpell(SPELL_STONED);
|
||||
target->CastSpell((Unit*)NULL, SPELL_SHATTER_EFFECT, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_krystallus_shatter_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_krystallus_shatter_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_krystallus_shatter_effect : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_krystallus_shatter_effect() : SpellScriptLoader("spell_krystallus_shatter_effect") { }
|
||||
|
||||
class spell_krystallus_shatter_effect_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_krystallus_shatter_effect_SpellScript);
|
||||
|
||||
void CalculateDamage()
|
||||
{
|
||||
if (!GetHitUnit())
|
||||
return;
|
||||
|
||||
float radius = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster());
|
||||
if (!radius)
|
||||
return;
|
||||
|
||||
float distance = GetCaster()->GetDistance2d(GetHitUnit());
|
||||
if (distance > 1.0f)
|
||||
SetHitDamage(int32(GetHitDamage() * ((radius - distance) / radius)));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnHit += SpellHitFn(spell_krystallus_shatter_effect_SpellScript::CalculateDamage);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_krystallus_shatter_effect_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_krystallus()
|
||||
{
|
||||
new boss_krystallus();
|
||||
new spell_krystallus_shatter();
|
||||
new spell_krystallus_shatter_effect();
|
||||
}
|
||||
|
||||
@@ -51,6 +51,8 @@ enum VezaxSpells
|
||||
SPELL_SHADOW_CRASH_HIT = 62659,
|
||||
SPELL_SURGE_OF_DARKNESS = 62662,
|
||||
SPELL_SARONITE_VAPORS = 63323,
|
||||
SPELL_SARONITE_VAPORS_ENERGIZE = 63337,
|
||||
SPELL_SARONITE_VAPORS_DAMAGE = 63338,
|
||||
SPELL_SUMMON_SARONITE_VAPORS = 63081,
|
||||
SPELL_BERSERK = 26662,
|
||||
|
||||
@@ -463,6 +465,45 @@ class spell_mark_of_the_faceless : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class spell_general_vezax_saronite_vapors : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_general_vezax_saronite_vapors() : SpellScriptLoader("spell_general_vezax_saronite_vapors") { }
|
||||
|
||||
class spell_general_vezax_saronite_vapors_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_general_vezax_saronite_vapors_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SARONITE_VAPORS_ENERGIZE) || !sSpellMgr->GetSpellInfo(SPELL_SARONITE_VAPORS_DAMAGE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
int32 mana = int32(aurEff->GetAmount() * pow(2.0f, GetStackAmount())); // mana restore - bp * 2^stackamount
|
||||
int32 damage = mana * 2;
|
||||
caster->CastCustomSpell(GetTarget(), SPELL_SARONITE_VAPORS_ENERGIZE, &mana, NULL, NULL, true);
|
||||
caster->CastCustomSpell(GetTarget(), SPELL_SARONITE_VAPORS_DAMAGE, &damage, NULL, NULL, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_general_vezax_saronite_vapors_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_general_vezax_saronite_vapors_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_shadowdodger : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
@@ -509,6 +550,7 @@ void AddSC_boss_general_vezax()
|
||||
new boss_saronite_animus();
|
||||
new npc_saronite_vapors();
|
||||
new spell_mark_of_the_faceless();
|
||||
new spell_general_vezax_saronite_vapors();
|
||||
new achievement_shadowdodger();
|
||||
new achievement_smell_saronite();
|
||||
}
|
||||
|
||||
@@ -19,11 +19,13 @@
|
||||
/* ScriptData
|
||||
SDName: Boss_Gruul
|
||||
SD%Complete: 60
|
||||
SDComment: Ground Slam need further development (knock back effect and shatter effect must be added to the core)
|
||||
SDComment: Ground Slam need further development (knock back effect must be added to the core)
|
||||
SDCategory: Gruul's Lair
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptPCH.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "gruuls_lair.h"
|
||||
|
||||
enum eEnums
|
||||
@@ -144,12 +146,7 @@ public:
|
||||
//this part should be in the core
|
||||
if (pSpell->Id == SPELL_SHATTER)
|
||||
{
|
||||
//this spell must have custom handling in the core, dealing damage based on distance
|
||||
target->CastSpell(target, SPELL_SHATTER_EFFECT, true);
|
||||
|
||||
if (target->HasAura(SPELL_STONED))
|
||||
target->RemoveAurasDueToSpell(SPELL_STONED);
|
||||
|
||||
// todo: use eventmap to kill this stuff
|
||||
//clear this, if we are still performing
|
||||
if (m_bPerformingGroundSlam)
|
||||
{
|
||||
@@ -258,7 +255,83 @@ public:
|
||||
|
||||
};
|
||||
|
||||
class spell_gruul_shatter : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gruul_shatter() : SpellScriptLoader("spell_gruul_shatter") { }
|
||||
|
||||
class spell_gruul_shatter_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gruul_shatter_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_STONED))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SHATTER_EFFECT))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
target->RemoveAurasDueToSpell(SPELL_STONED);
|
||||
target->CastSpell((Unit*)NULL, SPELL_SHATTER_EFFECT, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gruul_shatter_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_gruul_shatter_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_gruul_shatter_effect : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gruul_shatter_effect() : SpellScriptLoader("spell_gruul_shatter_effect") { }
|
||||
|
||||
class spell_gruul_shatter_effect_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gruul_shatter_effect_SpellScript);
|
||||
|
||||
void CalculateDamage()
|
||||
{
|
||||
if (!GetHitUnit())
|
||||
return;
|
||||
|
||||
float radius = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster());
|
||||
if (!radius)
|
||||
return;
|
||||
|
||||
float distance = GetCaster()->GetDistance2d(GetHitUnit());
|
||||
if (distance > 1.0f)
|
||||
SetHitDamage(int32(GetHitDamage() * ((radius - distance) / radius)));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnHit += SpellHitFn(spell_gruul_shatter_effect_SpellScript::CalculateDamage);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_gruul_shatter_effect_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_gruul()
|
||||
{
|
||||
new boss_gruul();
|
||||
new spell_gruul_shatter();
|
||||
new spell_gruul_shatter_effect();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,10 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ScriptPCH.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
enum Texts
|
||||
{
|
||||
@@ -36,6 +39,7 @@ enum Spells
|
||||
SPELL_THUNDERCLAP = 36706,
|
||||
SPELL_VOID_BOLT = 39329,
|
||||
SPELL_MARK_OF_KAZZAK = 32960,
|
||||
SPELL_MARK_OF_KAZZAK_DAMAGE = 32961,
|
||||
SPELL_ENRAGE = 32964,
|
||||
SPELL_CAPTURE_SOUL = 32966,
|
||||
SPELL_TWISTED_REFLECTION = 21063,
|
||||
@@ -171,7 +175,55 @@ class boss_doomlord_kazzak : public CreatureScript
|
||||
}
|
||||
};
|
||||
|
||||
class spell_mark_of_kazzak : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mark_of_kazzak() : SpellScriptLoader("spell_mark_of_kazzak") { }
|
||||
|
||||
class spell_mark_of_kazzak_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mark_of_kazzak_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MARK_OF_KAZZAK_DAMAGE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (Unit* owner = GetUnitOwner())
|
||||
amount = CalculatePctU(owner->GetPower(POWER_MANA), 5);
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
|
||||
if (target->GetPower(POWER_MANA) == 0)
|
||||
{
|
||||
target->CastSpell(target, SPELL_MARK_OF_KAZZAK_DAMAGE, true, NULL, aurEff);
|
||||
// Remove aura
|
||||
SetDuration(0);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mark_of_kazzak_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_MANA_LEECH);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mark_of_kazzak_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_MANA_LEECH);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_mark_of_kazzak_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_doomlordkazzak()
|
||||
{
|
||||
new boss_doomlord_kazzak();
|
||||
new spell_mark_of_kazzak();
|
||||
}
|
||||
|
||||
@@ -738,14 +738,14 @@ class spell_dk_death_coil : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_dk_death_coil_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*SpellEntry*/)
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DEATH_COIL_DAMAGE) || !sSpellMgr->GetSpellInfo(SPELL_DEATH_COIL_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
int32 damage = GetEffectValue();
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
@@ -28,7 +28,11 @@
|
||||
enum DruidSpells
|
||||
{
|
||||
DRUID_INCREASED_MOONFIRE_DURATION = 38414,
|
||||
DRUID_NATURES_SPLENDOR = 57865
|
||||
DRUID_NATURES_SPLENDOR = 57865,
|
||||
DRUID_LIFEBLOOM_FINAL_HEAL = 33778,
|
||||
DRUID_LIFEBLOOM_ENERGIZE = 64372,
|
||||
DRUID_SURVIVAL_INSTINCTS = 50322,
|
||||
DRUID_SAVAGE_ROAR = 62071
|
||||
};
|
||||
|
||||
// 54846 Glyph of Starfire
|
||||
@@ -154,7 +158,7 @@ class spell_dru_primal_tenacity : public SpellScriptLoader
|
||||
void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
|
||||
{
|
||||
// reduces all damage taken while Stunned in Cat Form
|
||||
if (GetTarget()->GetShapeshiftForm() == FORM_CAT && GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN))
|
||||
if (GetTarget()->GetShapeshiftForm() == FORM_CAT && GetTarget()->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN))
|
||||
absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
|
||||
}
|
||||
|
||||
@@ -328,6 +332,26 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class StarfallDummyTargetFilter
|
||||
{
|
||||
public:
|
||||
StarfallDummyTargetFilter(Unit* caster) : _caster(caster) { }
|
||||
|
||||
bool operator()(Unit* target) const
|
||||
{
|
||||
if (target->HasStealthAura() || target->HasInvisibilityAura())
|
||||
return true;
|
||||
|
||||
if (!target->IsWithinLOSInMap(_caster))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
Unit* _caster;
|
||||
};
|
||||
|
||||
class spell_dru_starfall_dummy : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -337,7 +361,14 @@ class spell_dru_starfall_dummy : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_dru_starfall_dummy_SpellScript);
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
void FilterTargets(std::list<Unit*>& unitList)
|
||||
{
|
||||
// Remove targets not in LoS or in stealth
|
||||
unitList.remove_if(StarfallDummyTargetFilter(GetCaster()));
|
||||
Trinity::Containers::RandomResizeList(unitList, 2);
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
// Shapeshifting into an animal form or mounting cancels the effect
|
||||
@@ -348,15 +379,16 @@ class spell_dru_starfall_dummy : public SpellScriptLoader
|
||||
return;
|
||||
}
|
||||
|
||||
//Any effect which causes you to lose control of your character will supress the starfall effect.
|
||||
// Any effect which causes you to lose control of your character will supress the starfall effect.
|
||||
if (caster->HasUnitState(UNIT_STATE_CONTROLLED))
|
||||
return;
|
||||
|
||||
caster->CastSpell(GetHitUnit(), GetEffectValue(), true);
|
||||
caster->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnUnitTargetSelect += SpellUnitTargetFn(spell_dru_starfall_dummy_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_dru_starfall_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
@@ -367,6 +399,247 @@ class spell_dru_starfall_dummy : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class spell_dru_lifebloom : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_dru_lifebloom() : SpellScriptLoader("spell_dru_lifebloom") { }
|
||||
|
||||
class spell_dru_lifebloom_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dru_lifebloom_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(DRUID_LIFEBLOOM_FINAL_HEAL))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(DRUID_LIFEBLOOM_ENERGIZE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
// Final heal only on duration end
|
||||
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
|
||||
return;
|
||||
|
||||
// final heal
|
||||
int32 stack = GetStackAmount();
|
||||
int32 healAmount = aurEff->GetAmount();
|
||||
Unit* caster = GetCaster();
|
||||
if (caster)
|
||||
{
|
||||
healAmount = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), healAmount, HEAL, stack);
|
||||
healAmount = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, stack);
|
||||
}
|
||||
|
||||
GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
|
||||
|
||||
// restore mana
|
||||
if (caster)
|
||||
{
|
||||
int32 returnMana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * stack / 2;
|
||||
caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
|
||||
}
|
||||
}
|
||||
|
||||
void HandleDispel(DispelInfo* dispelInfo)
|
||||
{
|
||||
if (Unit* target = GetUnitOwner())
|
||||
{
|
||||
if (AuraEffect const* aurEff = GetEffect(EFFECT_1))
|
||||
{
|
||||
// final heal
|
||||
int32 healAmount = aurEff->GetAmount();
|
||||
Unit* caster = GetCaster();
|
||||
if (caster)
|
||||
{
|
||||
healAmount = caster->SpellHealingBonusDone(target, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges());
|
||||
healAmount = target->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges());
|
||||
}
|
||||
|
||||
target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());
|
||||
|
||||
// restore mana
|
||||
if (caster)
|
||||
{
|
||||
int32 returnMana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * dispelInfo->GetRemovedCharges() / 2;
|
||||
caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, NULL, GetCasterGUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_dru_lifebloom_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterDispel += AuraDispelFn(spell_dru_lifebloom_AuraScript::HandleDispel);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_dru_lifebloom_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_dru_predatory_strikes : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_dru_predatory_strikes() : SpellScriptLoader("spell_dru_predatory_strikes") { }
|
||||
|
||||
class spell_dru_predatory_strikes_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dru_predatory_strikes_AuraScript);
|
||||
|
||||
void UpdateAmount(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Player* target = GetTarget()->ToPlayer())
|
||||
target->UpdateAttackPowerAndDamage();
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_dru_predatory_strikes_AuraScript::UpdateAmount, EFFECT_ALL, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_dru_predatory_strikes_AuraScript::UpdateAmount, EFFECT_ALL, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_dru_predatory_strikes_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_dru_savage_roar : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_dru_savage_roar() : SpellScriptLoader("spell_dru_savage_roar") { }
|
||||
|
||||
class spell_dru_savage_roar_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_dru_savage_roar_SpellScript);
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (caster->GetShapeshiftForm() != FORM_CAT)
|
||||
return SPELL_FAILED_ONLY_SHAPESHIFT;
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_dru_savage_roar_SpellScript::CheckCast);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_dru_savage_roar_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dru_savage_roar_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(DRUID_SAVAGE_ROAR))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
target->CastSpell(target, DRUID_SAVAGE_ROAR, true, NULL, aurEff, GetCasterGUID());
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetTarget()->RemoveAurasDueToSpell(DRUID_SAVAGE_ROAR);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_dru_savage_roar_AuraScript::AfterApply, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_dru_savage_roar_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_dru_savage_roar_SpellScript();
|
||||
}
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_dru_savage_roar_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_dru_survival_instincts : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_dru_survival_instincts() : SpellScriptLoader("spell_dru_survival_instincts") { }
|
||||
|
||||
class spell_dru_survival_instincts_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_dru_survival_instincts_SpellScript);
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster->IsInFeralForm())
|
||||
return SPELL_FAILED_ONLY_SHAPESHIFT;
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_dru_survival_instincts_SpellScript::CheckCast);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_dru_survival_instincts_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_dru_survival_instincts_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(DRUID_SURVIVAL_INSTINCTS))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
int32 bp0 = target->CountPctFromMaxHealth(aurEff->GetAmount());
|
||||
target->CastCustomSpell(target, DRUID_SURVIVAL_INSTINCTS, &bp0, NULL, NULL, true);
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetTarget()->RemoveAurasDueToSpell(DRUID_SURVIVAL_INSTINCTS);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_dru_survival_instincts_AuraScript::AfterApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_dru_survival_instincts_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_dru_survival_instincts_SpellScript();
|
||||
}
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_dru_survival_instincts_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_druid_spell_scripts()
|
||||
{
|
||||
new spell_dru_glyph_of_starfire();
|
||||
@@ -377,4 +650,8 @@ void AddSC_druid_spell_scripts()
|
||||
new spell_dru_starfall_aoe();
|
||||
new spell_dru_swift_flight_passive();
|
||||
new spell_dru_starfall_dummy();
|
||||
new spell_dru_lifebloom();
|
||||
new spell_dru_predatory_strikes();
|
||||
new spell_dru_savage_roar();
|
||||
new spell_dru_survival_instincts();
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ class spell_gen_parachute : public SpellScriptLoader
|
||||
{
|
||||
PrepareAuraScript(spell_gen_parachute_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PARACHUTE) || !sSpellMgr->GetSpellInfo(SPELL_PARACHUTE_BUFF))
|
||||
return false;
|
||||
@@ -252,7 +252,12 @@ class spell_gen_parachute : public SpellScriptLoader
|
||||
if (target->IsFalling())
|
||||
{
|
||||
target->RemoveAurasDueToSpell(SPELL_PARACHUTE);
|
||||
target->CastSpell(target, SPELL_PARACHUTE_BUFF, true);
|
||||
|
||||
float x, y, z;
|
||||
target->GetPosition(x, y, z);
|
||||
float groundZ = target->GetMap()->GetHeight(target->GetPhaseMask(), x, y, z);
|
||||
if (fabs(groundZ - z) > 0.1f)
|
||||
target->CastSpell(target, SPELL_PARACHUTE_BUFF, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2739,6 +2744,352 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
enum GenericBandage
|
||||
{
|
||||
SPELL_RECENTLY_BANDAGED = 11196,
|
||||
};
|
||||
|
||||
class spell_gen_bandage : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_bandage() : SpellScriptLoader("spell_gen_bandage") { }
|
||||
|
||||
class spell_gen_bandage_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_bandage_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_RECENTLY_BANDAGED))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
if (Unit* target = GetExplTargetUnit())
|
||||
{
|
||||
if (target->HasAura(SPELL_RECENTLY_BANDAGED))
|
||||
return SPELL_FAILED_TARGET_AURASTATE;
|
||||
}
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void HandleScript()
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->CastSpell(target, SPELL_RECENTLY_BANDAGED, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_gen_bandage_SpellScript::CheckCast);
|
||||
AfterHit += SpellHitFn(spell_gen_bandage_SpellScript::HandleScript);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_gen_bandage_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum GenericLifebloom
|
||||
{
|
||||
SPELL_HEXLORD_MALACRASS_LIFEBLOOM_FINAL_HEAL = 43422,
|
||||
SPELL_TUR_RAGEPAW_LIFEBLOOM_FINAL_HEAL = 52552,
|
||||
SPELL_CENARION_SCOUT_LIFEBLOOM_FINAL_HEAL = 53692,
|
||||
SPELL_TWISTED_VISAGE_LIFEBLOOM_FINAL_HEAL = 57763,
|
||||
SPELL_FACTION_CHAMPIONS_DRU_LIFEBLOOM_FINAL_HEAL = 66094,
|
||||
};
|
||||
|
||||
class spell_gen_lifebloom : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_lifebloom(const char* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { }
|
||||
|
||||
class spell_gen_lifebloom_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_gen_lifebloom_AuraScript);
|
||||
|
||||
public:
|
||||
spell_gen_lifebloom_AuraScript(uint32 spellId) : AuraScript(), _spellId(spellId) { }
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(_spellId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
// Final heal only on duration end
|
||||
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
|
||||
return;
|
||||
|
||||
// final heal
|
||||
GetTarget()->CastSpell(GetTarget(), _spellId, true, NULL, aurEff, GetCasterGUID());
|
||||
}
|
||||
|
||||
void HandleDispel(DispelInfo* /*dispelInfo*/)
|
||||
{
|
||||
// final heal
|
||||
if (Unit* target = GetUnitOwner())
|
||||
target->CastSpell(target, _spellId, true, NULL, GetEffect(EFFECT_0), GetCasterGUID());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_gen_lifebloom_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterDispel += AuraDispelFn(spell_gen_lifebloom_AuraScript::HandleDispel);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _spellId;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_gen_lifebloom_AuraScript(_spellId);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _spellId;
|
||||
};
|
||||
|
||||
enum SummonElemental
|
||||
{
|
||||
SPELL_SUMMON_FIRE_ELEMENTAL = 8985,
|
||||
SPELL_SUMMON_EARTH_ELEMENTAL = 19704
|
||||
};
|
||||
|
||||
class spell_gen_summon_elemental : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_summon_elemental(const char* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { }
|
||||
|
||||
class spell_gen_summon_elemental_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_gen_summon_elemental_AuraScript);
|
||||
|
||||
public:
|
||||
spell_gen_summon_elemental_AuraScript(uint32 spellId) : AuraScript(), _spellId(spellId) { }
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(_spellId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetCaster())
|
||||
if (Unit* owner = GetCaster()->GetOwner())
|
||||
if (owner->GetTypeId() == TYPEID_PLAYER) // todo: this check is maybe wrong
|
||||
owner->CastSpell(owner, _spellId, true);
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetCaster())
|
||||
if (Unit* owner = GetCaster()->GetOwner())
|
||||
if (owner->GetTypeId() == TYPEID_PLAYER) // todo: this check is maybe wrong
|
||||
owner->ToPlayer()->RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_gen_summon_elemental_AuraScript::AfterApply, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_gen_summon_elemental_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _spellId;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_gen_summon_elemental_AuraScript(_spellId);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _spellId;
|
||||
};
|
||||
|
||||
enum Mounts
|
||||
{
|
||||
SPELL_COLD_WEATHER_FLYING = 54197,
|
||||
|
||||
// Magic Broom
|
||||
SPELL_MAGIC_BROOM_60 = 42680,
|
||||
SPELL_MAGIC_BROOM_100 = 42683,
|
||||
SPELL_MAGIC_BROOM_150 = 42667,
|
||||
SPELL_MAGIC_BROOM_280 = 42668,
|
||||
|
||||
// Headless Horseman's Mount
|
||||
SPELL_HEADLESS_HORSEMAN_MOUNT_60 = 51621,
|
||||
SPELL_HEADLESS_HORSEMAN_MOUNT_100 = 48024,
|
||||
SPELL_HEADLESS_HORSEMAN_MOUNT_150 = 51617,
|
||||
SPELL_HEADLESS_HORSEMAN_MOUNT_280 = 48023,
|
||||
|
||||
// Winged Steed of the Ebon Blade
|
||||
SPELL_WINGED_STEED_150 = 54726,
|
||||
SPELL_WINGED_STEED_280 = 54727,
|
||||
|
||||
// Big Love Rocket
|
||||
SPELL_BIG_LOVE_ROCKET_0 = 71343,
|
||||
SPELL_BIG_LOVE_ROCKET_60 = 71344,
|
||||
SPELL_BIG_LOVE_ROCKET_100 = 71345,
|
||||
SPELL_BIG_LOVE_ROCKET_150 = 71346,
|
||||
SPELL_BIG_LOVE_ROCKET_310 = 71347,
|
||||
|
||||
// Invincible
|
||||
SPELL_INVINCIBLE_60 = 72281,
|
||||
SPELL_INVINCIBLE_100 = 72282,
|
||||
SPELL_INVINCIBLE_150 = 72283,
|
||||
SPELL_INVINCIBLE_310 = 72284,
|
||||
|
||||
// Blazing Hippogryph
|
||||
SPELL_BLAZING_HIPPOGRYPH_150 = 74854,
|
||||
SPELL_BLAZING_HIPPOGRYPH_280 = 74855,
|
||||
|
||||
// Celestial Steed
|
||||
SPELL_CELESTIAL_STEED_60 = 75619,
|
||||
SPELL_CELESTIAL_STEED_100 = 75620,
|
||||
SPELL_CELESTIAL_STEED_150 = 75617,
|
||||
SPELL_CELESTIAL_STEED_280 = 75618,
|
||||
SPELL_CELESTIAL_STEED_310 = 76153,
|
||||
|
||||
// X-53 Touring Rocket
|
||||
SPELL_X53_TOURING_ROCKET_150 = 75957,
|
||||
SPELL_X53_TOURING_ROCKET_280 = 75972,
|
||||
SPELL_X53_TOURING_ROCKET_310 = 76154,
|
||||
};
|
||||
|
||||
class spell_gen_mount : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_mount(const char* name, uint32 mount0 = 0, uint32 mount60 = 0, uint32 mount100 = 0, uint32 mount150 = 0, uint32 mount280 = 0, uint32 mount310 = 0) : SpellScriptLoader(name),
|
||||
_mount0(mount0), _mount60(mount60), _mount100(mount100), _mount150(mount150), _mount280(mount280), _mount310(mount310) { }
|
||||
|
||||
class spell_gen_mount_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_mount_SpellScript);
|
||||
|
||||
public:
|
||||
spell_gen_mount_SpellScript(uint32 mount0, uint32 mount60, uint32 mount100, uint32 mount150, uint32 mount280, uint32 mount310) : SpellScript(),
|
||||
_mount0(mount0), _mount60(mount60), _mount100(mount100), _mount150(mount150), _mount280(mount280), _mount310(mount310) { }
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (_mount0 && !sSpellMgr->GetSpellInfo(_mount0))
|
||||
return false;
|
||||
if (_mount60 && !sSpellMgr->GetSpellInfo(_mount60))
|
||||
return false;
|
||||
if (_mount100 && !sSpellMgr->GetSpellInfo(_mount100))
|
||||
return false;
|
||||
if (_mount150 && !sSpellMgr->GetSpellInfo(_mount150))
|
||||
return false;
|
||||
if (_mount280 && !sSpellMgr->GetSpellInfo(_mount280))
|
||||
return false;
|
||||
if (_mount310 && !sSpellMgr->GetSpellInfo(_mount310))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleMount(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
|
||||
if (Player* target = GetHitPlayer())
|
||||
{
|
||||
// Prevent stacking of mounts and client crashes upon dismounting
|
||||
target->RemoveAurasByType(SPELL_AURA_MOUNTED, 0, GetHitAura());
|
||||
|
||||
// Triggered spell id dependent on riding skill and zone
|
||||
bool canFly = false;
|
||||
uint32 vmap = GetVirtualMapForMapAndZone(target->GetMapId(), target->GetZoneId());
|
||||
if (vmap == 530 || (vmap == 571 && target->HasSpell(SPELL_COLD_WEATHER_FLYING)))
|
||||
canFly = true;
|
||||
|
||||
float x, y, z;
|
||||
target->GetPosition(x, y, z);
|
||||
uint32 areaFlag = target->GetBaseMap()->GetAreaFlag(x, y, z);
|
||||
AreaTableEntry const* area = sAreaStore.LookupEntry(areaFlag);
|
||||
if (!area || (canFly && (area->flags & AREA_FLAG_NO_FLY_ZONE)))
|
||||
canFly = false;
|
||||
|
||||
uint32 mount = 0;
|
||||
switch (target->GetBaseSkillValue(SKILL_RIDING))
|
||||
{
|
||||
case 0:
|
||||
mount = _mount0;
|
||||
break;
|
||||
case 75:
|
||||
mount = _mount60;
|
||||
break;
|
||||
case 150:
|
||||
mount = _mount100;
|
||||
break;
|
||||
case 225:
|
||||
if (canFly)
|
||||
mount = _mount150;
|
||||
else
|
||||
mount = _mount100;
|
||||
break;
|
||||
case 300:
|
||||
if (canFly)
|
||||
{
|
||||
if (_mount310 && target->Has310Flyer(false))
|
||||
mount = _mount310;
|
||||
else
|
||||
mount = _mount280;
|
||||
}
|
||||
else
|
||||
mount = _mount100;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (mount)
|
||||
{
|
||||
PreventHitAura();
|
||||
target->CastSpell(target, mount, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gen_mount_SpellScript::HandleMount, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _mount0;
|
||||
uint32 _mount60;
|
||||
uint32 _mount100;
|
||||
uint32 _mount150;
|
||||
uint32 _mount280;
|
||||
uint32 _mount310;
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_gen_mount_SpellScript(_mount0, _mount60, _mount100, _mount150, _mount280, _mount310);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _mount0;
|
||||
uint32 _mount60;
|
||||
uint32 _mount100;
|
||||
uint32 _mount150;
|
||||
uint32 _mount280;
|
||||
uint32 _mount310;
|
||||
};
|
||||
|
||||
void AddSC_generic_spell_scripts()
|
||||
{
|
||||
new spell_gen_absorb0_hitlimit1();
|
||||
@@ -2795,4 +3146,20 @@ void AddSC_generic_spell_scripts()
|
||||
new spell_gen_despawn_self();
|
||||
new spell_gen_touch_the_nightmare();
|
||||
new spell_gen_dream_funnel();
|
||||
new spell_gen_bandage();
|
||||
new spell_gen_lifebloom("spell_hexlord_lifebloom", SPELL_HEXLORD_MALACRASS_LIFEBLOOM_FINAL_HEAL);
|
||||
new spell_gen_lifebloom("spell_tur_ragepaw_lifebloom", SPELL_TUR_RAGEPAW_LIFEBLOOM_FINAL_HEAL);
|
||||
new spell_gen_lifebloom("spell_cenarion_scout_lifebloom", SPELL_CENARION_SCOUT_LIFEBLOOM_FINAL_HEAL);
|
||||
new spell_gen_lifebloom("spell_twisted_visage_lifebloom", SPELL_TWISTED_VISAGE_LIFEBLOOM_FINAL_HEAL);
|
||||
new spell_gen_lifebloom("spell_faction_champion_dru_lifebloom", SPELL_FACTION_CHAMPIONS_DRU_LIFEBLOOM_FINAL_HEAL);
|
||||
new spell_gen_summon_elemental("spell_gen_summon_fire_elemental", SPELL_SUMMON_FIRE_ELEMENTAL);
|
||||
new spell_gen_summon_elemental("spell_gen_summon_earth_elemental", SPELL_SUMMON_EARTH_ELEMENTAL);
|
||||
new spell_gen_mount("spell_magic_broom", 0, SPELL_MAGIC_BROOM_60, SPELL_MAGIC_BROOM_100, SPELL_MAGIC_BROOM_150, SPELL_MAGIC_BROOM_280);
|
||||
new spell_gen_mount("spell_headless_horseman_mount", 0, SPELL_HEADLESS_HORSEMAN_MOUNT_60, SPELL_HEADLESS_HORSEMAN_MOUNT_100, SPELL_HEADLESS_HORSEMAN_MOUNT_150, SPELL_HEADLESS_HORSEMAN_MOUNT_280);
|
||||
new spell_gen_mount("spell_winged_steed_of_the_ebon_blade", 0, 0, 0, SPELL_WINGED_STEED_150, SPELL_WINGED_STEED_280);
|
||||
new spell_gen_mount("spell_big_love_rocket", SPELL_BIG_LOVE_ROCKET_0, SPELL_BIG_LOVE_ROCKET_60, SPELL_BIG_LOVE_ROCKET_100, SPELL_BIG_LOVE_ROCKET_150, SPELL_BIG_LOVE_ROCKET_310);
|
||||
new spell_gen_mount("spell_invincible", 0, SPELL_INVINCIBLE_60, SPELL_INVINCIBLE_100, SPELL_INVINCIBLE_150, SPELL_INVINCIBLE_310);
|
||||
new spell_gen_mount("spell_blazing_hippogryph", 0, 0, 0, SPELL_BLAZING_HIPPOGRYPH_150, SPELL_BLAZING_HIPPOGRYPH_280);
|
||||
new spell_gen_mount("spell_celestial_steed", 0, SPELL_CELESTIAL_STEED_60, SPELL_CELESTIAL_STEED_100, SPELL_CELESTIAL_STEED_150, SPELL_CELESTIAL_STEED_280, SPELL_CELESTIAL_STEED_310);
|
||||
new spell_gen_mount("spell_x53_touring_rocket", 0, 0, 0, SPELL_X53_TOURING_ROCKET_150, SPELL_X53_TOURING_ROCKET_280, SPELL_X53_TOURING_ROCKET_310);
|
||||
}
|
||||
|
||||
@@ -618,6 +618,86 @@ class spell_hun_misdirection_proc : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class spell_hun_disengage : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_hun_disengage() : SpellScriptLoader("spell_hun_disengage") { }
|
||||
|
||||
class spell_hun_disengage_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_hun_disengage_SpellScript);
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (caster->GetTypeId() == TYPEID_PLAYER && !caster->isInCombat())
|
||||
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_hun_disengage_SpellScript::CheckCast);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_hun_disengage_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_hun_tame_beast : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_hun_tame_beast() : SpellScriptLoader("spell_hun_tame_beast") { }
|
||||
|
||||
class spell_hun_tame_beast_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_hun_tame_beast_SpellScript);
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
|
||||
if (!GetExplTargetUnit())
|
||||
return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
|
||||
|
||||
if (Creature* target = GetExplTargetUnit()->ToCreature())
|
||||
{
|
||||
if (target->getLevel() > caster->getLevel())
|
||||
return SPELL_FAILED_HIGHLEVEL;
|
||||
|
||||
// use SMSG_PET_TAME_FAILURE?
|
||||
if (!target->GetCreatureTemplate()->isTameable(caster->ToPlayer()->CanTameExoticPets()))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
if (caster->GetPetGUID())
|
||||
return SPELL_FAILED_ALREADY_HAVE_SUMMON;
|
||||
|
||||
if (caster->GetCharmGUID())
|
||||
return SPELL_FAILED_ALREADY_HAVE_CHARM;
|
||||
}
|
||||
else
|
||||
return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_hun_tame_beast_SpellScript::CheckCast);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_hun_tame_beast_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_hunter_spell_scripts()
|
||||
{
|
||||
@@ -633,4 +713,6 @@ void AddSC_hunter_spell_scripts()
|
||||
new spell_hun_pet_carrion_feeder();
|
||||
new spell_hun_misdirection();
|
||||
new spell_hun_misdirection_proc();
|
||||
new spell_hun_disengage();
|
||||
new spell_hun_tame_beast();
|
||||
}
|
||||
|
||||
@@ -342,13 +342,52 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_mage_living_bomb : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mage_living_bomb() : SpellScriptLoader("spell_mage_living_bomb") { }
|
||||
|
||||
class spell_mage_living_bomb_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mage_living_bomb_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* spell)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(uint32(spell->Effects[EFFECT_1].CalcValue())))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode();
|
||||
if (removeMode != AURA_REMOVE_BY_ENEMY_SPELL && removeMode != AURA_REMOVE_BY_EXPIRE)
|
||||
return;
|
||||
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(GetTarget(), uint32(aurEff->GetAmount()), true, NULL, aurEff);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_mage_living_bomb_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_mage_living_bomb_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_mage_spell_scripts()
|
||||
{
|
||||
new spell_mage_blast_wave;
|
||||
new spell_mage_cold_snap;
|
||||
new spell_mage_blast_wave();
|
||||
new spell_mage_cold_snap();
|
||||
new spell_mage_frost_warding_trigger();
|
||||
new spell_mage_incanters_absorbtion_absorb();
|
||||
new spell_mage_incanters_absorbtion_manashield();
|
||||
new spell_mage_polymorph_cast_visual;
|
||||
new spell_mage_summon_water_elemental;
|
||||
new spell_mage_polymorph_cast_visual();
|
||||
new spell_mage_summon_water_elemental();
|
||||
new spell_mage_living_bomb();
|
||||
}
|
||||
|
||||
@@ -43,6 +43,10 @@ enum PaladinSpells
|
||||
SPELL_DIVINE_STORM = 53385,
|
||||
SPELL_DIVINE_STORM_DUMMY = 54171,
|
||||
SPELL_DIVINE_STORM_HEAL = 54172,
|
||||
|
||||
SPELL_FORBEARANCE = 25771,
|
||||
SPELL_AVENGING_WRATH_MARKER = 61987,
|
||||
SPELL_IMMUNE_SHIELD_MARKER = 61988,
|
||||
};
|
||||
|
||||
// 31850 - Ardent Defender
|
||||
@@ -255,17 +259,18 @@ class spell_pal_holy_shock : public SpellScriptLoader
|
||||
|
||||
class spell_pal_holy_shock_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pal_holy_shock_SpellScript)
|
||||
bool Validate(SpellInfo const* spellEntry)
|
||||
PrepareSpellScript(spell_pal_holy_shock_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* spell)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_HOLY_SHOCK_R1))
|
||||
return false;
|
||||
|
||||
// can't use other spell than holy shock due to spell_ranks dependency
|
||||
if (sSpellMgr->GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id))
|
||||
if (sSpellMgr->GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != sSpellMgr->GetFirstSpellInChain(spell->Id))
|
||||
return false;
|
||||
|
||||
uint8 rank = sSpellMgr->GetSpellRank(spellEntry->Id);
|
||||
uint8 rank = sSpellMgr->GetSpellRank(spell->Id);
|
||||
if (!sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank, true) || !sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank, true))
|
||||
return false;
|
||||
|
||||
@@ -287,7 +292,7 @@ class spell_pal_holy_shock : public SpellScriptLoader
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Player* caster = GetCaster()->ToPlayer();
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* target = GetExplTargetUnit())
|
||||
{
|
||||
if (!caster->IsFriendlyTo(target))
|
||||
@@ -433,6 +438,108 @@ class spell_pal_divine_storm_dummy : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pal_lay_on_hands : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_lay_on_hands() : SpellScriptLoader("spell_pal_lay_on_hands") { }
|
||||
|
||||
class spell_pal_lay_on_hands_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pal_lay_on_hands_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_FORBEARANCE))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_AVENGING_WRATH_MARKER))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_IMMUNE_SHIELD_MARKER))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* target = GetExplTargetUnit())
|
||||
{
|
||||
if (caster == target)
|
||||
{
|
||||
if (target->HasAura(SPELL_FORBEARANCE))
|
||||
return SPELL_FAILED_TARGET_AURASTATE;
|
||||
|
||||
if (target->HasAura(SPELL_AVENGING_WRATH_MARKER))
|
||||
return SPELL_FAILED_TARGET_AURASTATE;
|
||||
|
||||
if (target->HasAura(SPELL_IMMUNE_SHIELD_MARKER))
|
||||
return SPELL_FAILED_TARGET_AURASTATE;
|
||||
}
|
||||
}
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void HandleScript()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (caster == GetHitUnit())
|
||||
{
|
||||
caster->CastSpell(caster, SPELL_FORBEARANCE, true);
|
||||
caster->CastSpell(caster, SPELL_AVENGING_WRATH_MARKER, true);
|
||||
caster->CastSpell(caster, SPELL_IMMUNE_SHIELD_MARKER, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_pal_lay_on_hands_SpellScript::CheckCast);
|
||||
AfterHit += SpellHitFn(spell_pal_lay_on_hands_SpellScript::HandleScript);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_pal_lay_on_hands_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pal_righteous_defense : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_righteous_defense() : SpellScriptLoader("spell_pal_righteous_defense") { }
|
||||
|
||||
class spell_pal_righteous_defense_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pal_righteous_defense_SpellScript);
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
|
||||
if (Unit* target = GetExplTargetUnit())
|
||||
{
|
||||
if (!target->IsFriendlyTo(caster) || target->getAttackers().empty())
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
}
|
||||
else
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_pal_righteous_defense_SpellScript::CheckCast);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_pal_righteous_defense_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_paladin_spell_scripts()
|
||||
{
|
||||
new spell_pal_ardent_defender();
|
||||
@@ -443,4 +550,6 @@ void AddSC_paladin_spell_scripts()
|
||||
new spell_pal_judgement_of_command();
|
||||
new spell_pal_divine_storm();
|
||||
new spell_pal_divine_storm_dummy();
|
||||
new spell_pal_lay_on_hands();
|
||||
new spell_pal_righteous_defense();
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ enum PriestSpells
|
||||
PRIEST_SPELL_PENANCE_R1_HEAL = 47757,
|
||||
PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED = 33619,
|
||||
PRIEST_SPELL_REFLECTIVE_SHIELD_R1 = 33201,
|
||||
PRIEST_SPELL_VAMPIRIC_TOUCH_DISPEL = 64085,
|
||||
};
|
||||
|
||||
// Guardian Spirit
|
||||
@@ -330,6 +331,50 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pri_vampiric_touch : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pri_vampiric_touch() : SpellScriptLoader("spell_pri_vampiric_touch") { }
|
||||
|
||||
class spell_pri_vampiric_touch_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pri_vampiric_touch_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(PRIEST_SPELL_VAMPIRIC_TOUCH_DISPEL))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDispel(DispelInfo* /*dispelInfo*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
if (Unit* target = GetUnitOwner())
|
||||
{
|
||||
if (AuraEffect const* aurEff = GetEffect(EFFECT_1))
|
||||
{
|
||||
int32 damage = aurEff->GetAmount() * 8;
|
||||
// backfire damage
|
||||
caster->CastCustomSpell(target, PRIEST_SPELL_VAMPIRIC_TOUCH_DISPEL, &damage, NULL, NULL, true, NULL, aurEff);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterDispel += AuraDispelFn(spell_pri_vampiric_touch_AuraScript::HandleDispel);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_pri_vampiric_touch_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_priest_spell_scripts()
|
||||
{
|
||||
new spell_pri_guardian_spirit();
|
||||
@@ -339,4 +384,5 @@ void AddSC_priest_spell_scripts()
|
||||
new spell_pri_reflective_shield_trigger();
|
||||
new spell_pri_mind_sear();
|
||||
new spell_pri_prayer_of_mending_heal();
|
||||
new spell_pri_vampiric_touch();
|
||||
}
|
||||
|
||||
@@ -42,6 +42,12 @@ enum ShamanSpells
|
||||
// For Earthen Power
|
||||
SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM = 6474,
|
||||
SHAMAN_TOTEM_SPELL_EARTHEN_POWER = 59566,
|
||||
|
||||
SHAMAN_BIND_SIGHT = 6277,
|
||||
|
||||
ICON_ID_SHAMAN_LAVA_FLOW = 3087,
|
||||
SHAMAN_LAVA_FLOWS_R1 = 51480,
|
||||
SHAMAN_LAVA_FLOWS_TRIGGERED_R1 = 64694,
|
||||
};
|
||||
|
||||
// 51474 - Astral shift
|
||||
@@ -652,6 +658,98 @@ class spell_sha_chain_heal : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class spell_sha_flame_shock : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_sha_flame_shock() : SpellScriptLoader("spell_sha_flame_shock") { }
|
||||
|
||||
class spell_sha_flame_shock_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_sha_flame_shock_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SHAMAN_LAVA_FLOWS_R1))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SHAMAN_LAVA_FLOWS_TRIGGERED_R1))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDispel(DispelInfo* /*dispelInfo*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
// Lava Flows
|
||||
if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, ICON_ID_SHAMAN_LAVA_FLOW, 0))
|
||||
{
|
||||
if (sSpellMgr->GetFirstSpellInChain(SHAMAN_LAVA_FLOWS_R1) != sSpellMgr->GetFirstSpellInChain(aurEff->GetId()))
|
||||
return;
|
||||
|
||||
uint8 rank = sSpellMgr->GetSpellRank(aurEff->GetId());
|
||||
caster->CastSpell(caster, sSpellMgr->GetSpellWithRank(SHAMAN_LAVA_FLOWS_TRIGGERED_R1, rank), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterDispel += AuraDispelFn(spell_sha_flame_shock_AuraScript::HandleDispel);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_sha_flame_shock_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_sha_sentry_totem : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_sha_sentry_totem() : SpellScriptLoader("spell_sha_sentry_totem") { }
|
||||
|
||||
class spell_sha_sentry_totem_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_sha_sentry_totem_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SHAMAN_BIND_SIGHT))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
if (Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[4]))
|
||||
if (totem->isTotem())
|
||||
caster->CastSpell(totem, SHAMAN_BIND_SIGHT, true);
|
||||
}
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (caster->GetTypeId() == TYPEID_PLAYER)
|
||||
caster->ToPlayer()->StopCastingBindSight();
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_sha_sentry_totem_AuraScript::AfterApply, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_sha_sentry_totem_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_sha_sentry_totem_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_shaman_spell_scripts()
|
||||
{
|
||||
new spell_sha_astral_shift();
|
||||
@@ -667,4 +765,6 @@ void AddSC_shaman_spell_scripts()
|
||||
new spell_sha_mana_spring_totem();
|
||||
new spell_sha_lava_lash();
|
||||
new spell_sha_chain_heal();
|
||||
new spell_sha_flame_shock();
|
||||
new spell_sha_sentry_totem();
|
||||
}
|
||||
|
||||
@@ -37,6 +37,8 @@ enum WarlockSpells
|
||||
WARLOCK_DEMONIC_CIRCLE_SUMMON = 48018,
|
||||
WARLOCK_DEMONIC_CIRCLE_TELEPORT = 48020,
|
||||
WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST = 62388,
|
||||
WARLOCK_HAUNT_HEAL = 48210,
|
||||
WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117,
|
||||
};
|
||||
|
||||
class spell_warl_banish : public SpellScriptLoader
|
||||
@@ -523,6 +525,106 @@ class spell_warl_demonic_circle_teleport : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class spell_warl_haunt : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_haunt() : SpellScriptLoader("spell_warl_haunt") { }
|
||||
|
||||
class spell_warl_haunt_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warl_haunt_SpellScript);
|
||||
|
||||
void HandleOnHit()
|
||||
{
|
||||
if (Aura* aura = GetHitAura())
|
||||
if (AuraEffect* aurEff = aura->GetEffect(EFFECT_1))
|
||||
aurEff->SetAmount(CalculatePctN(aurEff->GetAmount(), GetHitDamage()));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnHit += SpellHitFn(spell_warl_haunt_SpellScript::HandleOnHit);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_warl_haunt_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warl_haunt_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(WARLOCK_HAUNT_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
int32 amount = aurEff->GetAmount();
|
||||
GetTarget()->CastCustomSpell(caster, WARLOCK_HAUNT_HEAL, &amount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectRemove += AuraEffectApplyFn(spell_warl_haunt_AuraScript::HandleRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_warl_haunt_SpellScript();
|
||||
}
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_warl_haunt_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_warl_unstable_affliction : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_unstable_affliction() : SpellScriptLoader("spell_warl_unstable_affliction") { }
|
||||
|
||||
class spell_warl_unstable_affliction_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_warl_unstable_affliction_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(WARLOCK_UNSTABLE_AFFLICTION_DISPEL))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDispel(DispelInfo* dispelInfo)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
if (AuraEffect const* aurEff = GetEffect(EFFECT_0))
|
||||
{
|
||||
int32 damage = aurEff->GetAmount() * 9;
|
||||
// backfire damage and silence
|
||||
caster->CastCustomSpell(dispelInfo->GetDispeller(), WARLOCK_UNSTABLE_AFFLICTION_DISPEL, &damage, NULL, NULL, true, NULL, aurEff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterDispel += AuraDispelFn(spell_warl_unstable_affliction_AuraScript::HandleDispel);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_warl_unstable_affliction_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_warlock_spell_scripts()
|
||||
{
|
||||
new spell_warl_banish();
|
||||
@@ -535,4 +637,6 @@ void AddSC_warlock_spell_scripts()
|
||||
new spell_warl_life_tap();
|
||||
new spell_warl_demonic_circle_summon();
|
||||
new spell_warl_demonic_circle_teleport();
|
||||
new spell_warl_haunt();
|
||||
new spell_warl_unstable_affliction();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user