[10682] New table 'item_convert' for convertion items.

* Implment vendor at show replace BoA item with reputation requirement
  by identical item without rep. reqs for player that fit this requirements
  of original item.

* Table also can be used for store item convertion data form one team items
  to similar other team items. This case not impement but added function easy
  used for it.

* Note: strict single convert for item not created problem for both way use:
  item converted for same team or all, can't be original item for conversion to
  another team.
This commit is contained in:
VladimirMangos 2010-11-04 23:53:23 +03:00
parent 225b4db1ca
commit 2f144d9d29
13 changed files with 162 additions and 6 deletions

View file

@ -440,6 +440,7 @@ typedef UNORDERED_MAP<uint32,PageTextLocale> PageTextLocaleMap;
typedef UNORDERED_MAP<int32,MangosStringLocale> MangosStringLocaleMap;
typedef UNORDERED_MAP<uint32,GossipMenuItemsLocale> GossipMenuItemsLocaleMap;
typedef UNORDERED_MAP<uint32,PointOfInterestLocale> PointOfInterestLocaleMap;
typedef UNORDERED_MAP<uint32,uint32> ItemConvertMap;
typedef std::multimap<int32, uint32> ExclusiveQuestGroupsMap;
typedef std::multimap<uint32, ItemRequiredTarget> ItemRequiredTargetMap;
@ -931,6 +932,7 @@ class ObjectMgr
void LoadGameObjectLocales();
void LoadGameobjects();
void LoadGameobjectRespawnTimes();
void LoadItemConverts();
void LoadItemPrototypes();
void LoadItemRequiredTarget();
void LoadItemLocales();
@ -1251,6 +1253,16 @@ class ObjectMgr
return mSpellClickInfoMap.equal_range(creature_id);
}
uint32 GetItemConvert(uint32 itemEntry, uint32 raceMask) const
{
ItemConvertMap::const_iterator iter = m_ItemConvert.find(itemEntry);
if (iter == m_ItemConvert.end())
return itemEntry;
ItemPrototype const* proto = GetItemPrototype(iter->second);
return (proto && proto->AllowableRace & raceMask) ? iter->second : itemEntry;
}
ItemRequiredTargetMapBounds GetItemRequiredTargetMapBounds(uint32 uiItemEntry) const
{
return m_ItemRequiredTarget.equal_range(uiItemEntry);
@ -1360,6 +1372,7 @@ class ObjectMgr
SpellClickInfoMap mSpellClickInfoMap;
ItemConvertMap m_ItemConvert;
ItemRequiredTargetMap m_ItemRequiredTarget;
typedef std::vector<LocaleConstant> LocalForIndex;