diff options
Diffstat (limited to 'npc')
-rw-r--r-- | npc/functions/weather.txt | 46 | ||||
-rw-r--r-- | npc/magic/final.txt | 2 | ||||
-rw-r--r-- | npc/magic/level2-rain.txt | 50 | ||||
-rw-r--r-- | npc/scripts.conf | 1 |
4 files changed, 76 insertions, 23 deletions
diff --git a/npc/functions/weather.txt b/npc/functions/weather.txt index 1d384a04..5de86a5b 100644 --- a/npc/functions/weather.txt +++ b/npc/functions/weather.txt @@ -38,27 +38,27 @@ OnInit: htput(.wcore, "043-1", CLIMATE_DESERT); // Woodlands - htput(.wcore, "007-1", CLIMATE_WOODLAND); - htput(.wcore, "008-1", CLIMATE_WOODLAND); - htput(.wcore, "009-1", CLIMATE_WOODLAND); - htput(.wcore, "010-1", CLIMATE_WOODLAND); - htput(.wcore, "011-1", CLIMATE_WOODLAND); - htput(.wcore, "012-1", CLIMATE_WOODLAND); - htput(.wcore, "013-1", CLIMATE_WOODLAND); - htput(.wcore, "014-1", CLIMATE_WOODLAND); - htput(.wcore, "015-1", CLIMATE_WOODLAND); - htput(.wcore, "016-1", CLIMATE_WOODLAND); - htput(.wcore, "017-1", CLIMATE_WOODLAND); - htput(.wcore, "018-1", CLIMATE_WOODLAND); - htput(.wcore, "025-1", CLIMATE_WOODLAND); - htput(.wcore, "026-1", CLIMATE_WOODLAND); - htput(.wcore, "027-1", CLIMATE_WOODLAND); - htput(.wcore, "028-1", CLIMATE_WOODLAND); - htput(.wcore, "029-1", CLIMATE_WOODLAND); - htput(.wcore, "051-1", CLIMATE_WOODLAND); // ? - htput(.wcore, "052-1", CLIMATE_WOODLAND); - htput(.wcore, "055-1", CLIMATE_WOODLAND); - htput(.wcore, "057-1", CLIMATE_WOODLAND); + htput(.wcore, "007-1", CLIMATE_MODERATE); + htput(.wcore, "008-1", CLIMATE_MODERATE); + htput(.wcore, "009-1", CLIMATE_MODERATE); + htput(.wcore, "010-1", CLIMATE_MODERATE); + htput(.wcore, "011-1", CLIMATE_MODERATE); + htput(.wcore, "012-1", CLIMATE_MODERATE); + htput(.wcore, "013-1", CLIMATE_MODERATE); + htput(.wcore, "014-1", CLIMATE_MODERATE); + htput(.wcore, "015-1", CLIMATE_MODERATE); + htput(.wcore, "016-1", CLIMATE_MODERATE); + htput(.wcore, "017-1", CLIMATE_MODERATE); + htput(.wcore, "018-1", CLIMATE_MODERATE); + htput(.wcore, "025-1", CLIMATE_MODERATE); + htput(.wcore, "026-1", CLIMATE_MODERATE); + htput(.wcore, "027-1", CLIMATE_MODERATE); + htput(.wcore, "028-1", CLIMATE_MODERATE); + htput(.wcore, "029-1", CLIMATE_MODERATE); + htput(.wcore, "051-1", CLIMATE_MODERATE); // ? + htput(.wcore, "052-1", CLIMATE_MODERATE); + htput(.wcore, "055-1", CLIMATE_MODERATE); + htput(.wcore, "057-1", CLIMATE_MODERATE); // Icelands htput(.wcore, "019-1", CLIMATE_ICELAND); @@ -163,8 +163,8 @@ OnInit: } /////////////////////////////////////////////////////////////////// - // Every 5 seconds, we clean up any ongoing weather effects -OnTimer5000: + // Every 2.5 seconds, we clean up any ongoing weather effects +OnTimer2500: // No weather effect if (!htsize(.wtime)) { initnpctimer; 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; +} + diff --git a/npc/scripts.conf b/npc/scripts.conf index 0852925c..95ff9137 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -75,6 +75,7 @@ "npc/magic/level1-grow-plants.txt", "npc/magic/level1-lesser-heal.txt", "npc/magic/level2-lay-on-hands.txt", +"npc/magic/level2-rain.txt", "npc/magic/level2-summon-monsters.txt", "npc/magic/final.txt", |