diff options
| author | Ovahlord <dreadkiller@gmx.de> | 2023-11-15 15:03:26 +0100 |
|---|---|---|
| committer | Ovahlord <dreadkiller@gmx.de> | 2023-11-15 15:03:26 +0100 |
| commit | f2f0c266493ee8f49d497d60cd30cfd3a3c65b13 (patch) | |
| tree | 65e82cfc96f92abd79e48593f956ca676f818c77 | |
| parent | 2a5703aff685392d3db90a22a811804293f2f568 (diff) | |
Core/DataStores: fixed loading game tables
| -rw-r--r-- | src/server/game/DataStores/GameTables.cpp | 33 | ||||
| -rw-r--r-- | src/server/game/DataStores/GameTables.h | 63 | ||||
| -rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 200 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/StatSystem.cpp | 8 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 28 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.h | 33 | ||||
| -rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 10 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_azerite.cpp | 6 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_monk.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_priest.cpp | 2 |
11 files changed, 139 insertions, 252 deletions
diff --git a/src/server/game/DataStores/GameTables.cpp b/src/server/game/DataStores/GameTables.cpp index 2f786ddb63b..d7bc4adb2cb 100644 --- a/src/server/game/DataStores/GameTables.cpp +++ b/src/server/game/DataStores/GameTables.cpp @@ -36,7 +36,6 @@ GameTable<GtHpPerStaEntry> sHpPerStaGameTable; GameTable<GtItemSocketCostPerLevelEntry> sItemSocketCostPerLevelGameTable; GameTable<GtNpcManaCostScalerEntry> sNpcManaCostScalerGameTable; GameTable<GtSpellScalingEntry> sSpellScalingGameTable; -GameTable<GtStaminaMultByILvl> sStaminaMultByILvlGameTable; GameTable<GtXpEntry> sXpGameTable; template<class T> @@ -123,7 +122,6 @@ void LoadGameTables(std::string const& dataPath) LOAD_GT(sHpPerStaGameTable, "HpPerSta.txt"); LOAD_GT(sNpcManaCostScalerGameTable, "NPCManaCostScaler.txt"); LOAD_GT(sSpellScalingGameTable, "SpellScaling.txt"); - LOAD_GT(sStaminaMultByILvlGameTable, "StaminaMultByILvl.txt"); LOAD_GT(sXpGameTable, "xp.txt"); #undef LOAD_GT @@ -140,34 +138,3 @@ void LoadGameTables(std::string const& dataPath) TC_LOG_INFO("server.loading", ">> Initialized {} GameTables in {} ms", gameTableCount, GetMSTimeDiffToNow(oldMSTime)); } - -template<class T> -float GetIlvlStatMultiplier(T const* row, InventoryType invType) -{ - switch (invType) - { - case INVTYPE_NECK: - case INVTYPE_FINGER: - return row->JewelryMultiplier; - break; - case INVTYPE_TRINKET: - return row->TrinketMultiplier; - break; - case INVTYPE_WEAPON: - case INVTYPE_SHIELD: - case INVTYPE_RANGED: - case INVTYPE_2HWEAPON: - case INVTYPE_WEAPONMAINHAND: - case INVTYPE_WEAPONOFFHAND: - case INVTYPE_HOLDABLE: - case INVTYPE_RANGEDRIGHT: - return row->WeaponMultiplier; - break; - default: - return row->ArmorMultiplier; - break; - } -} - -template float GetIlvlStatMultiplier(GtCombatRatingsMultByILvl const* row, InventoryType invType); -template float GetIlvlStatMultiplier(GtStaminaMultByILvl const* row, InventoryType invType); diff --git a/src/server/game/DataStores/GameTables.h b/src/server/game/DataStores/GameTables.h index 188c9b74a65..32b5805ba45 100644 --- a/src/server/game/DataStores/GameTables.h +++ b/src/server/game/DataStores/GameTables.h @@ -54,8 +54,6 @@ struct GtBaseMPEntry float DeathKnight = 0.0f; float Monk = 0.0f; float DemonHunter = 0.0f; - float Evoker = 0.0f; - float Adventurer = 0.0f; }; struct GtBattlePetXPEntry @@ -66,7 +64,7 @@ struct GtBattlePetXPEntry struct GtCombatRatingsEntry { - float Amplify = 0.0f; + float WeaponSkill = 0.0f; float DefenseSkill = 0.0f; float Dodge = 0.0f; float Parry = 0.0f; @@ -77,27 +75,27 @@ struct GtCombatRatingsEntry float CritMelee = 0.0f; float CritRanged = 0.0f; float CritSpell = 0.0f; - float Corruption = 0.0f; - float CorruptionResistance = 0.0f; - float Speed = 0.0f; - float ResilienceCritTaken = 0.0f; - float ResiliencePlayerDamage = 0.0f; - float Lifesteal = 0.0f; + float HitTakenMelee = 0.0f; + float HitTakenRanged = 0.0f; + float HitTakenSpell = 0.0f; + float CritTakenMelee = 0.0f; + float CritTakenRanged = 0.0f; + float CritTakenSpell = 0.0f; float HasteMelee = 0.0f; float HasteRanged = 0.0f; float HasteSpell = 0.0f; - float Avoidance = 0.0f; - float Sturdiness = 0.0f; - float Unused7 = 0.0f; - float Expertise = 0.0f; - float ArmorPenetration = 0.0f; - float Mastery = 0.0f; - float PvPPower = 0.0f; - float Cleave = 0.0f; - float VersatilityDamageDone = 0.0f; - float VersatilityHealingDone = 0.0f; - float VersatilityDamageTaken = 0.0f; - float Unused12 = 0.0f; + float Unknown0 = 0.0f; + float Unknown1 = 0.0f; + float Unknown2 = 0.0f; + float Unknown3 = 0.0f; + float Unknown4 = 0.0f; + float Unknown5 = 0.0f; + float Unknown6 = 0.0f; + float Unknown7 = 0.0f; + float Unknown8 = 0.0f; + float Unknown9 = 0.0f; + float Unknown10 = 0.0f; + float Unknown11 = 0.0f; }; struct GtCombatRatingsMultByILvl @@ -137,17 +135,12 @@ struct GtSpellScalingEntry float DeathKnight = 0.0f; float Monk = 0.0f; float DemonHunter = 0.0f; - float Evoker = 0.0f; - float Adventurer = 0.0f; float Item = 0.0f; float Consumable = 0.0f; float Gem1 = 0.0f; float Gem2 = 0.0f; float Gem3 = 0.0f; float Health = 0.0f; - float DamageReplaceStat = 0.0f; - float DamageSecondary = 0.0f; - float ManaConsumable = 0.0f; }; struct GtStaminaMultByILvl @@ -198,7 +191,6 @@ TC_GAME_API extern GameTable<GtHpPerStaEntry> sHpPerStaGam TC_GAME_API extern GameTable<GtItemSocketCostPerLevelEntry> sItemSocketCostPerLevelGameTable; TC_GAME_API extern GameTable<GtNpcManaCostScalerEntry> sNpcManaCostScalerGameTable; TC_GAME_API extern GameTable<GtSpellScalingEntry> sSpellScalingGameTable; -TC_GAME_API extern GameTable<GtStaminaMultByILvl> sStaminaMultByILvlGameTable; TC_GAME_API extern GameTable<GtXpEntry> sXpGameTable; TC_GAME_API void LoadGameTables(std::string const& dataPath); @@ -232,10 +224,6 @@ inline float GetGameTableColumnForClass(T const* row, int32 class_) return row->Druid; case CLASS_DEMON_HUNTER: return row->DemonHunter; - case CLASS_EVOKER: - return row->Evoker; - case CLASS_ADVENTURER: - return row->Adventurer; default: break; } @@ -271,10 +259,6 @@ inline float GetSpellScalingColumnForClass(GtSpellScalingEntry const* row, int32 return row->Druid; case CLASS_DEMON_HUNTER: return row->DemonHunter; - case CLASS_EVOKER: - return row->Evoker; - case CLASS_ADVENTURER: - return row->Adventurer; case -1: case -7: return row->Item; @@ -288,12 +272,6 @@ inline float GetSpellScalingColumnForClass(GtSpellScalingEntry const* row, int32 return row->Gem3; case -6: return row->Health; - case -8: - return row->DamageReplaceStat; - case -9: - return row->DamageSecondary; - case -10: - return row->ManaConsumable; default: break; } @@ -306,7 +284,4 @@ inline float GetBattlePetXPPerLevel(GtBattlePetXPEntry const* row) return row->Wins * row->Xp; } -template<class T> -float GetIlvlStatMultiplier(T const* row, InventoryType invType); - #endif // GameTables_h__ diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 08d16d09232..531e372dd97 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5249,8 +5249,8 @@ inline float GetGameTableColumnForCombatRating(GtCombatRatingsEntry const* row, { switch (rating) { - case CR_AMPLIFY: - return row->Amplify; + case CR_WEAPON_SKILL: + return row->WeaponSkill; case CR_DEFENSE_SKILL: return row->DefenseSkill; case CR_DODGE: @@ -5271,48 +5271,24 @@ inline float GetGameTableColumnForCombatRating(GtCombatRatingsEntry const* row, return row->CritRanged; case CR_CRIT_SPELL: return row->CritSpell; - case CR_CORRUPTION: - return row->Corruption; - case CR_CORRUPTION_RESISTANCE: - return row->CorruptionResistance; - 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_HIT_TAKEN_MELEE: + return row->HitTakenMelee; + case CR_HIT_TAKEN_RANGED: + return row->HitTakenRanged; + case CR_HIT_TAKEN_SPELL: + return row->HitTakenSpell; + case CR_CRIT_TAKEN_MELEE: + return row->HitTakenMelee; + case CR_CRIT_TAKEN_RANGED: + return row->HitTakenMelee; + case CR_CRIT_TAKEN_SPELL: + return row->HitTakenMelee; 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; } @@ -5390,7 +5366,7 @@ void Player::UpdateRating(CombatRating cr) switch (cr) { - case CR_AMPLIFY: + case CR_WEAPON_SKILL: case CR_DEFENSE_SKILL: break; case CR_DODGE: @@ -5426,14 +5402,15 @@ void Player::UpdateRating(CombatRating cr) if (affectStats) UpdateSpellCritChance(); break; - case CR_CORRUPTION: - case CR_CORRUPTION_RESISTANCE: - UpdateCorruption(); + case CR_HIT_TAKEN_MELEE: // Implemented in Unit::MeleeMissChanceCalc + case CR_HIT_TAKEN_RANGED: + break; + case CR_HIT_TAKEN_SPELL: // Implemented in Unit::MagicSpellHitResult break; - case CR_SPEED: - case CR_RESILIENCE_PLAYER_DAMAGE: - case CR_RESILIENCE_CRIT_TAKEN: - case CR_LIFESTEAL: + case CR_CRIT_TAKEN_MELEE: // Implemented in Unit::RollMeleeOutcomeAgainst (only for chance to crit) + case CR_CRIT_TAKEN_RANGED: + break; + case CR_CRIT_TAKEN_SPELL: // Implemented in Unit::SpellCriticalBonus (only for chance to crit) break; case CR_HASTE_MELEE: case CR_HASTE_RANGED: @@ -5466,9 +5443,9 @@ void Player::UpdateRating(CombatRating cr) } break; } - case CR_AVOIDANCE: - case CR_STURDINESS: - case CR_UNUSED_7: + case CR_WEAPON_SKILL_MAINHAND: // Implemented in Unit::RollMeleeOutcomeAgainst + case CR_WEAPON_SKILL_OFFHAND: + case CR_WEAPON_SKILL_RANGED: break; case CR_EXPERTISE: if (affectStats) @@ -5481,21 +5458,6 @@ void Player::UpdateRating(CombatRating cr) if (affectStats) UpdateArmorPenetration(amount); break; - case CR_MASTERY: - UpdateMastery(); - break; - case CR_PVP_POWER: - case CR_CLEAVE: - break; - case CR_VERSATILITY_DAMAGE_DONE: - UpdateVersatilityDamageDone(); - break; - case CR_VERSATILITY_HEALING_DONE: - UpdateHealingDonePercentMod(); - break; - case CR_VERSATILITY_DAMAGE_TAKEN: - case CR_UNUSED_12: - break; } } @@ -7790,8 +7752,8 @@ void Player::_ApplyItemBonuses(Item* item, uint8 slot, bool apply) uint32 itemLevel = item->GetItemLevel(this); float combatRatingMultiplier = 1.0f; - if (GtCombatRatingsMultByILvl const* ratingMult = sCombatRatingsMultByILvlGameTable.GetRow(itemLevel)) - combatRatingMultiplier = GetIlvlStatMultiplier(ratingMult, proto->GetInventoryType()); + //if (GtCombatRatingsMultByILvl const* ratingMult = sCombatRatingsMultByILvlGameTable.GetRow(itemLevel)) + // combatRatingMultiplier = GetIlvlStatMultiplier(ratingMult, proto->GetInventoryType()); for (uint8 i = 0; i < MAX_ITEM_PROTO_STATS; ++i) { @@ -7829,8 +7791,8 @@ void Player::_ApplyItemBonuses(Item* item, uint8 slot, bool apply) // break; case ITEM_MOD_STAMINA: //modify stamina { - if (GtStaminaMultByILvl const* staminaMult = sStaminaMultByILvlGameTable.GetRow(itemLevel)) - val = int32(val * GetIlvlStatMultiplier(staminaMult, proto->GetInventoryType())); + //if (GtStaminaMultByILvl const* staminaMult = sStaminaMultByILvlGameTable.GetRow(itemLevel)) + // val = int32(val * GetIlvlStatMultiplier(staminaMult, proto->GetInventoryType())); HandleStatFlatModifier(UNIT_MOD_STAT_STAMINA, BASE_VALUE, float(val), apply); UpdateStatBuffMod(STAT_STAMINA); break; @@ -7877,9 +7839,9 @@ void Player::_ApplyItemBonuses(Item* item, uint8 slot, bool apply) // case ITEM_MOD_CRIT_TAKEN_MELEE_RATING: // ApplyRatingMod(CR_CRIT_TAKEN_MELEE, int32(val), apply); // break; - case ITEM_MOD_CRIT_TAKEN_RANGED_RATING: - ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE, int32(val), apply); - break; + //case ITEM_MOD_CRIT_TAKEN_RANGED_RATING: + // ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE, int32(val), apply); + // break; // case ITEM_MOD_CRIT_TAKEN_SPELL_RATING: // ApplyRatingMod(CR_CRIT_TAKEN_SPELL, int32(val), apply); // break; @@ -7912,9 +7874,9 @@ void Player::_ApplyItemBonuses(Item* item, uint8 slot, bool apply) // ApplyRatingMod(CR_CRIT_TAKEN_RANGED, int32(val), apply); // ApplyRatingMod(CR_CRIT_TAKEN_SPELL, int32(val), apply); // break; - case ITEM_MOD_RESILIENCE_RATING: - ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE, int32(val * combatRatingMultiplier), apply); - break; + //case ITEM_MOD_RESILIENCE_RATING: + // ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE, int32(val * combatRatingMultiplier), apply); + // break; case ITEM_MOD_HASTE_RATING: ApplyRatingMod(CR_HASTE_MELEE, int32(val * combatRatingMultiplier), apply); ApplyRatingMod(CR_HASTE_RANGED, int32(val * combatRatingMultiplier), apply); @@ -7930,11 +7892,11 @@ void Player::_ApplyItemBonuses(Item* item, uint8 slot, bool apply) case ITEM_MOD_RANGED_ATTACK_POWER: HandleStatFlatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(val), apply); break; - case ITEM_MOD_VERSATILITY: - ApplyRatingMod(CR_VERSATILITY_DAMAGE_DONE, int32(val * combatRatingMultiplier), apply); - ApplyRatingMod(CR_VERSATILITY_DAMAGE_TAKEN, int32(val * combatRatingMultiplier), apply); - ApplyRatingMod(CR_VERSATILITY_HEALING_DONE, int32(val * combatRatingMultiplier), apply); - break; + //case ITEM_MOD_VERSATILITY: + // ApplyRatingMod(CR_VERSATILITY_DAMAGE_DONE, int32(val * combatRatingMultiplier), apply); + // ApplyRatingMod(CR_VERSATILITY_DAMAGE_TAKEN, int32(val * combatRatingMultiplier), apply); + // ApplyRatingMod(CR_VERSATILITY_HEALING_DONE, int32(val * combatRatingMultiplier), apply); + // break; case ITEM_MOD_MANA_REGENERATION: ApplyManaRegenBonus(int32(val), apply); break; @@ -7950,9 +7912,9 @@ void Player::_ApplyItemBonuses(Item* item, uint8 slot, bool apply) case ITEM_MOD_SPELL_PENETRATION: ApplySpellPenetrationBonus(val, apply); break; - case ITEM_MOD_MASTERY_RATING: - ApplyRatingMod(CR_MASTERY, int32(val * combatRatingMultiplier), apply); - break; + //case ITEM_MOD_MASTERY_RATING: + // ApplyRatingMod(CR_MASTERY, int32(val * combatRatingMultiplier), apply); + // break; case ITEM_MOD_EXTRA_ARMOR: HandleStatFlatModifier(UNIT_MOD_ARMOR, TOTAL_VALUE, float(val), apply); break; @@ -7974,27 +7936,27 @@ void Player::_ApplyItemBonuses(Item* item, uint8 slot, bool apply) case ITEM_MOD_ARCANE_RESISTANCE: HandleStatFlatModifier(UNIT_MOD_RESISTANCE_ARCANE, BASE_VALUE, float(val), apply); break; - case ITEM_MOD_PVP_POWER: - ApplyRatingMod(CR_PVP_POWER, int32(val), apply); - break; - case ITEM_MOD_CORRUPTION: - ApplyRatingMod(CR_CORRUPTION, int32(val), apply); - break; - case ITEM_MOD_CORRUPTION_RESISTANCE: - ApplyRatingMod(CR_CORRUPTION_RESISTANCE, int32(val), apply); - break; - case ITEM_MOD_CR_SPEED: - ApplyRatingMod(CR_SPEED, int32(val * combatRatingMultiplier), apply); - break; - case ITEM_MOD_CR_LIFESTEAL: - ApplyRatingMod(CR_LIFESTEAL, int32(val * combatRatingMultiplier), apply); - break; - case ITEM_MOD_CR_AVOIDANCE: - ApplyRatingMod(CR_AVOIDANCE, int32(val * combatRatingMultiplier), apply); - break; - case ITEM_MOD_CR_STURDINESS: - ApplyRatingMod(CR_STURDINESS, int32(val * combatRatingMultiplier), apply); - break; + //case ITEM_MOD_PVP_POWER: + // ApplyRatingMod(CR_PVP_POWER, int32(val), apply); + // break; + //case ITEM_MOD_CORRUPTION: + // ApplyRatingMod(CR_CORRUPTION, int32(val), apply); + // break; + //case ITEM_MOD_CORRUPTION_RESISTANCE: + // ApplyRatingMod(CR_CORRUPTION_RESISTANCE, int32(val), apply); + // break; + //case ITEM_MOD_CR_SPEED: + // ApplyRatingMod(CR_SPEED, int32(val * combatRatingMultiplier), apply); + // break; + //case ITEM_MOD_CR_LIFESTEAL: + // ApplyRatingMod(CR_LIFESTEAL, int32(val * combatRatingMultiplier), apply); + // break; + //case ITEM_MOD_CR_AVOIDANCE: + // ApplyRatingMod(CR_AVOIDANCE, int32(val * combatRatingMultiplier), apply); + // break; + //case ITEM_MOD_CR_STURDINESS: + // ApplyRatingMod(CR_STURDINESS, int32(val * combatRatingMultiplier), apply); + // break; case ITEM_MOD_AGI_STR_INT: HandleStatFlatModifier(UNIT_MOD_STAT_AGILITY, BASE_VALUE, float(val), apply); HandleStatFlatModifier(UNIT_MOD_STAT_STRENGTH, BASE_VALUE, float(val), apply); @@ -13445,10 +13407,10 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool // ApplyRatingMod(CR_CRIT_TAKEN_RANGED, enchant_amount, apply); // ApplyRatingMod(CR_CRIT_TAKEN_SPELL, enchant_amount, apply); // break; - case ITEM_MOD_RESILIENCE_RATING: - ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE, enchant_amount, apply); - TC_LOG_DEBUG("entities.player.items", "+ {} RESILIENCE", enchant_amount); - break; + //case ITEM_MOD_RESILIENCE_RATING: + // ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE, enchant_amount, apply); + // TC_LOG_DEBUG("entities.player.items", "+ {} RESILIENCE", enchant_amount); + // break; case ITEM_MOD_HASTE_RATING: ApplyRatingMod(CR_HASTE_MELEE, enchant_amount, apply); ApplyRatingMod(CR_HASTE_RANGED, enchant_amount, apply); @@ -13492,16 +13454,16 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool HandleBaseModFlatValue(SHIELD_BLOCK_VALUE, float(enchant_amount), apply); TC_LOG_DEBUG("entities.player.items", "+ {} BLOCK_VALUE", enchant_amount); break; - case ITEM_MOD_MASTERY_RATING: - ApplyRatingMod(CR_MASTERY, enchant_amount, apply); - TC_LOG_DEBUG("entities.player.items", "+ {} MASTERY", enchant_amount); - break; - case ITEM_MOD_VERSATILITY: - ApplyRatingMod(CR_VERSATILITY_DAMAGE_DONE, enchant_amount, apply); - ApplyRatingMod(CR_VERSATILITY_HEALING_DONE, enchant_amount, apply); - ApplyRatingMod(CR_VERSATILITY_DAMAGE_TAKEN, enchant_amount, apply); - TC_LOG_DEBUG("entities.player.items", "+ {} VERSATILITY", enchant_amount); - break; + //case ITEM_MOD_MASTERY_RATING: + // ApplyRatingMod(CR_MASTERY, enchant_amount, apply); + // TC_LOG_DEBUG("entities.player.items", "+ {} MASTERY", enchant_amount); + // break; + // case ITEM_MOD_VERSATILITY: + // ApplyRatingMod(CR_VERSATILITY_DAMAGE_DONE, enchant_amount, apply); + // ApplyRatingMod(CR_VERSATILITY_HEALING_DONE, enchant_amount, apply); + // ApplyRatingMod(CR_VERSATILITY_DAMAGE_TAKEN, enchant_amount, apply); + // TC_LOG_DEBUG("entities.player.items", "+ {} VERSATILITY", enchant_amount); + // break; default: break; } @@ -16032,7 +15994,7 @@ int32 Player::GetQuestSlotObjectiveData(uint16 slot, QuestObjective const& objec if (!objective.IsStoringFlag()) return GetQuestSlotCounter(slot, objective.StorageIndex); - return uint8((GetQuestSlotState(slot) > objective.StorageIndex) != 0); + return uint8((GetQuestSlotState(slot) & objective.StorageIndex) != 0); } void Player::SetQuestSlot(uint16 slot, uint32 quest_id) @@ -20567,7 +20529,7 @@ void Player::_SaveStats(CharacterDatabaseTransaction trans) const stmt->setUInt32(index++, m_unitData->AttackPower); stmt->setUInt32(index++, m_unitData->RangedAttackPower); stmt->setUInt32(index++, GetBaseSpellPowerBonus()); - stmt->setUInt32(index, m_activePlayerData->CombatRatings[CR_RESILIENCE_PLAYER_DAMAGE]); + stmt->setUInt32(index, 0); // m_activePlayerData->CombatRatings[CR_RESILIENCE_PLAYER_DAMAGE] stmt->setFloat(index++, m_activePlayerData->Mastery); stmt->setInt32(index++, m_activePlayerData->Versatility); diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 1266dfddacd..de951250a3c 100644 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -450,7 +450,7 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bo float versaDmgMod = 1.0f; - AddPct(versaDmgMod, GetRatingBonusValue(CR_VERSATILITY_DAMAGE_DONE) + float(GetTotalAuraModifier(SPELL_AURA_MOD_VERSATILITY))); + //AddPct(versaDmgMod, GetRatingBonusValue(CR_VERSATILITY_DAMAGE_DONE) + float(GetTotalAuraModifier(SPELL_AURA_MOD_VERSATILITY))); SpellShapeshiftFormEntry const* shapeshift = sSpellShapeshiftFormStore.LookupEntry(GetShapeshiftForm()); if (shapeshift && shapeshift->CombatRoundTime) @@ -543,7 +543,7 @@ void Player::UpdateMastery() } float value = GetTotalAuraModifier(SPELL_AURA_MASTERY); - value += GetRatingBonusValue(CR_MASTERY); + //value += GetRatingBonusValue(CR_MASTERY); SetUpdateFieldValue(m_values.ModifyValue(&Player::m_activePlayerData).ModifyValue(&UF::ActivePlayerData::Mastery), value); ChrSpecializationEntry const* chrSpec = GetPrimarySpecializationEntry(); @@ -572,7 +572,7 @@ void Player::UpdateMastery() void Player::UpdateVersatilityDamageDone() { // No proof that CR_VERSATILITY_DAMAGE_DONE is allways = ActivePlayerData::Versatility - SetUpdateFieldValue(m_values.ModifyValue(&Player::m_activePlayerData).ModifyValue(&UF::ActivePlayerData::Versatility), m_activePlayerData->CombatRatings[CR_VERSATILITY_DAMAGE_DONE]); + //SetUpdateFieldValue(m_values.ModifyValue(&Player::m_activePlayerData).ModifyValue(&UF::ActivePlayerData::Versatility), m_activePlayerData->CombatRatings[CR_VERSATILITY_DAMAGE_DONE]); if (GetClass() == CLASS_HUNTER) UpdateDamagePhysical(RANGED_ATTACK); @@ -584,7 +584,7 @@ void Player::UpdateHealingDonePercentMod() { float value = 1.0f; - AddPct(value, GetRatingBonusValue(CR_VERSATILITY_HEALING_DONE) + GetTotalAuraModifier(SPELL_AURA_MOD_VERSATILITY)); + //AddPct(value, GetRatingBonusValue(CR_VERSATILITY_HEALING_DONE) + GetTotalAuraModifier(SPELL_AURA_MOD_VERSATILITY)); for (AuraEffect const* auraEffect : GetAuraEffectsByType(SPELL_AURA_MOD_HEALING_DONE_PERCENT)) AddPct(value, auraEffect->GetAmount()); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 0b6c13efa24..628655ac0b3 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6638,8 +6638,8 @@ float Unit::SpellDamagePctDone(Unit* victim, SpellInfo const* spellProto, Damage DoneTotalMod *= ToCreature()->GetSpellDamageMod(ToCreature()->GetCreatureTemplate()->rank); // Versatility - if (Player* modOwner = GetSpellModOwner()) - AddPct(DoneTotalMod, modOwner->GetRatingBonusValue(CR_VERSATILITY_DAMAGE_DONE) + modOwner->GetTotalAuraModifier(SPELL_AURA_MOD_VERSATILITY)); + //if (Player* modOwner = GetSpellModOwner()) + // AddPct(DoneTotalMod, modOwner->GetRatingBonusValue(CR_VERSATILITY_DAMAGE_DONE) + modOwner->GetTotalAuraModifier(SPELL_AURA_MOD_VERSATILITY)); float maxModDamagePercentSchool = 0.0f; if (Player const* thisPlayer = ToPlayer()) @@ -6730,12 +6730,12 @@ int32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, int if (!spellProto->HasAttribute(SPELL_ATTR4_IGNORE_DAMAGE_TAKEN_MODIFIERS)) { // Versatility - if (Player* modOwner = GetSpellModOwner()) - { - // only 50% of SPELL_AURA_MOD_VERSATILITY for damage reduction - float versaBonus = modOwner->GetTotalAuraModifier(SPELL_AURA_MOD_VERSATILITY) / 2.0f; - AddPct(TakenTotalMod, -(modOwner->GetRatingBonusValue(CR_VERSATILITY_DAMAGE_TAKEN) + versaBonus)); - } + //if (Player* modOwner = GetSpellModOwner()) + //{ + // // only 50% of SPELL_AURA_MOD_VERSATILITY for damage reduction + // float versaBonus = modOwner->GetTotalAuraModifier(SPELL_AURA_MOD_VERSATILITY) / 2.0f; + // AddPct(TakenTotalMod, -(modOwner->GetRatingBonusValue(CR_VERSATILITY_DAMAGE_TAKEN) + versaBonus)); + //} // from positive and negative SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN // multiplicative bonus, for example Dispersion + Shadowform (0.10*0.85=0.085) @@ -7683,12 +7683,12 @@ int32 Unit::MeleeDamageBonusTaken(Unit* attacker, int32 pdamage, WeaponAttackTyp TakenTotalMod *= GetTotalAuraMultiplier(SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT); // Versatility - if (Player* modOwner = GetSpellModOwner()) - { - // only 50% of SPELL_AURA_MOD_VERSATILITY for damage reduction - float versaBonus = modOwner->GetTotalAuraModifier(SPELL_AURA_MOD_VERSATILITY) / 2.0f; - AddPct(TakenTotalMod, -(modOwner->GetRatingBonusValue(CR_VERSATILITY_DAMAGE_TAKEN) + versaBonus)); - } + //if (Player* modOwner = GetSpellModOwner()) + //{ + // // only 50% of SPELL_AURA_MOD_VERSATILITY for damage reduction + // float versaBonus = modOwner->GetTotalAuraModifier(SPELL_AURA_MOD_VERSATILITY) / 2.0f; + // AddPct(TakenTotalMod, -(modOwner->GetRatingBonusValue(CR_VERSATILITY_DAMAGE_TAKEN) + versaBonus)); + //} // Sanctified Wrath (bypass damage reduction) if (TakenTotalMod < 1.0f) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 609ec53c2cc..21ba5ebe539 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -305,7 +305,7 @@ TC_GAME_API extern float playerBaseMoveSpeed[MAX_MOVE_TYPE]; enum CombatRating { - CR_AMPLIFY = 0, + CR_WEAPON_SKILL = 0, CR_DEFENSE_SKILL = 1, CR_DODGE = 2, CR_PARRY = 3, @@ -316,30 +316,23 @@ enum CombatRating CR_CRIT_MELEE = 8, CR_CRIT_RANGED = 9, CR_CRIT_SPELL = 10, - CR_CORRUPTION = 11, - CR_CORRUPTION_RESISTANCE = 12, - CR_SPEED = 13, - CR_RESILIENCE_CRIT_TAKEN = 14, - CR_RESILIENCE_PLAYER_DAMAGE = 15, - CR_LIFESTEAL = 16, + CR_HIT_TAKEN_MELEE = 11, + CR_HIT_TAKEN_RANGED = 12, + CR_HIT_TAKEN_SPELL = 13, + CR_CRIT_TAKEN_MELEE = 14, + CR_CRIT_TAKEN_RANGED = 15, + CR_CRIT_TAKEN_SPELL = 16, CR_HASTE_MELEE = 17, CR_HASTE_RANGED = 18, CR_HASTE_SPELL = 19, - CR_AVOIDANCE = 20, - CR_STURDINESS = 21, - CR_UNUSED_7 = 22, + CR_WEAPON_SKILL_MAINHAND = 20, + CR_WEAPON_SKILL_OFFHAND = 21, + CR_WEAPON_SKILL_RANGED = 22, CR_EXPERTISE = 23, - CR_ARMOR_PENETRATION = 24, - CR_MASTERY = 25, - CR_PVP_POWER = 26, - CR_CLEAVE = 27, - CR_VERSATILITY_DAMAGE_DONE = 28, - CR_VERSATILITY_HEALING_DONE = 29, - CR_VERSATILITY_DAMAGE_TAKEN = 30, - CR_UNUSED_12 = 31 + CR_ARMOR_PENETRATION = 24 }; -#define MAX_COMBAT_RATING 32 +#define MAX_COMBAT_RATING 25 enum UnitTypeMask { @@ -1056,7 +1049,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, 1.0f, 100.0f, damage); } + uint32 GetDamageReduction(uint32 damage) const { return 0; } virtual bool CanApplyResilience() const; static void ApplyResilience(Unit const* victim, int32* damage); diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index f73fa7e6a1a..1e4d11a5a81 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -594,16 +594,6 @@ int32 SpellEffectInfo::CalcBaseValue(WorldObject const* caster, Unit const* targ } else value = GetSpellScalingColumnForClass(sSpellScalingGameTable.GetRow(level), Scaling.Class); - - if (Scaling.Class == -7) - if (GtCombatRatingsMultByILvl const* ratingMult = sCombatRatingsMultByILvlGameTable.GetRow(effectiveItemLevel)) - if (ItemSparseEntry const* itemSparse = sItemSparseStore.LookupEntry(itemId)) - value *= GetIlvlStatMultiplier(ratingMult, InventoryType(itemSparse->InventoryType)); - - if (Scaling.Class == -6) - if (GtStaminaMultByILvl const* staminaMult = sStaminaMultByILvlGameTable.GetRow(effectiveItemLevel)) - if (ItemSparseEntry const* itemSparse = sItemSparseStore.LookupEntry(itemId)) - value *= GetIlvlStatMultiplier(staminaMult, InventoryType(itemSparse->InventoryType)); } value *= Scaling.Coefficient; diff --git a/src/server/scripts/Spells/spell_azerite.cpp b/src/server/scripts/Spells/spell_azerite.cpp index 794e588da9f..5216c468dc7 100644 --- a/src/server/scripts/Spells/spell_azerite.cpp +++ b/src/server/scripts/Spells/spell_azerite.cpp @@ -604,9 +604,9 @@ class spell_item_corruption_grasping_tendrils : public AuraScript void CalcAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated) { - Player* player = GetUnitOwner()->ToPlayer(); - amount = std::clamp(10.0f + player->GetRatingBonusValue(CR_CORRUPTION) - player->GetRatingBonusValue(CR_CORRUPTION_RESISTANCE), 0.0f, 99.0f); - canBeRecalculated = false; + //Player* player = GetUnitOwner()->ToPlayer(); + //amount = std::clamp(10.0f + player->GetRatingBonusValue(CR_CORRUPTION) - player->GetRatingBonusValue(CR_CORRUPTION_RESISTANCE), 0.0f, 99.0f); + //canBeRecalculated = false; } void Register() override diff --git a/src/server/scripts/Spells/spell_monk.cpp b/src/server/scripts/Spells/spell_monk.cpp index 6e66c820454..a3c56b8cb2a 100644 --- a/src/server/scripts/Spells/spell_monk.cpp +++ b/src/server/scripts/Spells/spell_monk.cpp @@ -129,8 +129,8 @@ class spell_monk_life_cocoon : public SpellScript void CalculateAbsorb(SpellEffIndex /*effIndex*/) { int32 absorb = GetCaster()->CountPctFromMaxHealth(GetEffectValue()); - if (Player* player = GetCaster()->ToPlayer()) - AddPct(absorb, player->GetRatingBonusValue(CR_VERSATILITY_HEALING_DONE)); + //if (Player* player = GetCaster()->ToPlayer()) + // AddPct(absorb, player->GetRatingBonusValue(CR_VERSATILITY_HEALING_DONE)); if (AuraEffect* calmingCoalescence = GetCaster()->GetAuraEffect(SPELL_MONK_CALMING_COALESCENCE, EFFECT_0, GetCaster()->GetGUID())) { diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index e6079efb253..4d3cc799b87 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -1329,8 +1329,8 @@ class spell_pal_shield_of_vengeance : public AuraScript void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { amount = CalculatePct(GetUnitOwner()->GetMaxHealth(), GetEffectInfo(EFFECT_1).CalcValue()); - if (Player const* player = GetUnitOwner()->ToPlayer()) - AddPct(amount, player->GetRatingBonusValue(CR_VERSATILITY_DAMAGE_DONE) + player->GetTotalAuraModifier(SPELL_AURA_MOD_VERSATILITY)); + //if (Player const* player = GetUnitOwner()->ToPlayer()) + // AddPct(amount, player->GetRatingBonusValue(CR_VERSATILITY_DAMAGE_DONE) + player->GetTotalAuraModifier(SPELL_AURA_MOD_VERSATILITY)); _initialAmount = amount; } diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 1da42380a9d..883d92321c9 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -1884,7 +1884,7 @@ class spell_pri_power_word_shield : public AuraScript if (Player* player = caster->ToPlayer()) { - AddPct(modifiedAmount, player->GetRatingBonusValue(CR_VERSATILITY_DAMAGE_DONE)); + //AddPct(modifiedAmount, player->GetRatingBonusValue(CR_VERSATILITY_DAMAGE_DONE)); // Mastery: Grace (TBD: move into DoEffectCalcDamageAndHealing hook with a new SpellScript and AuraScript). if (AuraEffect const* masteryGraceEffect = caster->GetAuraEffect(SPELL_PRIEST_MASTERY_GRACE, EFFECT_0)) |
