Merge pull request #1286 from Jeybla/add_1278

Adds var 'killedrid' to script monster OnKillEvents. (Closes #1278)

Thanks to @Jeybla - tested by @Stolao and confirmed as working.
This commit is contained in:
Lemongrass3110
2016-05-20 12:49:45 +02:00
2 changed files with 4 additions and 1 deletions

View File

@@ -5633,7 +5633,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)

View File

@@ -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