Scripts/Spells: Fixed arcane barrage + explosion

Port From (https://github.com/TrinityCore/TrinityCore/commit/be8cbab4b3cd9623c42bf89d1bf1d6b40e0ae4fd)
This commit is contained in:
hondacrx
2021-05-17 14:14:17 -04:00
parent 4872dcb649
commit 61c9f6edea
3 changed files with 97 additions and 1 deletions
+14
View File
@@ -186,6 +186,20 @@ namespace Game.Entities
int GetMinPower(PowerType power) { return power == PowerType.LunarPower ? -100 : 0; }
// Always return negative value for power reduction (or 0)
public int ConsumeAllPower(PowerType power)
{
int curPower = GetPower(power);
int minPower = GetMinPower(power);
if (curPower <= minPower)
return 0;
int diff = minPower - curPower;
SetPower(power, minPower);
return diff;
}
// returns negative amount on power reduction
public int ModifyPower(PowerType power, int dVal, bool withPowerUpdate = true)
{