Closed Pospelove closed 1 year ago
Please make sure that this API will not call JS if no callback is registered
Hits often happen during gameplay. We don't want our server to overload.
Maybe we should introduce smth like vanilla conditions system to only call into javascript when certain conditions are met.
won't fix for now
there is mp.onActivate. That's how we use this event in gamemode:
https://github.com/skyrim-multiplayer/skymp/blob/1907af820a749b83fc8fb52dfc83a2be07750834/skymp5-functions-lib/src/mpApiInteractor.ts#L65
the task is to add onHit in the same way.
onHit callback should accept hit caster and target ids, damage that would be made.
onHit callback should return modified damage.
So we will be able to change damage in gamemode dynamically.