[8016] Work at npc click table data use. Author: VladimirMangos

* New fields in `npc_spellclick_spells` for allow set npc spell click mode from quest to infinity
      or to another quest, or from reward quest.
    * Not expect (and forbid set UNIT_NPC_FLAG_SPELLCLICK in DB and set it at `npc_spellclick_spells` loading.
    * Apply some speedups for creature checks affected by spel click state

*Also add target position of 51852. By Roland

--HG--
branch : trunk
This commit is contained in:
megamage
2009-06-15 23:07:43 -05:00
parent 572a9191d9
commit 00f4a31b73
8 changed files with 143 additions and 89 deletions
+14 -3
View File
@@ -102,12 +102,17 @@ extern ScriptMapMap sWaypointScripts;
struct SpellClickInfo
{
uint32 spellId;
uint32 questId;
uint32 questStatus;
uint32 questStart; // quest start (quest must be active or rewarded for spell apply)
uint32 questEnd; // quest end (quest don't must be rewarded for spell apply)
bool questStartCanActive; // if true then quest start can be active (not only rewarded)
uint8 castFlags;
// helpers
bool IsFitToRequirements(Player const* player) const;
};
typedef std::multimap<uint32, SpellClickInfo> SpellClickInfoMap;
typedef std::pair<SpellClickInfoMap::const_iterator,SpellClickInfoMap::const_iterator> SpellClickInfoMapBounds;
struct AreaTrigger
{
@@ -585,7 +590,6 @@ class ObjectMgr
void LoadReputationOnKill();
void LoadPointsOfInterest();
SpellClickInfoMap mSpellClickInfoMap;
void LoadNPCSpellClickSpells();
void LoadWeatherZoneChances();
@@ -828,6 +832,11 @@ class ObjectMgr
int GetOrNewIndexForLocale(LocaleConstant loc);
SpellClickInfoMapBounds GetSpellClickInfoMapBounds(uint32 creature_id) const
{
return SpellClickInfoMapBounds(mSpellClickInfoMap.lower_bound(creature_id),mSpellClickInfoMap.upper_bound(creature_id));
}
ItemRequiredTargetMapBounds GetItemRequiredTargetMapBounds(uint32 uiItemEntry) const
{
return ItemRequiredTargetMapBounds(m_ItemRequiredTarget.lower_bound(uiItemEntry),m_ItemRequiredTarget.upper_bound(uiItemEntry));
@@ -921,6 +930,8 @@ class ObjectMgr
ScriptNameMap m_scriptNames;
SpellClickInfoMap mSpellClickInfoMap;
ItemRequiredTargetMap m_ItemRequiredTarget;
typedef std::vector<LocaleConstant> LocalForIndex;