mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-07 04:47:45 +00:00
feat(Core/Scripting): Implement OnLoadSpellCustomAttr global hook (#10469)
This commit is contained in:
@@ -153,3 +153,11 @@ bool ScriptMgr::OnSpellHealingBonusTakenNegativeModifiers(Unit const* target, Un
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ScriptMgr::OnLoadSpellCustomAttr(SpellInfo* spell)
|
||||
{
|
||||
ExecuteScript<GlobalScript>([&](GlobalScript* script)
|
||||
{
|
||||
script->OnLoadSpellCustomAttr(spell);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1531,6 +1531,9 @@ public:
|
||||
|
||||
// Called when checking for spell negative healing modifiers
|
||||
virtual bool OnSpellHealingBonusTakenNegativeModifiers(Unit const* /*target*/, Unit const* /*caster*/, SpellInfo const* /*spellInfo*/, float& /*val*/) { return false; };
|
||||
|
||||
// Called after loading spell dbc corrections
|
||||
virtual void OnLoadSpellCustomAttr(SpellInfo* /*spell*/) { }
|
||||
};
|
||||
|
||||
class BGScript : public ScriptObject
|
||||
@@ -2350,6 +2353,7 @@ public: /* GlobalScript */
|
||||
void OnBeforeWorldObjectSetPhaseMask(WorldObject const* worldObject, uint32& oldPhaseMask, uint32& newPhaseMask, bool& useCombinedPhases, bool& update);
|
||||
bool OnIsAffectedBySpellModCheck(SpellInfo const* affectSpell, SpellInfo const* checkSpell, SpellModifier const* mod);
|
||||
bool OnSpellHealingBonusTakenNegativeModifiers(Unit const* target, Unit const* caster, SpellInfo const* spellInfo, float& val);
|
||||
void OnLoadSpellCustomAttr(SpellInfo* spell);
|
||||
|
||||
public: /* Scheduled scripts */
|
||||
uint32 IncreaseScheduledScriptsCount() { return ++_scheduledScripts; }
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "SpellAuraDefines.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "World.h"
|
||||
|
||||
bool IsPrimaryProfessionSkill(uint32 skill)
|
||||
@@ -3403,6 +3404,8 @@ void SpellMgr::LoadSpellCustomAttr()
|
||||
}
|
||||
}
|
||||
spellInfo->_InitializeExplicitTargetMask();
|
||||
|
||||
sScriptMgr->OnLoadSpellCustomAttr(spellInfo);
|
||||
}
|
||||
|
||||
// Xinef: addition for binary spells, ommit spells triggering other spells
|
||||
|
||||
Reference in New Issue
Block a user