58 TC_LOG_ERROR(
"server.loading",
">> Loaded 0 skill discovery definitions. DB table `skill_discovery_template` is empty.");
64 std::ostringstream ssNonDiscoverableEntries;
65 std::set<uint32> reportedReqSpells;
69 Field* fields = result->Fetch();
78 ssNonDiscoverableEntries <<
"spellId = " << spellId <<
" reqSkillOrSpell = " << reqSkillOrSpell
79 <<
" reqSkillValue = " << reqSkillValue <<
" chance = " << chance <<
"(chance problem)\n";
83 if (reqSkillOrSpell > 0)
89 if (reportedReqSpells.find(absReqSkillOrSpell) == reportedReqSpells.end())
91 TC_LOG_ERROR(
"sql.sql",
"Spell (ID: %u) have not existed spell (ID: %i) in `reqSpell` field in `skill_discovery_template` table", spellId, reqSkillOrSpell);
92 reportedReqSpells.insert(absReqSkillOrSpell);
102 if (reportedReqSpells.find(absReqSkillOrSpell) == reportedReqSpells.end())
104 TC_LOG_ERROR(
"sql.sql",
"Spell (ID: %u) not have MECHANIC_DISCOVERY (28) value in Mechanic field in spell.dbc"
105 " and not 100%% chance random discovery ability but listed for spellId %u (and maybe more) in `skill_discovery_template` table",
106 absReqSkillOrSpell, spellId);
107 reportedReqSpells.insert(absReqSkillOrSpell);
114 else if (reqSkillOrSpell == 0)
118 if (bounds.first == bounds.second)
120 TC_LOG_ERROR(
"sql.sql",
"Spell (ID: %u) not listed in `SkillLineAbility.dbc` but listed with `reqSpell`=0 in `skill_discovery_template` table", spellId);
124 for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx)
129 TC_LOG_ERROR(
"sql.sql",
"Spell (ID: %u) have negative value in `reqSpell` field in `skill_discovery_template` table", spellId);
135 while (result->NextRow());
137 if (!ssNonDiscoverableEntries.str().empty())
138 TC_LOG_ERROR(
"sql.sql",
"Some items can't be successfully discovered: have in chance field value < 0.000001 in `skill_discovery_template` DB table . List:\n%s", ssNonDiscoverableEntries.str().c_str());
141 for (
uint32 spell_id = 1; spell_id <
sSpellMgr->GetSpellInfoStoreSize(); ++spell_id)
152 TC_LOG_ERROR(
"sql.sql",
"Spell (ID: %u) is 100%% chance random discovery ability but not have data in `skill_discovery_template` table", spell_id);
static SkillDiscoveryMap SkillDiscoveryStore
Definition: SkillDiscovery.cpp:45
float GetFloat() const
Definition: Field.h:222
Definition: SpellInfo.h:326
Class used to access individual fields of database query result.
Definition: Field.h:56
uint32 getMSTime()
Definition: Timer.h:24
WorldDatabaseWorkerPool WorldDatabase
Accessor to the world database.
Definition: DatabaseEnv.cpp:20
uint32 Mechanic
Definition: SpellInfo.h:332
std::pair< SkillLineAbilityMap::const_iterator, SkillLineAbilityMap::const_iterator > SkillLineAbilityMapBounds
Definition: SpellMgr.h:549
Definition: SkillDiscovery.cpp:29
#define sSpellMgr
Definition: SpellMgr.h:756
int32_t int32
Definition: Define.h:146
uint32_t uint32
Definition: Define.h:150
std::shared_ptr< ResultSet > QueryResult
Definition: QueryResult.h:61
Definition: SharedDefines.h:1818
uint16 GetUInt16() const
Definition: Field.h:108
bool IsExplicitDiscovery() const
Definition: SpellInfo.cpp:1228
int32 GetInt32() const
Definition: Field.h:165
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition: Timer.h:42
QueryResult Query(const char *sql, T *connection=nullptr)
Definition: DatabaseWorkerPool.cpp:113
uint32 GetUInt32() const
Definition: Field.h:146
int32_t int32
Definition: g3dmath.h:167
#define TC_LOG_INFO(filterType__,...)
Definition: Log.h:201
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
uint32_t uint32
Definition: g3dmath.h:168