mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
Core/Spells: Fix paladin talent "Eye for an Eye"
Note: Add proc flags hack (default proc flags not working)
This commit is contained in:
9
sql/updates/world/2013_06_28_01_world_spell_misc_434.sql
Normal file
9
sql/updates/world/2013_06_28_01_world_spell_misc_434.sql
Normal file
@@ -0,0 +1,9 @@
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName`="spell_pal_eye_for_an_eye";
|
||||
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
|
||||
(9799, "spell_pal_eye_for_an_eye"),
|
||||
(25988, "spell_pal_eye_for_an_eye");
|
||||
|
||||
DELETE FROM `spell_proc_event` WHERE `entry` IN (9799,25988);
|
||||
INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES
|
||||
(9799, 0, 0, 0, 0, 0, 0x10000, 0, 0, 0, 0),
|
||||
(25988, 0, 0, 0, 0, 0, 0x10000, 0, 0, 0, 0);
|
||||
@@ -46,6 +46,7 @@ enum PaladinSpells
|
||||
SPELL_PALADIN_DIVINE_STORM_DUMMY = 54171,
|
||||
SPELL_PALADIN_DIVINE_STORM_HEAL = 54172,
|
||||
|
||||
SPELL_PALADIN_EYE_FOR_AN_EYE_RANK_1 = 9799,
|
||||
SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE = 25997,
|
||||
|
||||
SPELL_PALADIN_FORBEARANCE = 25771,
|
||||
@@ -456,17 +457,16 @@ class spell_pal_eye_for_an_eye : public SpellScriptLoader
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
// return damage % to attacker but < 50% own total health
|
||||
int32 damage = int32(std::min(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount()), GetTarget()->GetMaxHealth() / 2));
|
||||
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()
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_pal_eye_for_an_eye_AuraScript::OnProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user