summaryrefslogtreecommitdiff
path: root/npc/magic
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-04-14 22:24:20 -0300
committerJesusaves <cpntb1@ymail.com>2021-04-14 22:24:20 -0300
commit9ce79291a280d0ebc93a076810a7e848fb0d397b (patch)
tree1aec1f3606f6f5aee535a03b8555728a31cb017f /npc/magic
parent9ed3fc1f95fe28741686280b1ae7da3b9f9ca403 (diff)
downloadserverdata-9ce79291a280d0ebc93a076810a7e848fb0d397b.tar.gz
serverdata-9ce79291a280d0ebc93a076810a7e848fb0d397b.tar.bz2
serverdata-9ce79291a280d0ebc93a076810a7e848fb0d397b.tar.xz
serverdata-9ce79291a280d0ebc93a076810a7e848fb0d397b.zip
Add Kaflosh. Maybe. Hopefully. This one requires some serious testing
Diffstat (limited to 'npc/magic')
-rw-r--r--npc/magic/final.txt2
-rw-r--r--npc/magic/level2-rain.txt50
2 files changed, 52 insertions, 0 deletions
diff --git a/npc/magic/final.txt b/npc/magic/final.txt
index e7d92da3..f5fe6750 100644
--- a/npc/magic/final.txt
+++ b/npc/magic/final.txt
@@ -62,6 +62,8 @@ function script HUB_SkillInvoke {
case SKILL_HALHISS:
case SKILL_HELORP:
SK_SummonLv2(); break;
+ case SKILL_KAFLOSH:
+ SK_Kaflosh(); break;
// Level 3
// Level 4
// Level 5
diff --git a/npc/magic/level2-rain.txt b/npc/magic/level2-rain.txt
new file mode 100644
index 00000000..c2b9a29a
--- /dev/null
+++ b/npc/magic/level2-rain.txt
@@ -0,0 +1,50 @@
+// The Mana World script
+// Author: Jesusalva <jesusalva@themanaworld.org>
+//
+// Magic Script: SKILL_KAFLOSH (Level 1)
+// School: Nature 2
+
+function script SK_Kaflosh {
+ .@m$=getmap();
+ .@cl="#WeatherCore"::climate(.@m$);
+
+ // Bad Climate
+ if (.@cl == CLIMATE_NONE) {
+ dispbottom l("It was impossible to conjure rain clouds on this map.");
+ return;
+ }
+
+ // Techinically not needed
+ .@rain="#WeatherCore"::weather(MASK_RAIN);
+ if (.@rain) {
+ dispbottom l("It is already raining!");
+ return;
+ }
+
+ // From now on, you'll have the cost paid and the MEXP deposited
+ delitem BottleOfWater, 1;
+ GetManaExp(@skillId, 2);
+
+ // Adjusted MATK will determine rain duration (15 ATK = 1s)
+ .@PW=80+(20*@skillLv);
+ .@dmg=AdjustSpellpower(.@PW);
+ .@time=.@dmg/15;
+ .@time+=getskilllv(SKILL_MAGIC_NATURE)-2; // +1 second per nature magic lv
+
+ // Adverse climate (eg. desert and icelands) will cut this to 1/3
+ if (.@cl != CLIMATE_MODERATE)
+ .@time=.@time/3;
+
+ // Rain must last at least 5 seconds or the clouds won't even gather
+ if (.@time < 5) {
+ dispbottom l("You do not have suffice magic power to make rain.");
+ return;
+ }
+
+ // Invoke the rain clouds; Everything else should work out of the box
+ // The builtin checks are not necessary in this case =D
+ // But would be for a sandstorm or snowstorm.
+ "#WeatherCore"::weather_override(MASK_RAIN, .@time, .@m$, true);
+ return;
+}
+