TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ObjectMgr.cpp File Reference
#include "AccountMgr.h"
#include "AchievementMgr.h"
#include "ArenaTeam.h"
#include "ArenaTeamMgr.h"
#include "BattlegroundMgr.h"
#include "Chat.h"
#include "Common.h"
#include "DatabaseEnv.h"
#include "DB2Structure.h"
#include "DB2Stores.h"
#include "DisableMgr.h"
#include "GossipDef.h"
#include "GroupMgr.h"
#include "GuildMgr.h"
#include "InstanceSaveMgr.h"
#include "Language.h"
#include "LFGMgr.h"
#include "Log.h"
#include "MapManager.h"
#include "Object.h"
#include "ObjectMgr.h"
#include "PoolMgr.h"
#include "ReputationMgr.h"
#include "ScriptMgr.h"
#include "SpellAuras.h"
#include "SpellMgr.h"
#include "SpellScript.h"
#include "UpdateMask.h"
#include "Util.h"
#include "Vehicle.h"
#include "World.h"
+ Include dependency graph for ObjectMgr.cpp:

Classes

struct  ItemSpecStats
 

Enumerations

enum  LanguageType {
  LT_BASIC_LATIN = 0x0000, LT_EXTENDEN_LATIN = 0x0001, LT_CYRILLIC = 0x0002, LT_EAST_ASIA = 0x0004,
  LT_ANY = 0xFFFF
}
 

Functions

std::string GetScriptsTableNameByType (ScriptsType type)
 
ScriptMapMapGetScriptsMapByType (ScriptsType type)
 
std::string GetScriptCommandName (ScriptCommands command)
 
bool normalizePlayerName (std::string &name)
 
ExtendedPlayerName ExtractExtendedPlayerName (std::string const &name)
 
LanguageDesc constGetLanguageDescByID (uint32 lang)
 
uint32 FillMaxDurability (uint32 itemClass, uint32 itemSubClass, uint32 inventoryType, uint32 quality, uint32 itemLevel)
 
void FillDisenchantFields (uint32 *disenchantID, uint32 *requiredDisenchantSkill, ItemTemplate const &itemTemplate)
 
void CheckGOLockId (GameObjectTemplate const *goInfo, uint32 dataN, uint32 N)
 
void CheckGOLinkedTrapId (GameObjectTemplate const *goInfo, uint32 dataN, uint32 N)
 
void CheckGOSpellId (GameObjectTemplate const *goInfo, uint32 dataN, uint32 N)
 
void CheckAndFixGOChairHeightId (GameObjectTemplate const *goInfo, uint32 &dataN, uint32 N)
 
void CheckGONoDamageImmuneId (GameObjectTemplate *goTemplate, uint32 dataN, uint32 N)
 
void CheckGOConsumable (GameObjectTemplate const *goInfo, uint32 dataN, uint32 N)
 
static LanguageType GetRealmLanguageType (bool create)
 
bool isValidString (const std::wstring &wstr, uint32 strictMask, bool numericOrSpace, bool create=false)
 
SkillRangeType GetSkillRangeType (SkillRaceClassInfoEntry const *rcEntry)
 

Variables

ScriptMapMap sSpellScripts
 
ScriptMapMap sEventScripts
 
ScriptMapMap sWaypointScripts
 
LanguageDesc lang_description [LANGUAGES_COUNT]
 

Enumeration Type Documentation

Enumerator
LT_BASIC_LATIN 
LT_EXTENDEN_LATIN 
LT_CYRILLIC 
LT_EAST_ASIA 
LT_ANY 
7508 {
7509  LT_BASIC_LATIN = 0x0000,
7510  LT_EXTENDEN_LATIN = 0x0001,
7511  LT_CYRILLIC = 0x0002,
7512  LT_EAST_ASIA = 0x0004,
7513  LT_ANY = 0xFFFF
7514 };
Definition: ObjectMgr.cpp:7511
Definition: ObjectMgr.cpp:7512
Definition: ObjectMgr.cpp:7509
Definition: ObjectMgr.cpp:7513
Definition: ObjectMgr.cpp:7510

Function Documentation

