mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-06 04:23:47 +00:00
Core/DB: Update all locales to actual TrinityCore (#1160)
* Core/Misc Update all locales table structure to simple system. Port from TrinityCore Co-Authored-By: Winfidonarleyan <dowlandtop@yandex.com> * Core/Db/Gossip Update structure gossip_menu and gossip_menu_action to actual TrinityCore * Core/DB Update Broadcast system to actual TC * Core/Mail: implement Quest Mail Sender * Core/Quest Split quest template locales
This commit is contained in:
@@ -469,15 +469,13 @@ typedef UNORDERED_MAP<uint32/*(mapid, spawnMode) pair*/, CellObjectGuidsMap> Map
|
||||
// Trinity string ranges
|
||||
#define MIN_TRINITY_STRING_ID 1 // 'trinity_string'
|
||||
#define MAX_TRINITY_STRING_ID 2000000000
|
||||
#define MIN_DB_SCRIPT_STRING_ID MAX_TRINITY_STRING_ID // 'db_script_string'
|
||||
#define MAX_DB_SCRIPT_STRING_ID 2000010000
|
||||
#define MIN_CREATURE_AI_TEXT_STRING_ID (-1) // 'creature_ai_texts'
|
||||
#define MAX_CREATURE_AI_TEXT_STRING_ID (-1000000)
|
||||
|
||||
// Trinity Trainer Reference start range
|
||||
#define TRINITY_TRAINER_START_REF 200000
|
||||
|
||||
struct TrinityStringLocale
|
||||
struct TrinityString
|
||||
{
|
||||
StringVector Content;
|
||||
};
|
||||
@@ -491,9 +489,11 @@ typedef UNORDERED_MAP<uint32, GameObjectLocale> GameObjectLocaleContainer;
|
||||
typedef UNORDERED_MAP<uint32, ItemLocale> ItemLocaleContainer;
|
||||
typedef UNORDERED_MAP<uint32, ItemSetNameLocale> ItemSetNameLocaleContainer;
|
||||
typedef UNORDERED_MAP<uint32, QuestLocale> QuestLocaleContainer;
|
||||
typedef UNORDERED_MAP<uint32, QuestOfferRewardLocale> QuestOfferRewardLocaleContainer;
|
||||
typedef UNORDERED_MAP<uint32, QuestRequestItemsLocale> QuestRequestItemsLocaleContainer;
|
||||
typedef UNORDERED_MAP<uint32, NpcTextLocale> NpcTextLocaleContainer;
|
||||
typedef UNORDERED_MAP<uint32, PageTextLocale> PageTextLocaleContainer;
|
||||
typedef UNORDERED_MAP<int32, TrinityStringLocale> TrinityStringLocaleContainer;
|
||||
typedef UNORDERED_MAP<int32, TrinityString> TrinityStringContainer;
|
||||
typedef UNORDERED_MAP<uint32, GossipMenuItemsLocale> GossipMenuItemsLocaleContainer;
|
||||
typedef UNORDERED_MAP<uint32, PointOfInterestLocale> PointOfInterestLocaleContainer;
|
||||
|
||||
@@ -570,25 +570,27 @@ struct PointOfInterest
|
||||
|
||||
struct GossipMenuItems
|
||||
{
|
||||
uint32 MenuId;
|
||||
uint32 OptionIndex;
|
||||
uint32 MenuID;
|
||||
uint32 OptionID;
|
||||
uint8 OptionIcon;
|
||||
std::string OptionText;
|
||||
uint32 OptionBroadcastTextID;
|
||||
uint32 OptionType;
|
||||
uint32 OptionNpcflag;
|
||||
uint32 ActionMenuId;
|
||||
uint32 ActionPoiId;
|
||||
uint32 OptionNpcFlag;
|
||||
uint32 ActionMenuID;
|
||||
uint32 ActionPoiID;
|
||||
bool BoxCoded;
|
||||
uint32 BoxMoney;
|
||||
std::string BoxText;
|
||||
ConditionList Conditions;
|
||||
uint32 BoxBroadcastTextID;
|
||||
};
|
||||
|
||||
struct GossipMenus
|
||||
{
|
||||
uint32 entry;
|
||||
uint32 text_id;
|
||||
ConditionList conditions;
|
||||
uint32 MenuID;
|
||||
uint32 TextID;
|
||||
ConditionList Conditions;
|
||||
};
|
||||
|
||||
typedef std::multimap<uint32, GossipMenus> GossipMenusContainer;
|
||||
@@ -952,9 +954,7 @@ class ObjectMgr
|
||||
void ValidateSpellScripts();
|
||||
void InitializeSpellInfoPrecomputedData();
|
||||
|
||||
bool LoadTrinityStrings(char const* table, int32 min_value, int32 max_value);
|
||||
bool LoadTrinityStrings() { return LoadTrinityStrings("trinity_string", MIN_TRINITY_STRING_ID, MAX_TRINITY_STRING_ID); }
|
||||
void LoadDbScriptStrings();
|
||||
bool LoadTrinityStrings();
|
||||
void LoadBroadcastTexts();
|
||||
void LoadBroadcastTextLocales();
|
||||
void LoadCreatureClassLevelStats();
|
||||
@@ -980,6 +980,8 @@ class ObjectMgr
|
||||
void LoadItemSetNameLocales();
|
||||
void LoadQuestLocales();
|
||||
void LoadNpcTextLocales();
|
||||
void LoadQuestOfferRewardLocale();
|
||||
void LoadQuestRequestItemsLocale();
|
||||
void LoadPageTextLocales();
|
||||
void LoadGossipMenuItemsLocales();
|
||||
void LoadPointOfInterestLocales();
|
||||
@@ -1181,6 +1183,18 @@ class ObjectMgr
|
||||
if (itr == _pointOfInterestLocaleStore.end()) return NULL;
|
||||
return &itr->second;
|
||||
}
|
||||
QuestOfferRewardLocale const* GetQuestOfferRewardLocale(uint32 entry) const
|
||||
{
|
||||
auto itr = _questOfferRewardLocaleStore.find(entry);
|
||||
if (itr == _questOfferRewardLocaleStore.end()) return nullptr;
|
||||
return &itr->second;
|
||||
}
|
||||
QuestRequestItemsLocale const* GetQuestRequestItemsLocale(uint32 entry) const
|
||||
{
|
||||
auto itr = _questRequestItemsLocaleStore.find(entry);
|
||||
if (itr == _questRequestItemsLocaleStore.end()) return nullptr;
|
||||
return &itr->second;
|
||||
}
|
||||
NpcTextLocale const* GetNpcTextLocale(uint32 entry) const
|
||||
{
|
||||
NpcTextLocaleContainer::const_iterator itr = _npcTextLocaleStore.find(entry);
|
||||
@@ -1189,15 +1203,17 @@ class ObjectMgr
|
||||
}
|
||||
GameObjectData& NewGOData(uint32 guid) { return _gameObjectDataStore[guid]; }
|
||||
void DeleteGOData(uint32 guid);
|
||||
|
||||
TrinityStringLocale const* GetTrinityStringLocale(int32 entry) const
|
||||
|
||||
TrinityString const* GetTrinityString(uint32 entry) const
|
||||
{
|
||||
TrinityStringLocaleContainer::const_iterator itr = _trinityStringLocaleStore.find(entry);
|
||||
if (itr == _trinityStringLocaleStore.end()) return NULL;
|
||||
TrinityStringContainer::const_iterator itr = _trinityStringStore.find(entry);
|
||||
if (itr == _trinityStringStore.end())
|
||||
return NULL;
|
||||
|
||||
return &itr->second;
|
||||
}
|
||||
const char *GetTrinityString(int32 entry, LocaleConstant locale_idx) const;
|
||||
const char *GetTrinityStringForDBCLocale(int32 entry) const { return GetTrinityString(entry, DBCLocaleIndex); }
|
||||
char const* GetTrinityString(uint32 entry, LocaleConstant locale) const;
|
||||
char const* GetTrinityStringForDBCLocale(uint32 entry) const { return GetTrinityString(entry, DBCLocaleIndex); }
|
||||
LocaleConstant GetDBCLocaleIndex() const { return DBCLocaleIndex; }
|
||||
void SetDBCLocaleIndex(LocaleConstant locale) { DBCLocaleIndex = locale; }
|
||||
|
||||
@@ -1380,7 +1396,6 @@ class ObjectMgr
|
||||
|
||||
private:
|
||||
void LoadScripts(ScriptsType type);
|
||||
void CheckScripts(ScriptsType type, std::set<int32>& ids);
|
||||
void LoadQuestRelationsHelper(QuestRelations& map, std::string const& table, bool starter, bool go);
|
||||
void PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint32 itemId, int32 count);
|
||||
|
||||
@@ -1441,9 +1456,11 @@ class ObjectMgr
|
||||
ItemLocaleContainer _itemLocaleStore;
|
||||
ItemSetNameLocaleContainer _itemSetNameLocaleStore;
|
||||
QuestLocaleContainer _questLocaleStore;
|
||||
QuestOfferRewardLocaleContainer _questOfferRewardLocaleStore;
|
||||
QuestRequestItemsLocaleContainer _questRequestItemsLocaleStore;
|
||||
NpcTextLocaleContainer _npcTextLocaleStore;
|
||||
PageTextLocaleContainer _pageTextLocaleStore;
|
||||
TrinityStringLocaleContainer _trinityStringLocaleStore;
|
||||
TrinityStringContainer _trinityStringStore;
|
||||
GossipMenuItemsLocaleContainer _gossipMenuItemsLocaleStore;
|
||||
PointOfInterestLocaleContainer _pointOfInterestLocaleStore;
|
||||
|
||||
@@ -1466,7 +1483,4 @@ class ObjectMgr
|
||||
|
||||
#define sObjectMgr ACE_Singleton<ObjectMgr, ACE_Null_Mutex>::instance()
|
||||
|
||||
// scripting access functions
|
||||
bool LoadTrinityStrings(char const* table, int32 start_value = MAX_CREATURE_AI_TEXT_STRING_ID, int32 end_value = std::numeric_limits<int32>::min());
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user