aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVincent-Michael <Vincent_Michael@gmx.de>2013-07-28 18:41:57 +0200
committerVincent-Michael <Vincent_Michael@gmx.de>2013-07-28 18:41:57 +0200
commit0710f480b7e26f235d65ce6ab4c547788cd70ac9 (patch)
treeaa5fcf02f92c00e66693d319fafca980c7f9b4a2 /src
parent9c5c43381bed3aec22307a8a96f7984ab96e7eac (diff)
parent62918e92d0493978e16f5fb1365818e9efa8461b (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/game/Spells/Auras/SpellAuras.cpp src/server/scripts/Spells/spell_dk.cpp src/server/scripts/Spells/spell_paladin.cpp
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp2
-rw-r--r--src/server/game/Spells/Auras/SpellAuras.cpp17
-rw-r--r--src/server/game/Spells/SpellScript.cpp2
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp4
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp306
5 files changed, 291 insertions, 40 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 74fe8f9108c..213d9eb74a3 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -4862,7 +4862,7 @@ void ObjectMgr::LoadSpellScriptNames()
else
{
if (spellInfo->IsRanked())
- TC_LOG_ERROR(LOG_FILTER_SQL, "Scriptname: `%s` spell (Id: %d) is ranked spell. Properly not all ranks are assigned to this script.", scriptName, spellId);
+ TC_LOG_ERROR(LOG_FILTER_SQL, "Scriptname: `%s` spell (Id: %d) is ranked spell. Perhaps not all ranks are assigned to this script.", scriptName, spellId);
_spellScriptsStore.insert(SpellScriptsContainer::value_type(spellInfo->Id, GetScriptId(scriptName)));
}
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index a2d25567cd2..b1602e8c03a 100644
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -1475,23 +1475,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
case SPELLFAMILY_PALADIN:
switch (GetId())
{
- case 31821:
- // Aura Mastery Triggered Spell Handler
- // If apply Concentration Aura -> trigger -> apply Aura Mastery Immunity
- // If remove Concentration Aura -> trigger -> remove Aura Mastery Immunity
- // If remove Aura Mastery -> trigger -> remove Aura Mastery Immunity
- // Do effects only on aura owner
- if (GetCasterGUID() != target->GetGUID())
- break;
-
- if (apply)
- {
- if ((GetSpellInfo()->Id == 31821 && target->HasAura(19746, GetCasterGUID())) || (GetSpellInfo()->Id == 19746 && target->HasAura(31821)))
- target->CastSpell(target, 64364, true);
- }
- else
- target->RemoveAurasDueToSpell(64364, GetCasterGUID());
- break;
case 31842: // Divine Favor
// Item - Paladin T10 Holy 2P Bonus
if (target->HasAura(70755))
diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp
index 404c62efb53..5fb4d69cd02 100644
--- a/src/server/game/Spells/SpellScript.cpp
+++ b/src/server/game/Spells/SpellScript.cpp
@@ -136,7 +136,7 @@ bool _SpellScript::EffectAuraNameCheck::Check(SpellInfo const* spellEntry, uint8
return true;
if (!spellEntry->Effects[effIndex].ApplyAuraName)
return false;
- return (effAurName == SPELL_EFFECT_ANY) || (spellEntry->Effects[effIndex].ApplyAuraName == effAurName);
+ return (effAurName == SPELL_AURA_ANY) || (spellEntry->Effects[effIndex].ApplyAuraName == effAurName);
}
std::string _SpellScript::EffectAuraNameCheck::ToString()
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index 24a6d40a0de..3a4cb5700a2 100644
--- a/src/server/scripts/Spells/spell_dk.cpp
+++ b/src/server/scripts/Spells/spell_dk.cpp
@@ -922,13 +922,13 @@ class spell_dk_necrotic_strike : public SpellScriptLoader
amount = int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.7f);
}
- void Register()
+ void Register() OVERRIDE
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_necrotic_strike_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_HEAL_ABSORB);
}
};
- AuraScript* GetAuraScript() const
+ AuraScript* GetAuraScript() const OVERRIDE
{
return new spell_dk_necrotic_strike_AuraScript();
}
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp
index 0c660cf2eaa..ee1e1aad9c4 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -29,12 +29,14 @@
enum PaladinSpells
{
+ SPELL_PALADIN_AURA_MASTERY_IMMUNE = 64364,
SPELL_PALADIN_BEACON_OF_LIGHT_MARKER = 53563,
SPELL_PALADIN_BEACON_OF_LIGHT_HEAL = 53652,
SPELL_PALADIN_BLESSING_OF_LOWER_CITY_DRUID = 37878,
SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PALADIN = 37879,
SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PRIEST = 37880,
SPELL_PALADIN_BLESSING_OF_LOWER_CITY_SHAMAN = 37881,
+ SPELL_PALADIN_CONCENTRACTION_AURA = 19746,
SPELL_PALADIN_DIVINE_PURPOSE_PROC = 90174,
SPELL_PALADIN_DIVINE_SACRIFICE = 64205,
SPELL_PALADIN_DIVINE_STORM = 53385,
@@ -50,9 +52,14 @@ enum PaladinSpells
SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE = 25912,
SPELL_PALADIN_HOLY_SHOCK_R1_HEALING = 25914,
SPELL_PALADIN_IMMUNE_SHIELD_MARKER = 61988,
+ SPELL_PALADIN_IMPROVED_CONCENTRACTION_AURA = 63510,
+ SPELL_PALADIN_IMPROVED_DEVOTION_AURA = 63514,
SPELL_PALADIN_ITEM_HEALING_TRANCE = 37706,
SPELL_PALADIN_RIGHTEOUS_DEFENSE_TAUNT = 31790,
- SPELL_PALADIN_SEAL_OF_RIGHTEOUSNESS = 25742
+ SPELL_PALADIN_SANCTIFIED_RETRIBUTION_AURA = 63531,
+ SPELL_PALADIN_SANCTIFIED_RETRIBUTION_R1 = 31869,
+ SPELL_PALADIN_SEAL_OF_RIGHTEOUSNESS = 25742,
+ SPELL_PALADIN_SWIFT_RETRIBUTION_R1 = 53379
};
enum MiscSpells
@@ -60,6 +67,12 @@ enum MiscSpells
SPELL_GENERIC_ARENA_DAMPENING = 74410,
SPELL_GENERIC_BATTLEGROUND_DAMPENING = 74411
};
+
+enum PaladinSpellIcons
+{
+ PALADIN_ICON_ID_RETRIBUTION_AURA = 555
+};
+
/*
// 31850 - Ardent Defender
class spell_pal_ardent_defender : public SpellScriptLoader
@@ -137,6 +150,81 @@ class spell_pal_ardent_defender : public SpellScriptLoader
}
};
*/
+
+// 31821 - Aura Mastery
+class spell_pal_aura_mastery : public SpellScriptLoader
+{
+ public:
+ spell_pal_aura_mastery() : SpellScriptLoader("spell_pal_aura_mastery") { }
+
+ class spell_pal_aura_mastery_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_pal_aura_mastery_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_AURA_MASTERY_IMMUNE))
+ return false;
+ return true;
+ }
+
+ void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ GetTarget()->CastSpell(GetTarget(), SPELL_PALADIN_AURA_MASTERY_IMMUNE, true);
+ }
+
+ void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ GetTarget()->RemoveOwnedAura(SPELL_PALADIN_AURA_MASTERY_IMMUNE, GetCasterGUID());
+ }
+
+ void Register() OVERRIDE
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_pal_aura_mastery_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_ADD_PCT_MODIFIER, AURA_EFFECT_HANDLE_REAL);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_pal_aura_mastery_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_ADD_PCT_MODIFIER, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const OVERRIDE
+ {
+ return new spell_pal_aura_mastery_AuraScript();
+ }
+};
+
+// 64364 - Aura Mastery Immune
+class spell_pal_aura_mastery_immune : public SpellScriptLoader
+{
+ public:
+ spell_pal_aura_mastery_immune() : SpellScriptLoader("spell_pal_aura_mastery_immune") { }
+
+ class spell_pal_aura_mastery_immune_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_pal_aura_mastery_immune_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_CONCENTRACTION_AURA))
+ return false;
+ return true;
+ }
+
+ bool CheckAreaTarget(Unit* target)
+ {
+ return target->HasAura(SPELL_PALADIN_CONCENTRACTION_AURA, GetCasterGUID());
+ }
+
+ void Register() OVERRIDE
+ {
+ DoCheckAreaTarget += AuraCheckAreaTargetFn(spell_pal_aura_mastery_immune_AuraScript::CheckAreaTarget);
+ }
+ };
+
+ AuraScript* GetAuraScript() const OVERRIDE
+ {
+ return new spell_pal_aura_mastery_immune_AuraScript();
+ }
+};
+
// 37877 - Blessing of Faith
class spell_pal_blessing_of_faith : public SpellScriptLoader
{
@@ -515,38 +603,36 @@ class spell_pal_hand_of_sacrifice : public SpellScriptLoader
}
};
-// 37705 - Healing Discount
-class spell_pal_item_healing_discount : public SpellScriptLoader
+// 1038 - Hand of Salvation
+class spell_pal_hand_of_salvation : public SpellScriptLoader
{
public:
- spell_pal_item_healing_discount() : SpellScriptLoader("spell_pal_item_healing_discount") { }
+ spell_pal_hand_of_salvation() : SpellScriptLoader("spell_pal_hand_of_salvation") { }
- class spell_pal_item_healing_discount_AuraScript : public AuraScript
+ class spell_pal_hand_of_salvation_AuraScript : public AuraScript
{
- PrepareAuraScript(spell_pal_item_healing_discount_AuraScript);
-
- bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
- {
- if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_ITEM_HEALING_TRANCE))
- return false;
- return true;
- }
+ PrepareAuraScript(spell_pal_hand_of_salvation_AuraScript);
- void OnProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
+ void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
{
- PreventDefaultAction();
- GetTarget()->CastSpell(GetTarget(), SPELL_PALADIN_ITEM_HEALING_TRANCE, true, NULL, aurEff);
+ if (Unit* caster = GetCaster())
+ {
+ // Glyph of Salvation
+ if (caster->GetGUID() == GetUnitOwner()->GetGUID())
+ if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_PALADIN_GLYPH_OF_SALVATION, EFFECT_0))
+ amount -= aurEff->GetAmount();
+ }
}
void Register() OVERRIDE
{
- OnEffectProc += AuraEffectProcFn(spell_pal_item_healing_discount_AuraScript::OnProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pal_hand_of_salvation_AuraScript::CalculateAmount, EFFECT_1, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN);
}
};
AuraScript* GetAuraScript() const OVERRIDE
{
- return new spell_pal_item_healing_discount_AuraScript();
+ return new spell_pal_hand_of_salvation_AuraScript();
}
};
@@ -622,6 +708,177 @@ class spell_pal_holy_shock : public SpellScriptLoader
}
};
+// Maybe this is incorrect
+// These spells should always be cast on login, regardless of whether the player has the talent or not
+
+// -20254 - Improved Concentration Aura
+// -20138 - Improved Devotion Aura
+// 31869 - Sanctified Retribution
+// -53379 - Swift Retribution
+class spell_pal_improved_aura : public SpellScriptLoader
+{
+ public:
+ spell_pal_improved_aura(char const* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { }
+
+ class spell_pal_improved_aura_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_pal_improved_aura_AuraScript);
+
+ public:
+ spell_pal_improved_aura_AuraScript(uint32 spellId) : AuraScript(), _spellId(spellId) { }
+
+ bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
+ {
+ if (!sSpellMgr->GetSpellInfo(_spellId)
+ || !sSpellMgr->GetSpellInfo(SPELL_PALADIN_SANCTIFIED_RETRIBUTION_R1)
+ || !sSpellMgr->GetSpellInfo(SPELL_PALADIN_SWIFT_RETRIBUTION_R1))
+ return false;
+ return true;
+ }
+
+ void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* target = GetTarget();
+ if (!target->GetOwnedAura(_spellId))
+ target->CastSpell(target, _spellId, true);
+ }
+
+ void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ uint32 spellId = GetSpellInfo()->GetFirstRankSpell()->Id;
+
+ if ((spellId == SPELL_PALADIN_SANCTIFIED_RETRIBUTION_R1 && GetTarget()->GetAuraOfRankedSpell(SPELL_PALADIN_SWIFT_RETRIBUTION_R1))
+ || (spellId == SPELL_PALADIN_SWIFT_RETRIBUTION_R1 && GetTarget()->GetAuraOfRankedSpell(SPELL_PALADIN_SANCTIFIED_RETRIBUTION_R1)))
+ return;
+
+ GetTarget()->RemoveOwnedAura(_spellId, GetCasterGUID());
+ }
+
+ void Register() OVERRIDE
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_pal_improved_aura_AuraScript::HandleEffectApply, EFFECT_FIRST_FOUND, SPELL_AURA_ADD_FLAT_MODIFIER, AURA_EFFECT_HANDLE_REAL);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_pal_improved_aura_AuraScript::HandleEffectRemove, EFFECT_FIRST_FOUND, SPELL_AURA_ADD_FLAT_MODIFIER, AURA_EFFECT_HANDLE_REAL);
+ }
+
+ private:
+ uint32 _spellId;
+ };
+
+ AuraScript* GetAuraScript() const OVERRIDE
+ {
+ return new spell_pal_improved_aura_AuraScript(_spellId);
+ }
+
+ private:
+ uint32 _spellId;
+};
+
+// 63510 - Improved Concentraction Aura (Area Aura)
+// 63514 - Improved Devotion Aura (Area Aura)
+// 63531 - Sanctified Retribution (Area Aura)
+class spell_pal_improved_aura_effect : public SpellScriptLoader
+{
+ public:
+ spell_pal_improved_aura_effect(char const* name) : SpellScriptLoader(name) { }
+
+ class spell_pal_improved_aura_effect_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_pal_improved_aura_effect_AuraScript);
+
+ bool CheckAreaTarget(Unit* target)
+ {
+ Unit::AuraApplicationMap& appliedAuras = target->GetAppliedAuras();
+ for (Unit::AuraApplicationMap::iterator itr = appliedAuras.begin(); itr != appliedAuras.end(); ++itr)
+ {
+ Aura const* aura = itr->second->GetBase();
+ if (aura->GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_AURA && aura->GetCasterGUID() == GetCasterGUID())
+ {
+ // Not allow for Retribution Aura (prevent stacking) - Retribution Aura Overflow and Retribution Aura has same spell effects
+ if (GetSpellInfo()->Id == SPELL_PALADIN_SANCTIFIED_RETRIBUTION_AURA && aura->GetSpellInfo()->SpellIconID == PALADIN_ICON_ID_RETRIBUTION_AURA)
+ return false;
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ void Register() OVERRIDE
+ {
+ DoCheckAreaTarget += AuraCheckAreaTargetFn(spell_pal_improved_aura_effect_AuraScript::CheckAreaTarget);
+ }
+ };
+
+ AuraScript* GetAuraScript() const OVERRIDE
+ {
+ return new spell_pal_improved_aura_effect_AuraScript();
+ }
+};
+
+// 37705 - Healing Discount
+class spell_pal_item_healing_discount : public SpellScriptLoader
+{
+ public:
+ spell_pal_item_healing_discount() : SpellScriptLoader("spell_pal_item_healing_discount") { }
+
+ class spell_pal_item_healing_discount_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_pal_item_healing_discount_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_ITEM_HEALING_TRANCE))
+ return false;
+ return true;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
+ {
+ PreventDefaultAction();
+ GetTarget()->CastSpell(GetTarget(), SPELL_PALADIN_ITEM_HEALING_TRANCE, true, NULL, aurEff);
+ }
+
+ void Register() OVERRIDE
+ {
+ OnEffectProc += AuraEffectProcFn(spell_pal_item_healing_discount_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const OVERRIDE
+ {
+ return new spell_pal_item_healing_discount_AuraScript();
+ }
+};
+
+// 20425 - Judgement of Command
+class spell_pal_judgement_of_command : public SpellScriptLoader
+{
+ public:
+ spell_pal_judgement_of_command() : SpellScriptLoader("spell_pal_judgement_of_command") { }
+
+ class spell_pal_judgement_of_command_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_pal_judgement_of_command_SpellScript);
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* unitTarget = GetHitUnit())
+ if (SpellInfo const* spell_proto = sSpellMgr->GetSpellInfo(GetEffectValue()))
+ GetCaster()->CastSpell(unitTarget, spell_proto, true, NULL);
+ }
+
+ void Register() OVERRIDE
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_pal_judgement_of_command_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const OVERRIDE
+ {
+ return new spell_pal_judgement_of_command_SpellScript();
+ }
+};
+
// 633 - Lay on Hands
class spell_pal_lay_on_hands : public SpellScriptLoader
{
@@ -893,6 +1150,8 @@ class spell_pal_seal_of_righteousness : public SpellScriptLoader
void AddSC_paladin_spell_scripts()
{
//new spell_pal_ardent_defender();
+ new spell_pal_aura_mastery();
+ new spell_pal_aura_mastery_immune();
new spell_pal_beacon_of_light();
new spell_pal_blessing_of_faith();
new spell_pal_divine_sacrifice();
@@ -901,8 +1160,17 @@ void AddSC_paladin_spell_scripts()
new spell_pal_exorcism_and_holy_wrath_damage();
new spell_pal_eye_for_an_eye();
new spell_pal_hand_of_sacrifice();
- new spell_pal_item_healing_discount();
+ new spell_pal_hand_of_salvation();
new spell_pal_holy_shock();
+ new spell_pal_improved_aura("spell_pal_improved_concentraction_aura", SPELL_PALADIN_IMPROVED_CONCENTRACTION_AURA);
+ new spell_pal_improved_aura("spell_pal_improved_devotion_aura", SPELL_PALADIN_IMPROVED_DEVOTION_AURA);
+ new spell_pal_improved_aura("spell_pal_sanctified_retribution", SPELL_PALADIN_SANCTIFIED_RETRIBUTION_AURA);
+ new spell_pal_improved_aura("spell_pal_swift_retribution", SPELL_PALADIN_SANCTIFIED_RETRIBUTION_AURA);
+ new spell_pal_improved_aura_effect("spell_pal_improved_concentraction_aura_effect");
+ new spell_pal_improved_aura_effect("spell_pal_improved_devotion_aura_effect");
+ new spell_pal_improved_aura_effect("spell_pal_sanctified_retribution_effect");
+ new spell_pal_item_healing_discount();
+ new spell_pal_judgement_of_command();
new spell_pal_lay_on_hands();
new spell_pal_righteous_defense();
new spell_pal_sacred_shield();