mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[8016] Work at npc click table data use.
* 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
This commit is contained in:
parent
08fe4933c5
commit
5254a498df
9 changed files with 106 additions and 30 deletions
|
|
@ -98,11 +98,17 @@ extern ScriptMapMap sEventScripts;
|
|||
struct SpellClickInfo
|
||||
{
|
||||
uint32 spellId;
|
||||
uint32 questId;
|
||||
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
|
||||
{
|
||||
|
|
@ -531,7 +537,6 @@ class ObjectMgr
|
|||
void LoadReputationOnKill();
|
||||
void LoadPointsOfInterest();
|
||||
|
||||
SpellClickInfoMap mSpellClickInfoMap;
|
||||
void LoadNPCSpellClickSpells();
|
||||
|
||||
void LoadWeatherZoneChances();
|
||||
|
|
@ -756,6 +761,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));
|
||||
|
|
@ -819,6 +829,8 @@ class ObjectMgr
|
|||
|
||||
ScriptNameMap m_scriptNames;
|
||||
|
||||
SpellClickInfoMap mSpellClickInfoMap;
|
||||
|
||||
ItemRequiredTargetMap m_ItemRequiredTarget;
|
||||
|
||||
typedef std::vector<LocaleConstant> LocalForIndex;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue