From 51df2c6e71dcf7b4e5bca9bc10158ac326cfcaf2 Mon Sep 17 00:00:00 2001 From: Lance Date: Sun, 19 Mar 2006 05:14:59 +0000 Subject: * Fixed event_kill_pc to behave like what it should instead of another replication of event_death. Added script function rid2name to convert bl ids to name. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5663 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/pc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/map/pc.c') diff --git a/src/map/pc.c b/src/map/pc.c index 2a47ab2ae..970f2b347 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -5332,15 +5332,16 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage) if (sd->state.event_death) pc_setglobalreg(sd,"killerrid",(ssd->status.account_id)); if (ssd->state.event_kill_pc) { + pc_setglobalreg(ssd, "killedrid", sd->bl.id); if (script_config.event_script_type == 0) { struct npc_data *npc; if ((npc = npc_name2id(script_config.kill_pc_event_name))) { - run_script(npc->u.scr.script,0,sd->bl.id,npc->bl.id); // PCKillPC [Lance] + run_script(npc->u.scr.script,0,ssd->bl.id,npc->bl.id); // PCKillPC [Lance] ShowStatus("Event '"CL_WHITE"%s"CL_RESET"' executed.\n", script_config.kill_pc_event_name); } } else { ShowStatus("%d '"CL_WHITE"%s"CL_RESET"' events executed.\n", - npc_event_doall_id(script_config.kill_pc_event_name, sd->bl.id), script_config.kill_pc_event_name); + npc_event_doall_id(script_config.kill_pc_event_name, ssd->bl.id), script_config.kill_pc_event_name); } } if (battle_config.pk_mode && ssd->status.manner >= 0 && battle_config.manner_system) { @@ -5367,6 +5368,8 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage) // To-do: Receive exp on certain occasions } } + } else { + pc_setglobalreg(sd, "killerrid", 0); } if (sd->state.event_death) { -- cgit v1.2.3-70-g09d2