Core/Misc: Added helper function Unit::SetFullPower * Also renamed Unit::getPowerType and Unit::setPowerType to follow style guidelines
This commit is contained in:
@@ -33,8 +33,8 @@ namespace Game.Entities
|
||||
{
|
||||
Unit a = objA.ToUnit();
|
||||
Unit b = objB.ToUnit();
|
||||
float rA = a.GetMaxPower(m_power) != 0 ? a.GetPower(m_power) / (float)a.GetMaxPower(m_power) : 0.0f;
|
||||
float rB = b.GetMaxPower(m_power) != 0 ? b.GetPower(m_power) / (float)b.GetMaxPower(m_power) : 0.0f;
|
||||
float rA = a != null ? a.GetPowerPct(m_power) : 0.0f;
|
||||
float rB = b != null ? b.GetPowerPct(m_power) : 0.0f;
|
||||
return Convert.ToInt32(m_ascending ? rA < rB : rA > rB);
|
||||
}
|
||||
|
||||
|
||||
@@ -944,7 +944,7 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
// Rage from Damage made (only from direct weapon damage)
|
||||
if (cleanDamage != null && (cleanDamage.attackType == WeaponAttackType.BaseAttack || cleanDamage.attackType == WeaponAttackType.OffAttack) && damagetype == DamageEffectType.Direct && this != victim && getPowerType() == PowerType.Rage)
|
||||
if (cleanDamage != null && (cleanDamage.attackType == WeaponAttackType.BaseAttack || cleanDamage.attackType == WeaponAttackType.OffAttack) && damagetype == DamageEffectType.Direct && this != victim && GetPowerType() == PowerType.Rage)
|
||||
{
|
||||
uint rage = (uint)(GetBaseAttackTime(cleanDamage.attackType) / 1000.0f * 1.75f);
|
||||
if (cleanDamage.attackType == WeaponAttackType.OffAttack)
|
||||
|
||||
@@ -215,7 +215,7 @@ namespace Game.Entities
|
||||
|
||||
// Ghoul pets have energy instead of mana (is anywhere better place for this code?)
|
||||
if (minion.IsPetGhoul())
|
||||
minion.setPowerType(PowerType.Energy);
|
||||
minion.SetPowerType(PowerType.Energy);
|
||||
|
||||
// Send infinity cooldown - client does that automatically but after relog cooldown needs to be set again
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(minion.GetUInt32Value(UnitFields.CreatedBySpell));
|
||||
|
||||
@@ -1651,7 +1651,7 @@ namespace Game.Entities
|
||||
// without this when removing IncreaseMaxHealth aura player may stuck with 1 hp
|
||||
// do not why since in IncreaseMaxHealth currenthealth is checked
|
||||
SetHealth(0);
|
||||
SetPower(getPowerType(), 0);
|
||||
SetPower(GetPowerType(), 0);
|
||||
SetUInt32Value(UnitFields.NpcEmotestate, 0);
|
||||
|
||||
// players in instance don't have ZoneScript, but they have InstanceScript
|
||||
@@ -1969,7 +1969,7 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
setPowerType(displayPower);
|
||||
SetPowerType(displayPower);
|
||||
}
|
||||
|
||||
public FactionTemplateRecord GetFactionTemplateEntry()
|
||||
|
||||
Reference in New Issue
Block a user