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:
@@ -782,10 +782,9 @@ namespace Scripts.Spells.Rogue
|
||||
damagePerCombo += t5.GetAmount();
|
||||
|
||||
int finalDamage = damagePerCombo;
|
||||
List<SpellPowerCost> cost = GetSpell().GetPowerCost();
|
||||
var c = cost.Find(cost => cost.Power == PowerType.ComboPoints);
|
||||
if (c != null)
|
||||
finalDamage *= c.Amount;
|
||||
int? comboPointCost = GetSpell().GetPowerTypeCostAmount(PowerType.ComboPoints);
|
||||
if (comboPointCost.HasValue)
|
||||
finalDamage *= comboPointCost.Value;
|
||||
|
||||
SetHitDamage(finalDamage);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user