*Update creature damage calculation.
--HG-- branch : trunk
This commit is contained in:
+13
-15
@@ -1391,23 +1391,21 @@ void Creature::SelectLevel(const CreatureInfo *cinfo)
|
||||
SetModifierValue(UNIT_MOD_MANA, BASE_VALUE, mana);
|
||||
|
||||
// damage
|
||||
float damagemod = _GetDamageMod(rank);
|
||||
|
||||
uint32 attackpower = cinfo->attackpower * level / 60;
|
||||
uint32 rangedattackpower = cinfo->rangedattackpower * level / 60;
|
||||
damagemod *= 0.75f;
|
||||
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg + attackpower/2) * damagemod);
|
||||
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg + attackpower) * damagemod);
|
||||
SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, (cinfo->mindmg + attackpower/2) * damagemod);
|
||||
SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, (cinfo->maxdmg + attackpower) * damagemod);
|
||||
SetBaseWeaponDamage(RANGED_ATTACK, MINDAMAGE, (cinfo->minrangedmg + rangedattackpower/2) * damagemod);
|
||||
SetBaseWeaponDamage(RANGED_ATTACK, MAXDAMAGE, (cinfo->maxrangedmg + rangedattackpower) * damagemod);
|
||||
//uint32 attackpower = cinfo->attackpower * level / 60;
|
||||
//uint32 rangedattackpower = cinfo->rangedattackpower * level / 60;
|
||||
//damagemod *= 0.75f;
|
||||
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg);
|
||||
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg);
|
||||
SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, cinfo->mindmg);
|
||||
SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, cinfo->maxdmg);
|
||||
SetBaseWeaponDamage(RANGED_ATTACK, MINDAMAGE, cinfo->minrangedmg);
|
||||
SetBaseWeaponDamage(RANGED_ATTACK, MAXDAMAGE, cinfo->maxrangedmg);
|
||||
|
||||
// this value is not accurate, but should be close to the real value
|
||||
SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, level * 5);
|
||||
SetModifierValue(UNIT_MOD_ATTACK_POWER_RANGED, BASE_VALUE, level * 5);
|
||||
//SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, cinfo->attackpower * damagemod);
|
||||
//SetModifierValue(UNIT_MOD_ATTACK_POWER_RANGED, BASE_VALUE, cinfo->rangedattackpower * damagemod);
|
||||
//SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, level * 5);
|
||||
//SetModifierValue(UNIT_MOD_ATTACK_POWER_RANGED, BASE_VALUE, level * 5);
|
||||
SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, cinfo->attackpower);
|
||||
SetModifierValue(UNIT_MOD_ATTACK_POWER_RANGED, BASE_VALUE, cinfo->rangedattackpower);
|
||||
}
|
||||
|
||||
float Creature::_GetHealthMod(int32 Rank)
|
||||
|
||||
+2
-2
@@ -736,7 +736,8 @@ class TRINITY_DLL_SPEC Creature : public Unit
|
||||
uint32 m_PlayerDamageReq;
|
||||
|
||||
void SetOriginalEntry(uint32 entry) { m_originalEntry = entry; }
|
||||
|
||||
|
||||
static float _GetDamageMod(int32 Rank);
|
||||
protected:
|
||||
bool CreateFromProto(uint32 guidlow,uint32 Entry,uint32 team, const CreatureData *data = NULL);
|
||||
bool InitEntry(uint32 entry, uint32 team=ALLIANCE, const CreatureData* data=NULL);
|
||||
@@ -747,7 +748,6 @@ class TRINITY_DLL_SPEC Creature : public Unit
|
||||
void _RealtimeSetCreatureInfo();
|
||||
|
||||
static float _GetHealthMod(int32 Rank);
|
||||
static float _GetDamageMod(int32 Rank);
|
||||
|
||||
uint32 m_lootMoney;
|
||||
uint64 m_lootRecipient;
|
||||
|
||||
@@ -785,6 +785,8 @@ void ObjectMgr::LoadCreatureTemplates()
|
||||
else
|
||||
const_cast<CreatureInfo*>(cInfo)->scale = 1.0f;
|
||||
}
|
||||
|
||||
const_cast<CreatureInfo*>(cInfo)->dmg_multiplier *= Creature::_GetDamageMod(cInfo->rank);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -881,10 +881,10 @@ void Creature::UpdateDamagePhysical(WeaponAttackType attType)
|
||||
float weapon_mindamage = GetWeaponDamageRange(attType, MINDAMAGE);
|
||||
float weapon_maxdamage = GetWeaponDamageRange(attType, MAXDAMAGE);
|
||||
|
||||
float base_value = GetModifierValue(unitMod, BASE_VALUE)
|
||||
+ (weapon_mindamage + weapon_maxdamage)
|
||||
* GetTotalAttackPowerValue(attType) / (getLevel() * 30);
|
||||
//float base_value = GetModifierValue(unitMod, BASE_VALUE) + GetTotalAttackPowerValue(attType);
|
||||
//float base_value = GetModifierValue(unitMod, BASE_VALUE)
|
||||
// + (weapon_mindamage + weapon_maxdamage)
|
||||
// * GetTotalAttackPowerValue(attType) / (getLevel() * 30);
|
||||
float base_value = GetModifierValue(unitMod, BASE_VALUE) + GetTotalAttackPowerValue(attType);
|
||||
float base_pct = GetModifierValue(unitMod, BASE_PCT);
|
||||
float total_value = GetModifierValue(unitMod, TOTAL_VALUE);
|
||||
float total_pct = GetModifierValue(unitMod, TOTAL_PCT);
|
||||
|
||||
Reference in New Issue
Block a user