Skip to content

Commit

Permalink
Adds var 'killedrid' to script monster OnKillEvents. (Closes #1278)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeybla committed May 20, 2016
1 parent 2b61f45 commit 5b35e1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion doc/script_commands.txt
Expand Up @@ -5628,7 +5628,8 @@ The only very special thing about this command is an event label, which is an
optional parameter. This label is written like '<NPC object name>::<label name>'
and upon the monster being killed, it will execute the script inside of the
specified NPC object starting from the label given. The RID of the player
attached at this execution will be the RID of the killing character.
attached at this execution will be the RID of the killing character. The variable
'killedrid' is set to the Class (mob ID) of the monster killed.

<size> can be:
0 = medium (default)
Expand Down
2 changes: 2 additions & 0 deletions src/map/mob.c
Expand Up @@ -2790,9 +2790,11 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)

if( md->npc_event[0] && !md->state.npc_killmonster ) {
if( sd && battle_config.mob_npc_event_type ) {
pc_setparam(sd, SP_KILLEDRID, md->mob_id);
pc_setparam(sd, SP_KILLERRID, sd->bl.id);
npc_event(sd,md->npc_event,0);
} else if( mvp_sd ) {
pc_setparam(mvp_sd, SP_KILLEDRID, md->mob_id);
pc_setparam(mvp_sd, SP_KILLERRID, sd?sd->bl.id:0);
npc_event(mvp_sd,md->npc_event,0);
} else
Expand Down

0 comments on commit 5b35e1a

Please sign in to comment.