AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
ObjectMgr.h File Reference
#include "Bag.h"
#include "ConditionMgr.h"
#include "Creature.h"
#include "DatabaseEnv.h"
#include "GameObject.h"
#include "ItemTemplate.h"
#include "Log.h"
#include "Mail.h"
#include "Map.h"
#include "NPCHandler.h"
#include "Object.h"
#include "ObjectAccessor.h"
#include "ObjectDefines.h"
#include "QuestDef.h"
#include "TemporarySummon.h"
#include "VehicleDefines.h"
#include <functional>
#include <limits>
#include <map>
#include <string>

Go to the source code of this file.

Classes

struct  PageText
 
struct  TempSummonGroupKey
 Key for storing temp summon data in TempSummonDataContainer. More...
 
struct  GameTele
 
struct  ScriptInfo
 
struct  SpellClickInfo
 
struct  AreaTriggerTeleport
 
struct  AreaTrigger
 
struct  BroadcastText
 
struct  CellObjectGuids
 
struct  ModuleString
 
struct  AcoreString
 
struct  PetLevelInfo
 
struct  MailLevelReward
 
struct  RepRewardRate
 
struct  ReputationOnKillEntry
 
struct  RepSpilloverTemplate
 
struct  PointOfInterest
 
struct  QuestGreeting
 
struct  GossipMenuItems
 
struct  GossipMenus
 
struct  QuestPOIPoint
 
struct  QuestPOI
 
struct  LanguageDesc
 
struct  DungeonEncounter
 
class  ObjectMgr
 
struct  ObjectMgr::GameobjectInstanceSavedState
 

Macros

#define MIN_ACORE_STRING_ID   1
 
#define MAX_ACORE_STRING_ID   2000000000
 
#define MIN_CREATURE_AI_TEXT_STRING_ID   (-1)
 
#define MAX_CREATURE_AI_TEXT_STRING_ID   (-1000000)
 
#define ACORE_TRAINER_START_REF   200000
 
#define MAX_PLAYER_NAME   12
 
#define MAX_INTERNAL_PLAYER_NAME   15
 
#define MAX_PET_NAME   12
 
#define MAX_CHARTER_NAME   24
 
#define MAX_CHANNEL_NAME   50
 
#define sObjectMgr   ObjectMgr::instance()
 

Typedefs

typedef std::map< uint32, PageTextPageTextContainer
 
typedef std::unordered_map< uint16, InstanceTemplateInstanceTemplateContainer
 
typedef std::unordered_map< uint32, GameTeleGameTeleContainer
 
typedef std::multimap< uint32, ScriptInfoScriptMap
 
typedef std::map< uint32, ScriptMapScriptMapMap
 
typedef std::multimap< uint32, uint32SpellScriptsContainer
 
typedef std::pair< SpellScriptsContainer::iterator, SpellScriptsContainer::iterator > SpellScriptsBounds
 
typedef std::multimap< uint32, SpellClickInfoSpellClickInfoContainer
 
typedef std::pair< SpellClickInfoContainer::const_iterator, SpellClickInfoContainer::const_iterator > SpellClickInfoMapBounds
 
typedef std::unordered_map< uint32, BroadcastTextBroadcastTextContainer
 
typedef std::set< ObjectGuid::LowTypeCellGuidSet
 
typedef std::unordered_map< uint32, CellObjectGuidsCellObjectGuidsMap
 
typedef std::unordered_map< uint32, CellObjectGuidsMapMapObjectGuids
 
typedef std::map< ObjectGuid, ObjectGuidLinkedRespawnContainer
 
typedef std::unordered_map< ObjectGuid::LowType, CreatureDataCreatureDataContainer
 
typedef std::unordered_map< ObjectGuid::LowType, GameObjectDataGameObjectDataContainer
 
typedef std::map< TempSummonGroupKey, std::vector< TempSummonData > > TempSummonDataContainer
 
typedef std::unordered_map< uint32, CreatureLocaleCreatureLocaleContainer
 
typedef std::unordered_map< uint32, GameObjectLocaleGameObjectLocaleContainer
 
typedef std::unordered_map< uint32, ItemLocaleItemLocaleContainer
 
typedef std::unordered_map< uint32, ItemSetNameLocaleItemSetNameLocaleContainer
 
typedef std::unordered_map< uint32, QuestLocaleQuestLocaleContainer
 
typedef std::unordered_map< uint32, QuestOfferRewardLocaleQuestOfferRewardLocaleContainer
 
typedef std::unordered_map< uint32, QuestRequestItemsLocaleQuestRequestItemsLocaleContainer
 
typedef std::unordered_map< uint32, NpcTextLocaleNpcTextLocaleContainer
 
typedef std::unordered_map< uint32, PageTextLocalePageTextLocaleContainer
 
typedef std::map< std::pair< std::string, uint32 >, ModuleStringModuleStringContainer
 
typedef std::unordered_map< int32, AcoreStringAcoreStringContainer
 
typedef std::unordered_map< uint32, GossipMenuItemsLocaleGossipMenuItemsLocaleContainer
 
typedef std::unordered_map< uint32, PointOfInterestLocalePointOfInterestLocaleContainer
 
typedef std::unordered_map< uint32, VehicleSeatAddonVehicleSeatAddonContainer
 
typedef std::multimap< uint32, uint32QuestRelations
 
typedef std::pair< QuestRelations::const_iterator, QuestRelations::const_iterator > QuestRelationBounds
 
typedef std::list< MailLevelRewardMailLevelRewardList
 
typedef std::unordered_map< uint8, MailLevelRewardListMailLevelRewardContainer
 
