diff options
author | Wushin <pasekei@gmail.com> | 2015-04-30 00:19:27 -0500 |
---|---|---|
committer | Wushin <pasekei@gmail.com> | 2015-04-30 00:19:27 -0500 |
commit | 86cc243c069b90c3eb47df1faede506822634f4a (patch) | |
tree | 06fa0213f689fc1e5dd3ef03b99eed1b427bf7b0 /world/map/npc/009-7 | |
parent | 17a8452f5a55f93f7d38e027b69d98445daabdef (diff) | |
parent | a413653361e218695fa6305d760c22458ac78657 (diff) | |
download | serverdata-86cc243c069b90c3eb47df1faede506822634f4a.tar.gz serverdata-86cc243c069b90c3eb47df1faede506822634f4a.tar.bz2 serverdata-86cc243c069b90c3eb47df1faede506822634f4a.tar.xz serverdata-86cc243c069b90c3eb47df1faede506822634f4a.zip |
Merge pull request #346 from mekolat/global-handler
onlogin & cleanup
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; +} |