mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 20:56:23 +00:00
feat(Core/Scripting): Add hook for applying weapon damage (#20350)
Add hook for applying weapon damage
This commit is contained in:
@@ -644,6 +644,11 @@ void ScriptMgr::OnApplyEnchantmentItemModsBefore(Player* player, Item* item, Enc
|
||||
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_APPLY_ENCHANTMENT_ITEM_MODS_BEFORE, script->OnApplyEnchantmentItemModsBefore(player, item, slot, apply, enchant_spell_id, enchant_amount));
|
||||
}
|
||||
|
||||
void ScriptMgr::OnApplyWeaponDamage(Player* player, uint8 slot, ItemTemplate const* proto, float& minDamage, float& maxDamage, uint8 damageIndex)
|
||||
{
|
||||
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_APPLY_WEAPON_DAMAGE, script->OnApplyWeaponDamage(player, slot, proto, minDamage, maxDamage, damageIndex));
|
||||
}
|
||||
|
||||
bool ScriptMgr::CanArmorDamageModifier(Player* player)
|
||||
{
|
||||
CALL_ENABLED_BOOLEAN_HOOKS(PlayerScript, PLAYERHOOK_CAN_ARMOR_DAMAGE_MODIFIER, !script->CanArmorDamageModifier(player));
|
||||
|
||||
@@ -150,6 +150,7 @@ enum PlayerHook
|
||||
PLAYERHOOK_ON_CUSTOM_SCALING_STAT_VALUE,
|
||||
PLAYERHOOK_ON_APPLY_ITEM_MODS_BEFORE,
|
||||
PLAYERHOOK_ON_APPLY_ENCHANTMENT_ITEM_MODS_BEFORE,
|
||||
PLAYERHOOK_ON_APPLY_WEAPON_DAMAGE,
|
||||
PLAYERHOOK_CAN_ARMOR_DAMAGE_MODIFIER,
|
||||
PLAYERHOOK_ON_GET_FERAL_AP_BONUS,
|
||||
PLAYERHOOK_CAN_APPLY_WEAPON_DEPENDENT_AURA_DAMAGE_MOD,
|
||||
@@ -547,6 +548,8 @@ public:
|
||||
|
||||
virtual void OnApplyEnchantmentItemModsBefore(Player* /*player*/, Item* /*item*/, EnchantmentSlot /*slot*/, bool /*apply*/, uint32 /*enchant_spell_id*/, uint32& /*enchant_amount*/) { }
|
||||
|
||||
virtual void OnApplyWeaponDamage(Player* /*player*/, uint8 /*slot*/, ItemTemplate const* /*proto*/, float& /*minDamage*/, float& /*maxDamage*/, uint8 /*damageIndex*/) { }
|
||||
|
||||
[[nodiscard]] virtual bool CanArmorDamageModifier(Player* /*player*/) { return true; }
|
||||
|
||||
virtual void OnGetFeralApBonus(Player* /*player*/, int32& /*feral_bonus*/, int32 /*dpsMod*/, ItemTemplate const* /*proto*/, ScalingStatValuesEntry const* /*ssv*/) { }
|
||||
|
||||
@@ -411,6 +411,7 @@ public: /* PlayerScript */
|
||||
void OnCustomScalingStatValue(Player* player, ItemTemplate const* proto, uint32& statType, int32& val, uint8 itemProtoStatNumber, uint32 ScalingStatValue, ScalingStatValuesEntry const* ssv);
|
||||
void OnApplyItemModsBefore(Player* player, uint8 slot, bool apply, uint8 itemProtoStatNumber, uint32 statType, int32& val);
|
||||
void OnApplyEnchantmentItemModsBefore(Player* player, Item* item, EnchantmentSlot slot, bool apply, uint32 enchant_spell_id, uint32& enchant_amount);
|
||||
void OnApplyWeaponDamage(Player* player, uint8 slot, ItemTemplate const* proto, float& minDamage, float& maxDamage, uint8 damageIndex);
|
||||
bool CanArmorDamageModifier(Player* player);
|
||||
void OnGetFeralApBonus(Player* player, int32& feral_bonus, int32 dpsMod, ItemTemplate const* proto, ScalingStatValuesEntry const* ssv);
|
||||
bool CanApplyWeaponDependentAuraDamageMod(Player* player, Item* item, WeaponAttackType attackType, AuraEffect const* aura, bool apply);
|
||||
|
||||
Reference in New Issue
Block a user