summaryrefslogtreecommitdiff
path: root/world/map/npc/magic/level2-rain.txt
diff options
context:
space:
mode:
authorJesusalva Jesusalva <jesusalva@themanaworld.org>2022-10-24 23:39:58 +0000
committerJesusalva Jesusalva <jesusalva@themanaworld.org>2022-10-24 23:39:58 +0000
commitb456fefa858671676c515a79be4b48d57a791305 (patch)
tree4a84a9f5711b6da10ac1e2552863a21f1a40ad0f /world/map/npc/magic/level2-rain.txt
parentb2522339a26f153a1214fd57d9b0a7c83fd3c6f2 (diff)
parent58e4b21b96d2bc4dae2c7132ec675faef0538bee (diff)
downloadserverdata-b456fefa858671676c515a79be4b48d57a791305.tar.gz
serverdata-b456fefa858671676c515a79be4b48d57a791305.tar.bz2
serverdata-b456fefa858671676c515a79be4b48d57a791305.tar.xz
serverdata-b456fefa858671676c515a79be4b48d57a791305.zip
Merge branch 'magic' into 'master'
magic use cooldown symbols See merge request legacy/serverdata!614
Diffstat (limited to 'world/map/npc/magic/level2-rain.txt')
-rw-r--r--world/map/npc/magic/level2-rain.txt27
1 files changed, 23 insertions, 4 deletions
diff --git a/world/map/npc/magic/level2-rain.txt b/world/map/npc/magic/level2-rain.txt
index fac98690..89ded96d 100644
--- a/world/map/npc/magic/level2-rain.txt
+++ b/world/map/npc/magic/level2-rain.txt
@@ -7,15 +7,21 @@ OnCast:
if(call("magic_checks")) end;
if (getskilllv(.school) < .level) end;
if (getskilllv(SKILL_MAGIC) < .level) end;
+ if (getskilllv(.school) < 4 && countitem("BottleOfWater") < 1) end;
if (Sp < 17) end;
explode .@map_ext[0], getmap(), "-";
if (.@map_ext[1] != 1 && getmap() != "099-5") end; // XXX this is fugly, in the future let's use MF_OUTSIDE to detect if a map is "outside" or "inside"
if (getmapflag(getmap(), MF_TOWN)) end;
- if (getskilllv(.school) < 4 && countitem("BottleOfWater") >= 1) delitem "BottleOfWater", 1;
- elif (getskilllv(.school) < 4) end;
+ if (getmap() == "033-1") goto L_SpecialRules6;
+ goto L_Pay;
+
+L_Pay:
+ if (getskilllv(.school) < 4) delitem "BottleOfWater", 1;
set Sp, Sp - 17;
set @_M_BLOCK, 1; // block casting, until the timer clears it
addtimer 3000, "Magic Timer::OnClear"; // set the new debuff
+ sc_start SC_COOLDOWN, 3000, 0, BL_ID;
+ sc_start SC_COOLDOWN_R, 30000, 0, BL_ID; // Set it to lenght of timeout
callfunc "adjust_spellpower";
set @krad, min(.max_radius,(min(@spellpower,200)/30)+3); // kaflosh radius
@@ -47,7 +53,7 @@ L_Absorb:
OnNearbyNpc:
explode .@nearby$[0], strnpcinfo(0,@target_id), "#";
- if(.@nearby$[1] == "DruidTree0" || .@nearby$[1] == "DruidTree0") goto L_Tree;
+ if(.@nearby$[0] == "DruidTree0" || .@nearby$[1] == "DruidTree0") goto L_Tree;
if(.@nearby$[0] == "rain" || .@nearby$[1] == "rain")
set @nearby, @nearby + 1;
end;
@@ -68,7 +74,10 @@ OnLaunch:
if(get(Hp, .caster) < 1) destroy; // destroy if caster is missing
if(getmap(.caster) != strnpcinfo(3)) destroy; // destroy if caster left the map
set .count, .count + 1;
- if(.count > .max) destroy;
+ if(.count > .max) goto L_Destroy;
+ goto L_Launch;
+
+L_Launch:
set .launch, 0;
callsub S_Launch;
addnpctimer 400 + rand(100), strnpcinfo(0)+"::OnLaunch"; // loop until max
@@ -82,6 +91,10 @@ S_Launch:
if(.launch < .max_launch) goto S_Launch;
return;
+L_Destroy:
+ if (attachrid(.caster)) sc_end SC_COOLDOWN_R;
+ destroy;
+
OnHit:
if (!(isloggedin(.caster))) destroy;
if(get(Hp, .caster) < 1) destroy; // destroy if caster is missing
@@ -96,6 +109,12 @@ OnDestroy:
debugmes "kaflosh timeout! [this shouldn't happen]"; // XXX: looks like this CAN happen with higher levels of magic, so we might want to cap max charges
destroy;
+L_SpecialRules6:
+ if ($@KIMARR_EVENT < 1) goto L_Pay;
+ if ($@Fluffy_FighterID == BL_ID) goto L_Pay;
+ message strcharinfo(0), "You can't use this spell here unless hunting fluffies.";
+ end;
+
OnInit:
set .school, SKILL_MAGIC_NATURE;
set .invocation$, chr(MAGIC_SYMBOL) + "kaflosh"; // used in npcs that refer to this spell