summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-06-03 22:20:49 -0300
committerJesusaves <cpntb1@ymail.com>2022-06-03 22:20:49 -0300
commita25e43a009e94455e70e238855274fe347e9ba43 (patch)
tree984b3acfb2d421e12b74c3af0f16acecc6dd00b1
parentfec09a8fb32391d36e78e18c458d7471f314c7b1 (diff)
downloadserverdata-a25e43a009e94455e70e238855274fe347e9ba43.tar.gz
serverdata-a25e43a009e94455e70e238855274fe347e9ba43.tar.bz2
serverdata-a25e43a009e94455e70e238855274fe347e9ba43.tar.xz
serverdata-a25e43a009e94455e70e238855274fe347e9ba43.zip
Prevent players from farming monster king aggro by setting 30 seconds ticks.
You can only generate up to 5 aggro every 30 seconds, non-cummulative. If you kill a level 30 monster and then a level 60 monster, 2 aggro is generated. If you kill two level 30 monsters, 1 aggro is generated. If you kill a level 90 monster and then a level 60 monster, 3 aggro is generated. If you kill a level 150 monster, wait 45 seconds, and kill a lv 30 one, 6 aggro is generated.
-rw-r--r--npc/functions/mkbot.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/npc/functions/mkbot.txt b/npc/functions/mkbot.txt
index 1b0d2b0cb..1ea3f2ba8 100644
--- a/npc/functions/mkbot.txt
+++ b/npc/functions/mkbot.txt
@@ -259,7 +259,19 @@ function script MKAggro {
.@aggro=getarg(0, killedrid);
.@moblv=strmobinfo(3,.@aggro);
.@aggro=min(5, .@moblv / 30);
+
+ // Cycles of 30 seconds
+ if (@mkaggra+30 > gettimetick(2)) {
+ .@aggro -= @mkaggrb;
+ if (.@aggro <= 0)
+ return;
+ } else {
+ @mkaggrb=0;
+ }
+ // Increase monster king aggro and update ticks
$@MK_AGGRO += .@aggro;
+ @mkaggra=gettimetick(2);
+ @mkaggrb=.@aggro + @mkaggrb;
return;
}