mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[8449] Deprecate healing/damage item mods and merge internal data in to spell power.
* Report at loading about deprecated ITEM_MOD_SPELL_HEALING_DONE and ITEM_MOD_SPELL_DAMAGE_DONE and drop support code. * Merge healing/damage base spell bonus fields and function to spell power field/function.
This commit is contained in:
parent
8497b520ce
commit
c8b717ab7d
7 changed files with 30 additions and 39 deletions
|
|
@ -59,8 +59,8 @@ enum ItemModType
|
||||||
ITEM_MOD_ATTACK_POWER = 38,
|
ITEM_MOD_ATTACK_POWER = 38,
|
||||||
ITEM_MOD_RANGED_ATTACK_POWER = 39,
|
ITEM_MOD_RANGED_ATTACK_POWER = 39,
|
||||||
ITEM_MOD_FERAL_ATTACK_POWER = 40,
|
ITEM_MOD_FERAL_ATTACK_POWER = 40,
|
||||||
ITEM_MOD_SPELL_HEALING_DONE = 41,
|
ITEM_MOD_SPELL_HEALING_DONE = 41, // deprecated
|
||||||
ITEM_MOD_SPELL_DAMAGE_DONE = 42,
|
ITEM_MOD_SPELL_DAMAGE_DONE = 42, // deprecated
|
||||||
ITEM_MOD_MANA_REGENERATION = 43,
|
ITEM_MOD_MANA_REGENERATION = 43,
|
||||||
ITEM_MOD_ARMOR_PENETRATION_RATING = 44,
|
ITEM_MOD_ARMOR_PENETRATION_RATING = 44,
|
||||||
ITEM_MOD_SPELL_POWER = 45
|
ITEM_MOD_SPELL_POWER = 45
|
||||||
|
|
|
||||||
|
|
@ -1768,6 +1768,16 @@ void ObjectMgr::LoadItemPrototypes()
|
||||||
sLog.outErrorDb("Item (Entry: %u) has wrong stat_type%d (%u)",i,j+1,proto->ItemStat[j].ItemStatType);
|
sLog.outErrorDb("Item (Entry: %u) has wrong stat_type%d (%u)",i,j+1,proto->ItemStat[j].ItemStatType);
|
||||||
const_cast<ItemPrototype*>(proto)->ItemStat[j].ItemStatType = 0;
|
const_cast<ItemPrototype*>(proto)->ItemStat[j].ItemStatType = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch(proto->ItemStat[j].ItemStatType)
|
||||||
|
{
|
||||||
|
case ITEM_MOD_SPELL_HEALING_DONE:
|
||||||
|
case ITEM_MOD_SPELL_DAMAGE_DONE:
|
||||||
|
sLog.outErrorDb("Item (Entry: %u) has deprecated stat_type%d (%u)",i,j+1,proto->ItemStat[j].ItemStatType);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int j = 0; j < MAX_ITEM_PROTO_DAMAGES; ++j)
|
for (int j = 0; j < MAX_ITEM_PROTO_DAMAGES; ++j)
|
||||||
|
|
|
||||||
|
|
@ -436,8 +436,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
|
||||||
for (int i = 0; i < MAX_COMBAT_RATING; ++i)
|
for (int i = 0; i < MAX_COMBAT_RATING; ++i)
|
||||||
m_baseRatingValue[i] = 0;
|
m_baseRatingValue[i] = 0;
|
||||||
|
|
||||||
m_baseSpellDamage = 0;
|
m_baseSpellPower = 0;
|
||||||
m_baseSpellHealing = 0;
|
|
||||||
m_baseFeralAP = 0;
|
m_baseFeralAP = 0;
|
||||||
m_baseManaRegen = 0;
|
m_baseManaRegen = 0;
|
||||||
|
|
||||||
|
|
@ -6663,12 +6662,6 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl
|
||||||
case ITEM_MOD_FERAL_ATTACK_POWER:
|
case ITEM_MOD_FERAL_ATTACK_POWER:
|
||||||
ApplyFeralAPBonus(int32(val), apply);
|
ApplyFeralAPBonus(int32(val), apply);
|
||||||
break;
|
break;
|
||||||
case ITEM_MOD_SPELL_HEALING_DONE:
|
|
||||||
ApplySpellHealingBonus(int32(val), apply);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_SPELL_DAMAGE_DONE:
|
|
||||||
ApplySpellDamageBonus(int32(val), apply);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_MANA_REGENERATION:
|
case ITEM_MOD_MANA_REGENERATION:
|
||||||
ApplyManaRegenBonus(int32(val), apply);
|
ApplyManaRegenBonus(int32(val), apply);
|
||||||
break;
|
break;
|
||||||
|
|
@ -6676,8 +6669,11 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl
|
||||||
ApplyRatingMod(CR_ARMOR_PENETRATION, int32(val), apply);
|
ApplyRatingMod(CR_ARMOR_PENETRATION, int32(val), apply);
|
||||||
break;
|
break;
|
||||||
case ITEM_MOD_SPELL_POWER:
|
case ITEM_MOD_SPELL_POWER:
|
||||||
ApplySpellHealingBonus(int32(val), apply);
|
ApplySpellPowerBonus(int32(val), apply);
|
||||||
ApplySpellDamageBonus(int32(val), apply);
|
break;
|
||||||
|
// depricated item mods
|
||||||
|
case ITEM_MOD_SPELL_HEALING_DONE:
|
||||||
|
case ITEM_MOD_SPELL_DAMAGE_DONE:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -11936,14 +11932,6 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool
|
||||||
((Player*)this)->ApplyFeralAPBonus(enchant_amount, apply);
|
((Player*)this)->ApplyFeralAPBonus(enchant_amount, apply);
|
||||||
sLog.outDebug("+ %u FERAL_ATTACK_POWER", enchant_amount);
|
sLog.outDebug("+ %u FERAL_ATTACK_POWER", enchant_amount);
|
||||||
break;
|
break;
|
||||||
case ITEM_MOD_SPELL_HEALING_DONE:
|
|
||||||
((Player*)this)->ApplySpellHealingBonus(enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u SPELL_HEALING_DONE", enchant_amount);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_SPELL_DAMAGE_DONE:
|
|
||||||
((Player*)this)->ApplySpellDamageBonus(enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u SPELL_DAMAGE_DONE", enchant_amount);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_MANA_REGENERATION:
|
case ITEM_MOD_MANA_REGENERATION:
|
||||||
((Player*)this)->ApplyManaRegenBonus(enchant_amount, apply);
|
((Player*)this)->ApplyManaRegenBonus(enchant_amount, apply);
|
||||||
sLog.outDebug("+ %u MANA_REGENERATION", enchant_amount);
|
sLog.outDebug("+ %u MANA_REGENERATION", enchant_amount);
|
||||||
|
|
@ -11953,10 +11941,11 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool
|
||||||
sLog.outDebug("+ %u ARMOR PENETRATION", enchant_amount);
|
sLog.outDebug("+ %u ARMOR PENETRATION", enchant_amount);
|
||||||
break;
|
break;
|
||||||
case ITEM_MOD_SPELL_POWER:
|
case ITEM_MOD_SPELL_POWER:
|
||||||
((Player*)this)->ApplySpellHealingBonus(enchant_amount, apply);
|
((Player*)this)->ApplySpellPowerBonus(enchant_amount, apply);
|
||||||
((Player*)this)->ApplySpellDamageBonus(enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u SPELL_POWER", enchant_amount);
|
sLog.outDebug("+ %u SPELL_POWER", enchant_amount);
|
||||||
break;
|
break;
|
||||||
|
case ITEM_MOD_SPELL_HEALING_DONE: // deprecated
|
||||||
|
case ITEM_MOD_SPELL_DAMAGE_DONE: // deprecated
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1686,8 +1686,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||||
void UpdateAttackPowerAndDamage(bool ranged = false);
|
void UpdateAttackPowerAndDamage(bool ranged = false);
|
||||||
void UpdateShieldBlockValue();
|
void UpdateShieldBlockValue();
|
||||||
void UpdateDamagePhysical(WeaponAttackType attType);
|
void UpdateDamagePhysical(WeaponAttackType attType);
|
||||||
void ApplySpellDamageBonus(int32 amount, bool apply);
|
void ApplySpellPowerBonus(int32 amount, bool apply);
|
||||||
void ApplySpellHealingBonus(int32 amount, bool apply);
|
|
||||||
void UpdateSpellDamageAndHealingBonus();
|
void UpdateSpellDamageAndHealingBonus();
|
||||||
|
|
||||||
void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, float& min_damage, float& max_damage);
|
void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, float& min_damage, float& max_damage);
|
||||||
|
|
@ -1705,8 +1704,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||||
uint32 GetRangedCritDamageReduction(uint32 damage) const;
|
uint32 GetRangedCritDamageReduction(uint32 damage) const;
|
||||||
uint32 GetSpellCritDamageReduction(uint32 damage) const;
|
uint32 GetSpellCritDamageReduction(uint32 damage) const;
|
||||||
uint32 GetDotDamageReduction(uint32 damage) const;
|
uint32 GetDotDamageReduction(uint32 damage) const;
|
||||||
uint32 GetBaseSpellDamageBonus() { return m_baseSpellDamage;}
|
uint32 GetBaseSpellPowerBonus() { return m_baseSpellPower; }
|
||||||
uint32 GetBaseSpellHealingBonus() { return m_baseSpellHealing;}
|
|
||||||
|
|
||||||
float GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const;
|
float GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const;
|
||||||
void UpdateBlockPercentage();
|
void UpdateBlockPercentage();
|
||||||
|
|
@ -2348,8 +2346,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||||
|
|
||||||
float m_auraBaseMod[BASEMOD_END][MOD_END];
|
float m_auraBaseMod[BASEMOD_END][MOD_END];
|
||||||
int16 m_baseRatingValue[MAX_COMBAT_RATING];
|
int16 m_baseRatingValue[MAX_COMBAT_RATING];
|
||||||
uint16 m_baseSpellDamage;
|
uint16 m_baseSpellPower;
|
||||||
uint16 m_baseSpellHealing;
|
|
||||||
uint16 m_baseFeralAP;
|
uint16 m_baseFeralAP;
|
||||||
uint16 m_baseManaRegen;
|
uint16 m_baseManaRegen;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,17 +91,12 @@ bool Player::UpdateStats(Stats stat)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::ApplySpellDamageBonus(int32 amount, bool apply)
|
void Player::ApplySpellPowerBonus(int32 amount, bool apply)
|
||||||
{
|
{
|
||||||
m_baseSpellDamage+=apply?amount:-amount;
|
m_baseSpellPower+=apply?amount:-amount;
|
||||||
|
|
||||||
// For speed just update for client
|
// For speed just update for client
|
||||||
ApplyModUInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS, amount, apply);
|
ApplyModUInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS, amount, apply);
|
||||||
}
|
|
||||||
|
|
||||||
void Player::ApplySpellHealingBonus(int32 amount, bool apply)
|
|
||||||
{
|
|
||||||
m_baseSpellHealing+=apply?amount:-amount;
|
|
||||||
// For speed just update for client
|
|
||||||
for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
|
for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
|
||||||
ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+i, amount, apply);;
|
ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+i, amount, apply);;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8267,7 +8267,7 @@ int32 Unit::SpellBaseDamageBonus(SpellSchoolMask schoolMask)
|
||||||
if (GetTypeId() == TYPEID_PLAYER)
|
if (GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
// Base value
|
// Base value
|
||||||
DoneAdvertisedBenefit +=((Player*)this)->GetBaseSpellDamageBonus();
|
DoneAdvertisedBenefit +=((Player*)this)->GetBaseSpellPowerBonus();
|
||||||
|
|
||||||
// Damage bonus from stats
|
// Damage bonus from stats
|
||||||
AuraList const& mDamageDoneOfStatPercent = GetAurasByType(SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT);
|
AuraList const& mDamageDoneOfStatPercent = GetAurasByType(SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT);
|
||||||
|
|
@ -8714,7 +8714,7 @@ int32 Unit::SpellBaseHealingBonus(SpellSchoolMask schoolMask)
|
||||||
if (GetTypeId() == TYPEID_PLAYER)
|
if (GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
// Base value
|
// Base value
|
||||||
AdvertisedBenefit +=((Player*)this)->GetBaseSpellHealingBonus();
|
AdvertisedBenefit +=((Player*)this)->GetBaseSpellPowerBonus();
|
||||||
|
|
||||||
// Healing bonus from stats
|
// Healing bonus from stats
|
||||||
AuraList const& mHealingDoneOfStatPercent = GetAurasByType(SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT);
|
AuraList const& mHealingDoneOfStatPercent = GetAurasByType(SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8448"
|
#define REVISION_NR "8449"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue