aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-09-02 18:11:11 -0500
committermegamage <none@none>2009-09-02 18:11:11 -0500
commit9d161ff757daf47335f7cc84825463cc30818c8c (patch)
tree2699fefb968d8628c3db688fe23527dedd3b9d9f /src
parentb8d1a0cd1794caab60d5815652355945de4586b3 (diff)
[8449] Deprecate healing/damage item mods and merge internal data in to spell power. Author: VladimirMangos
* 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. --HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/ItemPrototype.h4
-rw-r--r--src/game/ObjectMgr.cpp10
-rw-r--r--src/game/Player.cpp29
-rw-r--r--src/game/Player.h9
-rw-r--r--src/game/SpellMgr.cpp3
-rw-r--r--src/game/StatSystem.cpp13
-rw-r--r--src/game/Unit.cpp4
7 files changed, 31 insertions, 41 deletions
diff --git a/src/game/ItemPrototype.h b/src/game/ItemPrototype.h
index ac61d1be670..bb2da3be4de 100644
--- a/src/game/ItemPrototype.h
+++ b/src/game/ItemPrototype.h
@@ -61,8 +61,8 @@ enum ItemModType
ITEM_MOD_ATTACK_POWER = 38,
ITEM_MOD_RANGED_ATTACK_POWER = 39,
ITEM_MOD_FERAL_ATTACK_POWER = 40,
- ITEM_MOD_SPELL_HEALING_DONE = 41,
- ITEM_MOD_SPELL_DAMAGE_DONE = 42,
+ ITEM_MOD_SPELL_HEALING_DONE = 41, // deprecated
+ ITEM_MOD_SPELL_DAMAGE_DONE = 42, // deprecated
ITEM_MOD_MANA_REGENERATION = 43,
ITEM_MOD_ARMOR_PENETRATION_RATING = 44,
ITEM_MOD_SPELL_POWER = 45
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index 3204e8f0145..39ff3891077 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -2118,6 +2118,16 @@ void ObjectMgr::LoadItemPrototypes()
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;
}
+
+ 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)
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 73a5ee7c142..4bb7956aa5e 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -445,8 +445,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
for (uint8 i = 0; i < MAX_COMBAT_RATING; i++)
m_baseRatingValue[i] = 0;
- m_baseSpellDamage = 0;
- m_baseSpellHealing = 0;
+ m_baseSpellPower = 0;
m_baseFeralAP = 0;
m_baseManaRegen = 0;
@@ -6999,12 +6998,6 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl
case ITEM_MOD_FERAL_ATTACK_POWER:
ApplyFeralAPBonus(int32(val), apply);
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:
ApplyManaRegenBonus(int32(val), apply);
break;
@@ -7012,8 +7005,11 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl
ApplyRatingMod(CR_ARMOR_PENETRATION, int32(val), apply);
break;
case ITEM_MOD_SPELL_POWER:
- ApplySpellHealingBonus(int32(val), apply);
- ApplySpellDamageBonus(int32(val), apply);
+ ApplySpellPowerBonus(int32(val), apply);
+ break;
+ // depricated item mods
+ case ITEM_MOD_SPELL_HEALING_DONE:
+ case ITEM_MOD_SPELL_DAMAGE_DONE:
break;
}
}
@@ -12505,14 +12501,6 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool
((Player*)this)->ApplyFeralAPBonus(enchant_amount, apply);
sLog.outDebug("+ %u FERAL_ATTACK_POWER", enchant_amount);
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:
((Player*)this)->ApplyManaRegenBonus(enchant_amount, apply);
sLog.outDebug("+ %u MANA_REGENERATION", enchant_amount);
@@ -12522,10 +12510,11 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool
sLog.outDebug("+ %u ARMOR PENETRATION", enchant_amount);
break;
case ITEM_MOD_SPELL_POWER:
- ((Player*)this)->ApplySpellHealingBonus(enchant_amount, apply);
- ((Player*)this)->ApplySpellDamageBonus(enchant_amount, apply);
+ ((Player*)this)->ApplySpellPowerBonus(enchant_amount, apply);
sLog.outDebug("+ %u SPELL_POWER", enchant_amount);
break;
+ case ITEM_MOD_SPELL_HEALING_DONE: // deprecated
+ case ITEM_MOD_SPELL_DAMAGE_DONE: // deprecated
default:
break;
}
diff --git a/src/game/Player.h b/src/game/Player.h
index 75b6e25c1c3..9693312e3df 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -1664,8 +1664,7 @@ class MANGOS_DLL_SPEC Player : public Unit
void UpdateAttackPowerAndDamage(bool ranged = false);
void UpdateShieldBlockValue();
void UpdateDamagePhysical(WeaponAttackType attType);
- void ApplySpellDamageBonus(int32 amount, bool apply);
- void ApplySpellHealingBonus(int32 amount, bool apply);
+ void ApplySpellPowerBonus(int32 amount, bool apply);
void UpdateSpellDamageAndHealingBonus();
void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, float& min_damage, float& max_damage);
@@ -1684,8 +1683,7 @@ class MANGOS_DLL_SPEC Player : public Unit
uint32 GetRangedCritDamageReduction(uint32 damage) const;
uint32 GetSpellCritDamageReduction(uint32 damage) const;
uint32 GetDotDamageReduction(uint32 damage) const;
- uint32 GetBaseSpellDamageBonus() { return m_baseSpellDamage;}
- uint32 GetBaseSpellHealingBonus() { return m_baseSpellHealing;}
+ uint32 GetBaseSpellPowerBonus() { return m_baseSpellPower; }
float GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const;
void UpdateBlockPercentage();
@@ -2351,8 +2349,7 @@ Spell * m_spellModTakingSpell;
float m_auraBaseMod[BASEMOD_END][MOD_END];
int16 m_baseRatingValue[MAX_COMBAT_RATING];
- uint16 m_baseSpellDamage;
- uint16 m_baseSpellHealing;
+ uint16 m_baseSpellPower;
uint16 m_baseFeralAP;
uint16 m_baseManaRegen;
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 1b7b5065af2..c60b6d77aed 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -1153,8 +1153,6 @@ void SpellMgr::LoadSpellTargetPositions()
bar.step();
- ++count;
-
uint32 Spell_ID = fields[0].GetUInt32();
SpellTargetPosition st;
@@ -1201,6 +1199,7 @@ void SpellMgr::LoadSpellTargetPositions()
}
mSpellTargetPositions[Spell_ID] = st;
+ ++count;
} while( result->NextRow() );
diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp
index 2b147c5150a..d991a96ebe6 100644
--- a/src/game/StatSystem.cpp
+++ b/src/game/StatSystem.cpp
@@ -110,19 +110,14 @@ bool Player::UpdateStats(Stats stat)
return true;
}
-void Player::ApplySpellDamageBonus(int32 amount, bool apply)
+void Player::ApplySpellPowerBonus(int32 amount, bool apply)
{
- m_baseSpellDamage+=apply?amount:-amount;
- // For speed just update for client
- for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; i++)
- ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+i, amount, apply);
-}
+ m_baseSpellPower+=apply?amount:-amount;
-void Player::ApplySpellHealingBonus(int32 amount, bool apply)
-{
- m_baseSpellHealing+=apply?amount:-amount;
// For speed just update for client
ApplyModUInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS, amount, apply);
+ for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
+ ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+i, amount, apply);;
}
void Player::UpdateSpellDamageAndHealingBonus()
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 07188a9d9aa..8e00fb6ac16 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -9411,7 +9411,7 @@ int32 Unit::SpellBaseDamageBonus(SpellSchoolMask schoolMask)
if (GetTypeId() == TYPEID_PLAYER)
{
// Base value
- DoneAdvertisedBenefit +=((Player*)this)->GetBaseSpellDamageBonus();
+ DoneAdvertisedBenefit +=((Player*)this)->GetBaseSpellPowerBonus();
// Damage bonus from stats
AuraEffectList const& mDamageDoneOfStatPercent = GetAurasByType(SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT);
@@ -9964,7 +9964,7 @@ int32 Unit::SpellBaseHealingBonus(SpellSchoolMask schoolMask)
if (GetTypeId() == TYPEID_PLAYER)
{
// Base value
- AdvertisedBenefit +=((Player*)this)->GetBaseSpellHealingBonus();
+ AdvertisedBenefit +=((Player*)this)->GetBaseSpellPowerBonus();
// Healing bonus from stats
AuraEffectList const& mHealingDoneOfStatPercent = GetAurasByType(SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT);