diff options
author | mekolat <mekolat@users.noreply.github.com> | 2015-04-24 15:17:04 -0400 |
---|---|---|
committer | mekolat <mekolat@users.noreply.github.com> | 2015-04-24 15:17:04 -0400 |
commit | 931217d3ba156cecb25fa647bc572630147e60fd (patch) | |
tree | 25f2e399205e3153b0df8b862d1c213aab029d15 /world/map/npc/009-7 | |
parent | e8a1900fc0651a3ee74ce4cbe181fce2851f6420 (diff) | |
download | serverdata-931217d3ba156cecb25fa647bc572630147e60fd.tar.gz serverdata-931217d3ba156cecb25fa647bc572630147e60fd.tar.bz2 serverdata-931217d3ba156cecb25fa647bc572630147e60fd.tar.xz serverdata-931217d3ba156cecb25fa647bc572630147e60fd.zip |
clean global handler
Diffstat (limited to 'world/map/npc/009-7')
-rw-r--r-- | world/map/npc/009-7/core.txt | 33 |
1 files changed, 33 insertions, 0 deletions
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; +} |