diff options
Diffstat (limited to 'npc/034-4/exit.txt')
-rw-r--r-- | npc/034-4/exit.txt | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/npc/034-4/exit.txt b/npc/034-4/exit.txt index a20664099..3a6c5dfba 100644 --- a/npc/034-4/exit.txt +++ b/npc/034-4/exit.txt @@ -7,6 +7,7 @@ 034-4,144,82,0 script #GeminiFExit NPC_HIDDEN,0,0,{ OnWumpus: + GeminiCheck(); // TODO FIXME: Instead of 75% chance, a Wumpus Egg only on first victory if (any(true, true, true, false)) getitem WumpusEgg, 1; @@ -17,7 +18,13 @@ OnWumpus: end; OnTouch: - // if not (quest) end; + GeminiCheck(); + // Only the party leader go ahead + if (strcharinfo(0) != getpartyleader(getcharid(1))) { + mesq l("%s has the key.", getpartyleader(getcharid(1))); + close; + } + // Create maze and populate (From 45x45 to 60x60) CreateMaze(IOT_CHAR, MAZE_SIZE_M | MAZE_SIZE_G); .@mx=getmapinfo(MAPINFO_SIZE_X, MAZE_MAP$)-20; @@ -142,9 +149,39 @@ OnTouch: setunitdata(.@mob, UDT_DMOTION, 50); // Defeating the boss yields a bonus - InitMaze(7200); + .@old$=getmap(); + .@p=getcharid(1); + InitMaze(7200, false); + sleep2(500); + dispbottom l("It was a trap! We must escape!"); + $@VALIA_MAP$[.@p]=getmap(); + partytimer(.@old$, 2000, "#GeminiFExit::OnSick", .@p); + sleep2(2000); + @forced_sick$ = getmap(); + doevent "#DungeonCore::OnSick"; + end; + +OnSick: + .@p=getcharid(1); + MAZE_MAP$ = $@VALIA_MAP$[.@p]; + // Find random, warpable coordinates + .@e=0; .@x=0; .@y=0; + .@mx=50; + .@my=50; + do { + .@x = rand2(20, .@mx); + .@y = rand2(20, .@my); + .@e += 1; + if (.@e > 30) { + consolebug("Too many failures at Maze \"%s\"! Trying anyway!", MAZE_MAP$); + break; + } + } while (!checknpccell(MAZE_MAP$, .@x, .@y, cell_chkpass)); + + warp MAZE_MAP$, .@x, .@y; + sleep2(500); dispbottom l("It was a trap! We must escape!"); - sleep2(2500); + sleep2(2000); @forced_sick$ = getmap(); doevent "#DungeonCore::OnSick"; end; |