From 931217d3ba156cecb25fa647bc572630147e60fd Mon Sep 17 00:00:00 2001 From: mekolat Date: Fri, 24 Apr 2015 15:17:04 -0400 Subject: clean global handler --- world/map/npc/009-7/core.txt | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'world/map/npc/009-7') diff --git a/world/map/npc/009-7/core.txt b/world/map/npc/009-7/core.txt index ccbec25a..7ee652d8 100644 --- a/world/map/npc/009-7/core.txt +++ b/world/map/npc/009-7/core.txt @@ -460,3 +460,36 @@ function|script|fightclub_exit if(@Duel_HasPendingRequest) message strcharinfo(0), "You have received a new duel request."; return; } + + + +// ** called on OnPCKilledEvent +function|script|fightclub_event_killed +{ + set @duel_killer, 0; + if(@Duel_Fighter != 1) goto L_End; + if(getmap() != "009-7") goto L_End; + set $@duel_loser, getcharid(3); // grab the rid of the victim + set $@duel_winner, @killerrid; // grab the rid of the killer + set @killerrid, 0; // reset killerid + callfunc "fightclub_death"; + goto L_End; +L_End: + if(getpvpflag(0) == $@Duel_Channel) setpvpflag @previous_channel; + return; +} + +// ** called on OnPCDieEvent +function|script|fightclub_event_die +{ + set @duel_killer, 0; + if(@Duel_Fighter != 1) goto L_End; + if(getmap() != "009-7") goto L_End; + set @killerrid, 0; // since the player was not murdered, the killerrid is 0 + set $@duel_loser, getcharid(3); // grab the rid of the victim + callfunc "fightclub_death"; + goto L_End; +L_End: + if(getpvpflag(0) == $@Duel_Channel) setpvpflag @previous_channel; + return; +} -- cgit v1.2.3-60-g2f50