194 Unit const* summoner =
nullptr;
225 _equipmentSetGuid(1),
229 _gameObjectSpawnId(1),
248 if (data.size() <=
size_t(localeConstant))
249 data.resize(localeConstant + 1);
251 data[localeConstant] = std::move(value);
268 Field* fields = result->Fetch();
271 std::string localeName = fields[1].
GetString();
280 }
while (result->NextRow());
292 QueryResult result =
WorldDatabase.Query(
"SELECT MenuID, OptionID, Locale, OptionText, BoxText FROM gossip_menu_option_locale");
299 Field* fields = result->Fetch();
303 std::string localeName = fields[2].
GetString();
312 }
while (result->NextRow());
331 Field* fields = result->Fetch();
334 std::string localeName = fields[1].
GetString();
342 }
while (result->NextRow());
367 "difficulty_entry_1,"
369 "difficulty_entry_2,"
371 "difficulty_entry_3,"
465 "ctm.InteractionPauseTimer,"
477 "ExperienceModifier,"
485 "mechanic_immune_mask,"
487 "spell_school_immune_mask,"
494 " FROM creature_template ct"
495 " LEFT JOIN creature_template_movement ctm ON ct.entry = ctm.CreatureId");
499 TC_LOG_INFO(
"server.loading",
">> Loaded 0 creature template definitions. DB table `creature_template` is empty.");
506 Field* fields = result->Fetch();
508 }
while (result->NextRow());
525 creatureTemplate.
Entry = entry;
570 creatureTemplate.
spells[i] = 0;
578 if (!fields[44].IsNull())
581 if (!fields[45].IsNull())
584 if (!fields[46].IsNull())
587 if (!fields[47].IsNull())
590 if (!fields[48].IsNull())
593 if (!fields[49].IsNull())
596 if (!fields[50].IsNull())
621 QueryResult result =
WorldDatabase.Query(
"SELECT CreatureID, School, Resistance FROM creature_template_resistance");
625 TC_LOG_INFO(
"server.loading",
">> Loaded 0 creature template resistance definitions. DB table `creature_template_resistance` is empty.");
633 Field* fields = result->Fetch();
640 TC_LOG_ERROR(
"sql.sql",
"creature_template_resistance has resistance definitions for creature {} but this school {} doesn't exist", creatureID, school);
647 TC_LOG_ERROR(
"sql.sql",
"creature_template_resistance has resistance definitions for creature {} but this creature doesn't exist", creatureID);
656 }
while (result->NextRow());
670 TC_LOG_INFO(
"server.loading",
">> Loaded 0 creature template spell definitions. DB table `creature_template_spell` is empty.");
678 Field* fields = result->Fetch();
685 TC_LOG_ERROR(
"sql.sql",
"creature_template_spell has spell definitions for creature {} with a incorrect index {}", creatureID, index);
692 TC_LOG_ERROR(
"sql.sql",
"creature_template_spell has spell definitions for creature {} but this creature doesn't exist", creatureID);
701 }
while (result->NextRow());
711 QueryResult result =
WorldDatabase.Query(
"SELECT entry, path_id, mount, StandState, AnimTier, VisFlags, SheathState, PvPFlags, emote, visibilityDistanceType, auras FROM creature_template_addon");
715 TC_LOG_INFO(
"server.loading",
">> Loaded 0 creature template addon definitions. DB table `creature_template_addon` is empty.");
722 Field* fields = result->Fetch();
728 TC_LOG_ERROR(
"sql.sql",
"Creature template (Entry: {}) does not exist but has a record in `creature_template_addon`", entry);
744 for (std::string_view aura :
Trinity::Tokenize(fields[10].GetStringView(),
' ',
false))
749 spellInfo =
sSpellMgr->GetSpellInfo(*spellId);
753 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has wrong spell '{}' defined in `auras` field in `creature_template_addon`.", entry, aura);
758 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has SPELL_AURA_CONTROL_VEHICLE aura {} defined in `auras` field in `creature_template_addon`.", entry, spellInfo->
Id);
760 if (std::find(creatureAddon.
auras.begin(), creatureAddon.
auras.end(), spellInfo->
Id) != creatureAddon.
auras.end())
762 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has duplicate aura (spell {}) in `auras` field in `creature_template_addon`.", entry, spellInfo->
Id);
768 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has temporary aura (spell {}) in `auras` field in `creature_template_addon`.", entry, spellInfo->
Id);
772 creatureAddon.
auras.push_back(spellInfo->
Id);
775 if (creatureAddon.
mount)
779 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has invalid displayInfoId ({}) for mount defined in `creature_template_addon`", entry, creatureAddon.
mount);
780 creatureAddon.
mount = 0;
786 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has invalid unit stand state ({}) defined in `creature_template_addon`. Truncated to 0.", entry, creatureAddon.
standState);
792 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has invalid animation tier ({}) defined in `creature_template_addon`. Truncated to 0.", entry, creatureAddon.
animTier);
798 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has invalid sheath state ({}) defined in `creature_template_addon`. Truncated to 0.", entry, creatureAddon.
sheathState);
806 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has invalid emote ({}) defined in `creature_template_addon`.", entry, creatureAddon.
emote);
807 creatureAddon.
emote = 0;
812 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has invalid visibilityDistanceType ({}) defined in `creature_template_addon`.",
819 while (result->NextRow());
839 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has `difficulty_entry_{}`={} but creature entry {} does not exist.",
850 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) is listed as `difficulty_entry_{}` of another creature, but itself lists {} in `difficulty_entry_{}`.",
857 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) already listed as `difficulty_entry_{}` for another entry.", cInfo->
DifficultyEntry[diff], diff2 + 1);
863 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has `difficulty_entry_{}`={} but creature entry {} has itself a value in `difficulty_entry_{}`.",
875 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}, exp: {}) has different `exp` in difficulty {} mode (Entry: {}, exp: {}).",
881 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}, minlevel: {}) has lower `minlevel` in difficulty {} mode (Entry: {}, minlevel: {}).",
887 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}, maxlevel: {}) has lower `maxlevel` in difficulty {} mode (Entry: {}, maxlevel: {}).",
893 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}, faction: {}) has different `faction` in difficulty {} mode (Entry: {}, faction: {}).",
895 TC_LOG_ERROR(
"sql.sql",
"Possible FIX: UPDATE `creature_template` SET `faction`={} WHERE `entry`={};",
901 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}, class: {}) has different `unit_class` in difficulty {} mode (Entry: {}, class: {}).",
903 TC_LOG_ERROR(
"sql.sql",
"Possible FIX: UPDATE `creature_template` SET `unit_class`={} WHERE `entry`={};",
911 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}, `npcflag`: {}) has different `npcflag` in difficulty {} mode (Entry: {}, `npcflag`: {}).",
913 TC_LOG_ERROR(
"sql.sql",
"Possible FIX: UPDATE `creature_template` SET `npcflag`=`npcflag`^{} WHERE `entry`={};",
919 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}, `dmgschool`: {}) has different `dmgschool` in difficulty {} mode (Entry: {}, `dmgschool`: {}).",
921 TC_LOG_ERROR(
"sql.sql",
"Possible FIX: UPDATE `creature_template` SET `dmgschool`={} WHERE `entry`={};",
928 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}, `unit_flags2`: {}) has different `unit_flags2` in difficulty {} mode (Entry: {}, `unit_flags2`: {}).",
930 TC_LOG_ERROR(
"sql.sql",
"Possible FIX: UPDATE `creature_template` SET `unit_flags2`=`unit_flags2`^{} WHERE `entry`={};",
936 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}, family: {}) has different `family` in difficulty {} mode (Entry: {}, family: {}).",
938 TC_LOG_ERROR(
"sql.sql",
"Possible FIX: UPDATE `creature_template` SET `family`={} WHERE `entry`={};",
942 if (cInfo->
type != difficultyInfo->
type)
944 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}, type: {}) has different `type` in difficulty {} mode (Entry: {}, type: {}).",
946 TC_LOG_ERROR(
"sql.sql",
"Possible FIX: UPDATE `creature_template` SET `type`={} WHERE `entry`={};",
952 TC_LOG_ERROR(
"sql.sql",
"Non-vehicle Creature (Entry: {}, VehicleId: {}) has `VehicleId` set in difficulty {} mode (Entry: {}, VehicleId: {}).",
958 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}, RegenHealth: {}) has different `RegenHealth` in difficulty {} mode (Entry: {}, RegenHealth: {}).",
960 TC_LOG_ERROR(
"sql.sql",
"Possible FIX: UPDATE `creature_template` SET `RegenHealth`={} WHERE `entry`={};",
967 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}, mechanic_immune_mask: {}) has weaker immunities in difficulty {} mode (Entry: {}, mechanic_immune_mask: {}).",
969 TC_LOG_ERROR(
"sql.sql",
"Possible FIX: UPDATE `creature_template` SET `mechanic_immune_mask`=`mechanic_immune_mask`|{} WHERE `entry`={};",
976 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}, flags_extra: {}) has different `flags_extra` in difficulty {} mode (Entry: {}, flags_extra: {}).",
978 TC_LOG_ERROR(
"sql.sql",
"Possible FIX: UPDATE `creature_template` SET `flags_extra`=`flags_extra`^{} WHERE `entry`={};",
982 if (!difficultyInfo->
AIName.empty())
984 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) lists difficulty {} mode entry {} with `AIName` filled in. `AIName` of difficulty 0 mode creature is always used instead.",
991 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) lists difficulty {} mode entry {} with `ScriptName` filled in. `ScriptName` of difficulty 0 mode creature is always used instead.",
1003 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has `mingold` {} which is greater than `maxgold` {}, setting `maxgold` to {}.",
1008 if (!cInfo->
AIName.empty())
1013 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has non-registered `AIName` '{}' set, removing", cInfo->
Entry, cInfo->
AIName);
1021 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has not-allowed `AIName` '{}' set, removing", cInfo->
Entry, cInfo->
AIName);
1028 if (!factionTemplate)
1030 TC_LOG_FATAL(
"sql.sql",
"Creature (Entry: {}) has non-existing faction template ({}). This can lead to crashes, aborting.", cInfo->
Entry, cInfo->
faction);
1042 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) lists non-existing Modelid1 id ({}), this can crash the client.", cInfo->
Entry, cInfo->
Modelid1);
1046 displayScaleEntry = displayEntry;
1050 TC_LOG_ERROR(
"sql.sql",
"No model data exist for `Modelid1` = {} listed by creature (Entry: {}).", cInfo->
Modelid1, cInfo->
Entry);
1058 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) lists non-existing Modelid2 id ({}), this can crash the client.", cInfo->
Entry, cInfo->
Modelid2);
1061 else if (!displayScaleEntry)
1062 displayScaleEntry = displayEntry;
1066 TC_LOG_ERROR(
"sql.sql",
"No model data exist for `Modelid2` = {} listed by creature (Entry: {}).", cInfo->
Modelid2, cInfo->
Entry);
1074 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) lists non-existing Modelid3 id ({}), this can crash the client.", cInfo->
Entry, cInfo->
Modelid3);
1077 else if (!displayScaleEntry)
1078 displayScaleEntry = displayEntry;
1082 TC_LOG_ERROR(
"sql.sql",
"No model data exist for `Modelid3` = {} listed by creature (Entry: {}).", cInfo->
Modelid3, cInfo->
Entry);
1090 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) lists non-existing Modelid4 id ({}), this can crash the client.", cInfo->
Entry, cInfo->
Modelid4);
1093 else if (!displayScaleEntry)
1094 displayScaleEntry = displayEntry;
1098 TC_LOG_ERROR(
"sql.sql",
"No model data exist for `Modelid4` = {} listed by creature (Entry: {}).", cInfo->
Modelid4, cInfo->
Entry);
1101 if (!displayScaleEntry)
1102 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) does not have any existing display id in Modelid1/Modelid2/Modelid3/Modelid4.", cInfo->
Entry);
1110 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) lists non-existing creature entry {} in `KillCredit{}`.", cInfo->
Entry, cInfo->
KillCredit[k], k + 1);
1118 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has invalid unit_class ({}) in creature_template. Set to 1 (UNIT_CLASS_WARRIOR).", cInfo->
Entry, cInfo->
unit_class);
1124 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has invalid spell school value ({}) in `dmgschool`.", cInfo->
Entry, cInfo->
dmgschool);
1142 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has wrong value ({}) in speed_run, set to 1.14286.", cInfo->
Entry, cInfo->
speed_run);
1148 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has invalid creature type ({}) in `type`.", cInfo->
Entry, cInfo->
type);
1155 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has invalid creature family ({}) in `family`.", cInfo->
Entry, cInfo->
family);
1172 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has a non-existing VehicleId ({}). This *WILL* cause the client to freeze!", cInfo->
Entry, cInfo->
VehicleId);
1188 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has non-existing Spell{} ({}), set to 0.", cInfo->
Entry, j+1, cInfo->
spells[j]);
1195 TC_LOG_ERROR(
"sql.sql",
"Creature (Entry: {}) has wrong movement generator type ({}), ignored and set to IDLE.", cInfo->
Entry, cInfo->
MovementType);
1200 if (cInfo->
scale <= 0.0f)
1202 if (displayScaleEntry)
1210 TC_LOG_ERROR(
"sql.sql",
"Table `creature_template` lists creature (Entry: {}) with expansion {}. Ignored and set to 0.", cInfo->
Entry, cInfo->
expansion);
1216 TC_LOG_ERROR(
"sql.sql",
"Table `creature_template` lists creature (Entry: {}) with disallowed `flags_extra` {}, removing incorrect flag.", cInfo->
Entry, badFlags);
1222 TC_LOG_ERROR(
"sql.sql",
"Table `creature_template` lists creature (Entry: {}) with disallowed `unit_flags` {}, removing incorrect flag.", cInfo->
Entry, disallowedUnitFlags);
1228 TC_LOG_ERROR(
"sql.sql",
"Table `creature_template` lists creature (Entry: {}) with disallowed `unit_flags2` {}, removing incorrect flag.", cInfo->
Entry, disallowedUnitFlags2);
1234 TC_LOG_ERROR(
"sql.sql",
"Table `creature_template` lists creature (Entry: {}) with `dynamicflags` > 0. Ignored and set to 0.", cInfo->
Entry);
1241 TC_LOG_INFO(
"sql.sql",
"Creature (Entry: {}) has assigned gossip menu {}, but npcflag does not include UNIT_NPC_FLAG_GOSSIP.", cInfo->
Entry, cInfo->
GossipMenuId);
1243 TC_LOG_INFO(
"sql.sql",
"Creature (Entry: {}) has npcflag UNIT_NPC_FLAG_GOSSIP, but gossip menu is unassigned.", cInfo->
Entry);
1250 TC_LOG_ERROR(
"sql.sql",
"`{}`.`Ground` wrong value ({}) for Id {}, setting to Run.",
1257 TC_LOG_ERROR(
"sql.sql",
"`{}`.`Flight` wrong value ({}) for Id {}, setting to None.",
1264 TC_LOG_ERROR(
"sql.sql",
"`{}`.`Chase` wrong value ({}) for Id {}, setting to Run.",
1271 TC_LOG_ERROR(
"sql.sql",
"`{}`.`Random` wrong value ({}) for Id {}, setting to Walk.",
1282 QueryResult result =
WorldDatabase.Query(
"SELECT guid, path_id, mount, StandState, AnimTier, VisFlags, SheathState, PvPFlags, emote, visibilityDistanceType, auras FROM creature_addon");
1286 TC_LOG_INFO(
"server.loading",
">> Loaded 0 creature addon definitions. DB table `creature_addon` is empty.");
1293 Field* fields = result->Fetch();
1300 TC_LOG_ERROR(
"sql.sql",
"Creature (GUID: {}) does not exist but has a record in `creature_addon`", guid);
1310 TC_LOG_ERROR(
"sql.sql",
"Creature (GUID {}) has movement type set to WAYPOINT_MOTION_TYPE but no path assigned", guid);
1322 for (std::string_view aura :
Trinity::Tokenize(fields[10].GetStringView(),
' ',
false))
1326 spellInfo =
sSpellMgr->GetSpellInfo(*spellId);
1330 TC_LOG_ERROR(
"sql.sql",
"Creature (GUID: {}) has wrong spell '{}' defined in `auras` field in `creature_addon`.", guid, aura);
1335 TC_LOG_ERROR(
"sql.sql",
"Creature (GUID: {}) has SPELL_AURA_CONTROL_VEHICLE aura {} defined in `auras` field in `creature_addon`.", guid, spellInfo->
Id);
1337 if (std::find(creatureAddon.
auras.begin(), creatureAddon.
auras.end(), spellInfo->
Id) != creatureAddon.
auras.end())
1339 TC_LOG_ERROR(
"sql.sql",
"Creature (GUID: {}) has duplicate aura (spell {}) in `auras` field in `creature_addon`.", guid, spellInfo->
Id);
1345 TC_LOG_ERROR(
"sql.sql",
"Creature (GUID: {}) has temporary aura (spell {}) in `auras` field in `creature_addon`.", guid, spellInfo->
Id);
1349 creatureAddon.
auras.push_back(spellInfo->
Id);
1352 if (creatureAddon.
mount)
1356 TC_LOG_ERROR(
"sql.sql",
"Creature (GUID: {}) has invalid displayInfoId ({}) for mount defined in `creature_addon`", guid, creatureAddon.
mount);
1357 creatureAddon.
mount = 0;
1363 TC_LOG_ERROR(
"sql.sql",
"Creature (GUID: {}) has invalid unit stand state ({}) defined in `creature_addon`. Truncated to 0.", guid, creatureAddon.
standState);
1369 TC_LOG_ERROR(
"sql.sql",
"Creature (GUID: {}) has invalid animation tier ({}) defined in `creature_addon`. Truncated to 0.", guid, creatureAddon.
animTier);
1375 TC_LOG_ERROR(
"sql.sql",
"Creature (GUID: {}) has invalid sheath state ({}) defined in `creature_addon`. Truncated to 0.", guid, creatureAddon.
sheathState);
1383 TC_LOG_ERROR(
"sql.sql",
"Creature (GUID: {}) has invalid emote ({}) defined in `creature_addon`.", guid, creatureAddon.
emote);
1384 creatureAddon.
emote = 0;
1389 TC_LOG_ERROR(
"sql.sql",
"Creature (GUID: {}) has invalid visibilityDistanceType ({}) defined in `creature_addon`.",
1396 while (result->NextRow());
1406 QueryResult result =
WorldDatabase.Query(
"SELECT guid, parent_rotation0, parent_rotation1, parent_rotation2, parent_rotation3, invisibilityType, invisibilityValue FROM gameobject_addon");
1410 TC_LOG_INFO(
"server.loading",
">> Loaded 0 gameobject addon definitions. DB table `gameobject_addon` is empty.");
1417 Field* fields = result->Fetch();
1424 TC_LOG_ERROR(
"sql.sql",
"GameObject (GUID: {}) does not exist but has a record in `gameobject_addon`", guid);
1429 gameObjectAddon.
ParentRotation =
QuaternionData(fields[1].GetFloat(), fields[2].GetFloat(), fields[3].GetFloat(), fields[4].GetFloat());
1435 TC_LOG_ERROR(
"sql.sql",
"GameObject (GUID: {}) has invalid InvisibilityType in `gameobject_addon`, disabled invisibility", guid);
1442 TC_LOG_ERROR(
"sql.sql",
"GameObject (GUID: {}) has InvisibilityType set but has no InvisibilityValue in `gameobject_addon`, set to 1", guid);
1448 TC_LOG_ERROR(
"sql.sql",
"GameObject (GUID: {}) has invalid parent rotation in `gameobject_addon`, set to default", guid);
1454 while (result->NextRow());
1463 return &(itr->second);
1472 return &(itr->second);
1481 return &(itr->second);
1497 if (itr->second.empty())
1502 EquipmentInfoContainerInternal::const_iterator ritr = itr->second.begin();
1503 std::advance(ritr,
urand(0u, itr->second.size() - 1));
1504 id = std::distance(itr->second.begin(), ritr) + 1;
1505 return &ritr->second;
1509 EquipmentInfoContainerInternal::const_iterator itr2 = itr->second.find(
id);
1510 if (itr2 != itr->second.end())
1511 return &itr2->second;
1522 QueryResult result =
WorldDatabase.Query(
"SELECT CreatureID, ID, ItemID1, ItemID2, ItemID3 FROM creature_equip_template");
1526 TC_LOG_INFO(
"server.loading",
">> Loaded 0 creature equipment templates. DB table `creature_equip_template` is empty!");
1533 Field* fields = result->Fetch();
1539 TC_LOG_ERROR(
"sql.sql",
"Creature template (Entry: {}) does not exist but has a record in `creature_equip_template`", entry);
1546 TC_LOG_ERROR(
"sql.sql",
"Creature equipment template with id 0 found for creature {}, skipped.", entry);
1565 TC_LOG_ERROR(
"sql.sql",
"Unknown item (entry={}) in creature_equip_template.itemEntry{} for entry = {} and id={}, forced to 0.",
1566 equipmentInfo.
ItemEntry[i], i+1, entry,
id);
1581 TC_LOG_ERROR(
"sql.sql",
"Item (entry={}) in creature_equip_template.itemEntry{} for entry = {} and id = {} is not equipable in a hand, forced to 0.",
1582 equipmentInfo.
ItemEntry[i], i+1, entry,
id);
1589 while (result->NextRow());
1602 "SELECT cmo.SpawnId,"
1603 "COALESCE(cmo.Ground, ctm.Ground),"
1604 "COALESCE(cmo.Swim, ctm.Swim),"
1605 "COALESCE(cmo.Flight, ctm.Flight),"
1606 "COALESCE(cmo.Rooted, ctm.Rooted),"
1607 "COALESCE(cmo.Chase, ctm.Chase),"
1608 "COALESCE(cmo.Random, ctm.Random),"
1609 "COALESCE(cmo.InteractionPauseTimer, ctm.InteractionPauseTimer) "
1610 "FROM creature_movement_override AS cmo "
1611 "LEFT JOIN creature AS c ON c.guid = cmo.SpawnId "
1612 "LEFT JOIN creature_template_movement AS ctm ON ctm.CreatureId = c.id");
1616 TC_LOG_INFO(
"server.loading",
">> Loaded 0 creature movement overrides. DB table `creature_movement_override` is empty!");
1622 Field* fields = result->Fetch();
1626 TC_LOG_ERROR(
"sql.sql",
"Creature (GUID: {}) does not exist but has a record in `creature_movement_override`", spawnId);
1631 if (!fields[1].IsNull())
1633 if (!fields[2].IsNull())
1635 if (!fields[3].IsNull())
1637 if (!fields[4].IsNull())
1639 if (!fields[5].IsNull())
1641 if (!fields[6].IsNull())
1643 if (!fields[7].IsNull())
1648 while (result->NextRow());
1657 return &(itr->second);
1677#define ChooseCreatureFlagSource(field) ((data && data->field) ? data->field : cinfo->field)
1688#undef ChooseCreatureFlagSource
1718 QueryResult result =
WorldDatabase.Query(
"SELECT DisplayID, BoundingRadius, CombatReach, DisplayID_Other_Gender, Gender FROM creature_model_info");
1722 TC_LOG_INFO(
"server.loading",
">> Loaded 0 creature model definitions. DB table `creature_model_info` is empty.");
1731 Field* fields = result->Fetch();
1736 if (!creatureDisplay)
1738 TC_LOG_ERROR(
"sql.sql",
"Table `creature_model_info` has a non-existent DisplayID (ID: {}). Skipped.", displayId);
1754 TC_LOG_ERROR(
"sql.sql",
"Table `creature_model_info` has wrong gender ({}) for display id ({}).",
uint32(modelInfo.
gender), displayId);
1760 TC_LOG_ERROR(
"sql.sql",
"Table `creature_model_info` has a non-existent DisplayID_Other_Gender (ID: {}) being used by DisplayID (ID: {}).", modelInfo.
displayId_other_gender, displayId);
1768 modelInfo.
is_trigger = strstr(modelData->ModelName,
"InvisibleStalker") !=
nullptr;
1772 while (result->NextRow());
1785 TC_LOG_INFO(
"server.loading",
">> Loaded 0 player totem model records. DB table `player_totem_model` is empty.");
1792 Field* fields = result->Fetch();
1798 if (totemSlot < SUMMON_SLOT_TOTEM_FIRE || totemSlot >=
MAX_TOTEM_SLOT)
1800 TC_LOG_ERROR(
"sql.sql",
"Wrong TotemSlot {} in `player_totem_model` table, skipped.", totemSlot);
1807 TC_LOG_ERROR(
"sql.sql",
"Race {} defined in `player_totem_model` does not exists, skipped.",
uint32(race));
1814 TC_LOG_ERROR(
"sql.sql",
"TotemSlot: {} defined in `player_totem_model` has non-existing model ({}), skipped.", totemSlot, displayId);
1821 while (result->NextRow());
1840 QueryResult result =
WorldDatabase.Query(
"SELECT guid, linkedGuid, linkType FROM linked_respawn ORDER BY guid ASC");
1844 TC_LOG_INFO(
"server.loading",
">> Loaded 0 linked respawns. DB table `linked_respawn` is empty.");
1850 Field* fields = result->Fetch();
1865 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature (guid) '{}' not found in creature table", guidLow);
1873 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature (linkedGuid) '{}' not found in creature table", linkedGuidLow);
1881 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature '{}' linking to Creature '{}' on an unpermitted map.", guidLow, linkedGuidLow);
1888 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature '{}' linking to Creature '{}' with not corresponding spawnMask", guidLow, linkedGuidLow);
1893 guid = ObjectGuid::Create<HighGuid::Unit>(slave->
id, guidLow);
1894 linkedGuid = ObjectGuid::Create<HighGuid::Unit>(master->
id, linkedGuidLow);
1902 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature (guid) '{}' not found in creature table", guidLow);
1910 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Gameobject (linkedGuid) '{}' not found in gameobject table", linkedGuidLow);
1918 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature '{}' linking to Gameobject '{}' on an unpermitted map.", guidLow, linkedGuidLow);
1925 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature '{}' linking to Gameobject '{}' with not corresponding spawnMask", guidLow, linkedGuidLow);
1930 guid = ObjectGuid::Create<HighGuid::Unit>(slave->
id, guidLow);
1931 linkedGuid = ObjectGuid::Create<HighGuid::GameObject>(master->
id, linkedGuidLow);
1939 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Gameobject (guid) '{}' not found in gameobject table", guidLow);
1947 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Gameobject (linkedGuid) '{}' not found in gameobject table", linkedGuidLow);
1955 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Gameobject '{}' linking to Gameobject '{}' on an unpermitted map.", guidLow, linkedGuidLow);
1962 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Gameobject '{}' linking to Gameobject '{}' with not corresponding spawnMask", guidLow, linkedGuidLow);
1967 guid = ObjectGuid::Create<HighGuid::GameObject>(slave->
id, guidLow);
1968 linkedGuid = ObjectGuid::Create<HighGuid::GameObject>(master->
id, linkedGuidLow);
1976 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Gameobject (guid) '{}' not found in gameobject table", guidLow);
1984 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature (linkedGuid) '{}' not found in creature table", linkedGuidLow);
1992 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Gameobject '{}' linking to Creature '{}' on an unpermitted map.", guidLow, linkedGuidLow);
1999 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Gameobject '{}' linking to Creature '{}' with not corresponding spawnMask", guidLow, linkedGuidLow);
2004 guid = ObjectGuid::Create<HighGuid::GameObject>(slave->
id, guidLow);
2005 linkedGuid = ObjectGuid::Create<HighGuid::Unit>(master->
id, linkedGuidLow);
2013 while (result->NextRow());
2025 ObjectGuid guid = ObjectGuid::Create<HighGuid::Unit>(master->
id, guidLow);
2040 TC_LOG_ERROR(
"sql.sql",
"Creature '{}' linking to non-existent creature '{}'.", guidLow, linkedGuidLow);
2047 TC_LOG_ERROR(
"sql.sql",
"Creature '{}' linking to '{}' on an unpermitted map.", guidLow, linkedGuidLow);
2053 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature '{}' linking to '{}' with not corresponding spawnMask", guidLow, linkedGuidLow);
2057 ObjectGuid linkedGuid = ObjectGuid::Create<HighGuid::Unit>(slave->
id, linkedGuidLow);
2075 QueryResult result =
WorldDatabase.Query(
"SELECT summonerId, summonerType, groupId, entry, position_x, position_y, position_z, orientation, summonType, summonTime FROM creature_summon_groups");
2079 TC_LOG_INFO(
"server.loading",
">> Loaded 0 temp summons. DB table `creature_summon_groups` is empty.");
2086 Field* fields = result->Fetch();
2092 switch (summonerType)
2097 TC_LOG_ERROR(
"sql.sql",
"Table `creature_summon_groups` has summoner with non existing entry {} for creature summoner type, skipped.", summonerId);
2104 TC_LOG_ERROR(
"sql.sql",
"Table `creature_summon_groups` has summoner with non existing entry {} for gameobject summoner type, skipped.", summonerId);
2111 TC_LOG_ERROR(
"sql.sql",
"Table `creature_summon_groups` has summoner with non existing entry {} for map summoner type, skipped.", summonerId);
2116 TC_LOG_ERROR(
"sql.sql",
"Table `creature_summon_groups` has unhandled summoner type {} for summoner {}, skipped.", summonerType, summonerId);
2125 TC_LOG_ERROR(
"sql.sql",
"Table `creature_summon_groups` has creature in group [Summoner ID: {}, Summoner Type: {}, Group ID: {}] with non existing creature entry {}, skipped.", summonerId, summonerType, group, data.
entry);
2132 float orientation = fields[7].
GetFloat();
2140 TC_LOG_ERROR(
"sql.sql",
"Table `creature_summon_groups` has unhandled temp summon type {} in group [Summoner ID: {}, Summoner Type: {}, Group ID: {}] for creature entry {}, skipped.", data.
type, summonerId, summonerType, group, data.
entry);
2151 }
while (result->NextRow());
2161 QueryResult result =
WorldDatabase.Query(
"SELECT creature.guid, id, map, position_x, position_y, position_z, orientation, modelid, equipment_id, spawntimesecs, wander_distance, "
2163 "currentwaypoint, curhealth, curmana, MovementType, spawnMask, phaseMask, eventEntry, poolSpawnId, creature.npcflag, creature.unit_flags, creature.dynamicflags, "
2165 "creature.ScriptName, creature.StringId "
2167 "LEFT OUTER JOIN game_event_creature ON creature.guid = game_event_creature.guid "
2168 "LEFT OUTER JOIN pool_members ON pool_members.type = 0 AND creature.guid = pool_members.spawnId");
2172 TC_LOG_INFO(
"server.loading",
">> Loaded 0 creatures. DB table `creature` is empty.");
2177 std::map<uint32, uint32> spawnMasks;
2182 spawnMasks[i] |= (1 << k);
2188 Field* fields = result->Fetch();
2196 TC_LOG_ERROR(
"sql.sql",
"Table `creature` has creature (GUID: {}) with non existing creature entry {}, skipped.", guid, entry);
2204 data.
spawnPoint.
Relocate(fields[3].GetFloat(), fields[4].GetFloat(), fields[5].GetFloat(), fields[6].GetFloat());
2227 TC_LOG_ERROR(
"sql.sql",
"Table `creature` has creature (GUID: {}) that spawned at nonexistent map (Id: {}), skipped.", guid, data.
mapId);
2235 TC_LOG_ERROR(
"sql.sql",
"Table `creature` has creature (GUID: {}) that have wrong spawn mask {} including unsupported difficulty modes for map (Id: {}).", guid, data.
spawnMask, data.
mapId);
2245 TC_LOG_ERROR(
"sql.sql",
"Table `creature` has creature (GUID: {}) that is listed as difficulty {} template (entry: {}) in `creature_template`, skipped.",
2246 guid, diff + 1, data.
id);
2258 TC_LOG_ERROR(
"sql.sql",
"Table `creature` has creature (Entry: {}) with equipment_id {} not found in table `creature_equip_template`, set to no equipment.", data.
id, data.
equipmentId);
2266 TC_LOG_ERROR(
"sql.sql",
"Table `creature` has creature (GUID: {} Entry: {}) with `creature_template`.`flags_extra` including CREATURE_FLAG_EXTRA_INSTANCE_BIND but creature is not in instance.", guid, data.
id);
2271 TC_LOG_ERROR(
"sql.sql",
"Table `creature` has creature (GUID: {} Entry: {}) with wrong movement generator type ({}), ignored and set to IDLE.", guid, data.
id, data.
movementType);
2277 TC_LOG_ERROR(
"sql.sql",
"Table `creature` has creature (GUID: {} Entry: {}) with `wander_distance`< 0, set to 0.", guid, data.
id);
2284 TC_LOG_ERROR(
"sql.sql",
"Table `creature` has creature (GUID: {} Entry: {}) with `MovementType`=1 (random movement) but with `wander_distance`=0, replace by idle movement type (0).", guid, data.
id);
2292 TC_LOG_ERROR(
"sql.sql",
"Table `creature` has creature (GUID: {} Entry: {}) with `MovementType`=0 (idle) have `wander_distance`<>0, set to 0.", guid, data.
id);
2299 TC_LOG_ERROR(
"sql.sql",
"Table `creature` has creature (GUID: {} Entry: {}) with `phaseMask`=0 (not visible for anyone), set to 1.", guid, data.
id);
2305 TC_LOG_ERROR(
"sql.sql",
"Table `creature` has creature (GUID: {} Entry: {}) with disallowed `unit_flags` {}, removing incorrect flag.", guid, data.
id, disallowedUnitFlags);
2311 TC_LOG_ERROR(
"sql.sql",
"Table `creature` has creature (GUID: {} Entry: {}) with `dynamicflags` > 0. Ignored and set to 0.", guid, data.
id);
2331 if (gameEvent == 0 && PoolId == 0)
2334 while (result->NextRow());
2355 for (
uint8 i = 0; mask != 0; i++, mask >>= 1)
2369 for (
uint8 i = 0; mask != 0; i++, mask >>= 1)
2416 TC_LOG_ERROR(
"misc",
"AddGameObjectData: cannot add gameobject entry {} to map", entry);
2467 if (!creature->
LoadFromDB(spawnId, map,
true,
true))
2469 TC_LOG_ERROR(
"misc",
"AddCreature: Cannot add creature entry {} to map", entry);
2483 QueryResult result =
WorldDatabase.Query(
"SELECT gameobject.guid, id, map, position_x, position_y, position_z, orientation, "
2485 "rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state, spawnMask, phaseMask, eventEntry, poolSpawnId, "
2487 "ScriptName, StringId "
2488 "FROM gameobject LEFT OUTER JOIN game_event_gameobject ON gameobject.guid = game_event_gameobject.guid "
2489 "LEFT OUTER JOIN pool_members ON pool_members.type = 1 AND gameobject.guid = pool_members.spawnId");
2493 TC_LOG_INFO(
"server.loading",
">> Loaded 0 gameobjects. DB table `gameobject` is empty.");
2498 std::map<uint32, uint32> spawnMasks;
2503 spawnMasks[i] |= (1 << k);
2509 Field* fields = result->Fetch();
2517 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: {}) with non existing gameobject entry {}, skipped.", guid, entry);
2523 switch (gInfo->
type)
2529 TC_LOG_ERROR(
"sql.sql",
"Gameobject (GUID: {} Entry {} GoType: {}) doesn't have a displayId ({}), not loaded.", guid, entry, gInfo->
type, gInfo->
displayId);
2536 TC_LOG_ERROR(
"sql.sql",
"Gameobject (GUID: {} Entry {} GoType: {}) has an invalid displayId ({}), not loaded.", guid, entry, gInfo->
type, gInfo->
displayId);
2545 data.
spawnPoint.
Relocate(fields[3].GetFloat(), fields[4].GetFloat(), fields[5].GetFloat(), fields[6].GetFloat());
2556 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: {} Entry: {}) spawned on a non-existed map (Id: {}), skip", guid, data.
id, data.
mapId);
2562 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: {} Entry: {}) with `spawntimesecs` (0) value, but the gameobejct is marked as despawnable at action.", guid, data.
id);
2571 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: {} Entry: {}) with invalid `state` ({}) value, skip", guid, data.
id, go_state);
2581 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: {} Entry: {}) that has wrong spawn mask {} including unsupported difficulty modes for map (Id: {}), skip", guid, data.
id, data.
spawnMask, data.
mapId);
2595 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: {} Entry: {}) with invalid rotationX ({}) value, skip", guid, data.
id, data.
rotation.
x);
2601 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: {} Entry: {}) with invalid rotationY ({}) value, skip", guid, data.
id, data.
rotation.
y);
2607 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: {} Entry: {}) with invalid rotationZ ({}) value, skip", guid, data.
id, data.
rotation.
z);
2613 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: {} Entry: {}) with invalid rotationW ({}) value, skip", guid, data.
id, data.
rotation.
w);
2619 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: {} Entry: {}) with invalid coordinates, skip", guid, data.
id);
2625 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: {} Entry: {}) with invalid rotation quaternion (non-unit), defaulting to orientation on Z axis only", guid, data.
id);
2631 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: {} Entry: {}) with `phaseMask`=0 (not visible for anyone), set to 1.", guid, data.
id);
2650 if (gameEvent == 0 && PoolId == 0)
2653 while (result->NextRow());
2669 Field* fields = result->Fetch();
2683 flags &= ~SPAWNGROUP_FLAG_MANUAL_SPAWN;
2684 TC_LOG_ERROR(
"sql.sql",
"System spawn group {} ({}) has invalid manual spawn flag. Ignored.", groupId, group.
name);
2687 }
while (result->NextRow());
2692 TC_LOG_ERROR(
"sql.sql",
"Default spawn group (index 0) is missing from DB! Manually inserted.");
2695 data.
name =
"Default Group";
2701 TC_LOG_ERROR(
"sql.sql",
"Default legacy spawn group (index 1) is missing from DB! Manually inserted.");
2704 data.
name =
"Legacy Group";
2712 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spawn group templates. DB table `spawn_group_template` is empty.");
2726 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spawn group members. DB table `spawn_group` is empty.");
2733 Field* fields = result->Fetch();
2738 TC_LOG_ERROR(
"sql.sql",
"Spawn data with invalid type {} listed for spawn group {}. Skipped.",
uint32(spawnType), groupId);
2746 TC_LOG_ERROR(
"sql.sql",
"Spawn data with ID ({},{}) not found, but is listed as a member of spawn group {}!",
uint32(spawnType), spawnId, groupId);
2751 TC_LOG_ERROR(
"sql.sql",
"Spawn with ID ({},{}) is listed as a member of spawn group {}, but is already a member of spawn group {}. Skipping.",
uint32(spawnType), spawnId, groupId, data->
spawnGroupData->
groupId);
2757 TC_LOG_ERROR(
"sql.sql",
"Spawn group {} assigned to spawn ID ({},{}), but group does not exist!", groupId,
uint32(spawnType), spawnId);
2767 TC_LOG_ERROR(
"sql.sql",
"Spawn group {} has map ID {}, but spawn ({},{}) has map id {} - spawn NOT added to group!", groupId, groupTemplate.
mapId,
uint32(spawnType), spawnId, data->
mapId);
2770 const_cast<SpawnMetadata*
>(data)->spawnGroupData = &groupTemplate;
2775 }
while (result->NextRow());
2785 QueryResult result =
WorldDatabase.Query(
"SELECT instanceMapId, bossStateId, bossStates, spawnGroupId, flags FROM instance_spawn_groups");
2789 TC_LOG_INFO(
"server.loading",
">> Loaded 0 instance spawn groups. DB table `instance_spawn_groups` is empty.");
2796 Field* fields = result->Fetch();
2801 TC_LOG_ERROR(
"sql.sql",
"Invalid spawn group {} specified for instance {}. Skipped.", spawnGroupId, fields[0].GetUInt16());
2806 if (it->second.mapId != instanceMapId)
2808 TC_LOG_ERROR(
"sql.sql",
"Instance spawn group {} specified for instance {} has spawns on a different map {}. Skipped.",
2809 spawnGroupId, instanceMapId, it->second.mapId);
2819 if (states & ~ALL_STATES)
2822 TC_LOG_ERROR(
"sql.sql",
"Instance spawn group ({},{}) had invalid boss state mask {} - truncated to {}.", instanceMapId, spawnGroupId, states, info.
BossStates);
2831 TC_LOG_ERROR(
"sql.sql",
"Instance spawn group ({},{}) had invalid flags {} - truncated to {}.", instanceMapId, spawnGroupId,
flags, info.
Flags);
2839 TC_LOG_ERROR(
"sql.sql",
"Instance spawn group ({},{}) FLAG_ALLIANCE_ONLY and FLAG_HORDE_ONLY may not be used together in a single entry - truncated to {}.", instanceMapId, spawnGroupId, info.
Flags);
2843 }
while (result->NextRow());
2856 for (
auto it = pair.first; it != pair.second; ++it)
2858 if (it->second != data)
2869 for (
uint8 i = 0; mask != 0; i++, mask >>= 1)
2883 for (
uint8 i = 0; mask != 0; i++, mask >>= 1)
2907 Field* fields = result->Fetch();
2910 std::string localeName = fields[1].
GetString();
2919 }
while (result->NextRow());
2929 QueryResult result =
WorldDatabase.Query(
"SELECT entry, class, subclass, SoundOverrideSubclass, name, displayid, Quality, Flags, FlagsExtra, BuyCount, BuyPrice, SellPrice, InventoryType, "
2931 "AllowableClass, AllowableRace, ItemLevel, RequiredLevel, RequiredSkill, RequiredSkillRank, requiredspell, requiredhonorrank, "
2933 "RequiredCityRank, RequiredReputationFaction, RequiredReputationRank, maxcount, stackable, ContainerSlots, StatsCount, stat_type1, "
2935 "stat_value1, stat_type2, stat_value2, stat_type3, stat_value3, stat_type4, stat_value4, stat_type5, stat_value5, stat_type6, "
2937 "stat_value6, stat_type7, stat_value7, stat_type8, stat_value8, stat_type9, stat_value9, stat_type10, stat_value10, "
2939 "ScalingStatDistribution, ScalingStatValue, dmg_min1, dmg_max1, dmg_type1, dmg_min2, dmg_max2, dmg_type2, armor, holy_res, fire_res, "
2941 "nature_res, frost_res, shadow_res, arcane_res, delay, ammo_type, RangedModRange, spellid_1, spelltrigger_1, spellcharges_1, "
2943 "spellppmRate_1, spellcooldown_1, spellcategory_1, spellcategorycooldown_1, spellid_2, spelltrigger_2, spellcharges_2, "
2945 "spellppmRate_2, spellcooldown_2, spellcategory_2, spellcategorycooldown_2, spellid_3, spelltrigger_3, spellcharges_3, "
2947 "spellppmRate_3, spellcooldown_3, spellcategory_3, spellcategorycooldown_3, spellid_4, spelltrigger_4, spellcharges_4, "
2949 "spellppmRate_4, spellcooldown_4, spellcategory_4, spellcategorycooldown_4, spellid_5, spelltrigger_5, spellcharges_5, "
2951 "spellppmRate_5, spellcooldown_5, spellcategory_5, spellcategorycooldown_5, bonding, description, PageText, LanguageID, PageMaterial, "
2953 "startquest, lockid, Material, sheath, RandomProperty, RandomSuffix, block, itemset, MaxDurability, area, Map, BagFamily, "
2955 "TotemCategory, socketColor_1, socketContent_1, socketColor_2, socketContent_2, socketColor_3, socketContent_3, socketBonus, "
2957 "GemProperties, RequiredDisenchantSkill, ArmorDamageModifier, duration, ItemLimitCategory, HolidayId, ScriptName, DisenchantID, "
2959 "FoodType, minMoneyLoot, maxMoneyLoot, flagsCustom FROM item_template");
2963 TC_LOG_INFO(
"server.loading",
">> Loaded 0 item templates. DB table `item_template` is empty.");
2972 Field* fields = result->Fetch();
2977 itemTemplate.
ItemId = entry;
2978 itemTemplate.
Class =
uint32(fields[1].GetUInt8());
3014 itemTemplate.
ItemStat[i].ItemStatType =
uint32(fields[28 + i*2].GetUInt8());
3015 itemTemplate.
ItemStat[i].ItemStatValue =
int32(fields[29 + i*2].GetInt16());
3025 itemTemplate.
Damage[i].DamageType =
uint32(fields[52 + i*3].GetUInt8());
3028 itemTemplate.
Armor =
uint32(fields[56].GetUInt16());
3035 itemTemplate.
Delay =
uint32(fields[63].GetUInt16());
3042 itemTemplate.
Effects[i].TriggerType =
uint32(fields[67 + i * 7].GetUInt8());
3043 itemTemplate.
Effects[i].Charges =
int32(fields[68 + i * 7].GetInt16());
3046 itemTemplate.
Effects[i].SpellCategoryID =
uint32(fields[71 + i * 7].GetUInt16());
3047 itemTemplate.
Effects[i].CategoryCoolDownMSec = fields[72 + i * 7].
GetInt32();
3065 itemTemplate.
Map =
uint32(fields[116].GetUInt16());
3071 itemTemplate.
Socket[i].Color =
uint32(fields[119 + i*2].GetUInt8());
3097 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) does not have a correct class {}, must be {} .", entry, itemTemplate.
Class, dbcitem->
ClassID);
3098 if (enforceDBCAttributes)
3105 if (enforceDBCAttributes)
3110 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) does not have a correct material ({}), must be {} .", entry, itemTemplate.
Material, dbcitem->
Material);
3111 if (enforceDBCAttributes)
3117 if (enforceDBCAttributes)
3123 if (enforceDBCAttributes)
3128 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) does not have a correct sheathid ({}), must be {} .", entry, itemTemplate.
Sheath, dbcitem->
SheatheType);
3129 if (enforceDBCAttributes)
3135 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) does not exist in item.dbc! (not correct id?).", entry);
3139 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong Class value ({})", entry, itemTemplate.
Class);
3145 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong Subclass value ({}) for class {}", entry, itemTemplate.
SubClass, itemTemplate.
Class);
3151 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong Quality value ({})", entry, itemTemplate.
Quality);
3158 if ((itemTemplate.
AllowableRace & faction->ReputationRaceMask[0]) == 0)
3159 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has value ({}) in `AllowableRace` races, not compatible with ITEM_FLAG2_FACTION_HORDE ({}) in Flags field, item cannot be equipped or used by these races.",
3163 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has value ({}) in `Flags2` flags (ITEM_FLAG2_FACTION_ALLIANCE) and ITEM_FLAG2_FACTION_HORDE ({}) in Flags field, this is a wrong combination.",
3169 if ((itemTemplate.
AllowableRace & faction->ReputationRaceMask[0]) == 0)
3170 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has value ({}) in `AllowableRace` races, not compatible with ITEM_FLAG2_FACTION_ALLIANCE ({}) in Flags field, item cannot be equipped or used by these races.",
3176 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong BuyCount value ({}), set to default(1).", entry, itemTemplate.
BuyCount);
3198 if (itemTemplate.
Effects[j].SpellID > 0)
3208 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) does not have any playable classes ({}) in `AllowableClass` and can't be equipped or used.", entry, itemTemplate.
AllowableClass);
3211 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) does not have any playable races ({}) in `AllowableRace` and can't be equipped or used.", entry, itemTemplate.
AllowableRace);
3217 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has a wrong (non-existing) spell in RequiredSpell ({})", entry, itemTemplate.
RequiredSpell);
3222 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong reputation rank in RequiredReputationRank ({}), item can't be used.", entry, itemTemplate.
RequiredReputationRank);
3233 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has min. reputation rank in RequiredReputationRank (0) but RequiredReputationFaction > 0, faction setting is useless.", entry);
3238 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has too large negative in maxcount ({}), replace by value (-1) no storing limits.", entry, itemTemplate.
MaxCount);
3244 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong value in stackable ({}), replace by default 1.", entry, itemTemplate.
Stackable);
3249 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has too large negative in stackable ({}), replace by value (-1) no stacking limits.", entry, itemTemplate.
Stackable);
3264 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong (non-existing?) stat_type{} ({})", entry, j+1, itemTemplate.
ItemStat[j].ItemStatType);
3265 itemTemplate.
ItemStat[j].ItemStatType = 0;
3268 switch (itemTemplate.
ItemStat[j].ItemStatType)
3272 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has deprecated stat_type{} ({})", entry, j+1, itemTemplate.
ItemStat[j].ItemStatType);
3283 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong dmg_type{} ({})", entry, j+1, itemTemplate.
Damage[j].DamageType);
3284 itemTemplate.
Damage[j].DamageType = 0;
3292 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong item spell trigger value in spelltrigger_{} ({})", entry, j+1, itemTemplate.
Effects[j].TriggerType);
3293 itemTemplate.
Effects[j].SpellID = 0;
3297 if (itemTemplate.
Effects[j].SpellID > 0)
3302 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong (not existing) spell in spellid_{} ({})", entry, j+1, itemTemplate.
Effects[j].SpellID);
3303 itemTemplate.
Effects[j].SpellID = 0;
3309 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong Bonding value ({})", entry, itemTemplate.
Bonding);
3312 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has non existing first page (Id:{})", entry, itemTemplate.
PageText);
3315 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong LockID ({})", entry, itemTemplate.
LockID);
3319 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong Sheath ({})", entry, itemTemplate.
Sheath);
3331 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has unknown (wrong or not listed in `item_enchantment_template`) RandomProperty ({})", entry, itemTemplate.
RandomProperty);
3344 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) have wrong ItemSet ({})", entry, itemTemplate.
ItemSet);
3349 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong Area ({})", entry, itemTemplate.
Area);
3352 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong Map ({})", entry, itemTemplate.
Map);
3360 if ((itemTemplate.
BagFamily & mask) == 0)
3366 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has bag family bit set not listed in ItemBagFamily.dbc, remove bit", entry);
3376 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has currency bag family bit set in BagFamily but not listed in CurrencyTypes.dbc, remove bit", entry);
3390 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong socketColor_{} ({})", entry, j+1, itemTemplate.
Socket[j].Color);
3391 itemTemplate.
Socket[j].Color = 0;
3400 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong FoodType value ({})", entry, itemTemplate.
FoodType);
3412 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong HolidayId value ({})", entry, itemTemplate.
HolidayId);
3418 TC_LOG_ERROR(
"sql.sql",
"Item (Entry {}) has flag ITEM_FLAGS_CU_DURATION_REAL_TIME but it does not have duration limit", entry);
3419 itemTemplate.
FlagsCu &= ~ITEM_FLAGS_CU_DURATION_REAL_TIME;
3424 }
while (result->NextRow());
3427 std::set<uint32> notFoundOutfit;
3436 if (entry->
ItemID[j] <= 0)
3442 notFoundOutfit.insert(item_id);
3446 for (std::set<uint32>::const_iterator itr = notFoundOutfit.begin(); itr != notFoundOutfit.end(); ++itr)
3447 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) does not exist in `item_template` but is referenced in `CharStartOutfit.dbc`", *itr);
3470 Field* fields = result->Fetch();
3473 std::string localeName = fields[1].
GetString();
3481 }
while (result->NextRow());
3492 std::set<uint32> itemSetItems;
3503 itemSetItems.insert(setEntry->
ItemID[i]);
3511 TC_LOG_INFO(
"server.loading",
">> Loaded 0 item set names. DB table `item_set_names` is empty.");
3520 Field* fields = result->Fetch();
3523 if (itemSetItems.find(entry) == itemSetItems.end())
3525 TC_LOG_ERROR(
"sql.sql",
"Item set name (Entry: {}) not found in ItemSet.dbc, data useless.", entry);
3535 TC_LOG_ERROR(
"sql.sql",
"Item set name (Entry: {}) has wrong InventoryType value ({})", entry, invType);
3540 itemSetItems.erase(entry);
3542 }
while (result->NextRow());
3544 if (!itemSetItems.empty())
3547 for (std::set<uint32>::iterator itr = itemSetItems.begin(); itr != itemSetItems.end(); ++itr)
3554 TC_LOG_ERROR(
"sql.sql",
"Item set part (Entry: {}) does not have entry in `item_set_names`, adding data from `item_template`.", entry);
3561 TC_LOG_ERROR(
"sql.sql",
"Item set part (Entry: {}) does not have entry in `item_set_names`, set will not display properly.", entry);
3577 QueryResult result =
WorldDatabase.Query(
"SELECT `entry`, `accessory_entry`, `seat_id`, `minion`, `summontype`, `summontimer` FROM `vehicle_template_accessory`");
3581 TC_LOG_INFO(
"server.loading",
">> Loaded 0 vehicle template accessories. DB table `vehicle_template_accessory` is empty.");
3587 Field* fields = result->Fetch();
3592 bool isMinion = fields[3].
GetBool();
3598 TC_LOG_ERROR(
"sql.sql",
"Table `vehicle_template_accessory`: creature template entry {} does not exist.", entry);
3602 if (!
sObjectMgr->GetCreatureTemplate(accessory))
3604 TC_LOG_ERROR(
"sql.sql",
"Table `vehicle_template_accessory`: Accessory {} does not exist.", accessory);
3610 TC_LOG_ERROR(
"sql.sql",
"Table `vehicle_template_accessory`: creature template entry {} has no data in npc_spellclick_spells", entry);
3618 while (result->NextRow());
3634 TC_LOG_INFO(
"server.loading",
">> Loaded 0 vehicle template. DB table `vehicle_template` is empty.");
3640 Field* fields = result->Fetch();
3644 if (!
sObjectMgr->GetCreatureTemplate(creatureId))
3646 TC_LOG_ERROR(
"sql.sql",
"Table `vehicle_template`: Vehicle {} does not exist.", creatureId);
3653 }
while (result->NextRow());
3667 QueryResult result =
WorldDatabase.Query(
"SELECT `guid`, `accessory_entry`, `seat_id`, `minion`, `summontype`, `summontimer` FROM `vehicle_accessory`");
3677 Field* fields = result->Fetch();
3681 int8 uiSeat =
int8(fields[2].GetInt16());
3682 bool bMinion = fields[3].
GetBool();
3686 if (!
sObjectMgr->GetCreatureTemplate(uiAccessory))
3688 TC_LOG_ERROR(
"sql.sql",
"Table `vehicle_accessory`: Accessory {} does not exist.", uiAccessory);
3696 while (result->NextRow());
3710 QueryResult result =
WorldDatabase.Query(
"SELECT `SeatEntry`, `SeatOrientation`, `ExitParamX`, `ExitParamY`, `ExitParamZ`, `ExitParamO`, `ExitParamValue` FROM `vehicle_seat_addon`");
3714 TC_LOG_ERROR(
"server.loading",
">> Loaded 0 vehicle seat addons. DB table `vehicle_seat_addon` is empty.");
3720 Field* fields = result->Fetch();
3723 float orientation = fields[1].
GetFloat();
3724 float exitX = fields[2].
GetFloat();
3725 float exitY = fields[3].
GetFloat();
3726 float exitZ = fields[4].
GetFloat();
3727 float exitO = fields[5].
GetFloat();
3732 TC_LOG_ERROR(
"sql.sql",
"Table `vehicle_seat_addon`: SeatID: {} does not exist in VehicleSeat.dbc. Skipping entry.", seatID);
3737 if (orientation >
float(
M_PI * 2))
3739 TC_LOG_ERROR(
"sql.sql",
"Table `vehicle_seat_addon`: SeatID: {} is using invalid angle offset value ({}). Set Value to 0.", seatID, orientation);
3745 TC_LOG_ERROR(
"sql.sql",
"Table `vehicle_seat_addon`: SeatID: {} is using invalid exit parameter value ({}). Setting to 0 (none).", seatID, exitParam);
3752 }
while (result->NextRow());
3762 QueryResult result =
WorldDatabase.Query(
"SELECT creature_entry, level, hp, mana, str, agi, sta, inte, spi, armor, min_dmg, max_dmg FROM pet_levelstats");
3766 TC_LOG_INFO(
"server.loading",
">> Loaded 0 level pet stats definitions. DB table `pet_levelstats` is empty.");
3774 Field* fields = result->Fetch();
3777 if (!
sObjectMgr->GetCreatureTemplate(creature_id))
3779 TC_LOG_ERROR(
"sql.sql",
"Wrong creature id {} in `pet_levelstats` table, ignoring.", creature_id);
3790 TC_LOG_INFO(
"misc",
"Unused (> MaxPlayerLevel in worldserver.conf) level {} in `pet_levelstats` table, ignoring.", current_level);
3795 else if (current_level < 1)
3797 TC_LOG_ERROR(
"sql.sql",
"Wrong (<1) level {} in `pet_levelstats` table, ignoring.", current_level);
3806 PetLevelInfo* pLevelInfo = &pInfoMapEntry[current_level - 1];
3819 while (result->NextRow());
3824 auto& pInfo = itr->second;
3827 if (!pInfo || pInfo[0].health == 0)
3829 TC_LOG_ERROR(
"sql.sql",
"Creature {} does not have pet stats data for Level 1!", itr->first);
3836 if (pInfo[level].health == 0)
3838 TC_LOG_ERROR(
"sql.sql",
"Creature {} has no data for Level {} pet stats data, using data of Level {}.", itr->first, level + 1, level);
3839 pInfo[level] = pInfo[level - 1];
3856 return &itr->second[level - 1];
3869 TC_LOG_ERROR(
"sql.sql",
"Invalid count {} specified on item {} be removed from original player create info (use -1)!", count, itemId);
3878 if (entry->ItemID[x] > 0 &&
uint32(entry->ItemID[x]) == itemId)
3887 TC_LOG_ERROR(
"sql.sql",
"Item {} specified to be removed from original create info not found in dbc!", itemId);
3899 QueryResult result =
WorldDatabase.Query(
"SELECT race, class, map, zone, position_x, position_y, position_z, orientation FROM playercreateinfo");
3903 TC_LOG_ERROR(
"server.loading",
">> Loaded 0 player create definitions. DB table `playercreateinfo` is empty.");
3912 Field* fields = result->Fetch();
3918 float positionX = fields[4].
GetFloat();
3919 float positionY = fields[5].
GetFloat();
3920 float positionZ = fields[6].
GetFloat();
3921 float orientation = fields[7].
GetFloat();
3925 TC_LOG_ERROR(
"sql.sql",
"Wrong race {} in `playercreateinfo` table, ignoring.", current_race);
3932 TC_LOG_ERROR(
"sql.sql",
"Wrong race {} in `playercreateinfo` table, ignoring.", current_race);
3938 TC_LOG_ERROR(
"sql.sql",
"Wrong class {} in `playercreateinfo` table, ignoring.", current_class);
3944 TC_LOG_ERROR(
"sql.sql",
"Wrong class {} in `playercreateinfo` table, ignoring.", current_class);
3951 TC_LOG_ERROR(
"sql.sql",
"Wrong home position for class {} race {} pair in `playercreateinfo` table, ignoring.", current_class, current_race);
3955 if (
sMapStore.LookupEntry(mapId)->Instanceable())
3957 TC_LOG_ERROR(
"sql.sql",
"Home position in instanceable map for class {} race {} pair in `playercreateinfo` table, ignoring.", current_class, current_race);
3961 std::unique_ptr<PlayerInfo> info = std::make_unique<PlayerInfo>();
3962 info->mapId = mapId;
3963 info->areaId = areaId;
3964 info->positionX = positionX;
3965 info->positionY = positionY;
3966 info->positionZ = positionZ;
3967 info->orientation = orientation;
3970 _playerInfo[current_race][current_class] = std::move(info);
3974 while (result->NextRow());
3981 TC_LOG_INFO(
"server.loading",
"Loading Player Create Items Data...");
3989 TC_LOG_INFO(
"server.loading",
">> Loaded 0 custom player create items. DB table `playercreateinfo_item` is empty.");
3997 Field* fields = result->Fetch();
4002 TC_LOG_ERROR(
"sql.sql",
"Wrong race {} in `playercreateinfo_item` table, ignoring.", current_race);
4009 TC_LOG_ERROR(
"sql.sql",
"Wrong class {} in `playercreateinfo_item` table, ignoring.", current_class);
4017 TC_LOG_ERROR(
"sql.sql",
"Item id {} (race {} class {}) in `playercreateinfo_item` table but not listed in `item_template`, ignoring.", item_id, current_race, current_class);
4025 TC_LOG_ERROR(
"sql.sql",
"Item id {} (class {} race {}) have amount == 0 in `playercreateinfo_item` table, ignoring.", item_id, current_race, current_class);
4029 if (!current_race || !current_class)
4031 uint32 min_race = current_race ? current_race : 1;
4033 uint32 min_class = current_class ? current_class : 1;
4035 for (
uint32 r = min_race; r < max_race; ++r)
4036 for (
uint32 c = min_class; c < max_class; ++c)
4044 while (result->NextRow());
4051 TC_LOG_INFO(
"server.loading",
"Loading Player Create Skill Data...");
4055 QueryResult result =
WorldDatabase.PQuery(
"SELECT raceMask, classMask, skill, `rank` FROM playercreateinfo_skills");
4059 TC_LOG_INFO(
"server.loading",
">> Loaded 0 player create skills. DB table `playercreateinfo_skills` is empty.");
4067 Field* fields = result->Fetch();
4076 TC_LOG_ERROR(
"sql.sql",
"Skill rank value {} set for skill {} raceMask {} classMask {} is too high, max allowed value is {}", skill.
Rank, skill.
SkillId, raceMask, classMask,
MAX_SKILL_STEP);
4082 TC_LOG_ERROR(
"sql.sql",
"Wrong race mask {} in `playercreateinfo_skills` table, ignoring.", raceMask);
4088 TC_LOG_ERROR(
"sql.sql",
"Wrong class mask {} in `playercreateinfo_skills` table, ignoring.", classMask);
4094 TC_LOG_ERROR(
"sql.sql",
"Wrong skill id {} in `playercreateinfo_skills` table, ignoring.", skill.
SkillId);
4100 if (raceMask == 0 || ((1 << (raceIndex - 1)) & raceMask))
4104 if (classMask == 0 || ((1 << (classIndex - 1)) & classMask))
4109 if (
auto& info =
_playerInfo[raceIndex][classIndex])
4111 info->skills.push_back(skill);
4118 }
while (result->NextRow());
4125 TC_LOG_INFO(
"server.loading",
"Loading Player Create Spell Data...");
4133 TC_LOG_INFO(
"server.loading",
">> Loaded 0 player create spells. DB table `playercreateinfo_spell_custom` is empty.");
4141 Field* fields = result->Fetch();
4148 TC_LOG_ERROR(
"sql.sql",
"Wrong race mask {} in `playercreateinfo_spell_custom` table, ignoring.", raceMask);
4154 TC_LOG_ERROR(
"sql.sql",
"Wrong class mask {} in `playercreateinfo_spell_custom` table, ignoring.", classMask);
4160 if (raceMask == 0 || ((1 << (raceIndex - 1)) & raceMask))
4164 if (classMask == 0 || ((1 << (classIndex - 1)) & classMask))
4166 if (
auto& info =
_playerInfo[raceIndex][classIndex])
4168 info->customSpells.push_back(spellId);
4180 while (result->NextRow());
4187 TC_LOG_INFO(
"server.loading",
"Loading Player Create Cast Spell Data...");
4194 TC_LOG_INFO(
"server.loading",
">> Loaded 0 player create cast spells. DB table `playercreateinfo_cast_spell` is empty.");
4201 Field* fields = result->Fetch();
4208 TC_LOG_ERROR(
"sql.sql",
"Wrong race mask {} in `playercreateinfo_cast_spell` table, ignoring.", raceMask);
4214 TC_LOG_ERROR(
"sql.sql",
"Wrong class mask {} in `playercreateinfo_cast_spell` table, ignoring.", classMask);
4220 if (raceMask == 0 || ((1 << (raceIndex - 1)) & raceMask))
4224 if (classMask == 0 || ((1 << (classIndex - 1)) & classMask))
4226 if (
auto& info =
_playerInfo[raceIndex][classIndex])
4228 info->castSpells.push_back(spellId);
4235 }
while (result->NextRow());
4242 TC_LOG_INFO(
"server.loading",
"Loading Player Create Action Data...");
4251 TC_LOG_INFO(
"server.loading",
">> Loaded 0 player create actions. DB table `playercreateinfo_action` is empty.");
4259 Field* fields = result->Fetch();
4264 TC_LOG_ERROR(
"sql.sql",
"Wrong race {} in `playercreateinfo_action` table, ignoring.", current_race);
4271 TC_LOG_ERROR(
"sql.sql",
"Wrong class {} in `playercreateinfo_action` table, ignoring.", current_class);
4275 if (
auto& info =
_playerInfo[current_race][current_class])
4276 info->action.push_back(
PlayerCreateInfoAction(fields[2].GetUInt16(), fields[3].GetUInt32(), fields[4].GetUInt16()));
4280 while (result->NextRow());
4287 TC_LOG_INFO(
"server.loading",
"Loading Player Create Level HP/Mana Data...");
4296 TC_LOG_ERROR(
"server.loading",
">> Loaded 0 level health/mana definitions. DB table `player_classlevelstats` is empty.");
4304 Field* fields = result->Fetch();
4309 TC_LOG_ERROR(
"sql.sql",
"Wrong class {} in `player_classlevelstats` table, ignoring.", current_class);
4316 TC_LOG_INFO(
"misc",
"Unused (> MaxPlayerLevel in worldserver.conf) level {} in `player_classlevelstats` table, ignoring.", current_level);
4324 info = std::make_unique<PlayerClassInfo>();
4334 while (result->NextRow());
4346 if (!pClassInfo || !pClassInfo->levelInfo || pClassInfo->levelInfo[0].basehealth == 0)
4348 TC_LOG_ERROR(
"sql.sql",
"Class {} Level 1 does not have health/mana data!", class_);
4355 if (pClassInfo->levelInfo[level].basehealth == 0)
4357 TC_LOG_ERROR(
"sql.sql",
"Class {} Level {} does not have health/mana data. Using stats data of level {}.", class_, level + 1, level);
4358 pClassInfo->levelInfo[level] = pClassInfo->levelInfo[level - 1];
4367 TC_LOG_INFO(
"server.loading",
"Loading Player Create Level Stats Data...");
4372 QueryResult result =
WorldDatabase.Query(
"SELECT race, class, level, str, agi, sta, inte, spi FROM player_levelstats");
4376 TC_LOG_ERROR(
"server.loading",
">> Loaded 0 level stats definitions. DB table `player_levelstats` is empty.");
4384 Field* fields = result->Fetch();
4389 TC_LOG_ERROR(
"sql.sql",
"Wrong race {} in `player_levelstats` table, ignoring.", current_race);
4396 TC_LOG_ERROR(
"sql.sql",
"Wrong class {} in `player_levelstats` table, ignoring.", current_class);
4407 TC_LOG_INFO(
"misc",
"Unused (> MaxPlayerLevel in worldserver.conf) level {} in `player_levelstats` table, ignoring.", current_level);
4413 if (
auto& info =
_playerInfo[current_race][current_class])
4415 if (!info->levelInfo)
4425 while (result->NextRow());
4453 if (!info->levelInfo || info->levelInfo[0].stats[0] == 0)
4455 TC_LOG_ERROR(
"sql.sql",
"Race {} Class {} Level 1 does not have stats data!", race, class_);
4462 if (info->levelInfo[level].stats[0] == 0)
4464 TC_LOG_ERROR(
"sql.sql",
"Race {} Class {} Level {} does not have stats data. Using stats data of level {}.", race, class_, level + 1, level);
4465 info->levelInfo[level] = info->levelInfo[level - 1];
4475 TC_LOG_INFO(
"server.loading",
"Loading Player Create XP Data...");
4488 TC_LOG_ERROR(
"server.loading",
">> Loaded 0 xp for level definitions. DB table `player_xp_for_level` is empty.");
4496 Field* fields = result->Fetch();
4507 TC_LOG_INFO(
"misc",
"Unused (> MaxPlayerLevel in worldserver.conf) level {} in `player_xp_for_levels` table, ignoring.", current_level);
4516 while (result->NextRow());
4523 TC_LOG_ERROR(
"sql.sql",
"Level {} does not have XP for level data. Using data of level [{}] + 100.", level + 1, level);
4542 *info = pInfo->levelInfo[level - 1];
4555 *info = pInfo->levelInfo[level - 1];
4646 "ID, QuestType, QuestLevel, MinLevel, QuestSortID, QuestInfoID, SuggestedGroupNum, TimeAllowed, AllowableRaces,"
4648 "RequiredFactionId1, RequiredFactionId2, RequiredFactionValue1, RequiredFactionValue2, "
4650 "RewardNextQuest, RewardXPDifficulty, RewardMoney, RewardBonusMoney, RewardDisplaySpell, RewardSpell, RewardHonor, RewardKillHonor, "
4652 "StartItem, Flags, RewardTitle, RequiredPlayerKills, RewardTalents, RewardArenaPoints, "
4654 "RewardItem1, RewardAmount1, RewardItem2, RewardAmount2, RewardItem3, RewardAmount3, RewardItem4, RewardAmount4, "
4656 "RewardChoiceItemID1, RewardChoiceItemQuantity1, RewardChoiceItemID2, RewardChoiceItemQuantity2, RewardChoiceItemID3, RewardChoiceItemQuantity3, RewardChoiceItemID4, RewardChoiceItemQuantity4, RewardChoiceItemID5, RewardChoiceItemQuantity5, RewardChoiceItemID6, RewardChoiceItemQuantity6, "
4658 "RewardFactionID1, RewardFactionValue1, RewardFactionOverride1, RewardFactionID2, RewardFactionValue2, RewardFactionOverride2, RewardFactionID3, RewardFactionValue3, RewardFactionOverride3, RewardFactionID4, RewardFactionValue4, RewardFactionOverride4, RewardFactionID5, RewardFactionValue5, RewardFactionOverride5,"
4660 "POIContinent, POIx, POIy, POIPriority, "
4662 "LogTitle, LogDescription, QuestDescription, AreaDescription, QuestCompletionLog, "
4664 "RequiredNpcOrGo1, RequiredNpcOrGo2, RequiredNpcOrGo3, RequiredNpcOrGo4, RequiredNpcOrGoCount1, RequiredNpcOrGoCount2, RequiredNpcOrGoCount3, RequiredNpcOrGoCount4, "
4666 "ItemDrop1, ItemDrop2, ItemDrop3, ItemDrop4, ItemDropQuantity1, ItemDropQuantity2, ItemDropQuantity3, ItemDropQuantity4, "
4668 "RequiredItemId1, RequiredItemId2, RequiredItemId3, RequiredItemId4, RequiredItemId5, RequiredItemId6, RequiredItemCount1, RequiredItemCount2, RequiredItemCount3, RequiredItemCount4, RequiredItemCount5, RequiredItemCount6, "
4670 "RewardFactionFlags, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4"
4671 " FROM quest_template");
4674 TC_LOG_INFO(
"server.loading",
">> Loaded 0 quests definitions. DB table `quest_template` is empty.");
4685 Field* fields = result->Fetch();
4688 auto itr =
_questTemplates.emplace(std::piecewise_construct, std::forward_as_tuple(questId), std::forward_as_tuple(
new Quest(fields))).first;
4689 itr->second->_weakRef = itr->second;
4690 }
while (result->NextRow());
4692 std::unordered_map<uint32, uint32> usedMailTemplates;
4694 struct QuestLoaderHelper
4696 typedef void(
Quest::*QuestLoaderFunction)(
Field* fields);
4698 char const* QueryFields;
4699 char const* TableName;
4700 char const* TableDesc;
4701 QuestLoaderFunction LoaderFunction;
4704 static std::vector<QuestLoaderHelper>
const QuestLoaderHelpers =
4707 {
"ID, Emote1, Emote2, Emote3, Emote4, EmoteDelay1, EmoteDelay2, EmoteDelay3, EmoteDelay4",
"quest_details",
"details", &
Quest::LoadQuestDetails },
4710 {
"ID, EmoteOnComplete, EmoteOnIncomplete, EmoteOnCompleteDelay, EmoteOnIncompleteDelay, CompletionText",
"quest_request_items",
"request items", &
Quest::LoadQuestRequestItems },
4713 {
"ID, Emote1, Emote2, Emote3, Emote4, EmoteDelay1, EmoteDelay2, EmoteDelay3, EmoteDelay4, RewardText",
"quest_offer_reward",
"reward emotes", &
Quest::LoadQuestOfferReward },
4716 {
"ID, MaxLevel, AllowableClasses, SourceSpellID, PrevQuestID, NextQuestID, ExclusiveGroup, BreadcrumbForQuestId, RewardMailTemplateID, RewardMailDelay,"
4718 " RequiredSkillID, RequiredSkillPoints, RequiredMinRepFaction, RequiredMaxRepFaction, RequiredMinRepValue, RequiredMaxRepValue, ProvidedItemCount, SpecialFlags",
"quest_template_addon",
"template addons", &
Quest::LoadQuestTemplateAddon },
4724 for (QuestLoaderHelper
const& loader : QuestLoaderHelpers)
4726 result =
WorldDatabase.PQuery(
"SELECT {} FROM {}", loader.QueryFields, loader.TableName);
4728 TC_LOG_INFO(
"server.loading",
">> Loaded 0 quest {}. DB table `{}` is empty.", loader.TableDesc, loader.TableName);
4733 Field* fields = result->Fetch();
4738 (itr->second.get()->*loader.LoaderFunction)(fields);
4740 TC_LOG_ERROR(
"server.loading",
"Table `{}` has data for quest {} but such quest does not exist", loader.TableName, questId);
4741 }
while (result->NextRow());
4752 Quest* qinfo = questPair.second.get();
4761 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `SpecialFlags` = {} > max allowed value. Correct `SpecialFlags` to value <= {}",
4768 TC_LOG_ERROR(
"sql.sql",
"Weekly Quest {} is marked as daily quest in `Flags`, removed daily flag.", qinfo->
GetQuestId());
4769 qinfo->
_flags &= ~QUEST_FLAGS_DAILY;
4776 TC_LOG_ERROR(
"sql.sql",
"Daily Quest {} not marked as repeatable in `SpecialFlags`, added.", qinfo->
GetQuestId());
4785 TC_LOG_ERROR(
"sql.sql",
"Weekly Quest {} not marked as repeatable in `SpecialFlags`, added.", qinfo->
GetQuestId());
4794 TC_LOG_ERROR(
"sql.sql",
"Monthly quest {} not marked as repeatable in `SpecialFlags`, added.", qinfo->
GetQuestId());
4806 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardChoiceItemId{}` = {} but item from `RewardChoiceItemId{}` can't be rewarded with quest flag QUEST_FLAGS_TRACKING.",
4818 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `QuestSortID` = {} (zone case) but zone with this id does not exist.",
4829 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `QuestSortID` = {} (sort case) but quest sort with this id does not exist.",
4838 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `QuestSortID` = {} but `RequiredSkillId` does not have a corresponding value ({}).",
4870 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredSkillId` = {} but this skill does not exist",
4879 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredSkillPoints` = {} but max possible skill is {}, quest can't be done.",
4888 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredFactionId2` = {} but faction template {} does not exist, quest can't be done.",
4895 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredFactionId1` = {} but faction template {} does not exist, quest can't be done.",
4902 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredMinRepFaction` = {} but faction template {} does not exist, quest can't be done.",
4909 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredMaxRepFaction` = {} but faction template {} does not exist, quest can't be done.",
4916 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredMinRepValue` = {} but max reputation is {}, quest can't be done.",
4923 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredMaxRepValue` = {} and `RequiredMinRepValue` = {}, quest can't be done.",
4930 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredFactionValue1` = {} but `RequiredFactionId1` is 0, value has no effect",
4937 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredFactionValue2` = {} but `RequiredFactionId2` is 0, value has no effect",
4944 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredMinRepValue` = {} but `RequiredMinRepFaction` is 0, value has no effect",
4951 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredMaxRepValue` = {} but `RequiredMaxRepFaction` is 0, value has no effect",
4958 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardTitleId` = {} but CharTitle Id {} does not exist, quest can't be rewarded with title.",
4968 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `StartItem` = {} but item with entry {} does not exist, quest can't be done.",
4974 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `StartItem` = {} but `StartItemCount` = 0, set to 1 but need fix in DB.",
4981 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `StartItem` = 0 but `StartItemCount` = {}, useless value.",
4991 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `SourceSpellid` = {} but spell {} doesn't exist, quest can't be done.",
4997 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `SourceSpellid` = {} but spell {} is broken, quest can't be done.",
5010 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredItemId{}` = {} but `RequiredItemCount{}` = 0, quest can't be done.",
5019 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredItemId{}` = {} but item with entry {} does not exist, quest can't be done.",
5026 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredItemId{}` = 0 but `RequiredItemCount{}` = {}, quest can't be done.",
5039 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `ItemDrop{}` = {} but item with entry {} does not exist, quest can't be done.",
5048 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `ItemDrop{}` = 0 but `ItemDropQuantity{}` = {}.",
5060 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredNpcOrGo{}` = {} but gameobject {} does not exist, quest can't be done.",
5065 if (
id > 0 && !
sObjectMgr->GetCreatureTemplate(
id))
5067 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredNpcOrGo{}` = {} but creature with entry {} does not exist, quest can't be done.",
5080 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredNpcOrGo{}` = {} but `RequiredNpcOrGoCount{}` = 0, quest can't be done.",
5087 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredNpcOrGo{}` = 0 but `RequiredNpcOrGoCount{}` = {}.",
5100 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardChoiceItemId{}` = {} but item with entry {} does not exist, quest will not reward this item.",
5107 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardChoiceItemId{}` = {} but `RewardChoiceItemCount{}` = 0, quest can't be done.",
5114 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardChoiceItemId{}` = 0 but `RewardChoiceItemCount{}` = {}.",
5127 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardItemId{}` = {} but item with entry {} does not exist, quest will not reward this item.",
5134 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardItemId{}` = {} but `RewardItemCount{}` = 0, quest will not reward this item.",
5141 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardItemId{}` = 0 but `RewardItemCount{}` = {}.",
5164 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardFactionId{}` = 0 but `RewardFactionValueIdOverride{}` = {}.",
5175 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardDisplaySpell` = {} but spell {} does not exist, spell removed as display reward.",
5182 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardDisplaySpell` = {} but spell {} is broken, quest will not have a spell reward.",
5189 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardDisplaySpell` = {} but spell {} is talent, quest will not have a spell reward.",
5200 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardSpell` = {} but spell {} does not exist, quest will not have a spell reward.",
5207 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardSpell` = {} but spell {} is broken, quest will not have a spell reward.",
5214 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardDisplaySpell` = {} but spell {} is talent, quest will not have a spell reward.",
5224 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardMailTemplateId` = {} but mail template {} does not exist, quest will not have a mail reward.",
5233 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardMailTemplateId` = {} but mail template {} already used for quest {}, quest will not have a mail reward.",
5247 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardNextQuest` = {} but quest {} does not exist, quest chain will not work.",
5259 else if (prevQuestItr->second->_breadcrumbForQuestId)
5260 TC_LOG_ERROR(
"sql.sql",
"Quest {} should not be unlocked by breadcrumb quest {}", qinfo->
_id, prevQuestId);
5271 nextQuestItr->second->DependentPreviousQuests.push_back(qinfo->
GetQuestId());
5278 TC_LOG_ERROR(
"sql.sql",
"Quest {} is a breadcrumb for quest {}, but no such quest exists", qinfo->
_id, breadcrumbForQuestId);
5295 bool addFlag =
true;
5320 Quest* qinfo = questPair.second.get();
5323 std::set<uint32> questSet;
5325 while(breadcrumbForQuestId)
5329 if (!questSet.insert(qinfo->
_id).second)
5331 TC_LOG_ERROR(
"sql.sql",
"Breadcrumb quests {} and {} are in a loop", qid, breadcrumbForQuestId);
5336 qinfo =
const_cast<Quest*
>(
sObjectMgr->GetQuestTemplate(breadcrumbForQuestId));
5357 uint32 quest_id = spellEffectInfo.MiscValue;
5367 TC_LOG_ERROR(
"sql.sql",
"Spell (id: {}) have SPELL_EFFECT_QUEST_COMPLETE for quest {}, but quest not have flag QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT. Quest flags must be fixed, quest modified to enable objective.", spellInfo->
Id, quest_id);
5380 TC_LOG_INFO(
"server.loading",
"Loading GO Start Quest Data...");
5382 TC_LOG_INFO(
"server.loading",
"Loading GO End Quest Data...");
5384 TC_LOG_INFO(
"server.loading",
"Loading Creature Start Quest Data...");
5386 TC_LOG_INFO(
"server.loading",
"Loading Creature End Quest Data...");
5399 "LogTitle, LogDescription, QuestDescription, AreaDescription, QuestCompletionLog, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4"
5400 " FROM quest_template_locale");
5406 Field* fields = result->Fetch();
5409 std::string localeName = fields[1].
GetString();
5424 }
while (result->NextRow());
5438 if (tableName.empty())
5441 if (
sMapMgr->IsScriptScheduled())
5444 TC_LOG_INFO(
"server.loading",
"Loading {}...", tableName);
5449 QueryResult result =
WorldDatabase.PQuery(
"SELECT id, delay, command, datalong, datalong2, dataint, x, y, z, o FROM {}", tableName);
5453 TC_LOG_INFO(
"server.loading",
">> Loaded 0 script definitions. DB table `{}` is empty!", tableName);
5461 Field* fields = result->Fetch();
5482 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has invalid talk type (datalong = {}) in SCRIPT_COMMAND_TALK for script id {}",
5488 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has invalid talk text id (dataint = {}) in SCRIPT_COMMAND_TALK for script id {}",
5500 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has invalid emote id (datalong = {}) in SCRIPT_COMMAND_EMOTE for script id {}",
5511 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has invalid map (Id: {}) in SCRIPT_COMMAND_TELEPORT_TO for script id {}",
5518 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has invalid coordinates (X: {} Y: {} Z: {} O: {}) in SCRIPT_COMMAND_TELEPORT_TO for script id {}",
5530 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has invalid quest (ID: {}) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id {}",
5537 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has quest (ID: {}) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id {}, but quest not have flag QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT in quest flags. Script command or quest flags wrong. Quest modified to require objective.",
5548 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has too large distance ({}) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id {}",
5555 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has too large distance ({}) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id {}, max distance is {} or 0 for disable distance check",
5562 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has too small distance ({}) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id {}, min distance is {} or 0 for disable distance check",
5574 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has invalid creature (Entry: {}) in SCRIPT_COMMAND_KILL_CREDIT for script id {}",
5586 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has invalid gameobject (GUID: {}) in SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id {}",
5594 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has gameobject with invalid entry (GUID: {} Entry: {}) in SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id {}",
5605 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has gameobject type ({}) unsupported by command SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id {}",
5606 tableName, info->
entry, tmp.
id);
5616 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has invalid coordinates (X: {} Y: {} Z: {} O: {}) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id {}",
5623 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has invalid creature (Entry: {}) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id {}",
5636 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has invalid gameobject (GUID: {}) in {} for script id {}",
5644 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has gameobject with invalid entry (GUID: {} Entry: {}) in {} for script id {}",
5651 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has gameobject type ({}) unsupported by command {} for script id {}",
5663 TC_LOG_ERROR(
"sql.sql",
"Table `{}` using non-existent spell (id: {}) in SCRIPT_COMMAND_REMOVE_AURA for script id {}",
5669 TC_LOG_ERROR(
"sql.sql",
"Table `{}` using unknown flags in datalong2 ({}) in SCRIPT_COMMAND_REMOVE_AURA for script id {}",
5680 TC_LOG_ERROR(
"sql.sql",
"Table `{}` using non-existent spell (id: {}) in SCRIPT_COMMAND_CAST_SPELL for script id {}",
5686 TC_LOG_ERROR(
"sql.sql",
"Table `{}` using unknown target in datalong2 ({}) in SCRIPT_COMMAND_CAST_SPELL for script id {}",
5692 TC_LOG_ERROR(
"sql.sql",
"Table `{}` using unknown flags in dataint ({}) in SCRIPT_COMMAND_CAST_SPELL for script id {}",
5698 TC_LOG_ERROR(
"sql.sql",
"Table `{}` using invalid creature entry in dataint ({}) in SCRIPT_COMMAND_CAST_SPELL for script id {}",
5709 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has nonexistent item (entry: {}) in SCRIPT_COMMAND_CREATE_ITEM for script id {}",
5715 TC_LOG_ERROR(
"sql.sql",
"Table `{}` SCRIPT_COMMAND_CREATE_ITEM but amount is {} for script id {}",
5725 if (scripts->find(tmp.
id) == scripts->end())
5728 (*scripts)[tmp.
id] = emptyMap;
5730 (*scripts)[tmp.
id].insert(std::pair<uint32, ScriptInfo>(tmp.
delay, tmp));
5734 while (result->NextRow());
5743 std::set<uint32> evt_scripts;
5746 if (
uint32 eventId = gameObjectTemplatePair.second.GetEventScriptId())
5747 evt_scripts.insert(eventId);
5754 if (spellEffectInfo.MiscValue)
5755 evt_scripts.insert(spellEffectInfo.MiscValue);
5774 std::set<uint32>::const_iterator itr2 = evt_scripts.find(itr->first);
5775 if (itr2 == evt_scripts.end())
5776 TC_LOG_ERROR(
"sql.sql",
"Table `event_scripts` has script (Id: {}) not referring to any gameobject_template type 10 data2 field, type 3 data6 field, type 13 data 2 field or any spell effect {}",
5786 std::set<uint32> actionSet;
5789 actionSet.insert(itr->first);
5798 Field* fields = result->Fetch();
5801 actionSet.erase(action);
5803 while (result->NextRow());
5806 for (std::set<uint32>::iterator itr = actionSet.begin(); itr != actionSet.end(); ++itr)
5807 TC_LOG_ERROR(
"sql.sql",
"There is no waypoint which links to the waypoint script {}", *itr);
5820 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell script names. DB table `spell_script_names` is empty!");
5829 Field* fields = result->Fetch();
5832 std::string
const scriptName = fields[1].
GetString();
5834 bool allRanks =
false;
5844 TC_LOG_ERROR(
"sql.sql",
"Scriptname: `{}` spell (Id: {}) does not exist.", scriptName, fields[0].GetInt32());
5851 TC_LOG_ERROR(
"sql.sql",
"Scriptname: `{}` spell (Id: {}) has no ranks of spell.", scriptName, fields[0].GetInt32());
5855 TC_LOG_ERROR(
"sql.sql",
"Scriptname: `{}` spell (Id: {}) is not first rank of spell.", scriptName, fields[0].GetInt32());
5868 TC_LOG_ERROR(
"sql.sql",
"Scriptname: `{}` spell (Id: {}) is ranked spell. Perhaps not all ranks are assigned to this script.", scriptName, spellId);
5875 while (result->NextRow());
5886 TC_LOG_INFO(
"server.loading",
">> Validated 0 scripts.");
5896 auto const bounds =
sObjectMgr->GetSpellScriptsBounds(spell.first);
5898 for (
auto itr = bounds.first; itr != bounds.second; ++itr)
5904 std::unique_ptr<SpellScript> spellScript(spellScriptLoader->GetSpellScript());
5905 std::unique_ptr<AuraScript> auraScript(spellScriptLoader->GetAuraScript());
5907 if (!spellScript && !auraScript)
5909 TC_LOG_ERROR(
"scripts",
"Functions GetSpellScript() and GetAuraScript() of script `{}` do not return objects - script skipped",
GetScriptName(itr->second.first));
5911 itr->second.second =
false;
5917 spellScript->_Init(&spellScriptLoader->GetName(), spellEntry->
Id);
5918 spellScript->_Register();
5920 if (!spellScript->_Validate(spellEntry))
5922 itr->second.second =
false;
5929 auraScript->_Init(&spellScriptLoader->GetName(), spellEntry->
Id);
5930 auraScript->_Register();
5932 if (!auraScript->_Validate(spellEntry))
5934 itr->second.second =
false;
5940 itr->second.second =
true;
5943 itr->second.second =
false;
5959 TC_LOG_INFO(
"server.loading",
">> Loaded 0 page texts. DB table `page_text` is empty!");
5966 Field* fields = result->Fetch();
5975 while (result->NextRow());
5979 if (itr->second.NextPageID)
5981 PageTextContainer::const_iterator itr2 =
_pageTextStore.find(itr->second.NextPageID);
5983 TC_LOG_ERROR(
"sql.sql",
"Page text (ID: {}) has non-existing `NextPageID` ({})", itr->first, itr->second.NextPageID);
5993 PageTextContainer::const_iterator itr =
_pageTextStore.find(pageEntry);
5995 return &(itr->second);
6014 Field* fields = result->Fetch();
6017 std::string localeName = fields[1].
GetString();
6025 }
while (result->NextRow());
6039 TC_LOG_INFO(
"server.loading",
">> Loaded 0 instance templates. DB table `page_text` is empty!");
6046 Field* fields = result->Fetch();
6052 TC_LOG_ERROR(
"sql.sql",
"ObjectMgr::LoadInstanceTemplate: bad mapid {} for template!", mapID);
6059 instanceTemplate.
Parent =
uint32(fields[1].GetUInt16());
6066 while (result->NextRow());
6075 return &(itr->second);
6085 QueryResult result =
WorldDatabase.Query(
"SELECT entry, creditType, creditEntry, lastEncounterDungeon FROM instance_encounters");
6088 TC_LOG_INFO(
"server.loading",
">> Loaded 0 instance encounters, table is empty!");
6093 std::map<uint32, DungeonEncounterEntry const*> dungeonLastBosses;
6096 Field* fields = result->Fetch();
6102 if (!dungeonEncounter)
6104 TC_LOG_ERROR(
"sql.sql",
"Table `instance_encounters` has an invalid encounter id {}, skipped!", entry);
6108 if (lastEncounterDungeon && !
sLFGMgr->GetLFGDungeonEntry(lastEncounterDungeon))
6110 TC_LOG_ERROR(
"sql.sql",
"Table `instance_encounters` has an encounter {} ({}) marked as final for invalid dungeon id {}, skipped!", entry, dungeonEncounter->
Name[0], lastEncounterDungeon);
6114 auto itr = dungeonLastBosses.find(lastEncounterDungeon);
6115 if (lastEncounterDungeon)
6117 if (itr != dungeonLastBosses.end())
6119 TC_LOG_ERROR(
"sql.sql",
"Table `instance_encounters` specified encounter {} ({}) as last encounter but {} ({}) is already marked as one, skipped!", entry, dungeonEncounter->
Name[0], itr->second->ID, itr->second->Name[0]);
6123 dungeonLastBosses[lastEncounterDungeon] = dungeonEncounter;
6133 TC_LOG_ERROR(
"sql.sql",
"Table `instance_encounters` has an invalid creature (entry {}) linked to the encounter {} ({}), skipped!", creditEntry, entry, dungeonEncounter->
Name[0]);
6148 if (!
sSpellMgr->GetSpellInfo(creditEntry))
6150 TC_LOG_ERROR(
"sql.sql",
"Table `instance_encounters` has an invalid spell (entry {}) linked to the encounter {} ({}), skipped!", creditEntry, entry, dungeonEncounter->
Name[0]);
6155 TC_LOG_ERROR(
"sql.sql",
"Table `instance_encounters` has an invalid credit type ({}) for encounter {} ({}), skipped!", creditType, entry, dungeonEncounter->
Name[0]);
6160 encounters.emplace_back(std::make_unique<DungeonEncounter>(dungeonEncounter,
EncounterCreditType(creditType), creditEntry, lastEncounterDungeon));
6162 }
while (result->NextRow());
6171 return &itr->second;
6180 "text0_0, text0_1, BroadcastTextID0, lang0, Probability0, EmoteDelay0_0, Emote0_0, EmoteDelay0_1, Emote0_1, EmoteDelay0_2, Emote0_2, "
6181 "text1_0, text1_1, BroadcastTextID1, lang1, Probability1, EmoteDelay1_0, Emote1_0, EmoteDelay1_1, Emote1_1, EmoteDelay1_2, Emote1_2, "
6182 "text2_0, text2_1, BroadcastTextID2, lang2, Probability2, EmoteDelay2_0, Emote2_0, EmoteDelay2_1, Emote2_1, EmoteDelay2_2, Emote2_2, "
6183 "text3_0, text3_1, BroadcastTextID3, lang3, Probability3, EmoteDelay3_0, Emote3_0, EmoteDelay3_1, Emote3_1, EmoteDelay3_2, Emote3_2, "
6184 "text4_0, text4_1, BroadcastTextID4, lang4, Probability4, EmoteDelay4_0, Emote4_0, EmoteDelay4_1, Emote4_1, EmoteDelay4_2, Emote4_2, "
6185 "text5_0, text5_1, BroadcastTextID5, lang5, Probability5, EmoteDelay5_0, Emote5_0, EmoteDelay5_1, Emote5_1, EmoteDelay5_2, Emote5_2, "
6186 "text6_0, text6_1, BroadcastTextID6, lang6, Probability6, EmoteDelay6_0, Emote6_0, EmoteDelay6_1, Emote6_1, EmoteDelay6_2, Emote6_2, "
6187 "text7_0, text7_1, BroadcastTextID7, lang7, Probability7, EmoteDelay7_0, Emote7_0, EmoteDelay7_1, Emote7_1, EmoteDelay7_2, Emote7_2 "
6192 TC_LOG_INFO(
"server.loading",
">> Loaded 0 npc texts, table is empty!");
6206 Field* fields = result->Fetch();
6211 TC_LOG_ERROR(
"sql.sql",
"Table `npc_text` has record with reserved id 0, ignore.");
6238 TC_LOG_ERROR(
"sql.sql",
"Row {} in table `npc_text` has mismatch between text{}_0 and the corresponding Text in `broadcast_text` row {}",
id, i, gOption.
BroadcastTextID);
6240 TC_LOG_ERROR(
"sql.sql",
"Row {} in table `npc_text` has mismatch between text{}_1 and the corresponding Text1 in `broadcast_text` row {}",
id, i, gOption.
BroadcastTextID);
6244 TC_LOG_ERROR(
"sql.sql",
"GossipText (Id: {}) in table `npc_text` has non-existing or incompatible BroadcastTextID{} {}.",
id, i, gOption.
BroadcastTextID);
6252 while (result->NextRow());
6265 "Text0_0, Text0_1, Text1_0, Text1_1, Text2_0, Text2_1, Text3_0, Text3_1, Text4_0, Text4_1, Text5_0, Text5_1, Text6_0, Text6_1, Text7_0, Text7_1 "
6266 "FROM npc_text_locale");
6273 Field* fields = result->Fetch();
6276 std::string localeName = fields[1].
GetString();
6288 }
while (result->NextRow());
6300 localtime_r(&curTime, <);
6301 uint64 basetime(curTime);
6302 TC_LOG_INFO(
"misc",
"Returning mails current time: hour: {}, minute: {}, second: {} ", lt.tm_hour, lt.tm_min, lt.tm_sec);
6316 TC_LOG_INFO(
"server.loading",
">> No expired mails found.");
6328 Field* fields = items->Fetch();
6332 itemsCache[mailId].push_back(item);
6333 }
while (items->NextRow());
6337 uint32 returnedCount = 0;
6340 Field* fields = result->Fetch();
6350 bool has_items = fields[4].
GetBool();
6367 for (MailItemInfoVec::iterator itr2 = m->
items.begin(); itr2 != m->
items.end(); ++itr2)
6389 for (MailItemInfoVec::iterator itr2 = m->
items.begin(); itr2 != m->
items.end(); ++itr2)
6414 while (result->NextRow());
6416 TC_LOG_INFO(
"server.loading",
">> Processed {} expired mails: {} deleted and {} returned in {} ms", deletedCount + returnedCount, deletedCount, returnedCount,
GetMSTimeDiffToNow(oldMSTime));
6429 TC_LOG_INFO(
"server.loading",
">> Loaded 0 quest trigger points. DB table `areatrigger_involvedrelation` is empty.");
6439 Field* fields = result->Fetch();
6447 TC_LOG_ERROR(
"sql.sql",
"Area trigger (ID:{}) does not exist in `AreaTrigger.dbc`.", trigger_ID);
6455 TC_LOG_ERROR(
"sql.sql",
"Table `areatrigger_involvedrelation` has record (id: {}) for not existing quest {}", trigger_ID, quest_ID);
6461 TC_LOG_ERROR(
"sql.sql",
"Table `areatrigger_involvedrelation` has record (id: {}) for not quest {}, but quest not have flag QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT. Trigger or quest flags must be fixed, quest modified to require objective.", trigger_ID, quest_ID);
6471 }
while (result->NextRow());
6482 auto questItr = itr->second.find(guid.
GetEntry());
6483 if (questItr == itr->second.end())
6486 return &questItr->second;
6496 QueryResult result =
WorldDatabase.Query(
"SELECT ID, Type, GreetEmoteType, GreetEmoteDelay, Greeting FROM quest_greeting");
6499 TC_LOG_INFO(
"server.loading",
">> Loaded 0 quest greetings. DB table `quest_greeting` is empty.");
6509 Field* fields = result->Fetch();
6520 TC_LOG_ERROR(
"sql.sql",
"Table `quest_greeting`: creature template (entry: {}) does not exist.",
id);
6528 TC_LOG_ERROR(
"sql.sql",
"Table `quest_greeting`: gameobject template (entry: {}) does not exist.",
id);
6533 TC_LOG_ERROR(
"sql.sql",
"Table `quest_greeting`: unknown type = {} for entry = {}. Skipped.", type,
id);
6539 if (greetEmoteType > 0 && !
sEmotesStore.LookupEntry(greetEmoteType))
6541 TC_LOG_DEBUG(
"sql.sql",
"Table `quest_greeting`: entry {} has greetEmoteType = {} but emote does not exist. Set to 0.",
id, greetEmoteType);
6546 std::string greeting = fields[4].
GetString();
6552 while (result->NextRow());
6567 TC_LOG_INFO(
"server.loading",
">> Loaded 0 quest_greeting locales. DB table `quest_greeting_locale` is empty.");
6573 Field* fields = result->Fetch();
6590 std::string localeName = fields[2].
GetString();
6598 }
while (result->NextRow());
6615 Field* fields = result->Fetch();
6618 std::string localeName = fields[1].
GetString();
6626 }
while (result->NextRow());
6643 Field* fields = result->Fetch();
6646 std::string localeName = fields[1].
GetString();
6654 }
while (result->NextRow());
6669 TC_LOG_INFO(
"server.loading",
">> Loaded 0 tavern triggers. DB table `areatrigger_tavern` is empty.");
6679 Field* fields = result->Fetch();
6686 TC_LOG_ERROR(
"sql.sql",
"Area trigger (ID:{}) does not exist in `AreaTrigger.dbc`.", Trigger_ID);
6691 }
while (result->NextRow());
6705 TC_LOG_INFO(
"server.loading",
">> Loaded 0 areatrigger scripts. DB table `areatrigger_scripts` is empty.");
6711 Field* fields = result->Fetch();
6714 std::string
const scriptName = fields[1].
GetString();
6719 TC_LOG_ERROR(
"sql.sql",
"AreaTrigger (ID: {}) does not exist in `AreaTrigger.dbc`.", triggerId);
6724 while (result->NextRow());
6749 float dist2 = (node->
Pos.
X - x)*(node->
Pos.
X - x)+(node->
Pos.
Y - y)*(node->
Pos.
Y - y)+(node->
Pos.
Z - z)*(node->
Pos.
Z - z);
6781 TaxiPathSetForSource::iterator dest_i = pathSet.find(destination);
6782 if (dest_i == pathSet.end())
6789 cost = dest_i->second.price;
6790 path = dest_i->second.ID;
6809 if (mount_entry == 0 && allowed_alt_team)
6821 TC_LOG_ERROR(
"sql.sql",
"No displayid found for the taxi mount with the entry {}! Can't load it!", mount_entry);
6850 TC_LOG_INFO(
"server.loading",
">> Loaded 0 graveyard-zone links. DB table `graveyard_zone` is empty.");
6860 Field* fields = result->Fetch();
6869 TC_LOG_ERROR(
"sql.sql",
"Table `graveyard_zone` has a record for non-existing graveyard (WorldSafeLocsID: {}), skipped.", safeLocId);
6876 TC_LOG_ERROR(
"sql.sql",
"Table `graveyard_zone` has a record for non-existing Zone (ID: {}), skipped.", zoneId);
6882 TC_LOG_ERROR(
"sql.sql",
"Table `graveyard_zone` has a record for SubZone (ID: {}) instead of zone, skipped.", zoneId);
6888 TC_LOG_ERROR(
"sql.sql",
"Table `graveyard_zone` has a record for non player faction ({}), skipped.", team);
6893 TC_LOG_ERROR(
"sql.sql",
"Table `graveyard_zone` has a duplicate record for Graveyard (ID: {}) and Zone (ID: {}), skipped.", safeLocId, zoneId);
6894 }
while (result->NextRow());
6901 enum DefaultGraveyard
6903 HORDE_GRAVEYARD = 10,
6904 ALLIANCE_GRAVEYARD = 4
6911 else return nullptr;
6923 TC_LOG_ERROR(
"misc",
"ZoneId not found for map {} coords ({}, {}, {}), object name: {} {}", MapId, x, y, z,
6943 TC_LOG_ERROR(
"sql.sql",
"Table `graveyard_zone` incomplete: Zone {} Team {} does not have a linked graveyard.", zoneId, team);
6948 bool foundNear =
false;
6949 float distNear = 10000;
6953 bool foundEntr =
false;
6954 float distEntr = 10000;
6962 for (; range.first != range.second; ++range.first)
6969 TC_LOG_ERROR(
"sql.sql",
"Table `graveyard_zone` has record for not existing graveyard (WorldSafeLocsID {}), skipped.", data.
safeLocId);
6975 if (data.
team != 0 && team != 0 && data.
team != team)
6997 if (dist2 < distEntr)
7013 float dist2 = (entry->
Loc.
X - x)*(entry->
Loc.
X - x)+(entry->
Loc.
Y - y)*(entry->
Loc.
Y - y)+(entry->
Loc.
Z - z)*(entry->
Loc.
Z - z);
7016 if (dist2 < distNear)
7043 for (; range.first != range.second; ++range.first)
7056 return &itr->second;
7064 return itr->second.get();
7078 GraveyardStore.insert(GraveyardContainer::value_type(zoneId, data));
7098 if (range.first == range.second)
7106 for (; range.first != range.second; ++range.first)
7116 if (data.
team != 0 && team != 0 && data.
team != team)
7150 QueryResult result =
WorldDatabase.Query(
"SELECT ID, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM areatrigger_teleport");
7153 TC_LOG_INFO(
"server.loading",
">> Loaded 0 area trigger teleport definitions. DB table `areatrigger_teleport` is empty.");
7161 Field* fields = result->Fetch();
7170 TC_LOG_ERROR(
"sql.sql",
"Area trigger (ID:{}) does not exist in `AreaTrigger.dbc`.", Trigger_ID);
7185 TC_LOG_ERROR(
"sql.sql",
"Area trigger (ID:{}) target map (ID: {}) does not exist in `Map.dbc`.", Trigger_ID, at.
target_mapId);
7191 TC_LOG_ERROR(
"sql.sql",
"Area trigger (ID:{}) target coordinates not provided.", Trigger_ID);
7197 }
while (result->NextRow());
7209 QueryResult result =
WorldDatabase.Query(
"SELECT mapid, difficulty, level_min, level_max, item_level, item, item2, quest_done_A, quest_done_H, completed_achievement, quest_failed_text FROM access_requirement");
7213 TC_LOG_INFO(
"server.loading",
">> Loaded 0 access requirement definitions. DB table `access_requirement` is empty.");
7221 Field* fields = result->Fetch();
7230 ar = std::make_unique<AccessRequirement>();
7232 ar->levelMin = fields[2].
GetUInt8();
7233 ar->levelMax = fields[3].
GetUInt8();
7239 ar->achievement = fields[9].
GetUInt32();
7240 ar->questFailedText = fields[10].
GetString();
7247 TC_LOG_ERROR(
"misc",
"Key item {} does not exist for map {} difficulty {}, removing key requirement.", ar->item, mapid, difficulty);
7257 TC_LOG_ERROR(
"misc",
"Second item {} does not exist for map {} difficulty {}, removing key requirement.", ar->item2, mapid, difficulty);
7266 TC_LOG_ERROR(
"sql.sql",
"Required Alliance Quest {} not exist for map {} difficulty {}, remove quest done requirement.", ar->quest_A, mapid, difficulty);
7275 TC_LOG_ERROR(
"sql.sql",
"Required Horde Quest {} not exist for map {} difficulty {}, remove quest done requirement.", ar->quest_H, mapid, difficulty);
7280 if (ar->achievement)
7284 TC_LOG_ERROR(
"sql.sql",
"Required Achievement {} not exist for map {} difficulty {}, remove quest done requirement.", ar->achievement, mapid, difficulty);
7285 ar->achievement = 0;
7288 }
while (result->NextRow());
7298 bool useParentDbValue =
false;
7311 parentId = iTemplate->
Parent;
7312 useParentDbValue =
true;
7317 if ((!useParentDbValue && itr->second.target_mapId == entrance_map) || (useParentDbValue && itr->second.target_mapId == parentId))
7321 return &itr->second;
7333 if (itr->second.target_mapId ==
Map)
7337 return &itr->second;
7347 GetGenerator<HighGuid::Player>().Set((*result)[0].GetUInt32() + 1);
7351 GetGenerator<HighGuid::Item>().Set((*result)[0].GetUInt32() + 1);
7354 CharacterDatabase.PExecute(
"DELETE FROM character_inventory WHERE item >= '{}'", GetGenerator<HighGuid::Item>().GetNextAfterMaxUsed());
7355 CharacterDatabase.PExecute(
"DELETE FROM mail_items WHERE item_guid >= '{}'", GetGenerator<HighGuid::Item>().GetNextAfterMaxUsed());
7356 CharacterDatabase.PExecute(
"DELETE a, ab FROM auctionhouse a LEFT JOIN auctionbidders ab ON ab.id = a.id WHERE itemguid >= '{}'",
7357 GetGenerator<HighGuid::Item>().GetNextAfterMaxUsed());
7358 CharacterDatabase.PExecute(
"DELETE FROM guild_bank_item WHERE item_guid >= '{}'", GetGenerator<HighGuid::Item>().GetNextAfterMaxUsed());
7360 result =
WorldDatabase.Query(
"SELECT MAX(guid) FROM transports");
7362 GetGenerator<HighGuid::Mo_Transport>().Set((*result)[0].GetUInt32() + 1);
7370 _mailId = (*result)[0].GetUInt32()+1;
7374 sArenaTeamMgr->SetNextArenaTeamId((*result)[0].GetUInt32()+1);
7376 result =
CharacterDatabase.Query(
"SELECT MAX(setguid) FROM character_equipmentsets");
7382 sGuildMgr->SetNextGuildId((*result)[0].GetUInt32()+1);
7386 sGroupMgr->SetGroupDbStoreSize((*result)[0].GetUInt32()+1);
7388 result =
WorldDatabase.Query(
"SELECT MAX(guid) FROM creature");
7392 result =
WorldDatabase.Query(
"SELECT MAX(guid) FROM gameobject");
7401 itr =
_guidGenerators.insert(std::make_pair(high, std::make_unique<ObjectGuidGenerator>(high))).first;
7403 return *itr->second;
7410 TC_LOG_ERROR(
"misc",
"Auctions ids overflow!! Can't continue, shutting down server. Search on forum for TCE00007 for more info. ");
7420 TC_LOG_ERROR(
"misc",
"EquipmentSet guid overflow!! Can't continue, shutting down server. Search on forum for TCE00007 for more info. ");
7430 TC_LOG_ERROR(
"misc",
"Mail ids overflow!! Can't continue, shutting down server. Search on forum for TCE00007 for more info. ");
7440 TC_LOG_ERROR(
"misc",
"_hiPetNumber Id overflow!! Can't continue, shutting down server. Search on forum for TCE00007 for more info.");
7450 TC_LOG_ERROR(
"misc",
"Creature spawn id overflow!! Can't continue, shutting down server. Search on forum for TCE00007 for more info.");
7460 TC_LOG_ERROR(
"misc",
"GameObject spawn id overflow!! Can't continue, shutting down server. Search on forum for TCE00007 for more info. ");
7473 QueryResult result =
WorldDatabase.Query(
"SELECT entry, locale, name, castBarCaption FROM gameobject_template_locale");
7479 Field* fields = result->Fetch();
7482 std::string localeName = fields[1].
GetString();
7491 }
while (result->NextRow());
7501 TC_LOG_ERROR(
"sql.sql",
"Gameobject (Entry: {} GoType: {}) have data{}={} but lock (Id: {}) not found.",
7510 TC_LOG_ERROR(
"sql.sql",
"Gameobject (Entry: {} GoType: {}) have data{}={} but GO (Entry {}) have not GAMEOBJECT_TYPE_TRAP ({}) type.",
7520 TC_LOG_ERROR(
"sql.sql",
"Gameobject (Entry: {} GoType: {}) have data{}={} but Spell (Entry {}) not exist.",
7521 goInfo->
entry, goInfo->
type, N, dataN, dataN);
7529 TC_LOG_ERROR(
"sql.sql",
"Gameobject (Entry: {} GoType: {}) have data{}={} but correct chair height in range 0..{}.",
7542 TC_LOG_ERROR(
"sql.sql",
"Gameobject (Entry: {} GoType: {}) have data{}={} but expected boolean (0/1) noDamageImmune field value.", goTemplate->
entry, goTemplate->
type, N, dataN);
7551 TC_LOG_ERROR(
"sql.sql",
"Gameobject (Entry: {} GoType: {}) have data{}={} but expected boolean (0/1) consumable field value.",
7560 QueryResult result =
WorldDatabase.Query(
"SELECT entry, type, displayId, name, IconName, castBarCaption, unk1, size, "
7562 "Data0, Data1, Data2, Data3, Data4, Data5, Data6, Data7, Data8, Data9, Data10, Data11, Data12, "
7564 "Data13, Data14, Data15, Data16, Data17, Data18, Data19, Data20, Data21, Data22, Data23, AIName, ScriptName, StringId "
7565 "FROM gameobject_template");
7569 TC_LOG_INFO(
"server.loading",
">> Loaded 0 gameobject definitions. DB table `gameobject_template` is empty.");
7576 Field* fields = result->Fetch();
7600 TC_LOG_ERROR(
"sql.sql",
"GameObject (Entry: {}) has non-registered `AIName` '{}' set, removing", got.
entry, got.
AIName);
7652 TC_LOG_ERROR(
"sql.sql",
"GameObject (Entry: {} GoType: {}) have data0={} but SpellFocus (Id: {}) not exist.",
7670 TC_LOG_ERROR(
"sql.sql",
"GameObject (Entry: {} GoType: {}) have data7={} but PageText (Entry {}) not exist.",
7695 TC_LOG_ERROR(
"sql.sql",
"GameObject (Entry: {} GoType: {}) have data0={} but TaxiPath (Id: {}) not exist.",
7734 }
while (result->NextRow());
7744 QueryResult result =
WorldDatabase.Query(
"SELECT entry, faction, flags, mingold, maxgold, artkit0, artkit1, artkit2, artkit3 FROM gameobject_template_addon");
7748 TC_LOG_INFO(
"server.loading",
">> Loaded 0 gameobject template addon definitions. DB table `gameobject_template_addon` is empty.");
7755 Field* fields = result->Fetch();
7762 TC_LOG_ERROR(
"sql.sql",
"GameObject template (Entry: {}) does not exist but has a record in `gameobject_template_addon`", entry);
7780 TC_LOG_ERROR(
"sql.sql",
"GameObject (Entry: {}) has invalid `artkit{}` ({}) defined, set to zero instead.", entry, i, artKitID);
7784 gameObjectAddon.
artKits[i] = artKitID;
7789 TC_LOG_ERROR(
"sql.sql",
"GameObject (Entry: {}) has invalid faction ({}) defined in `gameobject_template_addon`.", entry, gameObjectAddon.
Faction);
7791 if (gameObjectAddon.
Maxgold > 0)
7799 TC_LOG_ERROR(
"sql.sql",
"GameObject (Entry {} GoType: {}) cannot be looted but has maxgold set in `gameobject_template_addon`.", entry, got->
type);
7806 while (result->NextRow());
7819 TC_LOG_INFO(
"server.loading",
">> Loaded 0 gameobject faction and flags overrides. DB table `gameobject_overrides` is empty.");
7826 Field* fields = result->Fetch();
7832 TC_LOG_ERROR(
"sql.sql",
"GameObject (SpawnId: {}) does not exist but has a record in `gameobject_overrides`", spawnId);
7841 TC_LOG_ERROR(
"sql.sql",
"GameObject (SpawnId: {}) has invalid faction ({}) defined in `gameobject_overrides`.", spawnId, gameObjectOverride.
Faction);
7844 }
while (result->NextRow());
7857 TC_LOG_INFO(
"server.loading",
">> Loaded 0 BaseXP definitions. DB table `exploration_basexp` is empty.");
7865 Field* fields = result->Fetch();
7871 while (result->NextRow());
7896 TC_LOG_INFO(
"server.loading",
">> Loaded 0 pet name parts. DB table `pet_name_generation` is empty!");
7904 Field* fields = result->Fetch();
7905 std::string word = fields[0].
GetString();
7907 bool half = fields[2].
GetBool();
7914 while (result->NextRow());
7926 Field* fields = result->Fetch();
7938 if (list0.empty() || list1.empty())
7942 return std::string();
7946 return std::string(petname);
7951 return *(list0.begin()+
urand(0, list0.size()-1)) + *(list1.begin()+
urand(0, list1.size()-1));
7961 QueryResult result =
WorldDatabase.Query(
"SELECT faction, quest_rate, quest_daily_rate, quest_weekly_rate, quest_monthly_rate, quest_repeatable_rate, creature_rate, spell_rate FROM reputation_reward_rate");
7964 TC_LOG_INFO(
"server.loading",
">> Loaded `reputation_reward_rate`, table is empty!");
7970 Field* fields = result->Fetch();
7987 TC_LOG_ERROR(
"sql.sql",
"Faction (faction.dbc) {} does not exist but is used in `reputation_reward_rate`", factionId);
7993 TC_LOG_ERROR(
"sql.sql",
"Table reputation_reward_rate has quest_rate with invalid rate {}, skipping data for faction {}", repRate.
questRate, factionId);
7999 TC_LOG_ERROR(
"sql.sql",
"Table reputation_reward_rate has quest_daily_rate with invalid rate {}, skipping data for faction {}", repRate.
questDailyRate, factionId);
8005 TC_LOG_ERROR(
"sql.sql",
"Table reputation_reward_rate has quest_weekly_rate with invalid rate {}, skipping data for faction {}", repRate.
questWeeklyRate, factionId);
8011 TC_LOG_ERROR(
"sql.sql",
"Table reputation_reward_rate has quest_monthly_rate with invalid rate {}, skipping data for faction {}", repRate.
questMonthlyRate, factionId);
8017 TC_LOG_ERROR(
"sql.sql",
"Table reputation_reward_rate has quest_repeatable_rate with invalid rate {}, skipping data for faction {}", repRate.
questRepeatableRate, factionId);
8023 TC_LOG_ERROR(
"sql.sql",
"Table reputation_reward_rate has creature_rate with invalid rate {}, skipping data for faction {}", repRate.
creatureRate, factionId);
8029 TC_LOG_ERROR(
"sql.sql",
"Table reputation_reward_rate has spell_rate with invalid rate {}, skipping data for faction {}", repRate.
spellRate, factionId);
8037 while (result->NextRow());
8054 "IsTeamAward1, MaxStanding1, RewOnKillRepValue1, IsTeamAward2, MaxStanding2, RewOnKillRepValue2, TeamDependent "
8055 "FROM creature_onkill_reputation");
8059 TC_LOG_INFO(
"server.loading",
">> Loaded 0 creature award reputation definitions. DB table `creature_onkill_reputation` is empty.");
8065 Field* fields = result->Fetch();
8082 TC_LOG_ERROR(
"sql.sql",
"Table `creature_onkill_reputation` has data for nonexistent creature entry ({}), skipped", creature_id);
8091 TC_LOG_ERROR(
"sql.sql",
"Faction (faction.dbc) {} does not exist but is used in `creature_onkill_reputation`", repOnKill.
RepFaction1);
8101 TC_LOG_ERROR(
"sql.sql",
"Faction (faction.dbc) {} does not exist but is used in `creature_onkill_reputation`", repOnKill.
RepFaction2);
8109 }
while (result->NextRow());
8121 QueryResult result =
WorldDatabase.Query(
"SELECT faction, faction1, rate_1, rank_1, faction2, rate_2, rank_2, faction3, rate_3, rank_3, faction4, rate_4, rank_4 FROM reputation_spillover_template");
8125 TC_LOG_INFO(
"server.loading",
">> Loaded `reputation_spillover_template`, table is empty.");
8131 Field* fields = result->Fetch();
8154 TC_LOG_ERROR(
"sql.sql",
"Faction (faction.dbc) {} does not exist but is used in `reputation_spillover_template`", factionId);
8160 TC_LOG_ERROR(
"sql.sql",
"Faction (faction.dbc) {} in `reputation_spillover_template` does not belong to any team, skipping", factionId);
8164 bool invalidSpilloverFaction =
false;
8171 if (!factionSpillover)
8173 TC_LOG_ERROR(
"sql.sql",
"Spillover faction (faction.dbc) {} does not exist but is used in `reputation_spillover_template` for faction {}, skipping", repTemplate.
faction[i], factionId);
8174 invalidSpilloverFaction =
true;
8180 TC_LOG_ERROR(
"sql.sql",
"Spillover faction (faction.dbc) {} for faction {} in `reputation_spillover_template` can not be listed for client, and then useless, skipping", repTemplate.
faction[i], factionId);
8181 invalidSpilloverFaction =
true;
8187 TC_LOG_ERROR(
"sql.sql",
"Rank {} used in `reputation_spillover_template` for spillover faction {} is not valid, skipping", repTemplate.
faction_rank[i], repTemplate.
faction[i]);
8188 invalidSpilloverFaction =
true;
8194 if (invalidSpilloverFaction)
8201 while (result->NextRow());
8215 QueryResult result =
WorldDatabase.Query(
"SELECT ID, PositionX, PositionY, Icon, Flags, Importance, Name FROM points_of_interest");
8219 TC_LOG_INFO(
"server.loading",
">> Loaded 0 Points of Interest definitions. DB table `points_of_interest` is empty.");
8225 Field* fields = result->Fetch();
8230 pointOfInterest.
ID = id;
8240 TC_LOG_ERROR(
"sql.sql",
"Table `points_of_interest` (ID: {}) have invalid coordinates (X: {} Y: {}), ignored.",
id, pointOfInterest.
PositionX, pointOfInterest.
PositionY);
8247 }
while (result->NextRow());
8259 QueryResult result =
WorldDatabase.Query(
"SELECT QuestID, id, ObjectiveIndex, MapID, WorldMapAreaId, Floor, Priority, Flags FROM quest_poi");
8262 TC_LOG_INFO(
"server.loading",
">> Loaded 0 quest POI definitions. DB table `quest_poi` is empty.");
8269 QueryResult points =
WorldDatabase.Query(
"SELECT QuestID, Idx1, X, Y FROM quest_poi_points ORDER BY QuestID DESC, Idx2");
8271 std::vector<std::vector<std::vector<QuestPOIBlobPoint>>> POIs;
8275 Field* fields = points->Fetch();
8277 POIs.resize(maxQuestPOIId + 1);
8281 fields = points->Fetch();
8288 if (POIs[questId].size() <=
id + 1)
8289 POIs[questId].resize(
id + 10);
8295 POIs[questId][id].push_back(point);
8296 }
while (points->NextRow());
8301 Field* fields = result->Fetch();
8317 POI.
Floor = FloorId;
8321 if (questId < POIs.size() &&
id < POIs[questId].size())
8333 std::tie(itr, std::ignore) =
_questPOIStore.emplace(questId, std::move(wrapper));
8339 TC_LOG_ERROR(
"sql.sql",
"Table quest_poi references unknown quest points for quest {} POI id {}", questId,
id);
8340 }
while (result->NextRow());
8351 QueryResult result =
WorldDatabase.Query(
"SELECT npc_entry, spell_id, cast_flags, user_type FROM npc_spellclick_spells");
8355 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spellclick spells. DB table `npc_spellclick_spells` is empty.");
8363 Field* fields = result->Fetch();
8369 TC_LOG_ERROR(
"sql.sql",
"Table npc_spellclick_spells references unknown creature_template {}. Skipping entry.", npc_entry);
8377 TC_LOG_ERROR(
"sql.sql",
"Table npc_spellclick_spells creature: {} references unknown spellid {}. Skipping entry.", npc_entry, spellid);
8383 TC_LOG_ERROR(
"sql.sql",
"Table npc_spellclick_spells creature: {} references unknown user type {}. Skipping entry.", npc_entry,
uint32(userType));
8394 while (result->NextRow());
8402 TC_LOG_ERROR(
"sql.sql",
"npc_spellclick_spells: Creature template {} has UNIT_NPC_FLAG_SPELLCLICK but no data in spellclick table! Removing flag", creatureTemplatePair.first);
8403 creatureTemplatePair.second.npcflag &= ~UNIT_NPC_FLAG_SPELLCLICK;
8448 TC_LOG_INFO(
"server.loading",
">> Loaded 0 quest relations from `{}`, table is empty.", table);
8454 uint32 id = result->Fetch()[0].GetUInt32();
8455 uint32 quest = result->Fetch()[1].GetUInt32();
8459 TC_LOG_ERROR(
"sql.sql",
"Table `{}`: Quest {} listed for entry {} does not exist.", table, quest,
id);
8463 map.insert(QuestRelations::value_type(
id, quest));
8465 }
while (result->NextRow());
8478 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject_queststarter` has data for nonexistent gameobject entry ({}) and existed quest {}", itr->first, itr->second);
8480 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject_queststarter` has data gameobject entry ({}) for quest {}, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second);
8492 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject_questender` has data for nonexistent gameobject entry ({}) and existed quest {}", itr->first, itr->second);
8494 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject_questender` has data gameobject entry ({}) for quest {}, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second);
8506 TC_LOG_ERROR(
"sql.sql",
"Table `creature_queststarter` has data for nonexistent creature entry ({}) and existed quest {}", itr->first, itr->second);
8508 TC_LOG_ERROR(
"sql.sql",
"Table `creature_queststarter` has creature entry ({}) for quest {}, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second);
8520 TC_LOG_ERROR(
"sql.sql",
"Table `creature_questender` has data for nonexistent creature entry ({}) and existed quest {}", itr->first, itr->second);
8522 TC_LOG_ERROR(
"sql.sql",
"Table `creature_questender` has creature entry ({}) for quest {}, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second);
8541 _reservedNamesStore.clear();
8547 TC_LOG_INFO(
"server.loading",
">> Loaded 0 reserved player names. DB table `reserved_name` is empty!");
8556 fields = result->Fetch();
8557 std::string name= fields[0].
GetString();
8562 TC_LOG_ERROR(
"misc",
"Table `reserved_name` has invalid name: {}", name);
8568 _reservedNamesStore.insert(wstr);
8571 while (result->NextRow());
8584 return _reservedNamesStore.find(wstr) != _reservedNamesStore.end();
8626 if (strictMask == 0)
8637 if (strictMask & 0x2)
8651 if (strictMask & 0x1)
8670 if (wname.size() < minName)
8678 for (
size_t i = 2; i < wname.size(); ++i)
8679 if (wname[i] == wname[i-1] && wname[i] == wname[i-2])
8695 if (wname.size() < minName)
8713 if (wname.size() < minName)
8738 _gameObjectForQuestStore.clear();
8740 if (_gameObjectTemplateStore.empty())
8742 TC_LOG_INFO(
"server.loading",
">> Loaded 0 GameObjects for quests");
8749 for (
auto const& gameObjectTemplatePair : _gameObjectTemplateStore)
8751 switch (gameObjectTemplatePair.second.type)
8758 uint32 lootId = gameObjectTemplatePair.second.GetLootId();
8766 if (gameObjectTemplatePair.second._generic.questID > 0)
8772 if (gameObjectTemplatePair.second.goober.questId > 0)
8780 _gameObjectForQuestStore.insert(gameObjectTemplatePair.first);
8791 _trinityStringStore.clear();
8793 QueryResult result =
WorldDatabase.Query(
"SELECT entry, content_default, content_loc1, content_loc2, content_loc3, content_loc4, content_loc5, content_loc6, content_loc7, content_loc8 FROM trinity_string");
8796 TC_LOG_INFO(
"server.loading",
">> Loaded 0 trinity strings. DB table `trinity_string` is empty. You have imported an incorrect database for more info search for TCE00003 on forum.");
8802 Field* fields = result->Fetch();
8813 while (result->NextRow());
8823 if (ts->Content.size() >
size_t(locale) && !ts->Content[locale].empty())
8824 return ts->
Content[locale].c_str();
8828 TC_LOG_ERROR(
"sql.sql",
"Trinity string entry {} not found in DB.", entry);
8836 _fishingBaseForAreaStore.clear();
8842 TC_LOG_INFO(
"server.loading",
">> Loaded 0 areas for fishing base skill level. DB table `skill_fishing_base_level` is empty.");
8850 Field* fields = result->Fetch();
8857 TC_LOG_ERROR(
"sql.sql",
"AreaId {} defined in `skill_fishing_base_level` does not exist", entry);
8861 _fishingBaseForAreaStore[entry] = skill;
8864 while (result->NextRow());
8887 if (w_ownname != wname)
8895 AreaTriggerScriptContainer::const_iterator i = _areaTriggerScriptStore.find(trigger_id);
8896 if (i!= _areaTriggerScriptStore.end())
8903 return _spellScriptsStore.equal_range(spellId);
8912 uint32 raceMask = (1 << (race - 1));
8913 uint32 classMask = (1 << (playerClass-1));
8915 for (
uint8 i = 0; i < 4; ++i)
8954 _gameTeleStore.clear();
8957 QueryResult result =
WorldDatabase.Query(
"SELECT id, position_x, position_y, position_z, orientation, map, name FROM game_tele");
8961 TC_LOG_INFO(
"server.loading",
">> Loaded 0 GameTeleports. DB table `game_tele` is empty!");
8969 Field* fields = result->Fetch();
8984 TC_LOG_ERROR(
"sql.sql",
"Wrong position for id {} (name: {}) in `game_tele` table, ignoring.",
id, gt.
name);
8990 TC_LOG_ERROR(
"sql.sql",
"Wrong UTF8 name for id {} in `game_tele` table, ignoring.",
id);
8996 _gameTeleStore[id] = gt;
9000 while (result->NextRow());
9017 for (GameTeleContainer::const_iterator itr = _gameTeleStore.begin(); itr != _gameTeleStore.end(); ++itr)
9019 if (itr->second.wnameLow == wname)
9020 return &itr->second;
9021 else if (!alt && itr->second.
wnameLow.find(wname) != std::wstring::npos)
9038 for (GameTeleContainer::const_iterator itr = _gameTeleStore.begin(); itr != _gameTeleStore.end(); ++itr)
9040 if (itr->second.wnameLow == wname)
9041 return &itr->second;
9051 for (GameTeleContainer::const_iterator itr = _gameTeleStore.begin(); itr != _gameTeleStore.end(); ++itr)
9052 if (itr->first > new_id)
9053 new_id = itr->first;
9063 _gameTeleStore[new_id] = tele;
9090 for (GameTeleContainer::iterator itr = _gameTeleStore.begin(); itr != _gameTeleStore.end(); ++itr)
9092 if (itr->second.wnameLow == wname)
9100 _gameTeleStore.erase(itr);
9112 _mailLevelRewardStore.clear();
9115 QueryResult result =
WorldDatabase.Query(
"SELECT level, raceMask, mailTemplateId, senderEntry FROM mail_level_reward");
9119 TC_LOG_INFO(
"server.loading",
">> Loaded 0 level dependent mail rewards. DB table `mail_level_reward` is empty.");
9127 Field* fields = result->Fetch();
9136 TC_LOG_ERROR(
"sql.sql",
"Table `mail_level_reward` has data for level {} that more supported by client ({}), ignoring.", level,
MAX_LEVEL);
9142 TC_LOG_ERROR(
"sql.sql",
"Table `mail_level_reward` has raceMask ({}) for level {} that not include any player races, ignoring.", raceMask, level);
9148 TC_LOG_ERROR(
"sql.sql",
"Table `mail_level_reward` has invalid mailTemplateId ({}) for level {} that invalid not include any player races, ignoring.", mailTemplateId, level);
9152 if (!GetCreatureTemplate(senderEntry))
9154 TC_LOG_ERROR(
"sql.sql",
"Table `mail_level_reward` has nonexistent sender creature entry ({}) for level {} that invalid not include any player races, ignoring.", senderEntry, level);
9158 _mailLevelRewardStore[level].push_back(
MailLevelReward(raceMask, mailTemplateId, senderEntry));
9162 while (result->NextRow());
9174 std::unordered_map<int32, std::vector<Trainer::Spell>> spellsByTrainer;
9175 if (
QueryResult trainerSpellsResult =
WorldDatabase.Query(
"SELECT TrainerId, SpellId, MoneyCost, ReqSkillLine, ReqSkillRank, ReqAbility1, ReqAbility2, ReqAbility3, ReqLevel FROM trainer_spell"))
9179 Field* fields = trainerSpellsResult->Fetch();
9195 TC_LOG_ERROR(
"sql.sql",
"Table `trainer_spell` references non-existing spell (SpellId: {}) for TrainerId {}, ignoring", spell.
SpellId, trainerId);
9201 TC_LOG_ERROR(
"sql.sql",
"Table `trainer_spell` references non-existing spell (SpellId: {}) which is a talent, for TrainerId {}, ignoring", spell.
SpellId, trainerId);
9207 TC_LOG_ERROR(
"sql.sql",
"Table `trainer_spell` references non-existing skill (ReqSkillLine: {}) for TrainerId {} and SpellId {}, ignoring",
9212 bool allReqValid =
true;
9213 for (std::size_t i = 0; i < spell.
ReqAbility.size(); ++i)
9216 if (requiredSpell && !
sSpellMgr->GetSpellInfo(requiredSpell))
9218 TC_LOG_ERROR(
"sql.sql",
"Table `trainer_spell` references non-existing spell (ReqAbility{}: {}) for TrainerId {} and SpellId {}, ignoring",
9219 i + 1, requiredSpell, trainerId, spell.
SpellId);
9220 allReqValid =
false;
9227 spellsByTrainer[trainerId].push_back(spell);
9228 }
while (trainerSpellsResult->NextRow());
9235 Field* fields = trainersResult->Fetch();
9240 std::string greeting = fields[3].
GetString();
9241 std::vector<Trainer::Spell> spells;
9242 auto spellsItr = spellsByTrainer.find(trainerId);
9243 if (spellsItr != spellsByTrainer.end())
9245 spells = std::move(spellsItr->second);
9246 spellsByTrainer.erase(spellsItr);
9249 switch (trainerType)
9255 TC_LOG_ERROR(
"sql.sql",
"Table `trainer` references non-existing class requirement {} for TrainerId {}, ignoring", requirement, trainerId);
9262 TC_LOG_ERROR(
"sql.sql",
"Table `trainer` references non-existing race requirement {} for TrainerId {}, ignoring", requirement, trainerId);
9267 if (requirement && !
sSpellMgr->GetSpellInfo(requirement))
9269 TC_LOG_ERROR(
"sql.sql",
"Table `trainer` references non-existing spell requirement {} for TrainerId {}, ignoring", requirement, trainerId);
9277 auto [it, isNew] = _trainers.emplace(std::piecewise_construct, std::forward_as_tuple(trainerId), std::forward_as_tuple(trainerId, trainerType, requirement, std::move(greeting), std::move(spells)));
9280 _classTrainers[requirement].push_back(&it->second);
9281 }
while (trainersResult->NextRow());
9284 for (
auto const& unusedSpells : spellsByTrainer)
9288 TC_LOG_ERROR(
"sql.sql",
"Table `trainer_spell` references non-existing trainer (TrainerId: {}) for SpellId {}, ignoring", unusedSpells.first, unusedSpell.SpellId);
9292 if (
QueryResult trainerLocalesResult =
WorldDatabase.Query(
"SELECT Id, locale, Greeting_lang FROM trainer_locale"))
9296 Field* fields = trainerLocalesResult->Fetch();
9298 std::string localeName = fields[1].
GetString();
9305 trainer->AddGreetingLocale(locale, fields[2].GetString());
9307 TC_LOG_ERROR(
"sql.sql",
"Table `trainer_locale` references non-existing trainer (TrainerId: {}) for locale {}, ignoring",
9308 trainerId, localeName);
9309 }
while (trainerLocalesResult->NextRow());
9319 _creatureDefaultTrainers.clear();
9325 Field* fields = result->Fetch();
9329 if (!GetCreatureTemplate(creatureId))
9331 TC_LOG_ERROR(
"sql.sql",
"Table `creature_default_trainer` references non-existing creature template (CreatureId: {}), ignoring", creatureId);
9338 TC_LOG_ERROR(
"sql.sql",
"Table `creature_default_trainer` references non-existing trainer (TrainerId: {}) for CreatureId {}, ignoring", trainerId, creatureId);
9342 _creatureDefaultTrainers[creatureId] = trainer;
9344 }
while (result->NextRow());
9363 Field* fields = result->Fetch();
9369 count += LoadReferenceVendor(vendor, -item_id, skip_vendors);
9376 if (!IsVendorItemValid(vendor, item_id, maxcount, incrtime, ExtendedCost,
nullptr, skip_vendors))
9381 vList.
AddItem(item_id, maxcount, incrtime, ExtendedCost);
9384 }
while (result->NextRow());
9394 for (CacheVendorItemContainer::iterator itr = _cacheVendorItemStore.begin(); itr != _cacheVendorItemStore.end(); ++itr)
9395 itr->second.Clear();
9396 _cacheVendorItemStore.clear();
9398 std::set<uint32> skip_vendors;
9400 QueryResult result =
WorldDatabase.Query(
"SELECT entry, item, maxcount, incrtime, ExtendedCost FROM npc_vendor ORDER BY entry, slot ASC");
9404 TC_LOG_ERROR(
"sql.sql",
">> Loaded 0 Vendors. DB table `npc_vendor` is empty!");
9412 Field* fields = result->Fetch();
9419 count += LoadReferenceVendor(entry, -item_id, &skip_vendors);
9426 if (!IsVendorItemValid(entry, item_id, maxcount, incrtime, ExtendedCost,
nullptr, &skip_vendors))
9431 vList.
AddItem(item_id, maxcount, incrtime, ExtendedCost);
9435 while (result->NextRow());
9444 _gossipMenusStore.clear();
9451 TC_LOG_INFO(
"server.loading",
">> Loaded 0 gossip_menu IDs. DB table `gossip_menu` is empty!");
9457 Field* fields = result->Fetch();
9464 if (!GetGossipText(gMenu.
TextID))
9470 _gossipMenusStore.insert(GossipMenusContainer::value_type(gMenu.
MenuID, gMenu));
9471 }
while (result->NextRow());
9480 _gossipMenuItemsStore.clear();
9484 "SELECT MenuID, OptionID, OptionIcon, OptionText, OptionBroadcastTextID, OptionType, OptionNpcFlag, ActionMenuID, ActionPoiID, BoxCoded, BoxMoney, BoxText, BoxBroadcastTextID "
9485 "FROM gossip_menu_option ORDER BY MenuID, OptionID");
9489 TC_LOG_INFO(
"server.loading",
">> Loaded 0 gossip_menu_option IDs. DB table `gossip_menu_option` is empty!");
9495 Field* fields = result->Fetch();
9515 TC_LOG_ERROR(
"sql.sql",
"Table `gossip_menu_option` for menu {}, id {} has unknown icon id {}. Replacing with GOSSIP_ICON_CHAT", gMenuItem.
MenuID, gMenuItem.
OptionID, gMenuItem.
OptionIcon);
9529 TC_LOG_ERROR(
"sql.sql",
"Table `gossip_menu_option` for menu {}, id {} has unknown option id {}. Option will not be used", gMenuItem.
MenuID, gMenuItem.
OptionID, gMenuItem.
OptionType);
9546 _gossipMenuItemsStore.insert(GossipMenuItemsContainer::value_type(gMenuItem.
MenuID, gMenuItem));
9547 }
while (result->NextRow());
9554 auto itr = _creatureDefaultTrainers.find(creatureId);
9555 if (itr != _creatureDefaultTrainers.end())
9564 vList.
AddItem(item, maxcount, incrtime, extendedCost);
9582 CacheVendorItemContainer::iterator iter = _cacheVendorItemStore.find(entry);
9583 if (iter == _cacheVendorItemStore.end())
9586 if (!iter->second.RemoveItem(item))
9610 TC_LOG_ERROR(
"sql.sql",
"Table `(game_event_)npc_vendor` has data for nonexistent creature template (Entry: {}), ignore", vendor_entry);
9616 if (!skip_vendors || skip_vendors->count(vendor_entry) == 0)
9621 TC_LOG_ERROR(
"sql.sql",
"Table `(game_event_)npc_vendor` has data for creature template (Entry: {}) without vendor flag, ignore", vendor_entry);
9624 skip_vendors->insert(vendor_entry);
9634 TC_LOG_ERROR(
"sql.sql",
"Table `(game_event_)npc_vendor` for Vendor (Entry: {}) have in item list non-existed item ({}), ignore", vendor_entry,
id);
9643 TC_LOG_ERROR(
"sql.sql",
"Table `(game_event_)npc_vendor` has Item (Entry: {}) with wrong ExtendedCost ({}) for vendor ({}), ignore",
id, ExtendedCost, vendor_entry);
9647 if (maxcount > 0 && incrtime == 0)
9652 TC_LOG_ERROR(
"sql.sql",
"Table `(game_event_)npc_vendor` has `maxcount` ({}) for item {} of vendor (Entry: {}) but `incrtime`=0, ignore", maxcount,
id, vendor_entry);
9655 else if (maxcount == 0 && incrtime > 0)
9660 TC_LOG_ERROR(
"sql.sql",
"Table `(game_event_)npc_vendor` has `maxcount`=0 for item {} of vendor (Entry: {}) but `incrtime`<>0, ignore",
id, vendor_entry);
9664 VendorItemData const* vItems = GetNpcVendorItemList(vendor_entry);
9673 TC_LOG_ERROR(
"sql.sql",
"Table `npc_vendor` has duplicate items {} (with extended cost {}) for vendor (Entry: {}), ignoring",
id, ExtendedCost, vendor_entry);
9686 _scriptNamesStore.emplace_back(
"");
9689 "SELECT DISTINCT(ScriptName) FROM achievement_criteria_data WHERE ScriptName <> '' AND type = 11 "
9691 "SELECT DISTINCT(ScriptName) FROM battlefield_template WHERE ScriptName <> '' "
9693 "SELECT DISTINCT(ScriptName) FROM battleground_template WHERE ScriptName <> '' "
9695 "SELECT DISTINCT(ScriptName) FROM creature WHERE ScriptName <> '' "
9697 "SELECT DISTINCT(ScriptName) FROM creature_template WHERE ScriptName <> '' "
9699 "SELECT DISTINCT(ScriptName) FROM gameobject WHERE ScriptName <> '' "
9701 "SELECT DISTINCT(ScriptName) FROM gameobject_template WHERE ScriptName <> '' "
9703 "SELECT DISTINCT(ScriptName) FROM item_template WHERE ScriptName <> '' "
9705 "SELECT DISTINCT(ScriptName) FROM areatrigger_scripts WHERE ScriptName <> '' "
9707 "SELECT DISTINCT(ScriptName) FROM spell_script_names WHERE ScriptName <> '' "
9709 "SELECT DISTINCT(ScriptName) FROM transports WHERE ScriptName <> '' "
9711 "SELECT DISTINCT(ScriptName) FROM game_weather WHERE ScriptName <> '' "
9713 "SELECT DISTINCT(ScriptName) FROM conditions WHERE ScriptName <> '' "
9715 "SELECT DISTINCT(ScriptName) FROM outdoorpvp_template WHERE ScriptName <> '' "
9717 "SELECT DISTINCT(script) FROM instance_template WHERE script <> ''");
9721 TC_LOG_INFO(
"server.loading",
">> Loaded empty set of Script Names!");
9725 _scriptNamesStore.reserve(result->GetRowCount() + 1);
9729 _scriptNamesStore.push_back((*result)[0].GetString());
9731 while (result->NextRow());
9733 std::sort(_scriptNamesStore.begin(), _scriptNamesStore.end());
9740 return _scriptNamesStore;
9745 static std::string
const empty =
"";
9746 return (
id < _scriptNamesStore.size()) ? _scriptNamesStore[id] : empty;
9756 ScriptNameContainer::const_iterator itr = std::lower_bound(_scriptNamesStore.begin(), _scriptNamesStore.end(), name);
9757 if (itr == _scriptNamesStore.end() || (*itr != name))
9760 return uint32(itr - _scriptNamesStore.begin());
9767 _broadcastTextStore.clear();
9770 QueryResult result =
WorldDatabase.Query(
"SELECT ID, LanguageID, `Text`, Text1, EmoteID1, EmoteID2, EmoteID3, EmoteDelay1, EmoteDelay2, EmoteDelay3, SoundEntriesID, EmotesID, Flags FROM broadcast_text");
9773 TC_LOG_INFO(
"server.loading",
">> Loaded 0 broadcast texts. DB table `broadcast_text` is empty.");
9777 _broadcastTextStore.reserve(result->GetRowCount());
9781 Field* fields = result->Fetch();
9803 TC_LOG_DEBUG(
"broadcasttext",
"BroadcastText (Id: {}) in table `broadcast_text` has SoundEntriesID {} but sound does not exist.", bct.
Id, bct.
SoundEntriesID);
9810 TC_LOG_DEBUG(
"broadcasttext",
"BroadcastText (Id: {}) in table `broadcast_text` using LanguageID {} but Language does not exist.", bct.
Id, bct.
LanguageID);
9814 for (std::size_t i = 0; i < bct.
EmoteID.size(); ++i)
9818 TC_LOG_DEBUG(
"broadcasttext",
"BroadcastText (Id: {}) in table `broadcast_text` has EmoteId{} {} but emote does not exist.", bct.
Id, i + 1, bct.
EmoteID[i]);
9822 }
while (result->NextRow());
9835 TC_LOG_INFO(
"server.loading",
">> Loaded 0 broadcast text locales. DB table `broadcast_text_locale` is empty.");
9841 Field* fields = result->Fetch();
9844 std::string localeName = fields[1].
GetString();
9850 BroadcastTextContainer::iterator bct = _broadcastTextStore.find(
id);
9851 if (bct == _broadcastTextStore.end())
9853 TC_LOG_ERROR(
"sql.sql",
"BroadcastText (Id: {}) in table `broadcast_text_locale` does not exist. Skipped!",
id);
9857 AddLocaleString(fields[2].GetString(), locale, bct->second.Text);
9858 AddLocaleString(fields[3].GetString(), locale, bct->second.Text1);
9859 }
while (result->NextRow());
9866 CreatureBaseStatsContainer::const_iterator it = _creatureBaseStatsStore.find(
MAKE_PAIR16(level, unitClass));
9868 if (it != _creatureBaseStatsStore.end())
9869 return &(it->second);
9873 DefaultCreatureBaseStats()
9879 BaseDamage[j] = 0.0f;
9883 RangedAttackPower = 0;
9886 static const DefaultCreatureBaseStats defStats;
9894 QueryResult result =
WorldDatabase.Query(
"SELECT level, class, basehp0, basehp1, basehp2, basemana, basearmor, attackpower, rangedattackpower, damage_base, damage_exp1, damage_exp2 FROM creature_classlevelstats");
9898 TC_LOG_INFO(
"server.loading",
">> Loaded 0 creature base stats. DB table `creature_classlevelstats` is empty.");
9905 Field* fields = result->Fetch();
9911 TC_LOG_ERROR(
"sql.sql",
"Creature base stats for level {} has invalid class {}", Level, Class);
9921 TC_LOG_ERROR(
"sql.sql",
"Creature base stats for class {}, level {} has invalid zero base HP[{}] - set to 1", Class, Level, i);
9928 TC_LOG_ERROR(
"sql.sql",
"Creature base stats for class {}, level {} has invalid negative base damage[{}] - set to 0.0", Class, Level, i);
9939 _creatureBaseStatsStore[
MAKE_PAIR16(Level, Class)] = stats;
9943 while (result->NextRow());
9945 for (
auto const& creatureTemplatePair : _creatureTemplateStore)
9947 for (
uint16 lvl = creatureTemplatePair.second.minlevel; lvl <= creatureTemplatePair.second.maxlevel; ++lvl)
9949 if (!_creatureBaseStatsStore.count(
MAKE_PAIR16(lvl, creatureTemplatePair.second.unit_class)))
9950 TC_LOG_ERROR(
"sql.sql",
"Missing base stats for creature class {} level {}", creatureTemplatePair.second.unit_class, lvl);
9965 TC_LOG_INFO(
"server.loading",
">> Loaded 0 faction change achievement pairs. DB table `player_factionchange_achievement` is empty.");
9973 Field* fields = result->Fetch();
9979 TC_LOG_ERROR(
"sql.sql",
"Achievement {} (alliance_id) referenced in `player_factionchange_achievement` does not exist, pair skipped!", alliance);
9981 TC_LOG_ERROR(
"sql.sql",
"Achievement {} (horde_id) referenced in `player_factionchange_achievement` does not exist, pair skipped!", horde);
9983 FactionChangeAchievements[alliance] = horde;
9987 while (result->NextRow());
10000 TC_LOG_INFO(
"server.loading",
">> Loaded 0 faction change item pairs. DB table `player_factionchange_items` is empty.");
10008 Field* fields = result->Fetch();
10013 if (!GetItemTemplate(alliance))
10014 TC_LOG_ERROR(
"sql.sql",
"Item {} (alliance_id) referenced in `player_factionchange_items` does not exist, pair skipped!", alliance);
10015 else if (!GetItemTemplate(horde))
10016 TC_LOG_ERROR(
"sql.sql",
"Item {} (horde_id) referenced in `player_factionchange_items` does not exist, pair skipped!", horde);
10018 FactionChangeItems[alliance] = horde;
10022 while (result->NextRow());
10035 TC_LOG_INFO(
"server.loading",
">> Loaded 0 faction change quest pairs. DB table `player_factionchange_quests` is empty.");
10043 Field* fields = result->Fetch();
10048 if (!
sObjectMgr->GetQuestTemplate(alliance))
10049 TC_LOG_ERROR(
"sql.sql",
"Quest {} (alliance_id) referenced in `player_factionchange_quests` does not exist, pair skipped!", alliance);
10050 else if (!
sObjectMgr->GetQuestTemplate(horde))
10051 TC_LOG_ERROR(
"sql.sql",
"Quest {} (horde_id) referenced in `player_factionchange_quests` does not exist, pair skipped!", horde);
10053 FactionChangeQuests[alliance] = horde;
10057 while (result->NextRow());
10070 TC_LOG_INFO(
"server.loading",
">> Loaded 0 faction change reputation pairs. DB table `player_factionchange_reputations` is empty.");
10078 Field* fields = result->Fetch();
10084 TC_LOG_ERROR(
"sql.sql",
"Reputation {} (alliance_id) referenced in `player_factionchange_reputations` does not exist, pair skipped!", alliance);
10086 TC_LOG_ERROR(
"sql.sql",
"Reputation {} (horde_id) referenced in `player_factionchange_reputations` does not exist, pair skipped!", horde);
10088 FactionChangeReputation[alliance] = horde;
10092 while (result->NextRow());
10105 TC_LOG_INFO(
"server.loading",
">> Loaded 0 faction change spell pairs. DB table `player_factionchange_spells` is empty.");
10113 Field* fields = result->Fetch();
10118 if (!
sSpellMgr->GetSpellInfo(alliance))
10119 TC_LOG_ERROR(
"sql.sql",
"Spell {} (alliance_id) referenced in `player_factionchange_spells` does not exist, pair skipped!", alliance);
10120 else if (!
sSpellMgr->GetSpellInfo(horde))
10121 TC_LOG_ERROR(
"sql.sql",
"Spell {} (horde_id) referenced in `player_factionchange_spells` does not exist, pair skipped!", horde);
10123 FactionChangeSpells[alliance] = horde;
10127 while (result->NextRow());
10140 TC_LOG_INFO(
"server.loading",
">> Loaded 0 faction change title pairs. DB table `player_factionchange_title` is empty.");
10148 Field* fields = result->Fetch();
10154 TC_LOG_ERROR(
"sql.sql",
"Title {} (alliance_id) referenced in `player_factionchange_title` does not exist, pair skipped!", alliance);
10156 TC_LOG_ERROR(
"sql.sql",
"Title {} (horde_id) referenced in `player_factionchange_title` does not exist, pair skipped!", horde);
10158 FactionChangeTitles[alliance] = horde;
10162 while (result->NextRow());
10174 auto itr = _gameObjectTemplateAddonStore.find(entry);
10175 if (itr != _gameObjectTemplateAddonStore.end())
10176 return &itr->second;
10206 VehicleAccessoryContainer::const_iterator itr = _vehicleAccessoryStore.find(cre->GetSpawnId());
10207 if (itr != _vehicleAccessoryStore.end())
10208 return &itr->second;
10212 VehicleAccessoryTemplateContainer::const_iterator itr = _vehicleTemplateAccessoryStore.find(veh->
GetCreatureEntry());
10213 if (itr != _vehicleTemplateAccessoryStore.end())
10214 return &itr->second;
10220 auto itr = _dungeonEncounterStore.find(
MAKE_PAIR32(mapId, difficulty));
10221 if (itr != _dungeonEncounterStore.end())
10222 return &itr->second;
10232 auto const& info = _playerInfo[race][class_];
10243 QueryResult result =
WorldDatabase.Query(
"SELECT GameObjectEntry, ItemId, Idx FROM gameobject_questitem ORDER BY Idx ASC");
10247 TC_LOG_INFO(
"server.loading",
">> Loaded 0 gameobject quest items. DB table `gameobject_questitem` is empty.");
10254 Field* fields = result->Fetch();
10263 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject_questitem` has data for nonexistent gameobject (entry: {}, idx: {}), skipped", entry, idx);
10270 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject_questitem` has nonexistent item (ID: {}) in gameobject (entry: {}, idx: {}), skipped", item, entry, idx);
10274 _gameObjectQuestItemStore[entry].push_back(item);
10278 while (result->NextRow());
10288 QueryResult result =
WorldDatabase.Query(
"SELECT CreatureEntry, ItemId, Idx FROM creature_questitem ORDER BY Idx ASC");
10292 TC_LOG_INFO(
"server.loading",
">> Loaded 0 creature quest items. DB table `creature_questitem` is empty.");
10299 Field* fields = result->Fetch();
10308 TC_LOG_ERROR(
"sql.sql",
"Table `creature_questitem` has data for nonexistent creature (entry: {}, idx: {}), skipped", entry, idx);
10315 TC_LOG_ERROR(
"sql.sql",
"Table `creature_questitem` has nonexistent item (ID: {}) in creature (entry: {}, idx: {}), skipped", item, entry, idx);
10319 _creatureQuestItemStore[entry].push_back(item);
10323 while (result->NextRow());
10335 TC_LOG_INFO(
"server.loading",
">> Query data caching is disabled. Skipped initialization.");
10343 for (
auto& creatureTemplatePair : _creatureTemplateStore)
10344 pool.
PostWork([creature = &creatureTemplatePair.second]() { creature->InitializeQueryData(); });
10348 for (
auto& gameObjectTemplatePair : _gameObjectTemplateStore)
10349 pool.
PostWork([gobj = &gameObjectTemplatePair.second]() { gobj->InitializeQueryData(); });
10353 for (
auto& itemTemplatePair : _itemTemplateStore)
10354 pool.
PostWork([item = &itemTemplatePair.second]() { item->InitializeQueryData(); });
10358 for (
auto& questTemplatePair : _questTemplates)
10359 pool.
PostWork([quest = questTemplatePair.second.get()]() { quest->InitializeQueryData(); });
10363 for (
auto& poiWrapperPair : _questPOIStore)
10364 pool.
PostWork([poi = &poiWrapperPair.second]() { poi->InitializeQueryData(); });
10373 QueryDataBuffer = BuildQueryData();
10379 tempBuffer <<
uint32(POIData.QuestID);
10380 tempBuffer <<
uint32(POIData.QuestPOIBlobDataStats.size());
10382 for (
QuestPOIBlobData const& questPOIBlobData : POIData.QuestPOIBlobDataStats)
10384 tempBuffer <<
uint32(questPOIBlobData.BlobIndex);
10385 tempBuffer <<
int32(questPOIBlobData.ObjectiveIndex);
10386 tempBuffer <<
uint32(questPOIBlobData.MapID);
10387 tempBuffer <<
uint32(questPOIBlobData.WorldMapAreaID);
10388 tempBuffer <<
uint32(questPOIBlobData.Floor);
10389 tempBuffer <<
uint32(questPOIBlobData.Unk3);
10390 tempBuffer <<
uint32(questPOIBlobData.Unk4);
10391 tempBuffer <<
uint32(questPOIBlobData.QuestPOIBlobPointStats.size());
10393 for (
QuestPOIBlobPoint const& questPOIBlobPoint : questPOIBlobData.QuestPOIBlobPointStats)
10395 tempBuffer <<
int32(questPOIBlobPoint.X);
10396 tempBuffer <<
int32(questPOIBlobPoint.Y);
@ CHAR_DEL_EMPTY_EXPIRED_MAIL
@ CHAR_SEL_EXPIRED_MAIL_ITEMS
@ CHAR_DEL_MAIL_ITEM_BY_ID
@ CHAR_UPD_MAIL_ITEM_RECEIVER
LocaleConstant GetLocaleByName(const std::string &name)
#define sCreatureAIRegistry
@ CREATURE_FLAG_EXTRA_DB_ALLOWED
@ CREATURE_FLAG_EXTRA_DUNGEON_BOSS
@ CREATURE_FLAG_EXTRA_TRIGGER
@ CREATURE_FLAG_EXTRA_INSTANCE_BIND
CreatureFlightMovementType
CreatureChaseMovementType
CreatureGroundMovementType
static const uint8 MAX_KILL_CREDIT
CreatureRandomMovementType
static const uint32 MAX_CREATURE_SPELLS
DBCStorage< CharTitlesEntry > sCharTitlesStore(CharTitlesEntryfmt)
DBCStorage< VehicleSeatEntry > sVehicleSeatStore(VehicleSeatEntryfmt)
DBCStorage< FactionEntry > sFactionStore(FactionEntryfmt)
SkillRaceClassInfoEntry const * GetSkillRaceClassInfo(uint32 skill, uint8 race, uint8 class_)
DBCStorage< ItemSetEntry > sItemSetStore(ItemSetEntryfmt)
DBCStorage< WorldSafeLocsEntry > sWorldSafeLocsStore(WorldSafeLocsEntryfmt)
ResponseCodes ValidateName(std::wstring const &name, LocaleConstant locale)
TaxiPathSetBySource sTaxiPathSetBySource
DBCStorage< MailTemplateEntry > sMailTemplateStore(MailTemplateEntryfmt)
DBCStorage< VehicleEntry > sVehicleStore(VehicleEntryfmt)
DBCStorage< ItemLimitCategoryEntry > sItemLimitCategoryStore(ItemLimitCategoryEntryfmt)
char const * GetPetName(uint32 petfamily, uint32 dbclang)
DBCStorage< CharStartOutfitEntry > sCharStartOutfitStore(CharStartOutfitEntryfmt)
DBCStorage< LockEntry > sLockStore(LockEntryfmt)
DBCStorage< SkillTiersEntry > sSkillTiersStore(SkillTiersfmt)
TaxiPathNodesByPath sTaxiPathNodesByPath
DBCStorage< ItemEntry > sItemStore(Itemfmt)
DBCStorage< CreatureSpellDataEntry > sCreatureSpellDataStore(CreatureSpellDatafmt)
DBCStorage< CreatureDisplayInfoEntry > sCreatureDisplayInfoStore(CreatureDisplayInfofmt)
DBCStorage< ItemBagFamilyEntry > sItemBagFamilyStore(ItemBagFamilyfmt)
DBCStorage< ChrRacesEntry > sChrRacesStore(ChrRacesEntryfmt)
uint32 GetTalentSpellCost(uint32 spellId)
DBCStorage< GameObjectDisplayInfoEntry > sGameObjectDisplayInfoStore(GameObjectDisplayInfofmt)
DBCStorage< AreaTriggerEntry > sAreaTriggerStore(AreaTriggerEntryfmt)
DBCStorage< HolidaysEntry > sHolidaysStore(Holidaysfmt)
DBCStorage< ItemRandomSuffixEntry > sItemRandomSuffixStore(ItemRandomSuffixfmt)
DBCStorage< SoundEntriesEntry > sSoundEntriesStore(SoundEntriesfmt)
DBCStorage< AchievementEntry > sAchievementStore(Achievementfmt)
DBCStorage< TotemCategoryEntry > sTotemCategoryStore(TotemCategoryEntryfmt)
DBCStorage< QuestSortEntry > sQuestSortStore(QuestSortEntryfmt)
DBCStorage< GameObjectArtKitEntry > sGameObjectArtKitStore(GameObjectArtKitfmt)
DBCStorage< GemPropertiesEntry > sGemPropertiesStore(GemPropertiesEntryfmt)
DBCStorage< ItemRandomPropertiesEntry > sItemRandomPropertiesStore(ItemRandomPropertiesfmt)
DBCStorage< DungeonEncounterEntry > sDungeonEncounterStore(DungeonEncounterfmt)
MapDifficultyEntry const * GetMapDifficultyData(uint32 mapId, Difficulty difficulty)
DBCStorage< SkillLineEntry > sSkillLineStore(SkillLinefmt)
DBCStorage< CreatureFamilyEntry > sCreatureFamilyStore(CreatureFamilyfmt)
DBCStorage< FactionTemplateEntry > sFactionTemplateStore(FactionTemplateEntryfmt)
DBCStorage< TaxiNodesEntry > sTaxiNodesStore(TaxiNodesEntryfmt)
DBCStorage< SpellFocusObjectEntry > sSpellFocusObjectStore(SpellFocusObjectfmt)
DBCStorage< MapEntry > sMapStore(MapEntryfmt)
CharStartOutfitEntry const * GetCharStartOutfitEntry(uint8 race, uint8 class_, uint8 gender)
DBCStorage< CreatureModelDataEntry > sCreatureModelDataStore(CreatureModelDatafmt)
DBCStorage< CreatureTypeEntry > sCreatureTypeStore(CreatureTypefmt)
DBCStorage< ItemExtendedCostEntry > sItemExtendedCostStore(ItemExtendedCostEntryfmt)
DBCStorage< AreaTableEntry > sAreaTableStore(AreaTableEntryfmt)
DBCStorage< ChrClassesEntry > sChrClassesStore(ChrClassesEntryfmt)
DBCStorage< CurrencyTypesEntry > sCurrencyTypesStore(CurrencyTypesfmt)
DBCStorage< EmotesEntry > sEmotesStore(EmotesEntryfmt)
std::map< uint32, TaxiPathBySourceAndDestination > TaxiPathSetForSource
#define MAX_ITEM_SET_ITEMS
std::shared_ptr< ResultSet > QueryResult
std::shared_ptr< PreparedResultSet > PreparedQueryResult
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
DatabaseWorkerPool< WorldDatabaseConnection > WorldDatabase
Accessor to the world database.
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
#define ASSERT_NOTNULL(pointer)
#define sGameObjectAIRegistry
uint32 GetItemEnchantMod(int32 entry)
@ ITEM_CLASS_MISCELLANEOUS
@ ITEM_FLAG2_FACTION_HORDE
@ ITEM_FLAG2_FACTION_ALLIANCE
@ ITEM_SPELLTRIGGER_ON_USE
@ BAG_FAMILY_MASK_CURRENCY_TOKENS
@ ITEM_MOD_SPELL_HEALING_DONE
@ ITEM_MOD_SPELL_DAMAGE_DONE
#define MAX_ITEM_PROTO_SOCKETS
#define MAX_ITEM_PROTO_DAMAGES
#define MAX_ITEM_PROTO_SPELLS
#define MAX_ITEM_SPELLTRIGGER
#define MAX_ITEM_PROTO_STATS
const uint32 MaxItemSubclassValues[MAX_ITEM_CLASS]
@ ITEM_FLAGS_CU_DURATION_REAL_TIME
@ LANG_ITEM_ALREADY_IN_LIST
@ LANG_COMMAND_VENDORSELECTION
@ LANG_EXTENDED_COST_NOT_EXIST
#define TC_LOG_DEBUG(filterType__,...)
#define TC_LOG_ERROR(filterType__,...)
#define TC_LOG_INFO(filterType__,...)
#define TC_LOG_FATAL(filterType__,...)
LootStore LootTemplates_Gameobject("gameobject_loot_template", "gameobject entry", true)
@ MAIL_CHECK_MASK_COD_PAYMENT
This mail is payable on delivery.
@ MAIL_CHECK_MASK_RETURNED
This mail was returned. Do not allow returning mail back again.
@ MAIL_CHECK_MASK_NOT_RETURNABLE
This mail cannot be returned even if mail was not returned before.
std::vector< MailItemInfo > MailItemInfoVec
#define MAX_GOSSIP_TEXT_OPTIONS
#define MAX_GOSSIP_TEXT_EMOTES
uint32 MAKE_PAIR32(uint16 l, uint16 h)
#define DEFAULT_PLAYER_COMBAT_REACH
#define DEFAULT_VISIBILITY_DISTANCE
@ TEMPSUMMON_MANUAL_DESPAWN
#define INTERACTION_DISTANCE
uint16 MAKE_PAIR16(uint8 l, uint8 h)
LanguageDesc lang_description[LANGUAGES_COUNT]
void CheckAndFixGOChairHeightId(GameObjectTemplate const *goInfo, uint32 &dataN, uint32 N)
static LanguageType GetRealmLanguageType(bool create)
#define ChooseCreatureFlagSource(field)
void CheckGONoDamageImmuneId(GameObjectTemplate *goTemplate, uint32 dataN, uint32 N)
void CheckGOSpellId(GameObjectTemplate const *goInfo, uint32 dataN, uint32 N)
ScriptMapMap * GetScriptsMapByType(ScriptsType type)
std::string GetScriptCommandName(ScriptCommands command)
bool isValidString(const std::wstring &wstr, uint32 strictMask, bool numericOrSpace, bool create=false)
LanguageDesc const * GetLanguageDescByID(uint32 lang)
ScriptMapMap sEventScripts
void CheckGOConsumable(GameObjectTemplate const *goInfo, uint32 dataN, uint32 N)
void CheckGOLinkedTrapId(GameObjectTemplate const *goInfo, uint32 dataN, uint32 N)
void CheckGOLockId(GameObjectTemplate const *goInfo, uint32 dataN, uint32 N)
std::string GetScriptsTableNameByType(ScriptsType type)
ScriptMapMap sWaypointScripts
bool normalizePlayerName(std::string &name)
std::pair< GraveyardContainer::iterator, GraveyardContainer::iterator > GraveyardMapBoundsNonConst
std::pair< GraveyardContainer::const_iterator, GraveyardContainer::const_iterator > GraveyardMapBounds
std::multimap< uint32, ScriptInfo > ScriptMap
SkillRangeType GetSkillRangeType(SkillRaceClassInfoEntry const *rcEntry)
std::pair< SpellScriptsContainer::iterator, SpellScriptsContainer::iterator > SpellScriptsBounds
ScriptMapMap * GetScriptsMapByType(ScriptsType type)
@ SCRIPT_COMMAND_CREATE_ITEM
@ SCRIPT_COMMAND_DESPAWN_SELF
@ SCRIPT_COMMAND_CLOSE_DOOR
@ SCRIPT_COMMAND_CAST_SPELL
@ SCRIPT_COMMAND_RESPAWN_GAMEOBJECT
@ SCRIPT_COMMAND_QUEST_EXPLORED
@ SCRIPT_COMMAND_ACTIVATE_OBJECT
@ SCRIPT_COMMAND_OPEN_DOOR
@ SCRIPT_COMMAND_FIELD_SET
@ SCRIPT_COMMAND_PLAYMOVIE
@ SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT
@ SCRIPT_COMMAND_TELEPORT_TO
@ SCRIPT_COMMAND_FLAG_SET
@ SCRIPT_COMMAND_TEMP_SUMMON_CREATURE
@ SCRIPT_COMMAND_MOVEMENT
@ SCRIPT_COMMAND_KILL_CREDIT
@ SCRIPT_COMMAND_LOAD_PATH
@ SCRIPT_COMMAND_ORIENTATION
@ SCRIPT_COMMAND_PLAY_SOUND
@ SCRIPT_COMMAND_CLOSE_GOSSIP
@ SCRIPT_COMMAND_REMOVE_AURA
@ SCRIPT_COMMAND_FLAG_REMOVE
std::string GetScriptCommandName(ScriptCommands command)
LanguageDesc const * GetLanguageDescByID(uint32 lang)
std::unordered_map< uint32, CellObjectGuids > CellObjectGuidsMap
#define SPAWNGROUP_MAP_UNSET
TC_GAME_API ScriptMapMap sEventScripts
TC_GAME_API ScriptMapMap sWaypointScripts
std::map< uint32, ScriptMap > ScriptMapMap
@ SUMMONER_TYPE_GAMEOBJECT
std::string GetScriptsTableNameByType(ScriptsType type)
@ ENCOUNTER_CREDIT_KILL_CREATURE
@ ENCOUNTER_CREDIT_CAST_SPELL
std::multimap< uint32, uint32 > QuestRelations
std::vector< std::unique_ptr< DungeonEncounter const > > DungeonEncounterList
std::optional< T > Optional
Optional helper class to wrap optional values within.
#define QUEST_ITEM_DROP_COUNT
#define QUEST_REWARD_ITEM_COUNT
#define QUEST_ITEM_OBJECTIVES_COUNT
#define QUEST_REWARD_REPUTATIONS_COUNT
#define QUEST_OBJECTIVES_COUNT
#define QUEST_REWARD_CHOICES_COUNT
@ QUEST_SPECIAL_FLAGS_COMPLETED_AT_START
@ QUEST_SPECIAL_FLAGS_CAST
@ QUEST_SPECIAL_FLAGS_TIMED
@ QUEST_SPECIAL_FLAGS_DELIVER
@ QUEST_SPECIAL_FLAGS_REPEATABLE
@ QUEST_SPECIAL_FLAGS_KILL
@ QUEST_SPECIAL_FLAGS_DB_ALLOWED
@ QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT
@ QUEST_SPECIAL_FLAGS_SPEAKTO
@ QUEST_SPECIAL_FLAGS_MONTHLY
@ QUEST_SPECIAL_FLAGS_PLAYER_KILL
uint32 urand(uint32 min, uint32 max)
@ GAMEOBJECT_TYPE_CAPTURE_POINT
@ GAMEOBJECT_TYPE_SPELL_FOCUS
@ GAMEOBJECT_TYPE_GENERIC
@ GAMEOBJECT_TYPE_FISHINGHOLE
@ GAMEOBJECT_TYPE_FLAGDROP
@ GAMEOBJECT_TYPE_QUESTGIVER
@ GAMEOBJECT_TYPE_SPELLCASTER
@ GAMEOBJECT_TYPE_FLAGSTAND
@ GAMEOBJECT_TYPE_AREADAMAGE
@ GAMEOBJECT_TYPE_FISHINGNODE
@ GAMEOBJECT_TYPE_BARBER_CHAIR
@ GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT
#define MAX_REPUTATION_RANK
@ SPELL_EFFECT_SEND_EVENT
@ SPELL_EFFECT_QUEST_COMPLETE
@ SKILL_CATEGORY_LANGUAGES
#define MIN_REPUTATION_RANK
@ CREATURE_FAMILY_HORSE_CUSTOM
@ CHAR_NAME_THREE_CONSECUTIVE
@ CHAR_NAME_INVALID_CHARACTER
@ CHAR_NAME_MIXED_LANGUAGES
@ TOTAL_INVISIBILITY_TYPES
@ MAX_DB_ALLOWED_QUEST_TYPES
constexpr uint32 SkillByQuestSort(int32 QuestSort)
@ SPELL_CLICK_USER_FRIEND
#define MAX_GAMEOBJECT_DATA
@ CHAT_MSG_RAID_BOSS_WHISPER
#define CLASSMASK_ALL_PLAYABLE
@ PET_NAME_MIXED_LANGUAGES
#define RACEMASK_ALL_PLAYABLE
#define CLASSMASK_ALL_CREATURES
@ EXPANSION_THE_BURNING_CRUSADE
@ EXPANSION_WRATH_OF_THE_LICH_KING
@ SKILL_LANG_DEMON_TONGUE
#define MAX_SPILLOVER_FACTIONS
@ SPAWNGROUP_FLAG_MANUAL_SPAWN
@ SPAWNGROUP_FLAG_COMPATIBILITY_MODE
@ LINKED_RESPAWN_CREATURE_TO_GO
@ LINKED_RESPAWN_GO_TO_GO
@ LINKED_RESPAWN_CREATURE_TO_CREATURE
@ LINKED_RESPAWN_GO_TO_CREATURE
@ SPELL_AURA_CONTROL_VEHICLE
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
@ UNIT_STAND_STATE_SIT_HIGH_CHAIR
@ UNIT_STAND_STATE_SIT_LOW_CHAIR
#define MAX_DECLINED_NAME_CASES
@ UNIT_NPC_FLAG_QUESTGIVER
@ UNIT_NPC_FLAG_SPELLCLICK
#define MAX_EQUIPMENT_ITEMS
std::wstring GetMainPartOfName(std::wstring const &wname, uint32 declension)
bool WStrToUtf8(wchar_t const *wstr, size_t size, std::string &utf8str)
void wstrToLower(std::wstring &str)
bool Utf8toWStr(char const *utf8str, size_t csize, wchar_t *wstr, size_t &wsize)
bool isCyrillicString(std::wstring_view wstr, bool numericOrSpace)
bool isBasicLatinString(std::wstring_view wstr, bool numericOrSpace)
bool isEastAsianString(std::wstring_view wstr, bool numericOrSpace)
constexpr std::underlying_type< E >::type AsUnderlyingType(E enumValue)
bool isExtendedLatinString(std::wstring_view wstr, bool numericOrSpace)
struct WcharToUpper wcharToUpper
std::vector< VehicleAccessory > VehicleAccessoryList
@ WORLD_SEL_WAYPOINT_DATA_ACTION
@ WORLD_INS_GRAVEYARD_ZONE
@ WORLD_SEL_NPC_VENDOR_REF
@ WORLD_REP_LINKED_RESPAWN
@ WORLD_UPD_GAMEOBJECT_ZONE_AREA_DATA
@ WORLD_UPD_CREATURE_ZONE_AREA_DATA
@ WORLD_DEL_LINKED_RESPAWN
@ WORLD_DEL_GRAVEYARD_ZONE
void PSendSysMessage(char const *fmt, Args &&... args)
virtual void SendSysMessage(std::string_view str, bool escapeCharacters=false)
bool LoadFromDB(ObjectGuid::LowType spawnId, Map *map, bool addToMap, bool allowDuplicate)
static float _GetDamageMod(int32 Rank)
Class used to access individual fields of database query result.
std::string GetString() const
std::string_view GetStringView() const
bool LoadFromDB(ObjectGuid::LowType spawnId, Map *map, bool addToMap, bool=true)
bool HaveQuestLootFor(uint32 loot_id) const
static bool IsValidMapCoord(uint32 mapid, float x, float y)
static bool IsValidMAP(uint32 mapid, bool startUp)
bool IsRemovalGrid(float x, float y) const
bool Instanceable() const
bool IsGridLoaded(uint32 gridId) const
static TypeID GetTypeId(HighGuid high)
void GetPlayerClassLevelInfo(uint32 class_, uint8 level, PlayerClassLevelInfo *info) const
CreatureMovementData const * GetCreatureMovementOverride(ObjectGuid::LowType spawnId) const
QuestOfferRewardLocaleContainer _questOfferRewardLocaleStore
QuestPOIWrapper const * GetQuestPOIWrapper(uint32 questId) const
AccessRequirement const * GetAccessRequirement(uint32 mapid, Difficulty difficulty) const
CellObjectGuidsMap const * GetMapObjectGuids(uint16 mapid, uint8 spawnMode)
static void ChooseCreatureFlags(CreatureTemplate const *cinfo, uint32 *npcflag, uint32 *unit_flags, uint32 *dynamicflags, CreatureData const *data=nullptr)
EquipmentInfo const * GetEquipmentInfo(uint32 entry, int8 &id) const
void AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedCost, bool persist=true)
TempSummonDataContainer _tempSummonDataStore
Stores temp summon data grouped by summoner's entry, summoner's type and group id.
QuestRelations _creatureQuestInvolvedRelations
PetLevelInfo const * GetPetLevelInfo(uint32 creature_id, uint8 level) const
void LoadCreatureTemplateResistances()
VehicleAccessoryList const * GetVehicleAccessoryList(Vehicle *veh) const
std::set< uint32 > _difficultyEntries[MAX_DIFFICULTY - 1]
VehicleAccessoryContainer _vehicleAccessoryStore
uint32 GetXPForLevel(uint8 level) const
void LoadCreatureTemplate(Field *fields)
GameObjectTemplateAddonContainer _gameObjectTemplateAddonStore
CreatureBaseStats const * GetCreatureBaseStats(uint8 level, uint8 unitClass)
void LoadCreatureTemplateSpells()
InstanceTemplate const * GetInstanceTemplate(uint32 mapId) const
TrinityString const * GetTrinityString(uint32 entry) const
void LoadReputationOnKill()
CellObjectGuids const * GetCellObjectGuids(uint16 mapid, uint8 spawnMode, uint32 cell_id)
void LoadGameObjectTemplate()
CreatureAddon const * GetCreatureTemplateAddon(uint32 entry) const
void LoadFactionChangeSpells()
void LoadFactionChangeItems()
void LoadAreaTriggerTeleports()
void LoadNpcTextLocales()
ObjectGuid::LowType AddCreatureData(uint32 entry, uint32 map, Position const &pos, uint32 spawntimedelay=0)
void LoadPageTextLocales()
AreaTriggerTeleport const * GetGoBackTrigger(uint32 Map) const
HalfNameContainer _petHalfName1
GossipTextContainer _gossipTextStore
void LoadVehicleTemplate()
void LoadInstanceTemplate()
uint32 GetTaxiMountDisplayId(uint32 id, uint32 team, bool allowed_alt_team=false)
SpellScriptsContainer _spellScriptsStore
SpawnGroupDataContainer _spawnGroupDataStore
WorldSafeLocsEntry const * GetDefaultGraveyard(uint32 team) const
void LoadQuestGreetingLocales()
CreatureDataContainer _creatureDataStore
void AddGameobjectToGrid(ObjectGuid::LowType guid, GameObjectData const *data)
void ValidateSpellScripts()
void LoadCreatureQuestEnders()
QuestRelations _goQuestRelations
void LoadGameobjectQuestEnders()
void LoadCreatureMovementOverrides()
void LoadCreatureLocales()
TavernAreaTriggerContainer _tavernAreaTriggerStore
void LoadCreatureClassLevelStats()
PlayerInfo const * GetPlayerInfo(uint32 race, uint32 class_) const
void LoadCreatureTemplates()
GossipText const * GetGossipText(uint32 Text_ID) const
GameObjectTemplateAddon const * GetGameObjectTemplateAddon(uint32 entry) const
PageTextLocaleContainer _pageTextLocaleStore
EquipmentInfoContainer _equipmentInfoStore
ObjectGuid::LowType _gameObjectSpawnId
AccessRequirementContainer _accessRequirementStore
void LoadQuestAreaTriggers()
QuestGreetingLocaleContainer _questGreetingLocaleStore
CreatureTemplateContainer _creatureTemplateStore
bool AddGameTele(GameTele &data)
std::vector< std::string > ScriptNameContainer
static bool CheckDeclinedNames(const std::wstring &w_ownname, DeclinedName const &names)
void LoadQuestOfferRewardLocale()
void LoadFactionChangeAchievements()
void LoadGameObjectOverrides()
SpellScriptsBounds GetSpellScriptsBounds(uint32 spellId)
QuestRequestItemsLocaleContainer _questRequestItemsLocaleStore
void AddCreatureToGrid(ObjectGuid::LowType guid, CreatureData const *data)
ItemSetNameContainer _itemSetNameStore
QuestGreetingContainer _questGreetingStore
SpawnGroupTemplateData const * GetLegacySpawnGroup() const
void LoadFactionChangeReputations()
std::set< uint32 > _transportMaps
std::unordered_map< ObjectGuid::LowType, CreatureMovementData > _creatureMovementOverrides
GraveyardContainer GraveyardStore
bool RemoveVendorItem(uint32 entry, uint32 item, bool persist=true)
DungeonEncounterList const * GetDungeonEncounterList(uint32 mapId, Difficulty difficulty) const
std::string const & GetScriptName(uint32 id) const
GameObjectTemplateContainer _gameObjectTemplateStore
void LoadReputationSpilloverTemplate()
void LoadExplorationBaseXP()
void LoadFishingBaseSkillLevel()
std::set< uint32 > _hasDifficultyEntries[MAX_DIFFICULTY - 1]
InstanceSpawnGroupContainer _instanceSpawnGroupStore
void LoadQuestRequestItemsLocale()
PlayerTotemModelMap _playerTotemModel
void GetPlayerLevelInfo(uint32 race, uint32 class_, uint8 level, PlayerLevelInfo *info) const
CreatureAddon const * GetCreatureAddon(ObjectGuid::LowType lowguid) const
void LoadEquipmentTemplates()
GameObjectData const * GetGameObjectData(ObjectGuid::LowType spawnId) const
ItemTemplateContainer _itemTemplateStore
void LoadQuestStartersAndEnders()
GameObjectOverride const * GetGameObjectOverride(ObjectGuid::LowType spawnId) const
GameObjectDataContainer _gameObjectDataStore
void LoadSpawnGroupTemplates()
AreaTriggerTeleport const * GetAreaTrigger(uint32 trigger) const
void LoadGraveyardZones()
uint32 GeneratePetNumber()
uint32 GetNearestTaxiNode(float x, float y, float z, uint32 mapid, uint32 team)
WorldSafeLocsEntry const * GetClosestGraveyard(float x, float y, float z, uint32 MapId, uint32 team, WorldObject *conditionObject) const
void LoadGossipMenuItemsLocales()
CreatureLocaleContainer _creatureLocaleStore
void CheckCreatureTemplate(CreatureTemplate const *cInfo)
std::atomic< uint32 > _hiPetNumber
void LoadCreatureDefaultTrainers()
bool IsReservedName(std::string_view name) const
GameTele const * GetGameTeleExactName(std::string_view name) const
int32 GetBaseReputationOf(FactionEntry const *factionEntry, uint8 race, uint8 playerClass) const
PointOfInterestLocaleContainer _pointOfInterestLocaleStore
InstanceTemplateContainer _instanceTemplateStore
bool DeleteGameTele(std::string_view name)
QuestRelations _goQuestInvolvedRelations
void LoadCreatureQuestItems()
void LoadNPCSpellClickSpells()
QuestAreaTriggerContainer _questAreaTriggerStore
bool IsTransportMap(uint32 mapId) const
std::atomic< uint32 > _mailId
static PetNameInvalidReason CheckPetName(std::string_view name, LocaleConstant locale)
uint32 GetModelForTotem(SummonSlot totemSlot, Races race) const
ObjectGuid::LowType _creatureSpawnId
AreaTriggerContainer _areaTriggerStore
ScriptNameContainer const & GetAllScriptNames() const
std::unique_ptr< PlayerClassInfo > _playerClassInfo[MAX_CLASSES]
uint32 LoadReferenceVendor(int32 vendor, int32 item, std::set< uint32 > *skip_vendors)
void LoadAccessRequirements()
MapObjectGuids _mapObjectGuidsStore
CreatureAddonContainer _creatureAddonStore
QuestGreeting const * GetQuestGreeting(ObjectGuid guid) const
void LoadItemSetNameLocales()
PetLevelInfoContainer _petInfoStore
void RemoveGraveyardLink(uint32 id, uint32 zoneId, uint32 team, bool persist=false)
VehicleAccessoryTemplateContainer _vehicleTemplateAccessoryStore
static ObjectMgr * instance()
ObjectGuid::LowType AddGameObjectData(uint32 entry, uint32 map, Position const &pos, QuaternionData const &rot, uint32 spawntimedelay=0)
void LoadVehicleTemplateAccessories()
void DeleteGameObjectData(ObjectGuid::LowType spawnId)
NpcTextLocaleContainer _npcTextLocaleStore
HalfNameContainer _petHalfName0
void LoadGameObjectLocales()
void LoadQuestGreetings()
QuestContainer _questTemplates
void PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint32 itemId, int32 count)
PageText const * GetPageText(uint32 pageEntry)
void LoadCreatureTemplateAddons()
static ResponseCodes CheckPlayerName(std::string_view name, LocaleConstant locale, bool create=false)
std::map< HighGuid, std::unique_ptr< ObjectGuidGenerator > > _guidGenerators
ItemSetNameLocaleContainer _itemSetNameLocaleStore
ObjectGuidGenerator & GetGuidSequenceGenerator(HighGuid high)
uint32 GetBaseXP(uint8 level)
CreatureTemplateAddonContainer _creatureTemplateAddonStore
static bool IsValidCharterName(std::string_view name)
std::unordered_map< uint32, VehicleTemplate > _vehicleTemplateStore
GameObjectTemplate const * GetGameObjectTemplate(uint32 entry) const
void LoadBroadcastTextLocales()
uint32 GetScriptId(std::string const &name)
void LoadBroadcastTexts()
std::unique_ptr< PlayerInfo > _playerInfo[MAX_RACES][MAX_CLASSES]
GossipMenuItemsLocaleContainer _gossipMenuItemsLocaleStore
BaseXPContainer _baseXPTable
void LoadGameObjectTemplateAddons()
void RemoveCreatureFromGrid(ObjectGuid::LowType guid, CreatureData const *data)
void LoadTavernAreaTriggers()
void LoadReputationRewardRate()
AreaTriggerScriptContainer _areaTriggerScriptStore
ObjectGuid::LowType GenerateGameObjectSpawnId()
void CheckCreatureMovement(char const *table, uint64 id, CreatureMovementData &creatureMovement)
Trainer::Trainer const * GetTrainer(uint32 creatureId) const
QuestRelations _creatureQuestRelations
QuestLocaleContainer _questLocaleStore
Quest const * GetQuestTemplate(uint32 quest_id) const
ObjectGuid::LowType GenerateCreatureSpawnId()
VehicleTemplate const * GetVehicleTemplate(Vehicle *veh) const
DungeonEncounterContainer _dungeonEncounterStore
GameObjectAddon const * GetGameObjectAddon(ObjectGuid::LowType lowguid) const
void LoadGameobjectQuestStarters()
void LoadScripts(ScriptsType type)
RepOnKillContainer _repOnKillStore
void LoadGameObjectForQuests()
void LoadFactionChangeTitles()
uint32 GetAreaTriggerScriptId(uint32 trigger_id) const
SpawnGroupLinkContainer _spawnGroupMapStore
RepSpilloverTemplateContainer _repSpilloverTemplateStore
void LoadAreaTriggerScripts()
bool SetCreatureLinkedRespawn(ObjectGuid::LowType guid, ObjectGuid::LowType linkedGuid)
SpawnMetadata const * GetSpawnMetadata(SpawnObjectType type, ObjectGuid::LowType spawnId) const
void ReturnOrDeleteOldMails(bool serverUp)
void LoadGameObjectAddons()
SpawnGroupTemplateData const * GetDefaultSpawnGroup() const
GameObjectData & NewOrExistGameObjectData(ObjectGuid::LowType spawnId)
CreatureModelInfo const * GetCreatureModelInfo(uint32 modelId) const
void LoadWaypointScripts()
CreatureModelContainer _creatureModelStore
LinkedRespawnContainer _linkedRespawnStore
uint64 GenerateEquipmentSetGuid()
void GetTaxiPath(uint32 source, uint32 destination, uint32 &path, uint32 &cost)
void DeleteCreatureData(ObjectGuid::LowType spawnId)
bool IsVendorItemValid(uint32 vendor_entry, uint32 id, int32 maxcount, uint32 ptime, uint32 ExtendedCost, Player *player=nullptr, std::set< uint32 > *skip_vendors=nullptr, uint32 ORnpcflag=0) const
void LoadInstanceEncounters()
GameObjectLocaleContainer _gameObjectLocaleStore
GameObjectAddonContainer _gameObjectAddonStore
void LoadCreatureQuestStarters()
GameTele const * GetGameTele(uint32 id) const
void LoadInstanceSpawnGroups()
PlayerXPperLevel _playerXPperLevel
void LoadSpellScriptNames()
CreatureTemplate const * GetCreatureTemplate(uint32 entry) const
void LoadMailLevelRewards()
void BuildPlayerLevelInfo(uint8 race, uint8 class_, uint8 level, PlayerLevelInfo *plinfo) const
CreatureData const * GetCreatureData(ObjectGuid::LowType spawnId) const
PointOfInterestContainer _pointsOfInterestStore
static void AddLocaleString(std::string &&value, LocaleConstant localeConstant, std::vector< std::string > &data)
void LoadGameObjectQuestItems()
void LoadPointsOfInterest()
void LoadFactionChangeQuests()
CreatureModelInfo const * GetCreatureModelRandomGender(uint32 *displayID) const
RepRewardRateContainer _repRewardRateStore
uint32 GenerateAuctionID()
std::string GeneratePetName(uint32 entry)
void LoadPointOfInterestLocales()
VehicleSeatAddonContainer _vehicleSeatAddonStore
bool LoadTrinityStrings()
CreatureData & NewOrExistCreatureData(ObjectGuid::LowType spawnId)
void LoadPlayerTotemModels()
PageTextContainer _pageTextStore
void LoadGossipMenuItems()
ItemLocaleContainer _itemLocaleStore
ExclusiveQuestGroups _exclusiveQuestGroups
void LoadVehicleAccessories()
void RemoveGameobjectFromGrid(ObjectGuid::LowType guid, GameObjectData const *data)
void LoadCreatureModelInfo()
void LoadVehicleSeatAddon()
GraveyardData const * FindGraveyardData(uint32 id, uint32 zone) const
void InitializeQueriesData(QueryDataGroup mask)
void LoadReservedPlayersNames()
AreaTriggerTeleport const * GetMapEntranceTrigger(uint32 Map) const
QuestPOIContainer _questPOIStore
void OnDeleteSpawnData(SpawnData const *data)
SpellClickInfoContainer _spellClickInfoStore
void LoadCreatureAddons()
bool AddGraveyardLink(uint32 id, uint32 zoneId, uint32 team, bool persist=true)
GameObjectOverrideContainer _gameObjectOverrideStore
static uint32 ChooseDisplayId(CreatureTemplate const *cinfo, CreatureData const *data=nullptr)
void LoadQuestRelationsHelper(QuestRelations &map, std::string const &table)
ItemTemplate const * GetItemTemplate(uint32 entry) const
static Creature * ToCreature(Object *o)
ObjectGuid GetGUID() const
static Player * ToPlayer(Object *o)
WorldSession * GetSession() const
void setUInt16(uint8 index, uint16 value)
void setUInt32(uint8 index, uint32 value)
void setFloat(uint8 index, float value)
void setUInt64(uint8 index, uint64 value)
void setUInt8(uint8 index, uint8 value)
void setString(uint8 index, std::string const &value)
std::array< uint32, QUEST_OBJECTIVES_COUNT > RequiredNpcOrGoCount
std::array< int32, QUEST_REWARD_REPUTATIONS_COUNT > RewardFactionValue
uint32 _requiredSkillPoints
uint32 GetRewTitle() const
std::vector< uint32 > DependentBreadcrumbQuests
int32 _breadcrumbForQuestId
void LoadQuestDetails(Field *fields)
std::array< uint32, QUEST_REWARD_CHOICES_COUNT > RewardChoiceItemCount
bool HasSpecialFlag(QuestSpecialFlags flag) const
uint32 _requiredFactionId2
uint32 _sourceItemIdCount
static bool IsTakingQuestEnabled(uint32 questId)
std::array< uint32, QUEST_REWARD_CHOICES_COUNT > RewardChoiceItemId
void LoadQuestRequestItems(Field *fields)
uint32 _requiredMinRepFaction
std::array< uint32, QUEST_REWARD_ITEM_COUNT > RewardItemId
int32 _requiredMinRepValue
std::array< uint32, QUEST_REWARD_ITEM_COUNT > RewardItemCount
uint32 GetSrcItemCount() const
void LoadQuestMailSender(Field *fields)
int32 _requiredFactionValue2
uint32 _requiredFactionId1
int32 _requiredMaxRepValue
std::array< uint32, QUEST_ITEM_OBJECTIVES_COUNT > RequiredItemId
uint32 GetQuestType() const
uint32 _requiredMaxRepFaction
std::vector< uint32 > DependentPreviousQuests
uint32 GetQuestId() const
void LoadQuestOfferReward(Field *fields)
uint32 _requiredPlayerKills
std::array< uint32, QUEST_ITEM_DROP_COUNT > ItemDropQuantity
int32 GetBreadcrumbForQuestId() const
uint32 _rewardDisplaySpell
void SetSpecialFlag(QuestSpecialFlags flag)
std::array< int32, QUEST_REWARD_REPUTATIONS_COUNT > RewardFactionOverride
std::array< uint32, QUEST_REWARD_REPUTATIONS_COUNT > RewardFactionId
uint32 GetSrcItemId() const
int32 _requiredFactionValue1
uint32 _rewardMailSenderEntry
std::array< uint32, QUEST_ITEM_OBJECTIVES_COUNT > RequiredItemCount
std::array< uint32, QUEST_ITEM_DROP_COUNT > ItemDrop
std::array< int32, QUEST_OBJECTIVES_COUNT > RequiredNpcOrGo
uint32 _rewardMailTemplateId
void LoadQuestTemplateAddon(Field *fields)
static const int32 Reputation_Cap
SpellInfo const * GetFirstRankSpell() const
int32 GetDuration() const
SpellInfo const * GetNextRankSpell() const
bool HasAura(AuraType aura) const
std::array< SpellEffectInfo, MAX_SPELL_EFFECTS > const & GetEffects() const
static bool IsSpellValid(SpellInfo const *spellInfo, Player *player=nullptr, bool msg=true)
Some checks for spells, to prevent adding deprecated/broken spells for trainers, spell book,...
Unit * GetSummonerUnit() const
decltype(auto) PostWork(T &&work)
TempSummon * ToTempSummon()
bool IsInRaidWith(Unit const *unit) const
bool IsInPartyWith(Unit const *unit) const
Unit * GetBase() const
May be called from scripts.
uint32 GetCreatureEntry() const
std::string const & GetName() const
bool IsFriendlyTo(WorldObject const *target) const
static void StopNow(uint8 exitcode)
@ REALM_ZONE_LATIN_AMERICA
@ REALM_ZONE_UNITED_STATES
@ CONFIG_STRICT_PET_NAMES
@ CONFIG_MAX_PLAYER_LEVEL
@ CONFIG_MIN_CHARTER_NAME
@ CONFIG_STRICT_CHARTER_NAMES
@ CONFIG_STRICT_PLAYER_NAMES
@ CONFIG_CALCULATE_GAMEOBJECT_ZONE_AREA_DATA
@ CONFIG_CALCULATE_CREATURE_ZONE_AREA_DATA
@ CONFIG_CACHE_DATA_QUERIES
@ CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES
bool IsDisabledFor(DisableType type, uint32 entry, WorldObject const *ref, uint8 flags)
TC_GAME_API Player * FindConnectedPlayer(ObjectGuid const &)
auto MapGetValuePtr(M &map, typename M::key_type const &key)
TC_COMMON_API std::vector< std::string_view > Tokenize(std::string_view str, char sep, bool keepEmpty)
bool IsValidMapCoord(float c)
std::string StringFormat(FormatString< Args... > fmt, Args &&... args)
Default TC string format function.
CellCoord ComputeCellCoord(float x, float y)
std::array< uint32, 3 > EmoteDelay
std::vector< std::string > Text
std::array< uint32, 3 > EmoteID
std::vector< std::string > Text1
int32 ItemID[MAX_OUTFIT_ITEMS]
std::vector< uint32 > auras
VisibilityDistanceType visibilityDistanceType
float BaseDamage[MAX_EXPANSIONS]
uint32 BaseHealth[MAX_EXPANSIONS]
uint32 GenerateMana(CreatureTemplate const *info) const
uint32 GenerateHealth(CreatureTemplate const *info) const
std::vector< std::string > Title
std::vector< std::string > Name
uint32 displayId_other_gender
CreatureRandomMovementType Random
CreatureFlightMovementType Flight
CreatureChaseMovementType Chase
CreatureGroundMovementType Ground
uint32 InteractionPauseTimer
uint32 MechanicImmuneMask
uint32 spells[MAX_CREATURE_SPELLS]
int32 resistance[MAX_SPELL_SCHOOL]
uint32 SpellSchoolImmuneMask
CreatureMovementData Movement
uint32 KillCredit[MAX_KILL_CREDIT]
uint32 GetFirstInvisibleModel() const
uint32 DifficultyEntry[MAX_DIFFICULTY - 1]
uint32 GetRandomValidModelId() const
std::string name[MAX_DECLINED_NAME_CASES]
uint32 ItemEntry[MAX_EQUIPMENT_ITEMS]
uint32 ReputationClassMask[4]
uint32 ReputationRaceMask[4]
bool CanHaveReputation() const
QuaternionData ParentRotation
InvisibilityType invisibilityType
std::vector< std::string > Name
std::vector< std::string > CastBarCaption
std::array< uint32, 4 > artKits
struct GameObjectTemplate::@191::@214 flagdrop
struct GameObjectTemplate::@191::@210 spellcaster
struct GameObjectTemplate::@191::@199 chair
struct GameObjectTemplate::@191::@200 spellFocus
uint32 data[MAX_GAMEOBJECT_DATA]
struct GameObjectTemplate::@191::@213 fishinghole
struct GameObjectTemplate::@191::@204 areadamage
bool IsDespawnAtAction() const
struct GameObjectTemplate::@191::@206 moTransport
struct GameObjectTemplate::@191::@223 raw
struct GameObjectTemplate::@191::@212 flagstand
struct GameObjectTemplate::@191::@219 barberChair
struct GameObjectTemplate::@191::@202 goober
struct GameObjectTemplate::@191::@205 camera
struct GameObjectTemplate::@191::@196 chest
struct GameObjectTemplate::@191::@195 questgiver
struct GameObjectTemplate::@191::@193 door
std::string castBarCaption
struct GameObjectTemplate::@191::@194 button
struct GameObjectTemplate::@191::@198 trap
QEmote Emotes[MAX_GOSSIP_TEXT_EMOTES]
GossipTextOption Options[MAX_GOSSIP_TEXT_OPTIONS]
int32 SoundOverrideSubclassID
std::vector< std::string > Description
std::vector< std::string > Name
uint32 ItemID[MAX_ITEM_SET_ITEMS]
std::vector< std::string > Name
std::array< uint32, MAX_ITEM_PROTO_FLAGS > Flags
std::array< ItemEffect, MAX_ITEM_PROTO_SPELLS > Effects
float ArmorDamageModifier
std::array< _Socket, MAX_ITEM_PROTO_SOCKETS > Socket
uint32 RequiredDisenchantSkill
uint32 RequiredReputationRank
uint32 RequiredReputationFaction
bool HasFlag(ItemFlags flag) const
uint32 ScalingStatDistribution
std::array< _ItemStat, MAX_ITEM_PROTO_STATS > ItemStat
int32 SoundOverrideSubclass
std::array< _Damage, MAX_ITEM_PROTO_DAMAGES > Damage
ObjectGuid::LowType item_guid
ObjectGuid::LowType receiver
ObjectGuid::LowType sender
std::vector< MailItemInfo > items
bool IsBattlegroundOrArena() const
bool Instanceable() const
std::vector< std::string > Text_0[MAX_GOSSIP_TEXT_OPTIONS]
std::vector< std::string > Text_1[MAX_GOSSIP_TEXT_OPTIONS]
std::vector< std::string > Text
std::vector< std::string > Name
std::string ToString() const
float GetOrientation() const
float GetPositionX() const
float GetPositionY() const
void Relocate(float x, float y)
static QuaternionData fromEulerAnglesZYX(float Z, float Y, float X)
std::vector< std::string > greeting
std::array< std::vector< std::string >, QUEST_OBJECTIVES_COUNT > ObjectiveText
std::vector< std::string > QuestCompletionLog
std::vector< std::string > LogDescription
std::vector< std::string > AreaDescription
std::vector< std::string > LogTitle
std::vector< std::string > QuestDescription
std::vector< std::string > RewardText
std::vector< QuestPOIBlobPoint > QuestPOIBlobPointStats
std::vector< QuestPOIBlobData > QuestPOIBlobDataStats
ByteBuffer BuildQueryData() const
void InitializeQueryData()
QuestRelations::const_iterator _it
QuestRelations::const_iterator _end
bool HasQuest(uint32 questId) const
QuestRelations::const_iterator _end
QuestRelations::const_iterator _begin
std::vector< std::string > CompletionText
float questRepeatableRate
uint32 faction_rank[MAX_SPILLOVER_FACTIONS]
uint32 faction[MAX_SPILLOVER_FACTIONS]
float faction_rate[MAX_SPILLOVER_FACTIONS]
struct ScriptInfo::@228::@242 RemoveAura
struct ScriptInfo::@228::@241 ToggleDoor
struct ScriptInfo::@228::@231 Talk
struct ScriptInfo::@228::@237 QuestExplored
struct ScriptInfo::@228::@232 Emote
struct ScriptInfo::@228::@236 TeleportTo
ObjectGuid::LowType GOGuid
struct ScriptInfo::@228::@239 RespawnGameobject
struct ScriptInfo::@228::@243 CastSpell
struct ScriptInfo::@228::@230 Raw
std::string GetDebugInfo() const
struct ScriptInfo::@228::@238 KillCredit
struct ScriptInfo::@228::@245 CreateItem
struct ScriptInfo::@228::@240 TempSummonCreature
bool IsFitToRequirements(Unit const *clicker, Unit const *clickee) const
SpellClickUserTypes userType
uint32 MountCreatureID[2]
Stores data for temp summons.
TempSummonType type
Summon type, see TempSummonType for available types.
uint32 time
Despawn time, usable only with certain temp summon types.
uint32 entry
Entry of summoned creature.
Position pos
Position, where should be creature spawned.
Key for storing temp summon data in TempSummonDataContainer.
std::array< uint32, 3 > ReqAbility
std::vector< std::string > Content
Milliseconds DespawnDelay
void AddItem(uint32 item, int32 maxcount, uint32 ptime, uint32 ExtendedCost)
VendorItem const * FindItemCostPair(uint32 item_id, uint32 extendedCost) const