Core/Spells: Fix Roar of Sacrifice damage part (#17519)

This commit is contained in:
ariel-
2016-07-16 02:52:32 -03:00
committed by GitHub
parent c78a352250
commit 6988407b43
3 changed files with 57 additions and 1 deletions

View File

@@ -0,0 +1,4 @@
--
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_hun_roar_of_sacrifice';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(53480, 'spell_hun_roar_of_sacrifice');

View File

@@ -3073,6 +3073,13 @@ void SpellMgr::LoadSpellInfoCorrections()
case 53385: // Divine Storm (Damage)
spellInfo->MaxAffectedTargets = 4;
break;
case 53480: // Roar of Sacrifice
// missing spell effect 2 data, taken from 4.3.4
spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA;
spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_DUMMY;
spellInfo->Effects[EFFECT_1].MiscValue = 127;
spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ALLY);
break;
case 42005: // Bloodboil
case 38296: // Spitfire Totem
case 37676: // Insidious Whisper

View File

@@ -58,7 +58,8 @@ enum HunterSpells
SPELL_HUNTER_T9_4P_GREATNESS = 68130,
SPELL_HUNTER_VICIOUS_VIPER = 61609,
SPELL_HUNTER_VIPER_ATTACK_SPEED = 60144,
SPELL_DRAENEI_GIFT_OF_THE_NAARU = 59543
SPELL_DRAENEI_GIFT_OF_THE_NAARU = 59543,
SPELL_ROAR_OF_SACRIFICE_TRIGGERED = 67481
};
// 13161 - Aspect of the Beast
@@ -847,6 +848,49 @@ class spell_hun_readiness : public SpellScriptLoader
}
};
// 53480 - Roar of Sacrifice
class spell_hun_roar_of_sacrifice : public SpellScriptLoader
{
public:
spell_hun_roar_of_sacrifice() : SpellScriptLoader("spell_hun_roar_of_sacrifice") { }
class spell_hun_roar_of_sacrifice_AuraScript : public AuraScript
{
PrepareAuraScript(spell_hun_roar_of_sacrifice_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_ROAR_OF_SACRIFICE_TRIGGERED))
return false;
return true;
}
bool CheckProc(ProcEventInfo& eventInfo)
{
return GetCaster() && (eventInfo.GetDamageInfo()->GetSchoolMask() & GetEffect(EFFECT_1)->GetMiscValue()) != 0;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
uint32 damage = CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount());
eventInfo.GetActor()->CastCustomSpell(SPELL_ROAR_OF_SACRIFICE_TRIGGERED, SPELLVALUE_BASE_POINT0, damage, GetCaster(), TRIGGERED_FULL_MASK, nullptr, aurEff);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_hun_roar_of_sacrifice_AuraScript::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_hun_roar_of_sacrifice_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_DUMMY);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_hun_roar_of_sacrifice_AuraScript();
}
};
// 37506 - Scatter Shot
class spell_hun_scatter_shot : public SpellScriptLoader
{
@@ -1132,6 +1176,7 @@ void AddSC_hunter_spell_scripts()
new spell_hun_piercing_shots();
new spell_hun_rapid_recuperation();
new spell_hun_readiness();
new spell_hun_roar_of_sacrifice();
new spell_hun_scatter_shot();
new spell_hun_sniper_training();
new spell_hun_tame_beast();