summaryrefslogtreecommitdiff
path: root/npc/magic
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-07-30 14:59:44 -0300
committerJesusaves <cpntb1@ymail.com>2020-07-30 14:59:44 -0300
commit2ecc7a56d276905f4f139f9f6b4baf97730e4c2b (patch)
tree35a29e4b3a056b725e777432c4ed3babc504cf97 /npc/magic
parent2303bef3da9a4a88fbbe33a4d583427d89468c7a (diff)
downloadserverdata-2ecc7a56d276905f4f139f9f6b4baf97730e4c2b.tar.gz
serverdata-2ecc7a56d276905f4f139f9f6b4baf97730e4c2b.tar.bz2
serverdata-2ecc7a56d276905f4f139f9f6b4baf97730e4c2b.tar.xz
serverdata-2ecc7a56d276905f4f139f9f6b4baf97730e4c2b.zip
Skill TMW2_STUDY registered
Cost: 1x Manapple. It is also the most expensive skill in RP terms. No MSP is required for studying (should be obvious)
Diffstat (limited to 'npc/magic')
-rw-r--r--npc/magic/study.txt12
1 files changed, 9 insertions, 3 deletions
diff --git a/npc/magic/study.txt b/npc/magic/study.txt
index 71beded64..418ac0f47 100644
--- a/npc/magic/study.txt
+++ b/npc/magic/study.txt
@@ -8,6 +8,10 @@
function script SK_study {
.@mobGD=getarg(0);
+ if (.@mobGD <= 0)
+ return;
+
+ // We want monsters
if (getunittype(.@mobGD) != UNITTYPE_MOB) {
dispbottom l("This skill can only be used on monsters!");
return;
@@ -16,7 +20,8 @@ function script SK_study {
// Research Points
if (array_rfind(@study, @mobGD) < 0) {
- .@rp=getmonsterinfo(MOB_LV)/10+1;
+ .@mult=max(1, 11-getskilllv(TMW2_STUDY));
+ .@rp=getmonsterinfo(MOB_LV)/.@mult+1;
array_push(@study, @mobGD);
dispbottom l("Research Points +%d", .@rp);
}
@@ -29,9 +34,10 @@ function script SK_study {
fnum(getunitdata(.@mobGD, UDT_SP)),
fnum(getunitdata(.@mobGD, UDT_MAXSP)));
- // Truncate
+ // Truncate.
+ // We're saving the GID so it must be "big enough"
+ // But not too big so rfind() is not expensive
if (getarraysize(@study) > 99) {
- //array_shift(@study);
deletearray(@study, 30);
}
return;