Skip to content

Expose X and Y of killed mob to OnMobKillEvent script event (for slime split, etc)

Hello TMW requested to merge Hello/tmwa:mob-coordinates-on-death into master

Rationale:

OnMobKillEvent invoked under PLAYER's RID - so using e.g. POS_X and POS_Y returns PLAYER's coordinates when kill occured. The only extra data available been @mobID - giving killed mob's type (class). However, to "split" slimes I need to spawn few new mobs right on location where kill occured - or some area around this spot, not player's X/Y.

This commit exposes 2 new variables set by server, @mob_X and @mob_Y containing mob's X and Y coordinates when kill happened.

This is server-code change needed by relevant scripts. Scripts itself would be landed a bit later to serverdata.

NB: this has been tested on my local server to compile without warning, and actually works. However extra review wouldn't hurt.

Edited by Hello TMW

Merge request reports