void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); std::vector<SpellPowerCost> const& costs = eventInfo.GetProcSpell()->GetPowerCost(); auto m = std::find_if(costs.begin(), costs.end(), [](SpellPowerCost const& cost) { return cost.Power == POWER_MANA; }); if (m != costs.end()) { int32 mana = CalculatePct(m->Amount, 35); if (mana > 0) GetTarget()->CastCustomSpell(SPELL_SHAMAN_ITEM_MANA_SURGE, SPELLVALUE_BASE_POINT0, mana, GetTarget(), true, NULL, aurEff); } }
bool CheckProc(ProcEventInfo& eventInfo) { return eventInfo.GetProcSpell() != nullptr; }