56 bool IsCapturableBattlePetNpc(
uint32 npcId)
64 if (speciesEntry && speciesEntry->
NpcId == npcId
76 bounds.
X = restArea.
X;
77 bounds.
Y = restArea.
Y;
78 bounds.
Z = restArea.
Z;
116 std::string res =
"";
150 snprintf(sz,
sizeof(sz),
"Unknown command: %d",
uint32(command));
162 return std::string(sz);
230 Unit const* summoner = NULL;
291 for (
int race = 0; race <
MAX_RACES; ++race)
293 for (
int class_ = 0; class_ <
MAX_CLASSES; ++class_)
308 for (DungeonEncounterList::iterator encounterItr = itr->second.begin(); encounterItr != itr->second.end(); ++encounterItr)
309 delete* encounterItr;
319 if (data.size() <=
size_t(locale))
320 data.resize(locale + 1);
339 Field* fields = result->Fetch();
344 SF_LOG_ERROR(
"server.loading",
"Graveyard %u referenced in graveyard_orientation doesn't exist.",
id);
348 }
while (result->NextRow());
359 QueryResult result =
WorldDatabase.Query(
"SELECT entry, name_loc1, subname_loc1, name_loc2, subname_loc2, name_loc3, subname_loc3, name_loc4, subname_loc4, name_loc5, subname_loc5, name_loc6, subname_loc6, name_loc7, subname_loc7, name_loc8, subname_loc8, name_loc9, subname_loc9, name_loc10, subname_loc10, name_loc11, subname_loc11 FROM locales_creature");
366 Field* fields = result->Fetch();
378 }
while (result->NextRow());
396 Field* fields = result->Fetch();
406 }
while (result->NextRow());
417 QueryResult result =
WorldDatabase.Query(
"SELECT entry, icon_name_loc1, icon_name_loc2, icon_name_loc3, icon_name_loc4, icon_name_loc5, icon_name_loc6, icon_name_loc7, icon_name_loc8, icon_name_loc9, icon_name_loc10, icon_name_loc11 FROM locales_points_of_interest");
424 Field* fields = result->Fetch();
432 }
while (result->NextRow());
442 QueryResult result =
WorldDatabase.Query(
"SELECT entry, difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, "
444 "modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, exp_unk, faction_A, faction_H, npcflag, speed_walk, "
446 "speed_run, scale, npc_rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, unit_flags2, "
448 "dynamicflags, family, trainer_type, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, "
450 "type_flags, type_flags2, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, "
452 "spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, "
454 "InhabitType, HoverHeight, Health_mod, Mana_mod, Mana_mod_extra, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, "
456 " questItem6, movementId, RegenHealth, mechanic_immune_mask, flags_extra, ScriptName, ModLevel "
457 "FROM creature_template;");
461 SF_LOG_INFO(
"server.loading",
">> Loaded 0 creature template definitions. DB table `creature_template` is empty.");
469 Field* fields = result->Fetch();
476 creatureTemplate.
Entry = entry;
478 for (
uint8 i = 0; i < 3; ++i)
499 if (IsCapturableBattlePetNpc(creatureTemplate.
Entry))
505 creatureTemplate.
rank =
uint32(fields[24].GetUInt8());
517 creatureTemplate.
family =
uint32(fields[36].GetUInt8());
524 creatureTemplate.
type =
uint32(fields[43].GetUInt8());
562 }
while (result->NextRow());
576 QueryResult result =
WorldDatabase.Query(
"SELECT entry, path_id, mount, bytes1, bytes2, emote, auras FROM creature_template_addon");
580 SF_LOG_INFO(
"server.loading",
">> Loaded 0 creature template addon definitions. DB table `creature_template_addon` is empty.");
587 Field* fields = result->Fetch();
593 SF_LOG_ERROR(
"sql.sql",
"Creature template (Entry: %u) does not exist but has a record in `creature_template_addon`", entry);
605 Tokenizer tokens(fields[6].GetString(),
' ');
607 creatureAddon.
auras.resize(tokens.
size());
611 if (!AdditionalSpellInfo)
613 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) has wrong spell %u defined in `auras` field in `creature_template_addon`.", entry,
uint32(atol(*itr)));
618 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) has SPELL_AURA_CONTROL_VEHICLE aura %u defined in `auras` field in `creature_template_addon`.", entry,
uint32(atol(*itr)));
623 if (creatureAddon.
mount)
627 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) has invalid displayInfoId (%u) for mount defined in `creature_template_addon`", entry, creatureAddon.
mount);
628 creatureAddon.
mount = 0;
634 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) has invalid emote (%u) defined in `creature_template_addon`.", entry, creatureAddon.
emote);
635 creatureAddon.
emote = 0;
639 }
while (result->NextRow());
650 for (
uint32 diff = 0; diff < 3 && ok; ++diff)
659 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) has `difficulty_entry_%u`=%u but creature entry %u does not exist.",
665 for (
uint32 diff2 = 0; diff2 < 3 && ok2; ++diff2)
670 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) is listed as `difficulty_entry_%u` of another creature, but itself lists %u in `difficulty_entry_%u`.",
677 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) already listed as `difficulty_entry_%u` for another entry.", cInfo->
DifficultyEntry[diff], diff2 + 1);
683 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) has `difficulty_entry_%u`=%u but creature entry %u has itself a value in `difficulty_entry_%u`.",
694 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u, class %u) has different `unit_class` in difficulty %u mode (Entry: %u, class %u).",
701 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) has different `npcflag` in difficulty %u mode (Entry: %u).", cInfo->
Entry, diff + 1, cInfo->
DifficultyEntry[diff]);
707 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) has different `trainer_class` in difficulty %u mode (Entry: %u).", cInfo->
Entry, diff + 1, cInfo->
DifficultyEntry[diff]);
713 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) has different `trainer_race` in difficulty %u mode (Entry: %u).", cInfo->
Entry, diff + 1, cInfo->
DifficultyEntry[diff]);
719 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) has different `trainer_type` in difficulty %u mode (Entry: %u).", cInfo->
Entry, diff + 1, cInfo->
DifficultyEntry[diff]);
723 if (!difficultyInfo->
AIName.empty())
725 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) lists difficulty %u mode entry %u with `AIName` filled in. `AIName` of difficulty 0 mode creature is always used instead.",
732 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) lists difficulty %u mode entry %u with `ScriptName` filled in. `ScriptName` of difficulty 0 mode creature is always used instead.",
743 if (!factionTemplate)
747 if (!factionTemplate)
758 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) lists non-existing Modelid1 id (%u), this can crash the client.", cInfo->
Entry, cInfo->
Modelid1);
761 else if (!displayScaleEntry)
762 displayScaleEntry = displayEntry;
766 SF_LOG_ERROR(
"sql.sql",
"No model data exist for `Modelid1` = %u listed by creature (Entry: %u).", cInfo->
Modelid1, cInfo->
Entry);
774 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) lists non-existing Modelid2 id (%u), this can crash the client.", cInfo->
Entry, cInfo->
Modelid2);
777 else if (!displayScaleEntry)
778 displayScaleEntry = displayEntry;
782 SF_LOG_ERROR(
"sql.sql",
"No model data exist for `Modelid2` = %u listed by creature (Entry: %u).", cInfo->
Modelid2, cInfo->
Entry);
790 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) lists non-existing Modelid3 id (%u), this can crash the client.", cInfo->
Entry, cInfo->
Modelid3);
793 else if (!displayScaleEntry)
794 displayScaleEntry = displayEntry;
798 SF_LOG_ERROR(
"sql.sql",
"No model data exist for `Modelid3` = %u listed by creature (Entry: %u).", cInfo->
Modelid3, cInfo->
Entry);
806 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) lists non-existing Modelid4 id (%u), this can crash the client.", cInfo->
Entry, cInfo->
Modelid4);
809 else if (!displayScaleEntry)
810 displayScaleEntry = displayEntry;
814 SF_LOG_ERROR(
"sql.sql",
"No model data exist for `Modelid4` = %u listed by creature (Entry: %u).", cInfo->
Modelid4, cInfo->
Entry);
817 if (!displayScaleEntry)
818 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) does not have any existing display id in Modelid1/Modelid2/Modelid3/Modelid4.", cInfo->
Entry);
826 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) lists non-existing creature entry %u in `KillCredit%d`.", cInfo->
Entry, cInfo->
KillCredit[k], k + 1);
834 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) has invalid unit_class (%u) in creature_template. Set to 1 (UNIT_CLASS_WARRIOR).", cInfo->
Entry, cInfo->
unit_class);
840 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) has invalid spell school value (%u) in `dmgschool`.", cInfo->
Entry, cInfo->
dmgschool);
851 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) has [UNIT_NPC_FLAG_GOSSIP] set, but does have (gossip_menu_id: %u) set.", cInfo->
Entry, cInfo->
GossipMenuId);
854 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) has (gossip_menu_id: %u) set, but does not have [UNIT_NPC_FLAG_GOSSIP] set.", cInfo->
Entry, cInfo->
GossipMenuId);
867 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) has wrong value (%f) in speed_run, set to 1.14286.", cInfo->
Entry, cInfo->
speed_run);
873 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) has invalid creature type (%u) in `type`.", cInfo->
Entry, cInfo->
type);
880 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) has invalid creature family (%u) in `family`.", cInfo->
Entry, cInfo->
family);
886 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) has wrong value (%u) in `InhabitType`, creature will not correctly walk/swim/fly.", cInfo->
Entry, cInfo->
InhabitType);
901 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) has a non-existing VehicleId (%u). This *WILL* cause the client to freeze!", cInfo->
Entry, cInfo->
VehicleId);
917 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) has non-existing Spell%d (%u), set to 0.", cInfo->
Entry, j + 1, cInfo->
spells[j]);
924 SF_LOG_ERROR(
"sql.sql",
"Creature (Entry: %u) has wrong movement generator type (%u), ignored and set to IDLE.", cInfo->
Entry, cInfo->
MovementType);
929 if (cInfo->
scale <= 0.0f)
931 if (displayScaleEntry)
939 SF_LOG_ERROR(
"sql.sql",
"Table `creature_template` lists creature (Entry: %u) with `exp` %u. Ignored and set to 0.", cInfo->
Entry, cInfo->
expansion);
951 SF_LOG_ERROR(
"sql.sql",
"Table `creature_template` lists creature (Entry: %u) with disallowed `flags_extra` %u, removing incorrect flag.", cInfo->
Entry, badFlags);
959 SF_LOG_ERROR(
"sql.sql",
"Table `creature_template` lists creature (Entry: %u) with enabled ModLevel and minlevel %u, minlevel set to 90.", cInfo->
Entry, cInfo->
minlevel);
965 SF_LOG_ERROR(
"sql.sql",
"Table `creature_template` lists creature (Entry: %u) with enabled ModLevel and maxlevel %u, maxlevel set to 90.", cInfo->
Entry, cInfo->
maxlevel);
978 QueryResult result =
WorldDatabase.Query(
"SELECT guid, path_id, mount, bytes1, bytes2, emote, auras FROM creature_addon");
982 SF_LOG_INFO(
"server.loading",
">> Loaded 0 creature addon definitions. DB table `creature_addon` is empty.");
989 Field* fields = result->Fetch();
996 SF_LOG_ERROR(
"sql.sql",
"Creature (GUID: %u) does not exist but has a record in `creature_addon`", guid);
1006 SF_LOG_ERROR(
"sql.sql",
"Creature (GUID %u) has movement type set to WAYPOINT_MOTION_TYPE but no path assigned", guid);
1014 Tokenizer tokens(fields[6].GetString(),
' ');
1016 creatureAddon.
auras.resize(tokens.
size());
1020 if (!AdditionalSpellInfo)
1022 SF_LOG_ERROR(
"sql.sql",
"Creature (GUID: %u) has wrong spell %u defined in `auras` field in `creature_addon`.", guid,
uint32(atol(*itr)));
1027 SF_LOG_ERROR(
"sql.sql",
"Creature (GUID: %u) has SPELL_AURA_CONTROL_VEHICLE aura %u defined in `auras` field in `creature_addon`.", guid,
uint32(atol(*itr)));
1032 if (creatureAddon.
mount)
1036 SF_LOG_ERROR(
"sql.sql",
"Creature (GUID: %u) has invalid displayInfoId (%u) for mount defined in `creature_addon`", guid, creatureAddon.
mount);
1037 creatureAddon.
mount = 0;
1043 SF_LOG_ERROR(
"sql.sql",
"Creature (GUID: %u) has invalid emote (%u) defined in `creature_addon`.", guid, creatureAddon.
emote);
1044 creatureAddon.
emote = 0;
1048 }
while (result->NextRow());
1057 return &(itr->second);
1066 return &(itr->second);
1077 if (itr->second.empty())
1082 EquipmentInfoContainerInternal::const_iterator ritr = itr->second.begin();
1083 std::advance(ritr, std::rand() % itr->second.size());
1084 id = std::distance(itr->second.begin(), ritr) + 1;
1085 return &ritr->second;
1089 EquipmentInfoContainerInternal::const_iterator itr2 = itr->second.find(
id);
1090 if (itr2 != itr->second.end())
1091 return &itr2->second;
1102 QueryResult result =
WorldDatabase.Query(
"SELECT entry, id, itemEntry1, itemEntry2, itemEntry3 FROM creature_equip_template");
1106 SF_LOG_INFO(
"server.loading",
">> Loaded 0 creature equipment templates. DB table `creature_equip_template` is empty!");
1113 Field* fields = result->Fetch();
1119 SF_LOG_ERROR(
"sql.sql",
"Creature template (Entry: %u) does not exist but has a record in `creature_equip_template`", entry);
1140 SF_LOG_ERROR(
"sql.sql",
"Unknown item (entry=%u) in creature_equip_template.itemEntry%u for entry = %u and id=%u, forced to 0.",
1141 equipmentInfo.
ItemEntry[i], i + 1, entry,
id);
1156 SF_LOG_ERROR(
"sql.sql",
"Item (entry=%u) in creature_equip_template.itemEntry%u for entry = %u and id = %u is not equipable in a hand, forced to 0.",
1157 equipmentInfo.
ItemEntry[i], i + 1, entry,
id);
1163 }
while (result->NextRow());
1172 return &(itr->second);
1204 if (IsCapturableBattlePetNpc(cinfo->
Entry))
1219 SF_LOG_ERROR(
"sql.sql",
"Model (Entry: %u) has modelid_other_gender %u not found in table `creature_model_info`. ", *displayID, modelInfo->
modelid_other_gender);
1235 QueryResult result =
WorldDatabase.Query(
"SELECT modelid, bounding_radius, combat_reach, gender, modelid_other_gender FROM creature_model_info");
1239 SF_LOG_INFO(
"server.loading",
">> Loaded 0 creature model definitions. DB table `creature_model_info` is empty.");
1248 Field* fields = result->Fetch();
1262 SF_LOG_ERROR(
"sql.sql",
"Table `creature_model_info` has model for not existed display id (%u).", modelId);
1266 SF_LOG_ERROR(
"sql.sql",
"Table `creature_model_info` has wrong gender (%u) for display id (%u).",
uint32(modelInfo.
gender), modelId);
1272 SF_LOG_ERROR(
"sql.sql",
"Table `creature_model_info` has not existed alt.gender model (%u) for existed display id (%u).", modelInfo.
modelid_other_gender, modelId);
1280 }
while (result->NextRow());
1291 QueryResult result =
WorldDatabase.Query(
"SELECT guid, linkedGuid, linkType FROM linked_respawn ORDER BY guid ASC");
1295 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 linked respawns. DB table `linked_respawn` is empty.");
1301 Field* fields = result->Fetch();
1307 uint64 guid = 0, linkedGuid = 0;
1316 SF_LOG_ERROR(
"sql.sql",
"Couldn't get creature data for GUIDLow %u", guidLow);
1324 SF_LOG_ERROR(
"sql.sql",
"Couldn't get creature data for GUIDLow %u", linkedGuidLow);
1332 SF_LOG_ERROR(
"sql.sql",
"Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
1339 SF_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
1353 SF_LOG_ERROR(
"sql.sql",
"Couldn't get creature data for GUIDLow %u", guidLow);
1361 SF_LOG_ERROR(
"sql.sql",
"Couldn't get gameobject data for GUIDLow %u", linkedGuidLow);
1369 SF_LOG_ERROR(
"sql.sql",
"Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
1376 SF_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
1390 SF_LOG_ERROR(
"sql.sql",
"Couldn't get gameobject data for GUIDLow %u", guidLow);
1398 SF_LOG_ERROR(
"sql.sql",
"Couldn't get gameobject data for GUIDLow %u", linkedGuidLow);
1406 SF_LOG_ERROR(
"sql.sql",
"Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
1413 SF_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
1427 SF_LOG_ERROR(
"sql.sql",
"Couldn't get gameobject data for GUIDLow %u", guidLow);
1435 SF_LOG_ERROR(
"sql.sql",
"Couldn't get creature data for GUIDLow %u", linkedGuidLow);
1443 SF_LOG_ERROR(
"sql.sql",
"Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
1450 SF_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
1463 }
while (result->NextRow());
1490 SF_LOG_ERROR(
"sql.sql",
"Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
1496 SF_LOG_ERROR(
"sql.sql",
"LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
1517 QueryResult result =
WorldDatabase.Query(
"SELECT summonerId, summonerType, groupId, entry, position_x, position_y, position_z, orientation, summonType, summonTime FROM creature_summon_groups");
1521 SF_LOG_INFO(
"server.loading",
">> Loaded 0 temp summons. DB table `creature_summon_groups` is empty.");
1528 Field* fields = result->Fetch();
1534 switch (summonerType)
1539 SF_LOG_ERROR(
"sql.sql",
"Table `creature_summon_groups` has summoner with non existing entry %u for creature summoner type, skipped.", summonerId);
1546 SF_LOG_ERROR(
"sql.sql",
"Table `creature_summon_groups` has summoner with non existing entry %u for gameobject summoner type, skipped.", summonerId);
1553 SF_LOG_ERROR(
"sql.sql",
"Table `creature_summon_groups` has summoner with non existing entry %u for map summoner type, skipped.", summonerId);
1558 SF_LOG_ERROR(
"sql.sql",
"Table `creature_summon_groups` has unhandled summoner type %u for summoner %u, skipped.",
uint8(summonerType), summonerId);
1567 SF_LOG_ERROR(
"sql.sql",
"Table `creature_summon_groups` has creature in group [Summoner ID: %u, Summoner Type: %u, Group ID: %u] with non existing creature entry %u, skipped.", summonerId,
uint8(summonerType), group, data.
entry);
1574 float orientation = fields[7].
GetFloat();
1582 SF_LOG_ERROR(
"sql.sql",
"Table `creature_summon_groups` has unhandled temp summon type %u in group [Summoner ID: %u, Summoner Type: %u, Group ID: %u] for creature entry %u, skipped.",
uint32(data.
type), summonerId,
uint8(summonerType), group, data.
entry);
1592 }
while (result->NextRow());
1602 QueryResult result =
WorldDatabase.Query(
"SELECT creature.guid, id, map, modelid, equipment_id, position_x, position_y, position_z, orientation, spawntimesecs, spawndist, "
1604 "currentwaypoint, curhealth, curmana, MovementType, spawnMask, creature.phaseid, creature.phasegroup, eventEntry, pool_entry, creature.npcflag, creature.unit_flags, creature.dynamicflags "
1606 "LEFT OUTER JOIN game_event_creature ON creature.guid = game_event_creature.guid "
1607 "LEFT OUTER JOIN pool_creature ON creature.guid = pool_creature.guid");
1611 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 creatures. DB table `creature` is empty.");
1616 std::map<uint32, uint32> spawnMasks;
1619 for (
int k = 0; k < 15; ++k)
1621 spawnMasks[i] |= (1 << k);
1627 Field* fields = result->Fetch();
1635 SF_LOG_ERROR(
"sql.sql",
"Table `creature` has creature (GUID: %u) with non existing creature entry %u, skipped.", guid, entry);
1666 SF_LOG_ERROR(
"sql.sql",
"Table `creature` have creature (GUID: %u) that spawned at not existed map (Id: %u), skipped.", guid, data.
mapid);
1671 SF_LOG_ERROR(
"sql.sql",
"Table `creature` have creature (GUID: %u) that have wrong spawn mask %u including not supported difficulty modes for map (Id: %u) spawnMasks[data.mapid]: %u.", guid, data.
spawnMask, data.
mapid, spawnMasks[data.
mapid]);
1674 for (
uint32 diff = 0; diff < 3 && ok; ++diff)
1678 SF_LOG_ERROR(
"sql.sql",
"Table `creature` have creature (GUID: %u) that listed as difficulty %u template (entry: %u) in `creature_template`, skipped.",
1679 guid, diff + 1, data.
id);
1691 SF_LOG_ERROR(
"sql.sql",
"Table `creature` have creature (Entry: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.", data.
id, data.
equipmentId);
1699 SF_LOG_ERROR(
"sql.sql",
"Table `creature` have creature (GUID: %u Entry: %u) with `creature_template`.`flags_extra` including CREATURE_FLAG_EXTRA_INSTANCE_BIND but creature are not in instance.", guid, data.
id);
1704 SF_LOG_ERROR(
"sql.sql",
"Table `creature` have creature (GUID: %u Entry: %u) with `spawndist`< 0, set to 0.", guid, data.
id);
1711 SF_LOG_ERROR(
"sql.sql",
"Table `creature` have creature (GUID: %u Entry: %u) with `MovementType`=1 (random movement) but with `spawndist`=0, replace by idle movement type (0).", guid, data.
id);
1719 SF_LOG_ERROR(
"sql.sql",
"Table `creature` have creature (GUID: %u Entry: %u) with `MovementType`=0 (idle) have `spawndist`<>0, set to 0.", guid, data.
id);
1726 SF_LOG_ERROR(
"sql.sql",
"Table `creature` has creature (GUID: %u Entry: %u) with non-existing `phasegroup` (%u) set, `phasegroup` set to 0", guid, data.
id, data.
phaseGroup);
1732 SF_LOG_ERROR(
"sql.sql",
"Table `creature` have creature (GUID: %u Entry: %u) with both `phaseid` and `phasegroup` set, `phasegroup` set to 0", guid, data.
id);
1737 if (gameEvent == 0 && PoolId == 0)
1741 }
while (result->NextRow());
1749 for (
uint32 i = 0; mask != 0; i++, mask >>= 1)
1763 for (
uint32 i = 0; mask != 0; i++, mask >>= 1)
1774uint32 ObjectMgr::AddGOData(
uint32 entry,
uint32 mapId,
float x,
float y,
float z,
float o,
uint32 spawntimedelay,
float rotation0,
float rotation1,
float rotation2,
float rotation3)
1814 SF_LOG_ERROR(
"misc",
"AddGOData: cannot add gameobject entry %u to map", entry);
1820 SF_LOG_DEBUG(
"maps",
"AddGOData: dbguid %u entry %u map %u x %f y %f z %f o %f", guid, entry, mapId, x, y, z, o);
1841 if (
Map* map =
sMapMgr->CreateBaseMap(mapId))
1844 if (!map->Instanceable() && map->IsGridLoaded(data.
posX, data.
posY))
1849 SF_LOG_ERROR(
"misc",
"MoveCreData: Cannot add creature guid %u to map", guid);
1894 if (
Map* map =
sMapMgr->CreateBaseMap(mapId))
1897 if (!map->Instanceable() && !map->IsRemovalGrid(x, y))
1902 SF_LOG_ERROR(
"misc",
"AddCreature: Cannot add creature entry %u to map", entry);
1919 QueryResult result =
WorldDatabase.Query(
"SELECT gameobject.guid, id, map, position_x, position_y, position_z, orientation, "
1921 "rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state, spawnMask, phaseid, phasegroup, eventEntry, pool_entry "
1922 "FROM gameobject LEFT OUTER JOIN game_event_gameobject ON gameobject.guid = game_event_gameobject.guid "
1923 "LEFT OUTER JOIN pool_gameobject ON gameobject.guid = pool_gameobject.guid");
1927 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 gameobjects. DB table `gameobject` is empty.");
1932 std::map<uint32, uint32> spawnMasks;
1935 for (
int k = 0; k < 15; ++k)
1937 spawnMasks[i] |= (1 << k);
1942 Field* fields = result->Fetch();
1950 SF_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: %u) with non existing gameobject entry %u, skipped.", guid, entry);
1956 switch (gInfo->
type)
1962 SF_LOG_ERROR(
"sql.sql",
"Gameobject (GUID: %u Entry %u GoType: %u) doesn't have a displayId (%u), not loaded.", guid, entry, gInfo->
type, gInfo->
displayId);
1969 SF_LOG_ERROR(
"sql.sql",
"Gameobject (GUID: %u Entry %u GoType: %u) has an invalid displayId (%u), not loaded.", guid, entry, gInfo->
type, gInfo->
displayId);
1990 SF_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: %u Entry: %u) spawned on a non-existed map (Id: %u), skip", guid, data.
id, data.
mapid);
1996 SF_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: %u Entry: %u) with `spawntimesecs` (0) value, but the gameobejct is marked as despawnable at action.", guid, data.
id);
2013 SF_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid `state` (%u) value, skip", guid, data.
id, go_state);
2023 SF_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: %u Entry: %u) that has wrong spawn mask %u including not supported difficulty modes for map (Id: %u), skip", guid, data.
id, data.
spawnMask, data.
mapid);
2032 SF_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: %u Entry: %u) with non-existing `phasegroup` (%u) set, `phasegroup` set to 0", guid, data.
id, data.
phaseGroup);
2038 SF_LOG_ERROR(
"sql.sql",
"Table `gameobject` have gameobject (GUID: %u Entry: %u) with both `phaseid` and `phasegroup` set, `phasegroup` set to 0", guid, data.
id);
2044 SF_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotation2 (%f) value, skip", guid, data.
id, data.
rotation2);
2050 SF_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotation3 (%f) value, skip", guid, data.
id, data.
rotation3);
2056 SF_LOG_ERROR(
"sql.sql",
"Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid coordinates, skip", guid, data.
id);
2064 if (allowedSpawnMask)
2068 LegacyTransport::LogRegisteredSpawn({ guid, data.
id, transportEntry, data.
mapid, allowedSpawnMask, data.
posX, data.
posY, data.
posZ, data.
orientation, animationInfo->TotalTime,
uint32(animationInfo->Path.size()) });
2075 else if (gameEvent == 0 && PoolId == 0)
2078 }
while (result->NextRow());
2086 for (
uint8 i = 0; mask != 0; i++, mask >>= 1)
2100 for (
uint8 i = 0; mask != 0; i++, mask >>= 1)
2139 name = player->GetName();
2151 name = (*result)[0].GetString();
2174 uint8 race = (*result)[0].GetUInt8();
2186 return player->GetSession()->GetAccountId();
2197 uint32 acc = (*result)[0].GetUInt32();
2214 uint32 acc = (*result)[0].GetUInt32();
2227 QueryResult result =
WorldDatabase.Query(
"SELECT entry, name_loc1, description_loc1, name_loc2, description_loc2, name_loc3, description_loc3, name_loc4, description_loc4, name_loc5, description_loc5, name_loc6, description_loc6, name_loc7, description_loc7, name_loc8, description_loc8, name_loc9, description_loc9, name_loc10, description_loc10, name_loc11, description_loc11 FROM locales_item");
2234 Field* fields = result->Fetch();
2246 }
while (result->NextRow());
2251void FillItemDamageFields(
float* minDamage,
float* maxDamage,
float* dps,
uint32 itemLevel,
uint32 itemClass,
uint32 itemSubClass,
uint32 quality,
uint32 delay,
float statScalingFactor,
uint32 inventoryType,
uint32 flags2)
2253 *minDamage = *maxDamage = *dps = 0.0f;
2259 if (inventoryType > 0xD + 13)
2262 switch (inventoryType)
2276 switch (itemSubClass)
2312 *dps = damageInfo->
DPS[quality];
2313 float avgDamage = *dps * delay * 0.001f;
2314 *minDamage = (statScalingFactor * -0.5f + 1.0f) * avgDamage;
2315 *maxDamage = floor(
float(avgDamage * (statScalingFactor * 0.5f + 1.0f) + 0.5f));
2325 1.0f, 1.0f, 1.0f, 1.17f, 1.37f, 1.68f, 0.0f, 0.0f
2328 static float const armorMultipliers[
MAX_INVTYPE] =
2386 float levelPenalty = 1.0f;
2387 if (itemLevel <= 28)
2388 levelPenalty = 0.966f - float(28u - itemLevel) / 54.0f;
2395 return 5 *
uint32(23.0f * qualityMultipliers[quality] * armorMultipliers[inventoryType] * levelPenalty + 0.5f);
2398 return 5 *
uint32(17.0f * qualityMultipliers[quality] * weaponMultipliers[itemSubClass] * levelPenalty + 0.5f);
2404 *(
int32*)requiredDisenchantSkill = -1;
2424 if (disenchant->
Id == 60 || disenchant->
Id == 61)
2429 else if (disenchant->
Id == 66 || disenchant->
Id == 67)
2435 *disenchantID = disenchant->
Id;
2452 if (!sparse || !db2Data)
2457 itemTemplate.
ItemId = itemId;
2533 itemTemplate.
Map = sparse->
Map;
2563 QueryResult result =
WorldDatabase.Query(
"SELECT entry, Class, SubClass, SoundOverrideSubclass, Name, DisplayId, Quality, Flags, FlagsExtra, Flags3, Unk430_1, Unk430_2, BuyCount, BuyPrice, SellPrice, "
2565 "InventoryType, AllowableClass, AllowableRace, ItemLevel, RequiredLevel, RequiredSkill, RequiredSkillRank, RequiredSpell, "
2567 "RequiredHonorRank, RequiredCityRank, RequiredReputationFaction, RequiredReputationRank, MaxCount, Stackable, ContainerSlots, "
2569 "stat_type1, stat_value1, stat_unk1_1, stat_unk2_1, stat_type2, stat_value2, stat_unk1_2, stat_unk2_2, "
2571 "stat_type3, stat_value3, stat_unk1_3, stat_unk2_3, stat_type4, stat_value4, stat_unk1_4, stat_unk2_4, "
2573 "stat_type5, stat_value5, stat_unk1_5, stat_unk2_5, stat_type6, stat_value6, stat_unk1_6, stat_unk2_6, "
2575 "stat_type7, stat_value7, stat_unk1_7, stat_unk2_7, stat_type8, stat_value8, stat_unk1_8, stat_unk2_8, "
2577 "stat_type9, stat_value9, stat_unk1_9, stat_unk2_9, stat_type10, stat_value10, stat_unk1_10, stat_unk2_10, "
2579 "ScalingStatDistribution, DamageType, Delay, RangedModRange, "
2581 "spellid_1, spelltrigger_1, spellcharges_1, spellcooldown_1, spellcategory_1, spellcategorycooldown_1, "
2583 "spellid_2, spelltrigger_2, spellcharges_2, spellcooldown_2, spellcategory_2, spellcategorycooldown_2, "
2585 "spellid_3, spelltrigger_3, spellcharges_3, spellcooldown_3, spellcategory_3, spellcategorycooldown_3, "
2587 "spellid_4, spelltrigger_4, spellcharges_4, spellcooldown_4, spellcategory_4, spellcategorycooldown_4, "
2589 "spellid_5, spelltrigger_5, spellcharges_5, spellcooldown_5, spellcategory_5, spellcategorycooldown_5, "
2591 "Bonding, Description, PageText, LanguageID, PageMaterial, StartQuest, LockID, Material, "
2593 "Sheath, RandomProperty, RandomSuffix, ItemSet, Area, Map, BagFamily, TotemCategory, "
2595 "SocketColor_1, SocketContent_1, SocketColor_2, SocketContent_2, SocketColor_3, SocketContent_3, SocketBonus, "
2597 "GemProperties, ArmorDamageModifier, Duration, ItemLimitCategory, HolidayId, StatScalingFactor, "
2599 "CurrencySubstitutionId, CurrencySubstitutionCount "
2600 "FROM item_template");
2606 Field* fields = result->Fetch();
2613 itemTemplate.
ItemId = itemId;
2614 itemTemplate.
Class =
uint32(fields[1].GetUInt8());
2692 itemTemplate.
Map =
uint32(fields[117].GetUInt16());
2718 }
while (result->NextRow());
2722 std::set<uint32> notFoundOutfit;
2731 if (entry->
ItemId[j] <= 0)
2737 notFoundOutfit.insert(item_id);
2741 for (std::set<uint32>::const_iterator itr = notFoundOutfit.begin(); itr != notFoundOutfit.end(); ++itr)
2742 SF_LOG_ERROR(
"sql.sql",
"Item (Entry: %u) does not exist in `item_template` but is referenced in `CharStartOutfit.dbc`", *itr);
2744 SF_LOG_INFO(
"server.loading",
">> Loaded %u item templates from Item-sparse.db2 and %u from database in %u ms", sparseCount, dbCount,
GetMSTimeDiffToNow(oldMSTime));
2752 QueryResult result =
WorldDatabase.Query(
"SELECT Id, FlagsCu, FoodType, MinMoneyLoot, MaxMoneyLoot, SpellPPMChance FROM item_template_addon");
2757 Field* fields = result->Fetch();
2761 SF_LOG_ERROR(
"sql.sql",
"Item %u specified in `item_template_addon` does not exist, skipped.", itemId);
2767 if (minMoneyLoot > maxMoneyLoot)
2769 SF_LOG_ERROR(
"sql.sql",
"Minimum money loot specified in `item_template_addon` for item %u was greater than maximum amount, swapping.", itemId);
2770 std::swap(minMoneyLoot, maxMoneyLoot);
2779 }
while (result->NextRow());
2794 Field* fields = result->Fetch();
2798 SF_LOG_ERROR(
"sql.sql",
"Item %u specified in `item_script_names` does not exist, skipped.", itemId);
2804 }
while (result->NextRow());
2813 return &(itr->second);
2826 QueryResult result =
WorldDatabase.Query(
"SELECT `entry`, `accessory_entry`, `seat_id`, `minion`, `summontype`, `summontimer` FROM `vehicle_template_accessory`");
2830 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 vehicle template accessories. DB table `vehicle_template_accessory` is empty.");
2836 Field* fields = result->Fetch();
2840 int8 uiSeat =
int8(fields[2].GetInt8());
2841 bool bMinion = fields[3].
GetBool();
2845 if (!
sObjectMgr->GetCreatureTemplate(uiEntry))
2847 SF_LOG_ERROR(
"sql.sql",
"Table `vehicle_template_accessory`: creature template entry %u does not exist.", uiEntry);
2851 if (!
sObjectMgr->GetCreatureTemplate(uiAccessory))
2853 SF_LOG_ERROR(
"sql.sql",
"Table `vehicle_template_accessory`: Accessory %u does not exist.", uiAccessory);
2859 SF_LOG_ERROR(
"sql.sql",
"Table `vehicle_template_accessory`: creature template entry %u has no data in npc_spellclick_spells", uiEntry);
2866 }
while (result->NextRow());
2880 QueryResult result =
WorldDatabase.Query(
"SELECT `guid`, `accessory_entry`, `seat_id`, `minion`, `summontype`, `summontimer` FROM `vehicle_accessory`");
2890 Field* fields = result->Fetch();
2894 int8 uiSeat =
int8(fields[2].GetInt16());
2895 bool bMinion = fields[3].
GetBool();
2899 if (!
sObjectMgr->GetCreatureTemplate(uiAccessory))
2901 SF_LOG_ERROR(
"sql.sql",
"Table `vehicle_accessory`: Accessory %u does not exist.", uiAccessory);
2908 }
while (result->NextRow());
2918 QueryResult result =
WorldDatabase.Query(
"SELECT creature_entry, level, hp, mana, str, agi, sta, inte, spi, armor FROM pet_levelstats");
2922 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 level pet stats definitions. DB table `pet_levelstats` is empty.");
2930 Field* fields = result->Fetch();
2933 if (!
sObjectMgr->GetCreatureTemplate(creature_id))
2935 SF_LOG_ERROR(
"sql.sql",
"Wrong creature id %u in `pet_levelstats` table, ignoring.", creature_id);
2946 SF_LOG_INFO(
"misc",
"Unused (> MaxPlayerLevel in worldserver.conf) level %u in `pet_levelstats` table, ignoring.", current_level);
2951 else if (current_level < 1)
2953 SF_LOG_ERROR(
"sql.sql",
"Wrong (<1) level %u in `pet_levelstats` table, ignoring.", current_level);
2959 if (pInfoMapEntry == NULL)
2963 PetLevelInfo* pLevelInfo = &pInfoMapEntry[current_level - 1];
2975 }
while (result->NextRow());
2983 if (!pInfo || pInfo[0].health == 0)
2985 SF_LOG_ERROR(
"sql.sql",
"Creature %u does not have pet stats data for Level 1!", itr->first);
2992 if (pInfo[level].health == 0)
2994 SF_LOG_ERROR(
"sql.sql",
"Creature %u has no data for Level %i pet stats data, using data of Level %i.", itr->first, level + 1, level);
2995 pInfo[level] = pInfo[level - 1];
3008 PetLevelInfoContainer::const_iterator itr =
_petInfoStore.find(creature_id);
3012 return &itr->second[level - 1];
3025 SF_LOG_ERROR(
"sql.sql",
"Invalid count %i specified on item %u be removed from original player create info (use -1)!", count, itemId);
3034 if (entry->ItemId[x] > 0 &&
uint32(entry->ItemId[x]) == itemId)
3043 SF_LOG_ERROR(
"sql.sql",
"Item %u specified to be removed from original create info not found in dbc!", itemId);
3055 QueryResult result =
WorldDatabase.Query(
"SELECT race, class, map, zone, position_x, position_y, position_z, orientation FROM playercreateinfo");
3059 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 player create definitions. DB table `playercreateinfo` is empty.");
3068 Field* fields = result->Fetch();
3074 float positionX = fields[4].
GetFloat();
3075 float positionY = fields[5].
GetFloat();
3076 float positionZ = fields[6].
GetFloat();
3077 float orientation = fields[7].
GetFloat();
3082 SF_LOG_ERROR(
"sql.sql",
"Wrong race %u in `playercreateinfo` table, ignoring.", current_race);
3088 SF_LOG_ERROR(
"sql.sql",
"Wrong class %u in `playercreateinfo` table, ignoring.", current_class);
3095 SF_LOG_ERROR(
"sql.sql",
"Wrong home position for class %u race %u pair in `playercreateinfo` table, ignoring.", current_class, current_race);
3099 if (
sMapStore.LookupEntry(mapId)->Instanceable())
3101 SF_LOG_ERROR(
"sql.sql",
"Home position in instanceable map for class %u race %u pair in `playercreateinfo` table, ignoring.", current_class, current_race);
3106 info->
mapId = mapId;
3117 }
while (result->NextRow());
3150 SF_LOG_INFO(
"server.loading",
"Loading Player Create Items Data...");
3158 SF_LOG_INFO(
"server.loading",
">> Loaded 0 custom player create items. DB table `playercreateinfo_item` is empty.");
3166 Field* fields = result->Fetch();
3171 SF_LOG_ERROR(
"sql.sql",
"Wrong race %u in `playercreateinfo_item` table, ignoring.", current_race);
3178 SF_LOG_ERROR(
"sql.sql",
"Wrong class %u in `playercreateinfo_item` table, ignoring.", current_class);
3186 SF_LOG_ERROR(
"sql.sql",
"Item id %u (race %u class %u) in `playercreateinfo_item` table but not listed in `item_template`, ignoring.", item_id, current_race, current_class);
3194 SF_LOG_ERROR(
"sql.sql",
"Item id %u (class %u race %u) have amount == 0 in `playercreateinfo_item` table, ignoring.", item_id, current_race, current_class);
3198 if (!current_race || !current_class)
3200 uint32 min_race = current_race ? current_race : 1;
3202 uint32 min_class = current_class ? current_class : 1;
3204 for (
uint32 r = min_race; r < max_race; ++r)
3205 for (
uint32 c = min_class; c < max_class; ++c)
3212 }
while (result->NextRow());
3222 SF_LOG_INFO(
"server.loading",
"Loading Player Create Spell Data...");
3239 Field* fields = result->Fetch();
3246 SF_LOG_ERROR(
"sql.sql",
"Spell %u in `%s` does not exist in SpellStore, ignoring.", spellId, tableName.c_str());
3252 SF_LOG_ERROR(
"sql.sql",
"Wrong race mask %u in `%s` table, ignoring.", raceMask, tableName.c_str());
3258 SF_LOG_ERROR(
"sql.sql",
"Wrong class mask %u in `%s` table, ignoring.", classMask, tableName.c_str());
3264 if (raceMask == 0 || ((1 << (raceIndex - 1)) & raceMask))
3268 if (classMask == 0 || ((1 << (classIndex - 1)) & classMask))
3272 info->spell.push_back(spellId);
3283 }
while (result->NextRow());
3293 SF_LOG_INFO(
"server.loading",
"Loading Player Create Action Data...");
3302 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 player create actions. DB table `playercreateinfo_action` is empty.");
3310 Field* fields = result->Fetch();
3315 SF_LOG_ERROR(
"sql.sql",
"Wrong race %u in `playercreateinfo_action` table, ignoring.", current_race);
3322 SF_LOG_ERROR(
"sql.sql",
"Wrong class %u in `playercreateinfo_action` table, ignoring.", current_class);
3327 info->action.push_back(
PlayerCreateInfoAction(fields[2].GetUInt16(), fields[3].GetUInt32(), fields[4].GetUInt16()));
3330 }
while (result->NextRow());
3340 SF_LOG_INFO(
"server.loading",
"Loading Player Create Level Stats Data...");
3345 QueryResult result =
WorldDatabase.Query(
"SELECT race, class, level, str, agi, sta, inte, spi FROM player_levelstats");
3349 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 level stats definitions. DB table `player_levelstats` is empty.");
3357 Field* fields = result->Fetch();
3362 SF_LOG_ERROR(
"sql.sql",
"Wrong race %u in `player_levelstats` table, ignoring.", current_race);
3369 SF_LOG_ERROR(
"sql.sql",
"Wrong class %u in `player_levelstats` table, ignoring.", current_class);
3380 SF_LOG_INFO(
"misc",
"Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_levelstats` table, ignoring.", current_level);
3388 if (!info->levelInfo)
3397 }
while (result->NextRow());
3400 for (
int race = 0; race <
MAX_RACES; ++race)
3406 for (
int class_ = 0; class_ <
MAX_CLASSES; ++class_)
3431 SF_LOG_ERROR(
"sql.sql",
"Race %i Class %i Level 1 does not have stats data!", race, class_);
3440 SF_LOG_ERROR(
"sql.sql",
"Race %i Class %i Level %i does not have stats data. Using stats data of level %i.", race, class_, level + 1, level);
3454 SF_LOG_INFO(
"server.loading",
"Loading Player Create XP Data...");
3467 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 xp for level definitions. DB table `player_xp_for_level` is empty.");
3475 Field* fields = result->Fetch();
3486 SF_LOG_INFO(
"misc",
"Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_xp_for_level` table, ignoring.", current_level);
3494 }
while (result->NextRow());
3501 SF_LOG_ERROR(
"sql.sql",
"Level %i does not have XP for level data. Using data of level [%i] + 100.", level + 1, level);
3513 SF_LOG_INFO(
"server.loading",
"Loading Player Create Spell Cast Data...");
3520 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 player create cast spells. DB table `playercreateinfo_spell_cast` is empty.");
3527 Field* fields = result->Fetch();
3534 SF_LOG_ERROR(
"sql.sql",
"Wrong race mask %u in `playercreateinfo_spell_cast` table, ignoring.", racemask);
3540 SF_LOG_ERROR(
"sql.sql",
"Wrong class mask %u in `playercreateinfo_spell_cast` table, ignoring.", classmask);
3546 if (racemask == 0 || ((1 << (raceIndex - 1)) & racemask))
3550 if (classmask == 0 || ((1 << (classIndex - 1)) & classmask))
3554 info->spell_cast.push_back(spellId);
3561 }
while (result->NextRow());
3581 SF_LOG_ERROR(
"misc",
"Tried to get non-existant Class-Level combination data for base hp/mp. Class %u Level %u", class_, level);
3633 info->
stats[
STAT_SPIRIT] += (lvl > 38 ? 1 : (lvl > 9 && !(lvl % 2) ? 1 : 0));
3640 info->
stats[
STAT_SPIRIT] += (lvl > 38 ? 1 : (lvl > 9 && !(lvl % 2) ? 1 : 0));
3700 "Id, Method, Level, MinLevel, MaxLevel, ZoneOrSort, Type, SuggestedPlayers, LimitTime, RequiredClasses, RequiredRaces, RequiredSkillId, RequiredSkillPoints, "
3701 "RequiredMinRepFaction, RequiredMaxRepFaction, RequiredMinRepValue, RequiredMaxRepValue, PrevQuestId, NextQuestId, ExclusiveGroup, NextQuestIdChain, RewardXPId, RewardMoney, RewardMoneyMaxLevel, RewardSpell, RewardSpellCast, "
3702 "RewardHonor, RewardHonorMultiplier, RewardMailTemplateId, RewardMailDelay, SourceItemId, SourceSpellId, Flags, Flags2, SpecialFlags, MinimapTargetMark, RewardTitleId, RewardTalents, RewardArenaPoints, "
3703 "RewardSkillId, RewardSkillPoints, RewardReputationMask, QuestGiverPortrait, QuestTurnInPortrait, RewardPackageItemId, RewardItemId1, RewardItemId2, RewardItemId3, RewardItemId4, RewardItemCount1, RewardItemCount2, RewardItemCount3, RewardItemCount4, "
3704 "RewardChoiceItemId1, RewardChoiceItemId2, RewardChoiceItemId3, RewardChoiceItemId4, RewardChoiceItemId5, RewardChoiceItemId6, RewardChoiceItemCount1, RewardChoiceItemCount2, RewardChoiceItemCount3, RewardChoiceItemCount4, RewardChoiceItemCount5, RewardChoiceItemCount6, "
3705 "RewardFactionId1, RewardFactionId2, RewardFactionId3, RewardFactionId4, RewardFactionId5, RewardFactionValueId1, RewardFactionValueId2, RewardFactionValueId3, RewardFactionValueId4, RewardFactionValueId5, "
3706 "RewardFactionValueIdOverride1, RewardFactionValueIdOverride2, RewardFactionValueIdOverride3, RewardFactionValueIdOverride4, RewardFactionValueIdOverride5, "
3707 "PointMapId, PointX, PointY, PointOption, Title, Objectives, Details, EndText, OfferRewardText, RequestItemsText, CompletedText,"
3708 "RequiredSourceItemId1, RequiredSourceItemId2, RequiredSourceItemId3, RequiredSourceItemId4, RequiredSourceItemCount1, RequiredSourceItemCount2, RequiredSourceItemCount3, RequiredSourceItemCount4, "
3709 "RewardCurrencyId1, RewardCurrencyId2, RewardCurrencyId3, RewardCurrencyId4, RewardCurrencyCount1, RewardCurrencyCount2, RewardCurrencyCount3, RewardCurrencyCount4, "
3710 "QuestGiverTextWindow, QuestGiverTargetName, QuestTurnTextWindow, QuestTurnTargetName, SoundAccept, SoundTurnIn, "
3711 "DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4, EmoteOnIncomplete, EmoteOnComplete, "
3712 "OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4, OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4, WDBVerified"
3713 " FROM quest_template");
3717 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 quests definitions. DB table `quest_template` is empty.");
3726 Field* fields = result->Fetch();
3730 }
while (result->NextRow());
3732 std::map<uint32, uint32> usedMailTemplates;
3741 Quest* qinfo = iter->second;
3750 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u",
3757 SF_LOG_ERROR(
"sql.sql",
"Weekly Quest %u is marked as daily quest in `Flags`, removed daily flag.", qinfo->
GetQuestId());
3765 SF_LOG_ERROR(
"sql.sql",
"Daily Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->
GetQuestId());
3774 SF_LOG_ERROR(
"sql.sql",
"Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->
GetQuestId());
3783 SF_LOG_ERROR(
"sql.sql",
"Monthly quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->
GetQuestId());
3795 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardChoiceItemId%d` = %u but item from `RewardChoiceItemId%d` can't be rewarded with quest flag QUEST_FLAGS_TRACKING_EVENT.",
3813 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `ZoneOrSort` = %u (zone case) but zone with this id does not exist.",
3824 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `ZoneOrSort` = %i (sort case) but quest sort with this id does not exist.",
3833 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `ZoneOrSort` = %i but `RequiredSkillId` does not have a corresponding value (%d).",
3863 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RequiredSkillId` = %u but this skill does not exist",
3872 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RequiredSkillPoints` = %u but max possible skill is %u, quest can't be done.",
3881 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RequiredMinRepFaction` = %u but faction template %u does not exist, quest can't be done.",
3888 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RequiredMaxRepFaction` = %u but faction template %u does not exist, quest can't be done.",
3895 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RequiredMinRepValue` = %d but max reputation is %u, quest can't be done.",
3902 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RequiredMaxRepValue` = %d and `RequiredMinRepValue` = %d, quest can't be done.",
3909 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RequiredMinRepValue` = %d but `RequiredMinRepFaction` is 0, value has no effect",
3916 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RequiredMaxRepValue` = %d but `RequiredMaxRepFaction` is 0, value has no effect",
3923 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardTitleId` = %u but CharTitle Id %u does not exist, quest can't be rewarded with title.",
3933 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `SourceItemId` = %u but item with entry %u does not exist, quest can't be done.",
3944 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `SourceSpellid` = %u but spell %u doesn't exist, quest can't be done.",
3950 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `SourceSpellid` = %u but spell %u is broken, quest can't be done.",
3963 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RequiredSourceItemId%d` = %u but item with entry %u does not exist, quest can't be done.",
3972 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RequiredSourceItemId%d` = 0 but `RequiredSourceItemCount%d` = %u.",
3986 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardChoiceItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.",
3993 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardChoiceItemId%d` = %u but `RewardChoiceItemCount%d` = 0, quest can't be done.",
4000 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardChoiceItemId%d` = 0 but `RewardChoiceItemCount%d` = %u.",
4013 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.",
4020 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardItemId%d` = %u but `RewardItemIdCount%d` = 0, quest will not reward this item.",
4027 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardItemId%d` = 0 but `RewardItemIdCount%d` = %u.",
4050 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardFactionId%d` = 0 but `RewardFactionValueIdOverride%d` = %i.",
4062 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardSpell` = %u but spell %u does not exist, spell removed as display reward.",
4069 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardSpell` = %u but spell %u is broken, quest will not have a spell reward.",
4076 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.",
4088 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardSpellCast` = %u but spell %u does not exist, quest will not have a spell reward.",
4095 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardSpellCast` = %u but spell %u is broken, quest will not have a spell reward.",
4102 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.",
4112 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardMailTemplateId` = %u but mail template %u does not exist, quest will not have a mail reward.",
4119 std::map<uint32, uint32>::const_iterator used_mt_itr = usedMailTemplates.find(qinfo->
RewardMailTemplateId);
4120 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardMailTemplateId` = %u but mail template %u already used for quest %u, quest will not have a mail reward.",
4134 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `NextQuestIdChain` = %u but quest %u does not exist, quest chain will not work.",
4139 qNextItr->second->prevChainQuests.push_back(qinfo->
GetQuestId());
4148 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardCurrencyId%d` = %u but `RewardCurrencyCount%d` = 0, quest can't be done.",
4155 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardCurrencyId%d` = %u but currency with entry %u does not exist, quest can't be done.",
4162 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardCurrencyId%d` = 0 but `RewardCurrencyCount%d` = %u, quest can't be done.",
4172 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `SoundAccept` = %u but sound %u does not exist, set to 0.",
4182 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `SoundTurnIn` = %u but sound %u does not exist, set to 0.",
4192 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardSkillId` = %u but this skill does not exist",
4197 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardSkillId` = %u but `RewardSkillPoints` is 0",
4206 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardSkillPoints` = %u but max possible skill is %u, quest can't be done.",
4212 SF_LOG_ERROR(
"sql.sql",
"Quest %u has `RewardSkillPoints` = %u but `RewardSkillId` is 0",
4234 qNextItr->second->prevQuests.push_back(signedQuestId);
4266 SF_LOG_ERROR(
"sql.sql",
"Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u, 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);
4284 "Title_loc1, Details_loc1, Objectives_loc1, OfferRewardText_loc1, RequestItemsText_loc1, EndText_loc1, CompletedText_loc1, QuestGiverTextWindow_loc1, QuestGiverTargetName_loc1, QuestTurnTextWindow_loc1, QuestTurnTargetName_loc1,"
4285 "Title_loc2, Details_loc2, Objectives_loc2, OfferRewardText_loc2, RequestItemsText_loc2, EndText_loc2, CompletedText_loc2, QuestGiverTextWindow_loc2, QuestGiverTargetName_loc2, QuestTurnTextWindow_loc2, QuestTurnTargetName_loc2,"
4286 "Title_loc3, Details_loc3, Objectives_loc3, OfferRewardText_loc3, RequestItemsText_loc3, EndText_loc3, CompletedText_loc3, QuestGiverTextWindow_loc3, QuestGiverTargetName_loc3, QuestTurnTextWindow_loc3, QuestTurnTargetName_loc3,"
4287 "Title_loc4, Details_loc4, Objectives_loc4, OfferRewardText_loc4, RequestItemsText_loc4, EndText_loc4, CompletedText_loc4, QuestGiverTextWindow_loc4, QuestGiverTargetName_loc4, QuestTurnTextWindow_loc4, QuestTurnTargetName_loc4,"
4288 "Title_loc5, Details_loc5, Objectives_loc5, OfferRewardText_loc5, RequestItemsText_loc5, EndText_loc5, CompletedText_loc5, QuestGiverTextWindow_loc5, QuestGiverTargetName_loc5, QuestTurnTextWindow_loc5, QuestTurnTargetName_loc5,"
4289 "Title_loc6, Details_loc6, Objectives_loc6, OfferRewardText_loc6, RequestItemsText_loc6, EndText_loc6, CompletedText_loc6, QuestGiverTextWindow_loc6, QuestGiverTargetName_loc6, QuestTurnTextWindow_loc6, QuestTurnTargetName_loc6,"
4290 "Title_loc7, Details_loc7, Objectives_loc7, OfferRewardText_loc7, RequestItemsText_loc7, EndText_loc7, CompletedText_loc7, QuestGiverTextWindow_loc7, QuestGiverTargetName_loc7, QuestTurnTextWindow_loc7, QuestTurnTargetName_loc7,"
4291 "Title_loc8, Details_loc8, Objectives_loc8, OfferRewardText_loc8, RequestItemsText_loc8, EndText_loc8, CompletedText_loc8, QuestGiverTextWindow_loc8, QuestGiverTargetName_loc8, QuestTurnTextWindow_loc8, QuestTurnTargetName_loc8,"
4292 "Title_loc9, Details_loc9, Objectives_loc9, OfferRewardText_loc9, RequestItemsText_loc9, EndText_loc9, CompletedText_loc9, QuestGiverTextWindow_loc9, QuestGiverTargetName_loc9, QuestTurnTextWindow_loc9, QuestTurnTargetName_loc9,"
4293 "Title_loc10, Details_loc10, Objectives_loc10, OfferRewardText_loc10, RequestItemsText_loc10, EndText_loc10, CompletedText_loc10, QuestGiverTextWindow_loc10, QuestGiverTargetName_loc10, QuestTurnTextWindow_loc10, QuestTurnTargetName_loc10,"
4294 "Title_loc11, Details_loc11, Objectives_loc11, OfferRewardText_loc11, RequestItemsText_loc11, EndText_loc11, CompletedText_loc11, QuestGiverTextWindow_loc11, QuestGiverTargetName_loc11, QuestTurnTextWindow_loc11, QuestTurnTargetName_loc11"
4295 " FROM locales_quest");
4302 Field* fields = result->Fetch();
4324 }
while (result->NextRow());
4338 if (tableName.empty())
4344 SF_LOG_INFO(
"server.loading",
"Loading %s...", tableName.c_str());
4350 QueryResult result =
WorldDatabase.PQuery(
"SELECT id, delay, command, datalong, datalong2, dataint, x, y, z, o%s FROM %s", isSpellScriptTable ?
", effIndex" :
"", tableName.c_str());
4354 SF_LOG_INFO(
"server.loading",
">> Loaded 0 script definitions. DB table `%s` is empty!", tableName.c_str());
4362 Field* fields = result->Fetch();
4366 if (isSpellScriptTable)
4385 SF_LOG_ERROR(
"sql.sql",
"Table `%s` has invalid talk type (datalong = %u) in SCRIPT_COMMAND_TALK for script id %u",
4391 SF_LOG_ERROR(
"sql.sql",
"Table `%s` has invalid talk text id (dataint = %i) in SCRIPT_COMMAND_TALK for script id %u",
4397 SF_LOG_ERROR(
"sql.sql",
"Table `%s` has out of range text id (dataint = %i expected %u-%u) in SCRIPT_COMMAND_TALK for script id %u",
4409 SF_LOG_ERROR(
"sql.sql",
"Table `%s` has invalid emote id (datalong = %u) in SCRIPT_COMMAND_EMOTE for script id %u",
4420 SF_LOG_ERROR(
"sql.sql",
"Table `%s` has invalid map (Id: %u) in SCRIPT_COMMAND_TELEPORT_TO for script id %u",
4427 SF_LOG_ERROR(
"sql.sql",
"Table `%s` has invalid coordinates (X: %f Y: %f Z: %f O: %f) in SCRIPT_COMMAND_TELEPORT_TO for script id %u",
4439 SF_LOG_ERROR(
"sql.sql",
"Table `%s` has invalid quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u",
4446 SF_LOG_ERROR(
"sql.sql",
"Table `%s` has quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, 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.",
4457 SF_LOG_ERROR(
"sql.sql",
"Table `%s` has too large distance (%u) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u",
4464 SF_LOG_ERROR(
"sql.sql",
"Table `%s` has too large distance (%u) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, max distance is %f or 0 for disable distance check",
4471 SF_LOG_ERROR(
"sql.sql",
"Table `%s` has too small distance (%u) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, min distance is %f or 0 for disable distance check",
4483 SF_LOG_ERROR(
"sql.sql",
"Table `%s` has invalid creature (Entry: %u) in SCRIPT_COMMAND_KILL_CREDIT for script id %u",
4495 SF_LOG_ERROR(
"sql.sql",
"Table `%s` has invalid gameobject (GUID: %u) in SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u",
4503 SF_LOG_ERROR(
"sql.sql",
"Table `%s` has gameobject with invalid entry (GUID: %u Entry: %u) in SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u",
4514 SF_LOG_ERROR(
"sql.sql",
"Table `%s` have gameobject type (%u) unsupported by command SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u",
4515 tableName.c_str(), info->
entry, tmp.
id);
4525 SF_LOG_ERROR(
"sql.sql",
"Table `%s` has invalid coordinates (X: %f Y: %f Z: %f O: %f) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id %u",
4532 SF_LOG_ERROR(
"sql.sql",
"Table `%s` has invalid creature (Entry: %u) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id %u",
4545 SF_LOG_ERROR(
"sql.sql",
"Table `%s` has invalid gameobject (GUID: %u) in %s for script id %u",
4553 SF_LOG_ERROR(
"sql.sql",
"Table `%s` has gameobject with invalid entry (GUID: %u Entry: %u) in %s for script id %u",
4560 SF_LOG_ERROR(
"sql.sql",
"Table `%s` has gameobject type (%u) non supported by command %s for script id %u",
4572 SF_LOG_ERROR(
"sql.sql",
"Table `%s` using non-existent spell (id: %u) in SCRIPT_COMMAND_REMOVE_AURA for script id %u",
4578 SF_LOG_ERROR(
"sql.sql",
"Table `%s` using unknown flags in datalong2 (%u) in SCRIPT_COMMAND_REMOVE_AURA for script id %u",
4589 SF_LOG_ERROR(
"sql.sql",
"Table `%s` using non-existent spell (id: %u) in SCRIPT_COMMAND_CAST_SPELL for script id %u",
4595 SF_LOG_ERROR(
"sql.sql",
"Table `%s` using unknown target in datalong2 (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u",
4601 SF_LOG_ERROR(
"sql.sql",
"Table `%s` using unknown flags in dataint (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u",
4607 SF_LOG_ERROR(
"sql.sql",
"Table `%s` using invalid creature entry in dataint (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u",
4618 SF_LOG_ERROR(
"sql.sql",
"Table `%s` has nonexistent item (entry: %u) in SCRIPT_COMMAND_CREATE_ITEM for script id %u",
4624 SF_LOG_ERROR(
"sql.sql",
"Table `%s` SCRIPT_COMMAND_CREATE_ITEM but amount is %u for script id %u",
4634 if (scripts->find(tmp.
id) == scripts->end())
4637 (*scripts)[tmp.
id] = emptyMap;
4639 (*scripts)[tmp.
id].insert(std::pair<uint32, ScriptInfo>(tmp.
delay, tmp));
4642 }
while (result->NextRow());
4659 SF_LOG_ERROR(
"sql.sql",
"Table `spell_scripts` has not existing spell (Id: %u) as script id", spellId);
4666 SF_LOG_ERROR(
"sql.sql",
"Table `spell_scripts` - spell %u effect %u is not SPELL_EFFECT_SCRIPT_EFFECT or SPELL_EFFECT_DUMMY", spellId, i);
4674 std::set<uint32> evt_scripts;
4677 for (GameObjectTemplateContainer::const_iterator itr = gotc->begin(); itr != gotc->end(); ++itr)
4678 if (
uint32 eventId = itr->second.GetEventScriptId())
4679 evt_scripts.insert(eventId);
4686 if (spell->Effects[j].MiscValue)
4687 evt_scripts.insert(spell->Effects[j].MiscValue);
4706 std::set<uint32>::const_iterator itr2 = evt_scripts.find(itr->first);
4707 if (itr2 == evt_scripts.end())
4708 SF_LOG_ERROR(
"sql.sql",
"Table `event_scripts` has script (Id: %u) not referring to any gameobject_template type 10 data2 field, type 3 data6 field, type 13 data 2 field or any spell effect %u",
4718 std::set<uint32> actionSet;
4721 actionSet.insert(itr->first);
4730 Field* fields = result->Fetch();
4733 actionSet.erase(action);
4734 }
while (result->NextRow());
4737 for (std::set<uint32>::iterator itr = actionSet.begin(); itr != actionSet.end(); ++itr)
4738 SF_LOG_ERROR(
"sql.sql",
"There is no waypoint which links to the waypoint script %u", *itr);
4751 SF_LOG_INFO(
"server.loading",
">> Loaded 0 spell script names. DB table `spell_script_names` is empty!");
4759 Field* fields = result->Fetch();
4762 char const* scriptName = fields[1].
GetCString();
4764 bool allRanks =
false;
4774 SF_LOG_ERROR(
"sql.sql",
"Scriptname: `%s` spell (Id: %d) does not exist.", scriptName, fields[0].GetInt32());
4781 SF_LOG_ERROR(
"sql.sql",
"Scriptname: `%s` spell (Id: %d) has no ranks of spell.", scriptName, fields[0].GetInt32());
4785 SF_LOG_ERROR(
"sql.sql",
"Scriptname: `%s` spell (Id: %d) is not first rank of spell.", scriptName, fields[0].GetInt32());
4797 SF_LOG_ERROR(
"sql.sql",
"Scriptname: `%s` spell (Id: %d) is ranked spell. Perhaps not all ranks are assigned to this script.", scriptName, spellId);
4803 }
while (result->NextRow());
4814 SF_LOG_INFO(
"server.loading",
">> Validated 0 scripts.");
4823 std::vector<std::pair<SpellScriptLoader*, SpellScriptsContainer::iterator> > SpellScriptLoaders;
4824 sScriptMgr->CreateSpellScriptLoaders(itr->first, SpellScriptLoaders);
4827 for (std::vector<std::pair<SpellScriptLoader*, SpellScriptsContainer::iterator> >::iterator sitr = SpellScriptLoaders.begin(); sitr != SpellScriptLoaders.end(); ++sitr)
4829 SpellScript* spellScript = sitr->first->GetSpellScript();
4830 AuraScript* auraScript = sitr->first->GetAuraScript();
4832 if (!spellScript && !auraScript)
4834 SF_LOG_ERROR(
"scripts",
"Functions GetSpellScript() and GetAuraScript() of script `%s` do not return objects - script skipped",
GetScriptName(sitr->second->second));
4839 spellScript->
_Init(&sitr->first->GetName(), spellEntry->
Id);
4841 if (!spellScript->
_Validate(spellEntry))
4847 auraScript->
_Init(&sitr->first->GetName(), spellEntry->
Id);
4873 SF_LOG_INFO(
"server.loading",
">> Loaded 0 page texts. DB table `page_text` is empty!");
4880 Field* fields = result->Fetch();
4888 }
while (result->NextRow());
4892 if (itr->second.NextPage)
4894 PageTextContainer::const_iterator itr2 =
_pageTextStore.find(itr->second.NextPage);
4896 SF_LOG_ERROR(
"sql.sql",
"Page text (Id: %u) has not existing next page (Id: %u)", itr->first, itr->second.NextPage);
4905 PageTextContainer::const_iterator itr =
_pageTextStore.find(pageEntry);
4907 return &(itr->second);
4918 QueryResult result =
WorldDatabase.Query(
"SELECT entry, text_loc1, text_loc2, text_loc3, text_loc4, text_loc5, text_loc6, text_loc7, text_loc8, text_loc9, text_loc10, text_loc11 FROM locales_page_text");
4925 Field* fields = result->Fetch();
4933 }
while (result->NextRow());
4947 SF_LOG_INFO(
"server.loading",
">> Loaded 0 instance templates. DB table `page_text` is empty!");
4954 Field* fields = result->Fetch();
4960 SF_LOG_ERROR(
"sql.sql",
"ObjectMgr::LoadInstanceTemplate: bad mapid %d for template!", mapID);
4967 instanceTemplate.
Parent =
uint32(fields[1].GetUInt16());
4973 }
while (result->NextRow());
4982 return &(itr->second);
4992 QueryResult result =
WorldDatabase.Query(
"SELECT entry, creditType, creditEntry, lastEncounterDungeon FROM instance_encounters");
4995 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 instance encounters, table is empty!");
5000 std::map<uint32, std::pair<uint32, DungeonEncounterEntry const*>> dungeonLastBosses;
5003 Field* fields = result->Fetch();
5009 if (!dungeonEncounter)
5011 SF_LOG_ERROR(
"sql.sql",
"Table `instance_encounters` has an invalid encounter id %u, skipped!", entry);
5015 if (lastEncounterDungeon && !
sLFGMgr->GetLFGDungeonEntry(lastEncounterDungeon))
5017 SF_LOG_ERROR(
"sql.sql",
"Table `instance_encounters` has an encounter %u (%s) marked as final for invalid dungeon id %u, skipped!", entry, dungeonEncounter->
encounterName, lastEncounterDungeon);
5021 std::map < uint32, std::pair<uint32, DungeonEncounterEntry const*>>::const_iterator itr = dungeonLastBosses.find(lastEncounterDungeon);
5022 if (lastEncounterDungeon)
5024 if (itr != dungeonLastBosses.end())
5026 SF_LOG_ERROR(
"sql.sql",
"Table `instance_encounters` specified encounter %u (%s) as last encounter but %u (%s) is already marked as one, skipped!",
5027 entry, dungeonEncounter->
encounterName, itr->second.first, itr->second.second->encounterName);
5031 dungeonLastBosses[lastEncounterDungeon] = std::make_pair(entry, dungeonEncounter);
5041 SF_LOG_ERROR(
"sql.sql",
"Table `instance_encounters` has an invalid creature (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->
encounterName);
5048 if (!
sSpellMgr->GetSpellInfo(creditEntry))
5050 SF_LOG_ERROR(
"sql.sql",
"Table `instance_encounters` has an invalid spell (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->
encounterName);
5055 SF_LOG_ERROR(
"sql.sql",
"Table `instance_encounters` has an invalid credit type (%u) for encounter %u (%s), skipped!", creditType, entry, dungeonEncounter->
encounterName);
5061 for (
uint32 i = 0; i < 14; ++i)
5077 }
while (result->NextRow());
5086 return &itr->second;
5099 SF_LOG_INFO(
"server.loading",
">> Loaded %u npc texts", count);
5111 Field* fields = result->Fetch();
5116 SF_LOG_ERROR(
"sql.sql",
"Table `npc_text` has record wit reserved id 0, ignore.");
5136 }
while (result->NextRow());
5148 "Text0_0_loc1, Text0_1_loc1, Text1_0_loc1, Text1_1_loc1, Text2_0_loc1, Text2_1_loc1, Text3_0_loc1, Text3_1_loc1, Text4_0_loc1, Text4_1_loc1, Text5_0_loc1, Text5_1_loc1, Text6_0_loc1, Text6_1_loc1, Text7_0_loc1, Text7_1_loc1, Text8_0_loc1, Text8_1_loc1, Text9_0_loc1, Text9_1_loc1, Text10_0_loc1, Text10_1_loc1, Text11_0_loc1, Text11_1_loc1,"
5149 "Text0_0_loc2, Text0_1_loc2, Text1_0_loc2, Text1_1_loc2, Text2_0_loc2, Text2_1_loc2, Text3_0_loc2, Text3_1_loc1, Text4_0_loc2, Text4_1_loc2, Text5_0_loc2, Text5_1_loc2, Text6_0_loc2, Text6_1_loc2, Text7_0_loc2, Text7_1_loc2, Text8_0_loc2, Text8_1_loc2, Text9_0_loc2, Text9_1_loc2, Text10_0_loc2, Text10_1_loc2, Text11_0_loc2, Text11_1_loc2,"
5150 "Text0_0_loc3, Text0_1_loc3, Text1_0_loc3, Text1_1_loc3, Text2_0_loc3, Text2_1_loc3, Text3_0_loc3, Text3_1_loc1, Text4_0_loc3, Text4_1_loc3, Text5_0_loc3, Text5_1_loc3, Text6_0_loc3, Text6_1_loc3, Text7_0_loc3, Text7_1_loc3, Text8_0_loc3, Text8_1_loc3, Text9_0_loc3, Text9_1_loc3, Text10_0_loc3, Text10_1_loc3, Text11_0_loc3, Text11_1_loc3,"
5151 "Text0_0_loc4, Text0_1_loc4, Text1_0_loc4, Text1_1_loc4, Text2_0_loc4, Text2_1_loc4, Text3_0_loc4, Text3_1_loc1, Text4_0_loc4, Text4_1_loc4, Text5_0_loc4, Text5_1_loc4, Text6_0_loc4, Text6_1_loc4, Text7_0_loc4, Text7_1_loc4, Text8_0_loc4, Text8_1_loc4, Text9_0_loc4, Text9_1_loc4, Text10_0_loc4, Text10_1_loc4, Text11_0_loc4, Text11_1_loc4,"
5152 "Text0_0_loc5, Text0_1_loc5, Text1_0_loc5, Text1_1_loc5, Text2_0_loc5, Text2_1_loc5, Text3_0_loc5, Text3_1_loc1, Text4_0_loc5, Text4_1_loc5, Text5_0_loc5, Text5_1_loc5, Text6_0_loc5, Text6_1_loc5, Text7_0_loc5, Text7_1_loc5, Text8_0_loc5, Text8_1_loc5, Text9_0_loc5, Text9_1_loc5, Text10_0_loc5, Text10_1_loc5, Text11_0_loc5, Text11_1_loc5,"
5153 "Text0_0_loc6, Text0_1_loc6, Text1_0_loc6, Text1_1_loc6, Text2_0_loc6, Text2_1_loc6, Text3_0_loc6, Text3_1_loc1, Text4_0_loc6, Text4_1_loc6, Text5_0_loc6, Text5_1_loc6, Text6_0_loc6, Text6_1_loc6, Text7_0_loc6, Text7_1_loc6, Text8_0_loc6, Text8_1_loc6, Text9_0_loc6, Text9_1_loc6, Text10_0_loc6, Text10_1_loc6, Text11_0_loc6, Text11_1_loc6,"
5154 "Text0_0_loc7, Text0_1_loc7, Text1_0_loc7, Text1_1_loc7, Text2_0_loc7, Text2_1_loc7, Text3_0_loc7, Text3_1_loc1, Text4_0_loc7, Text4_1_loc7, Text5_0_loc7, Text5_1_loc7, Text6_0_loc7, Text6_1_loc7, Text7_0_loc7, Text7_1_loc7, Text8_0_loc7, Text8_1_loc7, Text9_0_loc7, Text9_1_loc7, Text10_0_loc7, Text10_1_loc7, Text11_0_loc7, Text11_1_loc7,"
5155 "Text0_0_loc8, Text0_1_loc8, Text1_0_loc8, Text1_1_loc8, Text2_0_loc8, Text2_1_loc8, Text3_0_loc8, Text3_1_loc1, Text4_0_loc8, Text4_1_loc8, Text5_0_loc8, Text5_1_loc8, Text6_0_loc8, Text6_1_loc8, Text7_0_loc8, Text7_1_loc8, Text8_0_loc8, Text8_1_loc8, Text9_0_loc8, Text9_1_loc8, Text10_0_loc8, Text10_1_loc8, Text11_0_loc8, Text11_1_loc8,"
5156 "Text0_0_loc9, Text0_1_loc9, Text1_0_loc9, Text1_1_loc9, Text2_0_loc9, Text2_1_loc9, Text3_0_loc9, Text3_1_loc1, Text4_0_loc9, Text4_1_loc9, Text5_0_loc9, Text5_1_loc9, Text6_0_loc9, Text6_1_loc9, Text7_0_loc9, Text7_1_loc9, Text8_0_loc9, Text8_1_loc9, Text9_0_loc9, Text9_1_loc9, Text10_0_loc9, Text10_1_loc9, Text11_0_loc9, Text11_1_loc9,"
5157 "Text0_0_loc10, Text0_1_loc10, Text1_0_loc10, Text1_1_loc10, Text2_0_loc10, Text2_1_loc10, Text3_0_loc10, Text3_1_loc1, Text4_0_loc10, Text4_1_loc10, Text5_0_loc10, Text5_1_loc10, Text6_0_loc10, Text6_1_loc10, Text7_0_loc10, Text7_1_loc10, Text8_0_loc10, Text8_1_loc10, Text9_0_loc10, Text9_1_loc10, Text10_0_loc10, Text10_1_loc10, Text11_0_loc10, Text11_1_loc10,"
5158 "Text0_0_loc11, Text0_1_loc11, Text1_0_loc11, Text1_1_loc11, Text2_0_loc11, Text2_1_loc11, Text3_0_loc11, Text3_1_loc1, Text4_0_loc11, Text4_1_loc11, Text5_0_loc11, Text5_1_loc11, Text6_0_loc11, Text6_1_loc11, Text7_0_loc11, Text7_1_loc11 Text8_0_loc11, Text8_1_loc11, Text9_0_loc11, Text9_1_loc11, Text10_0_loc11, Text10_1_loc11, Text11_0_loc11, Text11_1_loc11"
5159 " FROM locales_npc_text");
5166 Field* fields = result->Fetch();
5181 }
while (result->NextRow());
5191 time_t curTime = time(NULL);
5194 uint64 basetime(curTime);
5195 SF_LOG_INFO(
"misc",
"Returning mails current time: hour: %d, minute: %d, second: %d ", lt.tm_hour, lt.tm_min, lt.tm_sec);
5209 SF_LOG_INFO(
"server.loading",
">> No expired mails found.");
5221 Field* fields = items->Fetch();
5225 itemsCache[mailId].push_back(item);
5226 }
while (items->NextRow());
5230 uint32 returnedCount = 0;
5233 Field* fields = result->Fetch();
5239 bool has_items = fields[4].
GetBool();
5267 for (MailItemInfoVec::iterator itr2 = m->
items.begin(); itr2 != m->
items.end(); ++itr2)
5285 for (MailItemInfoVec::iterator itr2 = m->
items.begin(); itr2 != m->
items.end(); ++itr2)
5309 }
while (result->NextRow());
5311 SF_LOG_INFO(
"server.loading",
">> Processed %u expired mails: %u deleted and %u returned in %u ms", deletedCount + returnedCount, deletedCount, returnedCount,
GetMSTimeDiffToNow(oldMSTime));
5324 SF_LOG_INFO(
"server.loading",
">> Loaded 0 quest trigger points. DB table `areatrigger_involvedrelation` is empty.");
5334 Field* fields = result->Fetch();
5342 SF_LOG_ERROR(
"sql.sql",
"Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", trigger_ID);
5350 SF_LOG_ERROR(
"sql.sql",
"Table `areatrigger_involvedrelation` has record (id: %u) for not existing quest %u", trigger_ID, quest_ID);
5356 SF_LOG_ERROR(
"sql.sql",
"Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, 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);
5365 }
while (result->NextRow());
5381 SF_LOG_INFO(
"server.loading",
">> Loaded 0 tavern triggers. DB table `areatrigger_tavern` is empty.");
5391 Field* fields = result->Fetch();
5398 SF_LOG_ERROR(
"sql.sql",
"Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID);
5403 }
while (result->NextRow());
5410 "SELECT id, map, position_x, position_y, position_z, radius, box_x, box_y, box_z, box_orientation "
5411 "FROM areatrigger_tavern_rest_area");
5413 if (!restAreaResult)
5415 SF_LOG_INFO(
"server.loading",
">> Loaded 0 tavern rest area overrides.");
5419 uint32 restAreaCount = 0;
5423 Field* fields = restAreaResult->Fetch();
5439 SF_LOG_ERROR(
"sql.sql",
"Table `areatrigger_tavern_rest_area` has override for non-tavern area trigger %u.", restArea.
TriggerId);
5445 SF_LOG_ERROR(
"sql.sql",
"Table `areatrigger_tavern_rest_area` has empty bounds for area trigger %u.", restArea.
TriggerId);
5451 }
while (restAreaResult->NextRow());
5462 return &itr->second;
5474 return &itr->second;
5488 SF_LOG_INFO(
"server.loading",
">> Loaded 0 areatrigger scripts. DB table `areatrigger_scripts` is empty.");
5498 Field* fields = result->Fetch();
5501 const char* scriptName = fields[1].
GetCString();
5506 SF_LOG_ERROR(
"sql.sql",
"Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID);
5510 }
while (result->NextRow());
5529 uint32 submask = 1 << ((i - 1) % 8);
5535 float dist2 = (node->
x - x) * (node->
x - x) + (node->
y - y) * (node->
y - y) + (node->
z - z) * (node->
z - z);
5567 TaxiPathSetForSource::iterator dest_i = pathSet.find(destination);
5568 if (dest_i == pathSet.end())
5575 cost = dest_i->second.price;
5576 path = dest_i->second.ID;
5595 if (mount_entry == 0 && allowed_alt_team)
5607 SF_LOG_ERROR(
"sql.sql",
"No displayid found for the taxi mount with the entry %u! Can't load it!", mount_entry);
5630 SF_LOG_INFO(
"server.loading",
">> Loaded 0 graveyard-zone links. DB table `game_graveyard_zone` is empty.");
5640 Field* fields = result->Fetch();
5649 SF_LOG_ERROR(
"sql.sql",
"Table `game_graveyard_zone` has a record for not existing graveyard (WorldSafeLocs.dbc id) %u, skipped.", safeLocId);
5656 SF_LOG_ERROR(
"sql.sql",
"Table `game_graveyard_zone` has a record for not existing zone id (%u), skipped.", zoneId);
5662 SF_LOG_ERROR(
"sql.sql",
"Table `game_graveyard_zone` has a record for non player faction (%u), skipped.", team);
5667 SF_LOG_ERROR(
"sql.sql",
"Table `game_graveyard_zone` has a duplicate record for Graveyard (ID: %u) and Zone (ID: %u), skipped.", safeLocId, zoneId);
5668 }
while (result->NextRow());
5675 enum DefaultGraveyard
5677 HORDE_GRAVEYARD = 10,
5678 ALLIANCE_GRAVEYARD = 4
5697 SF_LOG_ERROR(
"misc",
"ZoneId not found for map %u coords (%f, %f, %f)", MapId, x, y, z);
5709 uint32 lookupZoneId = zoneId;
5711 if (range.first == range.second)
5714 if (rootZoneId && rootZoneId != zoneId)
5716 lookupZoneId = rootZoneId;
5726 SF_LOG_ERROR(
"sql.sql",
"Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team);
5731 bool foundNear =
false;
5732 float distNear = 10000;
5736 bool foundEntr =
false;
5737 float distEntr = 10000;
5745 for (; range.first != range.second; ++range.first)
5752 SF_LOG_ERROR(
"sql.sql",
"Table `game_graveyard_zone` has record for not existing graveyard (WorldSafeLocs.dbc id) %u, skipped.", data.
safeLocId);
5758 if (data.
team != 0 && team != 0 && data.
team != team)
5762 if (MapId != entry->
map_id)
5780 if (dist2 < distEntr)
5796 float dist2 = (entry->
x - x) * (entry->
x - x) + (entry->
y - y) * (entry->
y - y) + (entry->
z - z) * (entry->
z - z);
5799 if (dist2 < distNear)
5828 for (; range.first != range.second; ++range.first)
5842 if (rootZoneId && rootZoneId != zoneId)
5843 return findData(rootZoneId);
5858 GraveYardStore.insert(GraveYardContainer::value_type(zoneId, data));
5878 if (range.first == range.second)
5887 for (; range.first != range.second; ++range.first)
5897 if (data.
team != 0 && team != 0 && data.
team != team)
5931 QueryResult result =
WorldDatabase.Query(
"SELECT id, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM areatrigger_teleport");
5934 SF_LOG_INFO(
"server.loading",
">> Loaded 0 area trigger teleport definitions. DB table `areatrigger_teleport` is empty.");
5942 Field* fields = result->Fetch();
5959 SF_LOG_ERROR(
"sql.sql",
"Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID);
5966 SF_LOG_ERROR(
"sql.sql",
"Area trigger (ID:%u) target map (ID: %u) does not exist in `Map.dbc`.", Trigger_ID, at.
target_mapId);
5972 SF_LOG_ERROR(
"sql.sql",
"Area trigger (ID:%u) target coordinates not provided.", Trigger_ID);
5977 }
while (result->NextRow());
5995 QueryResult result =
WorldDatabase.Query(
"SELECT mapid, difficulty, level_min, level_max, item, item2, quest_done_A, quest_done_H, completed_achievement, quest_failed_text, ilvl FROM access_requirement");
5998 SF_LOG_INFO(
"server.loading",
">> Loaded 0 access requirement definitions. DB table `access_requirement` is empty.");
6006 Field* fields = result->Fetch();
6031 SF_LOG_ERROR(
"misc",
"Key item %u does not exist for map %u difficulty %u, removing key requirement.", ar->
item, mapid, difficulty);
6041 SF_LOG_ERROR(
"misc",
"Second item %u does not exist for map %u difficulty %u, removing key requirement.", ar->
item2, mapid, difficulty);
6050 SF_LOG_ERROR(
"sql.sql",
"Required Alliance Quest %u not exist for map %u difficulty %u, remove quest done requirement.", ar->
quest_A, mapid, difficulty);
6059 SF_LOG_ERROR(
"sql.sql",
"Required Horde Quest %u not exist for map %u difficulty %u, remove quest done requirement.", ar->
quest_H, mapid, difficulty);
6068 SF_LOG_ERROR(
"sql.sql",
"Required Achievement %u not exist for map %u difficulty %u, remove quest done requirement.", ar->
achievement, mapid, difficulty);
6074 }
while (result->NextRow());
6084 bool useParentDbValue =
false;
6097 parentId = iTemplate->
Parent;
6098 useParentDbValue =
true;
6103 if ((!useParentDbValue && itr->second.target_mapId == entrance_map) || (useParentDbValue && itr->second.target_mapId == parentId))
6106 if (atEntry && atEntry->
mapid ==
Map)
6107 return &itr->second;
6119 if (itr->second.target_mapId ==
Map)
6123 return &itr->second;
6135 result =
WorldDatabase.Query(
"SELECT MAX(guid) FROM creature");
6149 result =
WorldDatabase.Query(
"SELECT MAX(guid) FROM gameobject");
6151 _hiGoGuid = (*result)[0].GetUInt32() + 1;
6153 result =
WorldDatabase.Query(
"SELECT MAX(guid) FROM transports");
6163 _mailId = (*result)[0].GetUInt32() + 1;
6169 result =
CharacterDatabase.Query(
"SELECT MAX(setguid) FROM character_equipmentsets");
6175 sGuildMgr->SetNextGuildId((*result)[0].GetUInt32() + 1);
6179 sGroupMgr->SetGroupDbStoreSize((*result)[0].GetUInt32() + 1);
6181 result =
CharacterDatabase.Query(
"SELECT MAX(itemId) from character_void_storage");
6194 SF_LOG_ERROR(
"misc",
"Auctions ids overflow!! Can't continue, shutting down server. ");
6204 SF_LOG_ERROR(
"misc",
"EquipmentSet guid overflow!! Can't continue, shutting down server. ");
6214 SF_LOG_ERROR(
"misc",
"Mail ids overflow!! Can't continue, shutting down server. ");
6275 ASSERT(
false &&
"ObjectMgr::GenerateLowGuid - Unknown HIGHGUID type");
6287 "name_loc5, name_loc6, name_loc7, name_loc8, name_loc9, name_loc10, name_loc11, "
6288 "castbarcaption_loc1, castbarcaption_loc2, castbarcaption_loc3, castbarcaption_loc4, "
6289 "castbarcaption_loc5, castbarcaption_loc6, castbarcaption_loc7, castbarcaption_loc8, "
6290 "castbarcaption_loc9, castbarcaption_loc10, castbarcaption_loc11 FROM locales_gameobject");
6297 Field* fields = result->Fetch();
6308 }
while (result->NextRow());
6318 SF_LOG_ERROR(
"sql.sql",
"Gameobject (Entry: %u GoType: %u) have data%d=%u but lock (Id: %u) not found.",
6319 goInfo->
entry, goInfo->
type, N, dataN, dataN);
6327 SF_LOG_ERROR(
"sql.sql",
"Gameobject (Entry: %u GoType: %u) have data%d=%u but GO (Entry %u) have not GAMEOBJECT_TYPE_TRAP (%u) type.",
6337 SF_LOG_ERROR(
"sql.sql",
"Gameobject (Entry: %u GoType: %u) have data%d=%u but Spell (Entry %u) not exist.",
6338 goInfo->
entry, goInfo->
type, N, dataN, dataN);
6346 SF_LOG_ERROR(
"sql.sql",
"Gameobject (Entry: %u GoType: %u) have data%d=%u but correct chair height in range 0..%i.",
6359 SF_LOG_ERROR(
"sql.sql",
"Gameobject (Entry: %u GoType: %u) have data%d=%u but expected boolean (0/1) noDamageImmune field value.", goTemplate->
entry, goTemplate->
type, N, dataN);
6368 SF_LOG_ERROR(
"sql.sql",
"Gameobject (Entry: %u GoType: %u) have data%d=%u but expected boolean (0/1) consumable field value.",
6377 QueryResult result =
WorldDatabase.Query(
"SELECT entry, type, displayId, name, IconName, castBarCaption, unk1, faction, flags, size, questItem1, questItem2, questItem3, "
6379 "questItem4, questItem5, questItem6, data0, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, "
6381 "data13, data14, data15, data16, data17, data18, data19, data20, data21, data22, data23, data24, data25, data26, data27, data28, "
6383 "data29, data30, data31, unkInt32, AIName, ScriptName "
6384 "FROM gameobject_template");
6388 SF_LOG_INFO(
"server.loading",
">> Loaded 0 gameobject definitions. DB table `gameobject_template` is empty.");
6396 Field* fields = result->Fetch();
6473 SF_LOG_ERROR(
"sql.sql",
"GameObject (Entry: %u GoType: %u) have data0=%u but SpellFocus (Id: %u) not exist.",
6491 SF_LOG_ERROR(
"sql.sql",
"GameObject (Entry: %u GoType: %u) have data7=%u but PageText (Entry %u) not exist.",
6516 SF_LOG_ERROR(
"sql.sql",
"GameObject (Entry: %u GoType: %u) have data0=%u but TaxiPath (Id: %u) not exist.",
6555 }
while (result->NextRow());
6568 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 BaseXP definitions. DB table `exploration_basexp` is empty.");
6576 Field* fields = result->Fetch();
6581 }
while (result->NextRow());
6606 SF_LOG_INFO(
"server.loading",
">> Loaded 0 pet name parts. DB table `pet_name_generation` is empty!");
6614 Field* fields = result->Fetch();
6615 std::string word = fields[0].
GetString();
6617 bool half = fields[2].
GetBool();
6623 }
while (result->NextRow());
6635 Field* fields = result->Fetch();
6647 if (list0.empty() || list1.empty())
6651 return std::string();
6655 return std::string(petname);
6660 return *(list0.begin() + std::rand() % list0.size()) + *(list1.begin() + std::rand() % list1.size());
6667 SF_LOG_ERROR(
"misc",
"_hiPetNumber Id overflow!! Can't continue, shutting down server. ");
6677 SF_LOG_ERROR(
"misc",
"VoidStorageItem Id overflow!! Can't continue, shutting down server. ");
6693 SF_LOG_INFO(
"server.loading",
">> Loaded 0 corpses. DB table `corpse` is empty.");
6700 Field* fields = result->Fetch();
6705 SF_LOG_ERROR(
"misc",
"Corpse (guid: %u) have wrong corpse type (%u), not loading.", guid,
uint8(type));
6718 }
while (result->NextRow());
6730 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");
6733 SF_LOG_ERROR(
"server.loading",
">> Loaded `reputation_reward_rate`, table is empty!");
6739 Field* fields = result->Fetch();
6756 SF_LOG_ERROR(
"sql.sql",
"Faction (faction.dbc) %u does not exist but is used in `reputation_reward_rate`", factionId);
6762 SF_LOG_ERROR(
"sql.sql",
"Table reputation_reward_rate has quest_rate with invalid rate %f, skipping data for faction %u", repRate.
questRate, factionId);
6768 SF_LOG_ERROR(
"sql.sql",
"Table reputation_reward_rate has quest_daily_rate with invalid rate %f, skipping data for faction %u", repRate.
questDailyRate, factionId);
6774 SF_LOG_ERROR(
"sql.sql",
"Table reputation_reward_rate has quest_weekly_rate with invalid rate %f, skipping data for faction %u", repRate.
questWeeklyRate, factionId);
6780 SF_LOG_ERROR(
"sql.sql",
"Table reputation_reward_rate has quest_monthly_rate with invalid rate %f, skipping data for faction %u", repRate.
questMonthlyRate, factionId);
6786 SF_LOG_ERROR(
"sql.sql",
"Table reputation_reward_rate has quest_repeatable_rate with invalid rate %f, skipping data for faction %u", repRate.
questRepeatableRate, factionId);
6792 SF_LOG_ERROR(
"sql.sql",
"Table reputation_reward_rate has creature_rate with invalid rate %f, skipping data for faction %u", repRate.
creatureRate, factionId);
6798 SF_LOG_ERROR(
"sql.sql",
"Table reputation_reward_rate has spell_rate with invalid rate %f, skipping data for faction %u", repRate.
spellRate, factionId);
6805 }
while (result->NextRow());
6822 "IsTeamAward1, MaxStanding1, RewOnKillRepValue1, IsTeamAward2, MaxStanding2, RewOnKillRepValue2, TeamDependent "
6823 "FROM creature_onkill_reputation");
6827 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 creature award reputation definitions. DB table `creature_onkill_reputation` is empty.");
6833 Field* fields = result->Fetch();
6850 SF_LOG_ERROR(
"sql.sql",
"Table `creature_onkill_reputation` have data for not existed creature entry (%u), skipped", creature_id);
6859 SF_LOG_ERROR(
"sql.sql",
"Faction (faction.dbc) %u does not exist but is used in `creature_onkill_reputation`", repOnKill.
RepFaction1);
6869 SF_LOG_ERROR(
"sql.sql",
"Faction (faction.dbc) %u does not exist but is used in `creature_onkill_reputation`", repOnKill.
RepFaction2);
6877 }
while (result->NextRow());
6889 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, faction5, rate_5, rank_5 FROM reputation_spillover_template");
6893 SF_LOG_INFO(
"server.loading",
">> Loaded `reputation_spillover_template`, table is empty.");
6899 Field* fields = result->Fetch();
6925 SF_LOG_ERROR(
"sql.sql",
"Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", factionId);
6929 if (factionEntry->
team == 0)
6931 SF_LOG_ERROR(
"sql.sql",
"Faction (faction.dbc) %u in `reputation_spillover_template` does not belong to any team, skipping", factionId);
6941 if (!factionSpillover)
6943 SF_LOG_ERROR(
"sql.sql",
"Spillover faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template` for faction %u, skipping", repTemplate.
faction[i], factionId);
6949 SF_LOG_ERROR(
"sql.sql",
"Spillover faction (faction.dbc) %u for faction %u in `reputation_spillover_template` can not be listed for client, and then useless, skipping", repTemplate.
faction[i], factionId);
6955 SF_LOG_ERROR(
"sql.sql",
"Rank %u used in `reputation_spillover_template` for spillover faction %u is not valid, skipping", repTemplate.
faction_rank[i], repTemplate.
faction[i]);
6962 if (repTemplate.
faction[0] && !factionEntry0)
6964 SF_LOG_ERROR(
"sql.sql",
"Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.
faction[0]);
6968 if (repTemplate.
faction[1] && !factionEntry1)
6970 SF_LOG_ERROR(
"sql.sql",
"Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.
faction[1]);
6974 if (repTemplate.
faction[2] && !factionEntry2)
6976 SF_LOG_ERROR(
"sql.sql",
"Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.
faction[2]);
6980 if (repTemplate.
faction[3] && !factionEntry3)
6982 SF_LOG_ERROR(
"sql.sql",
"Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.
faction[3]);
6986 if (repTemplate.
faction[4] && !factionEntry4)
6988 SF_LOG_ERROR(
"sql.sql",
"Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.
faction[4]);
6995 }
while (result->NextRow());
7009 QueryResult result =
WorldDatabase.Query(
"SELECT entry, x, y, icon, flags, data, icon_name FROM points_of_interest");
7013 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 Points of Interest definitions. DB table `points_of_interest` is empty.");
7019 Field* fields = result->Fetch();
7024 POI.
entry = point_id;
7034 SF_LOG_ERROR(
"sql.sql",
"Table `points_of_interest` (Entry: %u) have invalid coordinates (X: %f Y: %f), ignored.", point_id, POI.
x, POI.
y);
7041 }
while (result->NextRow());
7055 QueryResult result =
WorldDatabase.Query(
"SELECT questId, id, objIndex, mapid, WorldMapAreaId, FloorId, unk3, unk4 FROM quest_poi order by questId");
7059 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 quest POI definitions. DB table `quest_poi` is empty.");
7064 QueryResult points =
WorldDatabase.Query(
"SELECT questId, id, x, y FROM quest_poi_points ORDER BY questId DESC, idx");
7066 std::vector<std::vector<std::vector<QuestPOIPoint> > > POIs;
7071 Field* fields = points->Fetch();
7073 POIs.resize(questIdMax + 1);
7077 fields = points->Fetch();
7084 if (POIs[questId].size() <=
id + 1)
7085 POIs[questId].resize(
id + 10);
7088 POIs[questId][id].push_back(point);
7089 }
while (points->NextRow());
7094 Field* fields = result->Fetch();
7105 QuestPOI POI(
id, objIndex, mapId, WorldMapAreaId, FloorId, unk3, unk4);
7106 POI.
points = POIs[questId][id];
7111 }
while (result->NextRow());
7122 QueryResult result =
WorldDatabase.Query(
"SELECT npc_entry, spell_id, cast_flags, user_type FROM npc_spellclick_spells");
7126 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 spellclick spells. DB table `npc_spellclick_spells` is empty.");
7134 Field* fields = result->Fetch();
7140 SF_LOG_ERROR(
"sql.sql",
"Table npc_spellclick_spells references unknown creature_template %u. Skipping entry.", npc_entry);
7148 SF_LOG_ERROR(
"sql.sql",
"Table npc_spellclick_spells references unknown spellid %u. Skipping entry.", spellid);
7154 SF_LOG_ERROR(
"sql.sql",
"Table npc_spellclick_spells references unknown user type %u. Skipping entry.",
uint32(userType));
7164 }
while (result->NextRow());
7169 for (CreatureTemplateContainer::const_iterator itr = ctc->begin(); itr != ctc->end(); ++itr)
7173 SF_LOG_ERROR(
"sql.sql",
"npc_spellclick_spells: Creature template %u has UNIT_NPC_FLAG_SPELLCLICK but no data in spellclick table! Removing flag", itr->second.Entry);
7205 cell_guids.
corpses[player_guid] = instance;
7212 cell_guids.
corpses.erase(player_guid);
7223 QueryResult result =
WorldDatabase.PQuery(
"SELECT id, quest, pool_entry FROM %s qr LEFT JOIN pool_quest pq ON qr.quest = pq.entry",
table.c_str());
7227 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 quest relations from `%s`, table is empty.",
table.c_str());
7233 poolRelationMap->clear();
7237 uint32 id = result->Fetch()[0].GetUInt32();
7238 uint32 quest = result->Fetch()[1].GetUInt32();
7239 uint32 poolId = result->Fetch()[2].GetUInt32();
7243 SF_LOG_ERROR(
"sql.sql",
"Table `%s`: Quest %u listed for entry %u does not exist.",
table.c_str(), quest,
id);
7247 if (!poolId || !starter)
7248 map.insert(QuestRelations::value_type(
id, quest));
7250 poolRelationMap->insert(PooledQuestRelation::value_type(quest,
id));
7253 }
while (result->NextRow());
7266 SF_LOG_ERROR(
"sql.sql",
"Table `gameobject_queststarter` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second);
7268 SF_LOG_ERROR(
"sql.sql",
"Table `gameobject_queststarter` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second);
7280 SF_LOG_ERROR(
"sql.sql",
"Table `gameobject_questender` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second);
7282 SF_LOG_ERROR(
"sql.sql",
"Table `gameobject_questender` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second);
7294 SF_LOG_ERROR(
"sql.sql",
"Table `creature_queststarter` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second);
7296 SF_LOG_ERROR(
"sql.sql",
"Table `creature_queststarter` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second);
7308 SF_LOG_ERROR(
"sql.sql",
"Table `creature_questender` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second);
7310 SF_LOG_ERROR(
"sql.sql",
"Table `creature_questender` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second);
7324 SF_LOG_INFO(
"server.loading",
">> Loaded 0 reserved player names. DB table `reserved_name` is empty!");
7333 fields = result->Fetch();
7334 std::string name = fields[0].
GetString();
7339 SF_LOG_ERROR(
"misc",
"Table `reserved_name` have invalid name: %s", name.c_str());
7347 }
while (result->NextRow());
7402 if (strictMask == 0)
7413 if (strictMask & 0x2)
7427 if (strictMask & 0x1)
7446 if (wname.size() < minName)
7454 for (
size_t i = 2; i < wname.size(); ++i)
7455 if (wname[i] == wname[i - 1] && wname[i] == wname[i - 2])
7471 if (wname.size() < minName)
7489 if (wname.size() < minName)
7505 if (
sObjectMgr->GetGameObjectTemplates()->empty())
7507 SF_LOG_INFO(
"server.loading",
">> Loaded 0 GameObjects for quests");
7515 for (GameObjectTemplateContainer::const_iterator itr = gotc->begin(); itr != gotc->end(); ++itr)
7517 switch (itr->second.type)
7522 uint32 loot_id = (itr->second.GetLootId());
7534 if (itr->second._generic.questID > 0)
7543 if (itr->second.goober.questId > 0)
7562 int32 start_value = min_value;
7563 int32 end_value = max_value;
7565 if (start_value < 0)
7567 if (end_value >= start_value)
7569 SF_LOG_ERROR(
"sql.sql",
"Table '%s' attempt loaded with invalid range (%d - %d), strings not loaded.",
table, min_value, max_value);
7574 std::swap(start_value, end_value);
7580 if (start_value >= end_value)
7582 SF_LOG_ERROR(
"sql.sql",
"Table '%s' attempt loaded with invalid range (%d - %d), strings not loaded.",
table, min_value, max_value);
7590 if (itr->first >= start_value && itr->first < end_value)
7596 QueryResult result =
WorldDatabase.PQuery(
"SELECT entry, content_default, content_loc1, content_loc2, content_loc3, content_loc4, content_loc5, content_loc6, content_loc7, content_loc8, content_loc9, content_loc10, content_loc11 FROM %s",
table);
7601 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 skyfire strings. DB table `%s` is empty. Cannot continue.",
table);
7603 SF_LOG_INFO(
"server.loading",
">> Loaded 0 string templates. DB table `%s` is empty.",
table);
7612 Field* fields = result->Fetch();
7618 SF_LOG_ERROR(
"sql.sql",
"Table `%s` contain reserved entry 0, ignored.",
table);
7621 else if (entry < start_value || entry >= end_value)
7623 SF_LOG_ERROR(
"sql.sql",
"Table `%s` contain entry %i out of allowed range (%d - %d), ignored.",
table, entry, min_value, max_value);
7631 SF_LOG_ERROR(
"sql.sql",
"Table `%s` contain data for already loaded entry %i (from another table?), ignored.",
table, entry);
7640 }
while (result->NextRow());
7654 if (msl->Content.size() >
size_t(locale_idx) && !msl->Content[locale_idx].empty())
7655 return msl->Content[locale_idx].c_str();
7661 SF_LOG_ERROR(
"sql.sql",
"Entry %i not found in `skyfire_string` table.", entry);
7663 SF_LOG_ERROR(
"sql.sql",
"Skyfire string entry %i not found in DB.", entry);
7677 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 areas for fishing base skill level. DB table `skill_fishing_base_level` is empty.");
7685 Field* fields = result->Fetch();
7692 SF_LOG_ERROR(
"sql.sql",
"AreaId %u defined in `skill_fishing_base_level` does not exist", entry);
7698 }
while (result->NextRow());
7721 if (w_ownname != wname)
7746 uint32 raceMask = (1 << (race - 1));
7747 uint32 classMask = (1 << (playerClass - 1));
7749 for (
int i = 0; i < 4; i++)
7798 QueryResult result =
WorldDatabase.Query(
"SELECT id, position_x, position_y, position_z, orientation, map, name FROM game_tele");
7802 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 GameTeleports. DB table `game_tele` is empty!");
7810 Field* fields = result->Fetch();
7825 SF_LOG_ERROR(
"sql.sql",
"Wrong position for id %u (name: %s) in `game_tele` table, ignoring.",
id, gt.
name.c_str());
7831 SF_LOG_ERROR(
"sql.sql",
"Wrong UTF8 name for id %u in `game_tele` table, ignoring.",
id);
7840 }
while (result->NextRow());
7859 if (itr->second.wnameLow == wname)
7860 return &itr->second;
7861 else if (alt == NULL && itr->second.
wnameLow.find(wname) != std::wstring::npos)
7880 if (itr->second.wnameLow == wname)
7881 return &itr->second;
7892 if (itr->first > new_id)
7893 new_id = itr->first;
7932 if (itr->second.wnameLow == wname)
7955 QueryResult result =
WorldDatabase.Query(
"SELECT level, raceMask, mailTemplateId, senderEntry FROM mail_level_reward");
7959 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 level dependent mail rewards. DB table `mail_level_reward` is empty.");
7967 Field* fields = result->Fetch();
7976 SF_LOG_ERROR(
"sql.sql",
"Table `mail_level_reward` have data for level %u that more supported by client (%u), ignoring.", level,
MAX_LEVEL);
7982 SF_LOG_ERROR(
"sql.sql",
"Table `mail_level_reward` have raceMask (%u) for level %u that not include any player races, ignoring.", raceMask, level);
7988 SF_LOG_ERROR(
"sql.sql",
"Table `mail_level_reward` have invalid mailTemplateId (%u) for level %u that invalid not include any player races, ignoring.", mailTemplateId, level);
7994 SF_LOG_ERROR(
"sql.sql",
"Table `mail_level_reward` have not existed sender creature entry (%u) for level %u that invalid not include any player races, ignoring.", senderEntry, level);
8001 }
while (result->NextRow());
8014 SF_LOG_ERROR(
"sql.sql",
"Table `npc_trainer` contains entries for a non-existing creature template (Entry: %u), ignoring", entry);
8020 SF_LOG_ERROR(
"sql.sql",
"Table `npc_trainer` contains entries for a creature template (Entry: %u) without trainer flag, ignoring", entry);
8027 SF_LOG_ERROR(
"sql.sql",
"Table `npc_trainer` contains an entry (Entry: %u) for a non-existing spell (Spell: %u), ignoring", entry, spell);
8033 SF_LOG_ERROR(
"sql.sql",
"Table `npc_trainer` contains an entry (Entry: %u) for a broken spell (Spell: %u), ignoring", entry, spell);
8039 SF_LOG_ERROR(
"sql.sql",
"Table `npc_trainer` contains an entry (Entry: %u) for a non-existing spell (Spell: %u) which is a talent, ignoring", entry, spell);
8046 trainerSpell.
spell = spell;
8067 SF_LOG_ERROR(
"sql.sql",
"Table `npc_trainer` has spell %u for trainer entry %u with learn effect which has incorrect target type, ignoring learn effect!", spell, entry);
8076 if (learnedSpellInfo && learnedSpellInfo->
IsProfession())
8091 QueryResult result =
WorldDatabase.Query(
"SELECT b.entry, a.spell, a.spellcost, a.reqskill, a.reqskillvalue, a.reqlevel FROM npc_trainer AS a "
8092 "INNER JOIN npc_trainer AS b ON a.entry = -(b.spell) "
8093 "UNION SELECT * FROM npc_trainer WHERE spell > 0");
8097 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 Trainers. DB table `npc_trainer` is empty!");
8106 Field* fields = result->Fetch();
8118 }
while (result->NextRow());
8137 Field* fields = result->Fetch();
8151 if (!
IsVendorItemValid(vendor, item_id, maxcount, incrtime, ExtendedCost, type, NULL, skip_vendors))
8156 vList.
AddItem(item_id, maxcount, incrtime, ExtendedCost, type);
8159 }
while (result->NextRow());
8170 itr->second.Clear();
8173 std::set<uint32> skip_vendors;
8175 QueryResult result =
WorldDatabase.Query(
"SELECT entry, item, maxcount, incrtime, ExtendedCost, type FROM npc_vendor ORDER BY entry, slot ASC");
8178 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 Vendors. DB table `npc_vendor` is empty!");
8186 Field* fields = result->Fetch();
8201 if (!
IsVendorItemValid(entry, item_id, maxcount, incrtime, ExtendedCost, type, NULL, &skip_vendors))
8206 vList.
AddItem(item_id, maxcount, incrtime, ExtendedCost, type);
8209 }
while (result->NextRow());
8221 "SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'gossip_menu' AND LOWER(COLUMN_NAME) = 'menuid' LIMIT 1");
8224 result =
WorldDatabase.Query(
"SELECT MenuID, TextID FROM gossip_menu");
8226 result =
WorldDatabase.Query(
"SELECT entry, text_id FROM gossip_menu");
8230 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 gossip_menu entries. DB table `gossip_menu` is empty!");
8238 Field* fields = result->Fetch();
8247 SF_LOG_ERROR(
"sql.sql",
"Table gossip_menu entry %u are using non-existing text_id %u", gMenu.
entry, gMenu.
text_id);
8254 }
while (result->NextRow());
8269 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 gossip_menu_option entries. DB table `gossip_menu_option` is empty!");
8277 Field* fields = result->Fetch();
8297 SF_LOG_ERROR(
"sql.sql",
"Table gossip_menu_option for menu %u, id %u has unknown icon id %u. Replacing with GOSSIP_ICON_CHAT", gMenuItem.
MenuID, gMenuItem.
OptionID, gMenuItem.
OptionIcon);
8302 SF_LOG_ERROR(
"sql.sql",
"Table gossip_menu_option for menu %u, id %u has unknown option id %u. Option will not be used", gMenuItem.
MenuID, gMenuItem.
OptionID, gMenuItem.
OptionType);
8312 }
while (result->NextRow());
8320 vList.
AddItem(item, maxcount, incrtime, extendedCost, type);
8343 if (!iter->second.RemoveItem(item, type))
8368 SF_LOG_ERROR(
"sql.sql",
"Table `(game_event_)npc_vendor` have data for not existed creature template (Entry: %u), ignore", vendor_entry);
8374 if (!skip_vendors || skip_vendors->count(vendor_entry) == 0)
8379 SF_LOG_ERROR(
"sql.sql",
"Table `(game_event_)npc_vendor` have data for not creature template (Entry: %u) without vendor flag, ignore", vendor_entry);
8382 skip_vendors->insert(vendor_entry);
8393 SF_LOG_ERROR(
"sql.sql",
"Table `(game_event_)npc_vendor` for Vendor (Entry: %u) have in item list non-existed item (%u, type %u), ignore", vendor_entry,
id, type);
8402 SF_LOG_ERROR(
"sql.sql",
"Table `(game_event_)npc_vendor` have Item (Entry: %u) with wrong ExtendedCost (%u) for vendor (%u), ignore",
id, ExtendedCost, vendor_entry);
8408 if (maxcount > 0 && incrtime == 0)
8413 SF_LOG_ERROR(
"sql.sql",
"Table `(game_event_)npc_vendor` has `maxcount` (%u) for item %u of vendor (Entry: %u) but `incrtime`=0, ignore", maxcount,
id, vendor_entry);
8416 else if (maxcount == 0 && incrtime > 0)
8421 SF_LOG_ERROR(
"sql.sql",
"Table `(game_event_)npc_vendor` has `maxcount`=0 for item %u of vendor (Entry: %u) but `incrtime`<>0, ignore",
id, vendor_entry);
8435 SF_LOG_ERROR(
"sql.sql",
"Table `npc_vendor` has duplicate items %u (with extended cost %u, type %u) for vendor (Entry: %u), ignoring",
id, ExtendedCost, type, vendor_entry);
8441 SF_LOG_ERROR(
"sql.sql",
"Table `(game_event_)npc_vendor` have Item (Entry: %u, type: %u) with missing maxcount for vendor (%u), ignore",
id, type, vendor_entry);
8454 "SELECT DISTINCT(ScriptName) FROM achievement_criteria_data WHERE ScriptName <> '' AND type = 11 "
8456 "SELECT DISTINCT(ScriptName) FROM battleground_template WHERE ScriptName <> '' "
8458 "SELECT DISTINCT(ScriptName) FROM creature_template WHERE ScriptName <> '' "
8460 "SELECT DISTINCT(ScriptName) FROM gameobject_template WHERE ScriptName <> '' "
8462 "SELECT DISTINCT(ScriptName) FROM item_script_names WHERE ScriptName <> '' "
8464 "SELECT DISTINCT(ScriptName) FROM areatrigger_scripts WHERE ScriptName <> '' "
8466 "SELECT DISTINCT(ScriptName) FROM spell_script_names WHERE ScriptName <> '' "
8468 "SELECT DISTINCT(ScriptName) FROM transports WHERE ScriptName <> '' "
8470 "SELECT DISTINCT(ScriptName) FROM game_weather WHERE ScriptName <> '' "
8472 "SELECT DISTINCT(ScriptName) FROM conditions WHERE ScriptName <> '' "
8474 "SELECT DISTINCT(ScriptName) FROM outdoorpvp_template WHERE ScriptName <> '' "
8476 "SELECT DISTINCT(ScriptName) FROM scene_template WHERE ScriptName <> '' "
8478 "SELECT DISTINCT(script) FROM instance_template WHERE script <> ''");
8482 SF_LOG_ERROR(
"server.loading",
">> Loaded empty set of Script Names!");
8492 }
while (result->NextRow());
8518 for (ScriptMapMap::const_iterator itrMM = scripts->begin(); itrMM != scripts->end(); ++itrMM)
8520 for (ScriptMap::const_iterator itrM = itrMM->second.begin(); itrM != itrMM->second.end(); ++itrM)
8522 switch (itrM->second.command)
8527 SF_LOG_ERROR(
"sql.sql",
"Table `%s` references invalid text id %u from `db_script_string`, script id: %u.",
GetScriptsTableNameByType(type).c_str(), itrM->second.Talk.TextID, itrMM->first);
8529 if (ids.find(itrM->second.Talk.TextID) != ids.end())
8530 ids.erase(itrM->second.Talk.TextID);
8543 std::set<int32> ids;
8553 for (std::set<int32>::const_iterator itr = ids.begin(); itr != ids.end(); ++itr)
8554 SF_LOG_ERROR(
"sql.sql",
"Table `db_script_string` has unused string id %u", *itr);
8563 SF_LOG_ERROR(
"sql.sql",
"Table '%s' load attempted with range (%d - %d) reserved by Skyfire, strings not loaded.",
table, start_value, end_value + 1);
8575 return &(it->second);
8579 DefaultCreatureBaseStats()
8587 static const DefaultCreatureBaseStats def_stats;
8595 QueryResult result =
WorldDatabase.Query(
"SELECT level, class, OldContentBaseHP, CurrentContentBaseHP, basemana, basearmor FROM creature_classlevelstats");
8599 SF_LOG_INFO(
"server.loading",
">> Loaded 0 creature base stats. DB table `creature_classlevelstats` is empty.");
8606 Field* fields = result->Fetch();
8620 SF_LOG_ERROR(
"sql.sql",
"Creature base stats for level %u has invalid class %u", Level, Class);
8626 SF_LOG_ERROR(
"sql.sql",
"Creature base stats for class %u, level %u has invalid zero base HP[%u] - set to 1", Class, Level, i);
8634 }
while (result->NextRow());
8637 for (CreatureTemplateContainer::const_iterator itr = ctc->begin(); itr != ctc->end(); ++itr)
8639 for (
uint16 lvl = itr->second.minlevel; lvl <= itr->second.maxlevel; ++lvl)
8642 SF_LOG_ERROR(
"sql.sql",
"Missing base stats for creature entry %u, class %u, level %u", itr->second.Entry, itr->second.unit_class, lvl);
8657 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 faction change achievement pairs. DB table `player_factionchange_achievement` is empty.");
8665 Field* fields = result->Fetch();
8671 SF_LOG_ERROR(
"sql.sql",
"Achievement %u (alliance_id) referenced in `player_factionchange_achievement` does not exist, pair skipped!", alliance);
8673 SF_LOG_ERROR(
"sql.sql",
"Achievement %u (horde_id) referenced in `player_factionchange_achievement` does not exist, pair skipped!", horde);
8678 }
while (result->NextRow());
8691 SF_LOG_INFO(
"server.loading",
">> Loaded 0 faction change item pairs. DB table `player_factionchange_items` is empty.");
8699 Field* fields = result->Fetch();
8705 SF_LOG_ERROR(
"sql.sql",
"Item %u (alliance_id) referenced in `player_factionchange_items` does not exist, pair skipped!", alliance);
8707 SF_LOG_ERROR(
"sql.sql",
"Item %u (horde_id) referenced in `player_factionchange_items` does not exist, pair skipped!", horde);
8712 }
while (result->NextRow());
8725 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 faction change quest pairs. DB table `player_factionchange_quests` is empty.");
8733 Field* fields = result->Fetch();
8739 SF_LOG_ERROR(
"sql.sql",
"Quest %u (alliance_id) referenced in `player_factionchange_quests` does not exist, pair skipped!", alliance);
8740 else if (!
sObjectMgr->GetQuestTemplate(horde))
8741 SF_LOG_ERROR(
"sql.sql",
"Quest %u (horde_id) referenced in `player_factionchange_quests` does not exist, pair skipped!", horde);
8746 }
while (result->NextRow());
8759 SF_LOG_INFO(
"server.loading",
">> Loaded 0 faction change reputation pairs. DB table `player_factionchange_reputations` is empty.");
8767 Field* fields = result->Fetch();
8773 SF_LOG_ERROR(
"sql.sql",
"Reputation %u (alliance_id) referenced in `player_factionchange_reputations` does not exist, pair skipped!", alliance);
8775 SF_LOG_ERROR(
"sql.sql",
"Reputation %u (horde_id) referenced in `player_factionchange_reputations` does not exist, pair skipped!", horde);
8780 }
while (result->NextRow());
8793 SF_LOG_INFO(
"server.loading",
">> Loaded 0 hotfix info entries. DB table `hotfix_data` is empty.");
8803 Field* fields = result->Fetch();
8812 }
while (result->NextRow());
8825 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 faction change spell pairs. DB table `player_factionchange_spells` is empty.");
8833 Field* fields = result->Fetch();
8839 SF_LOG_ERROR(
"sql.sql",
"Spell %u (alliance_id) referenced in `player_factionchange_spells` does not exist, pair skipped!", alliance);
8840 else if (!
sSpellMgr->GetSpellInfo(horde))
8841 SF_LOG_ERROR(
"sql.sql",
"Spell %u (horde_id) referenced in `player_factionchange_spells` does not exist, pair skipped!", horde);
8846 }
while (result->NextRow());
8859 SF_LOG_INFO(
"server.loading",
">> Loaded 0 faction change title pairs. DB table `player_factionchange_title` is empty.");
8867 Field* fields = result->Fetch();
8873 SF_LOG_ERROR(
"sql.sql",
"Title %u (alliance_id) referenced in `player_factionchange_title` does not exist, pair skipped!", alliance);
8875 SF_LOG_ERROR(
"sql.sql",
"Title %u (horde_id) referenced in `player_factionchange_title` does not exist, pair skipped!", horde);
8880 }
while (result->NextRow());
8895 SF_LOG_INFO(
"server.loading",
">> Loaded 0 terrain swap defaults. DB table `terrain_swap_defaults` is empty.");
8902 Field* fields = result->Fetch();
8909 SF_LOG_INFO(
"sql.sql",
"Map %u defined in `terrain_swap_defaults` does not exist, skipped.", mapId);
8915 map =
sMapStore.LookupEntry(terrainSwap);
8918 SF_LOG_INFO(
"sql.sql",
"TerrainSwapMap %u defined in `terrain_swap_defaults` does not exist, skipped.", terrainSwap);
8922 defaultSwap.
id = terrainSwap;
8926 }
while (result->NextRow());
8942 SF_LOG_INFO(
"server.loading",
">> Loaded 0 terrain phase infos. DB table `terrain_phase_info` is empty.");
8949 Field* fields = result->Fetch();
8956 SF_LOG_INFO(
"sql.sql",
"Phase %u defined in `terrain_phase_info` does not exist, skipped.", phaseId);
8965 }
while (result->NextRow());
8981 SF_LOG_INFO(
"server.loading",
">> Loaded 0 terrain world maps. DB table `terrain_worldmap` is empty.");
8988 Field* fields = result->Fetch();
8994 SF_LOG_INFO(
"sql.sql",
"TerrainSwapMap %u defined in `terrain_worldmap` does not exist, skipped.", mapId);
9003 }
while (result->NextRow());
9019 SF_LOG_INFO(
"server.loading",
">> Loaded 0 phase areas. DB table `phase_area` is empty.");
9026 Field* fields = result->Fetch();
9031 _phases[area].push_back(phase);
9034 }
while (result->NextRow());
9090 return &(itr->second);
9099 return &(itr->second);
9111 return &itr->second;
9117 return &itr->second;
9140 QueryResult result =
WorldDatabase.Query(
"SELECT digsiteId, branchId, requiredSkillValue, requiredLevel FROM `research_digsite_data`");
9144 SF_LOG_INFO(
"server.loading",
">> Loaded 0 research digsite infos. DB table `research_digsite_data` is empty.");
9151 Field* fields = result->Fetch();
9159 SF_LOG_ERROR(
"sql.sql",
"Digsite %u defined in `research_digsite_data` does not exist in DBC, skipped.", digsiteInfo.
digsiteId);
9170 while (result->NextRow());
9181 QueryResult result =
WorldDatabase.Query(
"SELECT guid, digsiteId, goEntry, position_x, position_y, position_z FROM `research_digsite_finds`");
9185 SF_LOG_INFO(
"server.loading",
">> Loaded 0 archaeology find infos. DB table `research_digsite_finds` is empty.");
9192 Field* fields = result->Fetch();
9200 SF_LOG_ERROR(
"sql.sql",
"Digsite %u referenced in `research_digsite_finds` does not exist in DBC, skipped.", digsiteId);
9207 SF_LOG_ERROR(
"sql.sql",
"Table `research_digsite_finds` has archaeology find with non existing gameobject entry %u (Digsite Id: %u), skipped.", findInfo.
goEntry, digsiteId);
9219 while (result->NextRow());
9230 QueryResult result =
WorldDatabase.Query(
"SELECT projectId, requiredSkillValue, chance FROM `research_project_requirements`");
9234 SF_LOG_INFO(
"server.loading",
">> Loaded 0 research project requirements. DB table `research_project_requirements` is empty.");
9241 Field* fields = result->Fetch();
9246 SF_LOG_ERROR(
"sql.sql",
"Research project %u referenced in `research_project_requirements` does not exist in DBC, skipped.", projectId);
9258 while (result->NextRow());
9268 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 Battle Pets breed definitions. DB table `battle_pet_breed` is empty.");
9275 Field* fields = result->Fetch();
9282 SF_LOG_ERROR(
"sql.sql",
"Battle Pet species %u defined in `battle_pet_breed` does not exists, skipped.", speciesId);
9288 SF_LOG_ERROR(
"sql.sql",
"Battle Pet breed %u defined in `battle_pet_breed` does not exists, skipped.", breedId);
9298 }
while (result->NextRow());
9310 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 Battle Pets quality definitions. DB table `battle_pet_quality` is empty.");
9317 Field* fields = result->Fetch();
9324 SF_LOG_ERROR(
"sql.sql",
"Battle Pet species %u defined in `battle_pet_quality` does not exists, skipped.", speciesId);
9330 SF_LOG_ERROR(
"sql.sql",
"Battle Pet quality %u defined in `battle_pet_quality` is invalid, skipped.", quality);
9340 }
while (result->NextRow());
9349 QueryResult result =
WorldDatabase.Query(
"SELECT itemId, species FROM `battle_pet_item_to_species` ORDER BY itemId, species");
9352 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 Battle Pet item to species definitions. DB table `battle_pet_item_to_species` is empty.");
9359 Field* fields = result->Fetch();
9366 SF_LOG_ERROR(
"sql.sql",
"Item id %u defined in `battle_pet_item_to_species` does not exist, skipped.", itemId);
9372 SF_LOG_ERROR(
"sql.sql",
"Battle Pet species %u defined in `battle_pet_item_to_species` does not exist, skipped.", speciesId);
9377 SF_LOG_DEBUG(
"sql.sql",
"Battle Pet item %u already mapped to species %u, replacing with species %u.",
9382 }
while (result->NextRow());
9397 if (mapCitr->first == speciesId)
9399 BattleBetBreedSet::iterator setItr(mapCitr->second.begin());
9400 std::advance(setItr, std::rand() % mapCitr->second.size());
9413 if (mapCitr->first == speciesId)
9415 BattlePetQualitySet::iterator setItr(mapCitr->second.begin());
9416 std::advance(setItr, std::rand() % mapCitr->second.size());
9429 QueryResult result =
WorldDatabase.Query(
"SELECT `questId`, `id`, `index`, `type`, `objectId`, `amount`, `flags`, `description` FROM `quest_objective` ORDER BY `questId` ASC");
9432 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 Quest Objectives. DB table `quest_objective` is empty.");
9439 Field* fields = result->Fetch();
9448 std::string description = fields[7].
GetString();
9452 SF_LOG_ERROR(
"sql.sql",
"Quest Objective %u has non existant Quest Id %u! Skipping.",
id, questId);
9461 SF_LOG_ERROR(
"sql.sql",
"Quest Objective %u has invalid type %u! Skipping.",
id, type);
9474 SF_LOG_ERROR(
"sql.sql",
"Quest Objective %u has non existant Creature Id %u! Skipping.",
id, objectId);
9480 SF_LOG_ERROR(
"sql.sql",
"Quest Objective %u has valid Creature Id %u but amount %u is invalid! Skipping.",
id, objectId, amount);
9490 SF_LOG_ERROR(
"sql.sql",
"Quest Objective %u has non existant Item Id %u! Skipping.",
id, objectId);
9496 SF_LOG_ERROR(
"sql.sql",
"Quest Objective %u has valid Item Id %u but amount %u is invalid! Skipping.",
id, objectId, amount);
9506 SF_LOG_ERROR(
"sql.sql",
"Quest Objective %u has non existant GameObject Id %u! Skipping.",
id, objectId);
9512 SF_LOG_ERROR(
"sql.sql",
"Quest Objective %u has valid GameObject Id %u but amount %u is invalid! Skipping.",
id, objectId, amount);
9522 SF_LOG_ERROR(
"sql.sql",
"Quest Objective %u has non existant Currency Id %u! Skipping.",
id, objectId);
9533 SF_LOG_ERROR(
"sql.sql",
"Quest Objective %u has non existant Spell Id %u! Skipping.",
id, objectId);
9539 SF_LOG_ERROR(
"sql.sql",
"Quest Objective %u has invalid Spell Id %u! Skipping.",
id, objectId);
9545 SF_LOG_ERROR(
"sql.sql",
"Quest Objective %u has valid Spell Id %u but amount %u is invalid! Skipping.",
id, objectId, amount);
9556 SF_LOG_ERROR(
"sql.sql",
"Quest Objective %u has non existant Faction Id %u! Skipping.",
id, objectId);
9566 SF_LOG_ERROR(
"sql.sql",
"Quest Objective %u is invalid, Quest %u already has the max amount of Quest Objective type %u! Skipping.",
id, questId, type);
9576 SF_LOG_ERROR(
"sql.sql",
"Quest Objective %u has non existant Battle Pet Species %u! Skipping.",
id, objectId);
9582 SF_LOG_ERROR(
"sql.sql",
"Quest Objective %u has invalid Battle Pet Species %u, it doesn't have BATTLE_PET_FLAG_ELITE flag! Skipping.",
id, objectId);
9588 SF_LOG_ERROR(
"sql.sql",
"Quest Objective %u has valid Item Id %u but amount %u is invalid! Skipping.",
id, objectId, amount);
9598 SF_LOG_ERROR(
"sql.sql",
"Quest Objective %u is invalid, Quest %u already has the max amount of Quest Objective type %u! Skipping.",
id, questId, type);
9604 SF_LOG_ERROR(
"sql.sql",
"Quest Objective %u has invalid Pet Battle PvP win amount %u! Skipping.",
id, amount);
9621 }
while (result->NextRow());
9630 QueryResult result =
WorldDatabase.Query(
"SELECT `objectiveId`, `visualEffect` FROM `quest_objective_effects` ORDER BY `objectiveId` ASC");
9633 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 Quest Objective visual effects. DB table `quest_objective_effects` is empty.");
9640 Field* fields = result->Fetch();
9647 SF_LOG_ERROR(
"sql.sql",
"Visual effect %u has non existant Quest Objective Id %u! Skipping.", visualEffect, objectiveId);
9656 if (!questObjective)
9658 SF_LOG_ERROR(
"sql.sql",
"Visual effect %u has non existant Quest Objective %u for Quest %u! Skipping.", visualEffect, objectiveId, quest->
GetQuestId());
9665 }
while (result->NextRow());
9674 QueryResult result =
WorldDatabase.Query(
"SELECT `id`, `locale`, `description` FROM `locales_quest_objective` ORDER BY `id` ASC");
9677 SF_LOG_ERROR(
"server.loading",
">> Loaded 0 Quest Objective locale descriptions. DB table `locales_quest_objective` is empty.");
9684 Field* fields = result->Fetch();
9688 std::string description = fields[2].
GetString();
9692 SF_LOG_ERROR(
"sql.sql",
"Quest Objective locale %u has invalid Quest Objective %u! Skipping.", locale, objectiveId);
9698 SF_LOG_ERROR(
"sql.sql",
"Locale Id %u for Quest Objective %u is invalid! Skipping.", locale, objectiveId);
9703 }
while (result->NextRow());
9714 return &citr->second;
9731 return citr->second;
9739 QueryResult templates =
WorldDatabase.Query(
"SELECT SceneId, Flags, ScriptPackageID, ScriptName FROM scene_template");
9742 SF_LOG_INFO(
"server.loading",
">> Loaded 0 scene templates. DB table `scene_template` is empty.");
9750 Field* fields = templates->Fetch();
9753 sceneTemplate.
SceneId = sceneId;
9757 }
while (templates->NextRow());
9768 return &citr->second;
const AuthHandler table[]
bool BattlePetSpeciesFlagsAllowWildCapture(uint32 flags)
@ CHAR_DEL_EMPTY_EXPIRED_MAIL
@ CHAR_SEL_ACCOUNT_BY_NAME
@ CHAR_SEL_ACCOUNT_BY_GUID
@ CHAR_SEL_EXPIRED_MAIL_ITEMS
@ CHAR_SEL_CHARACTER_NAME
@ CHAR_UPD_MAIL_ITEM_RECEIVER
LocaleConstant GetLocaleByName(const std::string &name)
const uint8 TOTAL_LOCALES
std::vector< std::string > StringVector
@ CREATURE_FLAG_EXTRA_DUNGEON_BOSS
@ CREATURE_FLAG_EXTRA_INSTANCE_BIND
UNORDERED_MAP< uint32, CreatureTemplate > CreatureTemplateContainer
#define MAX_CREATURE_QUEST_ITEMS
#define MAX_EQUIPMENT_ITEMS
#define CREATURE_FLAG_EXTRA_DB_ALLOWED
DB2Storage< ItemEntry > sItemStore(Itemfmt, &DB2Utilities::HasItemEntry, &DB2Utilities::WriteItemDbReply)
bool BattlePetSpeciesHasFlag(uint16 speciesId, uint16 flag)
DB2Storage< ItemExtendedCostEntry > sItemExtendedCostStore(ItemExtendedCostEntryfmt)
BattlePetItemXSpeciesStore sBattlePetItemXSpeciesStore
DB2Storage< ItemSparseEntry > sItemSparseStore(ItemSparsefmt, &DB2Utilities::HasItemSparseEntry, &DB2Utilities::WriteItemSparseDbReply)
DB2Storage< ItemCurrencyCostEntry > sItemCurrencyCostStore(ItemCurrencyCostfmt)
DB2Storage< BattlePetSpeciesEntry > sBattlePetSpeciesStore(BattlePetSpeciesfmt)
BattlePetBreedSet sBattlePetBreedSet
DBCStorage< CharTitlesEntry > sCharTitlesStore(CharTitlesEntryfmt)
DBCStorage< ResearchSiteEntry > sResearchSiteStore(ResearchSitefmt)
DBCStorage< FactionEntry > sFactionStore(FactionEntryfmt)
DBCStorage< WorldSafeLocsEntry > sWorldSafeLocsStore(WorldSafeLocsEntryfmt)
TaxiPathSetBySource sTaxiPathSetBySource
DBCStorage< MailTemplateEntry > sMailTemplateStore(MailTemplateEntryfmt)
DBCStorage< VehicleEntry > sVehicleStore(VehicleEntryfmt)
DBCStorage< GtOCTBaseHPByClassEntry > sGtOCTBaseHPByClassStore(GtOCTBaseHPByClassfmt)
DBCStorage< CharStartOutfitEntry > sCharStartOutfitStore(CharStartOutfitEntryfmt)
DBCStorage< LockEntry > sLockStore(LockEntryfmt)
MapDifficulty const * GetMapDifficultyData(uint32 mapId, DifficultyID difficulty)
TaxiPathNodesByPath sTaxiPathNodesByPath
DBCStorage< ItemDamageEntry > sItemDamageOneHandCasterStore(ItemDamagefmt)
DBCStorage< CreatureSpellDataEntry > sCreatureSpellDataStore(CreatureSpellDatafmt)
DBCStorage< CreatureDisplayInfoEntry > sCreatureDisplayInfoStore(CreatureDisplayInfofmt)
DBCStorage< ChrRacesEntry > sChrRacesStore(ChrRacesEntryfmt)
uint32 GetTalentSpellCost(uint32 spellId)
DBCStorage< GameObjectDisplayInfoEntry > sGameObjectDisplayInfoStore(GameObjectDisplayInfofmt)
DBCStorage< ItemDamageEntry > sItemDamageRangedStore(ItemDamagefmt)
DBCStorage< ItemDamageEntry > sItemDamageAmmoStore(ItemDamagefmt)
DBCStorage< AreaTriggerEntry > sAreaTriggerStore(AreaTriggerEntryfmt)
DBCStorage< ItemDisenchantLootEntry > sItemDisenchantLootStore(ItemDisenchantLootfmt)
DBCStorage< ResearchProjectEntry > sResearchProjectStore(ResearchProjectfmt)
DBCStorage< SoundEntriesEntry > sSoundEntriesStore(SoundEntriesfmt)
DBCStorage< ItemDamageEntry > sItemDamageWandStore(ItemDamagefmt)
DBCStorage< QuestSortEntry > sQuestSortStore(QuestSortEntryfmt)
std::set< uint32 > const & GetPhasesForGroup(uint32 group)
DBCStorage< DungeonEncounterEntry > sDungeonEncounterStore(DungeonEncounterfmt)
DBCStorage< SkillLineEntry > sSkillLineStore(SkillLinefmt)
DBCStorage< PhaseEntry > sPhaseStore(PhaseEntryfmt)
DBCStorage< CreatureFamilyEntry > sCreatureFamilyStore(CreatureFamilyfmt)
DBCStorage< FactionTemplateEntry > sFactionTemplateStore(FactionTemplateEntryfmt)
DBCStorage< ItemDamageEntry > sItemDamageThrownStore(ItemDamagefmt)
DBCStorage< GtOCTBaseMPByClassEntry > sGtOCTBaseMPByClassStore(GtOCTBaseMPByClassfmt)
DBCStorage< TaxiNodesEntry > sTaxiNodesStore(TaxiNodesEntryfmt)
DBCStorage< SpellFocusObjectEntry > sSpellFocusObjectStore(SpellFocusObjectfmt)
char const * GetPetName(uint32 petfamily, uint32)
DBCStorage< ItemDamageEntry > sItemDamageOneHandStore(ItemDamagefmt)
DBCStorage< ItemDamageEntry > sItemDamageTwoHandStore(ItemDamagefmt)
DBCStorage< MapEntry > sMapStore(MapEntryfmt)
CharStartOutfitEntry const * GetCharStartOutfitEntry(uint8 race, uint8 class_, uint8 gender)
DBCStorage< CreatureTypeEntry > sCreatureTypeStore(CreatureTypefmt)
AreaTableEntry const * GetAreaEntryByAreaID(uint32 area_id)
DBCStorage< ChrClassesEntry > sChrClassesStore(ChrClassesEntryfmt)
DBCStorage< CurrencyTypesEntry > sCurrencyTypesStore(CurrencyTypesfmt)
DBCStorage< EmotesEntry > sEmotesStore(EmotesEntryfmt)
DBCStorage< ItemDamageEntry > sItemDamageTwoHandCasterStore(ItemDamagefmt)
std::map< uint32, TaxiPathBySourceAndDestination > TaxiPathSetForSource
#define MAX_SPELL_EFFECTS
UNORDERED_MAP< uint32, GameObjectTemplate > GameObjectTemplateContainer
#define MAX_GAMEOBJECT_QUEST_ITEMS
@ GO_STATE_TRANSPORT_ACTIVE
@ GO_STATE_TRANSPORT_STOPPED
@ GO_STATE_ACTIVE_ALTERNATIVE
CoordPair< TOTAL_NUMBER_OF_CELLS_PER_MAP > CellCoord
@ ITEM_SUBCLASS_WEAPON_CROSSBOW
@ ITEM_SUBCLASS_WEAPON_GUN
@ ITEM_SUBCLASS_WEAPON_BOW
@ ITEM_SUBCLASS_WEAPON_WAND
@ ITEM_SUBCLASS_WEAPON_THROWN
@ ITEM_PROTO_FLAG_CONJURED
@ ITEM_FLAGS_EXTRA_CASTER_WEAPON
#define MAX_ITEM_PROTO_SOCKETS
#define MAX_ITEM_PROTO_SPELLS
@ ITEM_VENDOR_TYPE_CURRENCY
#define MAX_ITEM_SUBCLASS_WEAPON
#define MAX_ITEM_PROTO_STATS
@ LANG_ITEM_ALREADY_IN_LIST
@ LANG_COMMAND_VENDORSELECTION
@ LANG_EXTENDED_COST_NOT_EXIST
#define SF_LOG_DEBUG(filterType__,...)
#define SF_LOG_ERROR(filterType__,...)
#define SF_LOG_INFO(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
#define DEFAULT_VISIBILITY_DISTANCE
@ TEMPSUMMON_MANUAL_DESPAWN
#define INTERACTION_DISTANCE
#define DEFAULT_COMBAT_REACH
uint32 GUID_LOPART(uint64 x)
uint32 MAKE_PAIR32(uint16 l, uint16 h)
uint64 MAKE_NEW_GUID(uint32 l, uint32 e, uint32 h)
uint16 MAKE_PAIR16(uint8 l, uint8 h)
LanguageDesc lang_description[LANGUAGES_COUNT]
void CheckAndFixGOChairHeightId(GameObjectTemplate const *goInfo, uint32 &dataN, uint32 N)
bool LoadSkyFireStrings(const char *table, int32 start_value, int32 end_value)
static LanguageType GetRealmLanguageType(bool create)
void CheckGONoDamageImmuneId(GameObjectTemplate *goTemplate, uint32 dataN, uint32 N)
void CheckGOSpellId(GameObjectTemplate const *goInfo, uint32 dataN, uint32 N)
ScriptMapMap * GetScriptsMapByType(ScriptsType type)
ScriptMapMap sSpellScripts
std::string GetScriptCommandName(ScriptCommands command)
bool isValidString(const std::wstring &wstr, uint32 strictMask, bool numericOrSpace, bool create=false)
uint32 FillMaxDurability(uint32 itemClass, uint32 itemSubClass, uint32 inventoryType, uint32 quality, uint32 itemLevel)
void FillItemDamageFields(float *minDamage, float *maxDamage, float *dps, uint32 itemLevel, uint32 itemClass, uint32 itemSubClass, uint32 quality, uint32 delay, float statScalingFactor, uint32 inventoryType, uint32 flags2)
SkillRangeType GetSkillRangeType(SkillLineEntry const *pSkill, bool racial)
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)
LanguageDesc const * GetLanguageDescByID(Language lang)
std::string GetScriptsTableNameByType(ScriptsType type)
ScriptMapMap sWaypointScripts
bool normalizePlayerName(std::string &name)
void FillDisenchantFields(uint32 *disenchantID, uint32 *requiredDisenchantSkill, ItemTemplate const &itemTemplate)
@ ENCOUNTER_CREDIT_KILL_CREATURE
@ ENCOUNTER_CREDIT_CAST_SPELL
std::pair< GraveYardContainer::const_iterator, GraveYardContainer::const_iterator > GraveYardMapBounds
#define SKYFIRE_TRAINER_START_REF
std::pair< GraveYardContainer::iterator, GraveYardContainer::iterator > GraveYardMapBoundsNonConst
std::multimap< uint32, ScriptInfo > ScriptMap
std::pair< SpellScriptsContainer::iterator, SpellScriptsContainer::iterator > SpellScriptsBounds
ScriptMapMap * GetScriptsMapByType(ScriptsType type)
@ SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT
@ SCRIPT_COMMAND_KILL_CREDIT
@ SCRIPT_COMMAND_QUEST_EXPLORED
@ SCRIPT_COMMAND_TELEPORT_TO
@ SCRIPT_COMMAND_RESPAWN_GAMEOBJECT
@ SCRIPT_COMMAND_FLAG_SET
@ SCRIPT_COMMAND_ACTIVATE_OBJECT
@ SCRIPT_COMMAND_PLAY_SOUND
@ SCRIPT_COMMAND_OPEN_DOOR
@ SCRIPT_COMMAND_FIELD_SET
@ SCRIPT_COMMAND_LOAD_PATH
@ SCRIPT_COMMAND_TEMP_SUMMON_CREATURE
@ SCRIPT_COMMAND_REMOVE_AURA
@ SCRIPT_COMMAND_DESPAWN_SELF
@ SCRIPT_COMMAND_CLOSE_DOOR
@ SCRIPT_COMMAND_CAST_SPELL
@ SCRIPT_COMMAND_PLAYMOVIE
@ SCRIPT_COMMAND_CLOSE_GOSSIP
@ SCRIPT_COMMAND_FLAG_REMOVE
@ SCRIPT_COMMAND_CREATE_ITEM
@ SCRIPT_COMMAND_ORIENTATION
ScriptMapMap sSpellScripts
std::string GetScriptCommandName(ScriptCommands command)
#define MIN_DB_SCRIPT_STRING_ID
#define MAX_DB_SCRIPT_STRING_ID
ScriptMapMap sEventScripts
#define MIN_SKYFIRE_STRING_ID
std::map< uint32, ScriptMap > ScriptMapMap
std::string GetScriptsTableNameByType(ScriptsType type)
ScriptMapMap sWaypointScripts
std::multimap< uint32, uint32 > QuestRelations
std::list< DungeonEncounter const * > DungeonEncounterList
std::multimap< uint32, uint32 > PooledQuestRelation
Skyfire::AutoPtr< PreparedResultSet, Skyfire::Mutex > PreparedQueryResult
Skyfire::AutoPtr< ResultSet, Skyfire::Mutex > QueryResult
#define QUEST_REWARDS_COUNT
@ QUEST_OBJECTIVE_TYPE_FACTION_REP2
@ QUEST_OBJECTIVE_TYPE_PET_BATTLE_PVP
@ QUEST_OBJECTIVE_TYPE_CURRENCY
@ QUEST_OBJECTIVE_TYPE_ITEM
@ QUEST_OBJECTIVE_TYPE_NPC
@ QUEST_OBJECTIVE_TYPE_NPC_INTERACT
@ QUEST_OBJECTIVE_TYPE_PET_BATTLE_ELITE
@ QUEST_OBJECTIVE_TYPE_SPELL
@ QUEST_OBJECTIVE_TYPE_PET_BATTLE_TAMER
@ QUEST_OBJECTIVE_TYPE_END
@ QUEST_OBJECTIVE_TYPE_FACTION_REP
@ QUEST_OBJECTIVE_TYPE_MONEY
@ QUEST_OBJECTIVE_TYPE_GO
#define QUEST_REWARD_CURRENCY_COUNT
@ QUEST_FLAGS_TRACKING_EVENT
#define QUEST_REPUTATIONS_COUNT
#define QUEST_SOURCE_ITEM_IDS_COUNT
#define QUEST_REWARD_CHOICES_COUNT
@ QUEST_SPECIAL_FLAGS_TIMED
@ QUEST_SPECIAL_FLAGS_REPEATABLE
@ QUEST_SPECIAL_FLAGS_DB_ALLOWED
@ QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT
@ QUEST_SPECIAL_FLAGS_MONTHLY
@ GAMEOBJECT_TYPE_CAPTURE_POINT
@ GAMEOBJECT_TYPE_SPELL_FOCUS
@ GAMEOBJECT_TYPE_MO_TRANSPORT
@ GAMEOBJECT_TYPE_TRANSPORT
@ GAMEOBJECT_TYPE_SUMMONING_RITUAL
@ 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
#define MAX_CREATURE_BASE_HP
#define MAX_REPUTATION_RANK
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_SEND_EVENT
@ SPELL_EFFECT_LEARN_SPELL
@ SPELL_EFFECT_QUEST_COMPLETE
uint32 SkillByQuestSort(int32 QuestSort)
@ SKILL_CATEGORY_ATTRIBUTES
@ SKILL_CATEGORY_SECONDARY
@ SKILL_CATEGORY_LANGUAGES
@ SKILL_CATEGORY_PROFESSION
@ TARGET_UNIT_TARGET_ALLY
@ CREATURE_FAMILY_HORSE_CUSTOM
@ CHAR_NAME_THREE_CONSECUTIVE
@ CHAR_NAME_INVALID_CHARACTER
@ CHAR_NAME_MIXED_LANGUAGES
@ SPELL_CLICK_USER_FRIEND
#define MAX_GAMEOBJECT_DATA
#define CLASSMASK_ALL_PLAYABLE
#define CURRENT_CONTENT_EXP
@ PET_NAME_MIXED_LANGUAGES
#define RACEMASK_ALL_PLAYABLE
#define CLASSMASK_ALL_CREATURES
@ SKILL_LANG_PANDAREN_NEUTRAL
@ SKILL_LANG_PANDAREN_ALLIANCE
@ SKILL_LANG_DEMON_TONGUE
@ SKILL_LANG_PANDAREN_HORDE
#define MAX_SPILLOVER_FACTIONS
@ SPELL_AURA_CONTROL_VEHICLE
bool IsProfessionSkill(uint32 skill)
@ SUMMONER_TYPE_GAMEOBJECT
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
@ UNIT_NPC_FLAG_WILDPET_CAPTURABLE
@ UNIT_NPC_FLAG_QUESTGIVER
@ UNIT_NPC_FLAG_SPELLCLICK
@ UNIT_STAND_STATE_SIT_HIGH_CHAIR
@ UNIT_STAND_STATE_SIT_LOW_CHAIR
#define MAX_DECLINED_NAME_CASES
#define CREATURE_MAX_SPELLS
bool WStrToUtf8(wchar_t *wstr, size_t size, std::string &utf8str)
bool Utf8toWStr(char const *utf8str, size_t csize, wchar_t *wstr, size_t &wsize)
std::wstring GetMainPartOfName(std::wstring wname, uint32 declension)
bool isBasicLatinString(const std::wstring &wstr, bool numericOrSpace)
bool isCyrillicString(const std::wstring &wstr, bool numericOrSpace)
bool isExtendedLatinString(const std::wstring &wstr, bool numericOrSpace)
bool isEastAsianString(const std::wstring &wstr, bool numericOrSpace)
void wstrToLower(std::wstring &str)
wchar_t wcharToUpper(wchar_t wchar)
std::vector< VehicleAccessory > VehicleAccessoryList
@ WORLD_SEL_WAYPOINT_DATA_ACTION
@ WORLD_INS_GRAVEYARD_ZONE
@ WORLD_SEL_NPC_VENDOR_REF
@ WORLD_REP_CREATURE_LINKED_RESPAWN
@ WORLD_DEL_GRAVEYARD_ZONE
@ WORLD_DEL_CRELINKED_RESPAWN
virtual void _Init(std::string const *scriptname, uint32 spellId)
bool _Validate(SpellInfo const *entry)
void PSendSysMessage(const char *format,...) ATTR_PRINTF(2
virtual void SendSysMessage(const char *str)
bool LoadCorpseFromDB(uint32 guid, Field *fields)
bool LoadCreatureFromDB(uint32 guid, Map *map, bool addToMap=true)
static float _GetDamageMod(int32 Rank)
T const * LookupEntry(uint32 id) const
std::string GetString() const
char const * GetCString() const
bool LoadGameObjectFromDB(uint32 guid, Map *map, bool addToMap=true)
static uint32 GetSpecialPrice(ItemTemplate const *proto, uint32 minimumPrice=10000)
bool Instanceable() const
bool IsGridLoaded(float x, float y) const
static bool IsValidMapCoord(uint32 mapid, float x, float y)
static bool IsValidMAP(uint32 mapid, bool startUp)
static Player * FindPlayer(uint64)
ItemTemplate const * GetItemTemplate(uint32 entry)
uint64 GetPlayerGUIDByName(std::string const &name) const
uint32 _hiAreaTriggerGuid
CharacterConversionMap FactionChangeAchievements
std::set< uint32 > _difficultyEntries[4 - 1]
void LoadResearchDigsiteInfo()
uint32 GenerateLowGuid(HighGuid guidhigh)
TempSummonDataContainer _tempSummonDataStore
Stores temp summon data grouped by summoner's entry, summoner's type and group id.
std::set< uint8 > BattlePetQualitySet
QuestRelations _creatureQuestInvolvedRelations
PetLevelInfo const * GetPetLevelInfo(uint32 creature_id, uint8 level) const
PlayerInfo * _playerInfo[MAX_RACES][MAX_CLASSES]
VehicleAccessoryList const * GetVehicleAccessoryList(Vehicle *veh) const
bool LoadSkyFireStrings()
VehicleAccessoryContainer _vehicleAccessoryStore
ResearchDigsiteContainer _researchDigsiteStore
QuestObjectiveLocale const * GetQuestObjectiveLocale(uint32 objectiveId) const
WorldSafeLocsEntry const * GetDefaultGraveYard(uint32 team)
uint32 GetXPForLevel(uint8 level) const
BattlePetQualityXSpeciesMap sBattlePetQualityXSpeciesStore
CreatureBaseStats const * GetCreatureBaseStats(uint8 level, uint8 unitClass)
GameTele const * GetGameTeleExactName(std::string const &name) const
WorldSafeLocsEntry const * GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team)
bool AddGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool persist=true)
uint32 GetAreaTriggerScriptId(uint32 trigger_id)
void LoadReputationOnKill()
PointOfInterest const * GetPointOfInterest(uint32 id) const
void LoadGameObjectTemplate()
void LoadFactionChangeSpells()
TavernRestAreaContainer _tavernRestAreaStore
void RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool persist=false)
void LoadFactionChangeItems()
void LoadAreaTriggerTeleports()
SceneTemplateContainer _sceneTemplateStore
void LoadNpcTextLocales()
GameTeleContainer _gameTeleStore
void LoadPageTextLocales()
uint32 GetPlayerAccountIdByGUID(uint64 guid) const
HalfNameContainer _petHalfName1
GossipTextContainer _gossipTextStore
void LoadInstanceTemplate()
void LoadItemScriptNames()
uint32 GetTaxiMountDisplayId(uint32 id, uint32 team, bool allowed_alt_team=false)
SpellScriptsContainer _spellScriptsStore
void LoadPlayerCreateCastSpellsData()
CreatureDataContainer _creatureDataStore
void ValidateSpellScripts()
void LoadGraveyardOrientations()
void LoadCreatureQuestEnders()
QuestRelations _goQuestRelations
CreatureBaseStatsContainer _creatureBaseStatsStore
void RemoveCreatureFromGrid(uint32 guid, CreatureData const *data)
void LoadSceneTemplates()
void LoadGameobjectQuestEnders()
SkyFireStringLocaleContainer _SkyfireStringLocaleStore
void LoadCreatureLocales()
ScriptNameContainer _scriptNamesStore
GameObjectTemplate const * GetGameObjectTemplate(uint32 entry)
TavernAreaTriggerContainer _tavernAreaTriggerStore
void LoadCreatureClassLevelStats()
PlayerInfo const * GetPlayerInfo(uint32 race, uint32 class_) const
int LoadReferenceVendor(int32 vendor, int32 item, uint8 type, std::set< uint32 > *skip_vendors)
void LoadCreatureTemplates()
GossipText const * GetGossipText(uint32 Text_ID) const
CacheTrainerSpellContainer _cacheTrainerSpellStore
PageTextLocaleContainer _pageTextLocaleStore
GameObjectData const * GetGOData(uint32 guid) const
EquipmentInfoContainer _equipmentInfoStore
void DeleteCorpseCellData(uint32 mapid, uint32 cellid, uint32 player_guid)
AccessRequirementContainer _accessRequirementStore
void LoadQuestAreaTriggers()
uint32 GetScriptId(const char *name)
CreatureAddon const * GetCreatureAddon(uint32 lowguid)
CreatureAddonContainer _creatureTemplateAddonStore
CreatureTemplateContainer _creatureTemplateStore
bool AddGameTele(GameTele &data)
static bool CheckDeclinedNames(const std::wstring &w_ownname, DeclinedName const &names)
const char * GetScriptName(uint32 id) const
void LoadFactionChangeAchievements()
static PetNameInvalidReason CheckPetName(std::string const &name)
static void AddLocaleString(std::string const &s, LocaleConstant locale, StringVector &data)
static uint32 ChooseDisplayId(CreatureTemplate const *cinfo, CreatureData const *data=NULL)
TerrainPhaseInfo _terrainMapDefaultStore
CharacterConversionMap FactionChangeReputation
uint64 BattlePetGetNewId()
SpellScriptsBounds GetSpellScriptsBounds(uint32 spellId)
ExclusiveQuestGroups mExclusiveQuestGroups
void AddGameobjectToGrid(uint32 guid, GameObjectData const *data)
void LoadBattlePetBreedData()
void LoadFactionChangeReputations()
static ResponseCodes CheckPlayerName(std::string const &name, bool create=false)
void AddCreatureToGrid(uint32 guid, CreatureData const *data)
GameObjectTemplateContainer _gameObjectTemplateStore
void LoadReputationSpilloverTemplate()
uint32 GetPlayerAccountIdByPlayerName(std::string const &name) const
void LoadExplorationBaseXP()
void LoadFishingBaseSkillLevel()
std::set< uint32 > _hasDifficultyEntries[4 - 1]
uint8 BattlePetGetRandomQuality(uint32 speciesId) const
uint64 GenerateVoidStorageItemId()
void GetPlayerClassLevelInfo(uint32 class_, uint8 level, uint32 &baseHP, uint32 &baseMana) const
void LoadArchaeologyFindInfo()
void GetPlayerLevelInfo(uint32 race, uint32 class_, uint8 level, PlayerLevelInfo *info) const
bool GetPlayerNameByGUID(uint64 guid, std::string &name) const
EquipmentInfo const * GetEquipmentInfo(uint32 entry, int8 &id)
void LoadEquipmentTemplates()
bool QuestObjectiveExists(uint32 objectiveId) const
void DeleteCreatureData(uint32 guid)
void RemoveGameobjectFromGrid(uint32 guid, GameObjectData const *data)
ItemTemplateContainer _itemTemplateStore
GameObjectDataContainer _gameObjectDataStore
void LoadGraveyardZones()
uint32 GeneratePetNumber()
GossipMenusContainer _gossipMenusStore
uint32 GetQuestObjectiveQuestId(uint32 objectiveId) const
uint32 GetNearestTaxiNode(float x, float y, float z, uint32 mapid, uint32 team)
void LoadTerrainWorldMaps()
void LoadGossipMenuItemsLocales()
VehicleAccessoryContainer _vehicleTemplateAccessoryStore
CreatureLocaleContainer _creatureLocaleStore
void CheckCreatureTemplate(CreatureTemplate const *cInfo)
TerrainPhaseInfo _terrainPhaseInfoStore
SkyFireStringLocale const * GetSkyFireStringLocale(int32 entry) const
void LoadPlayerCreateItemsData()
uint8 BattlePetGetRandomBreed(uint32 speciesId) const
PointOfInterestLocaleContainer _pointOfInterestLocaleStore
InstanceTemplateContainer _instanceTemplateStore
void DeleteGOData(uint32 guid)
void LoadTerrainSwapDefaults()
void AddCorpseCellData(uint32 mapid, uint32 cellid, uint32 player_guid, uint32 instance)
void AddSpellToTrainer(uint32 entry, uint32 spell, uint32 spellCost, uint32 reqSkill, uint32 reqSkillValue, uint32 reqLevel)
QuestRelations _goQuestInvolvedRelations
void LoadNPCSpellClickSpells()
QuestAreaTriggerContainer _questAreaTriggerStore
CreatureData & NewOrExistCreatureData(uint32 guid)
void LoadQuestObjectiveLocales()
FishingBaseSkillContainer _fishingBaseForAreaStore
AreaTriggerContainer _areaTriggerStore
uint32 AddGOData(uint32 entry, uint32 map, float x, float y, float z, float o, uint32 spawntimedelay=0, float rotation0=0, float rotation1=0, float rotation2=0, float rotation3=0)
void LoadAccessRequirements()
MapObjectGuids _mapObjectGuidsStore
CreatureAddonContainer _creatureAddonStore
ArchaeologyFindContainer _archaeologyFindStore
bool IsValidPlayerCreateClass(uint32 currentClass)
GraveyardOrientationContainer _graveyardOrientations
PetLevelInfoContainer _petInfoStore
GameObjectForQuestContainer _gameObjectForQuestStore
MailLevelRewardContainer _mailLevelRewardStore
AreaTriggerStruct const * GetGoBackTrigger(uint32 Map) const
void LoadVehicleTemplateAccessories()
Player * GetPlayerByLowGUID(uint32 lowguid) const
NpcTextLocaleContainer _npcTextLocaleStore
VendorItemData const * GetNpcVendorItemList(uint32 entry) const
HalfNameContainer _petHalfName0
void LoadGameObjectLocales()
ResearchProjectRequirementContainer _researchProjectRequirementStore
void PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint32 itemId, int32 count)
PageText const * GetPageText(uint32 pageEntry)
void LoadCreatureTemplateAddons()
bool RemoveVendorItem(uint32 entry, uint32 item, uint8 type, bool persist=true)
CharacterConversionMap FactionChangeSpells
uint32 GetBaseXP(uint8 level)
bool IsValidPlayerCreateRace(uint32 currentRace)
CharacterConversionMap FactionChangeItems
void LoadBattlePetItemToSpeciesData()
GossipMenuItemsLocaleContainer _gossipMenuItemsLocaleStore
CreatureModelInfo const * GetCreatureModelInfo(uint32 modelId)
BaseXPContainer _baseXPTable
void LoadTavernAreaTriggers()
void LoadReputationRewardRate()
AreaTriggerScriptContainer _areaTriggerScriptStore
QuestRelations _creatureQuestRelations
QuestLocaleContainer _questLocaleStore
std::set< uint8 > BattleBetBreedSet
SceneTemplate const * GetSceneTemplate(uint32 sceneId) const
Quest const * GetQuestTemplate(uint32 quest_id) const
void LoadPlayerCreateLevelStatsData()
DungeonEncounterContainer _dungeonEncounterStore
BattlePetBreedXSpeciesMap sBattlePetBreedXSpeciesStore
void LoadGameobjectQuestStarters()
void LoadScripts(ScriptsType type)
RepOnKillContainer _repOnKillStore
void LoadGameObjectForQuests()
AreaTriggerStruct const * GetMapEntranceTrigger(uint32 Map) const
void LoadFactionChangeTitles()
QuestObjectiveLocaleContainer m_questObjectiveLocaleStore
void LoadQuestObjectives()
CreatureModelInfo const * GetCreatureModelRandomGender(uint32 *displayID)
int32 GetBaseReputationOf(FactionEntry const *factionEntry, uint8 race, uint8 playerClass)
RepSpilloverTemplateContainer _repSpilloverTemplateStore
uint32 GetPlayerTeamByGUID(uint64 guid) const
void LoadAreaTriggerScripts()
void ReturnOrDeleteOldMails(bool serverUp)
bool IsReservedName(std::string const &name) const
void LoadTerrainPhaseInfo()
static bool IsValidCharterName(std::string const &name)
void LoadWaypointScripts()
CreatureModelContainer _creatureModelStore
bool DeleteGameTele(std::string const &name)
LinkedRespawnContainer _linkedRespawnStore
CreatureAddon const * GetCreatureTemplateAddon(uint32 entry)
uint64 GenerateEquipmentSetGuid()
GameObjectData & NewGOData(uint32 guid)
GraveYardContainer GraveYardStore
bool SetCreatureLinkedRespawn(uint32 guid, uint32 linkedGuid)
void LoadPlayerCreateActionData()
void GetTaxiPath(uint32 source, uint32 destination, uint32 &path, uint32 &cost)
static void ChooseCreatureFlags(CreatureTemplate const *cinfo, uint32 &npcflag, uint32 &unit_flags, uint32 &dynamicflags, CreatureData const *data=NULL)
void LoadInstanceEncounters()
InstanceTemplate const * GetInstanceTemplate(uint32 mapId)
TerrainUIPhaseInfo _terrainWorldMapStore
GameObjectLocaleContainer _gameObjectLocaleStore
void LoadBattlePetQualityData()
void LoadCreatureQuestStarters()
const char * GetSkyFireString(int32 entry, LocaleConstant locale_idx) const
GameTele const * GetGameTele(uint32 id) const
void CheckScripts(ScriptsType type, std::set< int32 > &ids)
void LoadItemTemplateAddon()
PlayerXPperLevel _playerXPperLevel
CacheVendorItemContainer _cacheVendorItemStore
void LoadSpellScriptNames()
void LoadMailLevelRewards()
void AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedCost, uint8 type, bool persist=true)
void BuildPlayerLevelInfo(uint8 race, uint8 class_, uint8 level, PlayerLevelInfo *plinfo) const
void LoadDbScriptStrings()
PointOfInterestContainer _pointsOfInterestStore
CreatureData const * GetCreatureData(uint32 guid) const
void LoadPointsOfInterest()
void LoadFactionChangeQuests()
RepRewardRateContainer _repRewardRateStore
TavernRestArea const * GetTavernRestAreaAtPosition(uint32 mapId, float x, float y, float z) const
CharacterConversionMap FactionChangeTitles
uint32 GenerateAuctionID()
void LoadPlayerCreateSpellsData()
std::string GeneratePetName(uint32 entry)
GraveYardData const * FindGraveYardData(uint32 id, uint32 zone)
void LoadPointOfInterestLocales()
void LoadQuestObjectiveVisualEffects()
bool IsInTavernRestArea(TavernRestArea const &restArea, uint32 mapId, float x, float y, float z, float padding=0.0f) const
PageTextContainer _pageTextStore
bool MoveCreData(uint32 guid, uint32 map, const Position &pos)
bool IsTavernAreaTrigger(uint32 Trigger_ID) const
void LoadGossipMenuItems()
void LoadResearchProjectRequirements()
ItemLocaleContainer _itemLocaleStore
void LoadVehicleAccessories()
bool IsVendorItemValid(uint32 vendor_entry, uint32 id, int32 maxcount, uint32 ptime, uint32 ExtendedCost, uint8 type, Player *player=NULL, std::set< uint32 > *skip_vendors=NULL, uint32 ORnpcflag=0) const
void LoadCreatureModelInfo()
CharacterConversionMap FactionChangeQuests
void LoadReservedPlayersNames()
QuestPOIContainer _questPOIStore
CreatureTemplate const * GetCreatureTemplate(uint32 entry)
SpellClickInfoContainer _spellClickInfoStore
ReservedNamesContainer _reservedNamesStore
uint32 AddCreData(uint32 entry, uint32 team, uint32 map, float x, float y, float z, float o, uint32 spawntimedelay=0)
void LoadPlayerCreateXpData()
GossipMenuItemsContainer _gossipMenuItemsStore
void LoadQuestRelationsHelper(QuestRelations &map, std::string const &table, bool starter, bool go)
void LoadCreatureAddons()
QuestObjectiveLookupMap m_questObjectiveLookup
TavernRestArea const * GetTavernRestArea(uint32 triggerId) const
WorldSession * GetSession() const
static uint32 TeamForRace(uint8 race)
void setFloat(const uint8 index, const float value)
void setString(const uint8 index, const std::string &value)
void setUInt16(const uint8 index, const uint16 value)
void setUInt64(const uint8 index, const uint64 value)
void setUInt32(const uint8 index, const uint32 value)
void setUInt8(const uint8 index, const uint8 value)
bool HasSpecialFlag(uint32 flag) const
uint32 RewardCurrencyCount[QUEST_REWARD_CURRENCY_COUNT]
uint32 RequiredMaxRepFaction
uint32 RequiredMinRepFaction
void SetSpecialFlag(uint32 flag)
uint32 RequiredSourceItemId[QUEST_SOURCE_ITEM_IDS_COUNT]
uint32 GetCharTitleId() const
uint8 GetQuestObjectiveCountType(uint8 type) const
uint32 RewardItemIdCount[QUEST_REWARDS_COUNT]
uint32 RewardChoiceItemId[QUEST_REWARD_CHOICES_COUNT]
uint32 RewardMailTemplateId
int32 GetNextQuestId() const
int32 RewardFactionValueIdOverride[QUEST_REPUTATIONS_COUNT]
ObjectiveTypeCountVec m_questObjecitveTypeCount
uint32 RequiredSkillPoints
uint32 RewardChoiceItemCount[QUEST_REWARD_CHOICES_COUNT]
int32 GetPrevQuestId() const
uint32 GetQuestId() const
int32 RequiredMaxRepValue
uint32 RequiredSourceItemCount[QUEST_SOURCE_ITEM_IDS_COUNT]
QuestObjectiveSet m_questObjectives
uint32 RewardCurrencyId[QUEST_REWARD_CURRENCY_COUNT]
uint32 RewardFactionId[QUEST_REPUTATIONS_COUNT]
int32 RewardFactionValueId[QUEST_REPUTATIONS_COUNT]
uint32 RewardItemId[QUEST_REWARDS_COUNT]
uint32 GetQuestMethod() const
int32 RequiredMinRepValue
QuestObjective const * GetQuestObjective(uint32 objectiveId) const
static const int32 Reputation_Cap
SpellImplicitTargetInfo TargetA
Targets GetTarget() const
SpellEffectInfo Effects[MAX_SPELL_EFFECTS]
SpellInfo const * GetFirstRankSpell() const
SpellInfo const * GetNextRankSpell() const
bool IsProfession() const
bool HasAura(AuraType aura) const
static bool IsSpellValid(SpellInfo const *spellInfo, Player *player=NULL, bool msg=true)
Some checks for spells, to prevent adding deprecated/broken spells for trainers, spell book,...
bool _Validate(SpellInfo const *entry)
Unit * GetSummoner() const
StorageType::const_iterator const_iterator
const_iterator end() const
const_iterator begin() const
TempSummon * ToTempSummon()
bool IsInRaidWith(Unit const *unit) const
bool IsFriendlyTo(Unit const *unit) const
bool IsInPartyWith(Unit const *unit) const
Unit * GetBase() const
May be called from scripts.
uint32 GetCreatureEntry() const
static void StopNow(uint8 exitcode)
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
WorldDatabaseWorkerPool WorldDatabase
Accessor to the world database.
@ CONFIG_MAX_PLAYER_LEVEL
@ CONFIG_STRICT_PET_NAMES
@ CONFIG_MIN_CHARTER_NAME
@ CONFIG_STRICT_PLAYER_NAMES
@ CONFIG_STRICT_CHARTER_NAMES
@ CONFIG_START_ALL_SPELLS
@ REALM_ZONE_LATIN_AMERICA
@ REALM_ZONE_UNITED_STATES
bool IsDisabledFor(DisableType type, uint32 entry, Unit const *unit, uint8 flags)
void LogMissingAnimationData(uint32, uint32, uint32)
void LogRegisteredSpawn(LegacyTransportSpawnDiagnostic const &)
uint32 GetAllowedSpawnMask(uint32 dbEntry, uint32 mapId, uint32 spawnMask)
char const * GetGossipMenuOptionLocaleLoadQuery()
char const * GetGossipMenuOptionLoadQuery()
uint32 GetRootZoneId(uint32 areaId)
bool HasInnAreaBounds(InnAreaBounds const &bounds)
bool IsInsideInnArea(InnAreaBounds const &bounds, uint32 mapId, float x, float y, float z, float padding)
bool LocalTime(time_t const &time, tm &result)
bool IsValidMapCoord(float c)
CellCoord ComputeCellCoord(float x, float y)
int32 SpellCategoryCooldown
std::string questFailedText
int32 ItemId[MAX_OUTFIT_ITEMS]
std::vector< uint32 > auras
uint32 BaseHealth[MAX_CREATURE_BASE_HP]
uint32 GenerateMana(CreatureTemplate const *info) const
uint32 GenerateHealth(CreatureTemplate const *info) const
uint32 modelid_other_gender
uint32 MechanicImmuneMask
int32 resistance[MAX_SPELL_SCHOOL]
uint32 DifficultyEntry[4 - 1]
uint32 KillCredit[MAX_KILL_CREDIT]
uint32 spells[CREATURE_MAX_SPELLS]
uint32 questItems[MAX_CREATURE_QUEST_ITEMS]
uint32 GetRandomValidModelId() const
std::string name[MAX_DECLINED_NAME_CASES]
uint32 ItemEntry[MAX_EQUIPMENT_ITEMS]
uint32 BaseRepRaceMask[4]
uint32 BaseRepClassMask[4]
StringVector CastBarCaption
struct GameObjectTemplate::@046065176235271051340241126110345143267101032070::@114312050106372302366137106154036240136321221160 barberChair
uint32 questItems[MAX_GAMEOBJECT_QUEST_ITEMS]
uint32 data[MAX_GAMEOBJECT_DATA]
struct GameObjectTemplate::@046065176235271051340241126110345143267101032070::@076042223047135343272115231235004103107103052206 raw
struct GameObjectTemplate::@046065176235271051340241126110345143267101032070::@253305212064111242104116123236360243075266147175 flagstand
struct GameObjectTemplate::@046065176235271051340241126110345143267101032070::@152130076372303155010023156377005036224346144151 camera
struct GameObjectTemplate::@046065176235271051340241126110345143267101032070::@154136051106040324176270267211357174344063050360 chest
bool IsDespawnAtAction() const
struct GameObjectTemplate::@046065176235271051340241126110345143267101032070::@076241013146174060203322361030304357327036335177 spellFocus
struct GameObjectTemplate::@046065176235271051340241126110345143267101032070::@334327144355150311317234223372371064337023010042 trap
struct GameObjectTemplate::@046065176235271051340241126110345143267101032070::@316034272062200025205312222263007157266267301257 chair
struct GameObjectTemplate::@046065176235271051340241126110345143267101032070::@243266127071011160240350104214013054067132104252 fishinghole
struct GameObjectTemplate::@046065176235271051340241126110345143267101032070::@110054372326320106132141070072073073207136033072 areadamage
std::string castBarCaption
struct GameObjectTemplate::@046065176235271051340241126110345143267101032070::@315077355127077256043020131262337362171234125061 spellcaster
struct GameObjectTemplate::@046065176235271051340241126110345143267101032070::@041347154150020206261150105351300331163012356113 flagdrop
struct GameObjectTemplate::@046065176235271051340241126110345143267101032070::@030154355127376377116310314155367165157323234200 door
struct GameObjectTemplate::@046065176235271051340241126110345143267101032070::@316212233253022127367165230227137227160036113140 moTransport
struct GameObjectTemplate::@046065176235271051340241126110345143267101032070::@336001126101306307066053364273045317014372227110 questgiver
struct GameObjectTemplate::@046065176235271051340241126110345143267101032070::@336060043160212225074214221232260020127013174055 goober
struct GameObjectTemplate::@046065176235271051340241126110345143267101032070::@035305233304037036156142147071371001131016202245 button
GossipTextOption Options[MAX_GOSSIP_TEXT_OPTIONS]
QEmote Emotes[MAX_GOSSIP_TEXT_EMOTES]
uint32 RequiredDisenchantSkill
int32 SoundOverrideSubclass
int32 ItemStatUnk1[MAX_ITEM_PROTO_STATS]
int32 CurrencySubstitutionCount
uint32 RequiredReputationRank
LocalizedString * Description
uint32 RequiredReputationFaction
uint32 ScalingStatDistribution
int32 SpellId[MAX_ITEM_PROTO_SPELLS]
int32 SpellTrigger[MAX_ITEM_PROTO_SPELLS]
uint32 ItemStatValue[MAX_ITEM_PROTO_STATS]
int32 CurrencySubstitutionId
int32 SpellCooldown[MAX_ITEM_PROTO_SPELLS]
int32 SpellCategoryCooldown[MAX_ITEM_PROTO_SPELLS]
float ArmorDamageModifier
uint32 Content[MAX_ITEM_PROTO_SOCKETS]
int32 ItemStatUnk2[MAX_ITEM_PROTO_STATS]
int32 ItemStatType[MAX_ITEM_PROTO_STATS]
uint32 Color[MAX_ITEM_PROTO_SOCKETS]
int32 SpellCategory[MAX_ITEM_PROTO_SPELLS]
int32 SpellCharges[MAX_ITEM_PROTO_SPELLS]
float ArmorDamageModifier
_Spell Spells[MAX_ITEM_PROTO_SPELLS]
uint32 RequiredDisenchantSkill
uint32 CurrencySubstitutionCount
uint32 RequiredReputationRank
uint32 RequiredReputationFaction
uint32 ScalingStatDistribution
_ItemStat ItemStat[MAX_ITEM_PROTO_STATS]
uint32 CurrencySubstitutionId
int32 SoundOverrideSubclass
_Socket Socket[MAX_ITEM_PROTO_SOCKETS]
char const * Str[TOTAL_LOCALES]
std::vector< MailItemInfo > items
bool IsBattlegroundOrArena() const
bool Instanceable() const
std::vector< StringVector > Text_0
std::vector< StringVector > Text_1
PlayerLevelInfo * levelInfo
float GetPositionZ() const
float GetOrientation() const
float GetPositionX() const
float GetPositionY() const
void Relocate(float x, float y)
StringVector QuestTurnTargetName
StringVector OfferRewardText
StringVector RequestItemsText
StringVector CompletedText
StringVector QuestTurnTextWindow
StringVector QuestGiverTextWindow
StringVector QuestGiverTargetName
VisualEffectVec VisualEffects
std::vector< QuestPOIPoint > points
float questRepeatableRate
uint32 faction_rank[MAX_SPILLOVER_FACTIONS]
uint32 faction[MAX_SPILLOVER_FACTIONS]
float faction_rate[MAX_SPILLOVER_FACTIONS]
uint32 requiredSkillValue
uint32 requiredSkillValue
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@235213206037260262323130355352141154322352336256 KillCredit
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@323144237034231264254170147314213276360375006374 RespawnGameobject
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@366202063362232017203072231044323334343276266221 CreateItem
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@215362176107272335311131263361174353005102016155 QuestExplored
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@060313056375165064134111275066130320355250202151 TempSummonCreature
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@051127012334050237002325262055013174250146206153 ToggleDoor
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@056312253106117114176351200255000030100172357051 Raw
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@310207036336307321205127162152160034150247215165 RemoveAura
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@340160313205203126365171223166355241073242151073 CastSpell
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@044166240220270000271314363001357235305117106163 Emote
std::string GetDebugInfo() const
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@203261325337225075157146047106312017011372377163 TeleportTo
struct ScriptInfo::@073000116166017043214113002234263016340307140354::@264374040335366155120321054324331165306344366303 Talk
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.
TrainerSpellMap spellList
uint32 learnedSpell[MAX_SPELL_EFFECTS]
VendorItem const * FindItemCostPair(uint32 item_id, uint32 extendedCost, uint8 type) const
void AddItem(uint32 item, int32 maxcount, uint32 ptime, uint32 ExtendedCost, uint8 type)