typedef std::multimap< uint32, GossipMenusGossipMenusContainer
 
typedef std::pair< GossipMenusContainer::const_iterator, GossipMenusContainer::const_iterator > GossipMenusMapBounds
 
typedef std::pair< GossipMenusContainer::iterator, GossipMenusContainer::iterator > GossipMenusMapBoundsNonConst
 
typedef std::multimap< uint32, GossipMenuItemsGossipMenuItemsContainer
 
typedef std::pair< GossipMenuItemsContainer::const_iterator, GossipMenuItemsContainer::const_iterator > GossipMenuItemsMapBounds
 
typedef std::pair< GossipMenuItemsContainer::iterator, GossipMenuItemsContainer::iterator > GossipMenuItemsMapBoundsNonConst
 
typedef std::vector< QuestPOIQuestPOIVector
 
typedef std::unordered_map< uint32, QuestPOIVectorQuestPOIContainer
 
typedef std::map< std::pair< uint32, uint8 >, QuestGreetingQuestGreetingContainer
 
typedef std::unordered_map< uint32, VendorItemDataCacheVendorItemContainer
 
typedef std::unordered_map< uint32, TrainerSpellDataCacheTrainerSpellContainer
 
typedef std::unordered_map< uint32, ServerMailServerMailContainer
 
typedef std::vector< uint32CreatureCustomIDsContainer
 
typedef std::list< DungeonEncounter const * > DungeonEncounterList
 
typedef std::unordered_map< uint32, DungeonEncounterListDungeonEncounterContainer
 
typedef std::array< uint32, MAX_QUEST_MONEY_REWARDSQuestMoneyRewardArray
 
typedef std::unordered_map< uint32, QuestMoneyRewardArrayQuestMoneyRewardStore
 

Enumerations

enum  ScriptCommands {
  SCRIPT_COMMAND_TALK = 0 ,
  SCRIPT_COMMAND_EMOTE = 1 ,
  SCRIPT_COMMAND_FIELD_SET = 2 ,
  SCRIPT_COMMAND_MOVE_TO = 3 ,
  SCRIPT_COMMAND_FLAG_SET = 4 ,
  SCRIPT_COMMAND_FLAG_REMOVE = 5 ,
  SCRIPT_COMMAND_TELEPORT_TO = 6 ,
  SCRIPT_COMMAND_QUEST_EXPLORED = 7 ,
  SCRIPT_COMMAND_KILL_CREDIT = 8 ,
  SCRIPT_COMMAND_RESPAWN_GAMEOBJECT = 9 ,
  SCRIPT_COMMAND_TEMP_SUMMON_CREATURE = 10 ,
  SCRIPT_COMMAND_OPEN_DOOR = 11 ,
  SCRIPT_COMMAND_CLOSE_DOOR = 12 ,
  SCRIPT_COMMAND_ACTIVATE_OBJECT = 13 ,
  SCRIPT_COMMAND_REMOVE_AURA = 14 ,
  SCRIPT_COMMAND_CAST_SPELL = 15 ,
  SCRIPT_COMMAND_PLAY_SOUND = 16 ,
  SCRIPT_COMMAND_CREATE_ITEM = 17 ,
  SCRIPT_COMMAND_DESPAWN_SELF = 18 ,
  SCRIPT_COMMAND_LOAD_PATH = 20 ,
  SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT = 21 ,
  SCRIPT_COMMAND_KILL = 22 ,
  SCRIPT_COMMAND_ORIENTATION = 30 ,
  SCRIPT_COMMAND_EQUIP = 31 ,
  SCRIPT_COMMAND_MODEL = 32 ,
  SCRIPT_COMMAND_CLOSE_GOSSIP = 33 ,
  SCRIPT_COMMAND_PLAYMOVIE = 34 ,
  SCRIPT_COMMAND_MOVEMENT = 35
}
 
enum  ScriptsType {
  SCRIPTS_FIRST = 1 ,
  SCRIPTS_SPELL = SCRIPTS_FIRST ,
  SCRIPTS_EVENT ,
  SCRIPTS_WAYPOINT ,
  SCRIPTS_LAST
}
 
enum  eScriptFlags {
  SF_TALK_USE_PLAYER = 0x1 ,
  SF_EMOTE_USE_STATE = 0x1 ,
  SF_TELEPORT_USE_CREATURE = 0x1 ,
  SF_KILLCREDIT_REWARD_GROUP = 0x1 ,
  SF_REMOVEAURA_REVERSE = 0x1 ,
  SF_CASTSPELL_SOURCE_TO_TARGET = 0 ,
  SF_CASTSPELL_SOURCE_TO_SOURCE = 1 ,
  SF_CASTSPELL_TARGET_TO_TARGET = 2 ,
  SF_CASTSPELL_TARGET_TO_SOURCE = 3 ,
  SF_CASTSPELL_SEARCH_CREATURE = 4 ,
  SF_CASTSPELL_TRIGGERED = 0x1 ,
  SF_PLAYSOUND_TARGET_PLAYER = 0x1 ,
  SF_PLAYSOUND_DISTANCE_SOUND = 0x2 ,
  SF_ORIENTATION_FACE_TARGET = 0x1
}
 
enum  SkillRangeType {
  SKILL_RANGE_LANGUAGE ,
  SKILL_RANGE_LEVEL ,
  SKILL_RANGE_MONO ,
  SKILL_RANGE_RANK ,
  SKILL_RANGE_NONE
}
 

Functions

std::string GetScriptsTableNameByType (ScriptsType type)
 
ScriptMapMapGetScriptsMapByType (ScriptsType type)
 
