Core/Misc: Added helper function Unit::SetFullPower * Also renamed Unit::getPowerType and Unit::setPowerType to follow style guidelines
This commit is contained in:
@@ -4820,7 +4820,7 @@ namespace Game.Spells
|
||||
{
|
||||
// Converts up to 10 rage per second into health for $d. Each point of rage is converted into ${$m2/10}.1% of max health.
|
||||
// Should be manauser
|
||||
if (target.getPowerType() != PowerType.Rage)
|
||||
if (target.GetPowerType() != PowerType.Rage)
|
||||
break;
|
||||
int rage = target.GetPower(PowerType.Rage);
|
||||
// Nothing todo
|
||||
@@ -5595,7 +5595,7 @@ namespace Game.Spells
|
||||
{
|
||||
PowerType powerType = (PowerType)GetMiscValue();
|
||||
|
||||
if (caster == null || !caster.IsAlive() || !target.IsAlive() || target.getPowerType() != powerType)
|
||||
if (caster == null || !caster.IsAlive() || !target.IsAlive() || target.GetPowerType() != powerType)
|
||||
return;
|
||||
|
||||
if (target.HasUnitState(UnitState.Isolated) || target.IsImmunedToDamage(GetSpellInfo()))
|
||||
@@ -5646,7 +5646,7 @@ namespace Game.Spells
|
||||
{
|
||||
PowerType powerType;
|
||||
if (GetMiscValue() == (int)PowerType.All)
|
||||
powerType = target.getPowerType();
|
||||
powerType = target.GetPowerType();
|
||||
else
|
||||
powerType = (PowerType)GetMiscValue();
|
||||
|
||||
@@ -5708,7 +5708,7 @@ namespace Game.Spells
|
||||
{
|
||||
PowerType powerType = (PowerType)GetMiscValue();
|
||||
|
||||
if (caster == null || !target.IsAlive() || target.getPowerType() != powerType)
|
||||
if (caster == null || !target.IsAlive() || target.GetPowerType() != powerType)
|
||||
return;
|
||||
|
||||
if (target.HasUnitState(UnitState.Isolated) || target.IsImmunedToDamage(GetSpellInfo()))
|
||||
|
||||
@@ -4931,7 +4931,7 @@ namespace Game.Spells
|
||||
{
|
||||
Unit target1 = m_targets.GetUnitTarget();
|
||||
if (target1 != null)
|
||||
if (target1 != m_caster && unitTarget.getPowerType() != (PowerType)effect.MiscValue)
|
||||
if (target1 != m_caster && unitTarget.GetPowerType() != (PowerType)effect.MiscValue)
|
||||
return SpellCastResult.BadTargets;
|
||||
}
|
||||
break;
|
||||
@@ -5378,7 +5378,7 @@ namespace Game.Spells
|
||||
if (!m_caster.IsTypeId(TypeId.Player) || m_CastItem != null)
|
||||
break;
|
||||
|
||||
if (m_targets.GetUnitTarget().getPowerType() != PowerType.Mana)
|
||||
if (m_targets.GetUnitTarget().GetPowerType() != PowerType.Mana)
|
||||
return SpellCastResult.BadTargets;
|
||||
|
||||
break;
|
||||
|
||||
@@ -823,7 +823,7 @@ namespace Game.Spells
|
||||
|
||||
PowerType powerType = (PowerType)effectInfo.MiscValue;
|
||||
|
||||
if (unitTarget == null || !unitTarget.IsAlive() || unitTarget.getPowerType() != powerType || damage < 0)
|
||||
if (unitTarget == null || !unitTarget.IsAlive() || unitTarget.GetPowerType() != powerType || damage < 0)
|
||||
return;
|
||||
|
||||
// add spell damage bonus
|
||||
@@ -902,7 +902,7 @@ namespace Game.Spells
|
||||
|
||||
PowerType powerType = (PowerType)effectInfo.MiscValue;
|
||||
|
||||
if (unitTarget == null || !unitTarget.IsAlive() || unitTarget.getPowerType() != powerType || damage < 0)
|
||||
if (unitTarget == null || !unitTarget.IsAlive() || unitTarget.GetPowerType() != powerType || damage < 0)
|
||||
return;
|
||||
|
||||
int newDamage = -(unitTarget.ModifyPower(powerType, -damage));
|
||||
@@ -4077,7 +4077,7 @@ namespace Game.Spells
|
||||
player.SetHealth(health);
|
||||
player.SetPower(PowerType.Mana, mana);
|
||||
player.SetPower(PowerType.Rage, 0);
|
||||
player.SetPower(PowerType.Energy, player.GetMaxPower(PowerType.Energy));
|
||||
player.SetFullPower(PowerType.Energy);
|
||||
player.SetPower(PowerType.Focus, 0);
|
||||
|
||||
player.SpawnCorpseBones();
|
||||
|
||||
Reference in New Issue
Block a user