OregonCore  revision fb2a440-git
Your Favourite TBC server
ObjectMgr.h
Go to the documentation of this file.
1 /*
2  * This file is part of the OregonCore Project. See AUTHORS file for Copyright information
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation; either version 2 of the License, or (at your
7  * option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef _OBJECTMGR_H
19 #define _OBJECTMGR_H
20 
21 #include "Log.h"
22 #include "Object.h"
23 #include "Bag.h"
24 #include "Creature.h"
25 #include "Player.h"
26 #include "DynamicObject.h"
27 #include "GameObject.h"
28 #include "Corpse.h"
29 #include "QuestDef.h"
30 #include "ItemPrototype.h"
31 #include "NPCHandler.h"
32 #include "Database/DatabaseEnv.h"
33 #include "Mail.h"
34 #include "Map.h"
35 #include "ObjectAccessor.h"
36 #include "ObjectGuid.h"
37 #include "Policies/Singleton.h"
38 #include "Database/SQLStorage.h"
39 #include "Path.h"
40 #include "ConditionMgr.h"
41 
42 #include <string>
43 #include <map>
44 #include <limits>
45 #include <tuple>
46 
53 extern SQLStorage sGOStorage;
57 
58 class Group;
59 class Guild;
60 class ArenaTeam;
61 class Item;
62 
63 struct GameTele
64 {
65  float position_x;
66  float position_y;
67  float position_z;
68  float orientation;
70  std::string name;
71  std::wstring wnameLow;
72 };
73 
74 typedef UNORDERED_MAP<uint32, GameTele > GameTeleMap;
75 
78 {
79  TempSummonGroupKey(uint32 summonerEntry, SummonerType summonerType, uint8 group)
80  : _summonerEntry(summonerEntry), _summonerType(summonerType), _summonGroup(group)
81  {
82  }
83 
84  bool operator<(TempSummonGroupKey const& rhs) const
85  {
86  return std::tie(_summonerEntry, _summonerType, _summonGroup) <
87  std::tie(rhs._summonerEntry, rhs._summonerType, rhs._summonGroup);
88  }
89 
90 private:
94 };
95 
97 {
99 
107 
109 };
110 
112 {
113  // Talk Flags
115 
116  // Emote flags
118 
119  // TeleportTo flags
121 
122  // KillCredit flags
124 
125  // RemoveAura flags
127 
128  // CastSpell flags
135 
136  // PlaySound flags
139 
140  // Orientation flags
142 };
143 
145 {
150 
151  union
152  {
153  struct
154  {
155  uint32 nData[3];
156  float fData[4];
157  } Raw;
158 
159  struct // SCRIPT_COMMAND_TALK (0)
160  {
161  uint32 ChatType; // datalong
162  uint32 Flags; // datalong2
163  int32 TextID; // dataint
164  } Talk;
165 
166  struct // SCRIPT_COMMAND_EMOTE (1)
167  {
168  uint32 EmoteID; // datalong
169  uint32 Flags; // datalong2
170  } Emote;
171 
172  struct // SCRIPT_COMMAND_FIELD_SET (2)
173  {
174  uint32 FieldID; // datalong
175  uint32 FieldValue; // datalong2
176  } FieldSet;
177 
178  struct // SCRIPT_COMMAND_MOVE_TO (3)
179  {
180  uint32 Unused1; // datalong
181  uint32 TravelTime; // datalong2
182  int32 Unused2; // dataint
183 
184  float DestX;
185  float DestY;
186  float DestZ;
187  } MoveTo;
188 
189  struct // SCRIPT_COMMAND_FLAG_SET (4)
190  // SCRIPT_COMMAND_FLAG_REMOVE (5)
191  {
192  uint32 FieldID; // datalong
193  uint32 FieldValue; // datalong2
194  } FlagToggle;
195 
196  struct // SCRIPT_COMMAND_TELEPORT_TO (6)
197  {
198  uint32 MapID; // datalong
199  uint32 Flags; // datalong2
200  int32 Unused1; // dataint
201 
202  float DestX;
203  float DestY;
204  float DestZ;
205  float Orientation;
206  } TeleportTo;
207 
208  struct // SCRIPT_COMMAND_QUEST_EXPLORED (7)
209  {
210  uint32 QuestID; // datalong
211  uint32 Distance; // datalong2
212  } QuestExplored;
213 
214  struct // SCRIPT_COMMAND_KILL_CREDIT (8)
215  {
216  uint32 CreatureEntry; // datalong
217  uint32 Flags; // datalong2
218  } KillCredit;
219 
220  struct // SCRIPT_COMMAND_RESPAWN_GAMEOBJECT (9)
221  {
222  uint32 GOGuid; // datalong
223  uint32 DespawnDelay; // datalong2
224  } RespawnGameobject;
225 
226  struct // SCRIPT_COMMAND_TEMP_SUMMON_CREATURE (10)
227  {
228  uint32 CreatureEntry; // datalong
229  uint32 DespawnDelay; // datalong2
230  int32 Unused1; // dataint
231 
232  float PosX;
233  float PosY;
234  float PosZ;
235  float Orientation;
236  } TempSummonCreature;
237 
238  struct // SCRIPT_COMMAND_CLOSE_DOOR (12)
239  // SCRIPT_COMMAND_OPEN_DOOR (11)
240  {
241  uint32 GOGuid; // datalong
242  uint32 ResetDelay; // datalong2
243  } ToggleDoor;
244 
245  // SCRIPT_COMMAND_ACTIVATE_OBJECT (13)
246 
247  struct // SCRIPT_COMMAND_REMOVE_AURA (14)
248  {
249  uint32 SpellID; // datalong
250  uint32 Flags; // datalong2
251  } RemoveAura;
252 
253  struct // SCRIPT_COMMAND_CAST_SPELL (15)
254  {
255  uint32 SpellID; // datalong
256  uint32 Flags; // datalong2
257  int32 CreatureEntry; // dataint
258 
260  } CastSpell;
261 
262  struct // SCRIPT_COMMAND_PLAY_SOUND (16)
263  {
264  uint32 SoundID; // datalong
265  uint32 Flags; // datalong2
266  } PlaySound;
267 
268  struct // SCRIPT_COMMAND_CREATE_ITEM (17)
269  {
270  uint32 ItemEntry; // datalong
271  uint32 Amount; // datalong2
272  } CreateItem;
273 
274  struct // SCRIPT_COMMAND_DESPAWN_SELF (18)
275  {
276  uint32 DespawnDelay; // datalong
277  } DespawnSelf;
278 
279  struct // SCRIPT_COMMAND_LOAD_PATH (20)
280  {
281  uint32 PathID; // datalong
282  uint32 IsRepeatable; // datalong2
283  } LoadPath;
284 
285  struct // SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT (21)
286  {
287  uint32 CreatureEntry; // datalong
288  uint32 ScriptID; // datalong2
289  uint32 ScriptType; // dataint
290  } CallScript;
291 
292  struct // SCRIPT_COMMAND_KILL (22)
293  {
294  uint32 Unused1; // datalong
295  uint32 Unused2; // datalong2
296  int32 RemoveCorpse; // dataint
297  } Kill;
298 
299  struct // SCRIPT_COMMAND_ORIENTATION (30)
300  {
301  uint32 Flags; // datalong
302  uint32 Unused1; // datalong2
303  int32 Unused2; // dataint
304 
305  float Unused3;
306  float Unused4;
307  float Unused5;
308  float Orientation;
309  } Orientation;
310 
311  struct // SCRIPT_COMMAND_EQUIP (31)
312  {
313  uint32 EquipmentID; // datalong
314  } Equip;
315 
316  struct // SCRIPT_COMMAND_MODEL (32)
317  {
318  uint32 ModelID; // datalong
319  } Model;
320 
321  // SCRIPT_COMMAND_CLOSE_GOSSIP (33)
322  };
323 
324  std::string GetDebugInfo() const;
325 };
326 
327 typedef std::multimap<uint32, ScriptInfo> ScriptMap;
328 typedef std::map<uint32, ScriptMap > ScriptMapMap;
336 
337 std::string GetScriptsTableNameByType(ScriptsType type);
339 std::string GetScriptCommandName(ScriptCommands command);
340 
342 {
345  float target_X;
346  float target_Y;
347  float target_Z;
349 };
350 
351 typedef std::set<uint32> CellGuidSet;
352 typedef std::map<uint32/*player guid*/, uint32/*instance*/> CellCorpseSet;
354 {
358 };
360 typedef UNORDERED_MAP<uint32/*(mapid,spawnMode) pair*/, CellObjectGuidsMap> MapObjectGuids;
361 
362 typedef UNORDERED_MAP<uint64/*(instance,guid) pair*/, time_t> RespawnTimes;
363 
364 
365 // Oregon string ranges
366 #define MIN_OREGON_STRING_ID 1 // 'mangos_string'
367 #define MAX_OREGON_STRING_ID 2000000000
368 #define MIN_DB_SCRIPT_STRING_ID MAX_OREGON_STRING_ID // 'db_script_string'
369 #define MAX_DB_SCRIPT_STRING_ID 2000010000
370 #define MIN_CREATURE_AI_TEXT_STRING_ID (-1) // 'creature_ai_texts'
371 #define MAX_CREATURE_AI_TEXT_STRING_ID (-1000000)
372 
374 {
375  std::vector<std::string> Content; // 0 -> default, i -> i-1 locale index
376 };
377 
378 typedef std::map<uint32, uint32> CreatureLinkedRespawnMap;
379 typedef UNORDERED_MAP<uint32, CreatureData> CreatureDataMap;
380 typedef UNORDERED_MAP<uint32, GameObjectData> GameObjectDataMap;
381 typedef UNORDERED_MAP<uint32, CreatureLocale> CreatureLocaleMap;
382 typedef UNORDERED_MAP<uint32, GameObjectLocale> GameObjectLocaleMap;
383 typedef UNORDERED_MAP<uint32, ItemLocale> ItemLocaleMap;
384 typedef UNORDERED_MAP<uint32, QuestLocale> QuestLocaleMap;
385 typedef UNORDERED_MAP<uint32, NpcTextLocale> NpcTextLocaleMap;
386 typedef UNORDERED_MAP<uint32, PageTextLocale> PageTextLocaleMap;
387 typedef UNORDERED_MAP<uint32, OregonStringLocale> OregonStringLocaleMap;
388 typedef UNORDERED_MAP<uint32, GossipMenuItemsLocale> GossipMenuItemsLocaleMap;
389 
390 typedef std::multimap<uint32, uint32> QuestRelations;
391 
393 {
394  PetLevelInfo() : health(0), mana(0), armor(0) { for (uint8 i = 0; i < MAX_STATS; ++i) stats[i] = 0; }
395 
400 };
401 
403 {
413 };
414 
416 {
418  float faction_rate[MAX_SPILLOVER_FACTIONS];
420 };
421 
423 {
427  std::string option_text;
433  bool box_coded;
435  std::string box_text;
437 };
438 
440 {
444 };
445 
446 typedef std::multimap<uint32, GossipMenus> GossipMenusMap;
447 typedef std::pair<GossipMenusMap::const_iterator, GossipMenusMap::const_iterator> GossipMenusMapBounds;
448 typedef std::pair<GossipMenusMap::iterator, GossipMenusMap::iterator> GossipMenusMapBoundsNonConst;
449 typedef std::multimap<uint32, GossipMenuItems> GossipMenuItemsMap;
450 typedef std::pair<GossipMenuItemsMap::const_iterator, GossipMenuItemsMap::const_iterator> GossipMenuItemsMapBounds;
451 typedef std::pair<GossipMenuItemsMap::iterator, GossipMenuItemsMap::iterator> GossipMenuItemsMapBoundsNonConst;
452 
453 typedef std::map<TempSummonGroupKey, std::vector<TempSummonData> > TempSummonDataContainer;
454 
456 {
457  uint32 spellid[4];
458 };
459 
460 #define WEATHER_SEASONS 4
462 {
466 };
467 
469 {
471 };
472 
474 {
477 };
478 typedef std::multimap<uint32, GraveYardData> GraveYardMap;
479 
480 // NPC gossip text id
481 typedef UNORDERED_MAP<uint32, uint32> CacheNpcTextIdMap;
482 
483 typedef UNORDERED_MAP<uint32, VendorItemData> CacheVendorItemMap;
484 typedef UNORDERED_MAP<uint32, TrainerSpellData> CacheTrainerSpellMap;
485 
487 {
488  SKILL_RANGE_LANGUAGE, // 300..300
489  SKILL_RANGE_LEVEL, // 1..max skill for level
490  SKILL_RANGE_MONO, // 1..1, grey monolite bar
491  SKILL_RANGE_RANK, // 1..skill for known rank
492  SKILL_RANGE_NONE, // 0..0 always
493 };
494 
495 SkillRangeType GetSkillRangeType(SkillLineEntry const* pSkill, bool racial);
496 
497 #define MAX_PLAYER_NAME 12 // max allowed by client name length
498 #define MAX_INTERNAL_PLAYER_NAME 15 // max server internal player name length (> MAX_PLAYER_NAME for support declined names)
499 
500 bool normalizePlayerName(std::string& name);
501 
503 {
507 };
508 
511 
512 class PlayerDumpReader;
513 
515 {
516  friend class PlayerDumpReader;
517 
518  public:
519  ObjectMgr();
520  ~ObjectMgr();
521 
522  typedef UNORDERED_MAP<uint32, Item*> ItemMap;
523 
524  typedef std::set< Group* > GroupSet;
525 
526  typedef UNORDERED_MAP<uint32, Guild* > GuildMap;
527 
528  typedef UNORDERED_MAP<uint32, ArenaTeam*> ArenaTeamMap;
529 
530  typedef UNORDERED_MAP<uint32, Quest*> QuestMap;
531 
532  typedef UNORDERED_MAP<uint32, AreaTrigger> AreaTriggerMap;
533 
534  typedef UNORDERED_MAP<uint32, uint32> AreaTriggerScriptMap;
535 
536  typedef UNORDERED_MAP<uint32, AccessRequirement> AccessRequirementMap;
537 
538  // Reputation Related
539  typedef UNORDERED_MAP<uint32, ReputationOnKillEntry> RepOnKillMap;
540  typedef UNORDERED_MAP<uint32, RepSpilloverTemplate> RepSpilloverTemplateMap;
541 
542  typedef UNORDERED_MAP<uint32, WeatherZoneChances> WeatherZoneMap;
543 
544  typedef UNORDERED_MAP<uint32, PetCreateSpellEntry> PetCreateSpellMap;
545 
546  typedef std::vector<std::string> ScriptNameMap;
547 
548  typedef UNORDERED_MAP<uint64, uint64> ReferFriendMap;
549 
550  UNORDERED_MAP<uint32, uint32> TransportEventMap;
551 
552  Player* GetPlayer(const char* name, bool force = false) const
553  {
554  return ObjectAccessor::Instance().FindPlayerByName(name, force);
555  }
556  Player* GetPlayer(uint64 guid, bool force = false) const
557  {
558  return ObjectAccessor::FindPlayer(guid, force);
559  }
560 
561  // Refer-a-Friend
562 
563  // Gets RAFLinkStatus and puts the friend's acc into 'linked'
564  RAFLinkStatus GetRAFLinkStatus (uint64 account, uint64* linked = NULL) const;
566  {
567  return GetRAFLinkStatus(plr->GetSession()->GetAccountId());
568  }
569  RAFLinkStatus GetRAFLinkStatus (uint64 AccOne, uint64 AccTwo) const;
570  RAFLinkStatus GetRAFLinkStatus (const Player* plr1, const Player* plr2) const
571  {
572  return GetRAFLinkStatus(plr1->GetSession()->GetAccountId(), plr2->GetSession()->GetAccountId());
573  }
574  void LinkIntoRAF (uint64 AccReferrer, uint64 AccReferred);
575  void UnlinkFromRAF (uint64 account);
576  Player* GetRAFLinkedBuddyForPlayer(const Player* plr1) const;
577 
579  {
580  return sGOStorage.LookupEntry<GameObjectInfo>(id);
581  }
582 
583  void LoadGameobjectInfo();
584  void AddGameobjectInfo(GameObjectInfo* goinfo);
585 
586  Group* GetGroupByLeader(const uint64& guid) const;
587  void AddGroup(Group* group)
588  {
589  mGroupSet.insert(group);
590  }
591  void RemoveGroup(Group* group)
592  {
593  mGroupSet.erase(group);
594  }
595 
596  Guild* GetGuildByLeader(uint64 const& guid) const;
597  Guild* GetGuildById(const uint32 GuildId) const;
598  Guild* GetGuildByName(const std::string& guildname) const;
599  std::string GetGuildNameById(const uint32 GuildId) const;
600  void AddGuild(Guild* guild);
601  void RemoveGuild(uint32 Id);
602 
603  ArenaTeam* GetArenaTeamById(const uint32 arenateamid) const;
604  ArenaTeam* GetArenaTeamByName(const std::string& arenateamname) const;
605  ArenaTeam* GetArenaTeamByCaptain(uint64 const& guid) const;
606  void AddArenaTeam(ArenaTeam* arenaTeam);
607  void RemoveArenaTeam(uint32 Id);
608  ArenaTeamMap::iterator GetArenaTeamMapBegin()
609  {
610  return mArenaTeamMap.begin();
611  }
612  ArenaTeamMap::iterator GetArenaTeamMapEnd()
613  {
614  return mArenaTeamMap.end();
615  }
616 
617  static CreatureInfo const* GetCreatureTemplate(uint32 id);
618  CreatureModelInfo const* GetCreatureModelInfo(uint32 modelid);
619  CreatureModelInfo const* GetCreatureModelRandomGender(uint32 display_id);
620  uint32 ChooseDisplayId(uint32 team, const CreatureInfo* cinfo, const CreatureData* data = NULL);
621  static void ChooseCreatureFlags(const CreatureInfo *cinfo, uint32& npcflag, uint32& unit_flags, uint32& dynamicflags, const CreatureData *data = NULL);
622  EquipmentInfo const* GetEquipmentInfo(uint32 entry);
623  EquipmentInfoRaw const* GetEquipmentInfoRaw( uint32 entry );
625  {
626  return sCreatureDataAddonStorage.LookupEntry<CreatureDataAddon>(lowguid);
627  }
628 
630  {
631  return sCreatureInfoAddonStorage.LookupEntry<CreatureDataAddon>(entry);
632  }
633 
635  {
636  return sItemStorage.LookupEntry<ItemTemplate>(id);
637  }
638 
640  {
641  return sInstanceTemplate.LookupEntry<InstanceTemplate>(map);
642  }
643 
644  PetLevelInfo const* GetPetLevelInfo(uint32 creature_id, uint32 level) const;
645 
647  {
648  if (class_ >= MAX_CLASSES) return NULL;
649  return &playerClassInfo[class_];
650  }
651  void GetPlayerClassLevelInfo(uint32 class_, uint32 level, PlayerClassLevelInfo* info) const;
652 
653  PlayerInfo const* GetPlayerInfo(uint32 race, uint32 class_) const
654  {
655  if (race >= MAX_RACES) return NULL;
656  if (class_ >= MAX_CLASSES) return NULL;
657  PlayerInfo const* info = &playerInfo[race][class_];
658  if (info->displayId_m == 0 || info->displayId_f == 0) return NULL;
659  return info;
660  }
661  void GetPlayerLevelInfo(uint32 race, uint32 class_, uint32 level, PlayerLevelInfo* info) const;
662 
663  uint64 GetPlayerGUIDByName(std::string name) const;
664  bool GetPlayerNameByGUID(const uint64& guid, std::string& name) const;
665  uint32 GetPlayerTeamByGUID(const uint64& guid) const;
666  uint32 GetPlayerAccountIdByGUID(const uint64& guid) const;
667  uint32 GetPlayerAccountIdByPlayerName(const std::string& name) const;
668 
669  uint32 GetNearestTaxiNode(float x, float y, float z, uint32 mapid);
670  void GetTaxiPath(uint32 source, uint32 destination, uint32& path, uint32& cost);
671  uint16 GetTaxiMount(uint32 id, uint32 team);
672 
673  Quest const* GetQuestTemplate(uint32 quest_id) const
674  {
675  QuestMap::const_iterator itr = mQuestTemplates.find(quest_id);
676  return itr != mQuestTemplates.end() ? itr->second : NULL;
677  }
678  QuestMap const& GetQuestTemplates() const
679  {
680  return mQuestTemplates;
681  }
682 
684  {
685  QuestAreaTriggerMap::const_iterator itr = mQuestAreaTriggerMap.find(Trigger_ID);
686  if (itr != mQuestAreaTriggerMap.end())
687  return itr->second;
688  return 0;
689  }
690  bool IsTavernAreaTrigger(uint32 Trigger_ID) const
691  {
692  return mTavernAreaTriggerSet.count(Trigger_ID) != 0;
693  }
694  bool IsGameObjectForQuests(uint32 entry) const
695  {
696  return mGameObjectForQuestSet.count(entry) != 0;
697  }
698 
700  {
701  BattleMastersMap::const_iterator itr = mBattleMastersMap.find(entry);
702  if (itr != mBattleMastersMap.end())
703  return itr->second;
704  return 2; //BATTLEGROUND_WS - i will not add include only for constant usage!
705  }
706 
707  void AddGossipText(GossipText* pGText);
708  GossipText* GetGossipText(uint32 Text_ID);
709 
710  WorldSafeLocsEntry const* GetDefaultGraveYard(uint32 team);
711  WorldSafeLocsEntry const* GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team);
712  bool AddGraveYardLink(uint32 id, uint32 zone, uint32 team, bool inDB = true);
713  void RemoveGraveYardLink(uint32 id, uint32 zone, uint32 team, bool inDB = false);
714  void LoadGraveyardZones();
715  GraveYardData const* FindGraveYardData(uint32 id, uint32 zone);
716 
717  AreaTrigger const* GetAreaTrigger(uint32 trigger) const
718  {
719  AreaTriggerMap::const_iterator itr = mAreaTriggers.find(trigger);
720  if (itr != mAreaTriggers.end())
721  return &itr->second;
722  return NULL;
723  }
724 
726  {
727  AccessRequirementMap::const_iterator itr = mAccessRequirements.find(requirement);
728  if (itr != mAccessRequirements.end())
729  return &itr->second;
730  return NULL;
731  }
732 
733  AreaTrigger const* GetGoBackTrigger(uint32 Map) const;
734  AreaTrigger const* GetMapEntranceTrigger(uint32 Map) const;
735 
737 
739  {
740  RepOnKillMap::const_iterator itr = mRepOnKill.find(id);
741  if (itr != mRepOnKill.end())
742  return &itr->second;
743  return NULL;
744  }
745 
747  {
748  RepSpilloverTemplateMap::const_iterator itr = m_RepSpilloverTemplateMap.find(factionId);
749  if (itr != m_RepSpilloverTemplateMap.end())
750  return &itr->second;
751 
752  return NULL;
753  }
754 
756  {
757  PetCreateSpellMap::const_iterator itr = mPetCreateSpell.find(id);
758  if (itr != mPetCreateSpell.end())
759  return &itr->second;
760  return NULL;
761  }
762 
763  void LoadGuilds();
764  void LoadArenaTeams();
765  void LoadGroups();
766  void LoadQuests();
768  {
769  LoadGameobjectQuestStarters();
770  LoadGameobjectQuestEnders();
771  LoadCreatureQuestStarters();
772  LoadCreatureQuestEnders();
773  }
774  void LoadGameobjectQuestStarters();
775  void LoadGameobjectQuestEnders();
776  void LoadCreatureQuestStarters();
777  void LoadCreatureQuestEnders();
778 
780  {
781  return &mGOQuestRelations;
782  }
783 
785  {
786  return &mCreatureQuestRelations;
787  }
788 
789  CreatureBaseStats const* GetCreatureClassLvlStats(uint32 level, uint32 unitClass, int32 expansion) const;
790 
795 
796  void LoadGameObjectScripts();
797  void LoadQuestEndScripts();
798  void LoadQuestStartScripts();
799  void LoadEventScripts();
800  void LoadSpellScripts();
801  void LoadGossipScripts();
802  void LoadWaypointScripts();
803  void LoadReferredFriends();
804 
805  void LoadTransportEvents();
806 
807  bool LoadOregonStrings(DatabaseType& db, char const* table, int32 min_value, int32 max_value);
809  {
811  }
812  void LoadDbScriptStrings();
813  void LoadPetCreateSpells();
814  void LoadCreatureLocales();
815  void LoadCreatureTemplates();
816  void LoadTempSummons();
817  void LoadCreatures();
818  void LoadCreatureLinkedRespawn();
819  bool CheckCreatureLinkedRespawn(uint32 guid, uint32 linkedGuid) const;
820  bool SetCreatureLinkedRespawn(uint32 guid, uint32 linkedGuid);
821  void LoadCreatureRespawnTimes();
822  void LoadCreatureAddons();
823  void LoadCreatureClassLevelStats();
824  void LoadCreatureModelInfo();
825  void LoadEquipmentTemplates();
826  void LoadGameObjectLocales();
827  void LoadGameobjects();
828  void LoadGameobjectRespawnTimes();
829  void LoadItemTemplates();
830  void LoadItemLocales();
831  void LoadQuestLocales();
832  void LoadNpcTextLocales();
833  void LoadPageTextLocales();
834  void LoadGossipMenuItemsLocales();
835  void LoadInstanceTemplate();
836 
837  void LoadGossipText();
838 
839  void LoadAreaTriggerTeleports();
840  void LoadAccessRequirements();
841  void LoadQuestAreaTriggers();
842  void LoadAreaTriggerScripts();
843  void LoadTavernAreaTriggers();
844  void LoadBattleMastersEntry();
845  void LoadGameObjectForQuests();
846 
847  void LoadItemTexts();
848  void LoadPageTexts();
849 
850  void LoadPlayerInfo();
851  void LoadPetLevelInfo();
852  void LoadExplorationBaseXP();
853  void LoadPetNames();
854  void LoadPetNumber();
855  void LoadCorpses();
856  void LoadFishingBaseSkillLevel();
857 
858  void LoadReputationOnKill();
859  void LoadReputationSpilloverTemplate();
860 
861  void LoadWeatherZoneChances();
862  void LoadGameTele();
863 
864  void LoadNpcTextId();
865 
866  void LoadGossipMenu();
867  void LoadGossipMenuItems();
868 
869  void LoadVendors();
870  void LoadTrainerSpell();
871 
872  std::string GeneratePetName(uint32 entry);
873  uint32 GetBaseXP(uint32 level);
874 
876  {
877  FishingBaseSkillMap::const_iterator itr = mFishingBaseForArea.find(entry);
878  return itr != mFishingBaseForArea.end() ? itr->second : 0;
879  }
880 
881  void ReturnOrDeleteOldMails(bool serverUp);
882 
883  void SetHighestGuids();
884  uint32 GenerateLowGuid(HighGuid guidhigh);
885  uint32 GenerateAuctionID();
886  uint32 GenerateMailID();
887  uint32 GenerateItemTextID();
888  uint32 GeneratePetNumber();
889  uint32 GenerateArenaTeamId();
890  uint32 GenerateGuildId();
891 
892  uint32 CreateItemText(std::string text);
893  std::string GetItemText(uint32 id)
894  {
895  ItemTextMap::const_iterator itr = mItemTexts.find(id);
896  if (itr != mItemTexts.end())
897  return itr->second;
898  else
899  return "There is no info for this item";
900  }
901 
902  typedef std::multimap<int32, uint32> ExclusiveQuestGroups;
903  ExclusiveQuestGroups mExclusiveQuestGroups;
904 
905 
915  std::vector<TempSummonData> const* GetSummonGroup(uint32 summonerId, SummonerType summonerType, uint8 group) const
916  {
917  TempSummonDataContainer::const_iterator itr = _tempSummonDataStore.find(TempSummonGroupKey(summonerId, summonerType, group));
918  if (itr != _tempSummonDataStore.end())
919  return &itr->second;
920 
921  return NULL;
922  }
923 
925  {
926  WeatherZoneMap::const_iterator itr = mWeatherZoneMap.find(zone_id);
927  if (itr != mWeatherZoneMap.end())
928  return &itr->second;
929  else
930  return NULL;
931  }
932 
933  CellObjectGuids const& GetCellObjectGuids(uint16 mapid, uint8 spawnMode, uint32 cell_id)
934  {
935  return mMapObjectGuids[MAKE_PAIR32(mapid, spawnMode)][cell_id];
936  }
937 
939  {
940  CreatureDataMap::const_iterator itr = mCreatureDataMap.find(guid);
941  if (itr == mCreatureDataMap.end()) return NULL;
942  return &itr->second;
943  }
945  {
946  return mCreatureDataMap[guid];
947  }
948  void DeleteCreatureData(uint32 guid);
950  {
951  CreatureLinkedRespawnMap::const_iterator itr = mCreatureLinkedRespawnMap.find(guid);
952  if (itr == mCreatureLinkedRespawnMap.end()) return 0;
953  return itr->second;
954  }
956  {
957  CreatureLocaleMap::const_iterator itr = mCreatureLocaleMap.find(entry);
958  if (itr == mCreatureLocaleMap.end()) return NULL;
959  return &itr->second;
960  }
962  {
963  GameObjectLocaleMap::const_iterator itr = mGameObjectLocaleMap.find(entry);
964  if (itr == mGameObjectLocaleMap.end()) return NULL;
965  return &itr->second;
966  }
967  ItemLocale const* GetItemLocale(uint32 entry) const
968  {
969  ItemLocaleMap::const_iterator itr = mItemLocaleMap.find(entry);
970  if (itr == mItemLocaleMap.end()) return NULL;
971  return &itr->second;
972  }
973  QuestLocale const* GetQuestLocale(uint32 entry) const
974  {
975  QuestLocaleMap::const_iterator itr = mQuestLocaleMap.find(entry);
976  if (itr == mQuestLocaleMap.end()) return NULL;
977  return &itr->second;
978  }
980  {
981  NpcTextLocaleMap::const_iterator itr = mNpcTextLocaleMap.find(entry);
982  if (itr == mNpcTextLocaleMap.end()) return NULL;
983  return &itr->second;
984  }
986  {
987  PageTextLocaleMap::const_iterator itr = mPageTextLocaleMap.find(entry);
988  if (itr == mPageTextLocaleMap.end()) return NULL;
989  return &itr->second;
990  }
992  {
993  GossipMenuItemsLocaleMap::const_iterator itr = mGossipMenuItemsLocaleMap.find(entry);
994  if (itr == mGossipMenuItemsLocaleMap.end()) return NULL;
995  return &itr->second;
996  }
997 
998  GameObjectData const* GetGOData(uint32 guid) const
999  {
1000  GameObjectDataMap::const_iterator itr = mGameObjectDataMap.find(guid);
1001  if (itr == mGameObjectDataMap.end()) return NULL;
1002  return &itr->second;
1003  }
1005  {
1006  return mGameObjectDataMap[guid];
1007  }
1008  void DeleteGOData(uint32 guid);
1009 
1011  {
1012  OregonStringLocaleMap::const_iterator itr = mOregonStringLocaleMap.find(entry);
1013  if (itr == mOregonStringLocaleMap.end()) return NULL;
1014  return &itr->second;
1015  }
1016  const char* GetOregonString(int32 entry, int locale_idx) const;
1017  const char* GetOregonStringForDBCLocale(int32 entry) const
1018  {
1019  return GetOregonString(entry, DBCLocaleIndex);
1020  }
1022  {
1023  return DBCLocaleIndex;
1024  }
1026  {
1027  DBCLocaleIndex = GetIndexForLocale(LocaleConstant(lang));
1028  }
1029 
1030  void AddCorpseCellData(uint32 mapid, uint32 cellid, uint32 player_guid, uint32 instance);
1031  void DeleteCorpseCellData(uint32 mapid, uint32 cellid, uint32 player_guid);
1032 
1033  time_t GetCreatureRespawnTime(uint32 loguid, uint32 instance)
1034  {
1035  return mCreatureRespawnTimes[MAKE_PAIR64(loguid, instance)];
1036  }
1037  void SaveCreatureRespawnTime(uint32 loguid, uint32 instance, time_t t);
1038  time_t GetGORespawnTime(uint32 loguid, uint32 instance)
1039  {
1040  return mGORespawnTimes[MAKE_PAIR64(loguid, instance)];
1041  }
1042  void SaveGORespawnTime(uint32 loguid, uint32 instance, time_t t);
1043  void DeleteRespawnTimeForInstance(uint32 instance);
1044 
1045  // grid objects
1046  void AddCreatureToGrid(uint32 guid, CreatureData const* data);
1047  void RemoveCreatureFromGrid(uint32 guid, CreatureData const* data);
1048  void AddGameobjectToGrid(uint32 guid, GameObjectData const* data);
1049  void RemoveGameobjectFromGrid(uint32 guid, GameObjectData const* data);
1050  uint32 AddGOData(uint32 entry, uint32 artKit, 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);
1051  uint32 AddCreData(uint32 entry, uint32 team, uint32 map, float x, float y, float z, float o, uint32 spawntimedelay = 0);
1052 
1053  // reserved names
1054  void LoadReservedPlayersNames();
1055  bool IsReservedName(const std::string& name) const
1056  {
1057  return m_ReservedNames.find(name) != m_ReservedNames.end();
1058  }
1059 
1060  // name with valid structure and symbols
1061  static bool IsValidName(const std::string& name, bool create = false);
1062  static bool IsValidCharterName(const std::string& name);
1063  static bool IsValidPetName(const std::string& name);
1064 
1065  static bool CheckDeclinedNames(std::wstring mainpart, DeclinedName const& names);
1066 
1067  int GetIndexForLocale(LocaleConstant loc);
1068  LocaleConstant GetLocaleForIndex(int i);
1069  // guild bank tabs
1071  {
1072  return Index < GUILD_BANK_MAX_TABS ? mGuildBankTabPrice[Index] : 0;
1073  }
1074 
1075  GameTele const* GetGameTele(uint32 id) const
1076  {
1077  GameTeleMap::const_iterator itr = m_GameTeleMap.find(id);
1078  if (itr == m_GameTeleMap.end()) return NULL;
1079  return &itr->second;
1080  }
1081  GameTele const* GetGameTele(const std::string& name) const;
1083  {
1084  return m_GameTeleMap;
1085  }
1086  bool AddGameTele(GameTele& data);
1087  bool DeleteGameTele(const std::string& name);
1088 
1090  {
1091  CacheNpcTextIdMap::const_iterator iter = m_mCacheNpcTextIdMap.find(entry);
1092  if (iter == m_mCacheNpcTextIdMap.end())
1093  return 0;
1094 
1095  return iter->second;
1096  }
1097 
1099  {
1100  CacheTrainerSpellMap::const_iterator iter = m_mCacheTrainerSpellMap.find(entry);
1101  if (iter == m_mCacheTrainerSpellMap.end())
1102  return NULL;
1103 
1104  return &iter->second;
1105  }
1106 
1108  {
1109  CacheVendorItemMap::const_iterator iter = m_mCacheVendorItemMap.find(entry);
1110  if (iter == m_mCacheVendorItemMap.end())
1111  return NULL;
1112 
1113  return &iter->second;
1114  }
1115  void AddVendorItem(uint32 entry, uint32 item, uint32 maxcount, uint32 incrtime, uint32 ExtendedCost, bool savetodb = true); // for event
1116  bool RemoveVendorItem(uint32 entry, uint32 item, bool savetodb = true); // for event
1117  bool IsVendorItemValid(uint32 vendor_entry, uint32 item, uint32 maxcount, uint32 ptime, uint32 ExtendedCost, Player* pl = NULL, std::set<uint32>* skip_vendors = NULL, uint32 ORnpcflag = 0) const;
1118 
1119  void LoadScriptNames();
1120  ScriptNameMap& GetScriptNames()
1121  {
1122  return m_scriptNames;
1123  }
1124  const char* GetScriptName(uint32 id)
1125  {
1126  return id < m_scriptNames.size() ? m_scriptNames[id].c_str() : "";
1127  }
1128  uint32 GetScriptId(const char* name);
1129 
1131  {
1132  return GossipMenusMapBounds(m_mGossipMenusMap.lower_bound(uiMenuId), m_mGossipMenusMap.upper_bound(uiMenuId));
1133  }
1134 
1136  {
1137  return GossipMenusMapBoundsNonConst(m_mGossipMenusMap.lower_bound(uiMenuId),m_mGossipMenusMap.upper_bound(uiMenuId));
1138  }
1139 
1141  {
1142  return GossipMenuItemsMapBounds(m_mGossipMenuItemsMap.lower_bound(uiMenuId), m_mGossipMenuItemsMap.upper_bound(uiMenuId));
1143  }
1144 
1146  {
1147  return GossipMenuItemsMapBoundsNonConst(m_mGossipMenuItemsMap.lower_bound(uiMenuId),m_mGossipMenuItemsMap.upper_bound(uiMenuId));
1148  }
1149 
1150  static void AddLocaleString(std::string const& s, LocaleConstant locale, StringVector& data);
1151  static inline void GetLocaleString(const StringVector& data, int loc_idx, std::string& value)
1152  {
1153  if (data.size() > size_t(loc_idx) && !data[loc_idx].empty())
1154  value = data[loc_idx];
1155  }
1156 
1157  protected:
1158 
1159  // first free id for selected id type
1166 
1167  // first free low guid for seelcted guid type
1175 
1177 
1178  typedef UNORDERED_MAP<uint32, GossipText*> GossipTextMap;
1179  typedef UNORDERED_MAP<uint32, uint32> QuestAreaTriggerMap;
1180  typedef UNORDERED_MAP<uint32, uint32> BattleMastersMap;
1181  typedef UNORDERED_MAP<uint32, std::string> ItemTextMap;
1182  typedef std::set<uint32> TavernAreaTriggerSet;
1183  typedef std::set<uint32> GameObjectForQuestSet;
1184 
1185  GroupSet mGroupSet;
1186  GuildMap mGuildMap;
1187  ArenaTeamMap mArenaTeamMap;
1188 
1189  ItemMap mItems;
1190 
1191  ItemTextMap mItemTexts;
1192 
1193  QuestAreaTriggerMap mQuestAreaTriggerMap;
1194  BattleMastersMap mBattleMastersMap;
1195  TavernAreaTriggerSet mTavernAreaTriggerSet;
1196  GameObjectForQuestSet mGameObjectForQuestSet;
1197  GossipTextMap mGossipText;
1198  AreaTriggerMap mAreaTriggers;
1199  AreaTriggerScriptMap mAreaTriggerScripts;
1200  AccessRequirementMap mAccessRequirements;
1201 
1202  RepOnKillMap mRepOnKill;
1203  RepSpilloverTemplateMap m_RepSpilloverTemplateMap;
1204 
1207 
1208  WeatherZoneMap mWeatherZoneMap;
1209 
1210  PetCreateSpellMap mPetCreateSpell;
1211 
1212  //character reserved names
1213  typedef std::set<std::string> ReservedNamesMap;
1214  ReservedNamesMap m_ReservedNames;
1215 
1217 
1219 
1220  ScriptNameMap m_scriptNames;
1221 
1222  ReferFriendMap m_referrerFriends;
1223  ReferFriendMap m_referredFriends;
1224 
1225  typedef std::vector<LocaleConstant> LocalForIndex;
1226  LocalForIndex m_LocalForIndex;
1227  int GetOrNewIndexForLocale(LocaleConstant loc);
1228 
1230 
1231  private:
1232  void LoadScripts(ScriptsType type);
1233  void CheckScripts(ScriptsType type, std::set<int32>& ids);
1234  void ConvertCreatureAddonAuras(CreatureDataAddon* addon, char const* table, char const* guidEntryStr);
1235  void LoadQuestRelationsHelper(QuestRelations& map, std::string table, bool starter, bool go);
1236 
1237  typedef std::map<uint32, PetLevelInfo*> PetLevelInfoMap;
1238  // PetLevelInfoMap[creature_id][level]
1239  PetLevelInfoMap petInfo; // [creature_id][level]
1240 
1241  PlayerClassInfo playerClassInfo[MAX_CLASSES];
1242 
1243  void BuildPlayerLevelInfo(uint8 race, uint8 class_, uint8 level, PlayerLevelInfo* plinfo) const;
1245 
1246  typedef std::map<uint32, uint32> BaseXPMap; // [area level][base xp]
1247  BaseXPMap mBaseXPTable;
1248 
1249  typedef std::map<uint32, int32> FishingBaseSkillMap; // [areaId][base skill level]
1250  FishingBaseSkillMap mFishingBaseForArea;
1251 
1252  typedef std::map<uint32, std::vector<std::string> > HalfNameMap;
1253  HalfNameMap PetHalfName0;
1254  HalfNameMap PetHalfName1;
1255 
1256  // Array to store creature stats, Max creature level + 1 (for data alignement with in game level)
1258 
1273 
1274  typedef std::vector<uint32> GuildBankTabPriceMap;
1275  GuildBankTabPriceMap mGuildBankTabPrice;
1276 
1280 
1283 };
1284 
1285 #define sObjectMgr Oregon::Singleton<ObjectMgr>::Instance()
1286 
1287 // scripting access functions
1288 bool LoadOregonStrings(DatabaseType& db, char const* table, int32 start_value = MAX_CREATURE_AI_TEXT_STRING_ID, int32 end_value = std::numeric_limits<int32>::min());
1290 uint32 GetScriptId(const char* name);
1295 Quest const* GetQuestTemplateStore(uint32 entry);
1296 
1297 #endif
1298 
GameObjectInfo const * GetGameObjectInfo(uint32 id)
Definition: ObjectMgr.cpp:7658
uint32 GOGuid
Definition: ObjectMgr.h:222
UNORDERED_MAP< uint32, PageTextLocale > PageTextLocaleMap
Definition: ObjectMgr.h:386
uint16 mana
Definition: ObjectMgr.h:398
CreatureDataMap mCreatureDataMap
Definition: ObjectMgr.h:1260
std::string option_text
Definition: ObjectMgr.h:427
#define MAKE_PAIR64(l, h)
Definition: Common.h:167
std::wstring wnameLow
Definition: ObjectMgr.h:71
float Unused4
Definition: ObjectMgr.h:306
uint32 SoundID
Definition: ObjectMgr.h:264
ItemLocaleMap mItemLocaleMap
Definition: ObjectMgr.h:1265
SQLStorage sCreatureStorage
float DestX
Definition: ObjectMgr.h:184
GossipMenuItemsMapBoundsNonConst GetGossipMenuItemsMapBoundsNonConst(uint32 uiMenuId)
Definition: ObjectMgr.h:1145
uint32 m_auctionid
Definition: ObjectMgr.h:1160
uint32 GetLinkedRespawnGuid(uint32 guid) const
Definition: ObjectMgr.h:949
UNORDERED_MAP< uint32, OregonStringLocale > OregonStringLocaleMap
Definition: ObjectMgr.h:387
std::multimap< uint32, ScriptInfo > ScriptMap
Definition: ObjectMgr.h:327
UNORDERED_MAP< uint32, uint32 > TransportEventMap
Definition: ObjectMgr.h:550
ReferFriendMap m_referredFriends
Definition: ObjectMgr.h:1223
uint32 TravelTime
Definition: ObjectMgr.h:181
std::string name
Definition: ObjectMgr.h:70
eScriptFlags
Definition: ObjectMgr.h:111
QuestRelations * GetCreatureQuestRelationMap()
Definition: ObjectMgr.h:784
uint32 GetNpcGossip(uint32 entry) const
Definition: ObjectMgr.h:1089
ArenaTeamMap::iterator GetArenaTeamMapBegin()
Definition: ObjectMgr.h:608
std::set< uint32 > TavernAreaTriggerSet
Definition: ObjectMgr.h:1182
GossipMenuItemsLocale const * GetGossipMenuItemsLocale(uint32 entry) const
Definition: ObjectMgr.h:991
OregonStringLocaleMap mOregonStringLocaleMap
Definition: ObjectMgr.h:1269
ScriptMapMap sGameObjectScripts
Definition: ObjectMgr.cpp:51
SQLStorage sCreatureModelStorage
GuildBankTabPriceMap mGuildBankTabPrice
Definition: ObjectMgr.h:1275
GossipMenusMapBounds GetGossipMenusMapBounds(uint32 uiMenuId) const
Definition: ObjectMgr.h:1130
uint32 team
Definition: ObjectMgr.h:476
UNORDERED_MAP< uint32, TrainerSpellData > CacheTrainerSpellMap
Definition: ObjectMgr.h:484
int DBCLocaleIndex
Definition: ObjectMgr.h:1229
DatabaseType WorldDatabase
Accessor to the world database.
Definition: Main.cpp:53
CreatureData const * GetCreatureData(uint32 guid) const
Definition: ObjectMgr.h:938
float DestY
Definition: ObjectMgr.h:185
int32 CreatureEntry
Definition: ObjectMgr.h:257
Quest const * GetQuestTemplate(uint32 quest_id) const
Definition: ObjectMgr.h:673
float Orientation
Definition: ObjectMgr.h:205
SkillRangeType
Definition: ObjectMgr.h:486
uint32 GetQuestForAreaTrigger(uint32 Trigger_ID) const
Definition: ObjectMgr.h:683
std::set< uint32 > CellGuidSet
Definition: ObjectMgr.h:351
UNORDERED_MAP< uint32, std::string > ItemTextMap
Definition: ObjectMgr.h:1181
Emote
uint32 option_id
Definition: ObjectMgr.h:428
float Unused3
Definition: ObjectMgr.h:305
RAFLinkStatus
Definition: Player.h:802
uint32 FieldID
Definition: ObjectMgr.h:174
SQLStorage sPageTextStore
ScriptCommands command
Definition: ObjectMgr.h:149
QuestRelations mCreatureQuestRelations
Definition: ObjectMgr.h:793
BattleMastersMap mBattleMastersMap
Definition: ObjectMgr.h:1194
PageTextLocale const * GetPageTextLocale(uint32 entry) const
Definition: ObjectMgr.h:985
GameObjectDataMap mGameObjectDataMap
Definition: ObjectMgr.h:1263
FishingBaseSkillMap mFishingBaseForArea
Definition: ObjectMgr.h:1250
uint32 FieldValue
Definition: ObjectMgr.h:175
NpcTextLocaleMap mNpcTextLocaleMap
Definition: ObjectMgr.h:1267
std::multimap< uint32, GossipMenuItems > GossipMenuItemsMap
Definition: ObjectMgr.h:449
ScriptsType
Definition: ObjectMgr.h:96
std::list< Condition * > ConditionList
Definition: ConditionMgr.h:223
ScriptMapMap sEventScripts
Definition: ObjectMgr.cpp:52
uint16 armor
Definition: ObjectMgr.h:399
time_t GetCreatureRespawnTime(uint32 loguid, uint32 instance)
Definition: ObjectMgr.h:1033
UNORDERED_MAP< uint32, CreatureLocale > CreatureLocaleMap
Definition: ObjectMgr.h:381
bool LoadOregonStrings(DatabaseType &db, char const *table, int32 start_value=MAX_CREATURE_AI_TEXT_STRING_ID, int32 end_value=std::numeric_limits< int32 >::min())
Definition: ObjectMgr.cpp:7635
AccessRequirementMap mAccessRequirements
Definition: ObjectMgr.h:1200
SummonerType _summonerType
Summoner&#39;s type, see SummonerType for available types.
Definition: ObjectMgr.h:92
UNORDERED_MAP< uint32, WeatherZoneChances > WeatherZoneMap
Definition: ObjectMgr.h:542
float PosX
Definition: ObjectMgr.h:232
UNORDERED_MAP< uint32, GameObjectData > GameObjectDataMap
Definition: ObjectMgr.h:380
AreaTriggerMap mAreaTriggers
Definition: ObjectMgr.h:1198
std::map< uint32, ScriptMap > ScriptMapMap
Definition: ObjectMgr.h:328
#define MAX_SPILLOVER_FACTIONS
uint8 _summonGroup
Summon&#39;s group id.
Definition: ObjectMgr.h:93
GossipMenusMapBoundsNonConst GetGossipMenusMapBoundsNonConst(uint32 uiMenuId)
Definition: ObjectMgr.h:1135
#define MAKE_PAIR32(l, h)
Definition: Common.h:171
UNORDERED_MAP< uint32, PetCreateSpellEntry > PetCreateSpellMap
Definition: ObjectMgr.h:544
GroupSet mGroupSet
Definition: ObjectMgr.h:1185
float orientation
Definition: ObjectMgr.h:68
uint32 id
Definition: ObjectMgr.h:147
QuestRelations mGOQuestRelations
Definition: ObjectMgr.h:791
uint32 npc_option_npcflag
Definition: ObjectMgr.h:429
std::map< uint32, uint32 > CellCorpseSet
Definition: ObjectMgr.h:352
float position_x
Definition: ObjectMgr.h:65
uint32 SpellID
Definition: ObjectMgr.h:249
uint32 ScriptType
Definition: ObjectMgr.h:289
ReputationOnKillEntry const * GetReputationOnKilEntry(uint32 id) const
Definition: ObjectMgr.h:738
uint32 GetBattleMasterBG(uint32 entry) const
Definition: ObjectMgr.h:699
WeatherZoneMap mWeatherZoneMap
Definition: ObjectMgr.h:1208
UNORDERED_MAP< uint32, ItemLocale > ItemLocaleMap
Definition: ObjectMgr.h:383
PetCreateSpellEntry const * GetPetCreateSpellEntry(uint32 id) const
Definition: ObjectMgr.h:755
ACE_INT32 int32
Definition: Define.h:67
uint32 reputation_max_cap2
Definition: ObjectMgr.h:410
int32 GetFishingBaseSkillLevel(uint32 entry) const
Definition: ObjectMgr.h:875
ReservedNamesMap m_ReservedNames
Definition: ObjectMgr.h:1214
UNORDERED_MAP< uint64, time_t > RespawnTimes
Definition: ObjectMgr.h:362
QuestMap mQuestTemplates
Definition: ObjectMgr.h:1176
static CreatureDataAddon const * GetCreatureAddon(uint32 lowguid)
Definition: ObjectMgr.h:624
CreatureInfo const * GetCreatureTemplateStore(uint32 entry)
Definition: ObjectMgr.cpp:7668
uint32 EquipmentID
Definition: ObjectMgr.h:313
uint32 safeLocId
Definition: ObjectMgr.h:475
uint32 text_id
Definition: ObjectMgr.h:442
uint32 m_hiPetGuid
Definition: ObjectMgr.h:1170
ItemLocale const * GetItemLocale(uint32 entry) const
Definition: ObjectMgr.h:967
UNORDERED_MAP< uint32, uint32 > AreaTriggerScriptMap
Definition: ObjectMgr.h:534
float PosZ
Definition: ObjectMgr.h:234
uint32 GetGuildBankTabPrice(uint8 Index) const
Definition: ObjectMgr.h:1070
uint32 GetAccountId() const
Definition: WorldSession.h:100
GossipTextMap mGossipText
Definition: ObjectMgr.h:1197
ItemMap mItems
Definition: ObjectMgr.h:1189
uint32 DespawnDelay
Definition: ObjectMgr.h:223
#define MAX_EXPANSION
CacheNpcTextIdMap m_mCacheNpcTextIdMap
Definition: ObjectMgr.h:1277
SummonerType
CellObjectGuids const & GetCellObjectGuids(uint16 mapid, uint8 spawnMode, uint32 cell_id)
Definition: ObjectMgr.h:933
Language lang_id
Definition: ObjectMgr.h:504
bool operator<(TempSummonGroupKey const &rhs) const
Definition: ObjectMgr.h:84
UNORDERED_MAP< uint32, VendorItemData > CacheVendorItemMap
Definition: ObjectMgr.h:483
RespawnTimes mGORespawnTimes
Definition: ObjectMgr.h:1272
AreaTrigger const * GetAreaTrigger(uint32 trigger) const
Definition: ObjectMgr.h:717
#define MIN_OREGON_STRING_ID
Definition: ObjectMgr.h:366
ScriptMapMap sGossipScripts
Definition: ObjectMgr.cpp:53
#define DEFAULT_MAX_CREATURE_LEVEL
bool IsGameObjectForQuests(uint32 entry) const
Definition: ObjectMgr.h:694
static ItemTemplate const * GetItemTemplate(uint32 id)
Definition: ObjectMgr.h:634
std::string GetScriptsTableNameByType(ScriptsType type)
Definition: ObjectMgr.cpp:56
ScriptsType type
Definition: ObjectMgr.h:146
GraveYardMap mGraveYardMap
Definition: ObjectMgr.h:1216
uint32 m_hiGoGuid
Definition: ObjectMgr.h:1172
bool IsTavernAreaTrigger(uint32 Trigger_ID) const
Definition: ObjectMgr.h:690
std::map< uint32, uint32 > BaseXPMap
Definition: ObjectMgr.h:1246
CacheTrainerSpellMap m_mCacheTrainerSpellMap
Definition: ObjectMgr.h:1279
uint32 m_hiItemGuid
Definition: ObjectMgr.h:1171
GameObjectData & NewGOData(uint32 guid)
Definition: ObjectMgr.h:1004
ArenaTeamMap::iterator GetArenaTeamMapEnd()
Definition: ObjectMgr.h:612
ObjectMgr::ScriptNameMap & GetScriptNames()
Definition: ObjectMgr.cpp:7653
UNORDERED_MAP< uint32, RepSpilloverTemplate > RepSpilloverTemplateMap
Definition: ObjectMgr.h:540
uint32 reputation_max_cap1
Definition: ObjectMgr.h:407
uint32 GetScriptId(const char *name)
Definition: ObjectMgr.cpp:7648
UNORDERED_MAP< uint32, Guild * > GuildMap
Definition: ObjectMgr.h:526
static InstanceTemplate const * GetInstanceTemplate(uint32 map)
Definition: ObjectMgr.h:639
QuestLocale const * GetQuestLocale(uint32 entry) const
Definition: ObjectMgr.h:973
#define MAX_STATS
SQLStorage sInstanceTemplate
float Unused5
Definition: ObjectMgr.h:307
GameTeleMap const & GetGameTeleMap() const
Definition: ObjectMgr.h:1082
uint32 target_mapId
Definition: ObjectMgr.h:344
CellCorpseSet corpses
Definition: ObjectMgr.h:357
float position_z
Definition: ObjectMgr.h:67
ScriptCommands
Definition: World.h:380
static GameObjectInfo const * GetGameObjectInfo(uint32 id)
Definition: ObjectMgr.h:578
SQLStorage sEquipmentStorageRaw
std::vector< std::string > ScriptNameMap
Definition: ObjectMgr.h:546
#define MAX_CREATURE_AI_TEXT_STRING_ID
Definition: ObjectMgr.h:371
WeatherZoneChances const * GetWeatherChances(uint32 zone_id) const
Definition: ObjectMgr.h:924
GameTeleMap m_GameTeleMap
Definition: ObjectMgr.h:1218
QuestRelations mCreatureQuestInvolvedRelations
Definition: ObjectMgr.h:794
uint32 PathID
Definition: ObjectMgr.h:281
uint32 Amount
Definition: ObjectMgr.h:271
bool IsReservedName(const std::string &name) const
Definition: ObjectMgr.h:1055
UNORDERED_MAP< uint32, NpcTextLocale > NpcTextLocaleMap
Definition: ObjectMgr.h:385
RAFLinkStatus GetRAFLinkStatus(const Player *plr1, const Player *plr2) const
Definition: ObjectMgr.h:570
uint32 m_arenaTeamId
Definition: ObjectMgr.h:1163
ACE_UINT8 uint8
Definition: Define.h:73
float SearchRadius
Definition: ObjectMgr.h:259
std::vector< std::string > Content
Definition: ObjectMgr.h:375
static CreatureDataAddon const * GetCreatureTemplateAddon(uint32 entry)
Definition: ObjectMgr.h:629
MapObjectGuids mMapObjectGuids
Definition: ObjectMgr.h:1259
uint32 Unused1
Definition: ObjectMgr.h:180
Language
PageTextLocaleMap mPageTextLocaleMap
Definition: ObjectMgr.h:1268
std::multimap< int32, uint32 > ExclusiveQuestGroups
Definition: ObjectMgr.h:902
std::multimap< uint32, uint32 > QuestRelations
Definition: ObjectMgr.h:390
uint32 QuestID
Definition: ObjectMgr.h:210
HighGuid
Definition: ObjectGuid.h:51
void RemoveGroup(Group *group)
Definition: ObjectMgr.h:591
uint32 ScriptID
Definition: ObjectMgr.h:288
uint32 delay
Definition: ObjectMgr.h:148
QuestLocaleMap mQuestLocaleMap
Definition: ObjectMgr.h:1266
bool LoadOregonStrings()
Definition: ObjectMgr.h:808
QuestMap const & GetQuestTemplates() const
Definition: ObjectMgr.h:678
uint32 skill_id
Definition: ObjectMgr.h:506
HalfNameMap PetHalfName0
Definition: ObjectMgr.h:1253
std::string GetScriptCommandName(ScriptCommands command)
Definition: ObjectMgr.cpp:120
PlayerInfo const * GetPlayerInfo(uint32 race, uint32 class_) const
Definition: ObjectMgr.h:653
GameObjectLocale const * GetGameObjectLocale(uint32 entry) const
Definition: ObjectMgr.h:961
TempSummonDataContainer _tempSummonDataStore
Stores temp summon data grouped by summoner&#39;s entry, summoner&#39;s type and group id.
Definition: ObjectMgr.h:1282
uint32 CreatureEntry
Definition: ObjectMgr.h:216
GossipMenuItemsMapBounds GetGossipMenuItemsMapBounds(uint32 uiMenuId) const
Definition: ObjectMgr.h:1140
const AuthHandler table[]
Definition: AuthSocket.cpp:149
ScriptMapMap * GetScriptsMapByType(ScriptsType type)
Definition: ObjectMgr.cpp:88
uint32 action_script_id
Definition: ObjectMgr.h:432
int32 Unused2
Definition: ObjectMgr.h:182
QuestRelations mGOQuestInvolvedRelations
Definition: ObjectMgr.h:792
std::set< uint32 > GameObjectForQuestSet
Definition: ObjectMgr.h:1183
uint32 m_hiCharGuid
Definition: ObjectMgr.h:1168
UNORDERED_MAP< uint32, ReputationOnKillEntry > RepOnKillMap
Definition: ObjectMgr.h:539
uint32 m_hiPetNumber
Definition: ObjectMgr.h:1165
TempSummonGroupKey(uint32 summonerEntry, SummonerType summonerType, uint8 group)
Definition: ObjectMgr.h:79
SQLStorage sCreatureDataAddonStorage
GossipMenuItemsMap m_mGossipMenuItemsMap
Definition: ObjectMgr.h:1206
Definition: Item.h:196
#define MAX_OREGON_STRING_ID
Definition: ObjectMgr.h:367
GameTele const * GetGameTele(uint32 id) const
Definition: ObjectMgr.h:1075
int32 GetDBCLocaleIndex() const
Definition: ObjectMgr.h:1021
QuestAreaTriggerMap mQuestAreaTriggerMap
Definition: ObjectMgr.h:1193
uint32 Flags
Definition: ObjectMgr.h:162
static Player * FindPlayer(uint64, bool force=false)
TrainerSpellData const * GetNpcTrainerSpells(uint32 entry) const
Definition: ObjectMgr.h:1098
BaseXPMap mBaseXPTable
Definition: ObjectMgr.h:1247
ConditionList conditions
Definition: ObjectMgr.h:436
std::map< TempSummonGroupKey, std::vector< TempSummonData > > TempSummonDataContainer
Definition: ObjectMgr.h:453
etc mysql my cnf *Then change max_allowed_packet to a bigger value
UNORDERED_MAP< uint32, ArenaTeam * > ArenaTeamMap
Definition: ObjectMgr.h:528
PlayerClassInfo const * GetPlayerClassInfo(uint32 class_) const
Definition: ObjectMgr.h:646
std::vector< std::string > StringVector
Definition: Common.h:232
UNORDERED_MAP< uint32, AreaTrigger > AreaTriggerMap
Definition: ObjectMgr.h:532
CreatureLocaleMap mCreatureLocaleMap
Definition: ObjectMgr.h:1262
uint32 EmoteID
Definition: ObjectMgr.h:168
Definition: model.h:33
std::pair< GossipMenuItemsMap::const_iterator, GossipMenuItemsMap::const_iterator > GossipMenuItemsMapBounds
Definition: ObjectMgr.h:450
#define UNORDERED_MAP
Definition: UnorderedMap.h:47
UNORDERED_MAP< uint32, uint32 > QuestAreaTriggerMap
Definition: ObjectMgr.h:1179
VendorItemData const * GetNpcVendorItemList(uint32 entry) const
Definition: ObjectMgr.h:1107
PetCreateSpellMap mPetCreateSpell
Definition: ObjectMgr.h:1210
std::map< uint32, PetLevelInfo * > PetLevelInfoMap
Definition: ObjectMgr.h:1237
uint32 ItemEntry
Definition: ObjectMgr.h:270
uint32 box_money
Definition: ObjectMgr.h:434
std::set< std::string > ReservedNamesMap
Definition: ObjectMgr.h:1213
PetLevelInfoMap petInfo
Definition: ObjectMgr.h:1239
uint16 displayId_m
Definition: Player.h:209
RespawnTimes mCreatureRespawnTimes
Definition: ObjectMgr.h:1271
Player * GetPlayer(uint64 guid, bool force=false) const
Definition: ObjectMgr.h:556
UNORDERED_MAP< uint32, Item * > ItemMap
Definition: ObjectMgr.h:522
int32 RemoveCorpse
Definition: ObjectMgr.h:296
std::vector< LocaleConstant > LocalForIndex
Definition: ObjectMgr.h:1225
Definition: Map.h:266
std::multimap< uint32, GraveYardData > GraveYardMap
Definition: ObjectMgr.h:478
ScriptMapMap sSpellScripts
Definition: ObjectMgr.cpp:50
GossipMenuItemsLocaleMap mGossipMenuItemsLocaleMap
Definition: ObjectMgr.h:1270
#define MAX_CREATURE_CLASS
SQLStorage sItemStorage
UNORDERED_MAP< uint64, uint64 > ReferFriendMap
Definition: ObjectMgr.h:548
CreatureLinkedRespawnMap mCreatureLinkedRespawnMap
Definition: ObjectMgr.h:1261
UNORDERED_MAP< uint32, CellObjectGuids > CellObjectGuidsMap
Definition: ObjectMgr.h:359
std::set< Group * > GroupSet
Definition: ObjectMgr.h:524
Key for storing temp summon data in TempSummonDataContainer.
Definition: ObjectMgr.h:77
Player * GetPlayer(const char *name, bool force=false) const
Definition: ObjectMgr.h:552
#define MAX_CLASSES
Definition: SharedDefines.h:91
UNORDERED_MAP< uint32, Quest * > QuestMap
Definition: ObjectMgr.h:530
float position_y
Definition: ObjectMgr.h:66
ArenaTeamMap mArenaTeamMap
Definition: ObjectMgr.h:1187
OregonStringLocale const * GetOregonStringLocale(int32 entry) const
Definition: ObjectMgr.h:1010
UNORDERED_MAP< uint32, QuestLocale > QuestLocaleMap
Definition: ObjectMgr.h:384
std::map< uint32, std::vector< std::string > > HalfNameMap
Definition: ObjectMgr.h:1252
UNORDERED_MAP< uint32, CellObjectGuidsMap > MapObjectGuids
Definition: ObjectMgr.h:360
QuestRelations * GetGOQuestRelationMap()
Definition: ObjectMgr.h:779
uint32 action_menu_id
Definition: ObjectMgr.h:430
ACE_UINT64 uint64
Definition: Define.h:70
T const * LookupEntry(uint32 id) const
Definition: SQLStorage.h:52
float DestZ
Definition: ObjectMgr.h:186
CacheVendorItemMap m_mCacheVendorItemMap
Definition: ObjectMgr.h:1278
#define LANGUAGES_COUNT
TavernAreaTriggerSet mTavernAreaTriggerSet
Definition: ObjectMgr.h:1195
std::multimap< uint32, GossipMenus > GossipMenusMap
Definition: ObjectMgr.h:446
#define MAX_RACES
Definition: SharedDefines.h:66
static void GetLocaleString(const StringVector &data, int loc_idx, std::string &value)
Definition: ObjectMgr.h:1151
float target_Orientation
Definition: ObjectMgr.h:348
float PosY
Definition: ObjectMgr.h:233
time_t GetGORespawnTime(uint32 loguid, uint32 instance)
Definition: ObjectMgr.h:1038
CellGuidSet creatures
Definition: ObjectMgr.h:355
uint32 m_hiCreatureGuid
Definition: ObjectMgr.h:1169
AccessRequirement const * GetAccessRequirement(uint32 requirement) const
Definition: ObjectMgr.h:725
SQLStorage sEquipmentStorage
std::pair< GossipMenusMap::iterator, GossipMenusMap::iterator > GossipMenusMapBoundsNonConst
Definition: ObjectMgr.h:448
ScriptNameMap & GetScriptNames()
Definition: ObjectMgr.h:1120
RepSpilloverTemplateMap m_RepSpilloverTemplateMap
Definition: ObjectMgr.h:1203
RepOnKillMap mRepOnKill
Definition: ObjectMgr.h:1202
uint32 GetAreaTriggerScriptId(uint32 trigger_id)
Definition: ObjectMgr.cpp:7630
LanguageDesc lang_description[LANGUAGES_COUNT]
Definition: ObjectMgr.cpp:246
float target_X
Definition: ObjectMgr.h:345
std::map< uint32, int32 > FishingBaseSkillMap
Definition: ObjectMgr.h:1249
LanguageDesc const * GetLanguageDescByID(uint32 lang)
Definition: ObjectMgr.cpp:269
uint32 mapId
Definition: ObjectMgr.h:69
UNORDERED_MAP< uint32, GameObjectLocale > GameObjectLocaleMap
Definition: ObjectMgr.h:382
uint32 action_poi_id
Definition: ObjectMgr.h:431
uint32 entry
Definition: ObjectMgr.h:441
UNORDERED_MAP< uint32, GameTele > GameTeleMap
Definition: ObjectMgr.h:74
#define WEATHER_SEASONS
Definition: ObjectMgr.h:460
uint32 IsRepeatable
Definition: ObjectMgr.h:282
UNORDERED_MAP< uint32, uint32 > BattleMastersMap
Definition: ObjectMgr.h:1180
uint32 m_mailid
Definition: ObjectMgr.h:1161
ConditionList conditions
Definition: ObjectMgr.h:443
std::map< uint32, uint32 > CreatureLinkedRespawnMap
Definition: ObjectMgr.h:378
uint32 ResetDelay
Definition: ObjectMgr.h:242
ExclusiveQuestGroups mExclusiveQuestGroups
Definition: ObjectMgr.h:903
const char * GetOregonStringForDBCLocale(int32 entry) const
Definition: ObjectMgr.h:1017
SQLStorage sCreatureInfoAddonStorage
GameObjectData const * GetGOData(uint32 guid) const
Definition: ObjectMgr.h:998
uint32 access_id
Definition: ObjectMgr.h:343
void SetDBCLocaleIndex(uint32 lang)
Definition: ObjectMgr.h:1025
uint32 ModelID
Definition: ObjectMgr.h:318
float target_Y
Definition: ObjectMgr.h:346
uint32 MapID
Definition: ObjectMgr.h:198
GameObjectLocaleMap mGameObjectLocaleMap
Definition: ObjectMgr.h:1264
CellGuidSet gameobjects
Definition: ObjectMgr.h:356
uint32 m_hiDoGuid
Definition: ObjectMgr.h:1173
uint32 spell_id
Definition: ObjectMgr.h:505
int32 Unused1
Definition: ObjectMgr.h:200
UNORDERED_MAP< uint32, GossipText * > GossipTextMap
Definition: ObjectMgr.h:1178
WorldSession * GetSession() const
Definition: Player.h:1944
LocaleConstant
Definition: Common.h:211
uint32 Unused2
Definition: ObjectMgr.h:295
NpcTextLocale const * GetNpcTextLocale(uint32 entry) const
Definition: ObjectMgr.h:979
std::pair< GossipMenusMap::const_iterator, GossipMenusMap::const_iterator > GossipMenusMapBounds
Definition: ObjectMgr.h:447
SkillRangeType GetSkillRangeType(SkillLineEntry const *pSkill, bool racial)
Definition: ObjectMgr.cpp:6976
RAFLinkStatus GetRAFLinkStatus(const Player *plr) const
Definition: ObjectMgr.h:565
ItemTextMap mItemTexts
Definition: ObjectMgr.h:1191
AreaTriggerScriptMap mAreaTriggerScripts
Definition: ObjectMgr.h:1199
ACE_UINT16 uint16
Definition: Define.h:72
SQLStorage sGOStorage
void LoadQuestStartersAndEnders()
Definition: ObjectMgr.h:767
Player * FindPlayerByName(const char *name, bool force=false)
CreatureLocale const * GetCreatureLocale(uint32 entry) const
Definition: ObjectMgr.h:955
ACE_UINT32 uint32
Definition: Define.h:71
GossipMenusMap m_mGossipMenusMap
Definition: ObjectMgr.h:1205
uint16 health
Definition: ObjectMgr.h:397
RepSpilloverTemplate const * GetRepSpilloverTemplate(uint32 factionId) const
Definition: ObjectMgr.h:746
std::vector< TempSummonData > const * GetSummonGroup(uint32 summonerId, SummonerType summonerType, uint8 group) const
Definition: ObjectMgr.h:915
std::vector< uint32 > GuildBankTabPriceMap
Definition: ObjectMgr.h:1274
HalfNameMap PetHalfName1
Definition: ObjectMgr.h:1254
ScriptNameMap m_scriptNames
Definition: ObjectMgr.h:1220
Quest const * GetQuestTemplateStore(uint32 entry)
Definition: ObjectMgr.cpp:7673
uint32 Distance
Definition: ObjectMgr.h:211
Definition: Guild.h:265
UNORDERED_MAP< uint32, AccessRequirement > AccessRequirementMap
Definition: ObjectMgr.h:536
GuildMap mGuildMap
Definition: ObjectMgr.h:1186
int32 TextID
Definition: ObjectMgr.h:163
GameObjectForQuestSet mGameObjectForQuestSet
Definition: ObjectMgr.h:1196
uint32 menu_id
Definition: ObjectMgr.h:424
CreatureData & NewOrExistCreatureData(uint32 guid)
Definition: ObjectMgr.h:944
uint32 m_guildId
Definition: ObjectMgr.h:1164
Definition: Player.h:922
ScriptMapMap sQuestStartScripts
Definition: ObjectMgr.cpp:49
void AddGroup(Group *group)
Definition: ObjectMgr.h:587
ReferFriendMap m_referrerFriends
Definition: ObjectMgr.h:1222
uint16 displayId_f
Definition: Player.h:210
UNORDERED_MAP< uint32, CreatureData > CreatureDataMap
Definition: ObjectMgr.h:379
LocalForIndex m_LocalForIndex
Definition: ObjectMgr.h:1226
uint32 _summonerEntry
Summoner&#39;s entry.
Definition: ObjectMgr.h:91
float target_Z
Definition: ObjectMgr.h:347
ScriptMapMap sWaypointScripts
Definition: ObjectMgr.cpp:54
uint32 ChatType
Definition: ObjectMgr.h:161
std::string GetItemText(uint32 id)
Definition: ObjectMgr.h:893
const char * GetScriptName(uint32 id)
Definition: ObjectMgr.h:1124
UNORDERED_MAP< uint32, GossipMenuItemsLocale > GossipMenuItemsLocaleMap
Definition: ObjectMgr.h:388
bool normalizePlayerName(std::string &name)
Definition: ObjectMgr.cpp:225
#define GUILD_BANK_MAX_TABS
Definition: Group.h:154
std::string box_text
Definition: ObjectMgr.h:435
uint32 m_ItemTextId
Definition: ObjectMgr.h:1162
CreatureInfo const * GetCreatureTemplate(uint32 id)
Definition: ObjectMgr.cpp:7663
std::pair< GossipMenuItemsMap::iterator, GossipMenuItemsMap::iterator > GossipMenuItemsMapBoundsNonConst
Definition: ObjectMgr.h:451
uint32 m_hiCorpseGuid
Definition: ObjectMgr.h:1174
UNORDERED_MAP< uint32, uint32 > CacheNpcTextIdMap
Definition: ObjectMgr.h:481
uint8 option_icon
Definition: ObjectMgr.h:426
ScriptMapMap sQuestEndScripts
Definition: ObjectMgr.cpp:48