std::string GetScriptCommandName (ScriptCommands command)
 
SkillRangeType GetSkillRangeType (SkillRaceClassInfoEntry const *rcEntry)
 
bool normalizePlayerName (std::string &name)
 
LanguageDesc const * GetLanguageDescByID (uint32 lang)
 

Variables

ScriptMapMap sSpellScripts
 
ScriptMapMap sEventScripts
 
ScriptMapMap sWaypointScripts
 
LanguageDesc lang_description [LANGUAGES_COUNT]
 
static constexpr uint32 MAX_QUEST_MONEY_REWARDS = 10
 

Macro Definition Documentation

◆ ACORE_TRAINER_START_REF

#define ACORE_TRAINER_START_REF   200000

◆ MAX_ACORE_STRING_ID

#define MAX_ACORE_STRING_ID   2000000000

◆ MAX_CHANNEL_NAME

#define MAX_CHANNEL_NAME   50

◆ MAX_CHARTER_NAME

#define MAX_CHARTER_NAME   24

◆ MAX_CREATURE_AI_TEXT_STRING_ID

#define MAX_CREATURE_AI_TEXT_STRING_ID   (-1000000)

◆ MAX_INTERNAL_PLAYER_NAME

#define MAX_INTERNAL_PLAYER_NAME   15

◆ MAX_PET_NAME

#define MAX_PET_NAME   12

◆ MAX_PLAYER_NAME

#define MAX_PLAYER_NAME   12

◆ MIN_ACORE_STRING_ID

#define MIN_ACORE_STRING_ID   1

◆ MIN_CREATURE_AI_TEXT_STRING_ID

#define MIN_CREATURE_AI_TEXT_STRING_ID   (-1)

◆ sObjectMgr

#define sObjectMgr   ObjectMgr::instance()

Typedef Documentation

◆ AcoreStringContainer

typedef std::unordered_map<int32, AcoreString> AcoreStringContainer

◆ BroadcastTextContainer

typedef std::unordered_map<uint32, BroadcastText> BroadcastTextContainer

◆ CacheTrainerSpellContainer

typedef std::unordered_map<uint32, TrainerSpellData> CacheTrainerSpellContainer

◆ CacheVendorItemContainer

typedef std::unordered_map<uint32, VendorItemData> CacheVendorItemContainer

◆ CellGuidSet

typedef std::set<ObjectGuid::LowType> CellGuidSet

◆ CellObjectGuidsMap

typedef std::unordered_map<uint32, CellObjectGuids> CellObjectGuidsMap

◆ CreatureCustomIDsContainer

typedef std::vector<uint32> CreatureCustomIDsContainer

◆ CreatureDataContainer

◆ CreatureLocaleContainer

typedef std::unordered_map<uint32, CreatureLocale> CreatureLocaleContainer

◆ DungeonEncounterContainer

◆ DungeonEncounterList

typedef std::list<DungeonEncounter const*> DungeonEncounterList

◆ GameObjectDataContainer

◆ GameObjectLocaleContainer

typedef std::unordered_map<uint32, GameObjectLocale> GameObjectLocaleContainer

◆ GameTeleContainer

typedef std::unordered_map<uint32, GameTele > GameTeleContainer

◆ GossipMenuItemsContainer

◆ GossipMenuItemsLocaleContainer

◆ GossipMenuItemsMapBounds

typedef std::pair<GossipMenuItemsContainer::const_iterator, GossipMenuItemsContainer::const_iterator> GossipMenuItemsMapBounds

◆ GossipMenuItemsMapBoundsNonConst

typedef std::pair<GossipMenuItemsContainer::iterator, GossipMenuItemsContainer::iterator> GossipMenuItemsMapBoundsNonConst

◆ GossipMenusContainer

typedef std::multimap<uint32, GossipMenus> GossipMenusContainer

◆ GossipMenusMapBounds

typedef std::pair<GossipMenusContainer::const_iterator, GossipMenusContainer::const_iterator> GossipMenusMapBounds

◆ GossipMenusMapBoundsNonConst

typedef std::pair<GossipMenusContainer::iterator, GossipMenusContainer::iterator> GossipMenusMapBoundsNonConst

◆ InstanceTemplateContainer

typedef std::unordered_map<uint16, InstanceTemplate> InstanceTemplateContainer

◆ ItemLocaleContainer

typedef std::unordered_map<uint32, ItemLocale> ItemLocaleContainer

◆ ItemSetNameLocaleContainer

typedef std::unordered_map<uint32, ItemSetNameLocale> ItemSetNameLocaleContainer

◆ LinkedRespawnContainer

◆ MailLevelRewardContainer

typedef std::unordered_map<uint8, MailLevelRewardList> MailLevelRewardContainer

◆ MailLevelRewardList

◆ MapObjectGuids

typedef std::unordered_map<uint32, CellObjectGuidsMap> MapObjectGuids

◆ ModuleStringContainer

typedef std::map<std::pair<std::string, uint32>, ModuleString> ModuleStringContainer

◆ NpcTextLocaleContainer

typedef std::unordered_map<uint32, NpcTextLocale> NpcTextLocaleContainer

◆ PageTextContainer

typedef std::map<uint32, PageText> PageTextContainer

◆ PageTextLocaleContainer

typedef std::unordered_map<uint32, PageTextLocale> PageTextLocaleContainer

◆ PointOfInterestLocaleContainer

◆ QuestGreetingContainer

typedef std::map<std::pair<uint32, uint8>, QuestGreeting> QuestGreetingContainer

◆ QuestLocaleContainer

typedef std::unordered_map<uint32, QuestLocale> QuestLocaleContainer