void CheckAndFixGOChairHeightId ( GameObjectTemplate const goInfo,
uint32 dataN,
uint32  N 
)
inline
6535 {
6537  return;
6538 
6539  TC_LOG_ERROR("sql.sql", "Gameobject (Entry: %u GoType: %u) have data%d=%u but correct chair height in range 0..%i.",
6540  goInfo->entry, goInfo->type, N, dataN, UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR);
6541 
6542  // prevent client and server unexpected work
6543  dataN = 0;
6544 }
Definition: Unit.h:213
Definition: Unit.h:211
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the caller graph for this function:

void CheckGOConsumable ( GameObjectTemplate const goInfo,
uint32  dataN,
uint32  N 
)
inline
6556 {
6557  // 0/1 correct values
6558  if (dataN <= 1)
6559  return;
6560 
6561  TC_LOG_ERROR("sql.sql", "Gameobject (Entry: %u GoType: %u) have data%d=%u but expected boolean (0/1) consumable field value.",
6562  goInfo->entry, goInfo->type, N, dataN);
6563 }
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the caller graph for this function:

void CheckGOLinkedTrapId ( GameObjectTemplate const goInfo,
uint32  dataN,
uint32  N 
)
inline
6516 {
6517  if (GameObjectTemplate const* trapInfo = sObjectMgr->GetGameObjectTemplate(dataN))
6518  {
6519  if (trapInfo->type != GAMEOBJECT_TYPE_TRAP)
6520  TC_LOG_ERROR("sql.sql", "Gameobject (Entry: %u GoType: %u) have data%d=%u but GO (Entry %u) have not GAMEOBJECT_TYPE_TRAP (%u) type.",
6521  goInfo->entry, goInfo->type, N, dataN, dataN, GAMEOBJECT_TYPE_TRAP);
6522  }
6523 }
Definition: GameObject.h:34
#define sObjectMgr
Definition: ObjectMgr.h:1567
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
Definition: SharedDefines.h:2071

+ Here is the caller graph for this function:

void CheckGOLockId ( GameObjectTemplate const goInfo,
uint32  dataN,
uint32  N 
)
inline
6507 {
6508  if (sLockStore.LookupEntry(dataN))
6509  return;
6510 
6511  TC_LOG_ERROR("sql.sql", "Gameobject (Entry: %u GoType: %u) have data%d=%u but lock (Id: %u) not found.",
6512  goInfo->entry, goInfo->type, N, goInfo->door.open, goInfo->door.open);
6513 }
DBCStorage< LockEntry > sLockStore(Lockfmt)
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the caller graph for this function:

void CheckGONoDamageImmuneId ( GameObjectTemplate goTemplate,
uint32  dataN,
uint32  N 
)
inline
6547 {
6548  // 0/1 correct values
6549  if (dataN <= 1)
6550  return;
6551 
6552  TC_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);
6553 }
uint32 entry
Definition: GameObject.h:36
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
uint32 type
Definition: GameObject.h:37

+ Here is the caller graph for this function:

void CheckGOSpellId ( GameObjectTemplate const goInfo,
uint32  dataN,
uint32  N 
)
inline
6526 {
6527  if (sSpellMgr->GetSpellInfo(dataN))
6528  return;
6529 
6530  TC_LOG_ERROR("sql.sql", "Gameobject (Entry: %u GoType: %u) have data%d=%u but Spell (Entry %u) not exist.",
6531  goInfo->entry, goInfo->type, N, dataN, dataN);
6532 }
#define sSpellMgr
Definition: SpellMgr.h:756
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the caller graph for this function:

ExtendedPlayerName ExtractExtendedPlayerName ( std::string const name)
156 {
157  size_t pos = name.find('-');
158  if (pos != std::string::npos)
159  return ExtendedPlayerName(name.substr(0, pos), name.substr(pos + 1));
160  else
161  return ExtendedPlayerName(name, "");
162 }
Definition: ObjectMgr.h:651

+ Here is the caller graph for this function:

