Core/Spells: Implement using different difficulty data from all spell related db2s, not just SpellEffect and SpellPower
Port From (https://github.com/TrinityCore/TrinityCore/commit/c7306439e7004288fb85890d6a5f730cf1761d71)
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
using Framework.Constants;
|
||||
using Framework.Database;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -62,7 +63,7 @@ namespace Game.Spells
|
||||
if (reqSkillOrSpell > 0) // spell case
|
||||
{
|
||||
uint absReqSkillOrSpell = (uint)reqSkillOrSpell;
|
||||
SpellInfo reqSpellInfo = Global.SpellMgr.GetSpellInfo(absReqSkillOrSpell);
|
||||
SpellInfo reqSpellInfo = Global.SpellMgr.GetSpellInfo(absReqSkillOrSpell, Difficulty.None);
|
||||
if (reqSpellInfo == null)
|
||||
{
|
||||
if (!reportedReqSpells.Contains(absReqSkillOrSpell))
|
||||
@@ -117,8 +118,12 @@ namespace Game.Spells
|
||||
Log.outError(LogFilter.Sql, "Some items can't be successfully discovered: have in chance field value < 0.000001 in `skill_discovery_template` DB table . List:\n{0}", ssNonDiscoverableEntries.ToString());
|
||||
|
||||
// report about empty data for explicit discovery spells
|
||||
foreach (var spellEntry in Global.SpellMgr.GetSpellInfoStorage().Values)
|
||||
foreach (SpellNameRecord spellNameEntry in CliDB.SpellNameStorage.Values)
|
||||
{
|
||||
SpellInfo spellEntry = Global.SpellMgr.GetSpellInfo(spellNameEntry.Id, Difficulty.None);
|
||||
if (spellEntry == null)
|
||||
continue;
|
||||
|
||||
// skip not explicit discovery spells
|
||||
if (!spellEntry.IsExplicitDiscovery())
|
||||
continue;
|
||||
|
||||
@@ -44,14 +44,14 @@ namespace Game.Spells
|
||||
{
|
||||
uint spellId = result.Read<uint>(0);
|
||||
|
||||
if (!Global.SpellMgr.HasSpellInfo(spellId))
|
||||
if (!Global.SpellMgr.HasSpellInfo(spellId, Framework.Constants.Difficulty.None))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, "Skill specialization {0} has non-existent spell id in `skill_extra_item_template`!", spellId);
|
||||
continue;
|
||||
}
|
||||
|
||||
uint requiredSpecialization = result.Read<uint>(1);
|
||||
if (!Global.SpellMgr.HasSpellInfo(requiredSpecialization))
|
||||
if (!Global.SpellMgr.HasSpellInfo(requiredSpecialization, Framework.Constants.Difficulty.None))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, "Skill specialization {0} have not existed required specialization spell id {1} in `skill_extra_item_template`!", spellId, requiredSpecialization);
|
||||
continue;
|
||||
@@ -144,14 +144,14 @@ namespace Game.Spells
|
||||
do
|
||||
{
|
||||
uint spellId = result.Read<uint>(0);
|
||||
if (!Global.SpellMgr.HasSpellInfo(spellId))
|
||||
if (!Global.SpellMgr.HasSpellInfo(spellId, Framework.Constants.Difficulty.None))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, "Skill perfection data for spell {0} has non-existent spell id in `skill_perfect_item_template`!", spellId);
|
||||
continue;
|
||||
}
|
||||
|
||||
uint requiredSpecialization = result.Read<uint>(1);
|
||||
if (!Global.SpellMgr.HasSpellInfo(requiredSpecialization))
|
||||
if (!Global.SpellMgr.HasSpellInfo(requiredSpecialization, Framework.Constants.Difficulty.None))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, "Skill perfection data for spell {0} has non-existent required specialization spell id {1} in `skill_perfect_item_template`!", spellId, requiredSpecialization);
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user