◆ QuestMoneyRewardArray

◆ QuestMoneyRewardStore

typedef std::unordered_map<uint32, QuestMoneyRewardArray> QuestMoneyRewardStore

◆ QuestOfferRewardLocaleContainer

◆ QuestPOIContainer

typedef std::unordered_map<uint32, QuestPOIVector> QuestPOIContainer

◆ QuestPOIVector

typedef std::vector<QuestPOI> QuestPOIVector

◆ QuestRelationBounds

typedef std::pair<QuestRelations::const_iterator, QuestRelations::const_iterator> QuestRelationBounds

◆ QuestRelations

typedef std::multimap<uint32, uint32> QuestRelations

◆ QuestRequestItemsLocaleContainer

◆ ScriptMap

typedef std::multimap<uint32, ScriptInfo> ScriptMap

◆ ScriptMapMap

typedef std::map<uint32, ScriptMap > ScriptMapMap

◆ ServerMailContainer

typedef std::unordered_map<uint32, ServerMail> ServerMailContainer

◆ SpellClickInfoContainer

◆ SpellClickInfoMapBounds

typedef std::pair<SpellClickInfoContainer::const_iterator, SpellClickInfoContainer::const_iterator> SpellClickInfoMapBounds

◆ SpellScriptsBounds

typedef std::pair<SpellScriptsContainer::iterator, SpellScriptsContainer::iterator> SpellScriptsBounds

◆ SpellScriptsContainer

typedef std::multimap<uint32, uint32> SpellScriptsContainer

◆ TempSummonDataContainer

typedef std::map<TempSummonGroupKey, std::vector<TempSummonData> > TempSummonDataContainer

◆ VehicleSeatAddonContainer

typedef std::unordered_map<uint32, VehicleSeatAddon> VehicleSeatAddonContainer

Enumeration Type Documentation

◆ eScriptFlags

Enumerator
SF_TALK_USE_PLAYER 
SF_EMOTE_USE_STATE 
SF_TELEPORT_USE_CREATURE 
SF_KILLCREDIT_REWARD_GROUP 
SF_REMOVEAURA_REVERSE 
SF_CASTSPELL_SOURCE_TO_TARGET 
SF_CASTSPELL_SOURCE_TO_SOURCE 
SF_CASTSPELL_TARGET_TO_TARGET 
SF_CASTSPELL_TARGET_TO_SOURCE 
SF_CASTSPELL_SEARCH_CREATURE 
SF_CASTSPELL_TRIGGERED 
SF_PLAYSOUND_TARGET_PLAYER 
SF_PLAYSOUND_DISTANCE_SOUND 
SF_ORIENTATION_FACE_TARGET 
156{
157 // Talk Flags
158 SF_TALK_USE_PLAYER = 0x1,
159
160 // Emote flags
161 SF_EMOTE_USE_STATE = 0x1,
162
163 // TeleportTo flags
165
166 // KillCredit flags
168
169 // RemoveAura flags
171
172 // CastSpell flags
179
180 // Playsound flags
183
184 // Orientation flags
186};
@ SF_CASTSPELL_SOURCE_TO_SOURCE
Definition: ObjectMgr.h:174
@ SF_CASTSPELL_SOURCE_TO_TARGET
Definition: ObjectMgr.h:173
@ SF_CASTSPELL_TRIGGERED
Definition: ObjectMgr.h:178
@ SF_CASTSPELL_TARGET_TO_SOURCE
Definition: ObjectMgr.h:176
@ SF_REMOVEAURA_REVERSE
Definition: ObjectMgr.h:170
@ SF_PLAYSOUND_DISTANCE_SOUND
Definition: ObjectMgr.h:182
@ SF_TALK_USE_PLAYER
Definition: ObjectMgr.h:158
@ SF_TELEPORT_USE_CREATURE
Definition: ObjectMgr.h:164
@ SF_KILLCREDIT_REWARD_GROUP
Definition: ObjectMgr.h:167
@ SF_PLAYSOUND_TARGET_PLAYER
Definition: ObjectMgr.h:181
@ SF_CASTSPELL_TARGET_TO_TARGET
Definition: ObjectMgr.h:175
@ SF_EMOTE_USE_STATE
Definition: ObjectMgr.h:161
@ SF_CASTSPELL_SEARCH_CREATURE
Definition: ObjectMgr.h:177
@ SF_ORIENTATION_FACE_TARGET
Definition: ObjectMgr.h:185

◆ ScriptCommands

