Core/Spells: move paladins judgements to spellscripts
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id` IN (53407,20271,53408);
|
||||
INSERT INTO `spell_script_names` (`spell_id` ,`ScriptName`) VALUES
|
||||
(53407,'spell_pal_judgement_of_justice'),
|
||||
(20271,'spell_pal_judgement_of_light'),
|
||||
(53408,'spell_pal_judgement_of_wisdom');
|
||||
@@ -4101,65 +4101,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPELLFAMILY_PALADIN:
|
||||
{
|
||||
// Judgement (seal trigger)
|
||||
if (m_spellInfo->GetCategory() == SPELLCATEGORY_JUDGEMENT)
|
||||
{
|
||||
if (!unitTarget || !unitTarget->IsAlive())
|
||||
return;
|
||||
uint32 spellId1 = 0;
|
||||
uint32 spellId2 = 0;
|
||||
|
||||
// Judgement self add switch
|
||||
switch (m_spellInfo->Id)
|
||||
{
|
||||
case 53407: spellId1 = 20184; break; // Judgement of Justice
|
||||
case 20271: // Judgement of Light
|
||||
case 57774: spellId1 = 20185; break; // Judgement of Light
|
||||
case 53408: spellId1 = 20186; break; // Judgement of Wisdom
|
||||
default:
|
||||
TC_LOG_ERROR("spells", "Unsupported Judgement (seal trigger) spell (Id: %u) in Spell::EffectScriptEffect", m_spellInfo->Id);
|
||||
return;
|
||||
}
|
||||
// all seals have aura dummy in 2 effect
|
||||
Unit::AuraApplicationMap & sealAuras = m_caster->GetAppliedAuras();
|
||||
for (Unit::AuraApplicationMap::iterator iter = sealAuras.begin(); iter != sealAuras.end();)
|
||||
{
|
||||
Aura* aura = iter->second->GetBase();
|
||||
if (aura->GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_SEAL)
|
||||
{
|
||||
if (AuraEffect* aureff = aura->GetEffect(2))
|
||||
if (aureff->GetAuraType() == SPELL_AURA_DUMMY)
|
||||
{
|
||||
if (sSpellMgr->GetSpellInfo(aureff->GetAmount()))
|
||||
spellId2 = aureff->GetAmount();
|
||||
break;
|
||||
}
|
||||
if (!spellId2)
|
||||
{
|
||||
switch (iter->first)
|
||||
{
|
||||
// Seal of light, Seal of wisdom, Seal of justice
|
||||
case 20165:
|
||||
case 20166:
|
||||
case 20164:
|
||||
spellId2 = 54158;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
else
|
||||
++iter;
|
||||
}
|
||||
if (spellId1)
|
||||
m_caster->CastSpell(unitTarget, spellId1, true);
|
||||
if (spellId2)
|
||||
m_caster->CastSpell(unitTarget, spellId2, true);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPELLFAMILY_DEATHKNIGHT:
|
||||
{
|
||||
// Pestilence
|
||||
@@ -5800,6 +5741,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const*
|
||||
TempSummon* summon = map->SummonCreature(entry, pos, properties, duration, caster, m_spellInfo->Id);
|
||||
if (!summon)
|
||||
return;
|
||||
|
||||
if (summon->HasUnitTypeMask(UNIT_MASK_GUARDIAN))
|
||||
((Guardian*)summon)->InitStatsForLevel(level);
|
||||
|
||||
|
||||
@@ -1022,7 +1022,7 @@ class spell_dru_wild_growth : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* spellInfo) OVERRIDE
|
||||
{
|
||||
if (spellInfo->Effects[EFFECT_2].IsEffect() || !spellInfo->Effects[EFFECT_2].CalcValue())
|
||||
if (spellInfo->Effects[EFFECT_2].IsEffect() || spellInfo->Effects[EFFECT_2].CalcValue() <= 0)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -1031,9 +1031,9 @@ class spell_dru_wild_growth : public SpellScriptLoader
|
||||
{
|
||||
targets.remove_if(RaidCheck(GetCaster()));
|
||||
|
||||
int32 const maxTargets = GetSpellInfo()->Effects[EFFECT_2].CalcValue(GetCaster());
|
||||
uint32 const maxTargets = uint32(GetSpellInfo()->Effects[EFFECT_2].CalcValue(GetCaster()));
|
||||
|
||||
if (targets.size() > uint32(maxTargets))
|
||||
if (targets.size() > maxTargets)
|
||||
{
|
||||
targets.sort(Trinity::HealthPctOrderPred());
|
||||
targets.resize(maxTargets);
|
||||
|
||||
@@ -290,7 +290,7 @@ enum PilgrimsBountyBuffFood
|
||||
class spell_pilgrims_bounty_buff_food : public SpellScriptLoader
|
||||
{
|
||||
private:
|
||||
uint32 _triggeredSpellId;
|
||||
uint32 const _triggeredSpellId;
|
||||
public:
|
||||
spell_pilgrims_bounty_buff_food(const char* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
|
||||
|
||||
@@ -298,12 +298,12 @@ class spell_pilgrims_bounty_buff_food : public SpellScriptLoader
|
||||
{
|
||||
PrepareAuraScript(spell_pilgrims_bounty_buff_food_AuraScript)
|
||||
private:
|
||||
uint32 _triggeredSpellId;
|
||||
uint32 const _triggeredSpellId;
|
||||
|
||||
public:
|
||||
spell_pilgrims_bounty_buff_food_AuraScript(uint32 triggeredSpellId) : AuraScript(), _triggeredSpellId(triggeredSpellId) { }
|
||||
|
||||
bool Load()
|
||||
bool Load() OVERRIDE
|
||||
{
|
||||
_handled = false;
|
||||
return true;
|
||||
@@ -311,6 +311,7 @@ class spell_pilgrims_bounty_buff_food : public SpellScriptLoader
|
||||
|
||||
void HandleTriggerSpell(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (_handled)
|
||||
return;
|
||||
|
||||
@@ -318,7 +319,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 +327,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);
|
||||
}
|
||||
|
||||
@@ -57,6 +57,11 @@ enum PaladinSpells
|
||||
|
||||
SPELL_PALADIN_ITEM_HEALING_TRANCE = 37706,
|
||||
|
||||
SPELL_PALADIN_JUDGEMENT_DAMAGE = 54158,
|
||||
SPELL_PALADIN_JUDGEMENT_OF_JUSTICE = 20184,
|
||||
SPELL_PALADIN_JUDGEMENT_OF_LIGHT = 20185,
|
||||
SPELL_PALADIN_JUDGEMENT_OF_WISDOM = 20186,
|
||||
|
||||
SPELL_PALADIN_GLYPH_OF_SALVATION = 63225,
|
||||
|
||||
SPELL_PALADIN_RIGHTEOUS_DEFENSE_TAUNT = 31790,
|
||||
@@ -923,6 +928,67 @@ class spell_pal_item_healing_discount : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 53407 - Judgement of Justice
|
||||
// 20271 - Judgement of Light
|
||||
// 53408 - Judgement of Wisdom
|
||||
class spell_pal_judgement : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_judgement(char const* scriptName, uint32 spellId) : SpellScriptLoader(scriptName), _spellId(spellId) { }
|
||||
|
||||
class spell_pal_judgement_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pal_judgement_SpellScript);
|
||||
|
||||
public:
|
||||
spell_pal_judgement_SpellScript(uint32 spellId) : SpellScript(), _spellId(spellId) { }
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_JUDGEMENT_DAMAGE)
|
||||
|| !sSpellMgr->GetSpellInfo(_spellId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
uint32 spellId2 = SPELL_PALADIN_JUDGEMENT_DAMAGE;
|
||||
|
||||
// some seals have SPELL_AURA_DUMMY in EFFECT_2
|
||||
Unit::AuraEffectList const& auras = GetCaster()->GetAuraEffectsByType(SPELL_AURA_DUMMY);
|
||||
for (Unit::AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
|
||||
{
|
||||
if ((*i)->GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_SEAL && (*i)->GetEffIndex() == EFFECT_2)
|
||||
if (sSpellMgr->GetSpellInfo((*i)->GetAmount()))
|
||||
{
|
||||
spellId2 = (*i)->GetAmount();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
GetCaster()->CastSpell(GetHitUnit(), _spellId, true);
|
||||
GetCaster()->CastSpell(GetHitUnit(), spellId2, true);
|
||||
}
|
||||
|
||||
void Register() OVERRIDE
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pal_judgement_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 const _spellId;
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const OVERRIDE
|
||||
{
|
||||
return new spell_pal_judgement_SpellScript(_spellId);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 const _spellId;
|
||||
};
|
||||
|
||||
// 20425 - Judgement of Command
|
||||
class spell_pal_judgement_of_command : public SpellScriptLoader
|
||||
{
|
||||
@@ -1187,6 +1253,9 @@ void AddSC_paladin_spell_scripts()
|
||||
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("spell_pal_judgement_of_justice", SPELL_PALADIN_JUDGEMENT_OF_JUSTICE);
|
||||
new spell_pal_judgement("spell_pal_judgement_of_light", SPELL_PALADIN_JUDGEMENT_OF_LIGHT);
|
||||
new spell_pal_judgement("spell_pal_judgement_of_wisdom", SPELL_PALADIN_JUDGEMENT_OF_WISDOM);
|
||||
new spell_pal_judgement_of_command();
|
||||
new spell_pal_lay_on_hands();
|
||||
new spell_pal_righteous_defense();
|
||||
|
||||
@@ -57,7 +57,7 @@ enum PriestSpellIcons
|
||||
class PowerCheck
|
||||
{
|
||||
public:
|
||||
explicit PowerCheck(Powers power) : _power(power) { }
|
||||
explicit PowerCheck(Powers const power) : _power(power) { }
|
||||
|
||||
bool operator()(WorldObject* obj) const
|
||||
{
|
||||
@@ -68,7 +68,7 @@ class PowerCheck
|
||||
}
|
||||
|
||||
private:
|
||||
Powers _power;
|
||||
Powers const _power;
|
||||
};
|
||||
|
||||
class RaidCheck
|
||||
|
||||
Reference in New Issue
Block a user