From ef1cac570726f59c821ebafd1980302c0035d3ce Mon Sep 17 00:00:00 2001 From: Fate Date: Tue, 30 Dec 2008 04:15:32 -0700 Subject: Added OnPCDieEvent and OnPCKillEvent label support --- src/map/pc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/map/pc.c') diff --git a/src/map/pc.c b/src/map/pc.c index bed6fc6..0d9e1ff 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -5067,6 +5067,9 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage) return 0; } + + // Character is dead! + sd->status.hp = 0; // [Fate] Stop quickregen sd->quick_regeneration_hp.amount = 0; @@ -5213,6 +5216,15 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage) pc_setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,0); } + if (src && src->type == BL_PC) { + // [Fate] PK death, trigger scripts + argrec_t arg; + arg.name = "@killerrid"; + arg.v.i = src->id; + npc_event_doall_l("OnPCKillEvent", sd->bl.id, 1, &arg); + } + npc_event_doall_l("OnPCDieEvent", sd->bl.id, 0, NULL); + return 0; } -- cgit v1.2.3-70-g09d2