From 64a4adaa06f1059c4ac705199d5a0716c8edef60 Mon Sep 17 00:00:00 2001 From: mekolat Date: Tue, 4 Nov 2014 13:01:07 -0500 Subject: fix fight club => v0.4 disallow towel inside ring kill on exit replace killer var with duel_killer remove nosave trigger restart on enable/disable remove accept/decline notification fix ring x2 and y2 forbid betsanc and asorm fix password var in debug allow random passwords handle all effects do not accept if not present fix rules check map too warp randomly on death fallthrough if no acceptable requests use bitmasking instead of modulo remove resave simplify goback do not re-declare randompassword password minigame --- world/map/npc/009-7/rouge.txt | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'world/map/npc/009-7/rouge.txt') diff --git a/world/map/npc/009-7/rouge.txt b/world/map/npc/009-7/rouge.txt index bf872566..c8c4dfaa 100644 --- a/world/map/npc/009-7/rouge.txt +++ b/world/map/npc/009-7/rouge.txt @@ -11,10 +11,11 @@ L_CallDebug: goto L_Main; L_Main: - mes "[Rouge]"; + set @requests, 0; if(@Duel_Queue$[0] != "") goto L_Queue; + mes "[Rouge]"; mes "Welcome to the Sanguine Vault's duel arena."; - if(($fightclub_enabled % 5) != 3) goto L_Disabled; + if($SANGUINE & $@SV_FCDBit != 0) goto L_Disabled; mes "What do you want to do?"; menu "See the commands.", L_Challenge, @@ -25,7 +26,13 @@ L_Queue: set @caster_name$, @Duel_Queue$[0]; set @target_name$, strcharinfo(0); set @target, getcharid(3, @caster_name$); + set $@my_rid, getcharid(3); set @Duel_Queue$[0], ""; + if(attachrid(@target) != 1) goto L_Missing; + if(getmap() != "009-7") goto L_Missing; + if(attachrid($@my_rid) != 1) goto L_End; + set @requests, (@requests + 1); + set $@my_rid, 0; // clean this ASAP mes @caster_name$ + " wishes to challenge you to a duel."; mes ""; callfunc "fightclub_getrules"; @@ -37,6 +44,7 @@ L_Queue: "No.", L_Decline; L_ShiftQueue: // here we shift the array to the left + if((@Duel_Queue$[@loop] == "" ) && (@requests < 1)) goto L_Main; if(@Duel_Queue$[@loop] == "") goto L_End; set @Duel_Queue$[(@loop - 1)], @Duel_Queue$[@loop]; set @Duel_Queue$[@loop], ""; @@ -46,17 +54,20 @@ L_ShiftQueue: // here we shift the array to the left L_Accept: callfunc "fightclub_AddToQueue"; - message @caster_name$, @target_name$ + " Accepted your offer."; set @loop, 1; goto L_ShiftQueue; L_Decline: - message @caster_name$, @target_name$ + " turned down your offer."; set @loop, 1; goto L_ShiftQueue; +L_Missing: + if(attachrid($@my_rid) != 1) goto L_End; + set $@my_rid, 0; // clean this ASAP + goto L_Decline; + L_Challenge: - if(($fightclub_enabled % 5) != 3) goto L_Disabled; + if($SANGUINE & $@SV_FCDBit != 0) goto L_Disabled; next; mes "[Rouge]"; mes "To challenge a player to a duel, you need to write this command:"; -- cgit v1.2.3-60-g2f50