Enumerator
SCRIPT_COMMAND_TALK 
SCRIPT_COMMAND_EMOTE 
SCRIPT_COMMAND_FIELD_SET 
SCRIPT_COMMAND_MOVE_TO 
SCRIPT_COMMAND_FLAG_SET 
SCRIPT_COMMAND_FLAG_REMOVE 
SCRIPT_COMMAND_TELEPORT_TO 
SCRIPT_COMMAND_QUEST_EXPLORED 
SCRIPT_COMMAND_KILL_CREDIT 
SCRIPT_COMMAND_RESPAWN_GAMEOBJECT 
SCRIPT_COMMAND_TEMP_SUMMON_CREATURE 
SCRIPT_COMMAND_OPEN_DOOR 
SCRIPT_COMMAND_CLOSE_DOOR 
SCRIPT_COMMAND_ACTIVATE_OBJECT 
SCRIPT_COMMAND_REMOVE_AURA 
SCRIPT_COMMAND_CAST_SPELL 
SCRIPT_COMMAND_PLAY_SOUND 
SCRIPT_COMMAND_CREATE_ITEM 
SCRIPT_COMMAND_DESPAWN_SELF 
SCRIPT_COMMAND_LOAD_PATH 
SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT 
SCRIPT_COMMAND_KILL 
SCRIPT_COMMAND_ORIENTATION 
SCRIPT_COMMAND_EQUIP 
SCRIPT_COMMAND_MODEL 
SCRIPT_COMMAND_CLOSE_GOSSIP 
SCRIPT_COMMAND_PLAYMOVIE 
SCRIPT_COMMAND_MOVEMENT 
91{
92 SCRIPT_COMMAND_TALK = 0, // source/target = Creature, target = any, datalong = talk type (0=say, 1=whisper, 2=yell, 3=emote text, 4=boss emote text), datalong2 & 1 = player talk (instead of creature), dataint = string_id
93 SCRIPT_COMMAND_EMOTE = 1, // source/target = Creature, datalong = emote id, datalong2 = 0: set emote state; > 0: play emote state
94 SCRIPT_COMMAND_FIELD_SET = 2, // source/target = Creature, datalong = field id, datalog2 = value
95 SCRIPT_COMMAND_MOVE_TO = 3, // source/target = Creature, datalong2 = time to reach, x/y/z = destination
96 SCRIPT_COMMAND_FLAG_SET = 4, // source/target = Creature, datalong = field id, datalog2 = bitmask
97 SCRIPT_COMMAND_FLAG_REMOVE = 5, // source/target = Creature, datalong = field id, datalog2 = bitmask
98 SCRIPT_COMMAND_TELEPORT_TO = 6, // source/target = Creature/Player (see datalong2), datalong = map_id, datalong2 = 0: Player; 1: Creature, x/y/z = destination, o = orientation
99 SCRIPT_COMMAND_QUEST_EXPLORED = 7, // target/source = Player, target/source = GO/Creature, datalong = quest id, datalong2 = distance or 0
100 SCRIPT_COMMAND_KILL_CREDIT = 8, // target/source = Player, datalong = creature entry, datalong2 = 0: personal credit, 1: group credit
101 SCRIPT_COMMAND_RESPAWN_GAMEOBJECT = 9, // source = WorldObject (summoner), datalong = GO guid, datalong2 = despawn delay
102 SCRIPT_COMMAND_TEMP_SUMMON_CREATURE = 10, // source = WorldObject (summoner), datalong = creature entry, datalong2 = despawn delay, x/y/z = summon position, o = orientation
103 SCRIPT_COMMAND_OPEN_DOOR = 11, // source = Unit, datalong = GO guid, datalong2 = reset delay (min 15)
104 SCRIPT_COMMAND_CLOSE_DOOR = 12, // source = Unit, datalong = GO guid, datalong2 = reset delay (min 15)
105 SCRIPT_COMMAND_ACTIVATE_OBJECT = 13, // source = Unit, target = GO
106 SCRIPT_COMMAND_REMOVE_AURA = 14, // source (datalong2 != 0) or target (datalong2 == 0) = Unit, datalong = spell id
107 SCRIPT_COMMAND_CAST_SPELL = 15, // source and/or target = Unit, datalong2 = cast direction (0: s->t 1: s->s 2: t->t 3: t->s 4: s->creature with dataint entry), dataint & 1 = triggered flag
108 SCRIPT_COMMAND_PLAY_SOUND = 16, // source = WorldObject, target = none/Player, datalong = sound id, datalong2 (bitmask: 0/1=anyone/player, 0/2=without/with distance dependency, so 1|2 = 3 is target with distance dependency)
109 SCRIPT_COMMAND_CREATE_ITEM = 17, // target/source = Player, datalong = item entry, datalong2 = amount
110 SCRIPT_COMMAND_DESPAWN_SELF = 18, // target/source = Creature, datalong = despawn delay
111
112 SCRIPT_COMMAND_LOAD_PATH = 20, // source = Unit, datalong = path id, datalong2 = is repeatable
113 SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT = 21, // source = WorldObject (if present used as a search center), datalong = script id, datalong2 = unit lowguid, dataint = script table to use (see ScriptsType)
114 SCRIPT_COMMAND_KILL = 22, // source/target = Creature, dataint = remove corpse attribute
115
116 // AzerothCore only
117 SCRIPT_COMMAND_ORIENTATION = 30, // source = Unit, target (datalong > 0) = Unit, datalong = > 0 turn source to face target, o = orientation
118 SCRIPT_COMMAND_EQUIP = 31, // soucre = Creature, datalong = equipment id
119 SCRIPT_COMMAND_MODEL = 32, // source = Creature, datalong = model id
120 SCRIPT_COMMAND_CLOSE_GOSSIP = 33, // source = Player
121 SCRIPT_COMMAND_PLAYMOVIE = 34, // source = Player, datalong = movie id
122 SCRIPT_COMMAND_MOVEMENT = 35 // soucre = Creature, datalong = MovementType, datalong2 = MovementDistance (wander_distance f.ex.), dataint = pathid
123};
@ SCRIPT_COMMAND_EMOTE
Definition: ObjectMgr.h:93
@ SCRIPT_COMMAND_CREATE_ITEM
Definition: ObjectMgr.h:109
@ SCRIPT_COMMAND_DESPAWN_SELF
Definition: ObjectMgr.h:110
@ SCRIPT_COMMAND_CLOSE_DOOR
Definition: ObjectMgr.h:104
@ SCRIPT_COMMAND_CAST_SPELL
Definition: ObjectMgr.h:107
@ SCRIPT_COMMAND_RESPAWN_GAMEOBJECT
Definition: ObjectMgr.h:101
@ SCRIPT_COMMAND_QUEST_EXPLORED
Definition: ObjectMgr.h:99
@ SCRIPT_COMMAND_ACTIVATE_OBJECT
Definition: ObjectMgr.h:105
@ SCRIPT_COMMAND_TALK
Definition: ObjectMgr.h:92
@ SCRIPT_COMMAND_OPEN_DOOR
Definition: ObjectMgr.h:103
@ SCRIPT_COMMAND_EQUIP
Definition: ObjectMgr.h:118
@ SCRIPT_COMMAND_FIELD_SET
Definition: ObjectMgr.h:94
@ SCRIPT_COMMAND_PLAYMOVIE
Definition: ObjectMgr.h:121
@ SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT
Definition: ObjectMgr.h:113
@ SCRIPT_COMMAND_TELEPORT_TO
Definition: ObjectMgr.h:98
@ SCRIPT_COMMAND_MOVE_TO
Definition: ObjectMgr.h:95
@ SCRIPT_COMMAND_FLAG_SET
Definition: ObjectMgr.h:96
@ SCRIPT_COMMAND_TEMP_SUMMON_CREATURE
Definition: ObjectMgr.h:102
@ SCRIPT_COMMAND_MOVEMENT
Definition: ObjectMgr.h:122
@ SCRIPT_COMMAND_KILL_CREDIT
Definition: ObjectMgr.h:100
@ SCRIPT_COMMAND_KILL
Definition: ObjectMgr.h:114
@ SCRIPT_COMMAND_LOAD_PATH
Definition: ObjectMgr.h:112
@ SCRIPT_COMMAND_ORIENTATION
Definition: ObjectMgr.h:117
@ SCRIPT_COMMAND_PLAY_SOUND
Definition: ObjectMgr.h:108
@ SCRIPT_COMMAND_MODEL
Definition: ObjectMgr.h:119
@ SCRIPT_COMMAND_CLOSE_GOSSIP
Definition: ObjectMgr.h:120
@ SCRIPT_COMMAND_REMOVE_AURA
Definition: ObjectMgr.h:106
@ SCRIPT_COMMAND_FLAG_REMOVE
Definition: ObjectMgr.h:97

