From 423a6264dda598b1ba87ffce35001bc62fe928ac Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 4 Jun 2022 17:17:18 -0300 Subject: Include Dungeon Map - Now you can find RANDOM DUNGEONS! --- db/re/item_db.conf | 19 +++- npc/001-14/ctrl.txt | 247 +----------------------------------------- npc/006-8/kage.txt | 2 +- npc/017-10/dispatcher.txt | 8 +- npc/functions/aurora.txt | 2 +- npc/functions/daily.txt | 2 +- npc/functions/event.txt | 244 +----------------------------------------- npc/functions/maze.txt | 259 ++++++++++++++++++++++++++++++++++++++++++++- npc/functions/treasure.txt | 2 +- npc/items/shovel.txt | 70 ++++++++++++ 10 files changed, 361 insertions(+), 494 deletions(-) diff --git a/db/re/item_db.conf b/db/re/item_db.conf index c98666d58..7469c9c42 100644 --- a/db/re/item_db.conf +++ b/db/re/item_db.conf @@ -3062,7 +3062,24 @@ item_db: ( doevent "Warp Crystal::OnUse"; "> }, -// item id 679 reserved - warp crystals +{ + Id: 679 + AegisName: "DungeonMap" + Name: "Dungeon Map" + Type: "IT_USABLE" + Buy: 45000 + Sell: 300 + Weight: 14 + KeepAfterUse: true + Refine: false + Script: <" + // ShovelQuests_Dungeon → Coordinates for Treasure Map + if (!ShovelQuests_DungeonX) { + callfunc "shovel_genranddungeon"; + } + dispbottom l("A dungeon is burried in @@, (@@, @@)", ShovelQuests_DungeonMAP$, ShovelQuests_DungeonX, ShovelQuests_DungeonY); + "> +}, { Id: 680 AegisName: "TreasureMap" diff --git a/npc/001-14/ctrl.txt b/npc/001-14/ctrl.txt index 715cf8cc8..070c1c5a2 100644 --- a/npc/001-14/ctrl.txt +++ b/npc/001-14/ctrl.txt @@ -332,235 +332,8 @@ OnInit: @moly_chall = 8; CreateMaze(IOT_CHAR); - .@mx=getmapinfo(MAPINFO_SIZE_X, MAZE_MAP$)-20; - .@my=getmapinfo(MAPINFO_SIZE_Y, MAZE_MAP$)-20; - .@tl=(20-.@mx)*(20-.@my) * 3 / 10; // Total tiles + collision guess - .@tl=.@tl / rand2(12,16) + 1; // Monster density is a bit random - - /* *** Copied from 006-5/groata.txt & 018-2-2/main.txt! *** */ - /* ********** Spawn monsters based on your level ********** */ - .@lv = max(6, BaseLevel) - 5; - .@mb[0] = MagicGoblin; - .@mb[1] = CaveMaggot; - - // Artillery - if (.@lv > 40) - array_push(.@mb, RobinBandit); - if (.@lv > 50) - array_push(.@mb, DustGatling); - if (.@lv > 60) - array_push(.@mb, DustRifle); - if (.@lv > 70) - array_push(.@mb, DustRevolver); - if (.@lv > 80) - array_push(.@mb, DustBoss); - if (.@lv > 90) - array_push(.@mb, GreatMoubooSlime); - if (.@lv > 100) - array_push(.@mb, Jhon); - - // Monsters - if (is_between2(0, .@lv, 40)) { - array_push(.@mb, Piou); - array_push(.@mb, Piousse); - array_push(.@mb, Squirrel); - array_push(.@mb, ManaPiou); - array_push(.@mb, ForestPiou); - array_push(.@mb, RedButterfly); - array_push(.@mb, Maggot); - array_push(.@mb, CandorScorpion); - array_push(.@mb, HouseMaggot); - array_push(.@mb, LittleYellowSlime); - array_push(.@mb, Ratto); - array_push(.@mb, RudolphSlime); - array_push(.@mb, MoubooSlime); - array_push(.@mb, Croc); - array_push(.@mb, Scorpion); - array_push(.@mb, SmallFrog); - } - if (is_between2(10, .@lv, 50)) { - array_push(.@mb, BigFrog); - array_push(.@mb, Lavern); - array_push(.@mb, LittleRedSlime); - array_push(.@mb, ChocolateSlime); - array_push(.@mb, Blub); - array_push(.@mb, Duck); - array_push(.@mb, Bat); - array_push(.@mb, CaveMaggot); - array_push(.@mb, ManaGhost); - array_push(.@mb, ManaBug); - array_push(.@mb, Fluffy); - array_push(.@mb, FireGoblin); - array_push(.@mb, ViciousSquirrel); - array_push(.@mb, RedScorpion); - array_push(.@mb, WhiteSlime); - array_push(.@mb, AzulSlime); - array_push(.@mb, DesertLogHead); - } - if (is_between2(20, .@lv, 50)) { - array_push(.@mb, RedSlime); - array_push(.@mb, PoisonSpikyMushroom); - array_push(.@mb, DesertBandit); - array_push(.@mb, OceanCroc); - array_push(.@mb, ToppyBlub); - array_push(.@mb, Sarracenus); - array_push(.@mb, IceMaggot); - array_push(.@mb, VampireBat); - array_push(.@mb, Bandit); - array_push(.@mb, Pinkie); - array_push(.@mb, LivingPotato); - array_push(.@mb, Assassin); - array_push(.@mb, Skeleton); - } - if (is_between2(30, .@lv, 60)) { - array_push(.@mb, CaveSnake); - array_push(.@mb, GreenSlime); - array_push(.@mb, CopperSlime); - array_push(.@mb, YellowSlime); - array_push(.@mb, SantaSlime); - array_push(.@mb, LavaSlime); - array_push(.@mb, Bluepar); - array_push(.@mb, DeathCat); - array_push(.@mb, Moggun); - array_push(.@mb, SeaSlime); - array_push(.@mb, RedMushroom); - array_push(.@mb, Mouboo); - array_push(.@mb, LogHead); - array_push(.@mb, CandiedSlime); - array_push(.@mb, OldSnake); - array_push(.@mb, GrassSnake); - } - if (is_between2(40, .@lv, 70)) { - array_push(.@mb, GiantMaggot); - array_push(.@mb, IcedFluffy); - array_push(.@mb, Snake); - array_push(.@mb, BlackSlime); - array_push(.@mb, Tipiou); - array_push(.@mb, AlphaMouboo); - array_push(.@mb, Pollet); - array_push(.@mb, PiouKnight); - array_push(.@mb, Shrewboo); - } - if (is_between2(40, .@lv, 80)) { - array_push(.@mb, Wolvern); - array_push(.@mb, FireSkull); - array_push(.@mb, DarkLizard); - } - if (is_between2(50, .@lv, 90)) { - array_push(.@mb, ArmoredSkeleton); - array_push(.@mb, BlackScorpion); - array_push(.@mb, ElectroWorm); - array_push(.@mb, EarthFairy); - array_push(.@mb, FireFairy); - array_push(.@mb, WaterFairy); - array_push(.@mb, WindFairy); - array_push(.@mb, PoisonFairy); - array_push(.@mb, MountainSnake); - array_push(.@mb, HoodedNinja); - array_push(.@mb, ForestMushroom); - array_push(.@mb, GoldenScorpion); - } - if (is_between2(60, .@lv, 100)) { - array_push(.@mb, Yeti); - array_push(.@mb, FallenGuard1); - array_push(.@mb, GreenSlimeMother); - array_push(.@mb, SnowFlower); - array_push(.@mb, BlueSlimeMother); - array_push(.@mb, WickedMushroom); - array_push(.@mb, CopperSlimeMother); - array_push(.@mb, YellowSlimeMother); - array_push(.@mb, RedSlimeMother); - array_push(.@mb, ChocolateSlimeMother); - array_push(.@mb, WhiteSlimeMother); - array_push(.@mb, Archant); - array_push(.@mb, Scar); - } - if (is_between2(70, .@lv, 110)) { - array_push(.@mb, AzulSlimeMother); - array_push(.@mb, SeaSlimeMother); - array_push(.@mb, LavaSlimeMother); - array_push(.@mb, BlackSlimeMother); - array_push(.@mb, Crafty); - array_push(.@mb, Forain); - array_push(.@mb, GreenDragon); - array_push(.@mb, Michel); - array_push(.@mb, Troll); - } - if (is_between2(80, .@lv, 120)) { - array_push(.@mb, EliteDuck); - array_push(.@mb, AzulSkullSlime); - array_push(.@mb, Moonshroom); - array_push(.@mb, RedSkullSlime); - array_push(.@mb, Terranite); - array_push(.@mb, JackO); - array_push(.@mb, BlackMamba); - array_push(.@mb, GreenSkullSlime); - array_push(.@mb, BloodyMouboo); - array_push(.@mb, Centaur); - array_push(.@mb, GoboBear); - } - if (is_between2(90, .@lv, 130)) { - array_push(.@mb, CopperSkullSlime); - array_push(.@mb, LavaSkullSlime); - array_push(.@mb, BlackSkullSlime); - array_push(.@mb, GiantCaveMaggot); - array_push(.@mb, TerraniteProtector); - array_push(.@mb, VanityPixie); - array_push(.@mb, HolyPixie); - } - if (is_between2(100, .@lv, 140)) { - array_push(.@mb, ShadowPixie); - array_push(.@mb, NulityPixie); - array_push(.@mb, Reaper); - array_push(.@mb, NightmareDragon); - array_push(.@mb, Snail); - array_push(.@mb, WhirlyBird); - } - if (is_between2(110, .@lv, 150)) { - array_push(.@mb, PinkieSuseran); - array_push(.@mb, Mandragora); - array_push(.@mb, PinkieMaximus); - } - if (.@lv > 120) { - array_push(.@mb, Junglefowl); - array_push(.@mb, Tengu); - array_push(.@mb, Moubi); - } - if (.@lv > 130) { - array_push(.@mb, SuperiorShroom); - array_push(.@mb, Nutcracker); - array_push(.@mb, Golem); - } - if (.@lv > 140) { - array_push(.@mb, SiegeTower); - array_push(.@mb, GreenhornAbomination); - array_push(.@mb, ShadowTortuga); - array_push(.@mb, FireElement); - array_push(.@mb, WaterElement); - array_push(.@mb, EarthElement); - array_push(.@mb, WindElement); - } - if (.@lv > 150) { - array_push(.@mb, SacredWisp); - array_push(.@mb, EvilWisp); - array_push(.@mb, PanthomWisp); - array_push(.@mb, EpiphanyWisp); - } - if (.@lv > 175) - array_push(.@mb, Tortuga); - - // Initialize instance but without InitMaze and short lived - instance_set_timeout(900, 900, MAZE_INST); - instance_init(MAZE_INST); - - /* Spawn them and make hostile */ - freeloop(true); - for (.@i = 0; .@i < 1+(.@tl); .@i++) { - .@mid = any_of(.@mb); - .@m=areamonster(MAZE_MAP$, 20, 20, .@mx, .@my, strmobinfo(1, .@mid), .@mid, 1); - set_aggro(.@m); - } - freeloop(false); + MazeMobs((max(6, BaseLevel) - 5), false, rand2(12,16)); + InitMaze(900, false, false); // Create the target boss .@mx=getmapinfo(MAPINFO_SIZE_X, MAZE_MAP$)-20; @@ -571,22 +344,6 @@ OnInit: setunitdata(.@m, UDT_LEVEL, 1); setunitdata(.@m, UDT_MODE, MD_BOSS); setunitdata(.@m, UDT_LUK, 32760); - - // Find random, warpable coordinates from the nearby zone - .@e=0; .@x=0; .@y=0; - .@mx=40; - .@my=40; - do { - .@x = rand2(20, .@mx); - .@y = rand2(20, .@my); - .@e += 1; - if (.@e > 30) { - consolebug("Olympics - Too many failures at Maze \"%s\"! Trying anyway!", MAZE_MAP$); - break; - } - } while (!checknpccell(MAZE_MAP$, .@x, .@y, cell_chkpass)); - - warp MAZE_MAP$, .@x, .@y; closeclientdialog; end; diff --git a/npc/006-8/kage.txt b/npc/006-8/kage.txt index cf6355f14..894c6e4f4 100644 --- a/npc/006-8/kage.txt +++ b/npc/006-8/kage.txt @@ -118,7 +118,7 @@ OnFinish: case 2: getitem any(Aquada, Piberries, Cheese, Bread), 1; break; case 3: getitem any(Coffee, ChamomileTea, MysteriousBottle), 1; break; case 4: getitem any(Aquada, Piberries, Cheese, Bread), 1; break; - case 5: getitem any(ReturnPotion, TreasureMap), 1; break; + case 5: getitem any(ReturnPotion, TreasureMap, DungeonMap), 1; break; case 6: getitem any(Aquada, Piberries, Cheese, Bread), 1; break; case 7: getitem any(SmokeGrenade, DodgePotion), 1; break; case 8: getitem any(Aquada, Piberries, Cheese, Bread), 1; break; diff --git a/npc/017-10/dispatcher.txt b/npc/017-10/dispatcher.txt index 5a0caa990..b47060d36 100644 --- a/npc/017-10/dispatcher.txt +++ b/npc/017-10/dispatcher.txt @@ -65,8 +65,8 @@ L_Main: rif(gethominfo(6) >= 10, l("Deploy to Rare Mines [2h]")), rif(gethominfo(6) >= 15, l("Deploy to Slime Nest [2h]")), rif(gethominfo(6) >= 30, l("Deploy to Snake Pit [3h]")), - rif(gethominfo(6) >= 55, l("Deploy to Dangerous Area [6h]")), - rif(gethominfo(6) >= 80 && $GAME_STORYLINE >= 4, l("Deploy to Monster King Basement [8h]")), + rif(gethominfo(6) >= 55 && $GAME_STORYLINE >= 3, l("Deploy to Dangerous Area [6h]")), + rif(gethominfo(6) >= 70 && $GAME_STORYLINE >= 4, l("Deploy to Monster King Basement [8h]")), "", l("Deploy to The Market [1h]"), l("Don't deploy"); @@ -204,6 +204,7 @@ L_Main: getitemlink(AncientBlueprint)+ getitemlink(Lockpicks)+ getitemlink(StatusResetPotion)+ + getitemlink(DungeonMap)+ getitemlink(TreasureMap)); mesc l("Rare Drops: "+ getitemlink(MagicApple)); @@ -223,6 +224,7 @@ L_Main: getitemlink(SmokeGrenade)+ getitemlink(Grenade)+ getitemlink(AncientBlueprint)+ + getitemlink(DungeonMap)+ getitemlink(TreasureMap)+ getitemlink(CrazyRum)+ getitemlink(MercBoxB)); @@ -360,6 +362,7 @@ function lootField { AncientBlueprint, 1, 1500, Lockpicks, limit(1, .@lv/30, 4), 1000, StatusResetPotion, 1, 1000, + DungeonMap, 1, 700, TreasureMap, 1, 700, MagicApple, 1, 40); break; @@ -371,6 +374,7 @@ function lootField { SmokeGrenade, limit(1, .@lv/18, 8), 4500, Grenade, limit(1, .@lv/28, 6), 3500, AncientBlueprint, 1, 2500, + DungeonMap, 1, 2000, TreasureMap, 1, 2000, CrazyRum, 1, 1500, MercBoxB, 1, 1000, diff --git a/npc/functions/aurora.txt b/npc/functions/aurora.txt index 2549ecd7a..2d3b5e64d 100644 --- a/npc/functions/aurora.txt +++ b/npc/functions/aurora.txt @@ -176,7 +176,7 @@ function script FYT { case 1: return any(SmokeGrenade, ScentGrenade, Grenade, DeathPotion, Lockpicks); case 2: - return any(MysteriousBottle, TreasureMap); + return any(MysteriousBottle, TreasureMap, DungeonMap); case 3: return any(ArcmageBoxset, MercBoxA, ScrollSMaggot); } diff --git a/npc/functions/daily.txt b/npc/functions/daily.txt index 3d2dc906a..e2127cfc2 100644 --- a/npc/functions/daily.txt +++ b/npc/functions/daily.txt @@ -160,7 +160,7 @@ function script daily_login_bonus_handler { if (gettime(6) == JUNE) { if (#TMW2_LOGINBONUS != gettime(GETTIME_YEAR) && gettime(5) == 21) { #TMW2_LOGINBONUS=gettime(GETTIME_YEAR); - getitem TreasureMap, 1; + getitem DungeonMap, 1; dispbottom "##B##2"+l("It's Jesusalva's anniversary!")+" "+l("Also, Summer just started. Why not taking this opportunity to go Treasure Hunting?!")+"##b##0"; } } diff --git a/npc/functions/event.txt b/npc/functions/event.txt index 8ee850cbf..5d57c540b 100644 --- a/npc/functions/event.txt +++ b/npc/functions/event.txt @@ -82,249 +82,11 @@ OnWarpTo: // Create maze and populate CreateMaze(IOT_CHAR, MAZE_SIZE_S | MAZE_SIZE_M); - .@mx=getmapinfo(MAPINFO_SIZE_X, MAZE_MAP$)-20; - .@my=getmapinfo(MAPINFO_SIZE_Y, MAZE_MAP$)-20; - .@tl=(20-.@mx)*(20-.@my) * 3 / 10; // Total tiles + collision guess - .@tl=.@tl / rand2(9,14) + 1; // Monster density is a bit random - - /* *** Copied from 006-5/groata.txt & 018-2-2/main.txt! *** */ - /* ********* Spawn monsters based on DTOWER_FLOOR ********* */ - .@lv = (BaseLevel/10) + DTOWER_FLOOR * 5; - .@mb[0] = MagicGoblin; - .@mb[1] = CaveMaggot; - - // Artillery & Chests - if (.@lv > 10) - array_push(.@mb, BronzeChest); - if (.@lv > 20) - array_push(.@mb, SmallMagicBif); - if (.@lv > 30) - array_push(.@mb, Bif); - if (.@lv > 40) - array_push(.@mb, RobinBandit); - if (.@lv > 45) - array_push(.@mb, SilverChest); - if (.@lv > 50) - array_push(.@mb, DustGatling); - if (.@lv > 55) - array_push(.@mb, MagicBif); - if (.@lv > 60) - array_push(.@mb, DustRifle); - if (.@lv > 70) - array_push(.@mb, DustRevolver); - if (.@lv > 75) - array_push(.@mb, GoldenChest); - if (.@lv > 80) - array_push(.@mb, DustBoss); - if (.@lv > 85) - array_push(.@mb, BigMagicBif); - if (.@lv > 90) - array_push(.@mb, GreatMoubooSlime); - if (.@lv > 100) - array_push(.@mb, Jhon); - if (.@lv > 105) - array_push(.@mb, PrismChest); - - // Monsters - if (is_between2(0, .@lv, 30)) { - array_push(.@mb, Piou); - array_push(.@mb, Piousse); - array_push(.@mb, Squirrel); - array_push(.@mb, ManaPiou); - array_push(.@mb, ForestPiou); - array_push(.@mb, RedButterfly); - array_push(.@mb, Maggot); - array_push(.@mb, CandorScorpion); - array_push(.@mb, HouseMaggot); - array_push(.@mb, LittleYellowSlime); - array_push(.@mb, Ratto); - array_push(.@mb, RudolphSlime); - array_push(.@mb, MoubooSlime); - array_push(.@mb, Croc); - array_push(.@mb, Scorpion); - array_push(.@mb, SmallFrog); - } - if (is_between2(10, .@lv, 40)) { - array_push(.@mb, BigFrog); - array_push(.@mb, Lavern); - array_push(.@mb, LittleRedSlime); - array_push(.@mb, ChocolateSlime); - array_push(.@mb, Blub); - array_push(.@mb, Duck); - array_push(.@mb, Bat); - array_push(.@mb, CaveMaggot); - array_push(.@mb, ManaGhost); - array_push(.@mb, ManaBug); - array_push(.@mb, Fluffy); - array_push(.@mb, FireGoblin); - array_push(.@mb, ViciousSquirrel); - array_push(.@mb, RedScorpion); - array_push(.@mb, WhiteSlime); - array_push(.@mb, AzulSlime); - array_push(.@mb, DesertLogHead); - } - if (is_between2(20, .@lv, 50)) { - array_push(.@mb, RedSlime); - array_push(.@mb, PoisonSpikyMushroom); - array_push(.@mb, DesertBandit); - array_push(.@mb, OceanCroc); - array_push(.@mb, ToppyBlub); - array_push(.@mb, Sarracenus); - array_push(.@mb, IceMaggot); - array_push(.@mb, VampireBat); - array_push(.@mb, Bandit); - array_push(.@mb, Pinkie); - array_push(.@mb, LivingPotato); - array_push(.@mb, Assassin); - array_push(.@mb, Skeleton); - } - if (is_between2(30, .@lv, 60)) { - array_push(.@mb, CaveSnake); - array_push(.@mb, GreenSlime); - array_push(.@mb, CopperSlime); - array_push(.@mb, YellowSlime); - array_push(.@mb, SantaSlime); - array_push(.@mb, LavaSlime); - array_push(.@mb, Bluepar); - array_push(.@mb, DeathCat); - array_push(.@mb, Moggun); - array_push(.@mb, SeaSlime); - array_push(.@mb, RedMushroom); - array_push(.@mb, Mouboo); - array_push(.@mb, LogHead); - array_push(.@mb, CandiedSlime); - array_push(.@mb, OldSnake); - array_push(.@mb, GrassSnake); - } - if (is_between2(40, .@lv, 70)) { - array_push(.@mb, GiantMaggot); - array_push(.@mb, IcedFluffy); - array_push(.@mb, Snake); - array_push(.@mb, BlackSlime); - array_push(.@mb, Tipiou); - array_push(.@mb, AlphaMouboo); - array_push(.@mb, Pollet); - array_push(.@mb, PiouKnight); - array_push(.@mb, Shrewboo); - } - if (is_between2(40, .@lv, 80)) { - array_push(.@mb, Wolvern); - array_push(.@mb, FireSkull); - array_push(.@mb, DarkLizard); - } - if (is_between2(50, .@lv, 90)) { - array_push(.@mb, ArmoredSkeleton); - array_push(.@mb, BlackScorpion); - array_push(.@mb, ElectroWorm); - array_push(.@mb, EarthFairy); - array_push(.@mb, FireFairy); - array_push(.@mb, WaterFairy); - array_push(.@mb, WindFairy); - array_push(.@mb, PoisonFairy); - array_push(.@mb, MountainSnake); - array_push(.@mb, HoodedNinja); - array_push(.@mb, ForestMushroom); - array_push(.@mb, GoldenScorpion); - } - if (is_between2(60, .@lv, 100)) { - array_push(.@mb, Yeti); - array_push(.@mb, FallenGuard1); - array_push(.@mb, GreenSlimeMother); - array_push(.@mb, SnowFlower); - array_push(.@mb, BlueSlimeMother); - array_push(.@mb, WickedMushroom); - array_push(.@mb, CopperSlimeMother); - array_push(.@mb, YellowSlimeMother); - array_push(.@mb, RedSlimeMother); - array_push(.@mb, ChocolateSlimeMother); - array_push(.@mb, WhiteSlimeMother); - array_push(.@mb, Archant); - array_push(.@mb, Scar); - } - if (is_between2(70, .@lv, 110)) { - array_push(.@mb, AzulSlimeMother); - array_push(.@mb, SeaSlimeMother); - array_push(.@mb, LavaSlimeMother); - array_push(.@mb, BlackSlimeMother); - array_push(.@mb, Crafty); - array_push(.@mb, Forain); - array_push(.@mb, GreenDragon); - array_push(.@mb, Michel); - array_push(.@mb, Troll); - } - if (is_between2(80, .@lv, 120)) { - array_push(.@mb, EliteDuck); - array_push(.@mb, AzulSkullSlime); - array_push(.@mb, Moonshroom); - array_push(.@mb, RedSkullSlime); - array_push(.@mb, Terranite); - array_push(.@mb, JackO); - array_push(.@mb, BlackMamba); - array_push(.@mb, GreenSkullSlime); - array_push(.@mb, BloodyMouboo); - array_push(.@mb, Centaur); - array_push(.@mb, GoboBear); - } - if (is_between2(90, .@lv, 130)) { - array_push(.@mb, CopperSkullSlime); - array_push(.@mb, LavaSkullSlime); - array_push(.@mb, BlackSkullSlime); - array_push(.@mb, GiantCaveMaggot); - array_push(.@mb, TerraniteProtector); - array_push(.@mb, VanityPixie); - array_push(.@mb, HolyPixie); - } - if (is_between2(100, .@lv, 140)) { - array_push(.@mb, ShadowPixie); - array_push(.@mb, NulityPixie); - array_push(.@mb, Reaper); - array_push(.@mb, NightmareDragon); - array_push(.@mb, Snail); - array_push(.@mb, WhirlyBird); - } - if (is_between2(110, .@lv, 150)) { - array_push(.@mb, PinkieSuseran); - array_push(.@mb, Mandragora); - array_push(.@mb, PinkieMaximus); - } - if (.@lv > 120) { - array_push(.@mb, Junglefowl); - array_push(.@mb, Tengu); - array_push(.@mb, Moubi); - } - if (.@lv > 130) { - array_push(.@mb, SuperiorShroom); - array_push(.@mb, Nutcracker); - array_push(.@mb, Golem); - } - if (.@lv > 140) { - array_push(.@mb, SiegeTower); - array_push(.@mb, GreenhornAbomination); - array_push(.@mb, ShadowTortuga); - array_push(.@mb, FireElement); - array_push(.@mb, WaterElement); - array_push(.@mb, EarthElement); - array_push(.@mb, WindElement); - } - if (.@lv > 150) { - array_push(.@mb, SacredWisp); - array_push(.@mb, EvilWisp); - array_push(.@mb, PanthomWisp); - array_push(.@mb, EpiphanyWisp); - } - if (.@lv > 175) - array_push(.@mb, Tortuga); - - /* Spawn them and make hostile */ - freeloop(true); - for (.@i = 0; .@i < 1+(.@tl); .@i++) { - .@mid = any_of(.@mb); - .@m=areamonster(MAZE_MAP$, 20, 20, .@mx, .@my, strmobinfo(1, .@mid), .@mid, 1); - set_aggro(.@m); - } - freeloop(false); + MazeMobs(((BaseLevel/10) + DTOWER_FLOOR * 5), true, rand2(9,14)); // 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$, 20, 20, .@mx, .@my, "Gatekeeper", MonsterSergeant, 1, "sDreamTower::OnBossDie"); setunitdata(.@mob, UDT_LEVEL, DTOWER_FLOOR * 5); setunitdata(.@mob, UDT_STR, DTOWER_FLOOR * 2); diff --git a/npc/functions/maze.txt b/npc/functions/maze.txt index 8cb7a2be5..b5dbf55a8 100644 --- a/npc/functions/maze.txt +++ b/npc/functions/maze.txt @@ -106,7 +106,7 @@ function script InitMaze { // Add a random treasure chest if set to do so if (getarg(2, false)) { - .@n$=instance_npcname("#T_"+MAZE_MAP$, MAZE_INST); + .@n$=instance_npcname(sprintf("#T_030-%02d", MAZE_ID), MAZE_INST); .@mx=getmapinfo(MAPINFO_SIZE_X, MAZE_MAP$)-20; .@my=getmapinfo(MAPINFO_SIZE_Y, MAZE_MAP$)-20; do { @@ -121,6 +121,263 @@ function script InitMaze { return true; } +///////////////////////////////////////////////////////////////////////////////// +// MazeMobs(level=BaseLevel, chests=yes, density_redux=10) +// Puts monsters on the maze. Less density_redux is more mobs. +function script MazeMobs { + .@mx=getmapinfo(MAPINFO_SIZE_X, MAZE_MAP$)-20; + .@my=getmapinfo(MAPINFO_SIZE_Y, MAZE_MAP$)-20; + .@tl=(20-.@mx)*(20-.@my) * 3 / 10; // Total tiles + collision guess + .@tl=.@tl / getarg(2, 10) + 1; // Monster density + + /* *** Copied from 006-5/groata.txt & 018-2-2/main.txt! *** */ + /* ********* Spawn monsters based on DTOWER_FLOOR ********* */ + .@lv = getarg(0, BaseLevel); + .@mb[0] = MagicGoblin; + .@mb[1] = CaveMaggot; + + // Artillery & Chests + // TODO: Mimics? + if (getarg(1, true)) { + if (.@lv > 10) + array_push(.@mb, BronzeChest); + if (.@lv > 15) + array_push(.@mb, BronzeMimic); + if (.@lv > 20) + array_push(.@mb, SmallMagicBif); + if (.@lv > 30) + array_push(.@mb, Bif); + if (.@lv > 45) + array_push(.@mb, SilverChest); + if (.@lv > 50) + array_push(.@mb, SilverMimic); + if (.@lv > 55) + array_push(.@mb, MagicBif); + if (.@lv > 75) + array_push(.@mb, GoldenChest); + if (.@lv > 80) + array_push(.@mb, GoldenMimic); + if (.@lv > 85) + array_push(.@mb, BigMagicBif); + if (.@lv > 105) + array_push(.@mb, PrismChest); + } + if (.@lv > 40) + array_push(.@mb, RobinBandit); + if (.@lv > 50) + array_push(.@mb, DustGatling); + if (.@lv > 60) + array_push(.@mb, DustRifle); + if (.@lv > 70) + array_push(.@mb, DustRevolver); + if (.@lv > 80) + array_push(.@mb, DustBoss); + if (.@lv > 90) + array_push(.@mb, GreatMoubooSlime); + if (.@lv > 100) + array_push(.@mb, Jhon); + + // Monsters + if (is_between2(0, .@lv, 30)) { + array_push(.@mb, Piou); + array_push(.@mb, Piousse); + array_push(.@mb, Squirrel); + array_push(.@mb, ManaPiou); + array_push(.@mb, ForestPiou); + array_push(.@mb, RedButterfly); + array_push(.@mb, Maggot); + array_push(.@mb, CandorScorpion); + array_push(.@mb, HouseMaggot); + array_push(.@mb, LittleYellowSlime); + array_push(.@mb, Ratto); + array_push(.@mb, RudolphSlime); + array_push(.@mb, MoubooSlime); + array_push(.@mb, Croc); + array_push(.@mb, Scorpion); + array_push(.@mb, SmallFrog); + } + if (is_between2(10, .@lv, 40)) { + array_push(.@mb, BigFrog); + array_push(.@mb, Lavern); + array_push(.@mb, LittleRedSlime); + array_push(.@mb, ChocolateSlime); + array_push(.@mb, Blub); + array_push(.@mb, Duck); + array_push(.@mb, Bat); + array_push(.@mb, CaveMaggot); + array_push(.@mb, ManaGhost); + array_push(.@mb, ManaBug); + array_push(.@mb, Fluffy); + array_push(.@mb, FireGoblin); + array_push(.@mb, ViciousSquirrel); + array_push(.@mb, RedScorpion); + array_push(.@mb, WhiteSlime); + array_push(.@mb, AzulSlime); + array_push(.@mb, DesertLogHead); + } + if (is_between2(20, .@lv, 50)) { + array_push(.@mb, RedSlime); + array_push(.@mb, PoisonSpikyMushroom); + array_push(.@mb, DesertBandit); + array_push(.@mb, OceanCroc); + array_push(.@mb, ToppyBlub); + array_push(.@mb, Sarracenus); + array_push(.@mb, IceMaggot); + array_push(.@mb, VampireBat); + array_push(.@mb, Bandit); + array_push(.@mb, Pinkie); + array_push(.@mb, LivingPotato); + array_push(.@mb, Assassin); + array_push(.@mb, Skeleton); + } + if (is_between2(30, .@lv, 60)) { + array_push(.@mb, CaveSnake); + array_push(.@mb, GreenSlime); + array_push(.@mb, CopperSlime); + array_push(.@mb, YellowSlime); + array_push(.@mb, SantaSlime); + array_push(.@mb, LavaSlime); + array_push(.@mb, Bluepar); + array_push(.@mb, DeathCat); + array_push(.@mb, Moggun); + array_push(.@mb, SeaSlime); + array_push(.@mb, RedMushroom); + array_push(.@mb, Mouboo); + array_push(.@mb, LogHead); + array_push(.@mb, CandiedSlime); + array_push(.@mb, OldSnake); + array_push(.@mb, GrassSnake); + } + if (is_between2(40, .@lv, 70)) { + array_push(.@mb, GiantMaggot); + array_push(.@mb, IcedFluffy); + array_push(.@mb, Snake); + array_push(.@mb, BlackSlime); + array_push(.@mb, Tipiou); + array_push(.@mb, AlphaMouboo); + array_push(.@mb, Pollet); + array_push(.@mb, PiouKnight); + array_push(.@mb, Shrewboo); + } + if (is_between2(40, .@lv, 80)) { + array_push(.@mb, Wolvern); + array_push(.@mb, FireSkull); + array_push(.@mb, DarkLizard); + } + if (is_between2(50, .@lv, 90)) { + array_push(.@mb, ArmoredSkeleton); + array_push(.@mb, BlackScorpion); + array_push(.@mb, ElectroWorm); + array_push(.@mb, EarthFairy); + array_push(.@mb, FireFairy); + array_push(.@mb, WaterFairy); + array_push(.@mb, WindFairy); + array_push(.@mb, PoisonFairy); + array_push(.@mb, MountainSnake); + array_push(.@mb, HoodedNinja); + array_push(.@mb, ForestMushroom); + array_push(.@mb, GoldenScorpion); + } + if (is_between2(60, .@lv, 100)) { + array_push(.@mb, Yeti); + array_push(.@mb, FallenGuard1); + array_push(.@mb, GreenSlimeMother); + array_push(.@mb, SnowFlower); + array_push(.@mb, BlueSlimeMother); + array_push(.@mb, WickedMushroom); + array_push(.@mb, CopperSlimeMother); + array_push(.@mb, YellowSlimeMother); + array_push(.@mb, RedSlimeMother); + array_push(.@mb, ChocolateSlimeMother); + array_push(.@mb, WhiteSlimeMother); + array_push(.@mb, Archant); + array_push(.@mb, Scar); + } + if (is_between2(70, .@lv, 110)) { + array_push(.@mb, AzulSlimeMother); + array_push(.@mb, SeaSlimeMother); + array_push(.@mb, LavaSlimeMother); + array_push(.@mb, BlackSlimeMother); + array_push(.@mb, Crafty); + array_push(.@mb, Forain); + array_push(.@mb, GreenDragon); + array_push(.@mb, Michel); + array_push(.@mb, Troll); + } + if (is_between2(80, .@lv, 120)) { + array_push(.@mb, EliteDuck); + array_push(.@mb, AzulSkullSlime); + array_push(.@mb, Moonshroom); + array_push(.@mb, RedSkullSlime); + array_push(.@mb, Terranite); + array_push(.@mb, JackO); + array_push(.@mb, BlackMamba); + array_push(.@mb, GreenSkullSlime); + array_push(.@mb, BloodyMouboo); + array_push(.@mb, Centaur); + array_push(.@mb, GoboBear); + } + if (is_between2(90, .@lv, 130)) { + array_push(.@mb, CopperSkullSlime); + array_push(.@mb, LavaSkullSlime); + array_push(.@mb, BlackSkullSlime); + array_push(.@mb, GiantCaveMaggot); + array_push(.@mb, TerraniteProtector); + array_push(.@mb, VanityPixie); + array_push(.@mb, HolyPixie); + } + if (is_between2(100, .@lv, 140)) { + array_push(.@mb, ShadowPixie); + array_push(.@mb, NulityPixie); + array_push(.@mb, Reaper); + array_push(.@mb, NightmareDragon); + array_push(.@mb, Snail); + array_push(.@mb, WhirlyBird); + } + if (is_between2(110, .@lv, 150)) { + array_push(.@mb, PinkieSuseran); + array_push(.@mb, Mandragora); + array_push(.@mb, PinkieMaximus); + } + if (.@lv > 120) { + array_push(.@mb, Junglefowl); + array_push(.@mb, Tengu); + array_push(.@mb, Moubi); + } + if (.@lv > 130) { + array_push(.@mb, SuperiorShroom); + array_push(.@mb, Nutcracker); + array_push(.@mb, Golem); + } + if (.@lv > 140) { + array_push(.@mb, SiegeTower); + array_push(.@mb, GreenhornAbomination); + array_push(.@mb, ShadowTortuga); + array_push(.@mb, FireElement); + array_push(.@mb, WaterElement); + array_push(.@mb, EarthElement); + array_push(.@mb, WindElement); + } + if (.@lv > 150) { + array_push(.@mb, SacredWisp); + array_push(.@mb, EvilWisp); + array_push(.@mb, PanthomWisp); + array_push(.@mb, EpiphanyWisp); + } + if (.@lv > 175) + array_push(.@mb, Tortuga); + + /* Spawn them and make hostile */ + freeloop(true); + for (.@i = 0; .@i < 1+(.@tl); .@i++) { + .@mid = any_of(.@mb); + .@m=areamonster(MAZE_MAP$, 20, 20, .@mx, .@my, strmobinfo(1, .@mid), .@mid, 1); + set_aggro(.@m); + } + freeloop(false); + return; +} + ///////////////////////////////////////////////////////////////////////////////// // RenewMaze(duration=2 hours) // Renews the map expiration time diff --git a/npc/functions/treasure.txt b/npc/functions/treasure.txt index cd8bae9e7..086978178 100644 --- a/npc/functions/treasure.txt +++ b/npc/functions/treasure.txt @@ -44,7 +44,7 @@ function script TreasureBox { else if (.@r < 1600 || .@t == 0) .@loot=any(MercBoxB, MoubooSteak, SmokeGrenade, ClothoLiquor, Coal, RedPlushWine, PrecisionPotion, CoinBag, DodgePotion, MoveSpeedPotion, Dagger, BronzeGift, IronOre, CopperOre, BlueDye, EquipmentBlueprintB, AlchemyBlueprintB, AlchemyBlueprintC, OolongTea); else if (.@r < 5200) - .@loot=any(MercBoxA, Croconut, Potatoz, MoubooSteak, ClothoLiquor, Coal, SmallMushroom, HastePotion, StrengthPotion, WoodenLog, LeatherPatch, Beer, StrangeCoin, EquipmentBlueprintA, EquipmentBlueprintB, AlchemyBlueprintA, SpearmintTea, TreasureMap, IcedBottle); + .@loot=any(MercBoxA, Croconut, Potatoz, MoubooSteak, ClothoLiquor, Coal, SmallMushroom, HastePotion, StrengthPotion, WoodenLog, LeatherPatch, Beer, StrangeCoin, EquipmentBlueprintA, EquipmentBlueprintB, AlchemyBlueprintA, SpearmintTea, TreasureMap, DungeonMap, IcedBottle); else .@loot=any(FatesPotion, PiberriesInfusion, EmptyBottle, ChocolateBar, Plushroom, Chagashroom, RawLog, LeatherPatch, BugLeg, ScorpionStinger, SmallKnife, ChamomileTea, EquipmentBlueprintA); 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; +} + -- cgit v1.2.3-60-g2f50