Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions LuaAPIDocs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down