◆ ScriptsType

Enumerator
SCRIPTS_FIRST 
SCRIPTS_SPELL 
SCRIPTS_EVENT 
SCRIPTS_WAYPOINT 
SCRIPTS_LAST 
145{
146 SCRIPTS_FIRST = 1,
147
151
153};
@ SCRIPTS_WAYPOINT
Definition: ObjectMgr.h:150
@ SCRIPTS_FIRST
Definition: ObjectMgr.h:146
@ SCRIPTS_EVENT
Definition: ObjectMgr.h:149
@ SCRIPTS_SPELL
Definition: ObjectMgr.h:148
@ SCRIPTS_LAST
Definition: ObjectMgr.h:152

◆ SkillRangeType

Enumerator
SKILL_RANGE_LANGUAGE 
SKILL_RANGE_LEVEL 
SKILL_RANGE_MONO 
SKILL_RANGE_RANK 
SKILL_RANGE_NONE 
671{
672 SKILL_RANGE_LANGUAGE, // 300..300
673 SKILL_RANGE_LEVEL, // 1..max skill for level
674 SKILL_RANGE_MONO, // 1..1, grey monolite bar
675 SKILL_RANGE_RANK, // 1..skill for known rank
676 SKILL_RANGE_NONE, // 0..0 always
677};
@ SKILL_RANGE_MONO
Definition: ObjectMgr.h:674
@ SKILL_RANGE_NONE
Definition: ObjectMgr.h:676
@ SKILL_RANGE_LANGUAGE
Definition: ObjectMgr.h:672
@ SKILL_RANGE_RANK
Definition: ObjectMgr.h:675
@ SKILL_RANGE_LEVEL
Definition: ObjectMgr.h:673

Function Documentation

◆ GetLanguageDescByID()

LanguageDesc const * GetLanguageDescByID ( uint32  lang)
254{
255 for (uint8 i = 0; i < LANGUAGES_COUNT; ++i)
256 {
257 if (uint32(lang_description[i].lang_id) == lang)
258 return &lang_description[i];
259 }
260
261 return nullptr;
262}
std::uint8_t uint8
Definition: Define.h:109
std::uint32_t uint32
Definition: Define.h:107
LanguageDesc lang_description[LANGUAGES_COUNT]
Definition: ObjectMgr.cpp:230
#define LANGUAGES_COUNT
Definition: SharedDefines.h:756

References lang_description, and LANGUAGES_COUNT.

Referenced by WorldSession::HandleMessagechatOpcode(), ObjectMgr::LoadBroadcastTexts(), and CreatureTextMgr::LoadCreatureTexts().

◆ GetScriptCommandName()

