diff options
author | Jesusaves <cpntb1@ymail.com> | 2022-06-04 17:17:18 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2022-06-04 17:17:18 -0300 |
commit | 423a6264dda598b1ba87ffce35001bc62fe928ac (patch) | |
tree | 1c3ac2de92c5c0da91f3ae65e065b5d9ed0c341c /npc/items/shovel.txt | |
parent | cd85f89af12067e72343ad5c2b3a79583108464a (diff) | |
download | serverdata-423a6264dda598b1ba87ffce35001bc62fe928ac.tar.gz serverdata-423a6264dda598b1ba87ffce35001bc62fe928ac.tar.bz2 serverdata-423a6264dda598b1ba87ffce35001bc62fe928ac.tar.xz serverdata-423a6264dda598b1ba87ffce35001bc62fe928ac.zip |
Include Dungeon Map - Now you can find RANDOM DUNGEONS!
Diffstat (limited to 'npc/items/shovel.txt')
-rw-r--r-- | npc/items/shovel.txt | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/npc/items/shovel.txt b/npc/items/shovel.txt index 7cf2ac213..ed1f464c5 100644 --- a/npc/items/shovel.txt +++ b/npc/items/shovel.txt @@ -472,3 +472,73 @@ function script shovel_genrandtreasure { return; } +// [Dungeon Map] functions + +function script shovel_randomdungeon { + // If you don't have the map, stop + delitem DungeonMap, 1; + + // Determine the dungeon size + if (ShovelQuests_DungeonMAP$ == "032-2" && REBIRTH) + .@mz = (MAZE_SIZE_X | MAZE_SIZE_A); + else if (ShovelQuests_DungeonMAP$ == "032-2") + .@mz = (MAZE_SIZE_G | MAZE_SIZE_X); + else if (REBIRTH) + .@mz = (MAZE_SIZE_M | MAZE_SIZE_G); + else + .@mz = (MAZE_SIZE_S | MAZE_SIZE_M); + + // Create the Maze + CreateMaze(IOT_CHAR, .@mz); + MazeMobs((BaseLevel*8/10), false, rand2(20, 24)); + + // Prepare the chest array + if (.@mz & MAZE_SIZE_A) + array_push(.@mob, SupremeChest); + if (.@mz & MAZE_SIZE_X) + array_push(.@mob, PrismChest); + if (.@mz & MAZE_SIZE_G) + array_push(.@mob, GoldenChest); + if (.@mz & MAZE_SIZE_M) + array_push(.@mob, SilverChest); + if (.@mz & MAZE_SIZE_S) + array_push(.@mob, BronzeChest); + + // Spawn & Configure the boss monster + .@mx=getmapinfo(MAPINFO_SIZE_X, MAZE_MAP$)-20; + .@my=getmapinfo(MAPINFO_SIZE_Y, MAZE_MAP$)-20; + .@mob=areamonster(MAZE_MAP$, .@mx/2, .@my/2, .@mx, .@my, "Treasure Chest", any_of(.@mob), 1, "Emergency Exit::OnTalk"); + + InitMaze(4800, true, true); // 1h30, random start, with treasure chest + + // Cleanup old variables and exit + ShovelQuests_DungeonMAP$=""; + ShovelQuests_DungeonX=0; + ShovelQuests_DungeonY=0; + dispbottom l("Now, to find the treasure chest!"); + closeclientdialog; + return; +} + +function script shovel_genranddungeon { + if (getq(LoFQuest_EPISODE) >= 16) + .@m$=any("007-1", "011-1", "015-1", "018-1", "032-2", + "007-1", "011-1", "015-1", "018-1"); + else + .@m$=any("007-1", "011-1", "015-1", "018-1"); + // Dangerous + do { + .@x=rand2(20, getmapinfo(MAPINFO_SIZE_X, .@m$)-20); + .@y=rand2(20, getmapinfo(MAPINFO_SIZE_Y, .@m$)-20); + } while (!checkcell(.@m$, .@x, .@y, cell_chkpass)); + + // Success + if (checkcell(.@m$, .@x, .@y, cell_chkpass)) { + shovel_addquest(.@m$, .@x, .@y, "shovel_randomdungeon"); + ShovelQuests_DungeonMAP$=shovel_getcity(.@m$); + ShovelQuests_DungeonX=.@x; + ShovelQuests_DungeonY=.@y; + } + return; +} + |