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
This commit is contained in:
Vincent_Michael committed 2014-01-26 18:22:06 +01:00
commit 7cc4828554
38 files changed
+651 -272

No files matched your search

+151
View File
@@ -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();