Scripts/Spells: Use Spell::GetPowerTypeCostAmount where possible instead of iterating Spell::GetPowerCost
Port From (https://github.com/TrinityCore/TrinityCore/commit/26376d89e165aece42e58213632ef43ecb0d81b3)
This commit is contained in:
@@ -977,11 +977,10 @@ namespace Scripts.Spells.Shaman
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
List<SpellPowerCost> costs = eventInfo.GetProcSpell().GetPowerCost();
|
||||
var m = costs.Find(cost => cost.Power == PowerType.Mana);
|
||||
if (m != null)
|
||||
int? manaCost = eventInfo.GetProcSpell().GetPowerTypeCostAmount(PowerType.Mana);
|
||||
if (manaCost.HasValue)
|
||||
{
|
||||
int mana = MathFunctions.CalculatePct(m.Amount, 35);
|
||||
int mana = MathFunctions.CalculatePct(manaCost.Value, 35);
|
||||
if (mana > 0)
|
||||
{
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
|
||||
Reference in New Issue
Block a user