void FillDisenchantFields ( uint32 disenchantID,
uint32 requiredDisenchantSkill,
ItemTemplate const itemTemplate 
)
2405 {
2406  *disenchantID = 0;
2407  *(int32*)requiredDisenchantSkill = -1;
2408  if ((itemTemplate.GetFlags() & (ITEM_FLAG_CONJURED | ITEM_FLAG_UNK6)) ||
2409  itemTemplate.GetBonding() == BIND_QUEST_ITEM || itemTemplate.GetArea() || itemTemplate.GetMap() ||
2410  itemTemplate.GetMaxStackSize() > 1 ||
2411  itemTemplate.GetQuality() < ITEM_QUALITY_UNCOMMON || itemTemplate.GetQuality() > ITEM_QUALITY_EPIC ||
2412  !(itemTemplate.GetClass() == ITEM_CLASS_ARMOR || itemTemplate.GetClass() == ITEM_CLASS_WEAPON) ||
2413  !(Item::GetSpecialPrice(&itemTemplate) || sItemCurrencyCostStore.LookupEntry(itemTemplate.GetId())))
2414  return;
2415 
2416  for (uint32 i = 0; i < sItemDisenchantLootStore.GetNumRows(); ++i)
2417  {
2418  ItemDisenchantLootEntry const* disenchant = sItemDisenchantLootStore.LookupEntry(i);
2419  if (!disenchant)
2420  continue;
2421 
2422  if (disenchant->ItemClass == itemTemplate.GetClass() &&
2423  disenchant->ItemQuality == itemTemplate.GetQuality() &&
2424  disenchant->MinItemLevel <= itemTemplate.GetBaseItemLevel() &&
2425  disenchant->MaxItemLevel >= itemTemplate.GetBaseItemLevel())
2426  {
2427  if (disenchant->ID == 60 || disenchant->ID == 61) // epic item disenchant ilvl range 66-99 (classic)
2428  {
2429  if (itemTemplate.GetBaseRequiredLevel() > 60 || itemTemplate.GetRequiredSkillRank() > 300)
2430  continue; // skip to epic item disenchant ilvl range 90-199 (TBC)
2431  }
2432  else if (disenchant->ID == 66 || disenchant->ID == 67) // epic item disenchant ilvl range 90-199 (TBC)
2433  {
2434  if (itemTemplate.GetBaseRequiredLevel() <= 60 || (itemTemplate.GetRequiredSkill() && itemTemplate.GetRequiredSkillRank() <= 300))
2435  continue;
2436  }
2437 
2438  *disenchantID = disenchant->ID;
2439  *requiredDisenchantSkill = disenchant->RequiredDisenchantSkill;
2440  return;
2441  }
2442  }
2443 }
Definition: ItemTemplate.h:174
uint32 RequiredDisenchantSkill
Definition: DB2Structure.h:693
Definition: DB2Structure.h:685
Definition: ItemTemplate.h:123
DB2Storage< ItemCurrencyCostEntry > sItemCurrencyCostStore("ItemCurrencyCost.db2", ItemCurrencyCostFormat, HOTFIX_SEL_ITEM_CURRENCY_COST)
uint32 ItemQuality
Definition: DB2Structure.h:690
static uint32 GetSpecialPrice(ItemTemplate const *proto, uint32 minimumPrice=10000)
Definition: Item.cpp:1661
uint32 MaxItemLevel
Definition: DB2Structure.h:692
int32_t int32
Definition: Define.h:146
uint32_t uint32
Definition: Define.h:150
Definition: SharedDefines.h:322
uint32 MinItemLevel
Definition: DB2Structure.h:691
Definition: ItemTemplate.h:369
Definition: ItemTemplate.h:188
Definition: SharedDefines.h:324
uint32 ID
Definition: DB2Structure.h:687
Definition: ItemTemplate.h:371
uint32 ItemClass
Definition: DB2Structure.h:688
DB2Storage< ItemDisenchantLootEntry > sItemDisenchantLootStore("ItemDisenchantLoot.db2", ItemDisenchantLootFormat, HOTFIX_SEL_ITEM_DISENCHANT_LOOT)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32 FillMaxDurability ( uint32  itemClass,
uint32  itemSubClass,
uint32  inventoryType,
uint32  quality,
uint32  itemLevel 
)
2322 {
2323  if (itemClass != ITEM_CLASS_ARMOR && itemClass != ITEM_CLASS_WEAPON)
2324  return 0;
2325 
2326  static float const qualityMultipliers[MAX_ITEM_QUALITY] =
2327  {
2328  1.0f, 1.0f, 1.0f, 1.17f, 1.37f, 1.68f, 0.0f, 0.0f
2329  };
2330 
2331  static float const armorMultipliers[MAX_INVTYPE] =
2332  {
2333  0.00f, // INVTYPE_NON_EQUIP
2334  0.59f, // INVTYPE_HEAD
2335  0.00f, // INVTYPE_NECK
2336  0.59f, // INVTYPE_SHOULDERS
2337  0.00f, // INVTYPE_BODY
2338  1.00f, // INVTYPE_CHEST
2339  0.35f, // INVTYPE_WAIST
2340  0.75f, // INVTYPE_LEGS
2341  0.49f, // INVTYPE_FEET
2342  0.35f, // INVTYPE_WRISTS
2343  0.35f, // INVTYPE_HANDS
2344  0.00f, // INVTYPE_FINGER
2345  0.00f, // INVTYPE_TRINKET
2346  0.00f, // INVTYPE_WEAPON
2347  1.00f, // INVTYPE_SHIELD
2348  0.00f, // INVTYPE_RANGED
2349  0.00f, // INVTYPE_CLOAK
2350  0.00f, // INVTYPE_2HWEAPON
2351  0.00f, // INVTYPE_BAG
2352  0.00f, // INVTYPE_TABARD
2353  1.00f, // INVTYPE_ROBE
2354  0.00f, // INVTYPE_WEAPONMAINHAND
2355  0.00f, // INVTYPE_WEAPONOFFHAND
2356  0.00f, // INVTYPE_HOLDABLE
2357  0.00f, // INVTYPE_AMMO
2358  0.00f, // INVTYPE_THROWN
2359  0.00f, // INVTYPE_RANGEDRIGHT
2360  0.00f, // INVTYPE_QUIVER
2361  0.00f, // INVTYPE_RELIC
2362  };
2363 
2364  static float const weaponMultipliers[MAX_ITEM_SUBCLASS_WEAPON] =
2365  {
2366  0.89f, // ITEM_SUBCLASS_WEAPON_AXE
2367  1.03f, // ITEM_SUBCLASS_WEAPON_AXE2
2368  0.77f, // ITEM_SUBCLASS_WEAPON_BOW
2369  0.77f, // ITEM_SUBCLASS_WEAPON_GUN
2370  0.89f, // ITEM_SUBCLASS_WEAPON_MACE
2371  1.03f, // ITEM_SUBCLASS_WEAPON_MACE2
2372  1.03f, // ITEM_SUBCLASS_WEAPON_POLEARM
2373  0.89f, // ITEM_SUBCLASS_WEAPON_SWORD
2374  1.03f, // ITEM_SUBCLASS_WEAPON_SWORD2
2375  0.00f, // ITEM_SUBCLASS_WEAPON_Obsolete
2376  1.03f, // ITEM_SUBCLASS_WEAPON_STAFF
2377  0.00f, // ITEM_SUBCLASS_WEAPON_EXOTIC
2378  0.00f, // ITEM_SUBCLASS_WEAPON_EXOTIC2
2379  0.64f, // ITEM_SUBCLASS_WEAPON_FIST_WEAPON
2380  0.00f, // ITEM_SUBCLASS_WEAPON_MISCELLANEOUS
2381  0.64f, // ITEM_SUBCLASS_WEAPON_DAGGER
2382  0.64f, // ITEM_SUBCLASS_WEAPON_THROWN
2383  0.00f, // ITEM_SUBCLASS_WEAPON_SPEAR
2384  0.77f, // ITEM_SUBCLASS_WEAPON_CROSSBOW
2385  0.64f, // ITEM_SUBCLASS_WEAPON_WAND
2386  0.64f, // ITEM_SUBCLASS_WEAPON_FISHING_POLE
2387  };
2388 
2389  float levelPenalty = 1.0f;
2390  if (itemLevel <= 28)
2391  levelPenalty = 0.966f - float(28u - itemLevel) / 54.0f;
2392 
2393  if (itemClass == ITEM_CLASS_ARMOR)
2394  {
2395  if (inventoryType > INVTYPE_ROBE)
2396  return 0;
2397 
2398  return 5 * uint32(23.0f * qualityMultipliers[quality] * armorMultipliers[inventoryType] * levelPenalty + 0.5f);
2399  }
2400 
2401  return 5 * uint32(17.0f * qualityMultipliers[quality] * weaponMultipliers[itemSubClass] * levelPenalty + 0.5f);
2402 };
Definition: ItemTemplate.h:352
#define MAX_ITEM_QUALITY
Definition: SharedDefines.h:330
#define MAX_ITEM_SUBCLASS_WEAPON
Definition: ItemTemplate.h:449
Definition: ItemTemplate.h:369
uint32_t uint32
Definition: g3dmath.h:168
Definition: ItemTemplate.h:371
#define MAX_INVTYPE
Definition: ItemTemplate.h:363

