diff options
author | Jesusaves <cpntb1@ymail.com> | 2022-01-16 02:11:23 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2022-01-16 02:11:23 -0300 |
commit | ea07cd1adbc5b5cd522aaeb399907db7093c2822 (patch) | |
tree | e3b81646ff324362c2a65f4efc72b7f592cfb162 /npc/001-14 | |
parent | 729402190413df0e5c80c835f1737573eb29750b (diff) | |
download | serverdata-ea07cd1adbc5b5cd522aaeb399907db7093c2822.tar.gz serverdata-ea07cd1adbc5b5cd522aaeb399907db7093c2822.tar.bz2 serverdata-ea07cd1adbc5b5cd522aaeb399907db7093c2822.tar.xz serverdata-ea07cd1adbc5b5cd522aaeb399907db7093c2822.zip |
I'll finish this tomorrow, but send the untested (and incomplete) code live
Diffstat (limited to 'npc/001-14')
-rw-r--r-- | npc/001-14/ctrl.txt | 289 |
1 files changed, 287 insertions, 2 deletions
diff --git a/npc/001-14/ctrl.txt b/npc/001-14/ctrl.txt index 010df94e5..e86dd72e7 100644 --- a/npc/001-14/ctrl.txt +++ b/npc/001-14/ctrl.txt @@ -308,9 +308,294 @@ OnInit: } ///////////////////////////////////////////////////////////////////////////////// -// FIXME +// FIXME ยป Testing required 001-14,39,114,0 script Hocus#MOLY0800 NPC_BLACKWIZARD,{ - npctalk l("Maze Race Challenge"); + if (@moly_chall) end; + mes ".:: " + l("Maze Race Challenge") + ":: ."; + mes l("Description: Reach the other side of the maze and defeat the %s as quick as possible.", getmonsterlink(EntAbomination)); + mes l("There'll be monsters, the maze is randomly generated, and the initial position for you and the Ent is not fixed. Therefore, you may begin handicapped in some cases depending on luck only."); + mesc l("NOTE: No equipment restriction. Less time is better."); + mes ""; + mesc l("Your progress thus far: %s taken.", FuzzyTime(gettimetick(2) + FYMOLY_RACERS)), 3; + next; + mesc l("Begin campaign?"), 1; + if (askyesno() == ASK_NO) close; + // FIXME: Intercept death event or handle it better (a timer with map check?) + +OnStart: + @map$ = getmap(); + @moly_tick = gettimetick(2); // Will be used to determine score + @moly_score = 0; // Actually unused + @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(9,14) + 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); + + // Create the target boss + .@mx=getmapinfo(MAPINFO_SIZE_X, MAZE_MAP$)-20; + .@my=getmapinfo(MAPINFO_SIZE_Y, MAZE_MAP$)-20; + .@m=areamonster(MAZE_MAP$, .@mx-20, .@my-20, .@mx, .@my, strmobinfo(1, EntAbomination), EntAbomination, 1, "Hocus#MOLY0800::OnWin"); + setunitdata(.@m, UDT_MAXHP, 100); + setunitdata(.@m, UDT_HP, 100); + 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; + end; + +OnWin: + warp @map$, 39, 117; + if (@moly_tick < gettimetick(2) / 2) end; // Ticks were Corrupted + @moly_score = gettimetick(2) - @moly_tick; + if (@moly_score < 8) end; // This is impossible*, don't even bother + dispbottom l("End! Score this time: %s", FuzzyTime(@moly_tick)); + FYMOLY_RACERS = min(FYMOLY_RACERS, @moly_score); + @moly_score = 0; + @moly_chall = 0; + // *: Distance is always at least ~50 tiles in a straight line end; OnInit: |