mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 18:10:26 +00:00
feat(Core/Scripting): OnBuildValuesUpdate hook (#9961)
This commit is contained in:
@@ -191,6 +191,18 @@ bool ScriptMgr::IsCustomBuildValuesUpdate(Unit const* unit, uint8 updateType, By
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnBuildValuesUpdate(Unit const* unit, uint8 updateType, ByteBuffer& fieldBuffer, Player* target, uint16 index)
|
||||
{
|
||||
auto ret = IsValidBoolScript<UnitScript>([&](UnitScript* script) { return script->OnBuildValuesUpdate(unit, updateType, fieldBuffer, target, index); });
|
||||
|
||||
if (ret && *ret)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ScriptMgr::OnUnitUpdate(Unit* unit, uint32 diff)
|
||||
{
|
||||
ExecuteScript<UnitScript>([&](UnitScript* script)
|
||||
|
||||
@@ -445,6 +445,8 @@ public:
|
||||
|
||||
[[nodiscard]] virtual bool IsCustomBuildValuesUpdate(Unit const* /*unit*/, uint8 /*updateType*/, ByteBuffer& /*fieldBuffer*/, Player const* /*target*/, uint16 /*index*/) { return false; }
|
||||
|
||||
[[nodiscard]] virtual bool OnBuildValuesUpdate(Unit const* /*unit*/, uint8 /*updateType*/, ByteBuffer& /*fieldBuffer*/, Player* /*target*/, uint16 /*index*/) { return false; }
|
||||
|
||||
/**
|
||||
* @brief This hook runs in Unit::Update
|
||||
*
|
||||
@@ -2361,6 +2363,7 @@ public: /* UnitScript */
|
||||
bool IsNeedModHealPercent(Unit const* unit, AuraEffect* auraEff, float& doneTotalMod, SpellInfo const* spellProto);
|
||||
bool CanSetPhaseMask(Unit const* unit, uint32 newPhaseMask, bool update);
|
||||
bool IsCustomBuildValuesUpdate(Unit const* unit, uint8 updateType, ByteBuffer& fieldBuffer, Player const* target, uint16 index);
|
||||
bool OnBuildValuesUpdate(Unit const* unit, uint8 updateType, ByteBuffer& fieldBuffer, Player* target, uint16 index);
|
||||
void OnUnitUpdate(Unit* unit, uint32 diff);
|
||||
|
||||
public: /* MovementHandlerScript */
|
||||
|
||||
Reference in New Issue
Block a user