+ Here is the caller graph for this function:

LanguageDesc const* GetLanguageDescByID ( uint32  lang)
193 {
194  for (uint8 i = 0; i < LANGUAGES_COUNT; ++i)
195  {
196  if (uint32(lang_description[i].lang_id) == lang)
197  return &lang_description[i];
198  }
199 
200  return NULL;
201 }
arena_t NULL
Definition: jemalloc_internal.h:624
#define LANGUAGES_COUNT
Definition: SharedDefines.h:988
uint8_t uint8
Definition: Define.h:152
LanguageDesc lang_description[LANGUAGES_COUNT]
Definition: ObjectMgr.cpp:164
uint32_t uint32
Definition: g3dmath.h:168

+ Here is the caller graph for this function:

static LanguageType GetRealmLanguageType ( bool  create)
static
7517 {
7518  switch (sWorld->getIntConfig(CONFIG_REALM_ZONE))
7519  {
7520  case REALM_ZONE_UNKNOWN: // any language
7523  case REALM_ZONE_QA_SERVER:
7524  return LT_ANY;
7525  case REALM_ZONE_UNITED_STATES: // extended-Latin
7526  case REALM_ZONE_OCEANIC:
7528  case REALM_ZONE_ENGLISH:
7529  case REALM_ZONE_GERMAN:
7530  case REALM_ZONE_FRENCH:
7531  case REALM_ZONE_SPANISH:
7532  return LT_EXTENDEN_LATIN;
7533  case REALM_ZONE_KOREA: // East-Asian
7534  case REALM_ZONE_TAIWAN:
7535  case REALM_ZONE_CHINA:
7536  return LT_EAST_ASIA;
7537  case REALM_ZONE_RUSSIAN: // Cyrillic
7538  return LT_CYRILLIC;
7539  default:
7540  return create ? LT_BASIC_LATIN : LT_ANY; // basic-Latin at create, any at login
7541  }
7542 }
Definition: ObjectMgr.cpp:7511
Definition: World.h:453
Definition: World.h:220
#define sWorld
Definition: World.h:887
Definition: World.h:457
Definition: ObjectMgr.cpp:7512
Definition: World.h:456
Definition: World.h:481
Definition: World.h:465
Definition: World.h:461
Definition: World.h:463
Definition: World.h:455
Definition: World.h:454
Definition: ObjectMgr.cpp:7509
Definition: World.h:479
Definition: ObjectMgr.cpp:7513
Definition: ObjectMgr.cpp:7510
Definition: World.h:467
Definition: World.h:464
Definition: World.h:459
Definition: World.h:469
Definition: World.h:462

