Core/Unit: rename & cleanup GetCreatePowers
Port From (https://github.com/TrinityCore/TrinityCore/commit/a8ec1ba9bc2d6d24407670159a765099f2a3004d)
This commit is contained in:
@@ -5830,7 +5830,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
// save new stats
|
// save new stats
|
||||||
for (var i = PowerType.Mana; i < PowerType.Max; ++i)
|
for (var i = PowerType.Mana; i < PowerType.Max; ++i)
|
||||||
SetMaxPower(i, GetCreatePowers(i));
|
SetMaxPower(i, GetCreatePowerValue(i));
|
||||||
|
|
||||||
SetMaxHealth(0); // stamina bonus will applied later
|
SetMaxHealth(0); // stamina bonus will applied later
|
||||||
|
|
||||||
|
|||||||
@@ -655,7 +655,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
return (int)(uint)m_unitData.MaxPower[(int)powerIndex];
|
return (int)(uint)m_unitData.MaxPower[(int)powerIndex];
|
||||||
}
|
}
|
||||||
public int GetCreatePowers(PowerType powerType)
|
public int GetCreatePowerValue(PowerType powerType)
|
||||||
{
|
{
|
||||||
if (powerType == PowerType.Mana)
|
if (powerType == PowerType.Mana)
|
||||||
return (int)GetCreateMana();
|
return (int)GetCreateMana();
|
||||||
@@ -1949,7 +1949,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
UnitMods unitMod = UnitMods.PowerStart + (int)power;
|
UnitMods unitMod = UnitMods.PowerStart + (int)power;
|
||||||
|
|
||||||
float value = GetFlatModifierValue(unitMod, UnitModifierFlatType.Base) + GetCreatePowers(power);
|
float value = GetFlatModifierValue(unitMod, UnitModifierFlatType.Base) + GetCreatePowerValue(power);
|
||||||
value *= GetPctModifierValue(unitMod, UnitModifierPctType.Base);
|
value *= GetPctModifierValue(unitMod, UnitModifierPctType.Base);
|
||||||
value += GetFlatModifierValue(unitMod, UnitModifierFlatType.Total);
|
value += GetFlatModifierValue(unitMod, UnitModifierFlatType.Total);
|
||||||
value *= GetPctModifierValue(unitMod, UnitModifierPctType.Total);
|
value *= GetPctModifierValue(unitMod, UnitModifierPctType.Total);
|
||||||
@@ -2067,7 +2067,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
UnitMods unitMod = UnitMods.PowerStart + (int)power;
|
UnitMods unitMod = UnitMods.PowerStart + (int)power;
|
||||||
|
|
||||||
float value = GetFlatModifierValue(unitMod, UnitModifierFlatType.Base) + GetCreatePowers(power);
|
float value = GetFlatModifierValue(unitMod, UnitModifierFlatType.Base) + GetCreatePowerValue(power);
|
||||||
value *= GetPctModifierValue(unitMod, UnitModifierPctType.Base);
|
value *= GetPctModifierValue(unitMod, UnitModifierPctType.Base);
|
||||||
value += GetFlatModifierValue(unitMod, UnitModifierFlatType.Total);
|
value += GetFlatModifierValue(unitMod, UnitModifierFlatType.Total);
|
||||||
value *= GetPctModifierValue(unitMod, UnitModifierPctType.Total);
|
value *= GetPctModifierValue(unitMod, UnitModifierPctType.Total);
|
||||||
|
|||||||
@@ -847,7 +847,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
UnitMods unitMod = UnitMods.PowerStart + (int)power;
|
UnitMods unitMod = UnitMods.PowerStart + (int)power;
|
||||||
|
|
||||||
float value = GetFlatModifierValue(unitMod, UnitModifierFlatType.Base) + GetCreatePowers(power);
|
float value = GetFlatModifierValue(unitMod, UnitModifierFlatType.Base) + GetCreatePowerValue(power);
|
||||||
value *= GetPctModifierValue(unitMod, UnitModifierPctType.Base);
|
value *= GetPctModifierValue(unitMod, UnitModifierPctType.Base);
|
||||||
value += GetFlatModifierValue(unitMod, UnitModifierFlatType.Total);
|
value += GetFlatModifierValue(unitMod, UnitModifierFlatType.Total);
|
||||||
value *= GetPctModifierValue(unitMod, UnitModifierPctType.Total);
|
value *= GetPctModifierValue(unitMod, UnitModifierPctType.Total);
|
||||||
|
|||||||
@@ -648,7 +648,7 @@ namespace Scripts.Spells.Druid
|
|||||||
|
|
||||||
Unit caster = GetCaster();
|
Unit caster = GetCaster();
|
||||||
if (caster)
|
if (caster)
|
||||||
amount = MathFunctions.CalculatePct(caster.GetCreatePowers(PowerType.Mana), amount) / (int)aurEff.GetTotalTicks();
|
amount = MathFunctions.CalculatePct(caster.GetCreatePowerValue(PowerType.Mana), amount) / (int)aurEff.GetTotalTicks();
|
||||||
else
|
else
|
||||||
amount = 0;
|
amount = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user