std::string GetScriptCommandName ( ScriptCommands  command)
104{
105 std::string res = "";
106 switch (command)
107 {
109 res = "SCRIPT_COMMAND_TALK";
110 break;
112 res = "SCRIPT_COMMAND_EMOTE";
113 break;
115 res = "SCRIPT_COMMAND_FIELD_SET";
116 break;
118 res = "SCRIPT_COMMAND_MOVE_TO";
119 break;
121 res = "SCRIPT_COMMAND_FLAG_SET";
122 break;
124 res = "SCRIPT_COMMAND_FLAG_REMOVE";
125 break;
127 res = "SCRIPT_COMMAND_TELEPORT_TO";
128 break;
130 res = "SCRIPT_COMMAND_QUEST_EXPLORED";
131 break;
133 res = "SCRIPT_COMMAND_KILL_CREDIT";
134 break;
136 res = "SCRIPT_COMMAND_RESPAWN_GAMEOBJECT";
137 break;
139 res = "SCRIPT_COMMAND_TEMP_SUMMON_CREATURE";
140 break;
142 res = "SCRIPT_COMMAND_OPEN_DOOR";
143 break;
145 res = "SCRIPT_COMMAND_CLOSE_DOOR";
146 break;
148 res = "SCRIPT_COMMAND_ACTIVATE_OBJECT";
149 break;
151 res = "SCRIPT_COMMAND_REMOVE_AURA";
152 break;
154 res = "SCRIPT_COMMAND_CAST_SPELL";
155 break;
157 res = "SCRIPT_COMMAND_PLAY_SOUND";
158 break;
160 res = "SCRIPT_COMMAND_CREATE_ITEM";
161 break;
163 res = "SCRIPT_COMMAND_DESPAWN_SELF";
164 break;
166 res = "SCRIPT_COMMAND_LOAD_PATH";
167 break;
169 res = "SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT";
170 break;
172 res = "SCRIPT_COMMAND_KILL";
173 break;
174 // AzerothCore only
176 res = "SCRIPT_COMMAND_ORIENTATION";
177 break;
179 res = "SCRIPT_COMMAND_EQUIP";
180 break;
182 res = "SCRIPT_COMMAND_MODEL";
183 break;
185 res = "SCRIPT_COMMAND_CLOSE_GOSSIP";
186 break;
188 res = "SCRIPT_COMMAND_PLAYMOVIE";
189 break;
190 default:
191 {
192 char sz[32];
193 snprintf(sz, sizeof(sz), "Unknown command: %d", command);
194 res = sz;
195 break;
196 }
197 }
198 return res;
199}

References SCRIPT_COMMAND_ACTIVATE_OBJECT, SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT, SCRIPT_COMMAND_CAST_SPELL, SCRIPT_COMMAND_CLOSE_DOOR, SCRIPT_COMMAND_CLOSE_GOSSIP, SCRIPT_COMMAND_CREATE_ITEM, SCRIPT_COMMAND_DESPAWN_SELF, SCRIPT_COMMAND_EMOTE, SCRIPT_COMMAND_EQUIP, SCRIPT_COMMAND_FIELD_SET, SCRIPT_COMMAND_FLAG_REMOVE, SCRIPT_COMMAND_FLAG_SET, SCRIPT_COMMAND_KILL, SCRIPT_COMMAND_KILL_CREDIT, SCRIPT_COMMAND_LOAD_PATH, SCRIPT_COMMAND_MODEL, SCRIPT_COMMAND_MOVE_TO, SCRIPT_COMMAND_OPEN_DOOR, SCRIPT_COMMAND_ORIENTATION, SCRIPT_COMMAND_PLAY_SOUND, SCRIPT_COMMAND_PLAYMOVIE, SCRIPT_COMMAND_QUEST_EXPLORED, SCRIPT_COMMAND_REMOVE_AURA, SCRIPT_COMMAND_RESPAWN_GAMEOBJECT, SCRIPT_COMMAND_TALK, SCRIPT_COMMAND_TELEPORT_TO, and SCRIPT_COMMAND_TEMP_SUMMON_CREATURE.

Referenced by ScriptInfo::GetDebugInfo(), and ObjectMgr::LoadScripts().

◆ GetScriptsMapByType()

ScriptMapMap * GetScriptsMapByType ( ScriptsType  type)
84{
85 ScriptMapMap* res = nullptr;
86 switch (type)
87 {
88 case SCRIPTS_SPELL:
89 res = &sSpellScripts;
90 break;
91 case SCRIPTS_EVENT:
92 res = &sEventScripts;
93 break;
95 res = &sWaypointScripts;
96 break;
97 default:
98 break;
99 }
100 return res;
101}
ScriptMapMap sSpellScripts
Definition: ObjectMgr.cpp:59
ScriptMapMap sEventScripts
Definition: ObjectMgr.cpp:60
ScriptMapMap sWaypointScripts
Definition: ObjectMgr.cpp:61
std::map< uint32, ScriptMap > ScriptMapMap
Definition: ObjectMgr.h:384

References SCRIPTS_EVENT, SCRIPTS_SPELL, SCRIPTS_WAYPOINT, sEventScripts, sSpellScripts, and sWaypointScripts.

Referenced by ObjectMgr::LoadScripts(), and Map::ScriptsProcess().

◆ GetScriptsTableNameByType()

std::string GetScriptsTableNameByType ( ScriptsType  type)
64{
65 std::string res = "";
66 switch (type)
67 {
68 case SCRIPTS_SPELL:
69 res = "spell_scripts";
70 break;
71 case SCRIPTS_EVENT:
72 res = "event_scripts";
73 break;
75 res = "waypoint_scripts";
76 break;
77 default:
78 break;
79 }
80 return res;
81}

References SCRIPTS_EVENT, SCRIPTS_SPELL, and SCRIPTS_WAYPOINT.

Referenced by ScriptInfo::GetDebugInfo(), and ObjectMgr::LoadScripts().

◆ GetSkillRangeType()

