aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
authorVincent_Michael <Vincent_Michael@gmx.de>2014-01-26 18:22:06 +0100
committerVincent_Michael <Vincent_Michael@gmx.de>2014-01-26 18:22:06 +0100
commit7cc482855421a6d6cc02c5ed9148cfde543ba8d6 (patch)
treeed54bedb7e9d0c88fa9d4326426eb1f4aef786ce /src/server/scripts/Spells
parentbdc150ebbd06e5f83b893d3771677f2e670c87d5 (diff)
parent79a2a0c434d24c7bf65a0625fad9dfe87533e2fd (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/game/Entities/Player/Player.cpp src/server/game/Entities/Unit/Unit.cpp src/server/game/Spells/Spell.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp src/server/scripts/Spells/spell_paladin.cpp src/server/scripts/Spells/spell_priest.cpp src/server/scripts/Spells/spell_shaman.cpp src/server/scripts/Spells/spell_warrior.cpp
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp7
-rw-r--r--src/server/scripts/Spells/spell_druid.cpp60
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp57
-rw-r--r--src/server/scripts/Spells/spell_holiday.cpp6
-rw-r--r--src/server/scripts/Spells/spell_item.cpp35
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp70
-rw-r--r--src/server/scripts/Spells/spell_pet.cpp3
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp151
-rw-r--r--src/server/scripts/Spells/spell_rogue.cpp5
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp13
-rw-r--r--src/server/scripts/Spells/spell_warrior.cpp39
11 files changed, 383 insertions, 63 deletions
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index af2e0c57b5a..76f2461bb28 100644
--- a/src/server/scripts/Spells/spell_dk.cpp
+++ b/src/server/scripts/Spells/spell_dk.cpp
@@ -138,13 +138,12 @@ class spell_dk_anti_magic_shell_self : public SpellScriptLoader
absorbAmount = std::min(CalculatePct(dmgInfo.GetDamage(), absorbPct), GetTarget()->CountPctFromMaxHealth(hpPct));
}
- void Trigger(AuraEffect* aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount)
+ 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, SPELL_DK_RUNIC_POWER_ENERGIZE, &bp, NULL, NULL, true, NULL, aurEff);
+ int32 bp = CalculatePct(absorbAmount, 20);
+ GetTarget()->CastCustomSpell(SPELL_DK_RUNIC_POWER_ENERGIZE, SPELLVALUE_BASE_POINT0, bp, GetTarget(), true, NULL, aurEff);
}
void Register() OVERRIDE
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index 20d16dcb3e7..575c2fe2860 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -1152,6 +1152,65 @@ class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader
}
};
+class RaidCheck
+{
+ public:
+ explicit RaidCheck(Unit const* caster) : _caster(caster) { }
+
+ bool operator()(WorldObject* obj) const
+ {
+ if (Unit* target = obj->ToUnit())
+ return !_caster->IsInRaidWith(target);
+
+ return true;
+ }
+
+ private:
+ Unit const* _caster;
+};
+
+// -48438 - Wild Growth
+class spell_dru_wild_growth : public SpellScriptLoader
+{
+ public:
+ spell_dru_wild_growth() : SpellScriptLoader("spell_dru_wild_growth") { }
+
+ class spell_dru_wild_growth_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_dru_wild_growth_SpellScript);
+
+ bool Validate(SpellInfo const* spellInfo) OVERRIDE
+ {
+ if (spellInfo->Effects[EFFECT_2].IsEffect() || !spellInfo->Effects[EFFECT_2].CalcValue())
+ return false;
+ return true;
+ }
+
+ void FilterTargets(std::list<WorldObject*>& targets)
+ {
+ targets.remove_if(RaidCheck(GetCaster()));
+
+ int32 const maxTargets = GetSpellInfo()->Effects[EFFECT_2].CalcValue(GetCaster());
+
+ if (targets.size() > uint32(maxTargets))
+ {
+ targets.sort(Trinity::HealthPctOrderPred());
+ targets.resize(maxTargets);
+ }
+ }
+
+ void Register() OVERRIDE
+ {
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dru_wild_growth_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const OVERRIDE
+ {
+ return new spell_dru_wild_growth_SpellScript();
+ }
+};
+
void AddSC_druid_spell_scripts()
{
new spell_dru_dash();
@@ -1179,4 +1238,5 @@ void AddSC_druid_spell_scripts()
new spell_dru_tiger_s_fury();
new spell_dru_typhoon();
new spell_dru_t10_restoration_4p_bonus();
+ new spell_dru_wild_growth();
}
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 7fff06a0073..891f578e73e 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -2796,22 +2796,65 @@ enum Replenishment
SPELL_INFINITE_REPLENISHMENT = 61782
};
+class ReplenishmentCheck
+{
+public:
+ bool operator()(WorldObject* obj) const
+ {
+ if (Unit* target = obj->ToUnit())
+ return target->getPowerType() != POWER_MANA;
+
+ return true;
+ }
+};
+
class spell_gen_replenishment : public SpellScriptLoader
{
public:
spell_gen_replenishment() : SpellScriptLoader("spell_gen_replenishment") { }
- class spell_gen_replenishment_AuraScript : public AuraScript
+ class spell_gen_replenishment_SpellScript : public SpellScript
{
- PrepareAuraScript(spell_gen_replenishment_AuraScript);
+ PrepareSpellScript(spell_gen_replenishment_SpellScript);
- bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
+ void RemoveInvalidTargets(std::list<WorldObject*>& targets)
{
- if (!sSpellMgr->GetSpellInfo(SPELL_REPLENISHMENT) ||
- !sSpellMgr->GetSpellInfo(SPELL_INFINITE_REPLENISHMENT))
- return false;
- return true;
+ // In arenas Replenishment may only affect the caster
+ if (Player* caster = GetCaster()->ToPlayer())
+ {
+ if (caster->InArena())
+ {
+ targets.clear();
+ targets.push_back(caster);
+ return;
+ }
+ }
+
+ targets.remove_if(ReplenishmentCheck());
+
+ uint8 const maxTargets = 10;
+
+ if (targets.size() > maxTargets)
+ {
+ targets.sort(Trinity::PowerPctOrderPred(POWER_MANA));
+ targets.resize(maxTargets);
+ }
+ }
+
+ void Register() OVERRIDE
+ {
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_gen_replenishment_SpellScript::RemoveInvalidTargets, EFFECT_ALL, TARGET_UNIT_CASTER_AREA_RAID);
}
+ };
+
+ SpellScript* GetSpellScript() const OVERRIDE
+ {
+ return new spell_gen_replenishment_SpellScript();
+ }
+
+ class spell_gen_replenishment_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_gen_replenishment_AuraScript);
bool Load() OVERRIDE
{
diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp
index 08aa19a4755..e066c8eb008 100644
--- a/src/server/scripts/Spells/spell_holiday.cpp
+++ b/src/server/scripts/Spells/spell_holiday.cpp
@@ -303,7 +303,7 @@ class spell_pilgrims_bounty_buff_food : public SpellScriptLoader
public:
spell_pilgrims_bounty_buff_food_AuraScript(uint32 triggeredSpellId) : AuraScript(), _triggeredSpellId(triggeredSpellId) { }
- bool Load()
+ bool Load() OVERRIDE
{
_handled = false;
return true;
@@ -318,7 +318,7 @@ class spell_pilgrims_bounty_buff_food : public SpellScriptLoader
GetTarget()->CastSpell(GetTarget(), _triggeredSpellId, true);
}
- void Register()
+ void Register() OVERRIDE
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_pilgrims_bounty_buff_food_AuraScript::HandleTriggerSpell, EFFECT_2, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
@@ -326,7 +326,7 @@ class spell_pilgrims_bounty_buff_food : public SpellScriptLoader
bool _handled;
};
- AuraScript* GetAuraScript() const
+ AuraScript* GetAuraScript() const OVERRIDE
{
return new spell_pilgrims_bounty_buff_food_AuraScript(_triggeredSpellId);
}
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index 61aba46f001..d8d70246e99 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -349,6 +349,40 @@ class spell_item_deviate_fish : public SpellScriptLoader
}
};
+// 71610, 71641 - Echoes of Light (Althor's Abacus)
+class spell_item_echoes_of_light : public SpellScriptLoader
+{
+ public:
+ spell_item_echoes_of_light() : SpellScriptLoader("spell_item_echoes_of_light") { }
+
+ class spell_item_echoes_of_light_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_echoes_of_light_SpellScript);
+
+ void FilterTargets(std::list<WorldObject*>& targets)
+ {
+ if (targets.size() < 2)
+ return;
+
+ targets.sort(Trinity::HealthPctOrderPred());
+
+ WorldObject* target = targets.front();
+ targets.clear();
+ targets.push_back(target);
+ }
+
+ void Register() OVERRIDE
+ {
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_item_echoes_of_light_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const OVERRIDE
+ {
+ return new spell_item_echoes_of_light_SpellScript();
+ }
+};
+
// http://www.wowhead.com/item=47499 Flask of the North
// 67019 Flask of the North
enum FlaskOfTheNorthSpells
@@ -2526,6 +2560,7 @@ void AddSC_item_spell_scripts()
new spell_item_defibrillate("spell_item_gnomish_army_knife", 33);
new spell_item_desperate_defense();
new spell_item_deviate_fish();
+ new spell_item_echoes_of_light();
new spell_item_flask_of_the_north();
new spell_item_gnomish_death_ray();
new spell_item_make_a_wish();
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp
index 991852c0547..f548255e554 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -524,6 +524,42 @@ class spell_pal_exorcism_and_holy_wrath_damage : public SpellScriptLoader
}
};
+// -9799 - Eye for an Eye
+class spell_pal_eye_for_an_eye : public SpellScriptLoader
+{
+ public:
+ spell_pal_eye_for_an_eye() : SpellScriptLoader("spell_pal_eye_for_an_eye") { }
+
+ class spell_pal_eye_for_an_eye_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_pal_eye_for_an_eye_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE))
+ return false;
+ return true;
+ }
+
+ void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+ int32 damage = CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount());
+ GetTarget()->CastCustomSpell(SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE, SPELLVALUE_BASE_POINT0, damage, eventInfo.GetProcTarget(), true, NULL, aurEff);
+ }
+
+ void Register() OVERRIDE
+ {
+ OnEffectProc += AuraEffectProcFn(spell_pal_eye_for_an_eye_AuraScript::HandleEffectProc, EFFECT_0, m_scriptSpellId == SPELL_PALADIN_EYE_FOR_AN_EYE_RANK_1 ? SPELL_AURA_DUMMY : SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const OVERRIDE
+ {
+ return new spell_pal_eye_for_an_eye_AuraScript();
+ }
+};
+
// -75806 - Grand Crusader
class spell_pal_grand_crusader : public SpellScriptLoader
{
@@ -564,39 +600,36 @@ class spell_pal_grand_crusader : public SpellScriptLoader
}
};
-// -9799 - Eye for an Eye
-class spell_pal_eye_for_an_eye : public SpellScriptLoader
+// 54968 - Glyph of Holy Light
+class spell_pal_glyph_of_holy_light : public SpellScriptLoader
{
public:
- spell_pal_eye_for_an_eye() : SpellScriptLoader("spell_pal_eye_for_an_eye") { }
+ spell_pal_glyph_of_holy_light() : SpellScriptLoader("spell_pal_glyph_of_holy_light") { }
- class spell_pal_eye_for_an_eye_AuraScript : public AuraScript
+ class spell_pal_glyph_of_holy_light_SpellScript : public SpellScript
{
- PrepareAuraScript(spell_pal_eye_for_an_eye_AuraScript);
+ PrepareSpellScript(spell_pal_glyph_of_holy_light_SpellScript);
- bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
+ void FilterTargets(std::list<WorldObject*>& targets)
{
- if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE))
- return false;
- return true;
- }
+ uint32 const maxTargets = GetSpellInfo()->MaxAffectedTargets;
- void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
- {
- PreventDefaultAction();
- int32 damage = CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount());
- GetTarget()->CastCustomSpell(SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE, SPELLVALUE_BASE_POINT0, damage, eventInfo.GetProcTarget(), true, NULL, aurEff);
+ if (targets.size() > maxTargets)
+ {
+ targets.sort(Trinity::HealthPctOrderPred());
+ targets.resize(maxTargets);
+ }
}
void Register() OVERRIDE
{
- OnEffectProc += AuraEffectProcFn(spell_pal_eye_for_an_eye_AuraScript::HandleEffectProc, EFFECT_0, m_scriptSpellId == SPELL_PALADIN_EYE_FOR_AN_EYE_RANK_1 ? SPELL_AURA_DUMMY : SPELL_AURA_PROC_TRIGGER_SPELL);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pal_glyph_of_holy_light_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY);
}
};
- AuraScript* GetAuraScript() const OVERRIDE
+ SpellScript* GetSpellScript() const OVERRIDE
{
- return new spell_pal_eye_for_an_eye_AuraScript();
+ return new spell_pal_glyph_of_holy_light_SpellScript();
}
};
@@ -1073,6 +1106,7 @@ void AddSC_paladin_spell_scripts()
new spell_pal_divine_storm_dummy();
new spell_pal_exorcism_and_holy_wrath_damage();
new spell_pal_eye_for_an_eye();
+ new spell_pal_glyph_of_holy_light();
new spell_pal_grand_crusader();
new spell_pal_hand_of_sacrifice();
new spell_pal_holy_shock();
diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp
index 3877fe22bac..7c8a725ca08 100644
--- a/src/server/scripts/Spells/spell_pet.cpp
+++ b/src/server/scripts/Spells/spell_pet.cpp
@@ -1477,9 +1477,8 @@ public:
// Ravenous Dead. Check just if owner has Ravenous Dead since it's effect is not an aura
if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0))
- {
mod += aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue()/100; // Ravenous Dead edits the original scale
- }
+
// Glyph of the Ghoul
if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_DEATH_KNIGHT_GLYPH_OF_GHOUL, 0))
mod += aurEff->GetAmount()/100;
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index b923c43716e..678ad54955a 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -37,6 +37,7 @@ enum PriestSpells
SPELL_PRIEST_DISPEL_MAGIC_HOSTILE = 97691,
SPELL_PRIEST_DIVINE_AEGIS = 47753,
SPELL_PRIEST_DIVINE_TOUCH = 63544,
+ SPELL_PRIEST_GLYPH_OF_CIRCLE_OF_HEALING = 55675,
SPELL_PRIEST_GLYPH_OF_DISPEL_MAGIC = 55677,
SPELL_PRIEST_GLYPH_OF_DISPEL_MAGIC_HEAL = 56131,
SPELL_PRIEST_GLYPH_OF_LIGHTWELL = 55673,
@@ -75,6 +76,40 @@ enum MiscSpells
SPELL_GEN_REPLENISHMENT = 57669
};
+class PowerCheck
+{
+ public:
+ explicit PowerCheck(Powers power) : _power(power) { }
+
+ bool operator()(WorldObject* obj) const
+ {
+ if (Unit* target = obj->ToUnit())
+ return target->getPowerType() != _power;
+
+ return true;
+ }
+
+ private:
+ Powers _power;
+};
+
+class RaidCheck
+{
+ public:
+ explicit RaidCheck(Unit const* caster) : _caster(caster) { }
+
+ bool operator()(WorldObject* obj) const
+ {
+ if (Unit* target = obj->ToUnit())
+ return !_caster->IsInRaidWith(target);
+
+ return true;
+ }
+
+ private:
+ Unit const* _caster;
+};
+
class spell_pri_body_and_soul : public SpellScriptLoader
{
public:
@@ -126,6 +161,48 @@ class spell_pri_body_and_soul : public SpellScriptLoader
}
};
+// 34861 - Circle of Healing
+class spell_pri_circle_of_healing : public SpellScriptLoader
+{
+ public:
+ spell_pri_circle_of_healing() : SpellScriptLoader("spell_pri_circle_of_healing") { }
+
+ class spell_pri_circle_of_healing_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_pri_circle_of_healing_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_GLYPH_OF_CIRCLE_OF_HEALING))
+ return false;
+ return true;
+ }
+
+ void FilterTargets(std::list<WorldObject*>& targets)
+ {
+ targets.remove_if(RaidCheck(GetCaster()));
+
+ uint32 const maxTargets = GetCaster()->HasAura(SPELL_PRIEST_GLYPH_OF_CIRCLE_OF_HEALING) ? 6 : 5; // Glyph of Circle of Healing
+
+ if (targets.size() > maxTargets)
+ {
+ targets.sort(Trinity::HealthPctOrderPred());
+ targets.resize(maxTargets);
+ }
+ }
+
+ void Register() OVERRIDE
+ {
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pri_circle_of_healing_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const OVERRIDE
+ {
+ return new spell_pri_circle_of_healing_SpellScript();
+ }
+};
+
// 527 - Dispel magic
class spell_pri_dispel_magic : public SpellScriptLoader
{
@@ -235,6 +312,41 @@ class spell_pri_divine_aegis : public SpellScriptLoader
}
};
+// 64844 - Divine Hymn
+class spell_pri_divine_hymn : public SpellScriptLoader
+{
+ public:
+ spell_pri_divine_hymn() : SpellScriptLoader("spell_pri_divine_hymn") { }
+
+ class spell_pri_divine_hymn_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_pri_divine_hymn_SpellScript);
+
+ void FilterTargets(std::list<WorldObject*>& targets)
+ {
+ targets.remove_if(RaidCheck(GetCaster()));
+
+ uint32 const maxTargets = 3;
+
+ if (targets.size() > maxTargets)
+ {
+ targets.sort(Trinity::HealthPctOrderPred());
+ targets.resize(maxTargets);
+ }
+ }
+
+ void Register() OVERRIDE
+ {
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pri_divine_hymn_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const OVERRIDE
+ {
+ return new spell_pri_divine_hymn_SpellScript();
+ }
+};
+
// 55680 - Glyph of Prayer of Healing
class spell_pri_glyph_of_prayer_of_healing : public SpellScriptLoader
{
@@ -400,6 +512,42 @@ class spell_pri_guardian_spirit : public SpellScriptLoader
}
};
+// 64904 - Hymn of Hope
+class spell_pri_hymn_of_hope : public SpellScriptLoader
+{
+ public:
+ spell_pri_hymn_of_hope() : SpellScriptLoader("spell_pri_hymn_of_hope") { }
+
+ class spell_pri_hymn_of_hope_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_pri_hymn_of_hope_SpellScript);
+
+ void FilterTargets(std::list<WorldObject*>& targets)
+ {
+ targets.remove_if(PowerCheck(POWER_MANA));
+ targets.remove_if(RaidCheck(GetCaster()));
+
+ uint32 const maxTargets = 3;
+
+ if (targets.size() > maxTargets)
+ {
+ targets.sort(Trinity::PowerPctOrderPred(POWER_MANA));
+ targets.resize(maxTargets);
+ }
+ }
+
+ void Register() OVERRIDE
+ {
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pri_hymn_of_hope_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const OVERRIDE
+ {
+ return new spell_pri_hymn_of_hope_SpellScript();
+ }
+};
+
// 92833 - Leap of Faith
class spell_pri_leap_of_faith_effect_trigger : public SpellScriptLoader
{
@@ -1077,9 +1225,12 @@ class spell_pri_vampiric_touch : public SpellScriptLoader
void AddSC_priest_spell_scripts()
{
new spell_pri_body_and_soul();
+ new spell_pri_circle_of_healing();
new spell_pri_dispel_magic();
new spell_pri_divine_aegis();
+ new spell_pri_divine_hymn();
new spell_pri_glyph_of_prayer_of_healing();
+ new spell_pri_hymn_of_hope();
new spell_pri_improved_power_word_shield();
new spell_pri_item_greater_heal_refund();
new spell_pri_guardian_spirit();
diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp
index 6c870bb55c4..7768ad7596c 100644
--- a/src/server/scripts/Spells/spell_rogue.cpp
+++ b/src/server/scripts/Spells/spell_rogue.cpp
@@ -339,10 +339,11 @@ class spell_rog_deadly_poison : public SpellScriptLoader
};
// 51690 - Killing Spree
+#define KillingSpreeScriptName "spell_rog_killing_spree"
class spell_rog_killing_spree : public SpellScriptLoader
{
public:
- spell_rog_killing_spree() : SpellScriptLoader("spell_rog_killing_spree") { }
+ spell_rog_killing_spree() : SpellScriptLoader(KillingSpreeScriptName) { }
class spell_rog_killing_spree_SpellScript : public SpellScript
{
@@ -358,7 +359,7 @@ class spell_rog_killing_spree : public SpellScriptLoader
{
if (Aura* aura = GetCaster()->GetAura(SPELL_ROGUE_KILLING_SPREE))
{
- if (spell_rog_killing_spree_AuraScript* script = dynamic_cast<spell_rog_killing_spree_AuraScript*>(aura->GetScriptByName("spell_rog_killing_spree")))
+ if (spell_rog_killing_spree_AuraScript* script = dynamic_cast<spell_rog_killing_spree_AuraScript*>(aura->GetScriptByName(KillingSpreeScriptName)))
script->AddTarget(GetHitUnit());
}
}
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
index b8b481e0244..c3ea8ca2d62 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -126,6 +126,18 @@ class spell_sha_ancestral_awakening_proc : public SpellScriptLoader
return true;
}
+ void FilterTargets(std::list<WorldObject*>& targets)
+ {
+ if (targets.size() < 2)
+ return;
+
+ targets.sort(Trinity::HealthPctOrderPred());
+
+ WorldObject* target = targets.front();
+ targets.clear();
+ targets.push_back(target);
+ }
+
void HandleDummy(SpellEffIndex /*effIndex*/)
{
GetCaster()->CastCustomSpell(SPELL_SHAMAN_ANCESTRAL_AWAKENING_PROC, SPELLVALUE_BASE_POINT0, GetEffectValue(), GetHitUnit(), true);
@@ -133,6 +145,7 @@ class spell_sha_ancestral_awakening_proc : public SpellScriptLoader
void Register() OVERRIDE
{
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_ancestral_awakening_proc_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
OnEffectHitTarget += SpellEffectFn(spell_sha_ancestral_awakening_proc_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp
index a844a4d7e69..3a8af5f0e17 100644
--- a/src/server/scripts/Spells/spell_warrior.cpp
+++ b/src/server/scripts/Spells/spell_warrior.cpp
@@ -330,39 +330,24 @@ class spell_warr_glyph_of_sunder_armor : public SpellScriptLoader
{
PrepareAuraScript(spell_warr_glyph_of_sunder_armor_AuraScript);
- bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
- {
- if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SUNDER_ARMOR))
- return false;
- return true;
- }
-
- bool Load() OVERRIDE
+ void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod)
{
- _target = NULL;
- return true;
- }
-
- bool CheckProc(ProcEventInfo& eventInfo)
- {
- _target = GetTarget()->SelectNearbyTarget(eventInfo.GetProcTarget());
- return _target;
- }
+ if (!spellMod)
+ {
+ spellMod = new SpellModifier(aurEff->GetBase());
+ spellMod->op = SpellModOp(aurEff->GetMiscValue());
+ spellMod->type = SPELLMOD_FLAT;
+ spellMod->spellId = GetId();
+ spellMod->mask = GetSpellInfo()->Effects[aurEff->GetEffIndex()].SpellClassMask;
+ }
- void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
- {
- PreventDefaultAction();
- GetTarget()->CastSpell(_target, SPELL_WARRIOR_SUNDER_ARMOR, true, NULL, aurEff);
+ spellMod->value = aurEff->GetAmount();
}
void Register() OVERRIDE
{
- DoCheckProc += AuraCheckProcFn(spell_warr_glyph_of_sunder_armor_AuraScript::CheckProc);
- OnEffectProc += AuraEffectProcFn(spell_warr_glyph_of_sunder_armor_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
+ DoEffectCalcSpellMod += AuraEffectCalcSpellModFn(spell_warr_glyph_of_sunder_armor_AuraScript::HandleEffectCalcSpellMod, EFFECT_0, SPELL_AURA_DUMMY);
}
-
- private:
- Unit * _target;
};
AuraScript* GetAuraScript() const OVERRIDE
@@ -638,7 +623,7 @@ class spell_warr_retaliation : public SpellScriptLoader
bool CheckProc(ProcEventInfo& eventInfo)
{
- // check attack comes not from behind
+ // check attack comes not from behind and warrior is not stunned
return GetTarget()->isInFront(eventInfo.GetProcTarget(), M_PI) && !GetTarget()->HasUnitState(UNIT_STATE_STUNNED);
}