aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2016-04-25 22:03:34 +0200
committerShauren <shauren.trinity@gmail.com>2016-05-20 23:49:53 +0200
commit70102f32fe38ae7d49acbd5ddee0239602d3cb94 (patch)
tree22dcecc33942c7f60e2edb5402f6f7feaf559ece /src/server/game/Entities
parent885d9b53c38662e00e3b4977b82e9cf36d197f94 (diff)
Core/DataStores: Updated opcodes and db2 to 7.0.3.21414
Diffstat (limited to 'src/server/game/Entities')
-rw-r--r--src/server/game/Entities/Item/Item.cpp5
-rw-r--r--src/server/game/Entities/Item/ItemEnchantmentMgr.cpp1
-rw-r--r--src/server/game/Entities/Item/ItemTemplate.cpp1
-rw-r--r--src/server/game/Entities/Item/ItemTemplate.h3
-rw-r--r--src/server/game/Entities/Player/Player.cpp324
-rw-r--r--src/server/game/Entities/Player/Player.h4
-rw-r--r--src/server/game/Entities/Taxi/TaxiPathGraph.cpp1
-rw-r--r--src/server/game/Entities/Transport/Transport.cpp1
-rw-r--r--src/server/game/Entities/Unit/StatSystem.cpp13
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp27
-rw-r--r--src/server/game/Entities/Unit/Unit.h25
11 files changed, 208 insertions, 197 deletions
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index 3eba4d58d80..84138cf0b45 100644
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -31,6 +31,7 @@
#include "WorldSession.h"
#include "ItemPackets.h"
#include "TradeData.h"
+#include "GameTables.h"
void AddItemsSetItem(Player* player, Item* item)
{
@@ -1856,8 +1857,8 @@ int32 Item::GetItemStatValue(uint32 index, Player const* owner) const
if (uint32 randomPropPoints = GetRandomPropertyPoints(itemLevel, GetQuality(), GetTemplate()->GetInventoryType(), GetTemplate()->GetSubClass()))
{
float statValue = float(_bonusData.ItemStatAllocation[index] * randomPropPoints) * 0.0001f;
- if (GtItemSocketCostPerLevelEntry const* gtCost = sGtItemSocketCostPerLevelStore.EvaluateTable(itemLevel - 1, 0))
- statValue -= float(int32(_bonusData.ItemStatSocketCostMultiplier[index] * gtCost->ratio));
+ if (GtItemSocketCostPerLevelEntry const* gtCost = sItemSocketCostPerLevelGameTable.GetRow(itemLevel))
+ statValue -= float(int32(_bonusData.ItemStatSocketCostMultiplier[index] * gtCost->SocketCost));
return int32(std::floor(statValue + 0.5f));
}
diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp
index 2f82071f66f..a36a4a4c246 100644
--- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp
+++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp
@@ -21,7 +21,6 @@
#include "Log.h"
#include "ObjectMgr.h"
#include "Util.h"
-#include "DBCStores.h"
#include <list>
#include <vector>
diff --git a/src/server/game/Entities/Item/ItemTemplate.cpp b/src/server/game/Entities/Item/ItemTemplate.cpp
index 04873bdddcf..67f683849a9 100644
--- a/src/server/game/Entities/Item/ItemTemplate.cpp
+++ b/src/server/game/Entities/Item/ItemTemplate.cpp
@@ -16,7 +16,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "DBCStores.h"
#include "DB2Stores.h"
#include "World.h"
#include "ItemTemplate.h"
diff --git a/src/server/game/Entities/Item/ItemTemplate.h b/src/server/game/Entities/Item/ItemTemplate.h
index 38265cc9fed..5fa6b5583af 100644
--- a/src/server/game/Entities/Item/ItemTemplate.h
+++ b/src/server/game/Entities/Item/ItemTemplate.h
@@ -660,11 +660,10 @@ class Player;
struct TC_GAME_API ItemTemplate
{
- uint32 Id;
ItemEntry const* BasicData;
ItemSparseEntry const* ExtendedData;
- uint32 GetId() const { return Id; }
+ uint32 GetId() const { return BasicData->ID; }
uint32 GetClass() const { return BasicData->Class; }
uint32 GetSubClass() const { return BasicData->SubClass; }
uint32 GetQuality() const { return ExtendedData->Quality; }
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 303ef5d4c5d..2809cf121d1 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -101,7 +101,6 @@
#include "WorldPacket.h"
#include "WorldSession.h"
#include "WorldStatePackets.h"
-#include "DBCStructure.h"
#define ZONE_UPDATE_INTERVAL (1*IN_MILLISECONDS)
@@ -2402,12 +2401,12 @@ void Player::GiveLevel(uint8 level)
PlayerLevelInfo info;
sObjectMgr->GetPlayerLevelInfo(getRace(), getClass(), level, &info);
- uint32 basehp = 0, basemana = 0;
- sObjectMgr->GetPlayerClassLevelInfo(getClass(), level, basehp, basemana);
+ uint32 basemana = 0;
+ sObjectMgr->GetPlayerClassLevelInfo(getClass(), level, basemana);
WorldPackets::Misc::LevelUpInfo packet;
packet.Level = level;
- packet.HealthDelta = int32(basehp) - int32(GetCreateHealth());
+ packet.HealthDelta = 0;
/// @todo find some better solution
// for (int i = 0; i < MAX_STORED_POWERS; ++i)
@@ -2444,7 +2443,7 @@ void Player::GiveLevel(uint8 level)
for (uint8 i = STAT_STRENGTH; i < MAX_STATS; ++i)
SetCreateStat(Stats(i), info.stats[i]);
- SetCreateHealth(basehp);
+ SetCreateHealth(0);
SetCreateMana(basemana);
InitTalentForLevel();
@@ -2522,7 +2521,7 @@ void Player::InitTalentForLevel()
if (!GetSession()->HasPermission(rbac::RBAC_PERM_SKIP_CHECK_MORE_TALENTS_THAN_ALLOWED))
for (uint32 t = talentTiers; t < MAX_TALENT_TIERS; ++t)
for (uint32 c = 0; c < MAX_TALENT_COLUMNS; ++c)
- for (TalentEntry const* talent : sTalentByPos[getClass()][t][c])
+ for (TalentEntry const* talent : sDB2Manager.GetTalentsByPosition(getClass(), t, c))
RemoveTalent(talent);
}
@@ -2537,8 +2536,8 @@ void Player::InitStatsForLevel(bool reapplyMods)
if (reapplyMods) //reapply stats values only on .reset stats (level) command
_RemoveAllStatBonuses();
- uint32 basehp = 0, basemana = 0;
- sObjectMgr->GetPlayerClassLevelInfo(getClass(), getLevel(), basehp, basemana);
+ uint32 basemana = 0;
+ sObjectMgr->GetPlayerClassLevelInfo(getClass(), getLevel(), basemana);
PlayerLevelInfo info;
sObjectMgr->GetPlayerLevelInfo(getRace(), getClass(), getLevel(), &info);
@@ -2568,7 +2567,7 @@ void Player::InitStatsForLevel(bool reapplyMods)
for (uint8 i = STAT_STRENGTH; i < MAX_STATS; ++i)
SetStat(Stats(i), info.stats[i]);
- SetCreateHealth(basehp);
+ SetCreateHealth(0);
//set create powers
SetCreateMana(basemana);
@@ -2662,7 +2661,7 @@ void Player::InitStatsForLevel(bool reapplyMods)
for (uint8 i = POWER_MANA; i < MAX_POWERS; ++i)
SetMaxPower(Powers(i), GetCreatePowers(Powers(i)));
- SetMaxHealth(basehp); // stamina bonus will applied later
+ SetMaxHealth(0); // stamina bonus will applied later
// cleanup mounted state (it will set correctly at aura loading if player saved at mount.
SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0);
@@ -4831,111 +4830,151 @@ float Player::GetTotalBaseModValue(BaseModGroup modGroup) const
return m_auraBaseMod[modGroup][FLAT_MOD] * m_auraBaseMod[modGroup][PCT_MOD];
}
-float Player::GetMeleeCritFromAgility() const
-{
- uint8 level = getLevel();
- uint32 pclass = getClass();
-
- if (level >= sGtChanceToMeleeCritStore.GetTableRowCount())
- level = sGtChanceToMeleeCritStore.GetTableRowCount() - 1;
-
- GtChanceToMeleeCritBaseEntry const* critBase = sGtChanceToMeleeCritBaseStore.EvaluateTable(pclass - 1, 0);
- GtChanceToMeleeCritEntry const* critRatio = sGtChanceToMeleeCritStore.EvaluateTable(level - 1, pclass - 1);
- if (critBase == nullptr || critRatio == nullptr)
- return 0.0f;
-
- float crit = critBase->base + GetStat(STAT_AGILITY)*critRatio->ratio;
- return crit*100.0f;
-}
-
void Player::GetDodgeFromAgility(float &diminishing, float &nondiminishing) const
{
- // Table for base dodge values
- const float dodge_base[MAX_CLASSES] =
- {
- 0.037580f, // Warrior
- 0.036520f, // Paladin
- -0.054500f, // Hunter
- -0.005900f, // Rogue
- 0.031830f, // Priest
- 0.036640f, // DK
- 0.016750f, // Shaman
- 0.034575f, // Mage
- 0.020350f, // Warlock
- 0.0f, // ??
- 0.049510f // Druid
- };
- // Crit/agility to dodge/agility coefficient multipliers; 3.2.0 increased required agility by 15%
- const float crit_to_dodge[MAX_CLASSES] =
- {
- 0.85f/1.15f, // Warrior
- 1.00f/1.15f, // Paladin
- 1.11f/1.15f, // Hunter
- 2.00f/1.15f, // Rogue
- 1.00f/1.15f, // Priest
- 0.85f/1.15f, // DK
- 1.60f/1.15f, // Shaman
- 1.00f/1.15f, // Mage
- 0.97f/1.15f, // Warlock (?)
- 0.0f, // ??
- 2.00f/1.15f // Druid
- };
+ //// Table for base dodge values
+ //const float dodge_base[MAX_CLASSES] =
+ //{
+ // 0.037580f, // Warrior
+ // 0.036520f, // Paladin
+ // -0.054500f, // Hunter
+ // -0.005900f, // Rogue
+ // 0.031830f, // Priest
+ // 0.036640f, // DK
+ // 0.016750f, // Shaman
+ // 0.034575f, // Mage
+ // 0.020350f, // Warlock
+ // 0.0f, // ??
+ // 0.049510f // Druid
+ //};
+ //// Crit/agility to dodge/agility coefficient multipliers; 3.2.0 increased required agility by 15%
+ //const float crit_to_dodge[MAX_CLASSES] =
+ //{
+ // 0.85f/1.15f, // Warrior
+ // 1.00f/1.15f, // Paladin
+ // 1.11f/1.15f, // Hunter
+ // 2.00f/1.15f, // Rogue
+ // 1.00f/1.15f, // Priest
+ // 0.85f/1.15f, // DK
+ // 1.60f/1.15f, // Shaman
+ // 1.00f/1.15f, // Mage
+ // 0.97f/1.15f, // Warlock (?)
+ // 0.0f, // ??
+ // 2.00f/1.15f // Druid
+ //};
- uint8 level = getLevel();
- uint32 pclass = getClass();
+ //uint8 level = getLevel();
+ //uint32 pclass = getClass();
- if (level >= sGtChanceToMeleeCritStore.GetTableRowCount())
- level = sGtChanceToMeleeCritStore.GetTableRowCount() - 1;
+ //if (level >= sGtChanceToMeleeCritStore.GetTableRowCount())
+ // level = sGtChanceToMeleeCritStore.GetTableRowCount() - 1;
- // Dodge per agility is proportional to crit per agility, which is available from DBC files
- GtChanceToMeleeCritEntry const* dodgeRatio = sGtChanceToMeleeCritStore.EvaluateTable(level - 1, pclass - 1);
- if (dodgeRatio == nullptr || pclass > MAX_CLASSES)
- return;
+ //// Dodge per agility is proportional to crit per agility, which is available from DBC files
+ //GtChanceToMeleeCritEntry const* dodgeRatio = sGtChanceToMeleeCritStore.EvaluateTable(level - 1, pclass - 1);
+ //if (dodgeRatio == nullptr || pclass > MAX_CLASSES)
+ // return;
- /// @todo research if talents/effects that increase total agility by x% should increase non-diminishing part
- float base_agility = GetCreateStat(STAT_AGILITY) * m_auraModifiersGroup[UNIT_MOD_STAT_START + STAT_AGILITY][BASE_PCT];
- float bonus_agility = GetStat(STAT_AGILITY) - base_agility;
+ ///// @todo research if talents/effects that increase total agility by x% should increase non-diminishing part
+ //float base_agility = GetCreateStat(STAT_AGILITY) * m_auraModifiersGroup[UNIT_MOD_STAT_START + STAT_AGILITY][BASE_PCT];
+ //float bonus_agility = GetStat(STAT_AGILITY) - base_agility;
- // calculate diminishing (green in char screen) and non-diminishing (white) contribution
- diminishing = 100.0f * bonus_agility * dodgeRatio->ratio * crit_to_dodge[pclass-1];
- nondiminishing = 100.0f * (dodge_base[pclass-1] + base_agility * dodgeRatio->ratio * crit_to_dodge[pclass-1]);
+ //// calculate diminishing (green in char screen) and non-diminishing (white) contribution
+ //diminishing = 100.0f * bonus_agility * dodgeRatio->ratio * crit_to_dodge[pclass-1];
+ //nondiminishing = 100.0f * (dodge_base[pclass-1] + base_agility * dodgeRatio->ratio * crit_to_dodge[pclass-1]);
}
-float Player::GetSpellCritFromIntellect() const
+inline float GetGameTableColumnForCombatRating(GtCombatRatingsEntry const* row, uint32 rating)
{
- uint8 level = getLevel();
- uint32 pclass = getClass();
-
- if (level >= sGtChanceToSpellCritStore.GetTableRowCount())
- level = sGtChanceToSpellCritStore.GetTableRowCount() - 1;
-
- GtChanceToSpellCritBaseEntry const* critBase = sGtChanceToSpellCritBaseStore.EvaluateTable(pclass - 1, 0);
- GtChanceToSpellCritEntry const* critRatio = sGtChanceToSpellCritStore.EvaluateTable(level - 1, pclass - 1);
- if (critBase == nullptr || critRatio == nullptr)
- return 0.0f;
+ switch (rating)
+ {
+ case CR_AMPLIFY:
+ return row->Amplify;
+ case CR_DEFENSE_SKILL:
+ return row->DefenseSkill;
+ case CR_DODGE:
+ return row->Dodge;
+ case CR_PARRY:
+ return row->Parry;
+ case CR_BLOCK:
+ return row->Block;
+ case CR_HIT_MELEE:
+ return row->HitMelee;
+ case CR_HIT_RANGED:
+ return row->HitRanged;
+ case CR_HIT_SPELL:
+ return row->HitSpell;
+ case CR_CRIT_MELEE:
+ return row->CritMelee;
+ case CR_CRIT_RANGED:
+ return row->CritRanged;
+ case CR_CRIT_SPELL:
+ return row->CritSpell;
+ case CR_MULTISTRIKE:
+ return row->MultiStrike;
+ case CR_READINESS:
+ return row->Readiness;
+ case CR_SPEED:
+ return row->Speed;
+ case CR_RESILIENCE_CRIT_TAKEN:
+ return row->ResilienceCritTaken;
+ case CR_RESILIENCE_PLAYER_DAMAGE:
+ return row->ResiliencePlayerDamage;
+ case CR_LIFESTEAL:
+ return row->Lifesteal;
+ case CR_HASTE_MELEE:
+ return row->HasteMelee;
+ case CR_HASTE_RANGED:
+ return row->HasteRanged;
+ case CR_HASTE_SPELL:
+ return row->HasteSpell;
+ case CR_AVOIDANCE:
+ return row->Avoidance;
+ case CR_STURDINESS:
+ return row->Sturdiness;
+ case CR_UNUSED_7:
+ return row->Unused7;
+ case CR_EXPERTISE:
+ return row->Expertise;
+ case CR_ARMOR_PENETRATION:
+ return row->ArmorPenetration;
+ case CR_MASTERY:
+ return row->Mastery;
+ case CR_PVP_POWER:
+ return row->PvPPower;
+ case CR_CLEAVE:
+ return row->Cleave;
+ case CR_VERSATILITY_DAMAGE_DONE:
+ return row->VersatilityDamageDone;
+ case CR_VERSATILITY_HEALING_DONE:
+ return row->VersatilityHealingDone;
+ case CR_VERSATILITY_DAMAGE_TAKEN:
+ return row->VersatilityDamageTaken;
+ case CR_UNUSED_12:
+ return row->Unused12;
+ default:
+ break;
+ }
- float crit = critBase->base + GetStat(STAT_INTELLECT) * critRatio->ratio;
- return crit * 100.0f;
+ return 1.0f;
}
float Player::GetRatingMultiplier(CombatRating cr) const
{
- uint8 level = getLevel();
-
- if (level >= sGtCombatRatingsStore.GetTableRowCount())
- level = sGtCombatRatingsStore.GetTableRowCount() - 1;
+ GtCombatRatingsEntry const* Rating = sCombatRatingsGameTable.GetRow(getLevel());
+ if (!Rating)
+ return 1.0f;
- GtCombatRatingsEntry const* Rating = sGtCombatRatingsStore.EvaluateTable(level - 1, cr);
- if (!Rating || !Rating->ratio)
+ float value = GetGameTableColumnForCombatRating(Rating, cr);
+ if (!value)
return 1.0f; // By default use minimum coefficient (not must be called)
- return 1.0f / Rating->ratio;
+ return 1.0f / value;
}
float Player::GetRatingBonusValue(CombatRating cr) const
{
float baseResult = float(GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + cr)) * GetRatingMultiplier(cr);
- if (cr != CR_RESILIENCE_PLAYER_DAMAGE_TAKEN)
+ if (cr != CR_RESILIENCE_PLAYER_DAMAGE)
return baseResult;
return float(1.0f - pow(0.99f, baseResult)) * 100.0f;
}
@@ -4955,24 +4994,6 @@ float Player::GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const
return 0.0f;
}
-float Player::OCTRegenMPPerSpirit() const
-{
- uint8 level = getLevel();
- uint32 pclass = getClass();
-
- if (level >= sGtRegenMPPerSptStore.GetTableRowCount())
- level = sGtRegenMPPerSptStore.GetTableRowCount() - 1;
-
- GtRegenMPPerSptEntry const* moreRatio = sGtRegenMPPerSptStore.EvaluateTable(level - 1, pclass - 1);
- if (moreRatio == nullptr)
- return 0.0f;
-
- // Formula get from PaperDollFrame script
- float spirit = GetStat(STAT_SPIRIT);
- float regen = spirit * moreRatio->ratio;
- return regen;
-}
-
void Player::ApplyRatingMod(CombatRating combatRating, int32 value, bool apply)
{
float oldRating = m_baseRatingValue[combatRating];
@@ -5024,7 +5045,7 @@ void Player::UpdateRating(CombatRating cr)
switch (cr)
{
- case CR_UNUSED_1:
+ case CR_AMPLIFY:
case CR_DEFENSE_SKILL:
break;
case CR_DODGE:
@@ -5063,7 +5084,7 @@ void Player::UpdateRating(CombatRating cr)
case CR_MULTISTRIKE:
case CR_READINESS:
case CR_SPEED:
- case CR_RESILIENCE_PLAYER_DAMAGE_TAKEN:
+ case CR_RESILIENCE_PLAYER_DAMAGE:
case CR_RESILIENCE_CRIT_TAKEN:
case CR_LIFESTEAL:
break;
@@ -5072,8 +5093,8 @@ void Player::UpdateRating(CombatRating cr)
case CR_HASTE_SPELL:
break;
case CR_AVOIDANCE:
- case CR_UNUSED_2:
- case CR_WEAPON_SKILL_RANGED:
+ case CR_STURDINESS:
+ case CR_UNUSED_7:
break;
case CR_EXPERTISE:
if (affectStats)
@@ -5089,8 +5110,8 @@ void Player::UpdateRating(CombatRating cr)
case CR_MASTERY:
UpdateMastery();
break;
- case CR_UNUSED_3:
- case CR_UNUSED_4:
+ case CR_PVP_POWER:
+ case CR_CLEAVE:
case CR_VERSATILITY_DAMAGE_DONE:
case CR_VERSATILITY_DAMAGE_TAKEN:
break;
@@ -6085,7 +6106,7 @@ void Player::RewardReputation(Unit* victim, float rate)
// support for: Championing - http://www.wowwiki.com/Championing
Map const* map = GetMap();
if (map->IsNonRaidDungeon())
- if (LFGDungeonEntry const* dungeon = GetLFGDungeon(map->GetId(), map->GetDifficultyID()))
+ if (LfgDungeonsEntry const* dungeon = DB2Manager::GetLfgDungeon(map->GetId(), map->GetDifficultyID()))
if (dungeon->TargetLevel == 80)
ChampioningFaction = GetChampioningFaction();
}
@@ -7235,7 +7256,7 @@ void Player::_ApplyItemBonuses(Item* item, uint8 slot, bool apply)
// ApplyRatingMod(CR_CRIT_TAKEN_MELEE, int32(val), apply);
// break;
case ITEM_MOD_CRIT_TAKEN_RANGED_RATING:
- ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE_TAKEN, int32(val), apply);
+ ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE, int32(val), apply);
break;
// case ITEM_MOD_CRIT_TAKEN_SPELL_RATING:
// ApplyRatingMod(CR_CRIT_TAKEN_SPELL, int32(val), apply);
@@ -7270,7 +7291,7 @@ void Player::_ApplyItemBonuses(Item* item, uint8 slot, bool apply)
// ApplyRatingMod(CR_CRIT_TAKEN_SPELL, int32(val), apply);
// break;
case ITEM_MOD_RESILIENCE_RATING:
- ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE_TAKEN, int32(val), apply);
+ ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE, int32(val), apply);
break;
case ITEM_MOD_HASTE_RATING:
ApplyRatingMod(CR_HASTE_MELEE, int32(val), apply);
@@ -7723,7 +7744,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
if (!spellInfo)
{
TC_LOG_ERROR("entities.player.items", "Player::CastItemCombatSpell: Player '%s' (%s) cast unknown spell (EnchantID: %u, SpellID: %i), ignoring",
- GetName().c_str(), GetGUID().ToString().c_str(), pEnchant->ID, pEnchant->EffectSpellID[s]);
+ GetName().c_str(), GetGUID().ToString().c_str(), enchant_id, pEnchant->EffectSpellID[s]);
continue;
}
@@ -7823,7 +7844,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->EffectSpellID[s]);
if (!spellInfo)
{
- TC_LOG_ERROR("entities.player", "Player::CastItemUseSpell: Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->EffectSpellID[s]);
+ TC_LOG_ERROR("entities.player", "Player::CastItemUseSpell: Enchant %i, cast unknown spell %i", enchant_id, pEnchant->EffectSpellID[s]);
continue;
}
@@ -13011,7 +13032,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
// ApplyRatingMod(CR_CRIT_TAKEN_SPELL, enchant_amount, apply);
// break;
case ITEM_MOD_RESILIENCE_RATING:
- ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE_TAKEN, enchant_amount, apply);
+ ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE, enchant_amount, apply);
TC_LOG_DEBUG("entities.player.items", "+ %u RESILIENCE", enchant_amount);
break;
case ITEM_MOD_HASTE_RATING:
@@ -18076,7 +18097,7 @@ void Player::_LoadBoundInstances(PreparedQueryResult result)
}
else
{
- MapDifficultyEntry const* mapDiff = GetMapDifficultyData(mapId, Difficulty(difficulty));
+ MapDifficultyEntry const* mapDiff = sDB2Manager.GetMapDifficultyData(mapId, Difficulty(difficulty));
if (!mapDiff)
{
TC_LOG_ERROR("entities.player", "Player::_LoadBoundInstances: player '%s' (%s) has bind to not existed difficulty %d instance for map %u (%s)",
@@ -18114,7 +18135,7 @@ void Player::_LoadBoundInstances(PreparedQueryResult result)
InstancePlayerBind* Player::GetBoundInstance(uint32 mapid, Difficulty difficulty, bool withExpired)
{
// some instances only have one difficulty
- MapDifficultyEntry const* mapDiff = GetDownscaledMapDifficultyData(mapid, difficulty);
+ MapDifficultyEntry const* mapDiff = sDB2Manager.GetDownscaledMapDifficultyData(mapid, difficulty);
if (!mapDiff)
return nullptr;
@@ -18128,7 +18149,7 @@ InstancePlayerBind* Player::GetBoundInstance(uint32 mapid, Difficulty difficulty
InstancePlayerBind const* Player::GetBoundInstance(uint32 mapid, Difficulty difficulty) const
{
// some instances only have one difficulty
- MapDifficultyEntry const* mapDiff = GetDownscaledMapDifficultyData(mapid, difficulty);
+ MapDifficultyEntry const* mapDiff = sDB2Manager.GetDownscaledMapDifficultyData(mapid, difficulty);
if (!mapDiff)
return nullptr;
@@ -18360,14 +18381,14 @@ bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report
missingAchievement = ar->achievement;
Difficulty target_difficulty = GetDifficultyID(mapEntry);
- MapDifficultyEntry const* mapDiff = GetDownscaledMapDifficultyData(target_map, target_difficulty);
+ MapDifficultyEntry const* mapDiff = sDB2Manager.GetDownscaledMapDifficultyData(target_map, target_difficulty);
if (LevelMin || LevelMax || missingItem || missingQuest || missingAchievement)
{
if (report)
{
if (missingQuest && !ar->questFailedText.empty())
ChatHandler(GetSession()).PSendSysMessage("%s", ar->questFailedText.c_str());
- else if (mapDiff->HasMessage()) // if (missingAchievement) covered by this case
+ else if (mapDiff->Message_lang->Str[sWorld->GetDefaultDbcLocale()][0] != '\0') // if (missingAchievement) covered by this case
SendTransferAborted(target_map, TRANSFER_ABORT_DIFFICULTY, target_difficulty);
else if (missingItem)
GetSession()->SendNotification(GetSession()->GetTrinityString(LANG_LEVEL_MINREQUIRED_AND_ITEM), LevelMin, ASSERT_NOTNULL(sObjectMgr->GetItemTemplate(missingItem))->GetName(GetSession()->GetSessionDbcLocale()));
@@ -19608,7 +19629,7 @@ void Player::_SaveStats(SQLTransaction& trans) const
stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_ATTACK_POWER));
stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER));
stmt->setUInt32(index++, GetBaseSpellPowerBonus());
- stmt->setUInt32(index, GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_RESILIENCE_PLAYER_DAMAGE_TAKEN));
+ stmt->setUInt32(index, GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_RESILIENCE_PLAYER_DAMAGE));
trans->Append(stmt);
}
@@ -23789,7 +23810,7 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z)
if (uint32 liqEntry = liquid_status.entry)
{
LiquidTypeEntry const* liquid = sLiquidTypeStore.LookupEntry(liqEntry);
- if (_lastLiquid && _lastLiquid->SpellID && _lastLiquid->ID != liqEntry)
+ if (_lastLiquid && _lastLiquid->SpellID && _lastLiquid != liquid)
RemoveAurasDueToSpell(_lastLiquid->SpellID);
if (liquid && liquid->SpellID)
@@ -23940,7 +23961,7 @@ bool Player::CanUseBattlegroundObject(GameObject* gameobject) const
FactionTemplateEntry const* playerFaction = GetFactionTemplateEntry();
FactionTemplateEntry const* faction = sFactionTemplateStore.LookupEntry(gameobject->GetUInt32Value(GAMEOBJECT_FACTION));
- if (playerFaction && faction && !playerFaction->IsFriendlyTo(*faction))
+ if (playerFaction && faction && !playerFaction->IsFriendlyTo(faction))
return false;
}
@@ -23960,11 +23981,6 @@ bool Player::CanCaptureTowerPoint() const
uint32 Player::GetBarberShopCost(BarberShopStyleEntry const* newHairStyle, uint8 newHairColor, BarberShopStyleEntry const* newFacialHair, BarberShopStyleEntry const* newSkin /*= nullptr*/, BarberShopStyleEntry const* newFace /*= nullptr*/) const
{
- uint8 level = getLevel();
-
- if (level >= sGtBarberShopCostBaseStore.GetTableRowCount())
- level = sGtBarberShopCostBaseStore.GetTableRowCount() - 1;
-
uint8 hairstyle = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID);
uint8 haircolor = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID);
uint8 facialhair = GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE);
@@ -23974,26 +23990,26 @@ uint32 Player::GetBarberShopCost(BarberShopStyleEntry const* newHairStyle, uint8
if ((hairstyle == newHairStyle->Data) && (haircolor == newHairColor) && (facialhair == newFacialHair->Data) && (!newSkin || (newSkin->Data == skincolor)) && (!newFace || (newFace->Data == face)))
return 0;
- GtBarberShopCostBaseEntry const* bsc = sGtBarberShopCostBaseStore.EvaluateTable(level - 1, 0);
+ GtBarberShopCostBaseEntry const* bsc = sBarberShopCostBaseGameTable.GetRow(getLevel());
if (!bsc) // shouldn't happen
return 0xFFFFFFFF;
uint32 cost = 0;
if (hairstyle != newHairStyle->Data)
- cost += uint32(bsc->cost * newHairStyle->CostModifier);
+ cost += uint32(bsc->Cost * newHairStyle->CostModifier);
if ((haircolor != newHairColor) && (hairstyle == newHairStyle->Data))
- cost += uint32(bsc->cost * 0.5f); // +1/2 of price
+ cost += uint32(bsc->Cost * 0.5f); // +1/2 of price
if (facialhair != newFacialHair->Data)
- cost += uint32(bsc->cost * newFacialHair->CostModifier);
+ cost += uint32(bsc->Cost * newFacialHair->CostModifier);
if (newSkin && skincolor != newSkin->Data)
- cost += uint32(bsc->cost * newSkin->CostModifier);
+ cost += uint32(bsc->Cost * newSkin->CostModifier);
if (newFace && face != newFace->Data)
- cost += uint32(bsc->cost * newFace->CostModifier);
+ cost += uint32(bsc->Cost * newFace->CostModifier);
return cost;
}
@@ -24302,7 +24318,7 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot)
bool Player::CanFlyInZone(uint32 mapid, uint32 zone) const
{
// continent checked in SpellInfo::CheckLocation at cast and area update
- uint32 v_map = GetVirtualMapForMapAndZone(mapid, zone);
+ uint32 v_map = sDB2Manager.GetVirtualMapForMapAndZone(mapid, zone);
return v_map != 571 || HasSpell(54197); // 54197 = Cold Weather Flying
}
@@ -24632,7 +24648,7 @@ bool Player::LearnTalent(uint32 talentId)
// but only 2 out of 3 have SpecID != 0
// We need to make sure that if player is in one of these defined specs he will not learn the other choice
TalentEntry const* bestSlotMatch = nullptr;
- for (TalentEntry const* talent : sTalentByPos[getClass()][talentInfo->TierID][talentInfo->ColumnIndex])
+ for (TalentEntry const* talent : sDB2Manager.GetTalentsByPosition(getClass(), talentInfo->TierID, talentInfo->ColumnIndex))
{
if (!talent->SpecID)
bestSlotMatch = talent;
@@ -24648,7 +24664,7 @@ bool Player::LearnTalent(uint32 talentId)
// Check if player doesn't have any talent in current tier
for (uint32 c = 0; c < MAX_TALENT_COLUMNS; ++c)
- for (TalentEntry const* talent : sTalentByPos[getClass()][talentInfo->TierID][c])
+ for (TalentEntry const* talent : sDB2Manager.GetTalentsByPosition(getClass(), talentInfo->TierID, c))
if (HasTalent(talent->ID, GetActiveTalentGroup()))
return false;
@@ -24686,8 +24702,8 @@ void Player::LearnTalentSpecialization(uint32 talentSpec)
uint32 class_ = getClass();
for (uint32 t = 0; t < MAX_TALENT_TIERS; ++t)
for (uint32 c = 0; c < MAX_TALENT_COLUMNS; ++c)
- if (sTalentByPos[class_][t][c].size() > 1)
- for (TalentEntry const* talent : sTalentByPos[class_][t][c])
+ if (sDB2Manager.GetTalentsByPosition(class_, t, c).size() > 1)
+ for (TalentEntry const* talent : sDB2Manager.GetTalentsByPosition(class_, t, c))
RemoveTalent(talent);
LearnSpecializationSpells();
@@ -24707,8 +24723,8 @@ void Player::ResetTalentSpecialization()
uint32 class_ = getClass();
for (uint32 t = 0; t < MAX_TALENT_TIERS; ++t)
for (uint32 c = 0; c < MAX_TALENT_COLUMNS; ++c)
- if (sTalentByPos[class_][t][c].size() > 1)
- for (TalentEntry const* talent : sTalentByPos[class_][t][c])
+ if (sDB2Manager.GetTalentsByPosition(class_, t, c).size() > 1)
+ for (TalentEntry const* talent : sDB2Manager.GetTalentsByPosition(class_, t, c))
RemoveTalent(talent);
RemoveSpecializationSpells();
@@ -26042,7 +26058,7 @@ Difficulty Player::GetDifficultyID(MapEntry const* mapEntry) const
if (!mapEntry->IsRaid())
return m_dungeonDifficulty;
- MapDifficultyEntry const* defaultDifficulty = GetDefaultMapDifficulty(mapEntry->ID);
+ MapDifficultyEntry const* defaultDifficulty = sDB2Manager.GetDefaultMapDifficulty(mapEntry->ID);
if (!defaultDifficulty)
return m_legacyRaidDifficulty;
@@ -26191,9 +26207,9 @@ bool Player::ValidateAppearance(uint8 race, uint8 class_, uint8 gender, uint8 ha
{
// Check skin color
// For Skin type is always 0
- if (CharSectionsEntry const* entry = GetCharSectionEntry(race, SECTION_TYPE_SKIN, gender, 0, skinColor))
+ if (CharSectionsEntry const* entry = sDB2Manager.GetCharSectionEntry(race, SECTION_TYPE_SKIN, gender, 0, skinColor))
{ // Skin Color defined as Face color, too, we check skin & face in one pass
- if (CharSectionsEntry const* entry2 = GetCharSectionEntry(race, SECTION_TYPE_FACE, gender, faceID, skinColor))
+ if (CharSectionsEntry const* entry2 = sDB2Manager.GetCharSectionEntry(race, SECTION_TYPE_FACE, gender, faceID, skinColor))
{
if (!IsSectionFlagValid(entry, class_, create))
return false;
@@ -26210,14 +26226,14 @@ bool Player::ValidateAppearance(uint8 race, uint8 class_, uint8 gender, uint8 ha
bool excludeCheck = (race == RACE_TAUREN) || (race == RACE_DRAENEI) || (gender == GENDER_FEMALE && race != RACE_NIGHTELF && race != RACE_UNDEAD_PLAYER);
// Check Hair
- if (CharSectionsEntry const* entry = GetCharSectionEntry(race, SECTION_TYPE_HAIR, gender, hairID, hairColor))
+ if (CharSectionsEntry const* entry = sDB2Manager.GetCharSectionEntry(race, SECTION_TYPE_HAIR, gender, hairID, hairColor))
{
if (!IsSectionFlagValid(entry, class_, create))
return false;
if (!excludeCheck)
{
- if (CharSectionsEntry const* entry2 = GetCharSectionEntry(race, SECTION_TYPE_FACIAL_HAIR, gender, facialHair, hairColor))
+ if (CharSectionsEntry const* entry2 = sDB2Manager.GetCharSectionEntry(race, SECTION_TYPE_FACIAL_HAIR, gender, facialHair, hairColor))
{
if (!IsSectionFlagValid(entry2, class_, create))
return false;
@@ -26235,7 +26251,7 @@ bool Player::ValidateAppearance(uint8 race, uint8 class_, uint8 gender, uint8 ha
return false;
for (uint32 i = 0; i < PLAYER_CUSTOM_DISPLAY_SIZE; ++i)
- if (CharSectionsEntry const* entry = GetCharSectionEntry(race, CharSectionType(SECTION_TYPE_CUSTOM_DISPLAY_1 + i * 2), gender, customDisplay[i], 0))
+ if (CharSectionsEntry const* entry = sDB2Manager.GetCharSectionEntry(race, CharSectionType(SECTION_TYPE_CUSTOM_DISPLAY_1 + i * 2), gender, customDisplay[i], 0))
if (!IsSectionFlagValid(entry, class_, create))
return false;
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index b538bbbe05c..e943672c4f0 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -19,7 +19,6 @@
#ifndef _PLAYER_H
#define _PLAYER_H
-#include "DBCStores.h"
#include "DB2Stores.h"
#include "GroupReference.h"
#include "MapReference.h"
@@ -1940,10 +1939,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& minDamage, float& maxDamage) override;
void RecalculateRating(CombatRating cr) { ApplyRatingMod(cr, 0, true);}
- float GetMeleeCritFromAgility() const;
void GetDodgeFromAgility(float &diminishing, float &nondiminishing) const;
- float GetSpellCritFromIntellect() const;
- float OCTRegenMPPerSpirit() const;
float GetRatingMultiplier(CombatRating cr) const;
float GetRatingBonusValue(CombatRating cr) const;
diff --git a/src/server/game/Entities/Taxi/TaxiPathGraph.cpp b/src/server/game/Entities/Taxi/TaxiPathGraph.cpp
index 22af722d592..709a5debf4d 100644
--- a/src/server/game/Entities/Taxi/TaxiPathGraph.cpp
+++ b/src/server/game/Entities/Taxi/TaxiPathGraph.cpp
@@ -18,7 +18,6 @@
#include "TaxiPathGraph.h"
#include "ObjectMgr.h"
#include "Player.h"
-#include "DBCStores.h"
#include "DB2Stores.h"
#include "Config.h"
#include "Util.h"
diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp
index d2a8a31817d..58a9b68e0e5 100644
--- a/src/server/game/Entities/Transport/Transport.cpp
+++ b/src/server/game/Entities/Transport/Transport.cpp
@@ -21,7 +21,6 @@
#include "MapManager.h"
#include "ObjectMgr.h"
#include "ScriptMgr.h"
-#include "DBCStores.h"
#include "GameObjectAI.h"
#include "Vehicle.h"
#include "Player.h"
diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp
index da04c39c289..ed6b9ec3696 100644
--- a/src/server/game/Entities/Unit/StatSystem.cpp
+++ b/src/server/game/Entities/Unit/StatSystem.cpp
@@ -20,6 +20,7 @@
#include "Player.h"
#include "Pet.h"
#include "Creature.h"
+#include "GameTables.h"
#include "SharedDefines.h"
#include "SpellAuras.h"
#include "SpellAuraEffects.h"
@@ -265,8 +266,8 @@ float Player::GetHealthBonusFromStamina()
{
// Taken from PaperDollFrame.lua - 6.0.3.19085
float ratio = 10.0f;
- if (GtOCTHpPerStaminaEntry const* hpBase = sGtOCTHpPerStaminaStore.EvaluateTable(getLevel() - 1, 0))
- ratio = hpBase->ratio;
+ if (GtHpPerStaEntry const* hpBase = sHpPerStaGameTable.GetRow(getLevel()))
+ ratio = hpBase->Health;
float stamina = GetStat(STAT_STAMINA);
@@ -512,7 +513,7 @@ void Player::UpdateCritPercentage(WeaponAttackType attType)
void Player::UpdateAllCritPercentages()
{
- float value = GetMeleeCritFromAgility();
+ float value = 5.0f;
SetBaseModValue(CRIT_PERCENTAGE, PCT_MOD, value);
SetBaseModValue(OFFHAND_CRIT_PERCENTAGE, PCT_MOD, value);
@@ -654,9 +655,7 @@ void Player::UpdateSpellCritChance(uint32 school)
return;
}
// For others recalculate it from:
- float crit = 0.0f;
- // Crit from Intellect
- crit += GetSpellCritFromIntellect();
+ float crit = 5.0f;
// Increase crit from SPELL_AURA_MOD_SPELL_CRIT_CHANCE
crit += GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_CRIT_CHANCE);
// Increase crit from SPELL_AURA_MOD_CRIT_PCT
@@ -754,7 +753,7 @@ void Player::UpdateManaRegen()
return;
// Mana regen from spirit
- float spirit_regen = OCTRegenMPPerSpirit();
+ float spirit_regen = 0.0f;
// Apply PCT bonus from SPELL_AURA_MOD_POWER_REGEN_PERCENT aura on spirit base regen
spirit_regen *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_POWER_REGEN_PERCENT, POWER_MANA);
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 2bf8d161798..964572e5f02 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -1430,7 +1430,7 @@ void Unit::HandleEmoteCommand(uint32 anim_id)
SendMessageToSet(packet.Write(), true);
}
-bool Unit::IsDamageReducedByArmor(SpellSchoolMask schoolMask, SpellInfo const* spellInfo, uint8 effIndex)
+bool Unit::IsDamageReducedByArmor(SpellSchoolMask schoolMask, SpellInfo const* spellInfo /*= nullptr*/, int8 effIndex /*= -1*/)
{
// only physical spells damage gets reduced by armor
if ((schoolMask & SPELL_SCHOOL_MASK_NORMAL) == 0)
@@ -1441,13 +1441,16 @@ bool Unit::IsDamageReducedByArmor(SpellSchoolMask schoolMask, SpellInfo const* s
if (spellInfo->HasAttribute(SPELL_ATTR0_CU_IGNORE_ARMOR))
return false;
- // bleeding effects are not reduced by armor
- if (SpellEffectInfo const* effect = spellInfo->GetEffect(GetMap()->GetDifficultyID(), effIndex))
+ if (effIndex != -1)
{
- if (effect->ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE ||
- effect->Effect == SPELL_EFFECT_SCHOOL_DAMAGE)
- if (spellInfo->GetEffectMechanicMask(effIndex) & (1<<MECHANIC_BLEED))
- return false;
+ // bleeding effects are not reduced by armor
+ if (SpellEffectInfo const* effect = spellInfo->GetEffect(GetMap()->GetDifficultyID(), effIndex))
+ {
+ if (effect->ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE ||
+ effect->Effect == SPELL_EFFECT_SCHOOL_DAMAGE)
+ if (spellInfo->GetEffectMechanicMask(effIndex) & (1 << MECHANIC_BLEED))
+ return false;
+ }
}
}
return true;
@@ -6733,11 +6736,11 @@ ReputationRank Unit::GetFactionReactionTo(FactionTemplateEntry const* factionTem
}
// common faction based check
- if (factionTemplateEntry->IsHostileTo(*targetFactionTemplateEntry))
+ if (factionTemplateEntry->IsHostileTo(targetFactionTemplateEntry))
return REP_HOSTILE;
- if (factionTemplateEntry->IsFriendlyTo(*targetFactionTemplateEntry))
+ if (factionTemplateEntry->IsFriendlyTo(targetFactionTemplateEntry))
return REP_FRIENDLY;
- if (targetFactionTemplateEntry->IsFriendlyTo(*factionTemplateEntry))
+ if (targetFactionTemplateEntry->IsFriendlyTo(factionTemplateEntry))
return REP_FRIENDLY;
if (factionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_HOSTILE_BY_DEFAULT)
return REP_HOSTILE;
@@ -8952,7 +8955,7 @@ uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackT
{
if (Player* player = ToPlayer())
{
- float mod = player->GetRatingBonusValue(CR_RESILIENCE_PLAYER_DAMAGE_TAKEN) * (-8.0f);
+ float mod = player->GetRatingBonusValue(CR_RESILIENCE_PLAYER_DAMAGE) * (-8.0f);
AddPct(TakenTotalMod, std::max(mod, float((*i)->GetAmount())));
}
}
@@ -15739,7 +15742,7 @@ void Unit::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target)
{
FactionTemplateEntry const* ft1 = GetFactionTemplateEntry();
FactionTemplateEntry const* ft2 = target->GetFactionTemplateEntry();
- if (ft1 && ft2 && !ft1->IsFriendlyTo(*ft2))
+ if (ft1 && ft2 && !ft1->IsFriendlyTo(ft2))
{
if (index == UNIT_FIELD_BYTES_2)
// Allow targetting opposite faction in party when enabled in config
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 5ba84c271be..68b27049f71 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -19,7 +19,6 @@
#ifndef __UNIT_H
#define __UNIT_H
-#include "DBCStructure.h"
#include "EventProcessor.h"
#include "FollowerReference.h"
#include "FollowerRefManager.h"
@@ -381,6 +380,7 @@ enum InventorySlot
};
struct FactionTemplateEntry;
+struct LiquidTypeEntry;
struct MountCapabilityEntry;
struct SpellValue;
@@ -623,8 +623,8 @@ enum WeaponAttackType : uint8
enum CombatRating
{
- CR_UNUSED_1 = 0,
- CR_DEFENSE_SKILL = 1, // Removed in 4.0.1
+ CR_AMPLIFY = 0,
+ CR_DEFENSE_SKILL = 1,
CR_DODGE = 2,
CR_PARRY = 3,
CR_BLOCK = 4,
@@ -638,22 +638,23 @@ enum CombatRating
CR_READINESS = 12,
CR_SPEED = 13,
CR_RESILIENCE_CRIT_TAKEN = 14,
- CR_RESILIENCE_PLAYER_DAMAGE_TAKEN = 15,
+ CR_RESILIENCE_PLAYER_DAMAGE = 15,
CR_LIFESTEAL = 16,
CR_HASTE_MELEE = 17,
CR_HASTE_RANGED = 18,
CR_HASTE_SPELL = 19,
CR_AVOIDANCE = 20,
- CR_UNUSED_2 = 21,
- CR_WEAPON_SKILL_RANGED = 22,
+ CR_STURDINESS = 21,
+ CR_UNUSED_7 = 22,
CR_EXPERTISE = 23,
CR_ARMOR_PENETRATION = 24,
CR_MASTERY = 25,
- CR_UNUSED_3 = 26,
- CR_UNUSED_4 = 27,
+ CR_PVP_POWER = 26,
+ CR_CLEAVE = 27,
CR_VERSATILITY_DAMAGE_DONE = 28,
- // placeholder = 29,
- CR_VERSATILITY_DAMAGE_TAKEN = 30
+ CR_VERSATILITY_HEALING_DONE = 29,
+ CR_VERSATILITY_DAMAGE_TAKEN = 30,
+ CR_UNUSED_12 = 31
};
#define MAX_COMBAT_RATING 31
@@ -1539,7 +1540,7 @@ class TC_GAME_API Unit : public WorldObject
void DealSpellDamage(SpellNonMeleeDamage const* damageInfo, bool durabilityLoss);
// player or player's pet resilience (-1%)
- uint32 GetDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_RESILIENCE_PLAYER_DAMAGE_TAKEN, 1.0f, 100.0f, damage); }
+ uint32 GetDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_RESILIENCE_PLAYER_DAMAGE, 1.0f, 100.0f, damage); }
void ApplyResilience(Unit const* victim, int32* damage) const;
@@ -2079,7 +2080,7 @@ class TC_GAME_API Unit : public WorldObject
bool IsImmunedToDamage(SpellInfo const* spellInfo) const;
virtual bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const; // redefined in Creature
- bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const* spellInfo = NULL, uint8 effIndex = MAX_SPELL_EFFECTS);
+ bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const* spellInfo = nullptr, int8 effIndex = -1);
uint32 CalcArmorReducedDamage(Unit* attacker, Unit* victim, const uint32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType = MAX_ATTACK);
uint32 CalcSpellResistance(Unit* victim, SpellSchoolMask schoolMask, SpellInfo const* spellInfo) const;
void CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffectType damagetype, uint32 const damage, uint32* absorb, uint32* resist, SpellInfo const* spellInfo = NULL);