summaryrefslogtreecommitdiff
path: root/npc/magic/level2-rain.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/magic/level2-rain.txt')
-rw-r--r--npc/magic/level2-rain.txt50
1 files changed, 50 insertions, 0 deletions
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;
+}
+