diff options
author | gumi <mekolat@users.noreply.github.com> | 2017-11-20 21:34:45 -0500 |
---|---|---|
committer | gumi <mekolat@users.noreply.github.com> | 2017-11-20 21:34:45 -0500 |
commit | 1a2c53aeeb93e352a5fc2e4d0fecbb2492b901bb (patch) | |
tree | e21d0ed234bebb451e13db527f7d63ac34a1b1c4 /world | |
parent | e25a361d9b1014b4f782df06851f3eb4b0b733fc (diff) | |
download | serverdata-1a2c53aeeb93e352a5fc2e4d0fecbb2492b901bb.tar.gz serverdata-1a2c53aeeb93e352a5fc2e4d0fecbb2492b901bb.tar.bz2 serverdata-1a2c53aeeb93e352a5fc2e4d0fecbb2492b901bb.tar.xz serverdata-1a2c53aeeb93e352a5fc2e4d0fecbb2492b901bb.zip |
fightclub removal
Diffstat (limited to 'world')
-rw-r--r-- | world/map/data/009-7.wlk | bin | 22504 -> 22504 bytes | |||
-rw-r--r-- | world/map/npc/009-2/_warps.txt | 1 | ||||
-rw-r--r-- | world/map/npc/009-7/_import.txt | 5 | ||||
-rw-r--r-- | world/map/npc/009-7/_warps.txt | 2 | ||||
-rw-r--r-- | world/map/npc/009-7/core.txt | 495 | ||||
-rw-r--r-- | world/map/npc/009-7/debug.txt | 166 | ||||
-rw-r--r-- | world/map/npc/009-7/eventHandler.txt | 125 | ||||
-rw-r--r-- | world/map/npc/009-7/mapflags.txt | 3 | ||||
-rw-r--r-- | world/map/npc/009-7/rouge.txt | 131 | ||||
-rw-r--r-- | world/map/npc/009-7/trapdoor.txt | 63 | ||||
-rw-r--r-- | world/map/npc/functions/global_event_handler.txt | 2 |
11 files changed, 3 insertions, 990 deletions
diff --git a/world/map/data/009-7.wlk b/world/map/data/009-7.wlk Binary files differindex ed9615d7..ce0988e0 100644 --- a/world/map/data/009-7.wlk +++ b/world/map/data/009-7.wlk diff --git a/world/map/npc/009-2/_warps.txt b/world/map/npc/009-2/_warps.txt index c0db523b..eae3c9d2 100644 --- a/world/map/npc/009-2/_warps.txt +++ b/world/map/npc/009-2/_warps.txt @@ -22,3 +22,4 @@ 009-2,46,50|warp|-1,-1,009-2,76,78 009-2,77,78|warp|-1,-1,009-2,47,50 009-2,31,91|warp|-1,-1,009-1,59,41 +009-2,38,105|warp|-1,-1,009-7,21,20 diff --git a/world/map/npc/009-7/_import.txt b/world/map/npc/009-7/_import.txt index a064a519..a612f080 100644 --- a/world/map/npc/009-7/_import.txt +++ b/world/map/npc/009-7/_import.txt @@ -5,10 +5,5 @@ npc: npc/009-7/_mobs.txt npc: npc/009-7/_nodes.txt npc: npc/009-7/_warps.txt npc: npc/009-7/battlemaster.txt -npc: npc/009-7/core.txt -npc: npc/009-7/debug.txt npc: npc/009-7/eventHandler.txt -npc: npc/009-7/mapflags.txt -npc: npc/009-7/rouge.txt npc: npc/009-7/shops.txt -npc: npc/009-7/trapdoor.txt diff --git a/world/map/npc/009-7/_warps.txt b/world/map/npc/009-7/_warps.txt index 96c62fea..dd129692 100644 --- a/world/map/npc/009-7/_warps.txt +++ b/world/map/npc/009-7/_warps.txt @@ -1,4 +1,4 @@ // This file is generated automatically. All manually added changes will be removed when running the Converter. // The Sanguine Vault warps -009-7,21,19|warp|-1,-1,009-2,38,103 +009-7,21,19|warp|-1,-1,009-2,38,104 diff --git a/world/map/npc/009-7/core.txt b/world/map/npc/009-7/core.txt deleted file mode 100644 index e1f0b58d..00000000 --- a/world/map/npc/009-7/core.txt +++ /dev/null @@ -1,495 +0,0 @@ -// this file contains the game logic of the fight club - -function|script|fightclub_sendrequest -{ - goto L_try; - -L_try: - set @loop, 0; - goto L_Loop; - -L_Loop: - if(@Duel_Queue$[@loop] == @caster_name$) goto L_Exists; - if((@Duel_Queue$[@loop] == "") && (@Duel_Queue$[(@loop + 1)] == "")) goto L_Proceed; - if((@Duel_Queue$[@loop] == "") && (@Duel_Queue$[(@loop + 1)] != "")) goto L_ShiftQueue; - set @loop, (@loop + 1); - if(@loop >= getarraysize(@Duel_Queue)) goto L_Full; // this shouldn't happen since we check in magic but we still handle it - goto L_Loop; - -L_ShiftQueue: - set @Duel_Queue$[@loop], @Duel_Queue$[(@loop + 1)]; - set @Duel_Queue[@loop], @Duel_Queue[(@loop + 1)]; - set @Duel_Queue$[(@loop + 1)], ""; - set @Duel_Queue[(@loop + 1)], 0; - set @loop, (@loop + 1); - if(@loop >= getarraysize(@Duel_Queue)) goto L_try; - goto L_ShiftQueue; - -L_Full: - message @caster_name$, "There is already "+ $@Duel_PlayerQueueLimit +" duel request(s) in the queue of this player, which is the maximum."; - return; - -L_Exists: - message @caster_name$, "You already requested a duel with this player."; - return; - -L_Proceed: - misceffect FX_MAGIC_DARKRED, @caster_name$; - message @caster_name$, "Your request has been sent."; - set @Duel_Queue$[@loop], @caster_name$; - set @Duel_Queue[@loop], gettimetick(2); - if(@Duel_Fighter == 0) message strcharinfo(0), "You have received a new duel request. Talk to Rouge to accept or decline."; - if(@Duel_Fighter == 0) misceffect FX_MAGIC_DARKRED, strcharinfo(0); - if(@Duel_Fighter == 1) set @Duel_HasPendingRequest, 1; - return; -} - -function|script|fightclub_getrules -{ - set $@fightclub_myself, getcharid(3); - if(@target < 1) goto L_Proceed; // get our own rules - if(attachrid(@target) == 1) goto L_Proceed; - goto L_Missing; - -L_Proceed: - set $@Temp_NoMagic, (DUELS & $@NoMagicBit); - if($@fightclub_myself == getcharid(3)) goto L_Proceed2; // the target is ourselves - if(attachrid($@fightclub_myself) == 1) goto L_Proceed2; - goto L_Missing; - -L_Missing: - return; - -L_Proceed2: - set $@fightclub_myself, 0; - set @target, 0; - if($@Temp_NoMagic == 0) - mes "(no rules)"; - if($@Temp_NoMagic != 0) mes "- No Magic"; - set $@Temp_NoMagic, 0; // now we clean these vars ASAP because they're globals - return; -} - -// ** called when someone agree to duel -function|script|fightclub_AddToQueue -{ - set @ATQ_Loop, 0; - goto L_Loop; - -L_Loop: - if(($@Duel_Queue_Blue$[@ATQ_Loop] == @caster_name$) && ($@Duel_Queue_Red$[@ATQ_Loop] == @target_name$)) goto L_Exists; - if(($@Duel_Queue_Red$[@ATQ_Loop] == @caster_name$) && ($@Duel_Queue_Blue$[@ATQ_Loop] == @target_name$)) goto L_Exists; - set @ATQ_Loop, (@ATQ_Loop + 1); - if(@ATQ_Loop >= getarraysize($@Duel_Queue_ID)) goto L_Proceed2; - goto L_Loop; - -L_Exists: - mes "This battle is already in the queue."; - return; - -L_Full: - mes "There is already " + $@Duel_QueueLimit + " battles in the queue, which is the maximum. Please try again later."; - return; - -L_Proceed2: - if(getarraysize($@Duel_Queue_ID) >= ($@Duel_QueueLimit + 1)) goto L_Full; - set @index, getarraysize($@Duel_Queue_ID); - if(@index >= 1) goto L_Proceed22; - set @index, 1; - goto L_Proceed22; - -L_Proceed22: - if($@Duel_Queue_Red$[@index] != "") goto L_NotClean; - set $@Duel_Queue_Red$[@index], @caster_name$; - if($@Duel_Queue_Blue$[@index] != "") goto L_NotClean; - set $@Duel_Queue_Blue$[@index], @target_name$; - if($@Duel_Queue_ID[@index] != 0) goto L_NotClean; - set $@Duel_Queue_ID[@index], ($@Duel_Queue_ID[(@index - 1)] + 1); - if($@Duel_Queue_ID[@index] <= $Duel_LastDuel) goto L_FixId; - return; - -L_NotClean: - message @caster_name$, "An error occured: array element not empty. Try again in 5 seconds."; - return; - -L_FixId: - set $@Duel_Queue_ID[@index], ($Duel_LastDuel + 1); - return; -} - -// ** called when a duel is finished -function|script|fightclub_NextBattle -{ - set $@Duel_Queue_Blue$[0], ""; // clean the 0 index - set $@Duel_Queue_Red$[0], ""; - set $@Duel_Queue_ID[0], 0; - set $@Duel_Loop, 1; // start the loop at 1 - goto L_Loop; - -L_Loop: // here we shift the array to the left - if($@Duel_Queue_ID[$@Duel_Loop] < 1) goto L_Empty; - set $@Duel_Queue_Red$[($@Duel_Loop - 1)], $@Duel_Queue_Red$[$@Duel_Loop]; - set $@Duel_Queue_Red$[$@Duel_Loop], ""; // it is always important to clean - set $@Duel_Queue_Blue$[($@Duel_Loop - 1)], $@Duel_Queue_Blue$[$@Duel_Loop]; - set $@Duel_Queue_Blue$[$@Duel_Loop], ""; - set $@Duel_Queue_ID[($@Duel_Loop - 1)], $@Duel_Queue_ID[$@Duel_Loop]; - set $@Duel_Queue_ID[$@Duel_Loop], 0; - set $@Duel_Loop, ($@Duel_Loop + 1); - if($@Duel_Loop >= getarraysize($@Duel_Queue_ID)) goto L_Proceed; - goto L_Loop; - -L_Empty: - // the queue is now empty - return; - -L_Proceed: - callfunc "fightclub_CleanStage"; - set $@Duel_CurrentDuel, $@Duel_Queue_ID[0]; // since the array is shifted, the index is always 0 - set $Duel_LastDuel, $@Duel_Queue_ID[0]; // this is used to keep the same index across reboots - set $@Duel_BluePlayer, getcharid(3,$@Duel_Queue_Blue$[0]); - set $@Duel_RedPlayer, getcharid(3,$@Duel_Queue_Red$[0]); - if(attachrid($@Duel_BluePlayer) != 1) goto L_Missing; - if(attachrid($@Duel_RedPlayer) == 1) goto L_Proceed2; - goto L_Missing; - -L_Missing: - callfunc "fightclub_CleanStage"; - callfunc "fightclub_NextBattle"; - return; - -L_Proceed2: - addtimer ($@Duel_TimeBeforeNext * 1000), "#FightClubUtils::OnDelayedNextBattle"; - return; -} - -// ** called after the delay -function|script|fightclub_NextBattleProceed -{ - set $@Duel_NoMagic, 0; - if((DUELS & $@NoMagicBit) != 0) set $@Duel_NoMagic, 1; // get the rules of the caster - donpcevent "Rouge#Duels::OnAnnounceNext"; - set $@Duel_Started, 0; - addtimer ($@Duel_TimeBeforeWarp * 1000), "#FightClubUtils::OnDelayedStart"; - return; -} - -function|script|fightclub_StartBattle -{ - set $@Duel_Started, 1; - npcwarp 40, 45, "Rouge#Duels"; - donpcevent "#FightClubTimeLimit::OnStartTimer"; - if(attachrid($@Duel_RedPlayer) != 1) goto L_Missing; - callfunc "fightclub_enter"; - if(attachrid($@Duel_BluePlayer) != 1) goto L_Missing; - callfunc "fightclub_enter"; - return; - -L_Missing: - callfunc "fightclub_CleanStage"; - callfunc "fightclub_NextBattle"; - return; -} - -function|script|fightclub_TimeOut -{ - donpcevent "Rouge#Duels::OnAnnounceTimeOut"; - if(attachrid($@Duel_RedPlayer) != 1) goto L_Missing; - callfunc "fightclub_exit"; - if(attachrid($@Duel_BluePlayer) != 1) goto L_Missing; - callfunc "fightclub_exit"; - callfunc "fightclub_CleanStage"; - callfunc "fightclub_NextBattle"; - return; - -L_Missing: - callfunc "fightclub_CleanStage"; - callfunc "fightclub_NextBattle"; - return; -} - -// ** called when someone uninvited is on stage -function|script|fightclub_Intrusion -{ - // nothing to do here (yet) - return; -} - -function|script|fightclub_EmergencyWipe -{ - callfunc "fightclub_CleanStage"; - callfunc "fightclub_StartUp"; - // TODO: check if everything is clean (function) and mapexit otherwise - return; -} - -// ** called whenever someone wins (to handle rewards and bids) -function|script|fightclub_Victory -{ - // TODO: give some sort of reward - // TODO: increase score - // TODO: update leaderboard - return; -} - -// ** called when the player needs to be reset -function|script|fightclub_DestroyMe -{ - set @Duel_Fighter, 0; - setpvpchannel @previous_channel; - sc_end 132; sc_end 14; sc_end 37; sc_end 185; sc_end 194; sc_end 195; sc_end 196; sc_end 197; sc_end 198; sc_end 199; // remove effects - heal MaxHp, MaxSp; // refill hp/mana - if(getmap() == "009-7") warp "009-7", rand($@fightclub_x1, $@fightclub_x2), rand(($@fightclub_y1 - 2), ($@fightclub_y1 - 3)); - return; -} - -// ** called when the red or blue player disappears from stage -function|script|fightclub_Missing -{ - // $@Duel_Missing 1 = red, 2 = blue - if (attachrid($@Duel_BluePlayer) == 1) goto L_Proceed; // we need to attach to at least one player - if (attachrid($@Duel_RedPlayer) == 1) goto L_Proceed; - goto L_Resume; // can't attach either of them (this is not a problem since it means they are offline so their vars are clean anyway) - -L_Proceed: - if($@Duel_Missing == 1) goto L_BlueWins; - goto L_RedWins; - -L_BlueWins: - donpcevent "Rouge#Duels::OnAnnounceBlueForfeit"; - set $@duel_winner, $@Duel_BluePlayer; - callfunc "fightclub_Victory"; - goto L_Clean; - -L_RedWins: - donpcevent "Rouge#Duels::OnAnnounceRedForfeit"; - set $@duel_winner, $@Duel_RedPlayer; - callfunc "fightclub_Victory"; - goto L_Clean; - -L_KillBlue: - callfunc "fightclub_exit"; - if(attachrid($@Duel_RedPlayer) == 1) goto L_KillRed; - goto L_Resume; - -L_KillRed: - callfunc "fightclub_exit"; - goto L_Resume; - -L_Clean: - if(attachrid($@Duel_BluePlayer) == 1) goto L_KillBlue; - if(attachrid($@Duel_RedPlayer) == 1) goto L_KillRed; - goto L_Resume; // couldn't kill them - -L_Resume: - callfunc "fightclub_CleanStage"; - callfunc "fightclub_NextBattle"; - return; -} - -// ** called after the server boots up -function|script|fightclub_StartUp -{ - if($@Duel_TimeBeforeNext < 1) set $@Duel_TimeBeforeNext, 5; // init the (temporary) TimeBeforeNext global - if($@Duel_TimeBeforeWarp < 1) set $@Duel_TimeBeforeWarp, 5; // init the (temporary) TimeBeforeWarp global - if($@Duel_TimeBeforeStart < 1) set $@Duel_TimeBeforeStart, 3; // init the (temporary) TimeBeforeStart global - if($@Duel_TimeLimit < 1) set $@Duel_TimeLimit, 120; // init the (temporary) TimeLimit global - if($@Duel_QueueLimit < 1) set $@Duel_QueueLimit, 5; // init the (temporary) QueueLimit global - if($@Duel_PlayerQueueLimit < 1) set $@Duel_PlayerQueueLimit, 2; // init the (temporary) PlayerQueueLimit global - if($@Duel_PlayerQueueTimeOut < 1) set $@Duel_PlayerQueueTimeOut, 300; // init the (temporary) PlayerQueueTimeOut global - setarray $@Duel_Queue_ID, 0; - cleararray $@Duel_Queue_ID, 0, ($@Duel_QueueLimit + 1); - setarray $@Duel_Queue_Blue$, ""; - cleararray $@Duel_Queue_Blue$, "", ($@Duel_QueueLimit + 1); - setarray $@Duel_Queue_Red$, ""; - cleararray $@Duel_Queue_Red$, "", ($@Duel_QueueLimit + 1); - set $@Duel_TotalTime, 0; - set $@Duel_Channel, 20; - if($fightclub_enabled) set $fightclub_enabled, 0; // this var moved to $SANGUINE - // DUELS flags below - set $@DuelPvpBit, (1 << 1); - set $@NoMagicBit, (1 << 2); - // $SANGUINE flags below - set $@SV_FCDBit, (1 << 1); - set $@SV_BMDBit, (1 << 2); - return; -} - -// ** called before and after each duel to wipe the vars -function|script|fightclub_CleanStage -{ - if($@Duel_NoWarp != 1) areawarp "009-7", $@fightclub_x1, $@fightclub_y1, $@fightclub_x2, $@fightclub_y2, "009-7", 31, 40; // kick all players from stage - set $@Duel_NoWarp, 0; - set $@Duel_NoMagic, 0; // clean the Duel parameters - set $@Duel_CurrentDuel, 0; // no duel atm - set $@Duel_Started, 0; // no duel atm - set $@Duel_RedPlayer, 0; - set $@Duel_BluePlayer, 0; - set $@Duel_Missing, 0; - set $@Duel_TotalTime, 0; - npcwarp 32, 45, "Rouge#Duels"; - donpcevent "#FightClubTimeLimit::OnStopTimer"; - killmonster "009-7", "All"; - return; -} - -// ** called by npc; allows the player to change their custom rules -function|script|fightclub_setrules -{ - goto L_Main; - -L_Main: - mes "Your rules are the following: "; mes ""; - callfunc "fightclub_getrules"; - mes ""; mes "What do you want to do?"; - menu - "Change my rules.", L_Start, - "Nevermind.", L_Return; - -L_Start: - set DUELS, DUELS | $@NoMagicBit; - goto L_NoMagic; - -L_NoMagic: - mes "Do you want to allow magic?"; - mes "If disabled, the fighters will not be able to use any kind of spell."; - menu - "Yes.", L_NoMagicYes, - "No.", L_Done; -L_NoMagicYes: - set DUELS, DUELS &~ $@NoMagicBit; - goto L_Done; - -L_Done: - next; - mes "You have succesfully changed your options."; - goto L_Main; - -L_Return: - return; -} - -// ** called by event handler whenever someone dies -function|script|fightclub_death -{ - if(@Duel_Fighter != 1) goto L_NoDuel; - if(($@Duel_CurrentDuel < 1) || ($@Duel_Started != 1)) goto L_Reset; - if(@killerrid != 0) goto L_Murdered; - goto L_Killed; - -L_Killed: - if(getcharid(3) == $@Duel_RedPlayer) goto L_BlueWins; - goto L_RedWins; - -L_RedWins: - donpcevent "Rouge#Duels::OnAnnounceRedWins"; - set $@duel_winner, $@Duel_RedPlayer; - callfunc "fightclub_Victory"; - callfunc "fightclub_exit"; - if(attachrid($@Duel_RedPlayer) == 1) goto L_RedWins2; - goto L_Missing; - -L_RedWins2: - callfunc "fightclub_exit"; - goto L_Proceed; - -L_BlueWins: - donpcevent "Rouge#Duels::OnAnnounceBlueWins"; - set $@duel_winner, $@Duel_BluePlayer; - callfunc "fightclub_Victory"; - callfunc "fightclub_exit"; - if(attachrid($@Duel_BluePlayer) == 1) goto L_BlueWins2; - goto L_Missing; - -L_Missing: - goto L_Proceed; - -L_BlueWins2: - callfunc "fightclub_exit"; - goto L_Proceed; - -L_Proceed: - callfunc "fightclub_CleanStage"; - return; - -L_Murdered: - if(($@Duel_RedPlayer != @killerrid) && ($@Duel_BluePlayer != @killerrid)) goto L_Stranger; - goto L_Killed; // now we proceed the same way as L_Killed - -L_Stranger: - // the victim was not murdered by its adversary (wtf) - if(debug) donpcevent "Debug#Duels::OnKillerNotInDuel"; - callfunc "fightclub_EmergencyWipe"; - return; - -L_NoDuel: - if(debug) donpcevent "Debug#Duels::OnVictimNotInDuel"; - return; - -L_Reset: // the player has duel_fighter but no duel is ongoing (happens if the player quit before fightclub_exit can be called) - if(debug) donpcevent "Debug#Duels::OnVictimInDuelNoDuel"; - callfunc "fightclub_DestroyMe"; // here we attempt to resume the interrupted procedure - return; -} - -// ** called every time a player enters the ring -function|script|fightclub_enter -{ - set @Duel_Fighter, 1; - warp "009-7", rand($@fightclub_x1,$@fightclub_x2), rand($@fightclub_y1,$@fightclub_y2); - heal MaxHp, MaxSp; // ensure that you can't duel wih a corpse - sc_end 132; sc_end 14; sc_end 37; sc_end 185; sc_end 194; sc_end 195; sc_end 196; sc_end 197; sc_end 198; sc_end 199; // remove effects - message strcharinfo(0), "Get Ready."; - addtimer ($@Duel_TimeBeforeStart * 1000), "#FightClubUtils::OnBecomeKiller"; // call fightclub_enter_killer in 3 seconds - return; -} - -// ** called 3 seconds after a player enters the ring -function|script|fightclub_enter_killer -{ - if(getpvpflag(0) != $@Duel_Channel) set @previous_channel, getpvpflag(0); - setpvpchannel $@Duel_Channel; - message strcharinfo(0), "GO !"; - return; -} - -// ** called every time a player exits the ring -function|script|fightclub_exit -{ - callfunc "fightclub_DestroyMe"; // kill and reset state - message strcharinfo(0), "Thank you for participating in the fight club!"; - 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; -} diff --git a/world/map/npc/009-7/debug.txt b/world/map/npc/009-7/debug.txt deleted file mode 100644 index 997d64f1..00000000 --- a/world/map/npc/009-7/debug.txt +++ /dev/null @@ -1,166 +0,0 @@ -function|script|fightclub_Debug -{ - goto L_Menu; - -L_Menu: - next; - set @bme,0; if($SANGUINE & $@SV_BMDBit == 0) set @bme,1; - set @due,0; if($SANGUINE & $@SV_FCDBit == 0) set @due,1; - mes "---"; - mes "##3$##0Duel_Enabled: ##7" + @due; - mes "##3$##0fightclub_bm_enabled: ##7" + @bme; - mes "##3$##2@##0Duel_TimeBeforeNext: ##7" + $@Duel_TimeBeforeNext; - mes "##3$##2@##0Duel_TimeBeforeWarp: ##7" + $@Duel_TimeBeforeWarp; - mes "##3$##2@##0Duel_TimeBeforeStart: ##7" + $@Duel_TimeBeforeStart; - mes "##3$##2@##0Duel_TimeLimit: ##7" + $@Duel_TimeLimit; - mes "##3$##2@##0Duel_QueueLimit: ##7" + $@Duel_QueueLimit; - mes "##3$##2@##0Duel_PlayerQueueLimit: ##7" + $@Duel_PlayerQueueLimit; - mes "##3$##2@##0Duel_PlayerQueueTimeOut: ##7" + $@Duel_PlayerQueueTimeOut; - mes "##3$##0Duel_LastDuel: ##7" + $Duel_LastDuel + "##0"; - mes "---"; - mes "##2@##0Duel_Fighter: ##7" + @Duel_Fighter + "##0"; - mes "pvp channel: ##7" + getpvpflag(0) + "##0"; - next; - menu - "toggle|Toggle $Duel_Enabled", L_DuelEnabled, - "toggle|Toggle $fightclub_bm_enabled", L_BmEnabled, - "edit|Set $@Duel_TimeBeforeNext", L_TimeBeforeNext, - "edit|Set $@Duel_TimeBeforeWarp", L_TimeBeforeWarp, - "edit|Set $@Duel_TimeBeforeStart", L_TimeBeforeStart, - "edit|Set $@Duel_TimeLimit", L_TimeLimit, - "edit|Set $@Duel_QueueLimit", L_QueueLimit, - "edit|Set $@Duel_PlayerQueueLimit", L_PlayerQueueLimit, - "edit|Set $@Duel_PlayerQueueTimeOut", L_PlayerQueueTimeOut, - "edit|Set $Duel_LastDuel", L_LastDuel, - "edit|Set pvp channel", L_Channel, - "toggle|Toggle @Duel_Fighter", L_DuelFighter, - "restart|Restart fightclub.", L_Restart, - "quit|Nevermind.", L_End; - -L_DuelEnabled: - if(@due < 1) goto L_DuelEnabled2; - set $SANGUINE, $SANGUINE | $@SV_FCDBit; - goto L_Menu; -L_DuelEnabled2: - set $SANGUINE, $SANGUINE &~ $@SV_FCDBit; - goto L_Restart; - -L_BmEnabled: - if(@bme < 1) goto L_BmEnabled2; - set $SANGUINE, $SANGUINE | $@SV_BMDBit; - goto L_Menu; -L_BmEnabled2: - set $SANGUINE, $SANGUINE &~ $@SV_BMDBit; - goto L_Menu; - -L_DuelFighter: - if(@Duel_Fighter < 1) goto L_DuelFighter2; - set @Duel_Fighter, 0; - goto L_Menu; -L_DuelFighter2: - set @Duel_Fighter, 1; - goto L_Menu; - -L_TimeBeforeNext: - mes "range: 1~600"; - input @time; - if((@time < 1) || (@time > 600)) goto L_OutOfRange; - set $@Duel_TimeBeforeNext, @time; - goto L_Menu; - -L_TimeBeforeWarp: - mes "range: 1~600"; - input @time; - if((@time < 1) || (@time > 600)) goto L_OutOfRange; - set $@Duel_TimeBeforeWarp, @time; - goto L_Menu; - -L_TimeBeforeStart: - mes "range: 1~600"; - input @time; - if((@time < 1) || (@time > 600)) goto L_OutOfRange; - set $@Duel_TimeBeforeStart, @time; - goto L_Menu; - -L_TimeLimit: - mes "range: 1~900"; - input @time; - if((@time < 1) || (@time > 900)) goto L_OutOfRange; - set $@Duel_TimeLimit, @time; - goto L_Menu; - -L_QueueLimit: - mes "range: 1~20"; - input @limit; - if((@limit < 1) || (@limit > 20)) goto L_OutOfRange; - set $@Duel_QueueLimit, @limit; - goto L_Menu; - -L_PlayerQueueLimit: - mes "range: 1~5"; - input @limit; - if((@limit < 1) || (@limit > 5)) goto L_OutOfRange; - set $@Duel_PlayerQueueLimit, @limit; - goto L_Menu; - -L_PlayerQueueTimeOut: - mes "range: 30~600"; - input @limit; - if((@limit < 30) || (@limit > 600)) goto L_OutOfRange; - set $@Duel_PlayerQueueTimeOut, @limit; - goto L_Menu; - -L_LastDuel: - mes "range: 1+"; - mes "[R] This will trigger a reboot"; - input @last; - if(@last < 1) goto L_OutOfRange; - set $Duel_LastDuel, @last; - next; - goto L_Restart; - -L_Channel: - mes "range: 0~32767"; - input @chn; - if(@last > 32767) goto L_OutOfRange; - setpvpchannel @chn; - goto L_Menu; - -L_OutOfRange: - mes "Value out of range or empty."; - goto L_Menu; - -L_Restart: - callfunc "fightclub_EmergencyWipe"; - donpcevent "#FightClubHandler::OnTimer2000"; // this re-starts the main timer if it was stopped - mes "The temporary variables have been reset."; - goto L_Menu; - -L_End: - return; -} - -009-7,41,45,0|script|Debug#Duels|181 -{ - mes "The debug menu can also be accessed by wearing a dev cap while talking to Rouge."; - mes "For the documentation, @@https://wiki.themanaworld.org/index.php/User:Meko/FightClub/debug|click here@@##0"; - callfunc "fightclub_Debug"; - end; - -OnInit: - if(!debug) disablenpc "Debug#Duels"; - end; - - // debug messages below -OnKillerNotInDuel: - npctalk strnpcinfo(0), "WARNING: The victim was not killed by its adversary. Aborting duel..."; - end; - -OnVictimNotInDuel: - npctalk strnpcinfo(0), "WARNING: The victim is not part of the duel"; - end; - -OnVictimInDuelNoDuel: - npctalk strnpcinfo(0), "WARNING: The victim is part of the duel but no duel is ongoing at the moment."; - end; -} diff --git a/world/map/npc/009-7/eventHandler.txt b/world/map/npc/009-7/eventHandler.txt index 6f6419ca..421cefed 100644 --- a/world/map/npc/009-7/eventHandler.txt +++ b/world/map/npc/009-7/eventHandler.txt @@ -1,5 +1,3 @@ -// this file handles every events related to the fight club and calls the appropriate functions from core - 009-7,45,33,0|script|#trapdoor2FightClub|327,0,0 { if(countitem(647)||countitem(725)||countitem(1178)||countitem(5131)||countitem(5132)||countitem(5133)||countitem(5134)||countitem(5135)||countitem(5136)||countitem(5137)||countitem(5138)||countitem(5139)||countitem(5140)||(getgmlevel()>=20)) goto L_Enter; @@ -9,130 +7,9 @@ L_Enter: warp "009-7",34,22; // this warp is a special thanks for contributors end; } + 009-7,33,21,0|script|#trapdoor3FightClub|327,0,0 { warp "009-7",44,32; end; } - -009-7,22,38,0|script|#FightClubUtils|32767 -{ - end; - -OnIntrusion: - if(getgmlevel() >= 60) end; // allow GMs to be in the ring - if(getcharid(3) == $@Duel_RedPlayer) end; // do not kill the red fighter - if(getcharid(3) == $@Duel_BluePlayer) end; // do not kill the blue fighter - donpcevent "Rouge#Duels::OnAnnounceIntrusion"; - callfunc "fightclub_DestroyMe"; // only kill the intruder(s) - end; - -OnDelayedStart: - callfunc "fightclub_StartBattle"; - end; - -OnDelayedNextBattle: - callfunc "fightclub_NextBattleProceed"; - end; - -OnBecomeKiller: - callfunc "fightclub_enter_killer"; - end; - -OnCommandIntrusion: - areatimer 0, "009-7", $@fightclub_x1, $@fightclub_y1, $@fightclub_x2, $@fightclub_y2, 0, "#FightClubUtils::OnIntrusion"; // we can not do this directly on #handler because it already have a timer - end; -} - -009-7,20,45,0|script|#FightClubTimeLimit|32767,0,0 -{ - end; - -OnStartTimer: - set $@Duel_TotalTime, 0; - goto L_StartTimer; - -OnStopTimer: - stopnpctimer; - end; - -OnTimer1000: - set $@Duel_TotalTime, ($@Duel_TotalTime + 1); - if($@Duel_TotalTime >= $@Duel_TimeLimit) goto L_TimeOut; - goto L_StartTimer; - -L_TimeOut: - stopnpctimer; - callfunc "fightclub_TimeOut"; - end; - -L_StartTimer: - setnpctimer 0; - initnpctimer; - end; - -OnInit: - set $@Duel_TotalTime, 0; - end; -} - -009-7,20,44,0|script|#FightClubHandler|32767,0,0 -{ - end; - -OnInit: - // this event is called when the map server boots up - set $@fightclub_x1, 27; - set $@fightclub_y1, 42; - set $@fightclub_x2, 38; - set $@fightclub_y2, 48; - callfunc "fightclub_StartUp"; - callfunc "fightclub_CleanStage"; - goto L_StartTimer; - -L_StartTimer: - if($SANGUINE & $@SV_FCDBit != 0) end; - if(debug >= 2) end; - setnpctimer 0; - initnpctimer; - end; - -OnTimer2000: - // this events checks who is on stage every 2 seconds - set $@areausers, getareausers("009-7", $@fightclub_x1, $@fightclub_y1, $@fightclub_x2, $@fightclub_y2); // get the number of players on stage - if (($@areausers > 2) || (($@Duel_CurrentDuel < 1) && ($@areausers >= 1))) goto L_Intrusion; // too many players on the stage - if (($@Duel_CurrentDuel < 1) && ($@Duel_Started != 1)) goto L_Request; // start the next duel - if ($@Duel_Started != 1) goto L_StartTimer; // no intrusion and no duel ongoing so loop again - if (attachrid($@Duel_BluePlayer) == 0) goto L_BlueMissing; - if (isin("009-7", $@fightclub_x1, $@fightclub_y1, $@fightclub_x2, $@fightclub_y2) == 0) goto L_BlueMissing; - if (isdead() == 1) goto L_IAmACorpse; - if (attachrid($@Duel_RedPlayer) == 0) goto L_RedMissing; - if (isin("009-7", $@fightclub_x1, $@fightclub_y1, $@fightclub_x2, $@fightclub_y2) == 0) goto L_RedMissing; - if (isdead() == 1) goto L_IAmACorpse; - detachrid; - goto L_StartTimer; - -L_Request: - callfunc "fightclub_NextBattle"; - goto L_StartTimer; - -L_IAmACorpse: - set $@duel_loser, getcharid(3); - callfunc "fightclub_death"; - goto L_StartTimer; - -L_RedMissing: - set $@Duel_Missing, 1; - callfunc "fightclub_Missing"; - goto L_StartTimer; - -L_BlueMissing: - set $@Duel_Missing, 2; - callfunc "fightclub_Missing"; - goto L_StartTimer; - -L_Intrusion: - donpcevent "#FightClubUtils::OnCommandIntrusion"; // we can not attach a second timer to this npc so we use another one - callfunc "fightclub_Intrusion"; - goto L_StartTimer; -} diff --git a/world/map/npc/009-7/mapflags.txt b/world/map/npc/009-7/mapflags.txt deleted file mode 100644 index b0589894..00000000 --- a/world/map/npc/009-7/mapflags.txt +++ /dev/null @@ -1,3 +0,0 @@ -009-7|mapflag|noteleport -009-7|mapflag|monster_noteleport -009-7|mapflag|nopvp diff --git a/world/map/npc/009-7/rouge.txt b/world/map/npc/009-7/rouge.txt deleted file mode 100644 index b9b8e4cd..00000000 --- a/world/map/npc/009-7/rouge.txt +++ /dev/null @@ -1,131 +0,0 @@ -009-7,32,45,0|script|Rouge#Duels|181 -{ -if (getgmlevel() >= 40 && (getequipid(equip_head) == 647 || getequipid(equip_head) == 725)) goto L_CallDebug; -goto L_Main; - -L_CallDebug: - mes "You are wearing a dev cap: calling debug menu..."; - mes "For the documentation, @@https://wiki.themanaworld.org/index.php/FightClub|click here@@##0"; - callfunc "fightclub_Debug"; - goto L_End; - -L_Main: - set @requests, 0; - if(@Duel_Queue$[0] != "") goto L_Queue; - if(@Duel_Queue$[1] != "") goto L_Decline; // if the user previously closed without declining we resume the procedure - mes "[Rouge]"; - mes "Welcome to the Sanguine Vault's duel arena."; - if($SANGUINE & $@SV_FCDBit != 0) goto L_Disabled; - mes "What do you want to do?"; - menu - "See the commands.", L_Challenge, - "Set my rules.", L_Rules, - "Nevermind.", L_End; - -L_Queue: - set @caster_name$, @Duel_Queue$[0]; - set @caster_time, @Duel_Queue[0]; - set @target_name$, strcharinfo(0); - set @target, getcharid(3, @caster_name$); - set $@my_rid, getcharid(3); - set @Duel_Queue$[0], ""; - set @Duel_Queue[0], 0; - if((gettimetick(2) - @caster_time) >= $@Duel_PlayerQueueTimeOut) goto L_Decline; - 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"; - mes ""; - mes "Do you accept?"; - next; - menu - "Yes, I do!", L_Accept, - "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 - 1)], @Duel_Queue[@loop]; - set @Duel_Queue$[@loop], ""; - set @Duel_Queue[@loop], 0; - set @loop, (@loop + 1); - if(@loop >= getarraysize(@Duel_Queue$)) goto L_Queue; - goto L_ShiftQueue; - -L_Accept: - callfunc "fightclub_AddToQueue"; - set @loop, 1; - goto L_ShiftQueue; - -L_Decline: - 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($SANGUINE & $@SV_FCDBit != 0) goto L_Disabled; - set @ms, $@Duel_PlayerQueueTimeOut * 1000; - callfunc "HumanTime"; - next; - mes "[Rouge]"; - mes "To challenge a player to a duel, you need to write this command:"; - mes "%%E ##a"+ ("duel") +" (name)##0"; - next; - mes "Your opponent will have to talk to me to accept or decline your offer."; - mes "The request will expire ##2"+ @time$ +"##0 after being sent."; - next; - mes "Keep in mind that you can ignore incoming duel requests with this command:"; - mes "%%E ##a"+ ("dueloff") +"##0"; - next; - mes "To un-ignore, simply write the same command again."; - goto L_End; - -L_Disabled: - mes "Sadly, the duel system is currently disabled. Please try again later."; - goto L_End; - -L_Rules: - callfunc "fightclub_setrules"; - goto L_End; - -L_End: - close; - -//announcements below -OnAnnounceNext: - npctalk strnpcinfo(0), "##0The next battle ("+ $@Duel_Queue_ID[0] +") is ##1" + $@Duel_Queue_Red$[0] + "##0 vs. ##3" + $@Duel_Queue_Blue$[0] + "##0.The battle will start in "+ $@Duel_TimeBeforeWarp +" seconds."; - end; - -OnAnnounceIntrusion: - npctalk strnpcinfo(0), "Intrusion detected. Annihilation in progress... Done."; - end; - -OnAnnounceTimeOut: - npctalk strnpcinfo(0), "Time limit reached! Both player lose!"; - end; - -OnAnnounceRedWins: - npctalk strnpcinfo(0), $@Duel_Queue_Red$[0] + " wins the duel against "+ $@Duel_Queue_Blue$[0] +"!"; - end; - -OnAnnounceRedForfeit: - npctalk strnpcinfo(0), $@Duel_Queue_Red$[0] + " wins by forfeit!"; - end; - -OnAnnounceBlueWins: - npctalk strnpcinfo(0), $@Duel_Queue_Blue$[0] + " wins the duel against "+ $@Duel_Queue_Red$[0] +"!"; - end; - -OnAnnounceBlueForfeit: - npctalk strnpcinfo(0), $@Duel_Queue_Blue$[0] + " wins by forfeit!"; - end; -} diff --git a/world/map/npc/009-7/trapdoor.txt b/world/map/npc/009-7/trapdoor.txt deleted file mode 100644 index b2709eef..00000000 --- a/world/map/npc/009-7/trapdoor.txt +++ /dev/null @@ -1,63 +0,0 @@ -009-2,38,105,0|script|#trapdoor#FightClub|327,0,0 -{ - set @index, rand(0,(getarraysize($@fightclub_randompasswords$) - 1)); - set @password$, $@fightclub_definitions$[@index]; - mes "[Bouncer]"; - mes "\"To enter, you must find the word I have in mind.\""; - mes "\"Here's a hint: ##2"+ @password$ + "##0.\""; - next; - mes "Pick the correct word for this definition."; - set @choices_nr, 3; - set @good, rand(0,(@choices_nr - 1)); - setarray @choices$, ""; - cleararray @choices$, "", getarraysize(@choices$); - set @loop, 0; - goto L_Shuffle; - -L_Shuffle: - set @nindex, rand(0,(getarraysize($@fightclub_randompasswords$) - 1)); - if(@nindex == @index) goto L_Shuffle; // do not get the good definition - set @loop2, 0; - goto L_Search; - -L_Search: - if(@choices$[@loop2] == $@fightclub_randompasswords$[@nindex]) goto L_Shuffle; // array is already populated with this choice - if(@loop2 >= (@choices_nr - 1)) goto L_Shuffle2; - set @loop2, @loop2 + 1; - goto L_Search; - -L_Shuffle2: - set @choices$[@loop], $@fightclub_randompasswords$[@nindex]; - if(@loop >= (@choices_nr - 1)) goto L_Answer; - set @loop, @loop + 1; - goto L_Shuffle; - -L_Answer: - set @choices$[@good], $@fightclub_randompasswords$[@index]; // set the good definition - set @choices$[getarraysize(@choices$)], "I have no clue"; - menu - @choices$[0], L_Enter, - @choices$[1], L_Enter, - @choices$[2], L_Enter, - @choices$[3], L_Enter, - @choices$[4], L_Enter, - @choices$[5], L_Enter, - @choices$[6], L_Enter; - -L_Enter: - if(@menu != (@good + 1)) goto L_Close; - mes "Correct. You may enter."; - close2; - warp "009-7", 22, 21; - end; - -L_Close: - mes "Incorrect."; - close; - -OnInit: - setarray $@fightclub_randompasswords$, "Abibliophobia", "Anencephalous", "Batrachomyomachy", "Blunderbuss", "Boustrophedon", "Bumbershoot", "Canoodle", "Cockalorum", "Cockamamie", "Collywobbles", "Eructation", "Flibbertigibbet", "Formication", "Gaberlunzie", "Gastromancy", "Gobemouche", "Hemidemisemiquaver", "Hobbledehoy", "Hootenanny", "Lickspittle", "Lollygag", "Mumpsimus", "Nincompoop", "Oocephalus", "Pettifogger", "Sialoquent", "Slangwhanger", "Smellfungus", "Tatterdemalion", "Vomitory", "Widdershins", "Avoirdupois", "Embonpoint", "Bibble", "Erinaceous", "Impignorate", "Nudiustertian", "Tittynope", "Winklepicker", "Yarborough", "Floccinaucinihilipilification"; - setarray $@fightclub_definitions$, "The fear of running out of reading material","Lacking a brain","Making a mountain out of a molehill","A gun with a flared muzzle or disorganized activity","A back and forth pattern","An umbrella","To hug and kiss","A small, haughty man","Absurd, outlandish","Butterflies in the stomach","A burp, belch","Nonsense, balderdash","The sense of ants crawling on your skin","A wandering beggar","Telling fortune from the rumblings of the stomach","A highly gullible person","A musical timing of 1/64","An awkward or ill-mannered young boy","A country or folk music get-together","A servile person, a toady","To move slowly, fall behind","To move slowly, fall behind","A foolish person","An egghead","A person who tries to befuddle others with his speech","Spitting while speaking","A loud abusive speaker or obnoxious writer","A perpetual pessimist","A child in rags","An exit or outlet","In a contrary or counterclockwise direction", "Commodities sold by weight", "A plump, hourglass figure", "To drink often; to eat and/or drink noisily", "Resembling a hedgehog", "To pawn or mortgage something", "The day before yesterday", "A small quantity of something left over", "Style of shoe or boot with a sharp and long pointed toe", "Hand of cards containing no card above a nine", "Estimation that something is valueless"; - if(getarraysize($@fightclub_randompasswords$) != getarraysize($@fightclub_definitions$)) mapexit; - end; -} diff --git a/world/map/npc/functions/global_event_handler.txt b/world/map/npc/functions/global_event_handler.txt index ad1ba65c..610fc42b 100644 --- a/world/map/npc/functions/global_event_handler.txt +++ b/world/map/npc/functions/global_event_handler.txt @@ -27,8 +27,6 @@ OnMobKillEvent: end; OnPCDieEvent: - callfunc "fightclub_GoBack"; // this used by the battle master - //callfunc "fightclub_event_die"; // this is used by the 1v1 arena set @necromancer, 0; addtimer 0, "Magic Timer::OnClear"; // reset magic block on death set @killerrid, 0; // reset killer rid |