summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/mob_points.txt4
-rw-r--r--npc/functions/quests.txt30
2 files changed, 32 insertions, 2 deletions
diff --git a/npc/functions/mob_points.txt b/npc/functions/mob_points.txt
index a9f6f1d4..c80a5514 100644
--- a/npc/functions/mob_points.txt
+++ b/npc/functions/mob_points.txt
@@ -43,9 +43,9 @@ function script MobPoints {
Mobpt+=.@addval;
}
- callfunc "ValonCount";
+ ValonCount();
if (((QL_VALON >= 2) && (QL_VALON < 6)) && (@mobId == $@ValonMob[@valon_mob]))
- callfunc("AddValonCntMask");
+ AddValonCntMask();
// Attitude adjustment for Sagatha
diff --git a/npc/functions/quests.txt b/npc/functions/quests.txt
index 3f0c40ef..fcdc13eb 100644
--- a/npc/functions/quests.txt
+++ b/npc/functions/quests.txt
@@ -35,3 +35,33 @@ function script elanore_decrease_exp {
return;
}
+function script ValonCount {
+ @valon_mob = 0;
+ if (QL_VALON >= 2)
+ @valon_mob = (QL_VALON - 2);
+ @valon_count = ((STARTAREA & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT);
+ return;
+}
+
+function script ResetValonCntMask {
+ STARTAREA = (STARTAREA & ~(NIBBLE_2_MASK) | (0 << NIBBLE_2_SHIFT));
+ return;
+}
+
+function script ValonProgress {
+ ValonCount();
+ if ((QL_VALON > 1) && (QL_VALON < 6))
+ message strcharinfo(0), $@ValonMobName$[@valon_mob] + ": " + @valon_count + "/" + $@ValonMobCnt[@valon_mob];
+ return;
+}
+
+function script AddValonCntMask {
+ @valon_tmp = (@valon_count + 1);
+ if (@valon_tmp > $@ValonMobCnt[@valon_mob])
+ @valon_tmp = $@ValonMobCnt[@valon_mob];
+ STARTAREA = (STARTAREA & ~(NIBBLE_2_MASK) | (@valon_tmp << NIBBLE_2_SHIFT));
+ @valon_tmp = 0;
+ ValonProgress();
+ return;
+}
+