58 QueryResult result =
WorldDatabase.Query(
"SELECT spellId, requiredSpecialization, perfectCreateChance, perfectItemType FROM skill_perfect_item_template");
62 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell perfection definitions. DB table `skill_perfect_item_template` is empty.");
70 Field* fields = result->Fetch();
76 TC_LOG_ERROR(
"sql.sql",
"Skill perfection data for spell {} has a non-existing spell id in the `skill_perfect_item_template`!", spellId);
83 TC_LOG_ERROR(
"sql.sql",
"Skill perfection data for spell {} has a non-existing required specialization spell id {} in the `skill_perfect_item_template`!", spellId, requiredSpecialization);
87 float perfectCreateChance = fields[2].
GetFloat();
88 if (perfectCreateChance <= 0.0f)
90 TC_LOG_ERROR(
"sql.sql",
"Skill perfection data for spell {} has impossibly low proc chance in the `skill_perfect_item_template`!", spellId);
95 if (!
sObjectMgr->GetItemTemplate(perfectItemType))
97 TC_LOG_ERROR(
"sql.sql",
"Skill perfection data for spell {} references a non-existing perfect item id {} in the `skill_perfect_item_template`!", spellId, perfectItemType);
109 while (result->NextRow());
145 QueryResult result =
WorldDatabase.Query(
"SELECT spellId, requiredSpecialization, additionalCreateChance, additionalMaxNum FROM skill_extra_item_template");
149 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell specialization definitions. DB table `skill_extra_item_template` is empty.");
157 Field* fields = result->Fetch();
163 TC_LOG_ERROR(
"sql.sql",
"Skill specialization {} has a non-existing spell id in the `skill_extra_item_template`!", spellId);
170 TC_LOG_ERROR(
"sql.sql",
"Skill specialization {} has a non-existing required specialization spell id {} in the `skill_extra_item_template`!", spellId, requiredSpecialization);
174 float additionalCreateChance = fields[2].
GetFloat();
175 if (additionalCreateChance <= 0.0f)
177 TC_LOG_ERROR(
"sql.sql",
"Skill specialization {} has too low additional create chance in the `skill_extra_item_template`!", spellId);
182 if (!additionalMaxNum)
184 TC_LOG_ERROR(
"sql.sql",
"Skill specialization {} has 0 max number of extra items in the `skill_extra_item_template`!", spellId);
196 while (result->NextRow());
std::shared_ptr< ResultSet > QueryResult
DatabaseWorkerPool< WorldDatabaseConnection > WorldDatabase
Accessor to the world database.
#define TC_LOG_ERROR(filterType__,...)
#define TC_LOG_INFO(filterType__,...)
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Class used to access individual fields of database query result.
bool HasSpell(uint32 spell) const override
SkillPerfectItemEntry(uint32 rS, float pCC, uint32 pIT)
float perfectCreateChance
uint32 requiredSpecialization