+ Here is the caller graph for this function:

std::string GetScriptCommandName ( ScriptCommands  command)
82 {
83  std::string res = "";
84  switch (command)
85  {
86  case SCRIPT_COMMAND_TALK: res = "SCRIPT_COMMAND_TALK"; break;
87  case SCRIPT_COMMAND_EMOTE: res = "SCRIPT_COMMAND_EMOTE"; break;
88  case SCRIPT_COMMAND_FIELD_SET: res = "SCRIPT_COMMAND_FIELD_SET"; break;
89  case SCRIPT_COMMAND_MOVE_TO: res = "SCRIPT_COMMAND_MOVE_TO"; break;
90  case SCRIPT_COMMAND_FLAG_SET: res = "SCRIPT_COMMAND_FLAG_SET"; break;
91  case SCRIPT_COMMAND_FLAG_REMOVE: res = "SCRIPT_COMMAND_FLAG_REMOVE"; break;
92  case SCRIPT_COMMAND_TELEPORT_TO: res = "SCRIPT_COMMAND_TELEPORT_TO"; break;
93  case SCRIPT_COMMAND_QUEST_EXPLORED: res = "SCRIPT_COMMAND_QUEST_EXPLORED"; break;
94  case SCRIPT_COMMAND_KILL_CREDIT: res = "SCRIPT_COMMAND_KILL_CREDIT"; break;
95  case SCRIPT_COMMAND_RESPAWN_GAMEOBJECT: res = "SCRIPT_COMMAND_RESPAWN_GAMEOBJECT"; break;
96  case SCRIPT_COMMAND_TEMP_SUMMON_CREATURE: res = "SCRIPT_COMMAND_TEMP_SUMMON_CREATURE"; break;
97  case SCRIPT_COMMAND_OPEN_DOOR: res = "SCRIPT_COMMAND_OPEN_DOOR"; break;
98  case SCRIPT_COMMAND_CLOSE_DOOR: res = "SCRIPT_COMMAND_CLOSE_DOOR"; break;
99  case SCRIPT_COMMAND_ACTIVATE_OBJECT: res = "SCRIPT_COMMAND_ACTIVATE_OBJECT"; break;
100  case SCRIPT_COMMAND_REMOVE_AURA: res = "SCRIPT_COMMAND_REMOVE_AURA"; break;
101  case SCRIPT_COMMAND_CAST_SPELL: res = "SCRIPT_COMMAND_CAST_SPELL"; break;
102  case SCRIPT_COMMAND_PLAY_SOUND: res = "SCRIPT_COMMAND_PLAY_SOUND"; break;
103  case SCRIPT_COMMAND_CREATE_ITEM: res = "SCRIPT_COMMAND_CREATE_ITEM"; break;
104  case SCRIPT_COMMAND_DESPAWN_SELF: res = "SCRIPT_COMMAND_DESPAWN_SELF"; break;
105  case SCRIPT_COMMAND_LOAD_PATH: res = "SCRIPT_COMMAND_LOAD_PATH"; break;
106  case SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT: res = "SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT"; break;
107  case SCRIPT_COMMAND_KILL: res = "SCRIPT_COMMAND_KILL"; break;
108  // TrinityCore only
109  case SCRIPT_COMMAND_ORIENTATION: res = "SCRIPT_COMMAND_ORIENTATION"; break;
110  case SCRIPT_COMMAND_EQUIP: res = "SCRIPT_COMMAND_EQUIP"; break;
111  case SCRIPT_COMMAND_MODEL: res = "SCRIPT_COMMAND_MODEL"; break;
112  case SCRIPT_COMMAND_CLOSE_GOSSIP: res = "SCRIPT_COMMAND_CLOSE_GOSSIP"; break;
113  case SCRIPT_COMMAND_PLAYMOVIE: res = "SCRIPT_COMMAND_PLAYMOVIE"; break;
114  case SCRIPT_COMMAND_PLAY_ANIMKIT: res = "SCRIPT_COMMAND_PLAY_ANIMKIT"; break;
115  default:
116  {
117  char sz[32];
118  sprintf(sz, "Unknown command: %d", command);
119  res = sz;
120  break;
121  }
122  }
123  return res;
124 }
Definition: ObjectMgr.h:115
Definition: ObjectMgr.h:97
Definition: ObjectMgr.h:108
Definition: ObjectMgr.h:96
Definition: ObjectMgr.h:95
Definition: ObjectMgr.h:94
Definition: ObjectMgr.h:89
Definition: ObjectMgr.h:103
Definition: ObjectMgr.h:106
Definition: ObjectMgr.h:101
Definition: ObjectMgr.h:90
Definition: ObjectMgr.h:113
Definition: ObjectMgr.h:87
Definition: ObjectMgr.h:91
Definition: ObjectMgr.h:107
Definition: ObjectMgr.h:86
Definition: ObjectMgr.h:102
std::string sprintf(CStringRef format, ArgList args)
Definition: format.h:3096
Definition: ObjectMgr.h:92
Definition: ObjectMgr.h:112
Definition: ObjectMgr.h:100
Definition: ObjectMgr.h:98
Definition: ObjectMgr.h:116
Definition: ObjectMgr.h:99
Definition: ObjectMgr.h:104
Definition: ObjectMgr.h:93
Definition: ObjectMgr.h:114
Definition: ObjectMgr.h:111
Definition: ObjectMgr.h:88

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ScriptMapMap* GetScriptsMapByType ( ScriptsType  type)
69 {
70  ScriptMapMap* res = NULL;
71  switch (type)
72  {
73  case SCRIPTS_SPELL: res = &sSpellScripts; break;
74  case SCRIPTS_EVENT: res = &sEventScripts; break;
75  case SCRIPTS_WAYPOINT: res = &sWaypointScripts; break;
76  default: break;
77  }
78  return res;
79 }
ScriptMapMap sSpellScripts
Definition: ObjectMgr.cpp:51
Definition: ObjectMgr.h:142
std::map< uint32, ScriptMap > ScriptMapMap
Definition: ObjectMgr.h:376
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: ObjectMgr.h:144
ScriptMapMap sEventScripts
Definition: ObjectMgr.cpp:52
ScriptMapMap sWaypointScripts
Definition: ObjectMgr.cpp:53
Definition: ObjectMgr.h:143

