summaryrefslogtreecommitdiff
path: root/npc/009-7
diff options
context:
space:
mode:
Diffstat (limited to 'npc/009-7')
-rw-r--r--npc/009-7/_import.txt11
-rw-r--r--npc/009-7/_warps.txt3
-rw-r--r--npc/009-7/battlemaster.txt83
-rw-r--r--npc/009-7/core.txt114
-rw-r--r--npc/009-7/debug.txt155
-rw-r--r--npc/009-7/eventHandler.txt88
-rw-r--r--npc/009-7/mapflags.txt2
-rw-r--r--npc/009-7/rouge.txt129
-rw-r--r--npc/009-7/shops.txt36
-rw-r--r--npc/009-7/trapdoor.txt62
10 files changed, 683 insertions, 0 deletions
diff --git a/npc/009-7/_import.txt b/npc/009-7/_import.txt
new file mode 100644
index 00000000..4b4202c9
--- /dev/null
+++ b/npc/009-7/_import.txt
@@ -0,0 +1,11 @@
+// Map 009-7: The Sanguine Vault
+// This file is generated automatically. All manually added changes will be removed when running the Converter.
+"npc/009-7/_warps.txt",
+"npc/009-7/battlemaster.txt",
+"npc/009-7/core.txt",
+"npc/009-7/debug.txt",
+"npc/009-7/eventHandler.txt",
+"npc/009-7/mapflags.txt",
+"npc/009-7/rouge.txt",
+"npc/009-7/shops.txt",
+"npc/009-7/trapdoor.txt",
diff --git a/npc/009-7/_warps.txt b/npc/009-7/_warps.txt
new file mode 100644
index 00000000..bdb3f37b
--- /dev/null
+++ b/npc/009-7/_warps.txt
@@ -0,0 +1,3 @@
+// This file is generated automatically. All manually added changes will be removed when running the Converter.
+// Map 009-7: The Sanguine Vault warps
+009-7,21,19,0 warp #009-7_21_19 0,0,009-2,38,104
diff --git a/npc/009-7/battlemaster.txt b/npc/009-7/battlemaster.txt
new file mode 100644
index 00000000..d6e43559
--- /dev/null
+++ b/npc/009-7/battlemaster.txt
@@ -0,0 +1,83 @@
+009-7,40,35,0 script Battle Master#Duels NPC322,{
+ if($SANGUINE & $@SV_BMDBit != 0) goto L_Disabled;
+ mes "[Battle Master]";
+ mes "\"Hey, you seem tough enough! Would you like to prove your skills?\"";
+ next;
+ menu
+ "PvP Cave (50gp)", L_Pvp,
+ "Last Man Standing (150gp)", L_Brodomir,
+ "Nevermind.", L_Next;
+
+L_Disabled:
+ mes "[Battle Master]";
+ mes "I am busy, come back later.";
+ close;
+
+L_Next:
+ mes "[Battle Master]";
+ mes "\"Ha ha, coward.\"";
+ close;
+
+L_Brodomir:
+ if (Zeny < 150) goto L_NoMoney;
+ Zeny = Zeny - 150;
+ mes "[Battle Master]";
+ mes "\"Get ready!\"";
+ close2;
+ set DUELS, DUELS | $@DuelPvpBit; // tell the arena to send the player back here when he exits
+ warp "009-6", 33, 37;
+ savepoint "009-7", 39, 37;
+ end;
+
+L_Pvp:
+ if (Zeny < 50) goto L_NoMoney;
+ Zeny = Zeny - 50;
+ mes "[Battle Master]";
+ mes "\"Get ready!\"";
+ close2;
+ set DUELS, DUELS | $@DuelPvpBit; // tell the arena to send the player back here when he dies
+ warp "001-3", 0, 0;
+ savepoint "009-7", 39, 37;
+ end;
+
+L_NoMoney:
+ mes "\"Wait a second, you don't have enough money.\"";
+ close;
+}
+
+
+
+function script fightclub_GoBack {
+ @Duel_PVP = DUELS & $@DuelPvpBit;
+ if(@Duel_PVP != 0) goto L_GoBack;
+ return;
+
+L_GoBack:
+ DUELS = DUELS &~ $@DuelPvpBit;
+ warp "009-7", 39, 37;
+ heal MaxHp, MaxSp;
+ message strcharinfo(0), "Thank you for participating!";
+ return;
+}
+009-6,36,48,0 script #GoBack2Duels NPC32767,0,1,{
+ callfunc "fightclub_GoBack";
+ end;
+}
+009-5,53,74,0 script #GoBack3Duels NPC32767,3,1,{
+ callfunc "fightclub_GoBack";
+ end;
+}
+009-3,158,83,0 script #GoBack5Duels NPC32767,7,0,{
+ callfunc "fightclub_GoBack";
+ end;
+}
+
+
+001-2,130,22,0 script #GoBack4Duels NPC32767,1,1,{
+ callfunc "fightclub_GoBack";
+ end;
+}
+001-3,73,28,0 script #GoBack1Duels NPC32767,0,1,{
+ callfunc "fightclub_GoBack";
+ end;
+}
diff --git a/npc/009-7/core.txt b/npc/009-7/core.txt
new file mode 100644
index 00000000..cb94ef97
--- /dev/null
+++ b/npc/009-7/core.txt
@@ -0,0 +1,114 @@
+// Replaced with @duel
+
+function script fightclub_sendrequest {
+ message @caster_name$, "You already requested a duel with this player.";
+ return;
+}
+
+function script fightclub_getrules {
+ return;
+}
+
+function script fightclub_AddToQueue {
+ mes "This battle is already in the queue.";
+ return;
+}
+
+function script fightclub_NextBattle {
+ return;
+}
+
+function script fightclub_NextBattleProceed {
+ return;
+}
+
+function script fightclub_StartBattle {
+ return;
+}
+
+function script fightclub_TimeOut {
+ return;
+}
+
+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;
+}
+
+function script fightclub_Victory {
+ // TODO: give some sort of reward
+ // TODO: increase score
+ // TODO: update leaderboard
+ return;
+}
+
+function script fightclub_DestroyMe {
+ @Duel_Fighter = 0;
+ 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(getmapname() == "009-7") warp "009-7", rand($@fightclub_x1, $@fightclub_x2), rand(($@fightclub_y1 - 2), ($@fightclub_y1 - 3));
+ return;
+}
+
+function script fightclub_Missing {
+ return;
+}
+
+function script fightclub_StartUp {
+ return;
+}
+
+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
+ $@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
+ $@Duel_RedPlayer = 0;
+ $@Duel_BluePlayer = 0;
+ $@Duel_Missing = 0;
+ $@Duel_TotalTime = 0;
+ npcwarp 32, 45, "Rouge#Duels";
+ donpcevent "#FightClubTimeLimit::OnStopTimer";
+ killmonster "009-7", "All";
+ return;
+}
+
+function script fightclub_setrules {
+ return;
+}
+
+function script fightclub_death {
+L_NoDuel:
+ if(debug) donpcevent "Debug#Duels::OnVictimNotInDuel";
+ return;
+}
+
+function script fightclub_enter {
+ return;
+}
+
+function script fightclub_enter_killer {
+ return;
+}
+
+function script fightclub_exit {
+ return;
+}
+
+
+
+function script fightclub_event_killed {
+ return;
+}
+
+function script fightclub_event_die {
+ return;
+}
diff --git a/npc/009-7/debug.txt b/npc/009-7/debug.txt
new file mode 100644
index 00000000..47ee823c
--- /dev/null
+++ b/npc/009-7/debug.txt
@@ -0,0 +1,155 @@
+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";
+ 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,
+ "toggle|Toggle @Duel_Fighter", L_DuelFighter,
+ "restart|Restart fightclub.", L_Restart,
+ "quit|Nevermind.", L_End;
+
+L_DuelEnabled:
+ if(@due < 1) goto L_DuelEnabled2;
+ $SANGUINE = $SANGUINE | $@SV_FCDBit;
+ goto L_Menu;
+L_DuelEnabled2:
+ $SANGUINE = $SANGUINE &~ $@SV_FCDBit;
+ goto L_Restart;
+
+L_BmEnabled:
+ if(@bme < 1) goto L_BmEnabled2;
+ $SANGUINE = $SANGUINE | $@SV_BMDBit;
+ goto L_Menu;
+L_BmEnabled2:
+ $SANGUINE = $SANGUINE &~ $@SV_BMDBit;
+ goto L_Menu;
+
+L_DuelFighter:
+ if(@Duel_Fighter < 1) goto L_DuelFighter2;
+ @Duel_Fighter = 0;
+ goto L_Menu;
+L_DuelFighter2:
+ @Duel_Fighter = 1;
+ goto L_Menu;
+
+L_TimeBeforeNext:
+ mes "range: 1~600";
+ input @time;
+ if((@time < 1) || (@time > 600)) goto L_OutOfRange;
+ $@Duel_TimeBeforeNext = @time;
+ goto L_Menu;
+
+L_TimeBeforeWarp:
+ mes "range: 1~600";
+ input @time;
+ if((@time < 1) || (@time > 600)) goto L_OutOfRange;
+ $@Duel_TimeBeforeWarp = @time;
+ goto L_Menu;
+
+L_TimeBeforeStart:
+ mes "range: 1~600";
+ input @time;
+ if((@time < 1) || (@time > 600)) goto L_OutOfRange;
+ $@Duel_TimeBeforeStart = @time;
+ goto L_Menu;
+
+L_TimeLimit:
+ mes "range: 1~900";
+ input @time;
+ if((@time < 1) || (@time > 900)) goto L_OutOfRange;
+ $@Duel_TimeLimit = @time;
+ goto L_Menu;
+
+L_QueueLimit:
+ mes "range: 1~20";
+ input @limit;
+ if((@limit < 1) || (@limit > 20)) goto L_OutOfRange;
+ $@Duel_QueueLimit = @limit;
+ goto L_Menu;
+
+L_PlayerQueueLimit:
+ mes "range: 1~5";
+ input @limit;
+ if((@limit < 1) || (@limit > 5)) goto L_OutOfRange;
+ $@Duel_PlayerQueueLimit = @limit;
+ goto L_Menu;
+
+L_PlayerQueueTimeOut:
+ mes "range: 30~600";
+ input @limit;
+ if((@limit < 30) || (@limit > 600)) goto L_OutOfRange;
+ $@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;
+ $Duel_LastDuel = @last;
+ next;
+ goto L_Restart;
+
+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 NPC181,{
+ 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/npc/009-7/eventHandler.txt b/npc/009-7/eventHandler.txt
new file mode 100644
index 00000000..0ddf96d2
--- /dev/null
+++ b/npc/009-7/eventHandler.txt
@@ -0,0 +1,88 @@
+
+009-7,45,33,0 script #trapdoor2FightClub NPC327,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;
+ end;
+
+L_Enter:
+ warp "009-7",34,22; // this warp is a special thanks for contributors
+ end;
+}
+009-7,33,21,0 script #trapdoor3FightClub NPC327,0,0,{
+ warp "009-7",44,32;
+ end;
+}
+
+009-7,22,38,0 script #FightClubUtils NPC32767,{
+ 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 NPC32767,0,0,{
+ end;
+
+OnStartTimer:
+ $@Duel_TotalTime = 0;
+ goto L_StartTimer;
+
+OnStopTimer:
+ stopnpctimer;
+ end;
+
+OnTimer1000:
+ $@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:
+ $@Duel_TotalTime = 0;
+ end;
+}
+
+009-7,20,44,0 script #FightClubHandler NPC32767,0,0,{
+ end;
+
+OnInit:
+ // this event is called when the map server boots up
+ $@fightclub_x1 = 27;
+ $@fightclub_y1 = 42;
+ $@fightclub_x2 = 38;
+ $@fightclub_y2 = 48;
+ end;
+
+OnTimer2000:
+ // this events checks who is on stage every 2 seconds
+ end;
+}
diff --git a/npc/009-7/mapflags.txt b/npc/009-7/mapflags.txt
new file mode 100644
index 00000000..104ea626
--- /dev/null
+++ b/npc/009-7/mapflags.txt
@@ -0,0 +1,2 @@
+009-7 mapflag noteleport
+009-7 mapflag monster_noteleport
diff --git a/npc/009-7/rouge.txt b/npc/009-7/rouge.txt
new file mode 100644
index 00000000..157da9fb
--- /dev/null
+++ b/npc/009-7/rouge.txt
@@ -0,0 +1,129 @@
+009-7,32,45,0 script Rouge#Duels NPC181,{
+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/Legacy:FightClub|click here@@##0";
+ callfunc "fightclub_Debug";
+ goto L_End;
+
+L_Main:
+ @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:
+ @caster_name$ = @Duel_Queue$[0];
+ @caster_time = @Duel_Queue[0];
+ @target_name$ = strcharinfo(0);
+ @target = getcharid(3, @caster_name$);
+ $@my_rid = getcharid(3);
+ @Duel_Queue$[0] = "";
+ @Duel_Queue[0] = 0;
+ if((gettimetick(2) - @caster_time) >= $@Duel_PlayerQueueTimeOut) goto L_Decline;
+ if(attachrid(@target) != 1) goto L_Missing;
+ if(getmapname() != "009-7") goto L_Missing;
+ if(attachrid($@my_rid) != 1) goto L_End;
+ @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;
+ @Duel_Queue$[(@loop - 1)] = @Duel_Queue$[@loop];
+ @Duel_Queue[(@loop - 1)] = @Duel_Queue[@loop];
+ @Duel_Queue$[@loop] = "";
+ @Duel_Queue[@loop] = 0;
+ @loop = (@loop + 1);
+ if(@loop >= getarraysize(@Duel_Queue$)) goto L_Queue;
+ goto L_ShiftQueue;
+
+L_Accept:
+ callfunc "fightclub_AddToQueue";
+ @loop = 1;
+ goto L_ShiftQueue;
+
+L_Decline:
+ @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;
+ @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;
+
+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/npc/009-7/shops.txt b/npc/009-7/shops.txt
new file mode 100644
index 00000000..1d08d55b
--- /dev/null
+++ b/npc/009-7/shops.txt
@@ -0,0 +1,36 @@
+// The Mana World Script
+// (C) Jesusalva, 2021
+// Licensed under GPLv2 or later
+
+009-7,34,23,0 script Bartender#Duels NPC177,{
+ shop .name$;
+ goodbye;
+ close;
+
+OnInit:
+ tradertype(NST_ZENY);
+ sellitem Beer;
+ sellitem IronPotion;
+ sellitem ConcentrationPotion;
+ sellitem BottleOfWater;
+ sellitem Milk;
+ .distance = 5;
+ end;
+}
+
+009-7,27,26,0 script Garcon#Duels NPC180,{
+ shop .name$;
+ goodbye;
+ close;
+
+OnInit:
+ tradertype(NST_ZENY);
+ sellitem RoastedMaggot;
+ sellitem PickledBeets;
+ sellitem ChickenLeg;
+ sellitem Steak;
+ sellitem Beer;
+ .distance = 5;
+ end;
+}
+
diff --git a/npc/009-7/trapdoor.txt b/npc/009-7/trapdoor.txt
new file mode 100644
index 00000000..14422fc7
--- /dev/null
+++ b/npc/009-7/trapdoor.txt
@@ -0,0 +1,62 @@
+009-2,38,105,0 script #trapdoor#FightClub NPC327,0,0,{
+ @index = rand(0,(getarraysize($@fightclub_randompasswords$) - 1));
+ @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.";
+ @choices_nr = 3;
+ @good = rand(0,(@choices_nr - 1));
+ setarray @choices$, "";
+ cleararray @choices$, "", getarraysize(@choices$);
+ @loop = 0;
+ goto L_Shuffle;
+
+L_Shuffle:
+ @nindex = rand(0,(getarraysize($@fightclub_randompasswords$) - 1));
+ if(@nindex == @index) goto L_Shuffle; // do not get the good definition
+ @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;
+ @loop2 = @loop2 + 1;
+ goto L_Search;
+
+L_Shuffle2:
+ @choices$[@loop] = $@fightclub_randompasswords$[@nindex];
+ if(@loop >= (@choices_nr - 1)) goto L_Answer;
+ @loop = @loop + 1;
+ goto L_Shuffle;
+
+L_Answer:
+ set @choices$[@good], $@fightclub_randompasswords$[@index]; // set the good definition
+ @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;
+}