From f61568503d48e879db10a41d4fcc7731b03c65e8 Mon Sep 17 00:00:00 2001 From: Felipe Renault <40004649+FelipeRenault@users.noreply.github.com> Date: Mon, 23 Mar 2020 23:02:49 -0300 Subject: [PATCH] Updating GetHitChance register method --- LuaAPIDocs.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/LuaAPIDocs.md b/LuaAPIDocs.md index f426cc26..89ff584e 100644 --- a/LuaAPIDocs.md +++ b/LuaAPIDocs.md @@ -529,10 +529,11 @@ local function YourHitChanceFunction(attacker, target) return hitChance end -Ext.GetHitChance = YourHitChanceFunction -Ext.EnableStatOverride("HitChance") +Ext.RegisterListener("GetHitChance", YourHitChanceFunction) ``` +The Register Listener for `GetHitChance` should be declared on both `BootstrapClient.lua` and `BootstrapServer.lua`. + Be aware that the Hit Chance Calculation considers a lot of variables, including checking if the target is incapacitated. To better approximate vanilla behavior, it is recommended to replicate the majority of the features present on the vanilla's code, changing only what you want to change. The complete code is available at: https://gist.github.com/Norbyte/e49cbff75e985f4558f0dbd6969d715c