summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2024-07-31 15:00:14 -0300
committerJesusaves <cpntb1@ymail.com>2024-07-31 15:00:14 -0300
commit547bdcdf7b7e3f9c6a27b321b6c56f7212ab182a (patch)
treec0c1d6a5976500d310578815ec40489ec34c6228
parentef6ac4ba85789c7b9f0aee98fb5d8e46d2934b6a (diff)
downloadserverdata-547bdcdf7b7e3f9c6a27b321b6c56f7212ab182a.tar.gz
serverdata-547bdcdf7b7e3f9c6a27b321b6c56f7212ab182a.tar.bz2
serverdata-547bdcdf7b7e3f9c6a27b321b6c56f7212ab182a.tar.xz
serverdata-547bdcdf7b7e3f9c6a27b321b6c56f7212ab182a.zip
Special Map Effect: Over Clocked
Inflicts Botter's Syndrome "randomly" when CAPTCHA is off.
-rw-r--r--npc/017-0/_import.txt1
-rw-r--r--npc/functions/dungeon.txt87
2 files changed, 88 insertions, 0 deletions
diff --git a/npc/017-0/_import.txt b/npc/017-0/_import.txt
index 8597a6931..dafb0216f 100644
--- a/npc/017-0/_import.txt
+++ b/npc/017-0/_import.txt
@@ -1,5 +1,6 @@
// Map 017-0: Mystic Forest
// This file is generated automatically. All manually added changes will be removed when running the Converter.
+"npc/017-0/_config.txt",
"npc/017-0/_mobs.txt",
"npc/017-0/_warps.txt",
"npc/017-0/wizard.txt",
diff --git a/npc/functions/dungeon.txt b/npc/functions/dungeon.txt
index a9d2d5003..a9165aa32 100644
--- a/npc/functions/dungeon.txt
+++ b/npc/functions/dungeon.txt
@@ -13,6 +13,7 @@ OnInit:
setarray .cursemap$, "006-4", "006-4-1", "025-1", "026-2";
setarray .sickmap$, "029-5";
setarray .bleedmap$, "006-9", "026-6", "026-7";
+ setarray .clockmap$, "017-0";
end;
/////////////////////////////////////////
@@ -146,6 +147,92 @@ OnBleed:
end;
+/////////////////////////////////////////
+// Heartbeat for Clocked effects
+function syndroCheck {
+ .@k = getarg(0);
+ .@t = getarg(1, 2000);
+ sleep2(.@t);
+ if (!playerattached()) return false;
+ if (BaseExp != .@k) return true;
+ return false;
+}
+
+OnClocked:
+ // Not Applicable
+ if ($CAPTCHA & 4)
+ end;
+
+ // Did you left?
+ .@i=array_find(.clockmap$, getmap());
+ if (.@i < 0) {
+ @clocked$="";
+ end;
+ }
+
+ // First time seeing this
+ if (@clocked$ != getmap()) {
+ @clocked$=getmap();
+ dispbottom l("This is an OverClocked map, excessive combat will cause Botter's Syndrome Disease, which reduces EXP Gain and drops.");
+ }
+ // Prepare the variables we'll be studying
+ .@mpk = MONSTERS_KILLED; .@k = BaseExp;
+ // We'll now wait in some intervals. Killing in them cause
+ // the K variables to be set, and contribute towards bot score.
+ .@k1 = syndroCheck(.@k); .@k = BaseExp;
+ .@k2 = syndroCheck(.@k); .@k = BaseExp;
+ .@k3 = syndroCheck(.@k); .@k = BaseExp;
+ .@k4 = syndroCheck(.@k); .@k = BaseExp;
+ .@k5 = syndroCheck(.@k); .@k = BaseExp;
+ .@k6 = syndroCheck(.@k); .@k = BaseExp;
+ .@k7 = syndroCheck(.@k); .@k = BaseExp;
+ .@k8 = syndroCheck(.@k); .@k = BaseExp;
+ // Determine if you'll be afflicted, base chance is 100%
+ .@chance = 100;
+ // Every 2 seconds you spent without killing is -10%
+ if (!.@k1)
+ .@chance -= 10;
+ if (!.@k2)
+ .@chance -= 10;
+ if (!.@k3)
+ .@chance -= 10;
+ if (!.@k4)
+ .@chance -= 10;
+ if (!.@k5)
+ .@chance -= 10;
+ if (!.@k6)
+ .@chance -= 10;
+ if (!.@k7)
+ .@chance -= 10;
+ if (!.@k8)
+ .@chance -= 10;
+ // You killed less than 7 monsters, so zero the chance
+ if (.@mpk + 7 > MONSTERS_KILLED)
+ .@chance -= 20;
+ // (If you killed less than 12 monsters, potentially go to 10%
+ else if (.@mpk + 12 > MONSTERS_KILLED)
+ .@chance -= 10;
+
+ // Determine whenever you'll be afflicted with the Syndrome
+ // The syndrome duration is 30 seconds
+ if (rand2(100) < .@chance) {
+ // Calculate the effect based on your score (5~15%)
+ .@eff = 5 + (.@chance / 10);
+ // If you already have one running (!!), increase the effect
+ if (getstatus(SC_BOTTER_SYNDROME)) {
+ .@t = 1 + getstatus(SC_BOTTER_SYNDROME, 5) / 3600000;
+ .@eff += .@t + min(100, getstatus(SC_BOTTER_SYNDROME, 1));
+ }
+ // Sanitize the effect (it cannot go past 75%)
+ .@eff = min(75, .@eff);
+ SC_Bonus(30, SC_BOTTER_SYNDROME, .@eff);
+ }
+
+ // New tick (15~30 seconds fixed cycle)
+ addtimer2 rand(15000,30000), .name$+"::OnClocked";
+ end;
+
+
}