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, std::string(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, std::string(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
1702 TC_LOG_ERROR(
"sql.sql",
"Model (Entry: {}) has modelid_other_gender {} not found in table `creature_model_info`. ", *displayID, modelInfo->
modelid_other_gender);
1718 QueryResult result =
WorldDatabase.Query(
"SELECT DisplayID, BoundingRadius, CombatReach, Gender, DisplayID_Other_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();
1735 if (!creatureDisplay)
1737 TC_LOG_ERROR(
"sql.sql",
"Table `creature_model_info` has model for nonexistent display id ({}).", modelId);
1753 TC_LOG_ERROR(
"sql.sql",
"Table `creature_model_info` has wrong gender ({}) for display id ({}).",
uint32(modelInfo.
gender), modelId);
1759 TC_LOG_ERROR(
"sql.sql",
"Table `creature_model_info` has nonexistent alt.gender model ({}) for existed display id ({}).", modelInfo.
modelid_other_gender, modelId);
1767 modelInfo.
is_trigger = strstr(modelData->ModelName,
"InvisibleStalker") !=
nullptr;
1771 while (result->NextRow());
1784 TC_LOG_INFO(
"server.loading",
">> Loaded 0 player totem model records. DB table `player_totem_model` is empty.");
1791 Field* fields = result->Fetch();
1797 if (totemSlot < SUMMON_SLOT_TOTEM_FIRE || totemSlot >=
MAX_TOTEM_SLOT)
1799 TC_LOG_ERROR(
"sql.sql",
"Wrong TotemSlot {} in `player_totem_model` table, skipped.", totemSlot);
1806 TC_LOG_ERROR(
"sql.sql",
"Race {} defined in `player_totem_model` does not exists, skipped.",
uint32(race));
1813 TC_LOG_ERROR(
"sql.sql",
"TotemSlot: {} defined in `player_totem_model` has non-existing model ({}), skipped.", totemSlot, displayId);
1820 while (result->NextRow());
1839 QueryResult result =
WorldDatabase.Query(
"SELECT guid, linkedGuid, linkType FROM linked_respawn ORDER BY guid ASC");
1843 TC_LOG_INFO(
"server.loading",
">> Loaded 0 linked respawns. DB table `linked_respawn` is empty.");
1849 Field* fields = result->Fetch();
1864 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature (guid) '{}' not found in creature table", guidLow);
1872 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature (linkedGuid) '{}' not found in creature table", linkedGuidLow);
1880 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature '{}' linking to Creature '{}' on an unpermitted map.", guidLow, linkedGuidLow);
1887 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature '{}' linking to Creature '{}' with not corresponding spawnMask", guidLow, linkedGuidLow);
1892 guid = ObjectGuid::Create<HighGuid::Unit>(slave->
id, guidLow);
1893 linkedGuid = ObjectGuid::Create<HighGuid::Unit>(master->
id, linkedGuidLow);
1901 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature (guid) '{}' not found in creature table", guidLow);
1909 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Gameobject (linkedGuid) '{}' not found in gameobject table", linkedGuidLow);
1917 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature '{}' linking to Gameobject '{}' on an unpermitted map.", guidLow, linkedGuidLow);
1924 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature '{}' linking to Gameobject '{}' with not corresponding spawnMask", guidLow, linkedGuidLow);
1929 guid = ObjectGuid::Create<HighGuid::Unit>(slave->
id, guidLow);
1930 linkedGuid = ObjectGuid::Create<HighGuid::GameObject>(master->
id, linkedGuidLow);
1938 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Gameobject (guid) '{}' not found in gameobject table", guidLow);
1946 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Gameobject (linkedGuid) '{}' not found in gameobject table", linkedGuidLow);
1954 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Gameobject '{}' linking to Gameobject '{}' on an unpermitted map.", guidLow, linkedGuidLow);
1961 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Gameobject '{}' linking to Gameobject '{}' with not corresponding spawnMask", guidLow, linkedGuidLow);
1966 guid = ObjectGuid::Create<HighGuid::GameObject>(slave->
id, guidLow);
1967 linkedGuid = ObjectGuid::Create<HighGuid::GameObject>(master->
id, linkedGuidLow);
1975 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Gameobject (guid) '{}' not found in gameobject table", guidLow);
1983 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature (linkedGuid) '{}' not found in creature table", linkedGuidLow);
1991 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Gameobject '{}' linking to Creature '{}' on an unpermitted map.", guidLow, linkedGuidLow);
1998 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Gameobject '{}' linking to Creature '{}' with not corresponding spawnMask", guidLow, linkedGuidLow);
2003 guid = ObjectGuid::Create<HighGuid::GameObject>(slave->
id, guidLow);
2004 linkedGuid = ObjectGuid::Create<HighGuid::Unit>(master->
id, linkedGuidLow);
2012 while (result->NextRow());
2024 ObjectGuid guid = ObjectGuid::Create<HighGuid::Unit>(master->
id, guidLow);
2039 TC_LOG_ERROR(
"sql.sql",
"Creature '{}' linking to non-existent creature '{}'.", guidLow, linkedGuidLow);
2046 TC_LOG_ERROR(
"sql.sql",
"Creature '{}' linking to '{}' on an unpermitted map.", guidLow, linkedGuidLow);
2052 TC_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature '{}' linking to '{}' with not corresponding spawnMask", guidLow, linkedGuidLow);
2056 ObjectGuid linkedGuid = ObjectGuid::Create<HighGuid::Unit>(slave->
id, linkedGuidLow);
2074 QueryResult result =
WorldDatabase.Query(
"SELECT summonerId, summonerType, groupId, entry, position_x, position_y, position_z, orientation, summonType, summonTime FROM creature_summon_groups");
2078 TC_LOG_INFO(
"server.loading",
">> Loaded 0 temp summons. DB table `creature_summon_groups` is empty.");
2085 Field* fields = result->Fetch();
2091 switch (summonerType)
2096 TC_LOG_ERROR(
"sql.sql",
"Table `creature_summon_groups` has summoner with non existing entry {} for creature summoner type, skipped.", summonerId);
2103 TC_LOG_ERROR(
"sql.sql",
"Table `creature_summon_groups` has summoner with non existing entry {} for gameobject summoner type, skipped.", summonerId);
2110 TC_LOG_ERROR(
"sql.sql",
"Table `creature_summon_groups` has summoner with non existing entry {} for map summoner type, skipped.", summonerId);
2115 TC_LOG_ERROR(
"sql.sql",
"Table `creature_summon_groups` has unhandled summoner type {} for summoner {}, skipped.", summonerType, summonerId);
2124 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);
2131 float orientation = fields[7].
GetFloat();
2139 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);
2150 }
while (result->NextRow());
2160 QueryResult result =
WorldDatabase.Query(
"SELECT creature.guid, id, map, position_x, position_y, position_z, orientation, modelid, equipment_id, spawntimesecs, wander_distance, "
2162 "currentwaypoint, curhealth, curmana, MovementType, spawnMask, phaseMask, eventEntry, poolSpawnId, creature.npcflag, creature.unit_flags, creature.dynamicflags, "
2164 "creature.ScriptName, creature.StringId "
2166 "LEFT OUTER JOIN game_event_creature ON creature.guid = game_event_creature.guid "
2167 "LEFT OUTER JOIN pool_members ON pool_members.type = 0 AND creature.guid = pool_members.spawnId");
2171 TC_LOG_INFO(
"server.loading",
">> Loaded 0 creatures. DB table `creature` is empty.");
2176 std::map<uint32, uint32> spawnMasks;
2181 spawnMasks[i] |= (1 << k);
2187 Field* fields = result->Fetch();
2195 TC_LOG_ERROR(
"sql.sql",
"Table `creature` has creature (GUID: {}) with non existing creature entry {}, skipped.", guid, entry);
2203 data.
spawnPoint.
Relocate(fields[3].GetFloat(), fields[4].GetFloat(), fields[5].GetFloat(), fields[6].GetFloat());
2226 TC_LOG_ERROR(
"sql.sql",
"Table `creature` has creature (GUID: {}) that spawned at nonexistent map (Id: {}), skipped.", guid, data.
mapId);
2234 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);
2244 TC_LOG_ERROR(
"sql.sql",
"Table `creature` has creature (GUID: {}) that is listed as difficulty {} template (entry: {}) in `creature_template`, skipped.",
2245 guid, diff + 1, data.
id);
2257 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);
2265 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);
2270 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);
2276 TC_LOG_ERROR(
"sql.sql",
"Table `creature` has creature (GUID: {} Entry: {}) with `wander_distance`< 0, set to 0.", guid, data.
id);
2283 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);
2291 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);
2298 TC_LOG_ERROR(
"sql.sql",
"Table `creature` has creature (GUID: {} Entry: {}) with `phaseMask`=0 (not visible for anyone), set to 1.", guid, data.
id);
2304 TC_LOG_ERROR(
"sql.sql",
"Table `creature` has creature (GUID: {} Entry: {}) with disallowed `unit_flags` {}, removing incorrect flag.", guid, data.
id, disallowedUnitFlags);
2310 TC_LOG_ERROR(
"sql.sql",
"Table `creature` has creature (GUID: {} Entry: {}) with `dynamicflags` > 0. Ignored and set to 0.", guid, data.
id);
2330 if (gameEvent == 0 && PoolId == 0)
2333 while (result->NextRow());
2354 for (
uint8 i = 0; mask != 0; i++, mask >>= 1)
2368 for (
uint8 i = 0; mask != 0; i++, mask >>= 1)
2415 TC_LOG_ERROR(
"misc",
"AddGameObjectData: cannot add gameobject entry {} to map", entry);
2466 if (!creature->
LoadFromDB(spawnId, map,
true,
true))
2468 TC_LOG_ERROR(
"misc",
"AddCreature: Cannot add creature entry {} to map", entry);
2482 QueryResult result =
WorldDatabase.Query(
"SELECT gameobject.guid, id, map, position_x, position_y, position_z, orientation, "
2484 "rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state, spawnMask, phaseMask, eventEntry, poolSpawnId, "
2486 "ScriptName, StringId "
2487 "FROM gameobject LEFT OUTER JOIN game_event_gameobject ON gameobject.guid = game_event_gameobject.guid "
2488 "LEFT OUTER JOIN pool_members ON pool_members.type = 1 AND gameobject.guid = pool_members.spawnId");
2492 TC_LOG_INFO(
"server.loading",
">> Loaded 0 gameobjects. DB table `gameobject` is empty.");
2497 std::map<uint32, uint32> spawnMasks;
2502 spawnMasks[i] |= (1 << k);
2508 Field* fields = result->Fetch();
2516 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: {}) with non existing gameobject entry {}, skipped.", guid, entry);
2522 switch (gInfo->
type)
2528 TC_LOG_ERROR(
"sql.sql",
"Gameobject (GUID: {} Entry {} GoType: {}) doesn't have a displayId ({}), not loaded.", guid, entry, gInfo->
type, gInfo->
displayId);
2535 TC_LOG_ERROR(
"sql.sql",
"Gameobject (GUID: {} Entry {} GoType: {}) has an invalid displayId ({}), not loaded.", guid, entry, gInfo->
type, gInfo->
displayId);
2544 data.
spawnPoint.
Relocate(fields[3].GetFloat(), fields[4].GetFloat(), fields[5].GetFloat(), fields[6].GetFloat());
2555 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: {} Entry: {}) spawned on a non-existed map (Id: {}), skip", guid, data.
id, data.
mapId);
2561 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);
2570 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: {} Entry: {}) with invalid `state` ({}) value, skip", guid, data.
id, go_state);
2580 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);
2594 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: {} Entry: {}) with invalid rotationX ({}) value, skip", guid, data.
id, data.
rotation.
x);
2600 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: {} Entry: {}) with invalid rotationY ({}) value, skip", guid, data.
id, data.
rotation.
y);
2606 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: {} Entry: {}) with invalid rotationZ ({}) value, skip", guid, data.
id, data.
rotation.
z);
2612 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: {} Entry: {}) with invalid rotationW ({}) value, skip", guid, data.
id, data.
rotation.
w);
2618 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: {} Entry: {}) with invalid coordinates, skip", guid, data.
id);
2624 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);
2630 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: {} Entry: {}) with `phaseMask`=0 (not visible for anyone), set to 1.", guid, data.
id);
2649 if (gameEvent == 0 && PoolId == 0)
2652 while (result->NextRow());
2668 Field* fields = result->Fetch();
2682 flags &= ~SPAWNGROUP_FLAG_MANUAL_SPAWN;
2683 TC_LOG_ERROR(
"sql.sql",
"System spawn group {} ({}) has invalid manual spawn flag. Ignored.", groupId, group.
name);
2686 }
while (result->NextRow());
2691 TC_LOG_ERROR(
"sql.sql",
"Default spawn group (index 0) is missing from DB! Manually inserted.");
2694 data.
name =
"Default Group";
2700 TC_LOG_ERROR(
"sql.sql",
"Default legacy spawn group (index 1) is missing from DB! Manually inserted.");
2703 data.
name =
"Legacy Group";
2711 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spawn group templates. DB table `spawn_group_template` is empty.");
2725 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spawn group members. DB table `spawn_group` is empty.");
2732 Field* fields = result->Fetch();
2737 TC_LOG_ERROR(
"sql.sql",
"Spawn data with invalid type {} listed for spawn group {}. Skipped.",
uint32(spawnType), groupId);
2745 TC_LOG_ERROR(
"sql.sql",
"Spawn data with ID ({},{}) not found, but is listed as a member of spawn group {}!",
uint32(spawnType), spawnId, groupId);
2750 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);
2756 TC_LOG_ERROR(
"sql.sql",
"Spawn group {} assigned to spawn ID ({},{}), but group does not exist!", groupId,
uint32(spawnType), spawnId);
2766 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);
2769 const_cast<SpawnMetadata*
>(data)->spawnGroupData = &groupTemplate;
2774 }
while (result->NextRow());
2784 QueryResult result =
WorldDatabase.Query(
"SELECT instanceMapId, bossStateId, bossStates, spawnGroupId, flags FROM instance_spawn_groups");
2788 TC_LOG_INFO(
"server.loading",
">> Loaded 0 instance spawn groups. DB table `instance_spawn_groups` is empty.");
2795 Field* fields = result->Fetch();
2800 TC_LOG_ERROR(
"sql.sql",
"Invalid spawn group {} specified for instance {}. Skipped.", spawnGroupId, fields[0].GetUInt16());
2805 if (it->second.mapId != instanceMapId)
2807 TC_LOG_ERROR(
"sql.sql",
"Instance spawn group {} specified for instance {} has spawns on a different map {}. Skipped.",
2808 spawnGroupId, instanceMapId, it->second.mapId);
2818 if (states & ~ALL_STATES)
2821 TC_LOG_ERROR(
"sql.sql",
"Instance spawn group ({},{}) had invalid boss state mask {} - truncated to {}.", instanceMapId, spawnGroupId, states, info.
BossStates);
2830 TC_LOG_ERROR(
"sql.sql",
"Instance spawn group ({},{}) had invalid flags {} - truncated to {}.", instanceMapId, spawnGroupId,
flags, info.
Flags);
2838 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);
2842 }
while (result->NextRow());
2855 for (
auto it = pair.first; it != pair.second; ++it)
2857 if (it->second != data)
2868 for (
uint8 i = 0; mask != 0; i++, mask >>= 1)
2882 for (
uint8 i = 0; mask != 0; i++, mask >>= 1)
2906 Field* fields = result->Fetch();
2909 std::string localeName = fields[1].
GetString();
2918 }
while (result->NextRow());
2928 QueryResult result =
WorldDatabase.Query(
"SELECT entry, class, subclass, SoundOverrideSubclass, name, displayid, Quality, Flags, FlagsExtra, BuyCount, BuyPrice, SellPrice, InventoryType, "
2930 "AllowableClass, AllowableRace, ItemLevel, RequiredLevel, RequiredSkill, RequiredSkillRank, requiredspell, requiredhonorrank, "
2932 "RequiredCityRank, RequiredReputationFaction, RequiredReputationRank, maxcount, stackable, ContainerSlots, StatsCount, stat_type1, "
2934 "stat_value1, stat_type2, stat_value2, stat_type3, stat_value3, stat_type4, stat_value4, stat_type5, stat_value5, stat_type6, "
2936 "stat_value6, stat_type7, stat_value7, stat_type8, stat_value8, stat_type9, stat_value9, stat_type10, stat_value10, "
2938 "ScalingStatDistribution, ScalingStatValue, dmg_min1, dmg_max1, dmg_type1, dmg_min2, dmg_max2, dmg_type2, armor, holy_res, fire_res, "
2940 "nature_res, frost_res, shadow_res, arcane_res, delay, ammo_type, RangedModRange, spellid_1, spelltrigger_1, spellcharges_1, "
2942 "spellppmRate_1, spellcooldown_1, spellcategory_1, spellcategorycooldown_1, spellid_2, spelltrigger_2, spellcharges_2, "
2944 "spellppmRate_2, spellcooldown_2, spellcategory_2, spellcategorycooldown_2, spellid_3, spelltrigger_3, spellcharges_3, "
2946 "spellppmRate_3, spellcooldown_3, spellcategory_3, spellcategorycooldown_3, spellid_4, spelltrigger_4, spellcharges_4, "
2948 "spellppmRate_4, spellcooldown_4, spellcategory_4, spellcategorycooldown_4, spellid_5, spelltrigger_5, spellcharges_5, "
2950 "spellppmRate_5, spellcooldown_5, spellcategory_5, spellcategorycooldown_5, bonding, description, PageText, LanguageID, PageMaterial, "
2952 "startquest, lockid, Material, sheath, RandomProperty, RandomSuffix, block, itemset, MaxDurability, area, Map, BagFamily, "
2954 "TotemCategory, socketColor_1, socketContent_1, socketColor_2, socketContent_2, socketColor_3, socketContent_3, socketBonus, "
2956 "GemProperties, RequiredDisenchantSkill, ArmorDamageModifier, duration, ItemLimitCategory, HolidayId, ScriptName, DisenchantID, "
2958 "FoodType, minMoneyLoot, maxMoneyLoot, flagsCustom FROM item_template");
2962 TC_LOG_INFO(
"server.loading",
">> Loaded 0 item templates. DB table `item_template` is empty.");
2971 Field* fields = result->Fetch();
2976 itemTemplate.
ItemId = entry;
2977 itemTemplate.
Class =
uint32(fields[1].GetUInt8());
3013 itemTemplate.
ItemStat[i].ItemStatType =
uint32(fields[28 + i*2].GetUInt8());
3014 itemTemplate.
ItemStat[i].ItemStatValue =
int32(fields[29 + i*2].GetInt16());
3024 itemTemplate.
Damage[i].DamageType =
uint32(fields[52 + i*3].GetUInt8());
3027 itemTemplate.
Armor =
uint32(fields[56].GetUInt16());
3034 itemTemplate.
Delay =
uint32(fields[63].GetUInt16());
3041 itemTemplate.
Effects[i].TriggerType =
uint32(fields[67 + i * 7].GetUInt8());
3042 itemTemplate.
Effects[i].Charges =
int32(fields[68 + i * 7].GetInt16());
3045 itemTemplate.
Effects[i].SpellCategoryID =
uint32(fields[71 + i * 7].GetUInt16());
3046 itemTemplate.
Effects[i].CategoryCoolDownMSec = fields[72 + i * 7].
GetInt32();
3064 itemTemplate.
Map =
uint32(fields[116].GetUInt16());
3070 itemTemplate.
Socket[i].Color =
uint32(fields[119 + i*2].GetUInt8());
3096 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) does not have a correct class {}, must be {} .", entry, itemTemplate.
Class, dbcitem->
ClassID);
3097 if (enforceDBCAttributes)
3104 if (enforceDBCAttributes)
3109 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) does not have a correct material ({}), must be {} .", entry, itemTemplate.
Material, dbcitem->
Material);
3110 if (enforceDBCAttributes)
3116 if (enforceDBCAttributes)
3122 if (enforceDBCAttributes)
3127 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) does not have a correct sheathid ({}), must be {} .", entry, itemTemplate.
Sheath, dbcitem->
SheatheType);
3128 if (enforceDBCAttributes)
3134 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) does not exist in item.dbc! (not correct id?).", entry);
3138 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong Class value ({})", entry, itemTemplate.
Class);
3144 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong Subclass value ({}) for class {}", entry, itemTemplate.
SubClass, itemTemplate.
Class);
3150 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong Quality value ({})", entry, itemTemplate.
Quality);
3157 if ((itemTemplate.
AllowableRace & faction->ReputationRaceMask[0]) == 0)
3158 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.",
3162 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.",
3168 if ((itemTemplate.
AllowableRace & faction->ReputationRaceMask[0]) == 0)
3169 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.",
3175 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong BuyCount value ({}), set to default(1).", entry, itemTemplate.
BuyCount);
3197 if (itemTemplate.
Effects[j].SpellID > 0)
3207 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);
3210 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);
3216 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has a wrong (non-existing) spell in RequiredSpell ({})", entry, itemTemplate.
RequiredSpell);
3221 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong reputation rank in RequiredReputationRank ({}), item can't be used.", entry, itemTemplate.
RequiredReputationRank);
3232 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has min. reputation rank in RequiredReputationRank (0) but RequiredReputationFaction > 0, faction setting is useless.", entry);
3237 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has too large negative in maxcount ({}), replace by value (-1) no storing limits.", entry, itemTemplate.
MaxCount);
3243 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong value in stackable ({}), replace by default 1.", entry, itemTemplate.
Stackable);
3248 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has too large negative in stackable ({}), replace by value (-1) no stacking limits.", entry, itemTemplate.
Stackable);
3263 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong (non-existing?) stat_type{} ({})", entry, j+1, itemTemplate.
ItemStat[j].ItemStatType);
3264 itemTemplate.
ItemStat[j].ItemStatType = 0;
3267 switch (itemTemplate.
ItemStat[j].ItemStatType)
3271 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has deprecated stat_type{} ({})", entry, j+1, itemTemplate.
ItemStat[j].ItemStatType);
3282 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong dmg_type{} ({})", entry, j+1, itemTemplate.
Damage[j].DamageType);
3283 itemTemplate.
Damage[j].DamageType = 0;
3291 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong item spell trigger value in spelltrigger_{} ({})", entry, j+1, itemTemplate.
Effects[j].TriggerType);
3292 itemTemplate.
Effects[j].SpellID = 0;
3296 if (itemTemplate.
Effects[j].SpellID > 0)
3301 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong (not existing) spell in spellid_{} ({})", entry, j+1, itemTemplate.
Effects[j].SpellID);
3302 itemTemplate.
Effects[j].SpellID = 0;
3308 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong Bonding value ({})", entry, itemTemplate.
Bonding);
3311 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has non existing first page (Id:{})", entry, itemTemplate.
PageText);
3314 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong LockID ({})", entry, itemTemplate.
LockID);
3318 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong Sheath ({})", entry, itemTemplate.
Sheath);
3330 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has unknown (wrong or not listed in `item_enchantment_template`) RandomProperty ({})", entry, itemTemplate.
RandomProperty);
3343 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) have wrong ItemSet ({})", entry, itemTemplate.
ItemSet);
3348 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong Area ({})", entry, itemTemplate.
Area);
3351 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong Map ({})", entry, itemTemplate.
Map);
3359 if ((itemTemplate.
BagFamily & mask) == 0)
3365 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has bag family bit set not listed in ItemBagFamily.dbc, remove bit", entry);
3375 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has currency bag family bit set in BagFamily but not listed in CurrencyTypes.dbc, remove bit", entry);
3389 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong socketColor_{} ({})", entry, j+1, itemTemplate.
Socket[j].Color);
3390 itemTemplate.
Socket[j].Color = 0;
3399 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong FoodType value ({})", entry, itemTemplate.
FoodType);
3411 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) has wrong HolidayId value ({})", entry, itemTemplate.
HolidayId);
3417 TC_LOG_ERROR(
"sql.sql",
"Item (Entry {}) has flag ITEM_FLAGS_CU_DURATION_REAL_TIME but it does not have duration limit", entry);
3418 itemTemplate.
FlagsCu &= ~ITEM_FLAGS_CU_DURATION_REAL_TIME;
3423 }
while (result->NextRow());
3426 std::set<uint32> notFoundOutfit;
3435 if (entry->
ItemID[j] <= 0)
3441 notFoundOutfit.insert(item_id);
3445 for (std::set<uint32>::const_iterator itr = notFoundOutfit.begin(); itr != notFoundOutfit.end(); ++itr)
3446 TC_LOG_ERROR(
"sql.sql",
"Item (Entry: {}) does not exist in `item_template` but is referenced in `CharStartOutfit.dbc`", *itr);
3469 Field* fields = result->Fetch();
3472 std::string localeName = fields[1].
GetString();
3480 }
while (result->NextRow());
3491 std::set<uint32> itemSetItems;
3502 itemSetItems.insert(setEntry->
ItemID[i]);
3510 TC_LOG_INFO(
"server.loading",
">> Loaded 0 item set names. DB table `item_set_names` is empty.");
3519 Field* fields = result->Fetch();
3522 if (itemSetItems.find(entry) == itemSetItems.end())
3524 TC_LOG_ERROR(
"sql.sql",
"Item set name (Entry: {}) not found in ItemSet.dbc, data useless.", entry);
3534 TC_LOG_ERROR(
"sql.sql",
"Item set name (Entry: {}) has wrong InventoryType value ({})", entry, invType);
3539 itemSetItems.erase(entry);
3541 }
while (result->NextRow());
3543 if (!itemSetItems.empty())
3546 for (std::set<uint32>::iterator itr = itemSetItems.begin(); itr != itemSetItems.end(); ++itr)
3553 TC_LOG_ERROR(
"sql.sql",
"Item set part (Entry: {}) does not have entry in `item_set_names`, adding data from `item_template`.", entry);
3560 TC_LOG_ERROR(
"sql.sql",
"Item set part (Entry: {}) does not have entry in `item_set_names`, set will not display properly.", entry);
3576 QueryResult result =
WorldDatabase.Query(
"SELECT `entry`, `accessory_entry`, `seat_id`, `minion`, `summontype`, `summontimer` FROM `vehicle_template_accessory`");
3580 TC_LOG_INFO(
"server.loading",
">> Loaded 0 vehicle template accessories. DB table `vehicle_template_accessory` is empty.");
3586 Field* fields = result->Fetch();
3591 bool isMinion = fields[3].
GetBool();
3597 TC_LOG_ERROR(
"sql.sql",
"Table `vehicle_template_accessory`: creature template entry {} does not exist.", entry);
3601 if (!
sObjectMgr->GetCreatureTemplate(accessory))
3603 TC_LOG_ERROR(
"sql.sql",
"Table `vehicle_template_accessory`: Accessory {} does not exist.", accessory);
3609 TC_LOG_ERROR(
"sql.sql",
"Table `vehicle_template_accessory`: creature template entry {} has no data in npc_spellclick_spells", entry);
3617 while (result->NextRow());
3633 TC_LOG_INFO(
"server.loading",
">> Loaded 0 vehicle template. DB table `vehicle_template` is empty.");
3639 Field* fields = result->Fetch();
3643 if (!
sObjectMgr->GetCreatureTemplate(creatureId))
3645 TC_LOG_ERROR(
"sql.sql",
"Table `vehicle_template`: Vehicle {} does not exist.", creatureId);
3652 }
while (result->NextRow());
3666 QueryResult result =
WorldDatabase.Query(
"SELECT `guid`, `accessory_entry`, `seat_id`, `minion`, `summontype`, `summontimer` FROM `vehicle_accessory`");
3676 Field* fields = result->Fetch();
3680 int8 uiSeat =
int8(fields[2].GetInt16());
3681 bool bMinion = fields[3].
GetBool();
3685 if (!
sObjectMgr->GetCreatureTemplate(uiAccessory))
3687 TC_LOG_ERROR(
"sql.sql",
"Table `vehicle_accessory`: Accessory {} does not exist.", uiAccessory);
3695 while (result->NextRow());
3709 QueryResult result =
WorldDatabase.Query(
"SELECT `SeatEntry`, `SeatOrientation`, `ExitParamX`, `ExitParamY`, `ExitParamZ`, `ExitParamO`, `ExitParamValue` FROM `vehicle_seat_addon`");
3713 TC_LOG_ERROR(
"server.loading",
">> Loaded 0 vehicle seat addons. DB table `vehicle_seat_addon` is empty.");
3719 Field* fields = result->Fetch();
3722 float orientation = fields[1].
GetFloat();
3723 float exitX = fields[2].
GetFloat();
3724 float exitY = fields[3].
GetFloat();
3725 float exitZ = fields[4].
GetFloat();
3726 float exitO = fields[5].
GetFloat();
3731 TC_LOG_ERROR(
"sql.sql",
"Table `vehicle_seat_addon`: SeatID: {} does not exist in VehicleSeat.dbc. Skipping entry.", seatID);
3736 if (orientation >
float(
M_PI * 2))
3738 TC_LOG_ERROR(
"sql.sql",
"Table `vehicle_seat_addon`: SeatID: {} is using invalid angle offset value ({}). Set Value to 0.", seatID, orientation);
3744 TC_LOG_ERROR(
"sql.sql",
"Table `vehicle_seat_addon`: SeatID: {} is using invalid exit parameter value ({}). Setting to 0 (none).", seatID, exitParam);
3751 }
while (result->NextRow());
3761 QueryResult result =
WorldDatabase.Query(
"SELECT creature_entry, level, hp, mana, str, agi, sta, inte, spi, armor, min_dmg, max_dmg FROM pet_levelstats");
3765 TC_LOG_INFO(
"server.loading",
">> Loaded 0 level pet stats definitions. DB table `pet_levelstats` is empty.");
3773 Field* fields = result->Fetch();
3776 if (!
sObjectMgr->GetCreatureTemplate(creature_id))
3778 TC_LOG_ERROR(
"sql.sql",
"Wrong creature id {} in `pet_levelstats` table, ignoring.", creature_id);
3789 TC_LOG_INFO(
"misc",
"Unused (> MaxPlayerLevel in worldserver.conf) level {} in `pet_levelstats` table, ignoring.", current_level);
3794 else if (current_level < 1)
3796 TC_LOG_ERROR(
"sql.sql",
"Wrong (<1) level {} in `pet_levelstats` table, ignoring.", current_level);
3805 PetLevelInfo* pLevelInfo = &pInfoMapEntry[current_level - 1];
3818 while (result->NextRow());
3823 auto& pInfo = itr->second;
3826 if (!pInfo || pInfo[0].health == 0)
3828 TC_LOG_ERROR(
"sql.sql",
"Creature {} does not have pet stats data for Level 1!", itr->first);
3835 if (pInfo[level].health == 0)
3837 TC_LOG_ERROR(
"sql.sql",
"Creature {} has no data for Level {} pet stats data, using data of Level {}.", itr->first, level + 1, level);
3838 pInfo[level] = pInfo[level - 1];
3855 return &itr->second[level - 1];
3868 TC_LOG_ERROR(
"sql.sql",
"Invalid count {} specified on item {} be removed from original player create info (use -1)!", count, itemId);
3877 if (entry->ItemID[x] > 0 &&
uint32(entry->ItemID[x]) == itemId)
3886 TC_LOG_ERROR(
"sql.sql",
"Item {} specified to be removed from original create info not found in dbc!", itemId);
3898 QueryResult result =
WorldDatabase.Query(
"SELECT race, class, map, zone, position_x, position_y, position_z, orientation FROM playercreateinfo");
3902 TC_LOG_ERROR(
"server.loading",
">> Loaded 0 player create definitions. DB table `playercreateinfo` is empty.");
3911 Field* fields = result->Fetch();
3917 float positionX = fields[4].
GetFloat();
3918 float positionY = fields[5].
GetFloat();
3919 float positionZ = fields[6].
GetFloat();
3920 float orientation = fields[7].
GetFloat();
3924 TC_LOG_ERROR(
"sql.sql",
"Wrong race {} in `playercreateinfo` table, ignoring.", current_race);
3931 TC_LOG_ERROR(
"sql.sql",
"Wrong race {} in `playercreateinfo` table, ignoring.", current_race);
3937 TC_LOG_ERROR(
"sql.sql",
"Wrong class {} in `playercreateinfo` table, ignoring.", current_class);
3943 TC_LOG_ERROR(
"sql.sql",
"Wrong class {} in `playercreateinfo` table, ignoring.", current_class);
3950 TC_LOG_ERROR(
"sql.sql",
"Wrong home position for class {} race {} pair in `playercreateinfo` table, ignoring.", current_class, current_race);
3954 if (
sMapStore.LookupEntry(mapId)->Instanceable())
3956 TC_LOG_ERROR(
"sql.sql",
"Home position in instanceable map for class {} race {} pair in `playercreateinfo` table, ignoring.", current_class, current_race);
3960 std::unique_ptr<PlayerInfo> info = std::make_unique<PlayerInfo>();
3961 info->mapId = mapId;
3962 info->areaId = areaId;
3963 info->positionX = positionX;
3964 info->positionY = positionY;
3965 info->positionZ = positionZ;
3966 info->orientation = orientation;
3969 _playerInfo[current_race][current_class] = std::move(info);
3973 while (result->NextRow());
3980 TC_LOG_INFO(
"server.loading",
"Loading Player Create Items Data...");
3988 TC_LOG_INFO(
"server.loading",
">> Loaded 0 custom player create items. DB table `playercreateinfo_item` is empty.");
3996 Field* fields = result->Fetch();
4001 TC_LOG_ERROR(
"sql.sql",
"Wrong race {} in `playercreateinfo_item` table, ignoring.", current_race);
4008 TC_LOG_ERROR(
"sql.sql",
"Wrong class {} in `playercreateinfo_item` table, ignoring.", current_class);
4016 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);
4024 TC_LOG_ERROR(
"sql.sql",
"Item id {} (class {} race {}) have amount == 0 in `playercreateinfo_item` table, ignoring.", item_id, current_race, current_class);
4028 if (!current_race || !current_class)
4030 uint32 min_race = current_race ? current_race : 1;
4032 uint32 min_class = current_class ? current_class : 1;
4034 for (
uint32 r = min_race; r < max_race; ++r)
4035 for (
uint32 c = min_class; c < max_class; ++c)
4043 while (result->NextRow());
4050 TC_LOG_INFO(
"server.loading",
"Loading Player Create Skill Data...");
4054 QueryResult result =
WorldDatabase.PQuery(
"SELECT raceMask, classMask, skill, `rank` FROM playercreateinfo_skills");
4058 TC_LOG_INFO(
"server.loading",
">> Loaded 0 player create skills. DB table `playercreateinfo_skills` is empty.");
4066 Field* fields = result->Fetch();
4075 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);
4081 TC_LOG_ERROR(
"sql.sql",
"Wrong race mask {} in `playercreateinfo_skills` table, ignoring.", raceMask);
4087 TC_LOG_ERROR(
"sql.sql",
"Wrong class mask {} in `playercreateinfo_skills` table, ignoring.", classMask);
4093 TC_LOG_ERROR(
"sql.sql",
"Wrong skill id {} in `playercreateinfo_skills` table, ignoring.", skill.
SkillId);
4099 if (raceMask == 0 || ((1 << (raceIndex - 1)) & raceMask))
4103 if (classMask == 0 || ((1 << (classIndex - 1)) & classMask))
4108 if (
auto& info =
_playerInfo[raceIndex][classIndex])
4110 info->skills.push_back(skill);
4117 }
while (result->NextRow());
4124 TC_LOG_INFO(
"server.loading",
"Loading Player Create Spell Data...");
4132 TC_LOG_INFO(
"server.loading",
">> Loaded 0 player create spells. DB table `playercreateinfo_spell_custom` is empty.");
4140 Field* fields = result->Fetch();
4147 TC_LOG_ERROR(
"sql.sql",
"Wrong race mask {} in `playercreateinfo_spell_custom` table, ignoring.", raceMask);
4153 TC_LOG_ERROR(
"sql.sql",
"Wrong class mask {} in `playercreateinfo_spell_custom` table, ignoring.", classMask);
4159 if (raceMask == 0 || ((1 << (raceIndex - 1)) & raceMask))
4163 if (classMask == 0 || ((1 << (classIndex - 1)) & classMask))
4165 if (
auto& info =
_playerInfo[raceIndex][classIndex])
4167 info->customSpells.push_back(spellId);
4179 while (result->NextRow());
4186 TC_LOG_INFO(
"server.loading",
"Loading Player Create Cast Spell Data...");
4193 TC_LOG_INFO(
"server.loading",
">> Loaded 0 player create cast spells. DB table `playercreateinfo_cast_spell` is empty.");
4200 Field* fields = result->Fetch();
4207 TC_LOG_ERROR(
"sql.sql",
"Wrong race mask {} in `playercreateinfo_cast_spell` table, ignoring.", raceMask);
4213 TC_LOG_ERROR(
"sql.sql",
"Wrong class mask {} in `playercreateinfo_cast_spell` table, ignoring.", classMask);
4219 if (raceMask == 0 || ((1 << (raceIndex - 1)) & raceMask))
4223 if (classMask == 0 || ((1 << (classIndex - 1)) & classMask))
4225 if (
auto& info =
_playerInfo[raceIndex][classIndex])
4227 info->castSpells.push_back(spellId);
4234 }
while (result->NextRow());
4241 TC_LOG_INFO(
"server.loading",
"Loading Player Create Action Data...");
4250 TC_LOG_INFO(
"server.loading",
">> Loaded 0 player create actions. DB table `playercreateinfo_action` is empty.");
4258 Field* fields = result->Fetch();
4263 TC_LOG_ERROR(
"sql.sql",
"Wrong race {} in `playercreateinfo_action` table, ignoring.", current_race);
4270 TC_LOG_ERROR(
"sql.sql",
"Wrong class {} in `playercreateinfo_action` table, ignoring.", current_class);
4274 if (
auto& info =
_playerInfo[current_race][current_class])
4275 info->action.push_back(
PlayerCreateInfoAction(fields[2].GetUInt16(), fields[3].GetUInt32(), fields[4].GetUInt16()));
4279 while (result->NextRow());
4286 TC_LOG_INFO(
"server.loading",
"Loading Player Create Level HP/Mana Data...");
4295 TC_LOG_ERROR(
"server.loading",
">> Loaded 0 level health/mana definitions. DB table `player_classlevelstats` is empty.");
4303 Field* fields = result->Fetch();
4308 TC_LOG_ERROR(
"sql.sql",
"Wrong class {} in `player_classlevelstats` table, ignoring.", current_class);
4315 TC_LOG_INFO(
"misc",
"Unused (> MaxPlayerLevel in worldserver.conf) level {} in `player_classlevelstats` table, ignoring.", current_level);
4323 info = std::make_unique<PlayerClassInfo>();
4333 while (result->NextRow());
4345 if (!pClassInfo || !pClassInfo->levelInfo || pClassInfo->levelInfo[0].basehealth == 0)
4347 TC_LOG_ERROR(
"sql.sql",
"Class {} Level 1 does not have health/mana data!", class_);
4354 if (pClassInfo->levelInfo[level].basehealth == 0)
4356 TC_LOG_ERROR(
"sql.sql",
"Class {} Level {} does not have health/mana data. Using stats data of level {}.", class_, level + 1, level);
4357 pClassInfo->levelInfo[level] = pClassInfo->levelInfo[level - 1];
4366 TC_LOG_INFO(
"server.loading",
"Loading Player Create Level Stats Data...");
4371 QueryResult result =
WorldDatabase.Query(
"SELECT race, class, level, str, agi, sta, inte, spi FROM player_levelstats");
4375 TC_LOG_ERROR(
"server.loading",
">> Loaded 0 level stats definitions. DB table `player_levelstats` is empty.");
4383 Field* fields = result->Fetch();
4388 TC_LOG_ERROR(
"sql.sql",
"Wrong race {} in `player_levelstats` table, ignoring.", current_race);
4395 TC_LOG_ERROR(
"sql.sql",
"Wrong class {} in `player_levelstats` table, ignoring.", current_class);
4406 TC_LOG_INFO(
"misc",
"Unused (> MaxPlayerLevel in worldserver.conf) level {} in `player_levelstats` table, ignoring.", current_level);
4412 if (
auto& info =
_playerInfo[current_race][current_class])
4414 if (!info->levelInfo)
4424 while (result->NextRow());
4452 if (!info->levelInfo || info->levelInfo[0].stats[0] == 0)
4454 TC_LOG_ERROR(
"sql.sql",
"Race {} Class {} Level 1 does not have stats data!", race, class_);
4461 if (info->levelInfo[level].stats[0] == 0)
4463 TC_LOG_ERROR(
"sql.sql",
"Race {} Class {} Level {} does not have stats data. Using stats data of level {}.", race, class_, level + 1, level);
4464 info->levelInfo[level] = info->levelInfo[level - 1];
4474 TC_LOG_INFO(
"server.loading",
"Loading Player Create XP Data...");
4487 TC_LOG_ERROR(
"server.loading",
">> Loaded 0 xp for level definitions. DB table `player_xp_for_level` is empty.");
4495 Field* fields = result->Fetch();
4506 TC_LOG_INFO(
"misc",
"Unused (> MaxPlayerLevel in worldserver.conf) level {} in `player_xp_for_levels` table, ignoring.", current_level);
4515 while (result->NextRow());
4522 TC_LOG_ERROR(
"sql.sql",
"Level {} does not have XP for level data. Using data of level [{}] + 100.", level + 1, level);
4541 *info = pInfo->levelInfo[level - 1];
4554 *info = pInfo->levelInfo[level - 1];
4645 "ID, QuestType, QuestLevel, MinLevel, QuestSortID, QuestInfoID, SuggestedGroupNum, TimeAllowed, AllowableRaces,"
4647 "RequiredFactionId1, RequiredFactionId2, RequiredFactionValue1, RequiredFactionValue2, "
4649 "RewardNextQuest, RewardXPDifficulty, RewardMoney, RewardBonusMoney, RewardDisplaySpell, RewardSpell, RewardHonor, RewardKillHonor, "
4651 "StartItem, Flags, RewardTitle, RequiredPlayerKills, RewardTalents, RewardArenaPoints, "
4653 "RewardItem1, RewardAmount1, RewardItem2, RewardAmount2, RewardItem3, RewardAmount3, RewardItem4, RewardAmount4, "
4655 "RewardChoiceItemID1, RewardChoiceItemQuantity1, RewardChoiceItemID2, RewardChoiceItemQuantity2, RewardChoiceItemID3, RewardChoiceItemQuantity3, RewardChoiceItemID4, RewardChoiceItemQuantity4, RewardChoiceItemID5, RewardChoiceItemQuantity5, RewardChoiceItemID6, RewardChoiceItemQuantity6, "
4657 "RewardFactionID1, RewardFactionValue1, RewardFactionOverride1, RewardFactionID2, RewardFactionValue2, RewardFactionOverride2, RewardFactionID3, RewardFactionValue3, RewardFactionOverride3, RewardFactionID4, RewardFactionValue4, RewardFactionOverride4, RewardFactionID5, RewardFactionValue5, RewardFactionOverride5,"
4659 "POIContinent, POIx, POIy, POIPriority, "
4661 "LogTitle, LogDescription, QuestDescription, AreaDescription, QuestCompletionLog, "
4663 "RequiredNpcOrGo1, RequiredNpcOrGo2, RequiredNpcOrGo3, RequiredNpcOrGo4, RequiredNpcOrGoCount1, RequiredNpcOrGoCount2, RequiredNpcOrGoCount3, RequiredNpcOrGoCount4, "
4665 "ItemDrop1, ItemDrop2, ItemDrop3, ItemDrop4, ItemDropQuantity1, ItemDropQuantity2, ItemDropQuantity3, ItemDropQuantity4, "
4667 "RequiredItemId1, RequiredItemId2, RequiredItemId3, RequiredItemId4, RequiredItemId5, RequiredItemId6, RequiredItemCount1, RequiredItemCount2, RequiredItemCount3, RequiredItemCount4, RequiredItemCount5, RequiredItemCount6, "
4669 "Unknown0, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4"
4670 " FROM quest_template");
4673 TC_LOG_INFO(
"server.loading",
">> Loaded 0 quests definitions. DB table `quest_template` is empty.");
4684 Field* fields = result->Fetch();
4687 auto itr =
_questTemplates.emplace(std::piecewise_construct, std::forward_as_tuple(questId), std::forward_as_tuple(
new Quest(fields))).first;
4688 itr->second->_weakRef = itr->second;
4689 }
while (result->NextRow());
4691 std::unordered_map<uint32, uint32> usedMailTemplates;
4693 struct QuestLoaderHelper
4695 typedef void(
Quest::*QuestLoaderFunction)(
Field* fields);
4697 char const* QueryFields;
4698 char const* TableName;
4699 char const* TableDesc;
4700 QuestLoaderFunction LoaderFunction;
4703 static std::vector<QuestLoaderHelper>
const QuestLoaderHelpers =
4706 {
"ID, Emote1, Emote2, Emote3, Emote4, EmoteDelay1, EmoteDelay2, EmoteDelay3, EmoteDelay4",
"quest_details",
"details", &
Quest::LoadQuestDetails },
4712 {
"ID, Emote1, Emote2, Emote3, Emote4, EmoteDelay1, EmoteDelay2, EmoteDelay3, EmoteDelay4, RewardText",
"quest_offer_reward",
"reward emotes", &
Quest::LoadQuestOfferReward },
4715 {
"ID, MaxLevel, AllowableClasses, SourceSpellID, PrevQuestID, NextQuestID, ExclusiveGroup, BreadcrumbForQuestId, RewardMailTemplateID, RewardMailDelay,"
4717 " RequiredSkillID, RequiredSkillPoints, RequiredMinRepFaction, RequiredMaxRepFaction, RequiredMinRepValue, RequiredMaxRepValue, ProvidedItemCount, SpecialFlags",
"quest_template_addon",
"template addons", &
Quest::LoadQuestTemplateAddon },
4723 for (QuestLoaderHelper
const& loader : QuestLoaderHelpers)
4725 result =
WorldDatabase.PQuery(
"SELECT {} FROM {}", loader.QueryFields, loader.TableName);
4727 TC_LOG_INFO(
"server.loading",
">> Loaded 0 quest {}. DB table `{}` is empty.", loader.TableDesc, loader.TableName);
4732 Field* fields = result->Fetch();
4737 (itr->second.get()->*loader.LoaderFunction)(fields);
4739 TC_LOG_ERROR(
"server.loading",
"Table `{}` has data for quest {} but such quest does not exist", loader.TableName, questId);
4740 }
while (result->NextRow());
4751 Quest* qinfo = questPair.second.get();
4760 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `SpecialFlags` = {} > max allowed value. Correct `SpecialFlags` to value <= {}",
4767 TC_LOG_ERROR(
"sql.sql",
"Weekly Quest {} is marked as daily quest in `Flags`, removed daily flag.", qinfo->
GetQuestId());
4768 qinfo->
_flags &= ~QUEST_FLAGS_DAILY;
4775 TC_LOG_ERROR(
"sql.sql",
"Daily Quest {} not marked as repeatable in `SpecialFlags`, added.", qinfo->
GetQuestId());
4784 TC_LOG_ERROR(
"sql.sql",
"Weekly Quest {} not marked as repeatable in `SpecialFlags`, added.", qinfo->
GetQuestId());
4793 TC_LOG_ERROR(
"sql.sql",
"Monthly quest {} not marked as repeatable in `SpecialFlags`, added.", qinfo->
GetQuestId());
4805 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardChoiceItemId{}` = {} but item from `RewardChoiceItemId{}` can't be rewarded with quest flag QUEST_FLAGS_TRACKING.",
4817 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `ZoneOrSort` = {} (zone case) but zone with this id does not exist.",
4828 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `ZoneOrSort` = {} (sort case) but quest sort with this id does not exist.",
4837 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `ZoneOrSort` = {} but `RequiredSkillId` does not have a corresponding value ({}).",
4869 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredSkillId` = {} but this skill does not exist",
4878 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredSkillPoints` = {} but max possible skill is {}, quest can't be done.",
4887 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredFactionId2` = {} but faction template {} does not exist, quest can't be done.",
4894 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredFactionId1` = {} but faction template {} does not exist, quest can't be done.",
4901 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredMinRepFaction` = {} but faction template {} does not exist, quest can't be done.",
4908 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredMaxRepFaction` = {} but faction template {} does not exist, quest can't be done.",
4915 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredMinRepValue` = {} but max reputation is {}, quest can't be done.",
4922 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredMaxRepValue` = {} and `RequiredMinRepValue` = {}, quest can't be done.",
4929 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredFactionValue1` = {} but `RequiredFactionId1` is 0, value has no effect",
4936 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredFactionValue2` = {} but `RequiredFactionId2` is 0, value has no effect",
4943 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredMinRepValue` = {} but `RequiredMinRepFaction` is 0, value has no effect",
4950 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredMaxRepValue` = {} but `RequiredMaxRepFaction` is 0, value has no effect",
4957 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardTitleId` = {} but CharTitle Id {} does not exist, quest can't be rewarded with title.",
4967 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `StartItem` = {} but item with entry {} does not exist, quest can't be done.",
4973 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `StartItem` = {} but `StartItemCount` = 0, set to 1 but need fix in DB.",
4980 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `StartItem` = 0 but `StartItemCount` = {}, useless value.",
4990 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `SourceSpellid` = {} but spell {} doesn't exist, quest can't be done.",
4996 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `SourceSpellid` = {} but spell {} is broken, quest can't be done.",
5009 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredItemId{}` = {} but `RequiredItemCount{}` = 0, quest can't be done.",
5018 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredItemId{}` = {} but item with entry {} does not exist, quest can't be done.",
5025 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredItemId{}` = 0 but `RequiredItemCount{}` = {}, quest can't be done.",
5038 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `ItemDrop{}` = {} but item with entry {} does not exist, quest can't be done.",
5047 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `ItemDrop{}` = 0 but `ItemDropQuantity{}` = {}.",
5059 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredNpcOrGo{}` = {} but gameobject {} does not exist, quest can't be done.",
5064 if (
id > 0 && !
sObjectMgr->GetCreatureTemplate(
id))
5066 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredNpcOrGo{}` = {} but creature with entry {} does not exist, quest can't be done.",
5079 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredNpcOrGo{}` = {} but `RequiredNpcOrGoCount{}` = 0, quest can't be done.",
5086 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RequiredNpcOrGo{}` = 0 but `RequiredNpcOrGoCount{}` = {}.",
5099 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardChoiceItemId{}` = {} but item with entry {} does not exist, quest will not reward this item.",
5106 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardChoiceItemId{}` = {} but `RewardChoiceItemCount{}` = 0, quest can't be done.",
5113 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardChoiceItemId{}` = 0 but `RewardChoiceItemCount{}` = {}.",
5126 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardItemId{}` = {} but item with entry {} does not exist, quest will not reward this item.",
5133 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardItemId{}` = {} but `RewardItemIdCount{}` = 0, quest will not reward this item.",
5140 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardItemId{}` = 0 but `RewardItemIdCount{}` = {}.",
5163 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardFactionId{}` = 0 but `RewardFactionValueIdOverride{}` = {}.",
5174 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardDisplaySpell` = {} but spell {} does not exist, spell removed as display reward.",
5181 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardDisplaySpell` = {} but spell {} is broken, quest will not have a spell reward.",
5188 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardDisplaySpell` = {} but spell {} is talent, quest will not have a spell reward.",
5199 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardSpell` = {} but spell {} does not exist, quest will not have a spell reward.",
5206 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardSpell` = {} but spell {} is broken, quest will not have a spell reward.",
5213 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardDisplaySpell` = {} but spell {} is talent, quest will not have a spell reward.",
5223 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardMailTemplateId` = {} but mail template {} does not exist, quest will not have a mail reward.",
5232 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardMailTemplateId` = {} but mail template {} already used for quest {}, quest will not have a mail reward.",
5246 TC_LOG_ERROR(
"sql.sql",
"Quest {} has `RewardNextQuest` = {} but quest {} does not exist, quest chain will not work.",
5258 else if (prevQuestItr->second->_breadcrumbForQuestId)
5259 TC_LOG_ERROR(
"sql.sql",
"Quest {} should not be unlocked by breadcrumb quest {}", qinfo->
_id, prevQuestId);
5270 nextQuestItr->second->DependentPreviousQuests.push_back(qinfo->
GetQuestId());
5277 TC_LOG_ERROR(
"sql.sql",
"Quest {} is a breadcrumb for quest {}, but no such quest exists", qinfo->
_id, breadcrumbForQuestId);
5294 bool addFlag =
true;
5319 Quest* qinfo = questPair.second.get();
5322 std::set<uint32> questSet;
5324 while(breadcrumbForQuestId)
5328 if (!questSet.insert(qinfo->
_id).second)
5330 TC_LOG_ERROR(
"sql.sql",
"Breadcrumb quests {} and {} are in a loop", qid, breadcrumbForQuestId);
5335 qinfo =
const_cast<Quest*
>(
sObjectMgr->GetQuestTemplate(breadcrumbForQuestId));
5356 uint32 quest_id = spellEffectInfo.MiscValue;
5366 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);
5379 TC_LOG_INFO(
"server.loading",
"Loading GO Start Quest Data...");
5381 TC_LOG_INFO(
"server.loading",
"Loading GO End Quest Data...");
5383 TC_LOG_INFO(
"server.loading",
"Loading Creature Start Quest Data...");
5385 TC_LOG_INFO(
"server.loading",
"Loading Creature End Quest Data...");
5396 QueryResult result =
WorldDatabase.Query(
"SELECT ID, locale, Title, Details, Objectives, EndText, CompletedText, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4 FROM quest_template_locale");
5402 Field* fields = result->Fetch();
5405 std::string localeName = fields[1].
GetString();
5418 for (
uint8 i = 0; i < 4; ++i)
5420 }
while (result->NextRow());
5434 if (tableName.empty())
5437 if (
sMapMgr->IsScriptScheduled())
5440 TC_LOG_INFO(
"server.loading",
"Loading {}...", tableName);
5445 QueryResult result =
WorldDatabase.PQuery(
"SELECT id, delay, command, datalong, datalong2, dataint, x, y, z, o FROM {}", tableName);
5449 TC_LOG_INFO(
"server.loading",
">> Loaded 0 script definitions. DB table `{}` is empty!", tableName);
5457 Field* fields = result->Fetch();
5478 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has invalid talk type (datalong = {}) in SCRIPT_COMMAND_TALK for script id {}",
5484 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has invalid talk text id (dataint = {}) in SCRIPT_COMMAND_TALK for script id {}",
5496 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has invalid emote id (datalong = {}) in SCRIPT_COMMAND_EMOTE for script id {}",
5507 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has invalid map (Id: {}) in SCRIPT_COMMAND_TELEPORT_TO for script id {}",
5514 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has invalid coordinates (X: {} Y: {} Z: {} O: {}) in SCRIPT_COMMAND_TELEPORT_TO for script id {}",
5526 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has invalid quest (ID: {}) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id {}",
5533 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.",
5544 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 {}",
5551 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",
5558 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",
5570 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has invalid creature (Entry: {}) in SCRIPT_COMMAND_KILL_CREDIT for script id {}",
5582 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has invalid gameobject (GUID: {}) in SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id {}",
5590 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has gameobject with invalid entry (GUID: {} Entry: {}) in SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id {}",
5601 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has gameobject type ({}) unsupported by command SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id {}",
5602 tableName, info->
entry, tmp.
id);
5612 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has invalid coordinates (X: {} Y: {} Z: {} O: {}) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id {}",
5619 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has invalid creature (Entry: {}) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id {}",
5632 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has invalid gameobject (GUID: {}) in {} for script id {}",
5640 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has gameobject with invalid entry (GUID: {} Entry: {}) in {} for script id {}",
5647 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has gameobject type ({}) unsupported by command {} for script id {}",
5659 TC_LOG_ERROR(
"sql.sql",
"Table `{}` using non-existent spell (id: {}) in SCRIPT_COMMAND_REMOVE_AURA for script id {}",
5665 TC_LOG_ERROR(
"sql.sql",
"Table `{}` using unknown flags in datalong2 ({}) in SCRIPT_COMMAND_REMOVE_AURA for script id {}",
5676 TC_LOG_ERROR(
"sql.sql",
"Table `{}` using non-existent spell (id: {}) in SCRIPT_COMMAND_CAST_SPELL for script id {}",
5682 TC_LOG_ERROR(
"sql.sql",
"Table `{}` using unknown target in datalong2 ({}) in SCRIPT_COMMAND_CAST_SPELL for script id {}",
5688 TC_LOG_ERROR(
"sql.sql",
"Table `{}` using unknown flags in dataint ({}) in SCRIPT_COMMAND_CAST_SPELL for script id {}",
5694 TC_LOG_ERROR(
"sql.sql",
"Table `{}` using invalid creature entry in dataint ({}) in SCRIPT_COMMAND_CAST_SPELL for script id {}",
5705 TC_LOG_ERROR(
"sql.sql",
"Table `{}` has nonexistent item (entry: {}) in SCRIPT_COMMAND_CREATE_ITEM for script id {}",
5711 TC_LOG_ERROR(
"sql.sql",
"Table `{}` SCRIPT_COMMAND_CREATE_ITEM but amount is {} for script id {}",
5721 if (scripts->find(tmp.
id) == scripts->end())
5724 (*scripts)[tmp.
id] = emptyMap;
5726 (*scripts)[tmp.
id].insert(std::pair<uint32, ScriptInfo>(tmp.
delay, tmp));
5730 while (result->NextRow());
5739 std::set<uint32> evt_scripts;
5742 if (
uint32 eventId = gameObjectTemplatePair.second.GetEventScriptId())
5743 evt_scripts.insert(eventId);
5750 if (spellEffectInfo.MiscValue)
5751 evt_scripts.insert(spellEffectInfo.MiscValue);
5770 std::set<uint32>::const_iterator itr2 = evt_scripts.find(itr->first);
5771 if (itr2 == evt_scripts.end())
5772 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 {}",
5782 std::set<uint32> actionSet;
5785 actionSet.insert(itr->first);
5794 Field* fields = result->Fetch();
5797 actionSet.erase(action);
5799 while (result->NextRow());
5802 for (std::set<uint32>::iterator itr = actionSet.begin(); itr != actionSet.end(); ++itr)
5803 TC_LOG_ERROR(
"sql.sql",
"There is no waypoint which links to the waypoint script {}", *itr);
5816 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell script names. DB table `spell_script_names` is empty!");
5825 Field* fields = result->Fetch();
5828 std::string
const scriptName = fields[1].
GetString();
5830 bool allRanks =
false;
5840 TC_LOG_ERROR(
"sql.sql",
"Scriptname: `{}` spell (Id: {}) does not exist.", scriptName, fields[0].GetInt32());
5847 TC_LOG_ERROR(
"sql.sql",
"Scriptname: `{}` spell (Id: {}) has no ranks of spell.", scriptName, fields[0].GetInt32());
5851 TC_LOG_ERROR(
"sql.sql",
"Scriptname: `{}` spell (Id: {}) is not first rank of spell.", scriptName, fields[0].GetInt32());
5864 TC_LOG_ERROR(
"sql.sql",
"Scriptname: `{}` spell (Id: {}) is ranked spell. Perhaps not all ranks are assigned to this script.", scriptName, spellId);
5871 while (result->NextRow());
5882 TC_LOG_INFO(
"server.loading",
">> Validated 0 scripts.");
5892 auto const bounds =
sObjectMgr->GetSpellScriptsBounds(spell.first);
5894 for (
auto itr = bounds.first; itr != bounds.second; ++itr)
5900 std::unique_ptr<SpellScript> spellScript(spellScriptLoader->GetSpellScript());
5901 std::unique_ptr<AuraScript> auraScript(spellScriptLoader->GetAuraScript());
5903 if (!spellScript && !auraScript)
5905 TC_LOG_ERROR(
"scripts",
"Functions GetSpellScript() and GetAuraScript() of script `{}` do not return objects - script skipped",
GetScriptName(itr->second.first));
5907 itr->second.second =
false;
5913 spellScript->_Init(&spellScriptLoader->GetName(), spellEntry->
Id);
5914 spellScript->_Register();
5916 if (!spellScript->_Validate(spellEntry))
5918 itr->second.second =
false;
5925 auraScript->_Init(&spellScriptLoader->GetName(), spellEntry->
Id);
5926 auraScript->_Register();
5928 if (!auraScript->_Validate(spellEntry))
5930 itr->second.second =
false;
5936 itr->second.second =
true;
5939 itr->second.second =
false;
5955 TC_LOG_INFO(
"server.loading",
">> Loaded 0 page texts. DB table `page_text` is empty!");
5962 Field* fields = result->Fetch();
5971 while (result->NextRow());
5975 if (itr->second.NextPageID)
5977 PageTextContainer::const_iterator itr2 =
_pageTextStore.find(itr->second.NextPageID);
5979 TC_LOG_ERROR(
"sql.sql",
"Page text (ID: {}) has non-existing `NextPageID` ({})", itr->first, itr->second.NextPageID);
5989 PageTextContainer::const_iterator itr =
_pageTextStore.find(pageEntry);
5991 return &(itr->second);
6010 Field* fields = result->Fetch();
6013 std::string localeName = fields[1].
GetString();
6021 }
while (result->NextRow());
6035 TC_LOG_INFO(
"server.loading",
">> Loaded 0 instance templates. DB table `page_text` is empty!");
6042 Field* fields = result->Fetch();
6048 TC_LOG_ERROR(
"sql.sql",
"ObjectMgr::LoadInstanceTemplate: bad mapid {} for template!", mapID);
6055 instanceTemplate.
Parent =
uint32(fields[1].GetUInt16());
6062 while (result->NextRow());
6071 return &(itr->second);
6081 QueryResult result =
WorldDatabase.Query(
"SELECT entry, creditType, creditEntry, lastEncounterDungeon FROM instance_encounters");
6084 TC_LOG_INFO(
"server.loading",
">> Loaded 0 instance encounters, table is empty!");
6089 std::map<uint32, DungeonEncounterEntry const*> dungeonLastBosses;
6092 Field* fields = result->Fetch();
6098 if (!dungeonEncounter)
6100 TC_LOG_ERROR(
"sql.sql",
"Table `instance_encounters` has an invalid encounter id {}, skipped!", entry);
6104 if (lastEncounterDungeon && !
sLFGMgr->GetLFGDungeonEntry(lastEncounterDungeon))
6106 TC_LOG_ERROR(
"sql.sql",
"Table `instance_encounters` has an encounter {} ({}) marked as final for invalid dungeon id {}, skipped!", entry, dungeonEncounter->
Name[0], lastEncounterDungeon);
6110 auto itr = dungeonLastBosses.find(lastEncounterDungeon);
6111 if (lastEncounterDungeon)
6113 if (itr != dungeonLastBosses.end())
6115 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]);
6119 dungeonLastBosses[lastEncounterDungeon] = dungeonEncounter;
6129 TC_LOG_ERROR(
"sql.sql",
"Table `instance_encounters` has an invalid creature (entry {}) linked to the encounter {} ({}), skipped!", creditEntry, entry, dungeonEncounter->
Name[0]);
6144 if (!
sSpellMgr->GetSpellInfo(creditEntry))
6146 TC_LOG_ERROR(
"sql.sql",
"Table `instance_encounters` has an invalid spell (entry {}) linked to the encounter {} ({}), skipped!", creditEntry, entry, dungeonEncounter->
Name[0]);
6151 TC_LOG_ERROR(
"sql.sql",
"Table `instance_encounters` has an invalid credit type ({}) for encounter {} ({}), skipped!", creditType, entry, dungeonEncounter->
Name[0]);
6156 encounters.emplace_back(std::make_unique<DungeonEncounter>(dungeonEncounter,
EncounterCreditType(creditType), creditEntry, lastEncounterDungeon));
6158 }
while (result->NextRow());
6167 return &itr->second;
6176 "text0_0, text0_1, BroadcastTextID0, lang0, Probability0, EmoteDelay0_0, Emote0_0, EmoteDelay0_1, Emote0_1, EmoteDelay0_2, Emote0_2, "
6177 "text1_0, text1_1, BroadcastTextID1, lang1, Probability1, EmoteDelay1_0, Emote1_0, EmoteDelay1_1, Emote1_1, EmoteDelay1_2, Emote1_2, "
6178 "text2_0, text2_1, BroadcastTextID2, lang2, Probability2, EmoteDelay2_0, Emote2_0, EmoteDelay2_1, Emote2_1, EmoteDelay2_2, Emote2_2, "
6179 "text3_0, text3_1, BroadcastTextID3, lang3, Probability3, EmoteDelay3_0, Emote3_0, EmoteDelay3_1, Emote3_1, EmoteDelay3_2, Emote3_2, "
6180 "text4_0, text4_1, BroadcastTextID4, lang4, Probability4, EmoteDelay4_0, Emote4_0, EmoteDelay4_1, Emote4_1, EmoteDelay4_2, Emote4_2, "
6181 "text5_0, text5_1, BroadcastTextID5, lang5, Probability5, EmoteDelay5_0, Emote5_0, EmoteDelay5_1, Emote5_1, EmoteDelay5_2, Emote5_2, "
6182 "text6_0, text6_1, BroadcastTextID6, lang6, Probability6, EmoteDelay6_0, Emote6_0, EmoteDelay6_1, Emote6_1, EmoteDelay6_2, Emote6_2, "
6183 "text7_0, text7_1, BroadcastTextID7, lang7, Probability7, EmoteDelay7_0, Emote7_0, EmoteDelay7_1, Emote7_1, EmoteDelay7_2, Emote7_2 "
6188 TC_LOG_INFO(
"server.loading",
">> Loaded 0 npc texts, table is empty!");
6202 Field* fields = result->Fetch();
6207 TC_LOG_ERROR(
"sql.sql",
"Table `npc_text` has record with reserved id 0, ignore.");
6234 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);
6236 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);
6240 TC_LOG_ERROR(
"sql.sql",
"GossipText (Id: {}) in table `npc_text` has non-existing or incompatible BroadcastTextID{} {}.",
id, i, gOption.
BroadcastTextID);
6248 while (result->NextRow());
6261 "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 "
6262 "FROM npc_text_locale");
6269 Field* fields = result->Fetch();
6272 std::string localeName = fields[1].
GetString();
6284 }
while (result->NextRow());
6296 localtime_r(&curTime, <);
6297 uint64 basetime(curTime);
6298 TC_LOG_INFO(
"misc",
"Returning mails current time: hour: {}, minute: {}, second: {} ", lt.tm_hour, lt.tm_min, lt.tm_sec);
6312 TC_LOG_INFO(
"server.loading",
">> No expired mails found.");
6324 Field* fields = items->Fetch();
6328 itemsCache[mailId].push_back(item);
6329 }
while (items->NextRow());
6333 uint32 returnedCount = 0;
6336 Field* fields = result->Fetch();
6346 bool has_items = fields[4].
GetBool();
6363 for (MailItemInfoVec::iterator itr2 = m->
items.begin(); itr2 != m->
items.end(); ++itr2)
6385 for (MailItemInfoVec::iterator itr2 = m->
items.begin(); itr2 != m->
items.end(); ++itr2)
6410 while (result->NextRow());
6412 TC_LOG_INFO(
"server.loading",
">> Processed {} expired mails: {} deleted and {} returned in {} ms", deletedCount + returnedCount, deletedCount, returnedCount,
GetMSTimeDiffToNow(oldMSTime));
6425 TC_LOG_INFO(
"server.loading",
">> Loaded 0 quest trigger points. DB table `areatrigger_involvedrelation` is empty.");
6435 Field* fields = result->Fetch();
6443 TC_LOG_ERROR(
"sql.sql",
"Area trigger (ID:{}) does not exist in `AreaTrigger.dbc`.", trigger_ID);
6451 TC_LOG_ERROR(
"sql.sql",
"Table `areatrigger_involvedrelation` has record (id: {}) for not existing quest {}", trigger_ID, quest_ID);
6457 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);
6467 }
while (result->NextRow());
6478 auto questItr = itr->second.find(guid.
GetEntry());
6479 if (questItr == itr->second.end())
6482 return &questItr->second;
6492 QueryResult result =
WorldDatabase.Query(
"SELECT ID, Type, GreetEmoteType, GreetEmoteDelay, Greeting FROM quest_greeting");
6495 TC_LOG_INFO(
"server.loading",
">> Loaded 0 quest greetings. DB table `quest_greeting` is empty.");
6505 Field* fields = result->Fetch();
6516 TC_LOG_ERROR(
"sql.sql",
"Table `quest_greeting`: creature template (entry: {}) does not exist.",
id);
6524 TC_LOG_ERROR(
"sql.sql",
"Table `quest_greeting`: gameobject template (entry: {}) does not exist.",
id);
6529 TC_LOG_ERROR(
"sql.sql",
"Table `quest_greeting`: unknown type = {} for entry = {}. Skipped.", type,
id);
6535 if (greetEmoteType > 0 && !
sEmotesStore.LookupEntry(greetEmoteType))
6537 TC_LOG_DEBUG(
"sql.sql",
"Table `quest_greeting`: entry {} has greetEmoteType = {} but emote does not exist. Set to 0.",
id, greetEmoteType);
6542 std::string greeting = fields[4].
GetString();
6548 while (result->NextRow());
6563 TC_LOG_INFO(
"server.loading",
">> Loaded 0 quest_greeting locales. DB table `quest_greeting_locale` is empty.");
6569 Field* fields = result->Fetch();
6586 std::string localeName = fields[2].
GetString();
6594 }
while (result->NextRow());
6611 Field* fields = result->Fetch();
6614 std::string localeName = fields[1].
GetString();
6622 }
while (result->NextRow());
6639 Field* fields = result->Fetch();
6642 std::string localeName = fields[1].
GetString();
6650 }
while (result->NextRow());
6665 TC_LOG_INFO(
"server.loading",
">> Loaded 0 tavern triggers. DB table `areatrigger_tavern` is empty.");
6675 Field* fields = result->Fetch();
6682 TC_LOG_ERROR(
"sql.sql",
"Area trigger (ID:{}) does not exist in `AreaTrigger.dbc`.", Trigger_ID);
6687 }
while (result->NextRow());
6701 TC_LOG_INFO(
"server.loading",
">> Loaded 0 areatrigger scripts. DB table `areatrigger_scripts` is empty.");
6707 Field* fields = result->Fetch();
6710 std::string
const scriptName = fields[1].
GetString();
6715 TC_LOG_ERROR(
"sql.sql",
"AreaTrigger (ID: {}) does not exist in `AreaTrigger.dbc`.", triggerId);
6720 while (result->NextRow());
6745 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);
6777 TaxiPathSetForSource::iterator dest_i = pathSet.find(destination);
6778 if (dest_i == pathSet.end())
6785 cost = dest_i->second.price;
6786 path = dest_i->second.ID;
6805 if (mount_entry == 0 && allowed_alt_team)
6817 TC_LOG_ERROR(
"sql.sql",
"No displayid found for the taxi mount with the entry {}! Can't load it!", mount_entry);
6846 TC_LOG_INFO(
"server.loading",
">> Loaded 0 graveyard-zone links. DB table `graveyard_zone` is empty.");
6856 Field* fields = result->Fetch();
6865 TC_LOG_ERROR(
"sql.sql",
"Table `graveyard_zone` has a record for non-existing graveyard (WorldSafeLocsID: {}), skipped.", safeLocId);
6872 TC_LOG_ERROR(
"sql.sql",
"Table `graveyard_zone` has a record for non-existing Zone (ID: {}), skipped.", zoneId);
6878 TC_LOG_ERROR(
"sql.sql",
"Table `graveyard_zone` has a record for SubZone (ID: {}) instead of zone, skipped.", zoneId);
6884 TC_LOG_ERROR(
"sql.sql",
"Table `graveyard_zone` has a record for non player faction ({}), skipped.", team);
6889 TC_LOG_ERROR(
"sql.sql",
"Table `graveyard_zone` has a duplicate record for Graveyard (ID: {}) and Zone (ID: {}), skipped.", safeLocId, zoneId);
6890 }
while (result->NextRow());
6897 enum DefaultGraveyard
6899 HORDE_GRAVEYARD = 10,
6900 ALLIANCE_GRAVEYARD = 4
6907 else return nullptr;
6919 TC_LOG_ERROR(
"misc",
"ZoneId not found for map {} coords ({}, {}, {}), object name: {} {}", MapId, x, y, z,
6939 TC_LOG_ERROR(
"sql.sql",
"Table `graveyard_zone` incomplete: Zone {} Team {} does not have a linked graveyard.", zoneId, team);
6944 bool foundNear =
false;
6945 float distNear = 10000;
6949 bool foundEntr =
false;
6950 float distEntr = 10000;
6958 for (; range.first != range.second; ++range.first)
6965 TC_LOG_ERROR(
"sql.sql",
"Table `graveyard_zone` has record for not existing graveyard (WorldSafeLocsID {}), skipped.", data.
safeLocId);
6971 if (data.
team != 0 && team != 0 && data.
team != team)
6993 if (dist2 < distEntr)
7009 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);
7012 if (dist2 < distNear)
7039 for (; range.first != range.second; ++range.first)
7052 return &itr->second;
7060 return itr->second.get();
7074 GraveyardStore.insert(GraveyardContainer::value_type(zoneId, data));
7094 if (range.first == range.second)
7102 for (; range.first != range.second; ++range.first)
7112 if (data.
team != 0 && team != 0 && data.
team != team)
7146 QueryResult result =
WorldDatabase.Query(
"SELECT ID, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM areatrigger_teleport");
7149 TC_LOG_INFO(
"server.loading",
">> Loaded 0 area trigger teleport definitions. DB table `areatrigger_teleport` is empty.");
7157 Field* fields = result->Fetch();
7166 TC_LOG_ERROR(
"sql.sql",
"Area trigger (ID:{}) does not exist in `AreaTrigger.dbc`.", Trigger_ID);
7181 TC_LOG_ERROR(
"sql.sql",
"Area trigger (ID:{}) target map (ID: {}) does not exist in `Map.dbc`.", Trigger_ID, at.
target_mapId);
7187 TC_LOG_ERROR(
"sql.sql",
"Area trigger (ID:{}) target coordinates not provided.", Trigger_ID);
7193 }
while (result->NextRow());
7205 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");
7209 TC_LOG_INFO(
"server.loading",
">> Loaded 0 access requirement definitions. DB table `access_requirement` is empty.");
7217 Field* fields = result->Fetch();
7226 ar = std::make_unique<AccessRequirement>();
7228 ar->levelMin = fields[2].
GetUInt8();
7229 ar->levelMax = fields[3].
GetUInt8();
7235 ar->achievement = fields[9].
GetUInt32();
7236 ar->questFailedText = fields[10].
GetString();
7243 TC_LOG_ERROR(
"misc",
"Key item {} does not exist for map {} difficulty {}, removing key requirement.", ar->item, mapid, difficulty);
7253 TC_LOG_ERROR(
"misc",
"Second item {} does not exist for map {} difficulty {}, removing key requirement.", ar->item2, mapid, difficulty);
7262 TC_LOG_ERROR(
"sql.sql",
"Required Alliance Quest {} not exist for map {} difficulty {}, remove quest done requirement.", ar->quest_A, mapid, difficulty);
7271 TC_LOG_ERROR(
"sql.sql",
"Required Horde Quest {} not exist for map {} difficulty {}, remove quest done requirement.", ar->quest_H, mapid, difficulty);
7276 if (ar->achievement)
7280 TC_LOG_ERROR(
"sql.sql",
"Required Achievement {} not exist for map {} difficulty {}, remove quest done requirement.", ar->achievement, mapid, difficulty);
7281 ar->achievement = 0;
7284 }
while (result->NextRow());
7294 bool useParentDbValue =
false;
7307 parentId = iTemplate->
Parent;
7308 useParentDbValue =
true;
7313 if ((!useParentDbValue && itr->second.target_mapId == entrance_map) || (useParentDbValue && itr->second.target_mapId == parentId))
7317 return &itr->second;
7329 if (itr->second.target_mapId ==
Map)
7333 return &itr->second;
7343 GetGenerator<HighGuid::Player>().Set((*result)[0].GetUInt32() + 1);
7347 GetGenerator<HighGuid::Item>().Set((*result)[0].GetUInt32() + 1);
7350 CharacterDatabase.PExecute(
"DELETE FROM character_inventory WHERE item >= '{}'", GetGenerator<HighGuid::Item>().GetNextAfterMaxUsed());
7351 CharacterDatabase.PExecute(
"DELETE FROM mail_items WHERE item_guid >= '{}'", GetGenerator<HighGuid::Item>().GetNextAfterMaxUsed());
7352 CharacterDatabase.PExecute(
"DELETE a, ab FROM auctionhouse a LEFT JOIN auctionbidders ab ON ab.id = a.id WHERE itemguid >= '{}'",
7353 GetGenerator<HighGuid::Item>().GetNextAfterMaxUsed());
7354 CharacterDatabase.PExecute(
"DELETE FROM guild_bank_item WHERE item_guid >= '{}'", GetGenerator<HighGuid::Item>().GetNextAfterMaxUsed());
7356 result =
WorldDatabase.Query(
"SELECT MAX(guid) FROM transports");
7358 GetGenerator<HighGuid::Mo_Transport>().Set((*result)[0].GetUInt32() + 1);
7366 _mailId = (*result)[0].GetUInt32()+1;
7370 sArenaTeamMgr->SetNextArenaTeamId((*result)[0].GetUInt32()+1);
7372 result =
CharacterDatabase.Query(
"SELECT MAX(setguid) FROM character_equipmentsets");
7378 sGuildMgr->SetNextGuildId((*result)[0].GetUInt32()+1);
7382 sGroupMgr->SetGroupDbStoreSize((*result)[0].GetUInt32()+1);
7384 result =
WorldDatabase.Query(
"SELECT MAX(guid) FROM creature");
7388 result =
WorldDatabase.Query(
"SELECT MAX(guid) FROM gameobject");
7397 itr =
_guidGenerators.insert(std::make_pair(high, std::make_unique<ObjectGuidGenerator>(high))).first;
7399 return *itr->second;
7406 TC_LOG_ERROR(
"misc",
"Auctions ids overflow!! Can't continue, shutting down server. Search on forum for TCE00007 for more info. ");
7416 TC_LOG_ERROR(
"misc",
"EquipmentSet guid overflow!! Can't continue, shutting down server. Search on forum for TCE00007 for more info. ");
7426 TC_LOG_ERROR(
"misc",
"Mail ids overflow!! Can't continue, shutting down server. Search on forum for TCE00007 for more info. ");
7436 TC_LOG_ERROR(
"misc",
"_hiPetNumber Id overflow!! Can't continue, shutting down server. Search on forum for TCE00007 for more info.");
7446 TC_LOG_ERROR(
"misc",
"Creature spawn id overflow!! Can't continue, shutting down server. Search on forum for TCE00007 for more info.");
7456 TC_LOG_ERROR(
"misc",
"GameObject spawn id overflow!! Can't continue, shutting down server. Search on forum for TCE00007 for more info. ");
7469 QueryResult result =
WorldDatabase.Query(
"SELECT entry, locale, name, castBarCaption FROM gameobject_template_locale");
7475 Field* fields = result->Fetch();
7478 std::string localeName = fields[1].
GetString();
7487 }
while (result->NextRow());
7497 TC_LOG_ERROR(
"sql.sql",
"Gameobject (Entry: {} GoType: {}) have data{}={} but lock (Id: {}) not found.",
7506 TC_LOG_ERROR(
"sql.sql",
"Gameobject (Entry: {} GoType: {}) have data{}={} but GO (Entry {}) have not GAMEOBJECT_TYPE_TRAP ({}) type.",
7516 TC_LOG_ERROR(
"sql.sql",
"Gameobject (Entry: {} GoType: {}) have data{}={} but Spell (Entry {}) not exist.",
7517 goInfo->
entry, goInfo->
type, N, dataN, dataN);
7525 TC_LOG_ERROR(
"sql.sql",
"Gameobject (Entry: {} GoType: {}) have data{}={} but correct chair height in range 0..{}.",
7538 TC_LOG_ERROR(
"sql.sql",
"Gameobject (Entry: {} GoType: {}) have data{}={} but expected boolean (0/1) noDamageImmune field value.", goTemplate->
entry, goTemplate->
type, N, dataN);
7547 TC_LOG_ERROR(
"sql.sql",
"Gameobject (Entry: {} GoType: {}) have data{}={} but expected boolean (0/1) consumable field value.",
7556 QueryResult result =
WorldDatabase.Query(
"SELECT entry, type, displayId, name, IconName, castBarCaption, unk1, size, "
7558 "Data0, Data1, Data2, Data3, Data4, Data5, Data6, Data7, Data8, Data9, Data10, Data11, Data12, "
7560 "Data13, Data14, Data15, Data16, Data17, Data18, Data19, Data20, Data21, Data22, Data23, AIName, ScriptName, StringId "
7561 "FROM gameobject_template");
7565 TC_LOG_INFO(
"server.loading",
">> Loaded 0 gameobject definitions. DB table `gameobject_template` is empty.");
7572 Field* fields = result->Fetch();
7596 TC_LOG_ERROR(
"sql.sql",
"GameObject (Entry: {}) has non-registered `AIName` '{}' set, removing", got.
entry, got.
AIName);
7648 TC_LOG_ERROR(
"sql.sql",
"GameObject (Entry: {} GoType: {}) have data0={} but SpellFocus (Id: {}) not exist.",
7666 TC_LOG_ERROR(
"sql.sql",
"GameObject (Entry: {} GoType: {}) have data7={} but PageText (Entry {}) not exist.",
7691 TC_LOG_ERROR(
"sql.sql",
"GameObject (Entry: {} GoType: {}) have data0={} but TaxiPath (Id: {}) not exist.",
7730 }
while (result->NextRow());
7740 QueryResult result =
WorldDatabase.Query(
"SELECT entry, faction, flags, mingold, maxgold, artkit0, artkit1, artkit2, artkit3 FROM gameobject_template_addon");
7744 TC_LOG_INFO(
"server.loading",
">> Loaded 0 gameobject template addon definitions. DB table `gameobject_template_addon` is empty.");
7751 Field* fields = result->Fetch();
7758 TC_LOG_ERROR(
"sql.sql",
"GameObject template (Entry: {}) does not exist but has a record in `gameobject_template_addon`", entry);
7776 TC_LOG_ERROR(
"sql.sql",
"GameObject (Entry: {}) has invalid `artkit{}` ({}) defined, set to zero instead.", entry, i, artKitID);
7780 gameObjectAddon.
artKits[i] = artKitID;
7785 TC_LOG_ERROR(
"sql.sql",
"GameObject (Entry: {}) has invalid faction ({}) defined in `gameobject_template_addon`.", entry, gameObjectAddon.
Faction);
7787 if (gameObjectAddon.
Maxgold > 0)
7795 TC_LOG_ERROR(
"sql.sql",
"GameObject (Entry {} GoType: {}) cannot be looted but has maxgold set in `gameobject_template_addon`.", entry, got->
type);
7802 while (result->NextRow());
7815 TC_LOG_INFO(
"server.loading",
">> Loaded 0 gameobject faction and flags overrides. DB table `gameobject_overrides` is empty.");
7822 Field* fields = result->Fetch();
7828 TC_LOG_ERROR(
"sql.sql",
"GameObject (SpawnId: {}) does not exist but has a record in `gameobject_overrides`", spawnId);
7837 TC_LOG_ERROR(
"sql.sql",
"GameObject (SpawnId: {}) has invalid faction ({}) defined in `gameobject_overrides`.", spawnId, gameObjectOverride.
Faction);
7840 }
while (result->NextRow());
7853 TC_LOG_INFO(
"server.loading",
">> Loaded 0 BaseXP definitions. DB table `exploration_basexp` is empty.");
7861 Field* fields = result->Fetch();
7867 while (result->NextRow());
7892 TC_LOG_INFO(
"server.loading",
">> Loaded 0 pet name parts. DB table `pet_name_generation` is empty!");
7900 Field* fields = result->Fetch();
7901 std::string word = fields[0].
GetString();
7903 bool half = fields[2].
GetBool();
7910 while (result->NextRow());
7922 Field* fields = result->Fetch();
7934 if (list0.empty() || list1.empty())
7938 return std::string();
7942 return std::string(petname);
7947 return *(list0.begin()+
urand(0, list0.size()-1)) + *(list1.begin()+
urand(0, list1.size()-1));
7957 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");
7960 TC_LOG_INFO(
"server.loading",
">> Loaded `reputation_reward_rate`, table is empty!");
7966 Field* fields = result->Fetch();
7983 TC_LOG_ERROR(
"sql.sql",
"Faction (faction.dbc) {} does not exist but is used in `reputation_reward_rate`", factionId);
7989 TC_LOG_ERROR(
"sql.sql",
"Table reputation_reward_rate has quest_rate with invalid rate {}, skipping data for faction {}", repRate.
questRate, factionId);
7995 TC_LOG_ERROR(
"sql.sql",
"Table reputation_reward_rate has quest_daily_rate with invalid rate {}, skipping data for faction {}", repRate.
questDailyRate, factionId);
8001 TC_LOG_ERROR(
"sql.sql",
"Table reputation_reward_rate has quest_weekly_rate with invalid rate {}, skipping data for faction {}", repRate.
questWeeklyRate, factionId);
8007 TC_LOG_ERROR(
"sql.sql",
"Table reputation_reward_rate has quest_monthly_rate with invalid rate {}, skipping data for faction {}", repRate.
questMonthlyRate, factionId);
8013 TC_LOG_ERROR(
"sql.sql",
"Table reputation_reward_rate has quest_repeatable_rate with invalid rate {}, skipping data for faction {}", repRate.
questRepeatableRate, factionId);
8019 TC_LOG_ERROR(
"sql.sql",
"Table reputation_reward_rate has creature_rate with invalid rate {}, skipping data for faction {}", repRate.
creatureRate, factionId);
8025 TC_LOG_ERROR(
"sql.sql",
"Table reputation_reward_rate has spell_rate with invalid rate {}, skipping data for faction {}", repRate.
spellRate, factionId);
8033 while (result->NextRow());
8050 "IsTeamAward1, MaxStanding1, RewOnKillRepValue1, IsTeamAward2, MaxStanding2, RewOnKillRepValue2, TeamDependent "
8051 "FROM creature_onkill_reputation");
8055 TC_LOG_INFO(
"server.loading",
">> Loaded 0 creature award reputation definitions. DB table `creature_onkill_reputation` is empty.");
8061 Field* fields = result->Fetch();
8078 TC_LOG_ERROR(
"sql.sql",
"Table `creature_onkill_reputation` has data for nonexistent creature entry ({}), skipped", creature_id);
8087 TC_LOG_ERROR(
"sql.sql",
"Faction (faction.dbc) {} does not exist but is used in `creature_onkill_reputation`", repOnKill.
RepFaction1);
8097 TC_LOG_ERROR(
"sql.sql",
"Faction (faction.dbc) {} does not exist but is used in `creature_onkill_reputation`", repOnKill.
RepFaction2);
8105 }
while (result->NextRow());
8117 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");
8121 TC_LOG_INFO(
"server.loading",
">> Loaded `reputation_spillover_template`, table is empty.");
8127 Field* fields = result->Fetch();
8150 TC_LOG_ERROR(
"sql.sql",
"Faction (faction.dbc) {} does not exist but is used in `reputation_spillover_template`", factionId);
8156 TC_LOG_ERROR(
"sql.sql",
"Faction (faction.dbc) {} in `reputation_spillover_template` does not belong to any team, skipping", factionId);
8160 bool invalidSpilloverFaction =
false;
8167 if (!factionSpillover)
8169 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);
8170 invalidSpilloverFaction =
true;
8176 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);
8177 invalidSpilloverFaction =
true;
8183 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]);
8184 invalidSpilloverFaction =
true;
8190 if (invalidSpilloverFaction)
8197 while (result->NextRow());
8211 QueryResult result =
WorldDatabase.Query(
"SELECT ID, PositionX, PositionY, Icon, Flags, Importance, Name FROM points_of_interest");
8215 TC_LOG_INFO(
"server.loading",
">> Loaded 0 Points of Interest definitions. DB table `points_of_interest` is empty.");
8221 Field* fields = result->Fetch();
8226 pointOfInterest.
ID = id;
8236 TC_LOG_ERROR(
"sql.sql",
"Table `points_of_interest` (ID: {}) have invalid coordinates (X: {} Y: {}), ignored.",
id, pointOfInterest.
PositionX, pointOfInterest.
PositionY);
8243 }
while (result->NextRow());
8255 QueryResult result =
WorldDatabase.Query(
"SELECT QuestID, id, ObjectiveIndex, MapID, WorldMapAreaId, Floor, Priority, Flags FROM quest_poi");
8258 TC_LOG_INFO(
"server.loading",
">> Loaded 0 quest POI definitions. DB table `quest_poi` is empty.");
8265 QueryResult points =
WorldDatabase.Query(
"SELECT QuestID, Idx1, X, Y FROM quest_poi_points ORDER BY QuestID DESC, Idx2");
8267 std::vector<std::vector<std::vector<QuestPOIBlobPoint>>> POIs;
8271 Field* fields = points->Fetch();
8273 POIs.resize(maxQuestPOIId + 1);
8277 fields = points->Fetch();
8284 if (POIs[questId].size() <=
id + 1)
8285 POIs[questId].resize(
id + 10);
8291 POIs[questId][id].push_back(point);
8292 }
while (points->NextRow());
8297 Field* fields = result->Fetch();
8313 POI.
Floor = FloorId;
8317 if (questId < POIs.size() &&
id < POIs[questId].size())
8329 std::tie(itr, std::ignore) =
_questPOIStore.emplace(questId, std::move(wrapper));
8335 TC_LOG_ERROR(
"sql.sql",
"Table quest_poi references unknown quest points for quest {} POI id {}", questId,
id);
8336 }
while (result->NextRow());
8347 QueryResult result =
WorldDatabase.Query(
"SELECT npc_entry, spell_id, cast_flags, user_type FROM npc_spellclick_spells");
8351 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spellclick spells. DB table `npc_spellclick_spells` is empty.");
8359 Field* fields = result->Fetch();
8365 TC_LOG_ERROR(
"sql.sql",
"Table npc_spellclick_spells references unknown creature_template {}. Skipping entry.", npc_entry);
8373 TC_LOG_ERROR(
"sql.sql",
"Table npc_spellclick_spells creature: {} references unknown spellid {}. Skipping entry.", npc_entry, spellid);
8379 TC_LOG_ERROR(
"sql.sql",
"Table npc_spellclick_spells creature: {} references unknown user type {}. Skipping entry.", npc_entry,
uint32(userType));
8390 while (result->NextRow());
8398 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);
8399 creatureTemplatePair.second.npcflag &= ~UNIT_NPC_FLAG_SPELLCLICK;
8444 TC_LOG_INFO(
"server.loading",
">> Loaded 0 quest relations from `{}`, table is empty.", table);
8450 uint32 id = result->Fetch()[0].GetUInt32();
8451 uint32 quest = result->Fetch()[1].GetUInt32();
8455 TC_LOG_ERROR(
"sql.sql",
"Table `{}`: Quest {} listed for entry {} does not exist.", table, quest,
id);
8459 map.insert(QuestRelations::value_type(
id, quest));
8461 }
while (result->NextRow());
8474 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject_queststarter` has data for nonexistent gameobject entry ({}) and existed quest {}", itr->first, itr->second);
8476 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);
8488 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject_questender` has data for nonexistent gameobject entry ({}) and existed quest {}", itr->first, itr->second);
8490 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);
8502 TC_LOG_ERROR(
"sql.sql",
"Table `creature_queststarter` has data for nonexistent creature entry ({}) and existed quest {}", itr->first, itr->second);
8504 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);
8516 TC_LOG_ERROR(
"sql.sql",
"Table `creature_questender` has data for nonexistent creature entry ({}) and existed quest {}", itr->first, itr->second);
8518 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);
8537 _reservedNamesStore.clear();
8543 TC_LOG_INFO(
"server.loading",
">> Loaded 0 reserved player names. DB table `reserved_name` is empty!");
8552 fields = result->Fetch();
8553 std::string name= fields[0].
GetString();
8558 TC_LOG_ERROR(
"misc",
"Table `reserved_name` has invalid name: {}", name);
8564 _reservedNamesStore.insert(wstr);
8567 while (result->NextRow());
8580 return _reservedNamesStore.find(wstr) != _reservedNamesStore.end();
8622 if (strictMask == 0)
8633 if (strictMask & 0x2)
8647 if (strictMask & 0x1)
8666 if (wname.size() < minName)
8674 for (
size_t i = 2; i < wname.size(); ++i)
8675 if (wname[i] == wname[i-1] && wname[i] == wname[i-2])
8691 if (wname.size() < minName)
8709 if (wname.size() < minName)
8734 _gameObjectForQuestStore.clear();
8736 if (_gameObjectTemplateStore.empty())
8738 TC_LOG_INFO(
"server.loading",
">> Loaded 0 GameObjects for quests");
8745 for (
auto const& gameObjectTemplatePair : _gameObjectTemplateStore)
8747 switch (gameObjectTemplatePair.second.type)
8754 uint32 lootId = gameObjectTemplatePair.second.GetLootId();
8762 if (gameObjectTemplatePair.second._generic.questID > 0)
8768 if (gameObjectTemplatePair.second.goober.questId > 0)
8776 _gameObjectForQuestStore.insert(gameObjectTemplatePair.first);
8787 _trinityStringStore.clear();
8789 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");
8792 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.");
8798 Field* fields = result->Fetch();
8809 while (result->NextRow());
8819 if (ts->Content.size() >
size_t(locale) && !ts->Content[locale].empty())
8820 return ts->
Content[locale].c_str();
8824 TC_LOG_ERROR(
"sql.sql",
"Trinity string entry {} not found in DB.", entry);
8832 _fishingBaseForAreaStore.clear();
8838 TC_LOG_INFO(
"server.loading",
">> Loaded 0 areas for fishing base skill level. DB table `skill_fishing_base_level` is empty.");
8846 Field* fields = result->Fetch();
8853 TC_LOG_ERROR(
"sql.sql",
"AreaId {} defined in `skill_fishing_base_level` does not exist", entry);
8857 _fishingBaseForAreaStore[entry] = skill;
8860 while (result->NextRow());
8883 if (w_ownname != wname)
8891 AreaTriggerScriptContainer::const_iterator i = _areaTriggerScriptStore.find(trigger_id);
8892 if (i!= _areaTriggerScriptStore.end())
8899 return _spellScriptsStore.equal_range(spellId);
8908 uint32 raceMask = (1 << (race - 1));
8909 uint32 classMask = (1 << (playerClass-1));
8911 for (
uint8 i = 0; i < 4; ++i)
8950 _gameTeleStore.clear();
8953 QueryResult result =
WorldDatabase.Query(
"SELECT id, position_x, position_y, position_z, orientation, map, name FROM game_tele");
8957 TC_LOG_INFO(
"server.loading",
">> Loaded 0 GameTeleports. DB table `game_tele` is empty!");
8965 Field* fields = result->Fetch();
8980 TC_LOG_ERROR(
"sql.sql",
"Wrong position for id {} (name: {}) in `game_tele` table, ignoring.",
id, gt.
name);
8986 TC_LOG_ERROR(
"sql.sql",
"Wrong UTF8 name for id {} in `game_tele` table, ignoring.",
id);
8992 _gameTeleStore[id] = gt;
8996 while (result->NextRow());
9013 for (GameTeleContainer::const_iterator itr = _gameTeleStore.begin(); itr != _gameTeleStore.end(); ++itr)
9015 if (itr->second.wnameLow == wname)
9016 return &itr->second;
9017 else if (!alt && itr->second.
wnameLow.find(wname) != std::wstring::npos)
9034 for (GameTeleContainer::const_iterator itr = _gameTeleStore.begin(); itr != _gameTeleStore.end(); ++itr)
9036 if (itr->second.wnameLow == wname)
9037 return &itr->second;
9047 for (GameTeleContainer::const_iterator itr = _gameTeleStore.begin(); itr != _gameTeleStore.end(); ++itr)
9048 if (itr->first > new_id)
9049 new_id = itr->first;
9059 _gameTeleStore[new_id] = tele;
9086 for (GameTeleContainer::iterator itr = _gameTeleStore.begin(); itr != _gameTeleStore.end(); ++itr)
9088 if (itr->second.wnameLow == wname)
9096 _gameTeleStore.erase(itr);
9108 _mailLevelRewardStore.clear();
9111 QueryResult result =
WorldDatabase.Query(
"SELECT level, raceMask, mailTemplateId, senderEntry FROM mail_level_reward");
9115 TC_LOG_INFO(
"server.loading",
">> Loaded 0 level dependent mail rewards. DB table `mail_level_reward` is empty.");
9123 Field* fields = result->Fetch();
9132 TC_LOG_ERROR(
"sql.sql",
"Table `mail_level_reward` has data for level {} that more supported by client ({}), ignoring.", level,
MAX_LEVEL);
9138 TC_LOG_ERROR(
"sql.sql",
"Table `mail_level_reward` has raceMask ({}) for level {} that not include any player races, ignoring.", raceMask, level);
9144 TC_LOG_ERROR(
"sql.sql",
"Table `mail_level_reward` has invalid mailTemplateId ({}) for level {} that invalid not include any player races, ignoring.", mailTemplateId, level);
9148 if (!GetCreatureTemplate(senderEntry))
9150 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);
9154 _mailLevelRewardStore[level].push_back(
MailLevelReward(raceMask, mailTemplateId, senderEntry));
9158 while (result->NextRow());
9170 std::unordered_map<int32, std::vector<Trainer::Spell>> spellsByTrainer;
9171 if (
QueryResult trainerSpellsResult =
WorldDatabase.Query(
"SELECT TrainerId, SpellId, MoneyCost, ReqSkillLine, ReqSkillRank, ReqAbility1, ReqAbility2, ReqAbility3, ReqLevel FROM trainer_spell"))
9175 Field* fields = trainerSpellsResult->Fetch();
9191 TC_LOG_ERROR(
"sql.sql",
"Table `trainer_spell` references non-existing spell (SpellId: {}) for TrainerId {}, ignoring", spell.
SpellId, trainerId);
9197 TC_LOG_ERROR(
"sql.sql",
"Table `trainer_spell` references non-existing spell (SpellId: {}) which is a talent, for TrainerId {}, ignoring", spell.
SpellId, trainerId);
9203 TC_LOG_ERROR(
"sql.sql",
"Table `trainer_spell` references non-existing skill (ReqSkillLine: {}) for TrainerId {} and SpellId {}, ignoring",
9208 bool allReqValid =
true;
9209 for (std::size_t i = 0; i < spell.
ReqAbility.size(); ++i)
9212 if (requiredSpell && !
sSpellMgr->GetSpellInfo(requiredSpell))
9214 TC_LOG_ERROR(
"sql.sql",
"Table `trainer_spell` references non-existing spell (ReqAbility{}: {}) for TrainerId {} and SpellId {}, ignoring",
9215 i + 1, requiredSpell, trainerId, spell.
SpellId);
9216 allReqValid =
false;
9223 spellsByTrainer[trainerId].push_back(spell);
9224 }
while (trainerSpellsResult->NextRow());
9231 Field* fields = trainersResult->Fetch();
9236 std::string greeting = fields[3].
GetString();
9237 std::vector<Trainer::Spell> spells;
9238 auto spellsItr = spellsByTrainer.find(trainerId);
9239 if (spellsItr != spellsByTrainer.end())
9241 spells = std::move(spellsItr->second);
9242 spellsByTrainer.erase(spellsItr);
9245 switch (trainerType)
9251 TC_LOG_ERROR(
"sql.sql",
"Table `trainer` references non-existing class requirement {} for TrainerId {}, ignoring", requirement, trainerId);
9258 TC_LOG_ERROR(
"sql.sql",
"Table `trainer` references non-existing race requirement {} for TrainerId {}, ignoring", requirement, trainerId);
9263 if (requirement && !
sSpellMgr->GetSpellInfo(requirement))
9265 TC_LOG_ERROR(
"sql.sql",
"Table `trainer` references non-existing spell requirement {} for TrainerId {}, ignoring", requirement, trainerId);
9273 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)));
9276 _classTrainers[requirement].push_back(&it->second);
9277 }
while (trainersResult->NextRow());
9280 for (
auto const& unusedSpells : spellsByTrainer)
9284 TC_LOG_ERROR(
"sql.sql",
"Table `trainer_spell` references non-existing trainer (TrainerId: {}) for SpellId {}, ignoring", unusedSpells.first, unusedSpell.SpellId);
9288 if (
QueryResult trainerLocalesResult =
WorldDatabase.Query(
"SELECT Id, locale, Greeting_lang FROM trainer_locale"))
9292 Field* fields = trainerLocalesResult->Fetch();
9294 std::string localeName = fields[1].
GetString();
9301 trainer->AddGreetingLocale(locale, fields[2].GetString());
9303 TC_LOG_ERROR(
"sql.sql",
"Table `trainer_locale` references non-existing trainer (TrainerId: {}) for locale {}, ignoring",
9304 trainerId, localeName);
9305 }
while (trainerLocalesResult->NextRow());
9315 _creatureDefaultTrainers.clear();
9321 Field* fields = result->Fetch();
9325 if (!GetCreatureTemplate(creatureId))
9327 TC_LOG_ERROR(
"sql.sql",
"Table `creature_default_trainer` references non-existing creature template (CreatureId: {}), ignoring", creatureId);
9334 TC_LOG_ERROR(
"sql.sql",
"Table `creature_default_trainer` references non-existing trainer (TrainerId: {}) for CreatureId {}, ignoring", trainerId, creatureId);
9338 _creatureDefaultTrainers[creatureId] = trainer;
9340 }
while (result->NextRow());
9359 Field* fields = result->Fetch();
9365 count += LoadReferenceVendor(vendor, -item_id, skip_vendors);
9372 if (!IsVendorItemValid(vendor, item_id, maxcount, incrtime, ExtendedCost,
nullptr, skip_vendors))
9377 vList.
AddItem(item_id, maxcount, incrtime, ExtendedCost);
9380 }
while (result->NextRow());
9390 for (CacheVendorItemContainer::iterator itr = _cacheVendorItemStore.begin(); itr != _cacheVendorItemStore.end(); ++itr)
9391 itr->second.Clear();
9392 _cacheVendorItemStore.clear();
9394 std::set<uint32> skip_vendors;
9396 QueryResult result =
WorldDatabase.Query(
"SELECT entry, item, maxcount, incrtime, ExtendedCost FROM npc_vendor ORDER BY entry, slot ASC");
9400 TC_LOG_ERROR(
"sql.sql",
">> Loaded 0 Vendors. DB table `npc_vendor` is empty!");
9408 Field* fields = result->Fetch();
9415 count += LoadReferenceVendor(entry, -item_id, &skip_vendors);
9422 if (!IsVendorItemValid(entry, item_id, maxcount, incrtime, ExtendedCost,
nullptr, &skip_vendors))
9427 vList.
AddItem(item_id, maxcount, incrtime, ExtendedCost);
9431 while (result->NextRow());
9440 _gossipMenusStore.clear();
9447 TC_LOG_INFO(
"server.loading",
">> Loaded 0 gossip_menu IDs. DB table `gossip_menu` is empty!");
9453 Field* fields = result->Fetch();
9460 if (!GetGossipText(gMenu.
TextID))
9466 _gossipMenusStore.insert(GossipMenusContainer::value_type(gMenu.
MenuID, gMenu));
9467 }
while (result->NextRow());
9476 _gossipMenuItemsStore.clear();
9480 "SELECT MenuID, OptionID, OptionIcon, OptionText, OptionBroadcastTextID, OptionType, OptionNpcFlag, ActionMenuID, ActionPoiID, BoxCoded, BoxMoney, BoxText, BoxBroadcastTextID "
9481 "FROM gossip_menu_option ORDER BY MenuID, OptionID");
9485 TC_LOG_INFO(
"server.loading",
">> Loaded 0 gossip_menu_option IDs. DB table `gossip_menu_option` is empty!");
9491 Field* fields = result->Fetch();
9511 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);
9525 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);
9542 _gossipMenuItemsStore.insert(GossipMenuItemsContainer::value_type(gMenuItem.
MenuID, gMenuItem));
9543 }
while (result->NextRow());
9550 auto itr = _creatureDefaultTrainers.find(creatureId);
9551 if (itr != _creatureDefaultTrainers.end())
9560 vList.
AddItem(item, maxcount, incrtime, extendedCost);
9578 CacheVendorItemContainer::iterator iter = _cacheVendorItemStore.find(entry);
9579 if (iter == _cacheVendorItemStore.end())
9582 if (!iter->second.RemoveItem(item))
9606 TC_LOG_ERROR(
"sql.sql",
"Table `(game_event_)npc_vendor` has data for nonexistent creature template (Entry: {}), ignore", vendor_entry);
9612 if (!skip_vendors || skip_vendors->count(vendor_entry) == 0)
9617 TC_LOG_ERROR(
"sql.sql",
"Table `(game_event_)npc_vendor` has data for creature template (Entry: {}) without vendor flag, ignore", vendor_entry);
9620 skip_vendors->insert(vendor_entry);
9630 TC_LOG_ERROR(
"sql.sql",
"Table `(game_event_)npc_vendor` for Vendor (Entry: {}) have in item list non-existed item ({}), ignore", vendor_entry,
id);
9639 TC_LOG_ERROR(
"sql.sql",
"Table `(game_event_)npc_vendor` has Item (Entry: {}) with wrong ExtendedCost ({}) for vendor ({}), ignore",
id, ExtendedCost, vendor_entry);
9643 if (maxcount > 0 && incrtime == 0)
9648 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);
9651 else if (maxcount == 0 && incrtime > 0)
9656 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);
9660 VendorItemData const* vItems = GetNpcVendorItemList(vendor_entry);
9669 TC_LOG_ERROR(
"sql.sql",
"Table `npc_vendor` has duplicate items {} (with extended cost {}) for vendor (Entry: {}), ignoring",
id, ExtendedCost, vendor_entry);
9682 _scriptNamesStore.emplace_back(
"");
9685 "SELECT DISTINCT(ScriptName) FROM achievement_criteria_data WHERE ScriptName <> '' AND type = 11 "
9687 "SELECT DISTINCT(ScriptName) FROM battlefield_template WHERE ScriptName <> '' "
9689 "SELECT DISTINCT(ScriptName) FROM battleground_template WHERE ScriptName <> '' "
9691 "SELECT DISTINCT(ScriptName) FROM creature WHERE ScriptName <> '' "
9693 "SELECT DISTINCT(ScriptName) FROM creature_template WHERE ScriptName <> '' "
9695 "SELECT DISTINCT(ScriptName) FROM gameobject WHERE ScriptName <> '' "
9697 "SELECT DISTINCT(ScriptName) FROM gameobject_template WHERE ScriptName <> '' "
9699 "SELECT DISTINCT(ScriptName) FROM item_template WHERE ScriptName <> '' "
9701 "SELECT DISTINCT(ScriptName) FROM areatrigger_scripts WHERE ScriptName <> '' "
9703 "SELECT DISTINCT(ScriptName) FROM spell_script_names WHERE ScriptName <> '' "
9705 "SELECT DISTINCT(ScriptName) FROM transports WHERE ScriptName <> '' "
9707 "SELECT DISTINCT(ScriptName) FROM game_weather WHERE ScriptName <> '' "
9709 "SELECT DISTINCT(ScriptName) FROM conditions WHERE ScriptName <> '' "
9711 "SELECT DISTINCT(ScriptName) FROM outdoorpvp_template WHERE ScriptName <> '' "
9713 "SELECT DISTINCT(script) FROM instance_template WHERE script <> ''");
9717 TC_LOG_INFO(
"server.loading",
">> Loaded empty set of Script Names!");
9721 _scriptNamesStore.reserve(result->GetRowCount() + 1);
9725 _scriptNamesStore.push_back((*result)[0].GetString());
9727 while (result->NextRow());
9729 std::sort(_scriptNamesStore.begin(), _scriptNamesStore.end());
9736 return _scriptNamesStore;
9741 static std::string
const empty =
"";
9742 return (
id < _scriptNamesStore.size()) ? _scriptNamesStore[id] : empty;
9752 ScriptNameContainer::const_iterator itr = std::lower_bound(_scriptNamesStore.begin(), _scriptNamesStore.end(), name);
9753 if (itr == _scriptNamesStore.end() || (*itr != name))
9756 return uint32(itr - _scriptNamesStore.begin());
9763 _broadcastTextStore.clear();
9766 QueryResult result =
WorldDatabase.Query(
"SELECT ID, LanguageID, `Text`, Text1, EmoteID1, EmoteID2, EmoteID3, EmoteDelay1, EmoteDelay2, EmoteDelay3, SoundEntriesID, EmotesID, Flags FROM broadcast_text");
9769 TC_LOG_INFO(
"server.loading",
">> Loaded 0 broadcast texts. DB table `broadcast_text` is empty.");
9773 _broadcastTextStore.rehash(result->GetRowCount());
9777 Field* fields = result->Fetch();
9799 TC_LOG_DEBUG(
"broadcasttext",
"BroadcastText (Id: {}) in table `broadcast_text` has SoundEntriesID {} but sound does not exist.", bct.
Id, bct.
SoundEntriesID);
9806 TC_LOG_DEBUG(
"broadcasttext",
"BroadcastText (Id: {}) in table `broadcast_text` using LanguageID {} but Language does not exist.", bct.
Id, bct.
LanguageID);
9814 TC_LOG_DEBUG(
"broadcasttext",
"BroadcastText (Id: {}) in table `broadcast_text` has EmoteId1 {} but emote does not exist.", bct.
Id, bct.
EmoteId1);
9823 TC_LOG_DEBUG(
"broadcasttext",
"BroadcastText (Id: {}) in table `broadcast_text` has EmoteId2 {} but emote does not exist.", bct.
Id, bct.
EmoteId2);
9832 TC_LOG_DEBUG(
"broadcasttext",
"BroadcastText (Id: {}) in table `broadcast_text` has EmoteId3 {} but emote does not exist.", bct.
Id, bct.
EmoteId3);
9837 _broadcastTextStore[bct.
Id] = bct;
9839 while (result->NextRow());
9852 TC_LOG_INFO(
"server.loading",
">> Loaded 0 broadcast text locales. DB table `broadcast_text_locale` is empty.");
9858 Field* fields = result->Fetch();
9861 std::string localeName = fields[1].
GetString();
9867 BroadcastTextContainer::iterator bct = _broadcastTextStore.find(
id);
9868 if (bct == _broadcastTextStore.end())
9870 TC_LOG_ERROR(
"sql.sql",
"BroadcastText (Id: {}) in table `broadcast_text_locale` does not exist. Skipped!",
id);
9874 AddLocaleString(fields[2].GetString(), locale, bct->second.Text);
9875 AddLocaleString(fields[3].GetString(), locale, bct->second.Text1);
9876 }
while (result->NextRow());
9883 CreatureBaseStatsContainer::const_iterator it = _creatureBaseStatsStore.find(
MAKE_PAIR16(level, unitClass));
9885 if (it != _creatureBaseStatsStore.end())
9886 return &(it->second);
9890 DefaultCreatureBaseStats()
9896 BaseDamage[j] = 0.0f;
9900 RangedAttackPower = 0;
9903 static const DefaultCreatureBaseStats defStats;
9911 QueryResult result =
WorldDatabase.Query(
"SELECT level, class, basehp0, basehp1, basehp2, basemana, basearmor, attackpower, rangedattackpower, damage_base, damage_exp1, damage_exp2 FROM creature_classlevelstats");
9915 TC_LOG_INFO(
"server.loading",
">> Loaded 0 creature base stats. DB table `creature_classlevelstats` is empty.");
9922 Field* fields = result->Fetch();
9928 TC_LOG_ERROR(
"sql.sql",
"Creature base stats for level {} has invalid class {}", Level, Class);
9938 TC_LOG_ERROR(
"sql.sql",
"Creature base stats for class {}, level {} has invalid zero base HP[{}] - set to 1", Class, Level, i);
9945 TC_LOG_ERROR(
"sql.sql",
"Creature base stats for class {}, level {} has invalid negative base damage[{}] - set to 0.0", Class, Level, i);
9956 _creatureBaseStatsStore[
MAKE_PAIR16(Level, Class)] = stats;
9960 while (result->NextRow());
9962 for (
auto const& creatureTemplatePair : _creatureTemplateStore)
9964 for (
uint16 lvl = creatureTemplatePair.second.minlevel; lvl <= creatureTemplatePair.second.maxlevel; ++lvl)
9966 if (!_creatureBaseStatsStore.count(
MAKE_PAIR16(lvl, creatureTemplatePair.second.unit_class)))
9967 TC_LOG_ERROR(
"sql.sql",
"Missing base stats for creature class {} level {}", creatureTemplatePair.second.unit_class, lvl);
9982 TC_LOG_INFO(
"server.loading",
">> Loaded 0 faction change achievement pairs. DB table `player_factionchange_achievement` is empty.");
9990 Field* fields = result->Fetch();
9996 TC_LOG_ERROR(
"sql.sql",
"Achievement {} (alliance_id) referenced in `player_factionchange_achievement` does not exist, pair skipped!", alliance);
9998 TC_LOG_ERROR(
"sql.sql",
"Achievement {} (horde_id) referenced in `player_factionchange_achievement` does not exist, pair skipped!", horde);
10000 FactionChangeAchievements[alliance] = horde;
10004 while (result->NextRow());
10017 TC_LOG_INFO(
"server.loading",
">> Loaded 0 faction change item pairs. DB table `player_factionchange_items` is empty.");
10025 Field* fields = result->Fetch();
10030 if (!GetItemTemplate(alliance))
10031 TC_LOG_ERROR(
"sql.sql",
"Item {} (alliance_id) referenced in `player_factionchange_items` does not exist, pair skipped!", alliance);
10032 else if (!GetItemTemplate(horde))
10033 TC_LOG_ERROR(
"sql.sql",
"Item {} (horde_id) referenced in `player_factionchange_items` does not exist, pair skipped!", horde);
10035 FactionChangeItems[alliance] = horde;
10039 while (result->NextRow());
10052 TC_LOG_INFO(
"server.loading",
">> Loaded 0 faction change quest pairs. DB table `player_factionchange_quests` is empty.");
10060 Field* fields = result->Fetch();
10065 if (!
sObjectMgr->GetQuestTemplate(alliance))
10066 TC_LOG_ERROR(
"sql.sql",
"Quest {} (alliance_id) referenced in `player_factionchange_quests` does not exist, pair skipped!", alliance);
10067 else if (!
sObjectMgr->GetQuestTemplate(horde))
10068 TC_LOG_ERROR(
"sql.sql",
"Quest {} (horde_id) referenced in `player_factionchange_quests` does not exist, pair skipped!", horde);
10070 FactionChangeQuests[alliance] = horde;
10074 while (result->NextRow());
10087 TC_LOG_INFO(
"server.loading",
">> Loaded 0 faction change reputation pairs. DB table `player_factionchange_reputations` is empty.");
10095 Field* fields = result->Fetch();
10101 TC_LOG_ERROR(
"sql.sql",
"Reputation {} (alliance_id) referenced in `player_factionchange_reputations` does not exist, pair skipped!", alliance);
10103 TC_LOG_ERROR(
"sql.sql",
"Reputation {} (horde_id) referenced in `player_factionchange_reputations` does not exist, pair skipped!", horde);
10105 FactionChangeReputation[alliance] = horde;
10109 while (result->NextRow());
10122 TC_LOG_INFO(
"server.loading",
">> Loaded 0 faction change spell pairs. DB table `player_factionchange_spells` is empty.");
10130 Field* fields = result->Fetch();
10135 if (!
sSpellMgr->GetSpellInfo(alliance))
10136 TC_LOG_ERROR(
"sql.sql",
"Spell {} (alliance_id) referenced in `player_factionchange_spells` does not exist, pair skipped!", alliance);
10137 else if (!
sSpellMgr->GetSpellInfo(horde))
10138 TC_LOG_ERROR(
"sql.sql",
"Spell {} (horde_id) referenced in `player_factionchange_spells` does not exist, pair skipped!", horde);
10140 FactionChangeSpells[alliance] = horde;
10144 while (result->NextRow());
10157 TC_LOG_INFO(
"server.loading",
">> Loaded 0 faction change title pairs. DB table `player_factionchange_title` is empty.");
10165 Field* fields = result->Fetch();
10171 TC_LOG_ERROR(
"sql.sql",
"Title {} (alliance_id) referenced in `player_factionchange_title` does not exist, pair skipped!", alliance);
10173 TC_LOG_ERROR(
"sql.sql",
"Title {} (horde_id) referenced in `player_factionchange_title` does not exist, pair skipped!", horde);
10175 FactionChangeTitles[alliance] = horde;
10179 while (result->NextRow());
10191 auto itr = _gameObjectTemplateAddonStore.find(entry);
10192 if (itr != _gameObjectTemplateAddonStore.end())
10193 return &itr->second;
10223 VehicleAccessoryContainer::const_iterator itr = _vehicleAccessoryStore.find(cre->GetSpawnId());
10224 if (itr != _vehicleAccessoryStore.end())
10225 return &itr->second;
10229 VehicleAccessoryTemplateContainer::const_iterator itr = _vehicleTemplateAccessoryStore.find(veh->
GetCreatureEntry());
10230 if (itr != _vehicleTemplateAccessoryStore.end())
10231 return &itr->second;
10237 auto itr = _dungeonEncounterStore.find(
MAKE_PAIR32(mapId, difficulty));
10238 if (itr != _dungeonEncounterStore.end())
10239 return &itr->second;
10249 auto const& info = _playerInfo[race][class_];
10260 QueryResult result =
WorldDatabase.Query(
"SELECT GameObjectEntry, ItemId, Idx FROM gameobject_questitem ORDER BY Idx ASC");
10264 TC_LOG_INFO(
"server.loading",
">> Loaded 0 gameobject quest items. DB table `gameobject_questitem` is empty.");
10271 Field* fields = result->Fetch();
10280 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject_questitem` has data for nonexistent gameobject (entry: {}, idx: {}), skipped", entry, idx);
10287 TC_LOG_ERROR(
"sql.sql",
"Table `gameobject_questitem` has nonexistent item (ID: {}) in gameobject (entry: {}, idx: {}), skipped", item, entry, idx);
10291 _gameObjectQuestItemStore[entry].push_back(item);
10295 while (result->NextRow());
10305 QueryResult result =
WorldDatabase.Query(
"SELECT CreatureEntry, ItemId, Idx FROM creature_questitem ORDER BY Idx ASC");
10309 TC_LOG_INFO(
"server.loading",
">> Loaded 0 creature quest items. DB table `creature_questitem` is empty.");
10316 Field* fields = result->Fetch();
10325 TC_LOG_ERROR(
"sql.sql",
"Table `creature_questitem` has data for nonexistent creature (entry: {}, idx: {}), skipped", entry, idx);
10332 TC_LOG_ERROR(
"sql.sql",
"Table `creature_questitem` has nonexistent item (ID: {}) in creature (entry: {}, idx: {}), skipped", item, entry, idx);
10336 _creatureQuestItemStore[entry].push_back(item);
10340 while (result->NextRow());
10352 TC_LOG_INFO(
"server.loading",
">> Query data caching is disabled. Skipped initialization.");
10360 for (
auto& creatureTemplatePair : _creatureTemplateStore)
10361 pool.
PostWork([creature = &creatureTemplatePair.second]() { creature->InitializeQueryData(); });
10365 for (
auto& gameObjectTemplatePair : _gameObjectTemplateStore)
10366 pool.
PostWork([gobj = &gameObjectTemplatePair.second]() { gobj->InitializeQueryData(); });
10370 for (
auto& itemTemplatePair : _itemTemplateStore)
10371 pool.
PostWork([item = &itemTemplatePair.second]() { item->InitializeQueryData(); });
10375 for (
auto& questTemplatePair : _questTemplates)
10376 pool.
PostWork([quest = questTemplatePair.second.get()]() { quest->InitializeQueryData(); });
10380 for (
auto& poiWrapperPair : _questPOIStore)
10381 pool.
PostWork([poi = &poiWrapperPair.second]() { poi->InitializeQueryData(); });
10390 QueryDataBuffer = BuildQueryData();
10396 tempBuffer <<
uint32(POIData.QuestID);
10397 tempBuffer <<
uint32(POIData.QuestPOIBlobDataStats.size());
10399 for (
QuestPOIBlobData const& questPOIBlobData : POIData.QuestPOIBlobDataStats)
10401 tempBuffer <<
uint32(questPOIBlobData.BlobIndex);
10402 tempBuffer <<
int32(questPOIBlobData.ObjectiveIndex);
10403 tempBuffer <<
uint32(questPOIBlobData.MapID);
10404 tempBuffer <<
uint32(questPOIBlobData.WorldMapAreaID);
10405 tempBuffer <<
uint32(questPOIBlobData.Floor);
10406 tempBuffer <<
uint32(questPOIBlobData.Unk3);
10407 tempBuffer <<
uint32(questPOIBlobData.Unk4);
10408 tempBuffer <<
uint32(questPOIBlobData.QuestPOIBlobPointStats.size());
10410 for (
QuestPOIBlobPoint const& questPOIBlobPoint : questPOIBlobData.QuestPOIBlobPointStats)
10412 tempBuffer <<
int32(questPOIBlobPoint.X);
10413 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)
MapDifficulty const * GetMapDifficultyData(uint32 mapId, Difficulty difficulty)
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)
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 was copied. Do not allow making a copy of items in mail.
@ MAIL_CHECK_MASK_RETURNED
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_REWARDS_COUNT
#define QUEST_ITEM_OBJECTIVES_COUNT
#define QUEST_OBJECTIVES_COUNT
#define QUEST_REPUTATIONS_COUNT
#define QUEST_SOURCE_ITEM_IDS_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
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
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)
bool HasSpecialFlag(uint32 flag) const
uint32 ItemDropQuantity[QUEST_SOURCE_ITEM_IDS_COUNT]
uint32 _requiredSkillPoints
int32 RequiredNpcOrGo[QUEST_OBJECTIVES_COUNT]
std::vector< uint32 > DependentBreadcrumbQuests
int32 _breadcrumbForQuestId
uint32 RequiredNpcOrGoCount[QUEST_OBJECTIVES_COUNT]
void LoadQuestDetails(Field *fields)
uint32 _requiredFactionId2
void SetSpecialFlag(uint32 flag)
static bool IsTakingQuestEnabled(uint32 questId)
uint32 GetCharTitleId() const
uint32 RewardItemIdCount[QUEST_REWARDS_COUNT]
void LoadQuestRequestItems(Field *fields)
uint32 _requiredMinRepFaction
int32 _requiredMinRepValue
uint32 RewardChoiceItemId[QUEST_REWARD_CHOICES_COUNT]
uint32 ItemDrop[QUEST_SOURCE_ITEM_IDS_COUNT]
uint32 GetSrcItemCount() const
void LoadQuestMailSender(Field *fields)
int32 RewardFactionValueIdOverride[QUEST_REPUTATIONS_COUNT]
int32 _requiredFactionValue2
uint32 _requiredFactionId1
uint32 RewardChoiceItemCount[QUEST_REWARD_CHOICES_COUNT]
int32 _requiredMaxRepValue
uint32 _requiredMaxRepFaction
std::vector< uint32 > DependentPreviousQuests
uint32 GetQuestId() const
void LoadQuestOfferReward(Field *fields)
uint32 _requiredPlayerKills
uint32 RequiredItemCount[QUEST_ITEM_OBJECTIVES_COUNT]
int32 GetBreadcrumbForQuestId() const
uint32 _rewardDisplaySpell
uint32 RequiredItemId[QUEST_ITEM_OBJECTIVES_COUNT]
uint32 GetSrcItemId() const
uint32 RewardFactionId[QUEST_REPUTATIONS_COUNT]
int32 _requiredFactionValue1
int32 RewardFactionValueId[QUEST_REPUTATIONS_COUNT]
uint32 _rewardMailSenderEntry
uint32 RewardItemId[QUEST_REWARDS_COUNT]
uint32 GetQuestMethod() const
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::vector< std::string > Text1
std::vector< std::string > Text
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 modelid_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]
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< 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::vector< std::string > AreaDescription
std::vector< std::string > CompletedText
std::vector< std::string > Title
std::vector< std::string > Objectives
std::vector< std::vector< std::string > > ObjectiveText
std::vector< std::string > Details
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