aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2011-01-22 17:21:24 +0100
committerShauren <shauren.trinity@gmail.com>2011-01-22 17:21:24 +0100
commit5adf9c5d305bb1c7e2f282ce3e5a4cf0fbd5592d (patch)
treecf388f7632be2728150ea6d02667c016849bcddd /src
parentc2690f748bcc42a1818b90336e81fb586588dd1e (diff)
Scripts/Spells: Moved all special target filtering cases to scripts
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp6
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp166
-rwxr-xr-xsrc/server/game/Spells/SpellMgr.cpp1
-rwxr-xr-xsrc/server/game/Spells/SpellScript.cpp6
-rwxr-xr-xsrc/server/game/Spells/SpellScript.h3
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp52
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp58
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp101
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp28
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp610
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp197
-rw-r--r--src/server/scripts/Spells/spell_warlock.cpp269
-rw-r--r--src/server/scripts/Spells/spell_warrior.cpp31
13 files changed, 885 insertions, 643 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 125203dfdeb..404f5a6c4bf 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -2314,6 +2314,12 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const
case 46736:
triggerSpellId = 46737;
break;
+ // Shield Level 1
+ case 63130:
+ // Shield Level 2
+ case 63131:
+ // Shield Level 3
+ case 63132:
// Ball of Flames Visual
case 71706:
return;
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 906a40b2261..9ea8100778c 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -2787,127 +2787,6 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
unitList.remove(m_targets.getUnitTarget());
Trinity::RandomResizeList(unitList, maxTargets);
}
- else
- {
- switch (m_spellInfo->Id)
- {
- case 27285: // Seed of Corruption proc spell
- case 49821: // Mind Sear proc spell Rank 1
- case 53022: // Mind Sear proc spell Rank 2
- unitList.remove(m_targets.getUnitTarget());
- break;
- case 55789: // Improved Icy Talons
- case 59725: // Improved Spell Reflection - aoe aura
- unitList.remove(m_caster);
- break;
- case 72378: // Blood Nova (Deathbringer Saurfang)
- case 73058:
- {
- // select one random target, with preference of ranged targets
- uint32 targetsAtRange = 0;
- uint32 const minTargets = m_caster->GetMap()->GetSpawnMode() & 1 ? 10 : 4;
- unitList.sort(Trinity::ObjectDistanceOrderPred(m_caster, false));
-
- // get target count at range
- for (std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr, ++targetsAtRange)
- if ((*itr)->GetDistance(m_caster) < 12.0f)
- break;
-
- // set the upper cap
- if (targetsAtRange < minTargets)
- targetsAtRange = std::min<uint32>(unitList.size()-1, minTargets);
-
- std::list<Unit*>::iterator itr = unitList.begin();
- std::advance(itr, urand(0, targetsAtRange));
- Unit* target = *itr;
- unitList.clear();
- unitList.push_back(target);
- break;
- }
- case 72255: // Mark of the Fallen Champion (Deathbringer Saurfang)
- case 72444:
- case 72445:
- case 72446:
- for (std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end();)
- {
- if (!(*itr)->HasAura(72293))
- itr = unitList.erase(itr);
- else
- ++itr;
- }
- break;
- case 68921: case 69049: // Soulstorm
- for (std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end();)
- {
- Position pos;
- (*itr)->GetPosition(&pos);
- if (m_caster->GetExactDist2d(&pos) <= 10.0f)
- itr = unitList.erase(itr);
- else
- ++itr;
- }
- break;
- case 70402: case 72511:
- case 72512: case 72513:
- if (Unit* owner = ObjectAccessor::GetUnit(*m_caster, m_caster->GetCreatorGUID()))
- unitList.remove(owner);
- break;
- case 71390: // Pact of the Darkfallen
- {
- for (std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end();)
- {
- if (!(*itr)->HasAura(71340))
- itr = unitList.erase(itr);
- else
- ++itr;
- }
- bool remove = true;
- // we can do this, unitList is MAX 4 in size
- for (std::list<Unit*>::const_iterator itr = unitList.begin(); itr != unitList.end() && remove; ++itr)
- {
- if (!m_caster->IsWithinDist(*itr, 5.0f, false))
- remove = false;
-
- for (std::list<Unit*>::const_iterator itr2 = unitList.begin(); itr2 != unitList.end() && remove; ++itr2)
- if (itr != itr2 && !(*itr2)->IsWithinDist(*itr, 5.0f, false))
- remove = false;
- }
-
- if (remove)
- for (std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
- (*itr)->RemoveAura(71340);
- break;
- }
- }
- // Death Pact
- if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && m_spellInfo->SpellFamilyFlags[0] & 0x00080000)
- {
- Unit * unit_to_add = NULL;
- for (std::list<Unit*>::iterator itr = unitList.begin() ; itr != unitList.end(); ++itr)
- {
- if ((*itr)->GetTypeId() == TYPEID_UNIT
- && (*itr)->GetOwnerGUID() == m_caster->GetGUID()
- && (*itr)->ToCreature()->GetCreatureInfo()->type == CREATURE_TYPE_UNDEAD)
- {
- unit_to_add = (*itr);
- break;
- }
- }
- if (unit_to_add)
- {
- unitList.clear();
- unitList.push_back(unit_to_add);
- }
- // Pet not found - remove cooldown
- else
- {
- if (modOwner->GetTypeId() == TYPEID_PLAYER)
- modOwner->RemoveSpellCooldown(m_spellInfo->Id,true);
- SendCastResult(SPELL_FAILED_NO_PET);
- finish(false);
- }
- }
- }
CallScriptAfterUnitTargetSelectHandlers(unitList, SpellEffIndex(i));
@@ -7300,13 +7179,13 @@ void Spell::InitEffectExecuteData(uint8 effIndex)
void Spell::CleanupEffectExecuteData()
{
- for(uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
m_effectExecuteData[i] = NULL;
}
void Spell::CheckEffectExecuteData()
{
- for(uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
ASSERT(!m_effectExecuteData[i]);
}
@@ -7314,7 +7193,7 @@ void Spell::LoadScripts()
{
sLog->outDebug("Spell::LoadScripts");
sScriptMgr->CreateSpellScripts(m_spellInfo->Id, m_loadedScripts);
- for(std::list<SpellScript *>::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end() ;)
+ for (std::list<SpellScript *>::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end() ;)
{
if (!(*itr)->_Load(this))
{
@@ -7330,28 +7209,26 @@ void Spell::LoadScripts()
void Spell::PrepareScriptHitHandlers()
{
- for(std::list<SpellScript *>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
- {
+ for (std::list<SpellScript *>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
(*scritr)->_InitHit();
- }
}
bool Spell::CallScriptEffectHandlers(SpellEffIndex effIndex)
{
// execute script effect handler hooks and check if effects was prevented
bool preventDefault = false;
- for(std::list<SpellScript *>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
+ for (std::list<SpellScript *>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_EFFECT);
std::list<SpellScript::EffectHandler>::iterator effEndItr = (*scritr)->OnEffect.end(), effItr = (*scritr)->OnEffect.begin();
- for(; effItr != effEndItr ; ++effItr)
- {
+ for (; effItr != effEndItr ; ++effItr)
// effect execution can be prevented
if (!(*scritr)->_IsEffectPrevented(effIndex) && (*effItr).IsEffectAffected(m_spellInfo, effIndex))
(*effItr).Call(*scritr, effIndex);
- }
+
if (!preventDefault)
preventDefault = (*scritr)->_IsDefaultEffectPrevented(effIndex);
+
(*scritr)->_FinishScriptCall();
}
return preventDefault;
@@ -7359,55 +7236,52 @@ bool Spell::CallScriptEffectHandlers(SpellEffIndex effIndex)
void Spell::CallScriptBeforeHitHandlers()
{
- for(std::list<SpellScript *>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
+ for (std::list<SpellScript *>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_BEFORE_HIT);
std::list<SpellScript::HitHandler>::iterator hookItrEnd = (*scritr)->BeforeHit.end(), hookItr = (*scritr)->BeforeHit.begin();
- for(; hookItr != hookItrEnd ; ++hookItr)
- {
+ for (; hookItr != hookItrEnd ; ++hookItr)
(*hookItr).Call(*scritr);
- }
+
(*scritr)->_FinishScriptCall();
}
}
void Spell::CallScriptOnHitHandlers()
{
- for(std::list<SpellScript *>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
+ for (std::list<SpellScript *>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_HIT);
std::list<SpellScript::HitHandler>::iterator hookItrEnd = (*scritr)->OnHit.end(), hookItr = (*scritr)->OnHit.begin();
- for(; hookItr != hookItrEnd ; ++hookItr)
- {
+ for (; hookItr != hookItrEnd ; ++hookItr)
(*hookItr).Call(*scritr);
- }
+
(*scritr)->_FinishScriptCall();
}
}
void Spell::CallScriptAfterHitHandlers()
{
- for(std::list<SpellScript *>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
+ for (std::list<SpellScript *>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_AFTER_HIT);
std::list<SpellScript::HitHandler>::iterator hookItrEnd = (*scritr)->AfterHit.end(), hookItr = (*scritr)->AfterHit.begin();
- for(; hookItr != hookItrEnd ; ++hookItr)
- {
+ for (; hookItr != hookItrEnd ; ++hookItr)
(*hookItr).Call(*scritr);
- }
+
(*scritr)->_FinishScriptCall();
}
}
void Spell::CallScriptAfterUnitTargetSelectHandlers(std::list<Unit*>& unitTargets, SpellEffIndex effIndex)
{
- for(std::list<SpellScript *>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
+ for (std::list<SpellScript *>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_UNIT_TARGET_SELECT);
std::list<SpellScript::UnitTargetHandler>::iterator hookItrEnd = (*scritr)->OnUnitTargetSelect.end(), hookItr = (*scritr)->OnUnitTargetSelect.begin();
- for(; hookItr != hookItrEnd ; ++hookItr)
+ for (; hookItr != hookItrEnd ; ++hookItr)
if ((*hookItr).IsEffectAffected(m_spellInfo, effIndex))
- (*hookItr).Call(*scritr, unitTargets);
+ (*hookItr).Call(*scritr, unitTargets);
(*scritr)->_FinishScriptCall();
}
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 32da80c662d..fc92e8448f8 100755
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -3668,6 +3668,7 @@ void SpellMgr::LoadSpellCustomAttr()
case 69538: case 69553: case 69610: // Ooze Combine
case 71447: case 71481: // Bloodbolt Splash
case 71482: case 71483: // Bloodbolt Splash
+ case 71390: // Pact of the Darkfallen
mSpellCustomAttr[i] |= SPELL_ATTR0_CU_EXCLUDE_SELF;
count++;
break;
diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp
index 30674b4f69d..52a06bd1f2e 100755
--- a/src/server/game/Spells/SpellScript.cpp
+++ b/src/server/game/Spells/SpellScript.cpp
@@ -439,6 +439,12 @@ void SpellScript::CreateItem(uint32 effIndex, uint32 itemId)
m_spell->DoCreateItem(effIndex, itemId);
}
+void SpellScript::FinishCast(SpellCastResult result)
+{
+ m_spell->SendCastResult(result);
+ m_spell->finish(result == SPELL_CAST_OK);
+}
+
bool AuraScript::_Validate(SpellEntry const * entry)
{
for (std::list<EffectApplyHandler>::iterator itr = OnEffectApply.begin(); itr != OnEffectApply.end(); ++itr)
diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h
index 5e0c7fdb4d5..8042c00b5b4 100755
--- a/src/server/game/Spells/SpellScript.h
+++ b/src/server/game/Spells/SpellScript.h
@@ -291,6 +291,9 @@ class SpellScript : public _SpellScript
// Creates item. Calls Spell::DoCreateItem method.
void CreateItem(uint32 effIndex, uint32 itemId);
+
+ // finishes spellcast prematurely with selected error message
+ void FinishCast(SpellCastResult result);
};
// AuraScript interface - enum used for runtime checks of script function calls
diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp
index c494b138561..7c0afe830f2 100644
--- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp
@@ -352,6 +352,57 @@ class spell_bronjahm_soulstorm_visual : public SpellScriptLoader
}
};
+class DistanceCheck
+{
+ public:
+ explicit DistanceCheck(Unit* _caster) : caster(_caster) { }
+
+ bool operator() (Unit* unit)
+ {
+ if (caster->GetExactDist2d(unit) <= 10.0f)
+ return true;
+ return false;
+ }
+
+ Unit* caster;
+};
+
+class spell_bronjahm_soulstorm_targeting : public SpellScriptLoader
+{
+ public:
+ spell_bronjahm_soulstorm_targeting() : SpellScriptLoader("spell_bronjahm_soulstorm_targeting") { }
+
+ class spell_bronjahm_soulstorm_targeting_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_bronjahm_soulstorm_targeting_SpellScript);
+
+ void FilterTargetsInitial(std::list<Unit*>& unitList)
+ {
+ unitList.remove_if(DistanceCheck(GetCaster()));
+ sharedUnitList = unitList;
+ }
+
+ // use the same target for first and second effect
+ void FilterTargetsSubsequent(std::list<Unit*>& unitList)
+ {
+ unitList = sharedUnitList;
+ }
+
+ void Register()
+ {
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_bronjahm_soulstorm_targeting_SpellScript::FilterTargetsInitial, EFFECT_1, TARGET_UNIT_AREA_ENEMY_DST);
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_bronjahm_soulstorm_targeting_SpellScript::FilterTargetsSubsequent, EFFECT_2, TARGET_UNIT_AREA_ENEMY_DST);
+ }
+
+ std::list<Unit*> sharedUnitList;
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_bronjahm_soulstorm_targeting_SpellScript();
+ }
+};
+
void AddSC_boss_bronjahm()
{
new boss_bronjahm();
@@ -360,4 +411,5 @@ void AddSC_boss_bronjahm()
new spell_bronjahm_consume_soul();
new spell_bronjahm_soulstorm_channel();
new spell_bronjahm_soulstorm_visual();
+ new spell_bronjahm_soulstorm_targeting();
}
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp
index d4d51e98b3d..ab3b19c14f8 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp
@@ -560,6 +560,63 @@ class spell_blood_queen_bloodbolt : public SpellScriptLoader
}
};
+class PactOfTheDarkfallenChack
+{
+ public:
+ bool operator() (Unit* unit)
+ {
+ return !unit->HasAura(SPELL_PACT_OF_THE_DARKFALLEN);
+ }
+};
+
+class spell_blood_queen_pact_of_the_darkfallen : public SpellScriptLoader
+{
+ public:
+ spell_blood_queen_pact_of_the_darkfallen() : SpellScriptLoader("spell_blood_queen_pact_of_the_darkfallen") { }
+
+ class spell_blood_queen_pact_of_the_darkfallen_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_blood_queen_pact_of_the_darkfallen_SpellScript);
+
+ void FilterTargets(std::list<Unit*>& unitList)
+ {
+ unitList.remove_if(PactOfTheDarkfallenChack());
+
+ bool remove = true;
+ std::list<Unit*>::const_iterator itrEnd = unitList.end(), itr, itr2;
+ // we can do this, unitList is MAX 4 in size
+ for (itr = unitList.begin(); itr != itrEnd && remove; ++itr)
+ {
+ if (!GetCaster()->IsWithinDist(*itr, 5.0f, false))
+ remove = false;
+
+ for (itr2 = unitList.begin(); itr2 != itrEnd && remove; ++itr2)
+ if (itr != itr2 && !(*itr2)->IsWithinDist(*itr, 5.0f, false))
+ remove = false;
+ }
+
+ if (remove)
+ {
+ if (InstanceScript* instance = GetCaster()->GetInstanceScript())
+ {
+ instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_PACT_OF_THE_DARKFALLEN);
+ unitList.clear();
+ }
+ }
+ }
+
+ void Register()
+ {
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_blood_queen_pact_of_the_darkfallen_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_AREA_ALLY_SRC);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_blood_queen_pact_of_the_darkfallen_SpellScript();
+ }
+};
+
class achievement_once_bitten_twice_shy_n : public AchievementCriteriaScript
{
public:
@@ -598,6 +655,7 @@ void AddSC_boss_blood_queen_lana_thel()
new spell_blood_queen_vampiric_bite();
new spell_blood_queen_frenzied_bloodthirst();
new spell_blood_queen_bloodbolt();
+ new spell_blood_queen_pact_of_the_darkfallen();
new achievement_once_bitten_twice_shy_n();
new achievement_once_bitten_twice_shy_v();
}
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
index bf28de2d80c..a6dce643c80 100755
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
@@ -1124,6 +1124,105 @@ class spell_deathbringer_blood_nova : public SpellScriptLoader
}
};
+class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader
+{
+ public:
+ spell_deathbringer_blood_nova_targeting() : SpellScriptLoader("spell_deathbringer_blood_nova_targeting") { }
+
+ class spell_deathbringer_blood_nova_targeting_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_deathbringer_blood_nova_targeting_SpellScript);
+
+ bool Load()
+ {
+ // initialize variable
+ target = NULL;
+ return true;
+ }
+
+ void FilterTargetsInitial(std::list<Unit*>& unitList)
+ {
+ // select one random target, with preference of ranged targets
+ uint32 targetsAtRange = 0;
+ uint32 const minTargets = GetCaster()->GetMap()->GetSpawnMode() & 1 ? 10 : 4;
+ unitList.sort(Trinity::ObjectDistanceOrderPred(GetCaster(), false));
+
+ // get target count at range
+ for (std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr, ++targetsAtRange)
+ if ((*itr)->GetDistance(GetCaster()) < 12.0f)
+ break;
+
+ // set the upper cap
+ if (targetsAtRange < minTargets)
+ targetsAtRange = std::min<uint32>(unitList.size()-1, minTargets);
+
+ std::list<Unit*>::iterator itr = unitList.begin();
+ std::advance(itr, urand(0, targetsAtRange));
+ target = *itr;
+ unitList.clear();
+ unitList.push_back(target);
+ }
+
+ // use the same target for first and second effect
+ void FilterTargetsSubsequent(std::list<Unit*>& unitList)
+ {
+ if (!target)
+ return;
+
+ unitList.clear();
+ unitList.push_back(target);
+ }
+
+ void Register()
+ {
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_AREA_ENEMY_SRC);
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsSubsequent, EFFECT_1, TARGET_UNIT_AREA_ENEMY_SRC);
+ }
+
+ Unit* target;
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_deathbringer_blood_nova_targeting_SpellScript();
+ }
+};
+
+class MarkOfTheFallenChampionCheck
+{
+ public:
+ bool operator() (Unit* unit)
+ {
+ return !unit->HasAura(SPELL_MARK_OF_THE_FALLEN_CHAMPION);
+ }
+};
+
+class spell_deathbringer_mark_of_the_fallen_champion : public SpellScriptLoader
+{
+ public:
+ spell_deathbringer_mark_of_the_fallen_champion() : SpellScriptLoader("spell_deathbringer_mark_of_the_fallen_champion") { }
+
+ class spell_deathbringer_mark_of_the_fallen_champion_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_deathbringer_mark_of_the_fallen_champion_SpellScript);
+
+ void FilterTargets(std::list<Unit*>& unitList)
+ {
+ unitList.remove_if(MarkOfTheFallenChampionCheck());
+ }
+
+ void Register()
+ {
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_deathbringer_mark_of_the_fallen_champion_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_AREA_ENEMY_SRC);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_deathbringer_mark_of_the_fallen_champion_SpellScript();
+ }
+};
+
class achievement_ive_gone_and_made_a_mess : public AchievementCriteriaScript
{
public:
@@ -1151,5 +1250,7 @@ void AddSC_boss_deathbringer_saurfang()
new spell_deathbringer_blood_power();
new spell_deathbringer_rune_of_blood();
new spell_deathbringer_blood_nova();
+ new spell_deathbringer_blood_nova_targeting();
+ new spell_deathbringer_mark_of_the_fallen_champion();
new achievement_ive_gone_and_made_a_mess();
}
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
index 153902eef9f..f1eddc21861 100755
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
@@ -1270,6 +1270,33 @@ class spell_putricide_mutated_transformation : public SpellScriptLoader
}
};
+class spell_putricide_mutated_transformation_dmg : public SpellScriptLoader
+{
+public:
+ spell_putricide_mutated_transformation_dmg() : SpellScriptLoader("spell_putricide_mutated_transformation_dmg") { }
+
+ class spell_putricide_mutated_transformation_dmg_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_putricide_mutated_transformation_dmg_SpellScript);
+
+ void FilterTargetsInitial(std::list<Unit*>& unitList)
+ {
+ if (Unit* owner = ObjectAccessor::GetUnit(*GetCaster(), GetCaster()->GetCreatorGUID()))
+ unitList.remove(owner);
+ }
+
+ void Register()
+ {
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_mutated_transformation_dmg_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_AREA_ALLY_SRC);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_putricide_mutated_transformation_dmg_SpellScript();
+ }
+};
+
class spell_putricide_regurgitated_ooze : public SpellScriptLoader
{
public:
@@ -1347,6 +1374,7 @@ void AddSC_boss_professor_putricide()
new spell_putricide_mutation_init();
new spell_putricide_mutated_transformation_dismiss();
new spell_putricide_mutated_transformation();
+ new spell_putricide_mutated_transformation_dmg();
new spell_putricide_regurgitated_ooze();
new spell_stinky_precious_decimate();
}
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index f94a1bcf4de..6c2c0c30fe9 100644
--- a/src/server/scripts/Spells/spell_dk.cpp
+++ b/src/server/scripts/Spells/spell_dk.cpp
@@ -26,407 +26,446 @@
enum DeathKnightSpells
{
- DK_SPELL_SUMMON_GARGOYLE = 50514,
- DK_SPELL_CORPSE_EXPLOSION_TRIGGERED = 43999,
- DISPLAY_GHOUL_CORPSE = 25537,
- DK_SPELL_SCOURGE_STRIKE_TRIGGERED = 70890,
+ DK_SPELL_RUNIC_POWER_ENERGIZE = 49088,
+ DK_SPELL_ANTI_MAGIC_SHELL_TALENT = 51052,
+ DK_SPELL_SUMMON_GARGOYLE = 50514,
+ DK_SPELL_CORPSE_EXPLOSION_TRIGGERED = 43999,
+ DISPLAY_GHOUL_CORPSE = 25537,
+ DK_SPELL_SCOURGE_STRIKE_TRIGGERED = 70890,
+ DK_SPELL_WILL_OF_THE_NECROPOLIS_TALENT_R1 = 49189,
+ DK_SPELL_WILL_OF_THE_NECROPOLIS_AURA_R1 = 52284,
};
// 50462 - Anti-Magic Shell (on raid member)
class spell_dk_anti_magic_shell_raid : public SpellScriptLoader
{
-public:
- spell_dk_anti_magic_shell_raid() : SpellScriptLoader("spell_dk_anti_magic_shell_raid") { }
+ public:
+ spell_dk_anti_magic_shell_raid() : SpellScriptLoader("spell_dk_anti_magic_shell_raid") { }
- class spell_dk_anti_magic_shell_raid_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_dk_anti_magic_shell_raid_AuraScript);
+ class spell_dk_anti_magic_shell_raid_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dk_anti_magic_shell_raid_AuraScript);
- uint32 absorbPct;
+ uint32 absorbPct;
- bool Load()
- {
- absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster());
- return true;
- }
+ bool Load()
+ {
+ absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster());
+ return true;
+ }
- void CalculateAmount(AuraEffect const * /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
- {
- // TODO: this should absorb limited amount of damage, but no info on calculation formula
- amount = -1;
- }
+ void CalculateAmount(AuraEffect const * /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
+ {
+ // TODO: this should absorb limited amount of damage, but no info on calculation formula
+ amount = -1;
+ }
- void Absorb(AuraEffect * /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
- {
- absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
- }
+ void Absorb(AuraEffect * /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
+ {
+ absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_anti_magic_shell_raid_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
+ OnEffectAbsorb += AuraEffectAbsorbFn(spell_dk_anti_magic_shell_raid_AuraScript::Absorb, EFFECT_0);
+ }
+ };
- void Register()
+ AuraScript *GetAuraScript() const
{
- DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_anti_magic_shell_raid_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
- OnEffectAbsorb += AuraEffectAbsorbFn(spell_dk_anti_magic_shell_raid_AuraScript::Absorb, EFFECT_0);
+ return new spell_dk_anti_magic_shell_raid_AuraScript();
}
- };
-
- AuraScript *GetAuraScript() const
- {
- return new spell_dk_anti_magic_shell_raid_AuraScript();
- }
};
// 48707 - Anti-Magic Shell (on self)
class spell_dk_anti_magic_shell_self : public SpellScriptLoader
{
-public:
- spell_dk_anti_magic_shell_self() : SpellScriptLoader("spell_dk_anti_magic_shell_self") { }
+ public:
+ spell_dk_anti_magic_shell_self() : SpellScriptLoader("spell_dk_anti_magic_shell_self") { }
- class spell_dk_anti_magic_shell_self_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_dk_anti_magic_shell_self_AuraScript);
-
- enum Spells
+ class spell_dk_anti_magic_shell_self_AuraScript : public AuraScript
{
- DK_SPELL_RUNIC_POWER_ENERGIZE = 49088,
- };
+ PrepareAuraScript(spell_dk_anti_magic_shell_self_AuraScript);
- uint32 absorbPct, hpPct;
- bool Load()
- {
- absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster());
- hpPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_1, GetCaster());
- return true;
- }
+ uint32 absorbPct, hpPct;
+ bool Load()
+ {
+ absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster());
+ hpPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_1, GetCaster());
+ return true;
+ }
- bool Validate(SpellEntry const * /*spellEntry*/)
- {
- return sSpellStore.LookupEntry(DK_SPELL_RUNIC_POWER_ENERGIZE);
- }
+ bool Validate(SpellEntry const * /*spellEntry*/)
+ {
+ return sSpellStore.LookupEntry(DK_SPELL_RUNIC_POWER_ENERGIZE);
+ }
- void CalculateAmount(AuraEffect const * /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
- {
- // Set absorbtion amount to unlimited
- amount = -1;
- }
+ void CalculateAmount(AuraEffect const * /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
+ {
+ // Set absorbtion amount to unlimited
+ amount = -1;
+ }
- void Absorb(AuraEffect * /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
- {
- absorbAmount = std::min(CalculatePctN(dmgInfo.GetDamage(), absorbPct), GetTarget()->CountPctFromMaxHealth(hpPct));
- }
+ void Absorb(AuraEffect * /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
+ {
+ absorbAmount = std::min(CalculatePctN(dmgInfo.GetDamage(), absorbPct), GetTarget()->CountPctFromMaxHealth(hpPct));
+ }
- void Trigger(AuraEffect * aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount)
- {
- Unit * target = GetTarget();
- // damage absorbed by Anti-Magic Shell energizes the DK with additional runic power.
- // This, if I'm not mistaken, shows that we get back ~20% of the absorbed damage as runic power.
- int32 bp = absorbAmount * 2 / 10;
- target->CastCustomSpell(target, DK_SPELL_RUNIC_POWER_ENERGIZE, &bp, NULL, NULL, true, NULL, aurEff);
- }
+ void Trigger(AuraEffect * aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount)
+ {
+ Unit * target = GetTarget();
+ // damage absorbed by Anti-Magic Shell energizes the DK with additional runic power.
+ // This, if I'm not mistaken, shows that we get back ~20% of the absorbed damage as runic power.
+ int32 bp = absorbAmount * 2 / 10;
+ target->CastCustomSpell(target, DK_SPELL_RUNIC_POWER_ENERGIZE, &bp, NULL, NULL, true, NULL, aurEff);
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_anti_magic_shell_self_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
+ OnEffectAbsorb += AuraEffectAbsorbFn(spell_dk_anti_magic_shell_self_AuraScript::Absorb, EFFECT_0);
+ AfterEffectAbsorb += AuraEffectAbsorbFn(spell_dk_anti_magic_shell_self_AuraScript::Trigger, EFFECT_0);
+ }
+ };
- void Register()
+ AuraScript *GetAuraScript() const
{
- DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_anti_magic_shell_self_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
- OnEffectAbsorb += AuraEffectAbsorbFn(spell_dk_anti_magic_shell_self_AuraScript::Absorb, EFFECT_0);
- AfterEffectAbsorb += AuraEffectAbsorbFn(spell_dk_anti_magic_shell_self_AuraScript::Trigger, EFFECT_0);
+ return new spell_dk_anti_magic_shell_self_AuraScript();
}
- };
-
- AuraScript *GetAuraScript() const
- {
- return new spell_dk_anti_magic_shell_self_AuraScript();
- }
};
// 50461 - Anti-Magic Zone
class spell_dk_anti_magic_zone : public SpellScriptLoader
{
-public:
- spell_dk_anti_magic_zone() : SpellScriptLoader("spell_dk_anti_magic_zone") { }
-
- class spell_dk_anti_magic_zone_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_dk_anti_magic_zone_AuraScript);
+ public:
+ spell_dk_anti_magic_zone() : SpellScriptLoader("spell_dk_anti_magic_zone") { }
- enum Spells
+ class spell_dk_anti_magic_zone_AuraScript : public AuraScript
{
- DK_SPELL_ANTI_MAGIC_SHELL_TALENT = 51052,
- };
+ PrepareAuraScript(spell_dk_anti_magic_zone_AuraScript);
- uint32 absorbPct;
+ uint32 absorbPct;
- bool Load()
- {
- absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster());
- return true;
- }
+ bool Load()
+ {
+ absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster());
+ return true;
+ }
- bool Validate(SpellEntry const * /*spellEntry*/)
- {
- return sSpellStore.LookupEntry(DK_SPELL_ANTI_MAGIC_SHELL_TALENT);
- }
+ bool Validate(SpellEntry const * /*spellEntry*/)
+ {
+ return sSpellStore.LookupEntry(DK_SPELL_ANTI_MAGIC_SHELL_TALENT);
+ }
- void CalculateAmount(AuraEffect const * /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
- {
- SpellEntry const * talentSpell = sSpellStore.LookupEntry(DK_SPELL_ANTI_MAGIC_SHELL_TALENT);
- amount = SpellMgr::CalculateSpellEffectAmount(talentSpell, EFFECT_0, GetCaster());
- // assume caster is a player here
- if (Unit * caster = GetCaster())
- amount += int32(2 * caster->ToPlayer()->GetTotalAttackPowerValue(BASE_ATTACK));
- }
+ void CalculateAmount(AuraEffect const * /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
+ {
+ SpellEntry const * talentSpell = sSpellStore.LookupEntry(DK_SPELL_ANTI_MAGIC_SHELL_TALENT);
+ amount = SpellMgr::CalculateSpellEffectAmount(talentSpell, EFFECT_0, GetCaster());
+ // assume caster is a player here
+ if (Unit * caster = GetCaster())
+ amount += int32(2 * caster->ToPlayer()->GetTotalAttackPowerValue(BASE_ATTACK));
+ }
- void Absorb(AuraEffect * /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
- {
- absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
- }
+ void Absorb(AuraEffect * /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
+ {
+ absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_anti_magic_zone_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
+ OnEffectAbsorb += AuraEffectAbsorbFn(spell_dk_anti_magic_zone_AuraScript::Absorb, EFFECT_0);
+ }
+ };
- void Register()
+ AuraScript *GetAuraScript() const
{
- DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_anti_magic_zone_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
- OnEffectAbsorb += AuraEffectAbsorbFn(spell_dk_anti_magic_zone_AuraScript::Absorb, EFFECT_0);
+ return new spell_dk_anti_magic_zone_AuraScript();
}
- };
-
- AuraScript *GetAuraScript() const
- {
- return new spell_dk_anti_magic_zone_AuraScript();
- }
};
// 49158 Corpse Explosion (51325, 51326, 51327, 51328)
class spell_dk_corpse_explosion : public SpellScriptLoader
{
-public:
- spell_dk_corpse_explosion() : SpellScriptLoader("spell_dk_corpse_explosion") { }
+ public:
+ spell_dk_corpse_explosion() : SpellScriptLoader("spell_dk_corpse_explosion") { }
- class spell_dk_corpse_explosion_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_dk_corpse_explosion_SpellScript)
- bool Validate(SpellEntry const * /*spellEntry*/)
+ class spell_dk_corpse_explosion_SpellScript : public SpellScript
{
- if (!sSpellStore.LookupEntry(DK_SPELL_CORPSE_EXPLOSION_TRIGGERED))
- return false;
- return true;
+ PrepareSpellScript(spell_dk_corpse_explosion_SpellScript);
+
+ bool Validate(SpellEntry const * /*spellEntry*/)
+ {
+ if (!sSpellStore.LookupEntry(DK_SPELL_CORPSE_EXPLOSION_TRIGGERED))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* unitTarget = GetHitUnit())
+ {
+ int32 bp = 0;
+ // Living ghoul as a target
+ if (unitTarget->isAlive())
+ bp = int32(unitTarget->CountPctFromMaxHealth(25));
+ // Some corpse
+ else
+ bp = GetEffectValue();
+ GetCaster()->CastCustomSpell(unitTarget, SpellMgr::CalculateSpellEffectAmount(GetSpellInfo(), 1), &bp, NULL, NULL, true);
+ // Corpse Explosion (Suicide)
+ unitTarget->CastCustomSpell(unitTarget, DK_SPELL_CORPSE_EXPLOSION_TRIGGERED, &bp, NULL, NULL, true);
+ // Set corpse look
+ unitTarget->SetDisplayId(DISPLAY_GHOUL_CORPSE + urand(0, 3));
+ }
+ }
+
+ void Register()
+ {
+ OnEffect += SpellEffectFn(spell_dk_corpse_explosion_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_dk_corpse_explosion_SpellScript();
}
+};
+
+class spell_dk_death_pact : public SpellScriptLoader
+{
+ public:
+ spell_dk_death_pact() : SpellScriptLoader("spell_dk_death_pact") { }
- void HandleDummy(SpellEffIndex /*effIndex*/)
+ class spell_dk_death_pact_SpellScript : public SpellScript
{
- if (Unit* unitTarget = GetHitUnit())
+ PrepareSpellScript(spell_dk_death_pact_SpellScript);
+
+ void FilterTargets(std::list<Unit*>& unitList)
{
- int32 bp = 0;
- // Living ghoul as a target
- if (unitTarget->isAlive())
- bp = int32(unitTarget->CountPctFromMaxHealth(25));
- // Some corpse
+ Unit* unit_to_add = NULL;
+ for (std::list<Unit*>::iterator itr = unitList.begin() ; itr != unitList.end(); ++itr)
+ {
+ if ((*itr)->GetTypeId() == TYPEID_UNIT
+ && (*itr)->GetOwnerGUID() == GetCaster()->GetGUID()
+ && (*itr)->ToCreature()->GetCreatureInfo()->type == CREATURE_TYPE_UNDEAD)
+ {
+ unit_to_add = (*itr);
+ break;
+ }
+ }
+
+ unitList.clear();
+ if (unit_to_add)
+ unitList.push_back(unit_to_add);
else
- bp = GetEffectValue();
- GetCaster()->CastCustomSpell(unitTarget, SpellMgr::CalculateSpellEffectAmount(GetSpellInfo(), 1), &bp, NULL, NULL, true);
- // Corpse Explosion (Suicide)
- unitTarget->CastCustomSpell(unitTarget, DK_SPELL_CORPSE_EXPLOSION_TRIGGERED, &bp, NULL, NULL, true);
- // Set corpse look
- unitTarget->SetDisplayId(DISPLAY_GHOUL_CORPSE + urand(0, 3));
+ {
+ // Pet not found - remove cooldown
+ if (Player* modOwner = GetCaster()->GetSpellModOwner())
+ modOwner->RemoveSpellCooldown(GetSpellInfo()->Id, true);
+ FinishCast(SPELL_FAILED_NO_PET);
+ }
}
- }
- void Register()
+ void Register()
+ {
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_dk_death_pact_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_AREA_ALLY_DST);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- OnEffect += SpellEffectFn(spell_dk_corpse_explosion_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_dk_death_pact_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_dk_corpse_explosion_SpellScript();
- }
};
// 50524 Runic Power Feed (keeping Gargoyle alive)
class spell_dk_runic_power_feed : public SpellScriptLoader
{
-public:
- spell_dk_runic_power_feed() : SpellScriptLoader("spell_dk_runic_power_feed") { }
+ public:
+ spell_dk_runic_power_feed() : SpellScriptLoader("spell_dk_runic_power_feed") { }
- class spell_dk_runic_power_feed_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_dk_runic_power_feed_SpellScript)
- bool Validate(SpellEntry const * /*spellEntry*/)
+ class spell_dk_runic_power_feed_SpellScript : public SpellScript
{
- if (!sSpellStore.LookupEntry(DK_SPELL_SUMMON_GARGOYLE))
- return false;
- return true;
- }
+ PrepareSpellScript(spell_dk_runic_power_feed_SpellScript);
- void HandleDummy(SpellEffIndex /*effIndex*/)
- {
- if (Unit* caster = GetCaster())
+ bool Validate(SpellEntry const * /*spellEntry*/)
{
- // No power, dismiss Gargoyle
- if (caster->GetPower(POWER_RUNIC_POWER) < 30)
- caster->RemoveAurasDueToSpell(DK_SPELL_SUMMON_GARGOYLE, caster->GetGUID());
- else
- caster->ModifyPower(POWER_RUNIC_POWER, -30);
+ if (!sSpellStore.LookupEntry(DK_SPELL_SUMMON_GARGOYLE))
+ return false;
+ return true;
}
- }
- void Register()
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* caster = GetCaster())
+ {
+ // No power, dismiss Gargoyle
+ if (caster->GetPower(POWER_RUNIC_POWER) < 30)
+ caster->RemoveAurasDueToSpell(DK_SPELL_SUMMON_GARGOYLE, caster->GetGUID());
+ else
+ caster->ModifyPower(POWER_RUNIC_POWER, -30);
+ }
+ }
+
+ void Register()
+ {
+ OnEffect += SpellEffectFn(spell_dk_runic_power_feed_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- OnEffect += SpellEffectFn(spell_dk_runic_power_feed_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ return new spell_dk_runic_power_feed_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_dk_runic_power_feed_SpellScript();
- }
};
// 55090 Scourge Strike (55265, 55270, 55271)
class spell_dk_scourge_strike : public SpellScriptLoader
{
-public:
- spell_dk_scourge_strike() : SpellScriptLoader("spell_dk_scourge_strike") { }
+ public:
+ spell_dk_scourge_strike() : SpellScriptLoader("spell_dk_scourge_strike") { }
- class spell_dk_scourge_strike_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_dk_scourge_strike_SpellScript)
- bool Validate(SpellEntry const * /*spellEntry*/)
+ class spell_dk_scourge_strike_SpellScript : public SpellScript
{
- if (!sSpellStore.LookupEntry(DK_SPELL_SCOURGE_STRIKE_TRIGGERED))
- return false;
- return true;
- }
+ PrepareSpellScript(spell_dk_scourge_strike_SpellScript);
- void HandleDummy(SpellEffIndex /*effIndex*/)
- {
- Unit* caster = GetCaster();
- if (Unit* unitTarget = GetHitUnit())
+ bool Validate(SpellEntry const * /*spellEntry*/)
{
- int32 bp = CalculatePctN(GetHitDamage(), GetEffectValue() * unitTarget->GetDiseasesByCaster(caster->GetGUID()));
- caster->CastCustomSpell(unitTarget, DK_SPELL_SCOURGE_STRIKE_TRIGGERED, &bp, NULL, NULL, true);
+ if (!sSpellStore.LookupEntry(DK_SPELL_SCOURGE_STRIKE_TRIGGERED))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ if (Unit* unitTarget = GetHitUnit())
+ {
+ int32 bp = CalculatePctN(GetHitDamage(), GetEffectValue() * unitTarget->GetDiseasesByCaster(caster->GetGUID()));
+ caster->CastCustomSpell(unitTarget, DK_SPELL_SCOURGE_STRIKE_TRIGGERED, &bp, NULL, NULL, true);
+ }
}
- }
- void Register()
+ void Register()
+ {
+ OnEffect += SpellEffectFn(spell_dk_scourge_strike_SpellScript::HandleDummy, EFFECT_2, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- OnEffect += SpellEffectFn(spell_dk_scourge_strike_SpellScript::HandleDummy, EFFECT_2, SPELL_EFFECT_DUMMY);
+ return new spell_dk_scourge_strike_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_dk_scourge_strike_SpellScript();
- }
};
// 49145 - Spell Deflection
class spell_dk_spell_deflection : public SpellScriptLoader
{
-public:
- spell_dk_spell_deflection() : SpellScriptLoader("spell_dk_spell_deflection") { }
+ public:
+ spell_dk_spell_deflection() : SpellScriptLoader("spell_dk_spell_deflection") { }
- class spell_dk_spell_deflection_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_dk_spell_deflection_AuraScript);
+ class spell_dk_spell_deflection_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dk_spell_deflection_AuraScript);
- uint32 absorbPct;
+ uint32 absorbPct;
- bool Load()
- {
- absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster());
- return true;
- }
+ bool Load()
+ {
+ absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster());
+ return true;
+ }
- void CalculateAmount(AuraEffect const * /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
- {
- // Set absorbtion amount to unlimited
- amount = -1;
- }
+ void CalculateAmount(AuraEffect const * /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
+ {
+ // Set absorbtion amount to unlimited
+ amount = -1;
+ }
- void Absorb(AuraEffect * /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
- {
- // You have a chance equal to your Parry chance
- if ((dmgInfo.GetDamageType() == DIRECT_DAMAGE) && roll_chance_f(GetTarget()->GetUnitParryChance()))
- absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
- }
+ void Absorb(AuraEffect * /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
+ {
+ // You have a chance equal to your Parry chance
+ if ((dmgInfo.GetDamageType() == DIRECT_DAMAGE) && roll_chance_f(GetTarget()->GetUnitParryChance()))
+ absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
+ }
- void Register()
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_spell_deflection_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
+ OnEffectAbsorb += AuraEffectAbsorbFn(spell_dk_spell_deflection_AuraScript::Absorb, EFFECT_0);
+ }
+ };
+
+ AuraScript *GetAuraScript() const
{
- DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_spell_deflection_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
- OnEffectAbsorb += AuraEffectAbsorbFn(spell_dk_spell_deflection_AuraScript::Absorb, EFFECT_0);
+ return new spell_dk_spell_deflection_AuraScript();
}
- };
-
- AuraScript *GetAuraScript() const
- {
- return new spell_dk_spell_deflection_AuraScript();
- }
};
// 52284 - Will of the Necropolis
class spell_dk_will_of_the_necropolis : public SpellScriptLoader
{
-public:
- spell_dk_will_of_the_necropolis() : SpellScriptLoader("spell_dk_will_of_the_necropolis") { }
-
- class spell_dk_will_of_the_necropolis_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_dk_will_of_the_necropolis_AuraScript);
+ public:
+ spell_dk_will_of_the_necropolis() : SpellScriptLoader("spell_dk_will_of_the_necropolis") { }
- enum Spells
+ class spell_dk_will_of_the_necropolis_AuraScript : public AuraScript
{
- DK_SPELL_WILL_OF_THE_NECROPOLIS_TALENT_R1 = 49189,
- DK_SPELL_WILL_OF_THE_NECROPOLIS_AURA_R1 = 52284,
- };
- bool Validate(SpellEntry const *spellEntry)
- {
- // can't use other spell than will of the necropolis due to spell_ranks dependency
- if (sSpellMgr->GetFirstSpellInChain(DK_SPELL_WILL_OF_THE_NECROPOLIS_AURA_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id))
- return false;
+ PrepareAuraScript(spell_dk_will_of_the_necropolis_AuraScript);
- uint8 rank = sSpellMgr->GetSpellRank(spellEntry->Id);
- if (!sSpellMgr->GetSpellWithRank(DK_SPELL_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank, true))
- return false;
+ bool Validate(SpellEntry const *spellEntry)
+ {
+ // can't use other spell than will of the necropolis due to spell_ranks dependency
+ if (sSpellMgr->GetFirstSpellInChain(DK_SPELL_WILL_OF_THE_NECROPOLIS_AURA_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id))
+ return false;
- return true;
- }
+ uint8 rank = sSpellMgr->GetSpellRank(spellEntry->Id);
+ if (!sSpellMgr->GetSpellWithRank(DK_SPELL_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank, true))
+ return false;
- uint32 absorbPct;
+ return true;
+ }
- bool Load()
- {
- absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster());
- return true;
- }
+ uint32 absorbPct;
- void CalculateAmount(AuraEffect const * /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
- {
- // Set absorbtion amount to unlimited
- amount = -1;
- }
+ bool Load()
+ {
+ absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster());
+ return true;
+ }
- void Absorb(AuraEffect * /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
- {
- // min pct of hp is stored in effect 0 of talent spell
- uint32 rank = sSpellMgr->GetSpellRank(GetSpellProto()->Id);
- SpellEntry const * talentProto = sSpellStore.LookupEntry(sSpellMgr->GetSpellWithRank(DK_SPELL_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank));
+ void CalculateAmount(AuraEffect const * /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
+ {
+ // Set absorbtion amount to unlimited
+ amount = -1;
+ }
- int32 remainingHp = int32(GetTarget()->GetHealth() - dmgInfo.GetDamage());
- int32 minHp = int32(GetTarget()->CountPctFromMaxHealth(SpellMgr::CalculateSpellEffectAmount(talentProto, EFFECT_0, GetCaster())));
+ void Absorb(AuraEffect * /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
+ {
+ // min pct of hp is stored in effect 0 of talent spell
+ uint32 rank = sSpellMgr->GetSpellRank(GetSpellProto()->Id);
+ SpellEntry const * talentProto = sSpellStore.LookupEntry(sSpellMgr->GetSpellWithRank(DK_SPELL_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank));
+
+ int32 remainingHp = int32(GetTarget()->GetHealth() - dmgInfo.GetDamage());
+ int32 minHp = int32(GetTarget()->CountPctFromMaxHealth(SpellMgr::CalculateSpellEffectAmount(talentProto, EFFECT_0, GetCaster())));
- // Damage that would take you below [effect0] health or taken while you are at [effect0]
- if (remainingHp < minHp)
- absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
- }
+ // Damage that would take you below [effect0] health or taken while you are at [effect0]
+ if (remainingHp < minHp)
+ absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
+ }
- void Register()
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_will_of_the_necropolis_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
+ OnEffectAbsorb += AuraEffectAbsorbFn(spell_dk_will_of_the_necropolis_AuraScript::Absorb, EFFECT_0);
+ }
+ };
+
+ AuraScript *GetAuraScript() const
{
- DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_will_of_the_necropolis_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
- OnEffectAbsorb += AuraEffectAbsorbFn(spell_dk_will_of_the_necropolis_AuraScript::Absorb, EFFECT_0);
+ return new spell_dk_will_of_the_necropolis_AuraScript();
}
- };
-
- AuraScript *GetAuraScript() const
- {
- return new spell_dk_will_of_the_necropolis_AuraScript();
- }
};
void AddSC_deathknight_spell_scripts()
@@ -435,6 +474,7 @@ void AddSC_deathknight_spell_scripts()
new spell_dk_anti_magic_shell_self();
new spell_dk_anti_magic_zone();
new spell_dk_corpse_explosion();
+ new spell_dk_death_pact();
new spell_dk_runic_power_feed();
new spell_dk_scourge_strike();
new spell_dk_spell_deflection();
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index c4b6107a9f6..98504899da5 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -26,69 +26,67 @@
enum PriestSpells
{
- PRIEST_SPELL_PENANCE_R1 = 47540,
- PRIEST_SPELL_PENANCE_R1_DAMAGE = 47758,
- PRIEST_SPELL_PENANCE_R1_HEAL = 47757,
+ PRIEST_SPELL_GUARDIAN_SPIRIT_HEAL = 48153,
+ PRIEST_SPELL_PENANCE_R1 = 47540,
+ PRIEST_SPELL_PENANCE_R1_DAMAGE = 47758,
+ PRIEST_SPELL_PENANCE_R1_HEAL = 47757,
+ PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED = 33619,
+ PRIEST_SPELL_REFLECTIVE_SHIELD_R1 = 33201,
};
// Guardian Spirit
class spell_pri_guardian_spirit : public SpellScriptLoader
{
-public:
- spell_pri_guardian_spirit() : SpellScriptLoader("spell_pri_guardian_spirit") { }
+ public:
+ spell_pri_guardian_spirit() : SpellScriptLoader("spell_pri_guardian_spirit") { }
- class spell_pri_guardian_spirit_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_pri_guardian_spirit_AuraScript);
+ class spell_pri_guardian_spirit_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_pri_guardian_spirit_AuraScript);
- uint32 healPct;
+ uint32 healPct;
- enum Spell
- {
- PRI_SPELL_GUARDIAN_SPIRIT_HEAL = 48153,
- };
+ bool Validate(SpellEntry const * /*spellEntry*/)
+ {
+ return sSpellStore.LookupEntry(PRIEST_SPELL_GUARDIAN_SPIRIT_HEAL) != NULL;
+ }
- bool Validate(SpellEntry const * /*spellEntry*/)
- {
- return sSpellStore.LookupEntry(PRI_SPELL_GUARDIAN_SPIRIT_HEAL);
- }
+ bool Load()
+ {
+ healPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_1);
+ return true;
+ }
- bool Load()
- {
- healPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_1);
- return true;
- }
+ void CalculateAmount(AuraEffect const * /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
+ {
+ // Set absorbtion amount to unlimited
+ amount = -1;
+ }
- void CalculateAmount(AuraEffect const * /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
- {
- // Set absorbtion amount to unlimited
- amount = -1;
- }
+ void Absorb(AuraEffect * /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
+ {
+ Unit * target = GetTarget();
+ if (dmgInfo.GetDamage() < target->GetHealth())
+ return;
- void Absorb(AuraEffect * /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
- {
- Unit * target = GetTarget();
- if (dmgInfo.GetDamage() < target->GetHealth())
- return;
-
- int32 healAmount = int32(target->CountPctFromMaxHealth(healPct));
- // remove the aura now, we don't want 40% healing bonus
- Remove(AURA_REMOVE_BY_ENEMY_SPELL);
- target->CastCustomSpell(target, PRI_SPELL_GUARDIAN_SPIRIT_HEAL, &healAmount, NULL, NULL, true);
- absorbAmount = dmgInfo.GetDamage();
- }
+ int32 healAmount = int32(target->CountPctFromMaxHealth(healPct));
+ // remove the aura now, we don't want 40% healing bonus
+ Remove(AURA_REMOVE_BY_ENEMY_SPELL);
+ target->CastCustomSpell(target, PRIEST_SPELL_GUARDIAN_SPIRIT_HEAL, &healAmount, NULL, NULL, true);
+ absorbAmount = dmgInfo.GetDamage();
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pri_guardian_spirit_AuraScript::CalculateAmount, EFFECT_1, SPELL_AURA_SCHOOL_ABSORB);
+ OnEffectAbsorb += AuraEffectAbsorbFn(spell_pri_guardian_spirit_AuraScript::Absorb, EFFECT_1);
+ }
+ };
- void Register()
+ AuraScript *GetAuraScript() const
{
- DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pri_guardian_spirit_AuraScript::CalculateAmount, EFFECT_1, SPELL_AURA_SCHOOL_ABSORB);
- OnEffectAbsorb += AuraEffectAbsorbFn(spell_pri_guardian_spirit_AuraScript::Absorb, EFFECT_1);
+ return new spell_pri_guardian_spirit_AuraScript();
}
- };
-
- AuraScript *GetAuraScript() const
- {
- return new spell_pri_guardian_spirit_AuraScript();
- }
};
class spell_pri_mana_burn : public SpellScriptLoader
@@ -98,15 +96,11 @@ class spell_pri_mana_burn : public SpellScriptLoader
class spell_pri_mana_burn_SpellScript : public SpellScript
{
- PrepareSpellScript(spell_pri_mana_burn_SpellScript)
- bool Validate(SpellEntry const * /*spellEntry*/)
- {
- return true;
- }
+ PrepareSpellScript(spell_pri_mana_burn_SpellScript);
void HandleAfterHit()
{
- Unit * unitTarget = GetHitUnit();
+ Unit* unitTarget = GetHitUnit();
if (!unitTarget)
return;
@@ -125,6 +119,32 @@ class spell_pri_mana_burn : public SpellScriptLoader
}
};
+class spell_pri_mind_sear : public SpellScriptLoader
+{
+ public:
+ spell_pri_mind_sear() : SpellScriptLoader("spell_pri_mind_sear") { }
+
+ class spell_pri_mind_sear_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_pri_mind_sear_SpellScript);
+
+ void FilterTargets(std::list<Unit*>& unitList)
+ {
+ unitList.remove(GetTargetUnit());
+ }
+
+ void Register()
+ {
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_pri_mind_sear_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_AREA_ENEMY_DST);
+ }
+ };
+
+ SpellScript *GetSpellScript() const
+ {
+ return new spell_pri_mind_sear_SpellScript();
+ }
+};
+
class spell_pri_pain_and_suffering_proc : public SpellScriptLoader
{
public:
@@ -133,7 +153,8 @@ class spell_pri_pain_and_suffering_proc : public SpellScriptLoader
// 47948 Pain and Suffering (proc)
class spell_pri_pain_and_suffering_proc_SpellScript : public SpellScript
{
- PrepareSpellScript(spell_pri_pain_and_suffering_proc_SpellScript)
+ PrepareSpellScript(spell_pri_pain_and_suffering_proc_SpellScript);
+
void HandleEffectScriptEffect(SpellEffIndex /*effIndex*/)
{
// Refresh Shadow Word: Pain on target
@@ -161,7 +182,8 @@ class spell_pri_penance : public SpellScriptLoader
class spell_pri_penance_SpellScript : public SpellScript
{
- PrepareSpellScript(spell_pri_penance_SpellScript)
+ PrepareSpellScript(spell_pri_penance_SpellScript);
+
bool Validate(SpellEntry const * spellEntry)
{
if (!sSpellStore.LookupEntry(PRIEST_SPELL_PENANCE_R1))
@@ -211,49 +233,43 @@ class spell_pri_penance : public SpellScriptLoader
// Reflective Shield
class spell_pri_reflective_shield_trigger : public SpellScriptLoader
{
-public:
- spell_pri_reflective_shield_trigger() : SpellScriptLoader("spell_pri_reflective_shield_trigger") { }
-
- class spell_pri_reflective_shield_trigger_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_pri_reflective_shield_trigger_AuraScript);
+ public:
+ spell_pri_reflective_shield_trigger() : SpellScriptLoader("spell_pri_reflective_shield_trigger") { }
- enum Spells
+ class spell_pri_reflective_shield_trigger_AuraScript : public AuraScript
{
- SPELL_PRI_REFLECTIVE_SHIELD_TRIGGERED = 33619,
- SPELL_PRI_REFLECTIVE_SHIELD_R1 = 33201,
- };
+ PrepareAuraScript(spell_pri_reflective_shield_trigger_AuraScript);
- bool Validate(SpellEntry const * /*spellEntry*/)
- {
- return sSpellStore.LookupEntry(SPELL_PRI_REFLECTIVE_SHIELD_TRIGGERED) && sSpellStore.LookupEntry(SPELL_PRI_REFLECTIVE_SHIELD_R1);
- }
+ bool Validate(SpellEntry const * /*spellEntry*/)
+ {
+ return sSpellStore.LookupEntry(PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED) && sSpellStore.LookupEntry(PRIEST_SPELL_REFLECTIVE_SHIELD_R1);
+ }
- void Trigger(AuraEffect * aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount)
- {
- Unit * target = GetTarget();
- if (dmgInfo.GetAttacker() == target)
- return;
- Unit * caster = GetCaster();
- if (!caster)
- return;
- if (AuraEffect * talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_PRI_REFLECTIVE_SHIELD_R1, EFFECT_0))
+ void Trigger(AuraEffect * aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount)
{
- int32 bp = CalculatePctN(absorbAmount, talentAurEff->GetAmount());
- target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_PRI_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff);
+ Unit * target = GetTarget();
+ if (dmgInfo.GetAttacker() == target)
+ return;
+ Unit * caster = GetCaster();
+ if (!caster)
+ return;
+ if (AuraEffect * talentAurEff = target->GetAuraEffectOfRankedSpell(PRIEST_SPELL_REFLECTIVE_SHIELD_R1, EFFECT_0))
+ {
+ int32 bp = CalculatePctN(absorbAmount, talentAurEff->GetAmount());
+ target->CastCustomSpell(dmgInfo.GetAttacker(), PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff);
+ }
}
- }
- void Register()
+ void Register()
+ {
+ AfterEffectAbsorb += AuraEffectAbsorbFn(spell_pri_reflective_shield_trigger_AuraScript::Trigger, EFFECT_0);
+ }
+ };
+
+ AuraScript *GetAuraScript() const
{
- AfterEffectAbsorb += AuraEffectAbsorbFn(spell_pri_reflective_shield_trigger_AuraScript::Trigger, EFFECT_0);
+ return new spell_pri_reflective_shield_trigger_AuraScript();
}
- };
-
- AuraScript *GetAuraScript() const
- {
- return new spell_pri_reflective_shield_trigger_AuraScript();
- }
};
void AddSC_priest_spell_scripts()
@@ -263,4 +279,5 @@ void AddSC_priest_spell_scripts()
new spell_pri_pain_and_suffering_proc;
new spell_pri_penance;
new spell_pri_reflective_shield_trigger();
+ new spell_pri_mind_sear();
}
diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp
index 55a7bb00630..31d35db5edd 100644
--- a/src/server/scripts/Spells/spell_warlock.cpp
+++ b/src/server/scripts/Spells/spell_warlock.cpp
@@ -39,155 +39,128 @@ enum WarlockSpells
// 47193 Demonic Empowerment
class spell_warl_demonic_empowerment : public SpellScriptLoader
{
-public:
- spell_warl_demonic_empowerment() : SpellScriptLoader("spell_warl_demonic_empowerment") { }
+ public:
+ spell_warl_demonic_empowerment() : SpellScriptLoader("spell_warl_demonic_empowerment") { }
- class spell_warl_demonic_empowerment_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_warl_demonic_empowerment_SpellScript)
- bool Validate(SpellEntry const * /*spellEntry*/)
+ class spell_warl_demonic_empowerment_SpellScript : public SpellScript
{
- if (!sSpellStore.LookupEntry(WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS))
- return false;
- if (!sSpellStore.LookupEntry(WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER))
- return false;
- if (!sSpellStore.LookupEntry(WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD))
- return false;
- if (!sSpellStore.LookupEntry(WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER))
- return false;
- if (!sSpellStore.LookupEntry(WARLOCK_DEMONIC_EMPOWERMENT_IMP))
- return false;
- return true;
- }
+ PrepareSpellScript(spell_warl_demonic_empowerment_SpellScript);
- void HandleScriptEffect(SpellEffIndex /*effIndex*/)
- {
- if (Creature* targetCreature = GetHitCreature())
+ bool Validate(SpellEntry const * /*spellEntry*/)
+ {
+ if (!sSpellStore.LookupEntry(WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS))
+ return false;
+ if (!sSpellStore.LookupEntry(WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER))
+ return false;
+ if (!sSpellStore.LookupEntry(WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD))
+ return false;
+ if (!sSpellStore.LookupEntry(WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER))
+ return false;
+ if (!sSpellStore.LookupEntry(WARLOCK_DEMONIC_EMPOWERMENT_IMP))
+ return false;
+ return true;
+ }
+
+ void HandleScriptEffect(SpellEffIndex /*effIndex*/)
{
- if (targetCreature->isPet())
+ if (Creature* targetCreature = GetHitCreature())
{
- CreatureInfo const * ci = ObjectMgr::GetCreatureTemplate(targetCreature->GetEntry());
- switch (ci->family)
+ if (targetCreature->isPet())
{
- case CREATURE_FAMILY_SUCCUBUS:
- targetCreature->CastSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS, true);
- break;
- case CREATURE_FAMILY_VOIDWALKER:
- {
- SpellEntry const* spellInfo = sSpellStore.LookupEntry(WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER);
- int32 hp = int32(targetCreature->CountPctFromMaxHealth(GetCaster()->CalculateSpellDamage(targetCreature, spellInfo, 0)));
- targetCreature->CastCustomSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER, &hp, NULL, NULL, true);
- //unitTarget->CastSpell(unitTarget, 54441, true);
- break;
- }
- case CREATURE_FAMILY_FELGUARD:
- targetCreature->CastSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD, true);
- break;
- case CREATURE_FAMILY_FELHUNTER:
- targetCreature->CastSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER, true);
- break;
- case CREATURE_FAMILY_IMP:
- targetCreature->CastSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_IMP, true);
- break;
+ CreatureInfo const * ci = ObjectMgr::GetCreatureTemplate(targetCreature->GetEntry());
+ switch (ci->family)
+ {
+ case CREATURE_FAMILY_SUCCUBUS:
+ targetCreature->CastSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS, true);
+ break;
+ case CREATURE_FAMILY_VOIDWALKER:
+ {
+ SpellEntry const* spellInfo = sSpellStore.LookupEntry(WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER);
+ int32 hp = int32(targetCreature->CountPctFromMaxHealth(GetCaster()->CalculateSpellDamage(targetCreature, spellInfo, 0)));
+ targetCreature->CastCustomSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER, &hp, NULL, NULL, true);
+ //unitTarget->CastSpell(unitTarget, 54441, true);
+ break;
+ }
+ case CREATURE_FAMILY_FELGUARD:
+ targetCreature->CastSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD, true);
+ break;
+ case CREATURE_FAMILY_FELHUNTER:
+ targetCreature->CastSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER, true);
+ break;
+ case CREATURE_FAMILY_IMP:
+ targetCreature->CastSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_IMP, true);
+ break;
+ }
}
}
}
- }
-
- void Register()
- {
- OnEffect += SpellEffectFn(spell_warl_demonic_empowerment_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
- }
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_warl_demonic_empowerment_SpellScript();
- }
-};
-// 47422 Everlasting Affliction
-class spell_warl_everlasting_affliction : public SpellScriptLoader
-{
-public:
- spell_warl_everlasting_affliction() : SpellScriptLoader("spell_warl_everlasting_affliction") { }
-
- class spell_warl_everlasting_affliction_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_warl_everlasting_affliction_SpellScript)
- void HandleScriptEffect(SpellEffIndex /*effIndex*/)
- {
- if (Unit* unitTarget = GetHitUnit())
- // Refresh corruption on target
- if (AuraEffect* aur = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_WARLOCK, 0x2, 0, 0, GetCaster()->GetGUID()))
- aur->GetBase()->RefreshDuration();
- }
+ void Register()
+ {
+ OnEffect += SpellEffectFn(spell_warl_demonic_empowerment_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
- void Register()
+ SpellScript* GetSpellScript() const
{
- OnEffect += SpellEffectFn(spell_warl_everlasting_affliction_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ return new spell_warl_demonic_empowerment_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_warl_everlasting_affliction_SpellScript();
- }
};
// 6201 Create Healthstone (and ranks)
class spell_warl_create_healthstone : public SpellScriptLoader
{
-public:
- spell_warl_create_healthstone() : SpellScriptLoader("spell_warl_create_healthstone") { }
+ public:
+ spell_warl_create_healthstone() : SpellScriptLoader("spell_warl_create_healthstone") { }
- class spell_warl_create_healthstone_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_warl_create_healthstone_SpellScript)
- static uint32 const iTypes[8][3];
-
- bool Validate(SpellEntry const * /*spellEntry*/)
+ class spell_warl_create_healthstone_SpellScript : public SpellScript
{
- if (!sSpellStore.LookupEntry(WARLOCK_IMPROVED_HEALTHSTONE_R1))
- return false;
- if (!sSpellStore.LookupEntry(WARLOCK_IMPROVED_HEALTHSTONE_R2))
- return false;
- return true;
- }
+ PrepareSpellScript(spell_warl_create_healthstone_SpellScript);
- void HandleScriptEffect(SpellEffIndex effIndex)
- {
- if (Unit* unitTarget = GetHitUnit())
+ static uint32 const iTypes[8][3];
+
+ bool Validate(SpellEntry const * /*spellEntry*/)
{
- uint32 rank = 0;
- // Improved Healthstone
- if (AuraEffect const * aurEff = unitTarget->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, 284, 0))
+ if (!sSpellStore.LookupEntry(WARLOCK_IMPROVED_HEALTHSTONE_R1))
+ return false;
+ if (!sSpellStore.LookupEntry(WARLOCK_IMPROVED_HEALTHSTONE_R2))
+ return false;
+ return true;
+ }
+
+ void HandleScriptEffect(SpellEffIndex effIndex)
+ {
+ if (Unit* unitTarget = GetHitUnit())
{
- switch (aurEff->GetId())
+ uint32 rank = 0;
+ // Improved Healthstone
+ if (AuraEffect const * aurEff = unitTarget->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, 284, 0))
{
- case WARLOCK_IMPROVED_HEALTHSTONE_R1: rank = 1; break;
- case WARLOCK_IMPROVED_HEALTHSTONE_R2: rank = 2; break;
- default:
- sLog->outError("Unknown rank of Improved Healthstone id: %d", aurEff->GetId());
- break;
+ switch (aurEff->GetId())
+ {
+ case WARLOCK_IMPROVED_HEALTHSTONE_R1: rank = 1; break;
+ case WARLOCK_IMPROVED_HEALTHSTONE_R2: rank = 2; break;
+ default:
+ sLog->outError("Unknown rank of Improved Healthstone id: %d", aurEff->GetId());
+ break;
+ }
}
+ uint8 spellRank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
+ if (spellRank > 0 && spellRank <= 8)
+ CreateItem(effIndex, iTypes[spellRank - 1][rank]);
}
- uint8 spellRank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
- if (spellRank > 0 && spellRank <= 8)
- CreateItem(effIndex, iTypes[spellRank - 1][rank]);
}
- }
- void Register()
+ void Register()
+ {
+ OnEffect += SpellEffectFn(spell_warl_create_healthstone_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
{
- OnEffect += SpellEffectFn(spell_warl_create_healthstone_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ return new spell_warl_create_healthstone_SpellScript();
}
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_warl_create_healthstone_SpellScript();
- }
};
uint32 const spell_warl_create_healthstone::spell_warl_create_healthstone_SpellScript::iTypes[8][3] = {
@@ -201,10 +174,66 @@ uint32 const spell_warl_create_healthstone::spell_warl_create_healthstone_SpellS
{36892, 36893, 36894} // Fel Healthstone
};
+// 47422 Everlasting Affliction
+class spell_warl_everlasting_affliction : public SpellScriptLoader
+{
+ public:
+ spell_warl_everlasting_affliction() : SpellScriptLoader("spell_warl_everlasting_affliction") { }
+
+ class spell_warl_everlasting_affliction_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_warl_everlasting_affliction_SpellScript);
+
+ void HandleScriptEffect(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* unitTarget = GetHitUnit())
+ // Refresh corruption on target
+ if (AuraEffect* aur = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_WARLOCK, 0x2, 0, 0, GetCaster()->GetGUID()))
+ aur->GetBase()->RefreshDuration();
+ }
+
+ void Register()
+ {
+ OnEffect += SpellEffectFn(spell_warl_everlasting_affliction_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_warl_everlasting_affliction_SpellScript();
+ }
+};
+
+class spell_warl_seed_of_corruption : public SpellScriptLoader
+{
+ public:
+ spell_warl_seed_of_corruption() : SpellScriptLoader("spell_warl_seed_of_corruption") { }
+
+ class spell_warl_seed_of_corruption_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_warl_seed_of_corruption_SpellScript);
+
+ void FilterTargets(std::list<Unit*>& unitList)
+ {
+ unitList.remove(GetTargetUnit());
+ }
+
+ void Register()
+ {
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_warl_seed_of_corruption_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_AREA_ENEMY_DST);
+ }
+ };
+
+ SpellScript *GetSpellScript() const
+ {
+ return new spell_warl_seed_of_corruption_SpellScript();
+ }
+};
void AddSC_warlock_spell_scripts()
{
new spell_warl_demonic_empowerment();
- new spell_warl_everlasting_affliction();
new spell_warl_create_healthstone();
+ new spell_warl_everlasting_affliction();
+ new spell_warl_seed_of_corruption();
}
diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp
index 833a2802320..83c3d9c137c 100644
--- a/src/server/scripts/Spells/spell_warrior.cpp
+++ b/src/server/scripts/Spells/spell_warrior.cpp
@@ -35,7 +35,7 @@ class spell_warr_last_stand : public SpellScriptLoader
class spell_warr_last_stand_SpellScript : public SpellScript
{
- PrepareSpellScript(spell_warr_last_stand_SpellScript)
+ PrepareSpellScript(spell_warr_last_stand_SpellScript);
bool Validate(SpellEntry const * /*spellEntry*/)
{
@@ -63,7 +63,34 @@ class spell_warr_last_stand : public SpellScriptLoader
}
};
+class spell_warr_improved_spell_reflection : public SpellScriptLoader
+{
+ public:
+ spell_warr_improved_spell_reflection() : SpellScriptLoader("spell_warr_improved_spell_reflection") { }
+
+ class spell_warr_improved_spell_reflection_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_warr_improved_spell_reflection_SpellScript);
+
+ void FilterTargets(std::list<Unit*>& unitList)
+ {
+ unitList.remove(GetCaster());
+ }
+
+ void Register()
+ {
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_warr_improved_spell_reflection_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_PARTY_CASTER);
+ }
+ };
+
+ SpellScript *GetSpellScript() const
+ {
+ return new spell_warr_improved_spell_reflection_SpellScript();
+ }
+};
+
void AddSC_warrior_spell_scripts()
{
- new spell_warr_last_stand;
+ new spell_warr_last_stand();
+ new spell_warr_improved_spell_reflection();
}