summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/functions/clientversion.txt14
-rw-r--r--npc/functions/util.txt15
2 files changed, 23 insertions, 6 deletions
diff --git a/npc/functions/clientversion.txt b/npc/functions/clientversion.txt
index 3e6b11830..a9e740a2b 100644
--- a/npc/functions/clientversion.txt
+++ b/npc/functions/clientversion.txt
@@ -909,6 +909,20 @@ function script clientupdater {
skill(TMW2_SPEECH, .@x, 0);
dispbottom l("AFK skill levels fixed.");
}
+ // Magic RP bugfix
+ // sáb ago 1 05:45:00 BRT 2020
+ if (UPDATE < 1596271500) {
+ UPDATE=1596271500;
+ for (.@i=0; .@i < getarraysize($@MSK_MAGIC) ; .@i++) {
+ if (getskilllv($@MSK_MAGIC[.@i]) > 1) {
+ .@msp=max(0, getskilllv(@menuret)-5);
+ MAGIC_PTS-=.@msp;
+ skill $@MSK_MAGIC[.@i], 1, 0;
+ dispbottom l("%s removed - YOU NOOB STOP CHEATING %%e%%Q",
+ getskillname($@MSK_MAGIC[.@i]), .@msp);
+ }
+ }
+ }
// :// End of Regular Update System
////////////////////////////////////
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index 9daef7611..90106d177 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -730,10 +730,10 @@ function script mlearn {
// Not enough MSP
if (!sk_canlvup(.@msp))
return false;
- // TODO: Not enough AP
- //if (MAGIC_AP < .@ap) {
- // return false;
- //}
+ // Not enough AP
+ if (MAGIC_RP < .@ap) {
+ return false;
+ }
// Payment
if (countitem(.@it) < .@am)
@@ -743,6 +743,7 @@ function script mlearn {
// Level up
sk_lvup(.@sk, .@msp);
+ MAGIC_RP-=.@ap;
return true;
}
@@ -771,6 +772,7 @@ function script learn_magic {
mesc l("Pre-requisites not met!"), 1;
mesc l("The following skill is needed: %s%s (Lv. %d)",
"##9", getskillname(.@pre), 1), 1;
+ next;
return false;
}
}
@@ -778,6 +780,7 @@ function script learn_magic {
// Max level reached
if (getskilllv(.@ski) >= .@mlv) {
mesc l("You've reached the maximum level for this skill."), 1;
+ next;
return true;
}
@@ -796,7 +799,7 @@ function script learn_magic {
mesc l("%s %s will require:", .@learn$, getskillname(.@ski));
mes l("* %d/%d MSP (Magic Skill Points)", sk_points(), .@msp);
- mes l("* %d/%d RP (Research Points)", fnum(MAGIC_RP), fnum(.@ap));
+ mes l("* %s/%s RP (Research Points)", fnum(MAGIC_RP), fnum(.@ap));
if (countitem(.@it) < .@am) {
mesc l("~~%d/%d %s~~", countitem(.@it), .@am, getitemlink(.@it)), 8;
mes l("* %d/%d %s", countitem(ScholarshipBadge), 1, getitemlink(ScholarshipBadge));
@@ -808,7 +811,7 @@ function script learn_magic {
if (askyesno() == ASK_NO)
return true;
- return mlearn(.@ski, .@mlv, .@msp, .@it, .@am);
+ return mlearn(.@ski, .@mlv, .@msp, .@it, .@am, .@ap);
}
// transcheck( {item 1, amount 1}, {item 2, amount 2}... )