summaryrefslogtreecommitdiff
path: root/npc/magic/level2-rain.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/magic/level2-rain.txt')
-rwxr-xr-xnpc/magic/level2-rain.txt104
1 files changed, 0 insertions, 104 deletions
diff --git a/npc/magic/level2-rain.txt b/npc/magic/level2-rain.txt
deleted file mode 100755
index e95974e0..00000000
--- a/npc/magic/level2-rain.txt
+++ /dev/null
@@ -1,104 +0,0 @@
-- script rain NPC32767,{
- // we can not start here because for the puppets this is OnClick
- end;
-
-OnCast:
- if(call("magic_checks")) end;
- if (getskilllv(.school) < .level) end;
- if (getskilllv(SKILL_MAGIC) < .level) end;
- if (Sp < 17) end;
- explode .@map_ext[0], getmapname(), "-";
- if (.@map_ext[1] != 1) end; // XXX this is fugly, in the future let's use MF_OUTSIDE to detect if a map is "outside" or "inside"
- if (getmapflag(getmapname(), MF_TOWN)) end;
- if (getskilllv(.school) < 4 && countitem("BottleOfWater") >= 1) delitem "BottleOfWater", 1;
- elif (getskilllv(.school) < 4) end;
- Sp = Sp - 17;
- set @_M_BLOCK, 1; // block casting, until the timer clears it
- addtimer 3000, "Magic Timer::OnClear"; // set the new debuff
-
- callfunc "adjust_spellpower";
- set @krad, min(.max_radius,(min(@spellpower,200)/30)+3); // kaflosh radius
-
- @nearby = 0;
- foreach 1, getmapname(), POS_X - .max_radius, POS_Y - .max_radius, POS_X + .max_radius, POS_Y + .max_radius,
- strnpcinfo(0) + "::OnNearbyNpc";
- if (@nearby) goto L_Absorb;
-
- set @new_npc_name$, "#" + strnpcinfo(0) + "#" + getcharid(3); // make a unique puppet name for every player
- callfunc "magic_exp";
- misceffect FX_MAGIC_GREEN, strcharinfo(0);
- set @spell_npc, puppet(getmapname(), POS_X, POS_Y, @new_npc_name$, 127); // clone npc => get puppet id
- if (@spell_npc < 1) end;
- set .caster, getcharid(3), @spell_npc; // tell the puppet who controls it
- set .radius, @krad, @spell_npc; // this is also used by ingrav, don't rename
- .initial_x = POS_X, @spell_npc;
- .initial_y = POS_Y, @spell_npc;
- .max = @spellpower/3, @spell_npc;
- .max_launch = min(200,@spellpower/2)/100, @spell_npc;
- donpcevent @new_npc_name$+"::OnLaunch"; // start
- addnpctimer 30000, @new_npc_name$+"::OnDestroy"; // this is just a failsafe in case the npc is not properly destroyed
- if(isin("011-1", 85, 31, 103, 45)) goto L_Pumpkins;
- end;
-
-L_Absorb:
- message strcharinfo(0), "##3Rain : ##BA nearby raincloud absorbs your magic.";
- end;
-
-OnNearbyNpc:
- explode .@nearby$[0], strnpcinfo(0,@target_id), "#";
- if(.@nearby$[1] == "DruidTree0" || .@nearby$[1] == "DruidTree0") goto L_Tree;
- if(.@nearby$[0] == "rain" || .@nearby$[1] == "rain")
- @nearby = @nearby + 1;
- end;
-
-L_Pumpkins:
- callfunc "HalloweenQuestWaterPumpkins";
- end;
-
-L_Tree:
- set .@x, get(POS_X, @target_id); set .@y, get(POS_Y, @target_id);
- if (.@x < POS_X-@krad || .@y < POS_Y-@krad || .@x > POS_X+@krad || .@y > POS_Y+@krad) end; // in max radius but not in puppet area
- @flag = 1;
- callfunc "QuestTreeTrigger";
- close;
-
-OnLaunch:
- if(get(Hp, .caster) < 1) destroy; // destroy if caster is missing
- if(getmap(.caster) != strnpcinfo(3)) destroy; // destroy if caster left the map
- .count = .count + 1;
- if(.count > .max) destroy;
- .launch = 0;
- callsub S_Launch;
- addnpctimer 400 + rand(100), strnpcinfo(0)+"::OnLaunch"; // loop until max
- end;
-
-S_Launch:
- npcareawarp .initial_x - .radius, .initial_y - .radius, .initial_x + .radius, .initial_y + .radius, 0, strnpcinfo(0);
- misceffect FX_RAIN;
- foreach 2, strnpcinfo(3), getnpcx()-1, getnpcy()-1, getnpcx()+1, getnpcy()+1, strnpcinfo(0) + "::OnHit", .caster;
- .launch = .launch + 1;
- if(.launch < .max_launch) goto S_Launch;
- return;
-
-OnHit:
- if(get(Hp, .caster) < 1) destroy; // destroy if caster is missing
- if(getmap(.caster) != strnpcinfo(3)) destroy; // destroy if caster left the map
- if(target(.caster, @target_id, 16) != 16 && .caster != @target_id) end;
- if((get(BL_TYPE, @target_id) & 1) == 0) end; // either mob or pc
- if(get(ELTTYPE, @target_id) == ELT_FIRE)
- injure .caster, @target_id, ((rand((@spellpower/15)+5)+2) * (100 - get(MDEF1, @target_id))) / 100;
- end;
-
-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;
-
-OnInit:
- .school = SKILL_MAGIC_NATURE;
- set .invocation$, chr(MAGIC_SYMBOL) + "kaflosh"; // used in npcs that refer to this spell
- void call("magic_register", "OnCast");
- .level = 2;
- .exp_gain = 1;
- .max_radius = 15;
- end;
-}