Core/Spells: Implemented multiple spell power costs

This commit is contained in:
Shauren
2015-03-08 13:31:57 +01:00
parent 9ffeb58d09
commit 0ba2e0d5ee
30 changed files with 537 additions and 421 deletions
+8 -4
View File
@@ -947,10 +947,14 @@ class spell_hun_thrill_of_the_hunt : public SpellScriptLoader
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
int32 focus = eventInfo.GetDamageInfo()->GetSpellInfo()->CalcPowerCost(GetTarget(), SpellSchoolMask(eventInfo.GetDamageInfo()->GetSchoolMask()));
focus = CalculatePct(focus, aurEff->GetAmount());
GetTarget()->CastCustomSpell(GetTarget(), SPELL_HUNTER_THRILL_OF_THE_HUNT, &focus, NULL, NULL, true, NULL, aurEff);
std::vector<SpellInfo::CostData> costs = eventInfo.GetDamageInfo()->GetSpellInfo()->CalcPowerCost(GetTarget(), SpellSchoolMask(eventInfo.GetDamageInfo()->GetSchoolMask()));
auto m = std::find_if(costs.begin(), costs.end(), [](SpellInfo::CostData const& cost) { return cost.Power == POWER_FOCUS; });
if (m != costs.end())
{
int32 focus = CalculatePct(m->Amount, aurEff->GetAmount());
if (focus > 0)
GetTarget()->CastCustomSpell(GetTarget(), SPELL_HUNTER_THRILL_OF_THE_HUNT, &focus, NULL, NULL, true, NULL, aurEff);
}
}
void Register() override