+ Here is the caller graph for this function:

std::string GetScriptsTableNameByType ( ScriptsType  type)
56 {
57  std::string res = "";
58  switch (type)
59  {
60  case SCRIPTS_SPELL: res = "spell_scripts"; break;
61  case SCRIPTS_EVENT: res = "event_scripts"; break;
62  case SCRIPTS_WAYPOINT: res = "waypoint_scripts"; break;
63  default: break;
64  }
65  return res;
66 }
Definition: ObjectMgr.h:142
Definition: ObjectMgr.h:144
Definition: ObjectMgr.h:143

+ Here is the caller graph for this function:

SkillRangeType GetSkillRangeType ( SkillRaceClassInfoEntry const rcEntry)
7873 {
7874  SkillLineEntry const* skill = sSkillLineStore.LookupEntry(rcEntry->SkillID);
7875  if (!skill)
7876  return SKILL_RANGE_NONE;
7877 
7878  if (sObjectMgr->GetSkillTier(rcEntry->SkillTierID))
7879  return SKILL_RANGE_RANK;
7880 
7881  if (rcEntry->SkillID == SKILL_RUNEFORGING || rcEntry->SkillID == SKILL_RUNEFORGING_2)
7882  return SKILL_RANGE_MONO;
7883 
7884  switch (skill->CategoryID)
7885  {
7886  case SKILL_CATEGORY_ARMOR:
7887  return SKILL_RANGE_MONO;
7889  return SKILL_RANGE_LANGUAGE;
7890  }
7891 
7892  return SKILL_RANGE_LEVEL;
7893 }
Definition: DBCStructure.h:952
Definition: ObjectMgr.h:627
DBCStorage< SkillLineEntry > sSkillLineStore(SkillLinefmt)
Definition: ObjectMgr.h:631
#define sObjectMgr
Definition: ObjectMgr.h:1567
Definition: SharedDefines.h:4150
Definition: SharedDefines.h:4148
Definition: ObjectMgr.h:629
Definition: SharedDefines.h:4075
int32 CategoryID
Definition: DBCStructure.h:955
Definition: ObjectMgr.h:628
Definition: SharedDefines.h:4023
Definition: ObjectMgr.h:630
bool isValidString ( const std::wstring &  wstr,
uint32  strictMask,
bool  numericOrSpace,
bool  create = false 
)
7545 {
7546  if (strictMask == 0) // any language, ignore realm
7547  {
7548  if (isExtendedLatinString(wstr, numericOrSpace))
7549  return true;
7550  if (isCyrillicString(wstr, numericOrSpace))
7551  return true;
7552  if (isEastAsianString(wstr, numericOrSpace))
7553  return true;
7554  return false;
7555  }
7556 
7557  if (strictMask & 0x2) // realm zone specific
7558  {
7559  LanguageType lt = GetRealmLanguageType(create);
7560  if (lt & LT_EXTENDEN_LATIN)
7561  if (isExtendedLatinString(wstr, numericOrSpace))
7562  return true;
7563  if (lt & LT_CYRILLIC)
7564  if (isCyrillicString(wstr, numericOrSpace))
7565  return true;
7566  if (lt & LT_EAST_ASIA)
7567  if (isEastAsianString(wstr, numericOrSpace))
7568  return true;
7569  }
7570 
7571  if (strictMask & 0x1) // basic Latin
7572  {
7573  if (isBasicLatinString(wstr, numericOrSpace))
7574  return true;
7575  }
7576 
7577  return false;
7578 }
Definition: ObjectMgr.cpp:7511
LanguageType
Definition: ObjectMgr.cpp:7507
Definition: ObjectMgr.cpp:7512
bool isCyrillicString(const std::wstring &wstr, bool numericOrSpace)
Definition: Util.h:234
Definition: ObjectMgr.cpp:7510
bool isBasicLatinString(const std::wstring &wstr, bool numericOrSpace)
Definition: Util.h:218
bool isEastAsianString(const std::wstring &wstr, bool numericOrSpace)
Definition: Util.h:242
bool isExtendedLatinString(const std::wstring &wstr, bool numericOrSpace)
Definition: Util.h:226
static LanguageType GetRealmLanguageType(bool create)
Definition: ObjectMgr.cpp:7516

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool normalizePlayerName ( std::string &  name)
134 {
135  if (name.empty())
136  return false;
137 
138  wchar_t wstr_buf[MAX_INTERNAL_PLAYER_NAME+1];
139  size_t wstr_len = MAX_INTERNAL_PLAYER_NAME;
140 
141  if (!Utf8toWStr(name, &wstr_buf[0], wstr_len))
142  return false;
143 
144  wstr_buf[0] = wcharToUpper(wstr_buf[0]);
145  for (size_t i = 1; i < wstr_len; ++i)
146  wstr_buf[i] = wcharToLower(wstr_buf[i]);
147 
148  if (!WStrToUtf8(wstr_buf, wstr_len, name))
149  return false;
150 
151  return true;
152 }
bool Utf8toWStr(char const *utf8str, size_t csize, wchar_t *wstr, size_t &wsize)
Definition: Util.cpp:281
bool WStrToUtf8(wchar_t *wstr, size_t size, std::string &utf8str)
Definition: Util.cpp:328
#define MAX_INTERNAL_PLAYER_NAME
Definition: ObjectMgr.h:645
wchar_t wcharToLower(wchar_t wchar)
Definition: Util.h:278
wchar_t wcharToUpper(wchar_t wchar)
Definition: Util.h:250

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