SkillRangeType GetSkillRangeType ( SkillRaceClassInfoEntry const *  rcEntry)
8864{
8865 SkillLineEntry const* skill = sSkillLineStore.LookupEntry(rcEntry->SkillID);
8866 if (!skill)
8867 {
8868 return SKILL_RANGE_NONE;
8869 }
8870
8871 if (sSkillTiersStore.LookupEntry(rcEntry->SkillTierID))
8872 {
8873 return SKILL_RANGE_RANK;
8874 }
8875
8876 if (rcEntry->SkillID == SKILL_RUNEFORGING)
8877 {
8878 return SKILL_RANGE_MONO;
8879 }
8880
8881 switch (skill->categoryId)
8882 {
8884 return SKILL_RANGE_MONO;
8886 return SKILL_RANGE_LANGUAGE;
8887 }
8888
8889 return SKILL_RANGE_LEVEL;
8890}
DBCStorage< SkillTiersEntry > sSkillTiersStore(SkillTiersfmt)
DBCStorage< SkillLineEntry > sSkillLineStore(SkillLinefmt)
@ SKILL_CATEGORY_ARMOR
Definition: SharedDefines.h:3075
@ SKILL_CATEGORY_LANGUAGES
Definition: SharedDefines.h:3077
@ SKILL_RUNEFORGING
Definition: SharedDefines.h:3004
Definition: DBCStructure.h:1582
int32 categoryId
Definition: DBCStructure.h:1584

References SkillLineEntry::categoryId, SKILL_CATEGORY_ARMOR, SKILL_CATEGORY_LANGUAGES, SKILL_RANGE_LANGUAGE, SKILL_RANGE_LEVEL, SKILL_RANGE_MONO, SKILL_RANGE_NONE, SKILL_RANGE_RANK, SKILL_RUNEFORGING, SkillRaceClassInfoEntry::SkillID, SkillRaceClassInfoEntry::SkillTierID, sSkillLineStore, and sSkillTiersStore.

Referenced by Player::_LoadSkills(), Player::LearnDefaultSkill(), and Player::UpdateSkillsForLevel().

◆ normalizePlayerName()

bool normalizePlayerName ( std::string &  name)
209{
210 if (name.empty())
211 return false;
212
213 if (name.find(" ") != std::string::npos)
214 return false;
215
216 std::wstring tmp;
217 if (!Utf8toWStr(name, tmp))
218 return false;
219
220 wstrToLower(tmp);
221 if (!tmp.empty())
222 tmp[0] = wcharToUpper(tmp[0]);
223
224 if (!WStrToUtf8(tmp, name))
225 return false;
226
227 return true;
228}
bool Utf8toWStr(char const *utf8str, std::size_t csize, wchar_t *wstr, std::size_t &wsize)
Definition: Util.cpp:281
bool WStrToUtf8(wchar_t const *wstr, std::size_t size, std::string &utf8str)
Definition: Util.cpp:333
void wstrToLower(std::wstring &str)
Definition: Util.cpp:382
wchar_t wcharToUpper(wchar_t wchar)
Definition: Util.h:278

References Utf8toWStr(), wcharToUpper(), wstrToLower(), and WStrToUtf8().

Referenced by ChatHandler::extractLowGuidFromLink(), ChatHandler::extractPlayerNameFromLink(), PlayerNameMapHolder::Find(), character_commandscript::GetDeletedCharacterInfoList(), ChatHandler::GetPlayerGroupAndGUIDByName(), WorldSession::HandleAddFriendOpcode(), WorldSession::HandleAddIgnoreOpcode(), WorldSession::HandleArenaTeamInviteOpcode(), WorldSession::HandleArenaTeamLeaderOpcode(), WorldSession::HandleArenaTeamRemoveOpcode(), ban_commandscript::HandleBanCharacterCommand(), ban_commandscript::HandleBanHelper(), WorldSession::HandleChannelBan(), WorldSession::HandleChannelInvite(), WorldSession::HandleChannelKick(), WorldSession::HandleChannelModerator(), WorldSession::HandleChannelMute(), WorldSession::HandleChannelSetOwner(), WorldSession::HandleChannelUnban(), WorldSession::HandleChannelUnmoderator(), WorldSession::HandleChannelUnmute(), character_commandscript::HandleCharacterRenameCommand(), WorldSession::HandleCharCreateOpcode(), WorldSession::HandleCharCustomizeCallback(), WorldSession::HandleCharFactionOrRaceChangeCallback(), WorldSession::HandleCharRenameOpcode(), deserter_commandscript::HandleDeserterAdd(), ticket_commandscript::HandleGMTicketAssignToCommand(), ticket_commandscript::HandleGMTicketGetByNameCommand(), WorldSession::HandleGroupInviteOpcode(), WorldSession::HandleGroupSwapSubGroupOpcode(), WorldSession::HandleGroupUninviteOpcode(), WorldSession::HandleGuildDemoteOpcode(), WorldSession::HandleGuildInviteOpcode(), WorldSession::HandleGuildLeaderOpcode(), WorldSession::HandleGuildPromoteOpcode(), WorldSession::HandleGuildRemoveOpcode(), WorldSession::HandleGuildSetOfficerNoteOpcode(), WorldSession::HandleGuildSetPublicNoteOpcode(), WorldSession::HandleMessagechatOpcode(), WorldSession::HandleSendMail(), WorldSession::HandleSetPlayerDeclinedNames(), ban_commandscript::HandleUnBanCharacterCommand(), ban_commandscript::HandleUnBanHelper(), message_commandscript::HandleWhispersCommand(), WorldSession::HandleWhoisOpcode(), PlayerDumpReader::LoadDump(), Acore::ChatCommands::PlayerIdentifier::TryConsume(), and character_commandscript::ValidatePDumpTarget().

Variable Documentation

◆ lang_description

◆ MAX_QUEST_MONEY_REWARDS

constexpr uint32 MAX_QUEST_MONEY_REWARDS = 10
staticconstexpr

◆ sEventScripts

◆ sSpellScripts

◆ sWaypointScripts