MaNGOS merge: Mail System.
* Store loot in mail_loot_template indexed by mail template ids. * Implement proper creating mail text copy item from mail template based mail. * Move send functions to new MailDraft class from WorldSession. * Implement mails sending at player levelup. * Autor VladimirMangos, converted by me. --HG-- branch : trunk
This commit is contained in:
@@ -180,6 +180,19 @@ struct PetLevelInfo
|
||||
uint16 armor;
|
||||
};
|
||||
|
||||
struct MailLevelReward
|
||||
{
|
||||
MailLevelReward() : raceMask(0), mailTemplateId(0), senderEntry(0) {}
|
||||
MailLevelReward(uint32 _raceMask, uint32 _mailTemplateId, uint32 _senderEntry) : raceMask(_raceMask), mailTemplateId(_mailTemplateId), senderEntry(_senderEntry) {}
|
||||
|
||||
uint32 raceMask;
|
||||
uint32 mailTemplateId;
|
||||
uint32 senderEntry;
|
||||
};
|
||||
|
||||
typedef std::list<MailLevelReward> MailLevelRewardList;
|
||||
typedef UNORDERED_MAP<uint8,MailLevelRewardList> MailLevelRewardMap;
|
||||
|
||||
struct ReputationOnKillEntry
|
||||
{
|
||||
uint32 repfaction1;
|
||||
@@ -570,6 +583,7 @@ class ObjectMgr
|
||||
void LoadNpcOptionLocales();
|
||||
void LoadPointOfInterestLocales();
|
||||
void LoadInstanceTemplate();
|
||||
void LoadMailLevelRewards();
|
||||
|
||||
void LoadGossipText();
|
||||
|
||||
@@ -645,6 +659,19 @@ class ObjectMgr
|
||||
typedef std::multimap<int32, uint32> ExclusiveQuestGroups;
|
||||
ExclusiveQuestGroups mExclusiveQuestGroups;
|
||||
|
||||
MailLevelReward const* GetMailLevelReward(uint32 level,uint32 raceMask)
|
||||
{
|
||||
MailLevelRewardMap::const_iterator map_itr = m_mailLevelRewardMap.find(level);
|
||||
if (map_itr == m_mailLevelRewardMap.end())
|
||||
return NULL;
|
||||
|
||||
for(MailLevelRewardList::const_iterator set_itr = map_itr->second.begin(); set_itr != map_itr->second.end(); ++set_itr)
|
||||
if (set_itr->raceMask & raceMask)
|
||||
return &*set_itr;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
WeatherZoneChances const* GetWeatherChances(uint32 zone_id) const
|
||||
{
|
||||
WeatherZoneMap::const_iterator itr = mWeatherZoneMap.find(zone_id);
|
||||
@@ -956,6 +983,8 @@ class ObjectMgr
|
||||
void ConvertCreatureAddonAuras(CreatureDataAddon* addon, char const* table, char const* guidEntryStr);
|
||||
void LoadQuestRelationsHelper(QuestRelations& map,char const* table);
|
||||
|
||||
MailLevelRewardMap m_mailLevelRewardMap;
|
||||
|
||||
typedef std::map<uint32,PetLevelInfo*> PetLevelInfoMap;
|
||||
// PetLevelInfoMap[creature_id][level]
|
||||
PetLevelInfoMap petInfo; // [creature_id][level]
|
||||
|
||||
Reference in New Issue
Block a user