summaryrefslogtreecommitdiff
path: root/npc/functions/mobpoint.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-06-13 20:52:23 -0300
committerJesusaves <cpntb1@ymail.com>2020-06-13 20:52:23 -0300
commit92f41d9a2229028575f0e7a37f0104ce8eff6eaf (patch)
tree02e3b3a3e0a902b381c2d901af9c16a290333463 /npc/functions/mobpoint.txt
parentedcd20a005cd18273bdcb87d43fdc259029d88b5 (diff)
downloadserverdata-92f41d9a2229028575f0e7a37f0104ce8eff6eaf.tar.gz
serverdata-92f41d9a2229028575f0e7a37f0104ce8eff6eaf.tar.bz2
serverdata-92f41d9a2229028575f0e7a37f0104ce8eff6eaf.tar.xz
serverdata-92f41d9a2229028575f0e7a37f0104ce8eff6eaf.zip
NEW MONSTER POINT RULE.
If target level is above you, you'll get +1% mob pt (capped at 50% bonus) If target level is below you, you'll get -1% mob pt (capped at 50% malus) Note: If target is exactly 1 level below you, there'll be no penalty. Numbers are always rounded down.
Diffstat (limited to 'npc/functions/mobpoint.txt')
-rw-r--r--npc/functions/mobpoint.txt20
1 files changed, 18 insertions, 2 deletions
diff --git a/npc/functions/mobpoint.txt b/npc/functions/mobpoint.txt
index 11bb40f57..6a6ed99ad 100644
--- a/npc/functions/mobpoint.txt
+++ b/npc/functions/mobpoint.txt
@@ -15,12 +15,28 @@ function script mobpoint {
return;
//if (killedrid < 1002) goto L_Return;
+ .@moblv=strmobinfo(3,killedrid);
// You get MobLv + 20% as MobPoints.
// So a level 100 monster gives you 120 MobPt. Slimes gives no bonus.
if (compare("slime", strtolower(strmobinfo(1, killedrid))))
- .@addval=strmobinfo(3,killedrid);
+ .@addval=.@moblv;
else
- .@addval=strmobinfo(3,killedrid)*12/10;
+ .@addval=.@moblv*12/10;
+
+ // Penalty/Bonus
+ .@base=(.@moblv-BaseLevel);
+ if (BaseLevel < .@moblv) {
+ // Target is stronger, +1% per monster level, capped at +50%
+ .@addval = .@addval * limit(100, 100+.@base, 150) / 100;
+ } else if (BaseLevel > .@moblv) {
+ // Target is weaker, -1% per monster level, capped at -50%
+ .@addval = .@addval * limit(50, 101+.@base, 100) / 100;
+ }
+
+ // Sanitization
+ .@addval=max(0, .@addval);
+
+ // Grant you the Monster Points
Mobpt = Mobpt + .@addval;
return;