diff options
Diffstat (limited to 'npc/functions')
-rw-r--r-- | npc/functions/event.txt | 26 | ||||
-rw-r--r-- | npc/functions/math.txt | 10 |
2 files changed, 23 insertions, 13 deletions
diff --git a/npc/functions/event.txt b/npc/functions/event.txt index f3b094b03..6c72ef205 100644 --- a/npc/functions/event.txt +++ b/npc/functions/event.txt @@ -125,7 +125,7 @@ OnWarpTo: array_push(.@mb, PrismChest); // Monsters - if (is_between(0, .@lv, 30)) { + if (is_between2(0, .@lv, 30)) { array_push(.@mb, Piou); array_push(.@mb, Piousse); array_push(.@mb, Squirrel); @@ -143,7 +143,7 @@ OnWarpTo: array_push(.@mb, Scorpion); array_push(.@mb, SmallFrog); } - if (is_between(10, .@lv, 40)) { + if (is_between2(10, .@lv, 40)) { array_push(.@mb, BigFrog); array_push(.@mb, Lavern); array_push(.@mb, LittleRedSlime); @@ -162,7 +162,7 @@ OnWarpTo: array_push(.@mb, AzulSlime); array_push(.@mb, DesertLogHead); } - if (is_between(20, .@lv, 50)) { + if (is_between2(20, .@lv, 50)) { array_push(.@mb, RedSlime); array_push(.@mb, PoisonSpikyMushroom); array_push(.@mb, DesertBandit); @@ -177,7 +177,7 @@ OnWarpTo: array_push(.@mb, Assassin); array_push(.@mb, Skeleton); } - if (is_between(30, .@lv, 60)) { + if (is_between2(30, .@lv, 60)) { array_push(.@mb, CaveSnake); array_push(.@mb, GreenSlime); array_push(.@mb, CopperSlime); @@ -195,7 +195,7 @@ OnWarpTo: array_push(.@mb, OldSnake); array_push(.@mb, GrassSnake); } - if (is_between(40, .@lv, 70)) { + if (is_between2(40, .@lv, 70)) { array_push(.@mb, GiantMaggot); array_push(.@mb, IcedFluffy); array_push(.@mb, Snake); @@ -206,12 +206,12 @@ OnWarpTo: array_push(.@mb, PiouKnight); array_push(.@mb, Shrewboo); } - if (is_between(40, .@lv, 80)) { + if (is_between2(40, .@lv, 80)) { array_push(.@mb, Wolvern); array_push(.@mb, FireSkull); array_push(.@mb, DarkLizard); } - if (is_between(50, .@lv, 90)) { + if (is_between2(50, .@lv, 90)) { array_push(.@mb, ArmoredSkeleton); array_push(.@mb, BlackScorpion); array_push(.@mb, ElectroWorm); @@ -225,7 +225,7 @@ OnWarpTo: array_push(.@mb, ForestMushroom); array_push(.@mb, GoldenScorpion); } - if (is_between(60, .@lv, 100)) { + if (is_between2(60, .@lv, 100)) { array_push(.@mb, Yeti); array_push(.@mb, FallenGuard1); array_push(.@mb, GreenSlimeMother); @@ -240,7 +240,7 @@ OnWarpTo: array_push(.@mb, Archant); array_push(.@mb, Scar); } - if (is_between(70, .@lv, 110)) { + if (is_between2(70, .@lv, 110)) { array_push(.@mb, AzulSlimeMother); array_push(.@mb, SeaSlimeMother); array_push(.@mb, LavaSlimeMother); @@ -251,7 +251,7 @@ OnWarpTo: array_push(.@mb, Michel); array_push(.@mb, Troll); } - if (is_between(80, .@lv, 120)) { + if (is_between2(80, .@lv, 120)) { array_push(.@mb, EliteDuck); array_push(.@mb, AzulSkullSlime); array_push(.@mb, Moonshroom); @@ -264,7 +264,7 @@ OnWarpTo: array_push(.@mb, Centaur); array_push(.@mb, GoboBear); } - if (is_between(90, .@lv, 130)) { + if (is_between2(90, .@lv, 130)) { array_push(.@mb, CopperSkullSlime); array_push(.@mb, LavaSkullSlime); array_push(.@mb, BlackSkullSlime); @@ -273,7 +273,7 @@ OnWarpTo: array_push(.@mb, VanityPixie); array_push(.@mb, HolyPixie); } - if (is_between(100, .@lv, 140)) { + if (is_between2(100, .@lv, 140)) { array_push(.@mb, ShadowPixie); array_push(.@mb, NulityPixie); array_push(.@mb, Reaper); @@ -281,7 +281,7 @@ OnWarpTo: array_push(.@mb, Snail); array_push(.@mb, WhirlyBird); } - if (is_between(110, .@lv, 150)) { + if (is_between2(110, .@lv, 150)) { array_push(.@mb, PinkieSuseran); array_push(.@mb, Mandragora); array_push(.@mb, PinkieMaximus); diff --git a/npc/functions/math.txt b/npc/functions/math.txt index fc27bec40..22cf88159 100644 --- a/npc/functions/math.txt +++ b/npc/functions/math.txt @@ -79,6 +79,16 @@ function script is_between { } +// result is: lower < target <= higher +// is_between ( lower, target, higher) +function script is_between2 { + .@min=getarg(0); + .@val=getarg(1); + .@max=getarg(2); + return (.@min < .@val && .@val <= .@max); +} + + // forces the equation: lower <= target <= higher. // Note it still works if higher and target values are swapped. // limit ( lower, target, higher) |