mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[7263] Fixed AP calculation in some cases
Fixed use AP dynamic mods (bonuses from stats) Apply ITEM_MOD_ATTACK_POWER for ranged AP Implement feral AP from weapon dps for druids Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
parent
edfa757020
commit
14be347015
5 changed files with 47 additions and 9 deletions
|
|
@ -9788,13 +9788,16 @@ Powers Unit::GetPowerTypeByAuraGroup(UnitMods unitMod) const
|
|||
|
||||
float Unit::GetTotalAttackPowerValue(WeaponAttackType attType) const
|
||||
{
|
||||
UnitMods unitMod = (attType == RANGED_ATTACK) ? UNIT_MOD_ATTACK_POWER_RANGED : UNIT_MOD_ATTACK_POWER;
|
||||
|
||||
float val = GetTotalAuraModValue(unitMod);
|
||||
if(val < 0.0f)
|
||||
val = 0.0f;
|
||||
|
||||
return val;
|
||||
if (attType == RANGED_ATTACK)
|
||||
{
|
||||
uint32 ap = GetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER) + GetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER_MODS);
|
||||
return ap * (1.0f + GetFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER));
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32 ap = GetInt32Value(UNIT_FIELD_ATTACK_POWER) + GetInt32Value(UNIT_FIELD_ATTACK_POWER_MODS);
|
||||
return ap * (1.0f + GetFloatValue(UNIT_FIELD_ATTACK_POWER_MULTIPLIER));
|
||||
}
|
||||
}
|
||||
|
||||
float Unit::GetWeaponDamageRange(WeaponAttackType attType ,WeaponDamageRange type) const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue