From a25e43a009e94455e70e238855274fe347e9ba43 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 3 Jun 2022 22:20:49 -0300 Subject: 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. --- npc/functions/mkbot.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'npc/functions') 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; } -- cgit v1.2.3-70-g09d2