Scripts/Spells: Fixed arcane barrage + explosion
Port From (https://github.com/TrinityCore/TrinityCore/commit/be8cbab4b3cd9623c42bf89d1bf1d6b40e0ae4fd)
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user