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

Signed-off-by: VladimirMangos <[email protected]>

    * 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.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-06-08 17:25:02 -05:00
parent 6578cce471
commit 4e130dcdfd
15 changed files with 257 additions and 35 deletions
+11
View File
@@ -160,6 +160,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
{
@@ -534,6 +536,7 @@ class ObjectMgr
void LoadGameobjects();
void LoadGameobjectRespawnTimes();
void LoadItemPrototypes();
void LoadItemRequiredTarget();
void LoadItemLocales();
void LoadQuestLocales();
void LoadNpcTextLocales();
@@ -805,6 +808,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
@@ -867,6 +876,8 @@ class ObjectMgr
ScriptNameMap m_scriptNames;
ItemRequiredTargetMap m_ItemRequiredTarget;
typedef std::vector<LocaleConstant> LocalForIndex;
LocalForIndex m_LocalForIndex;