[7980] Implement item use target requirements store and check (new table item_required_target).

Signed-off-by: VladimirMangos <vladimir@getmangos.com>

* Also implement this table reload
* Static Spell::SendCastResult function for call not from spell code.
  Can be also used in scripts where need send explicitly spell cast error to client.
This commit is contained in:
NoFantasy 2009-06-09 00:22:51 +04:00 committed by VladimirMangos
parent 6d8867d0fc
commit 6a1b4e5729
18 changed files with 279 additions and 36 deletions

View file

@ -161,6 +161,8 @@ typedef UNORDERED_MAP<uint32,NpcOptionLocale> NpcOptionLocaleMap;
typedef UNORDERED_MAP<uint32,PointOfInterestLocale> PointOfInterestLocaleMap;
typedef std::multimap<uint32,uint32> QuestRelations;
typedef std::multimap<uint32,ItemRequiredTarget> ItemRequiredTargetMap;
typedef std::pair<ItemRequiredTargetMap::const_iterator, ItemRequiredTargetMap::const_iterator> ItemRequiredTargetMapBounds;
struct PetLevelInfo
{
@ -498,6 +500,7 @@ class ObjectMgr
void LoadGameobjects();
void LoadGameobjectRespawnTimes();
void LoadItemPrototypes();
void LoadItemRequiredTarget();
void LoadItemLocales();
void LoadQuestLocales();
void LoadNpcTextLocales();
@ -751,6 +754,12 @@ class ObjectMgr
uint32 GetScriptId(const char *name);
int GetOrNewIndexForLocale(LocaleConstant loc);
ItemRequiredTargetMapBounds GetItemRequiredTargetMapBounds(uint32 uiItemEntry) const
{
return ItemRequiredTargetMapBounds(m_ItemRequiredTarget.lower_bound(uiItemEntry),m_ItemRequiredTarget.upper_bound(uiItemEntry));
}
protected:
// first free id for selected id type
@ -808,6 +817,8 @@ class ObjectMgr
ScriptNameMap m_scriptNames;
ItemRequiredTargetMap m_ItemRequiredTarget;
typedef std::vector<LocaleConstant> LocalForIndex;
LocalForIndex m_LocalForIndex;