LanguageDesc lang_description[LANGUAGES_COUNT]
Initial value:
=
{
{ LANG_ADDON, 0, 0 },
{ LANG_UNIVERSAL, 0, 0 },
{ LANG_ZOMBIE, 0, 0 },
{ LANG_GOBLIN_BINARY, 0, 0 },
}
Definition: SharedDefines.h:966
Definition: SharedDefines.h:983
Definition: SharedDefines.h:3906
Definition: SharedDefines.h:961
Definition: SharedDefines.h:964
Definition: SharedDefines.h:967
Definition: SharedDefines.h:3918
Definition: SharedDefines.h:4064
Definition: SharedDefines.h:4038
Definition: SharedDefines.h:3903
Definition: SharedDefines.h:982
Definition: SharedDefines.h:3915
Definition: SharedDefines.h:3914
Definition: SharedDefines.h:4066
Definition: SharedDefines.h:3901
Definition: SharedDefines.h:3904
Definition: SharedDefines.h:980
Definition: SharedDefines.h:975
Definition: SharedDefines.h:3971
Definition: SharedDefines.h:962
Definition: SharedDefines.h:979
Definition: SharedDefines.h:972
Definition: SharedDefines.h:981
Definition: SharedDefines.h:3905
Definition: SharedDefines.h:3972
Definition: SharedDefines.h:965
Definition: SharedDefines.h:4007
Definition: SharedDefines.h:977
Definition: SharedDefines.h:970
Definition: SharedDefines.h:976
Definition: SharedDefines.h:969
Definition: SharedDefines.h:971
Definition: SharedDefines.h:963
Definition: SharedDefines.h:3917
Definition: SharedDefines.h:4065
Definition: SharedDefines.h:974
Definition: SharedDefines.h:4037
Definition: SharedDefines.h:973
Definition: SharedDefines.h:968
Definition: SharedDefines.h:3999
Definition: SharedDefines.h:985
Definition: SharedDefines.h:3916
Definition: SharedDefines.h:978
ScriptMapMap sEventScripts
ScriptMapMap sSpellScripts
ScriptMapMap sWaypointScripts