From 58e4b21b96d2bc4dae2c7132ec675faef0538bee Mon Sep 17 00:00:00 2001 From: HoraK-FDF Date: Mon, 24 Oct 2022 23:39:58 +0000 Subject: magic use cooldown symbols. Also, restrict magic on Kimarr. --- world/map/db/const.txt | 5 ++++ world/map/npc/magic/event-summon-managuardian.txt | 17 ++++++++++-- world/map/npc/magic/event-summon-manatyrant.txt | 17 ++++++++++-- world/map/npc/magic/level0-wand.txt | 1 + world/map/npc/magic/level1-aggravate.txt | 1 + world/map/npc/magic/level1-detect-magic.txt | 1 + world/map/npc/magic/level1-experience.txt | 1 + world/map/npc/magic/level1-flare-dart.txt | 1 + world/map/npc/magic/level1-grow-alizarin.txt | 1 + world/map/npc/magic/level1-grow-cobalt.txt | 1 + world/map/npc/magic/level1-grow-gamboge.txt | 1 + world/map/npc/magic/level1-grow-mauve.txt | 1 + world/map/npc/magic/level1-lesser-heal.txt | 12 +++++++++ world/map/npc/magic/level1-magic-blade.txt | 1 + world/map/npc/magic/level1-make-sulphur.txt | 1 + world/map/npc/magic/level1-summon-maggots.txt | 11 ++++++++ world/map/npc/magic/level1-transmute-wood.txt | 1 + world/map/npc/magic/level2-arrow-hail.txt | 31 +++++++++++++++++++--- world/map/npc/magic/level2-barrier.txt | 19 +++++++++---- world/map/npc/magic/level2-detect-players.txt | 1 + world/map/npc/magic/level2-enchant-lifestone.txt | 1 + world/map/npc/magic/level2-flying-backpack.txt | 27 +++++++++++++------ world/map/npc/magic/level2-happy-curse.txt | 1 + world/map/npc/magic/level2-hide.txt | 1 + world/map/npc/magic/level2-lay-on-hands.txt | 15 ++++++++--- world/map/npc/magic/level2-lightning-strike.txt | 1 + world/map/npc/magic/level2-magic-knuckles.txt | 1 + world/map/npc/magic/level2-make-arrows.txt | 1 + world/map/npc/magic/level2-make-iron-powder.txt | 1 + world/map/npc/magic/level2-make-shirt.txt | 1 + world/map/npc/magic/level2-make-short-tanktop.txt | 1 + world/map/npc/magic/level2-make-tanktop.txt | 1 + world/map/npc/magic/level2-protect.txt | 17 +++++++++--- world/map/npc/magic/level2-rain.txt | 27 ++++++++++++++++--- world/map/npc/magic/level2-shear.txt | 1 + world/map/npc/magic/level2-summon-fluffies.txt | 11 ++++++++ world/map/npc/magic/level2-summon-mouboo.txt | 11 ++++++++ world/map/npc/magic/level2-summon-pinkie.txt | 11 ++++++++ world/map/npc/magic/level2-summon-snakes.txt | 11 ++++++++ .../map/npc/magic/level2-summon-spiky-mushroom.txt | 11 ++++++++ .../map/npc/magic/level2-summon-wickedmushroom.txt | 11 ++++++++ world/map/npc/magic/level2-toxic-dart.txt | 1 + world/map/npc/magic/level3-necromancy.txt | 1 + 43 files changed, 258 insertions(+), 32 deletions(-) diff --git a/world/map/db/const.txt b/world/map/db/const.txt index 335ab687..f4625294 100644 --- a/world/map/db/const.txt +++ b/world/map/db/const.txt @@ -237,6 +237,11 @@ SC_FLYING_BACKPACK 196 SC_MBARRIER 197 SC_HASTE 198 SC_PHYS_SHIELD 199 +SC_COOLDOWN 71 +SC_COOLDOWN_MG 72 +SC_COOLDOWN_MT 73 +SC_COOLDOWN_R 74 +SC_COOLDOWN_AR 75 // Emotions EMOTE_DISGUST 1 diff --git a/world/map/npc/magic/event-summon-managuardian.txt b/world/map/npc/magic/event-summon-managuardian.txt index bad1213c..4e91ee06 100644 --- a/world/map/npc/magic/event-summon-managuardian.txt +++ b/world/map/npc/magic/event-summon-managuardian.txt @@ -10,10 +10,16 @@ OnCast: if (getskilllv(SKILL_MAGIC) < .level) end; if (countitem("TinyManaElixir") < 1) end; if (!$DOOMSDAY_SUMMON) end; - if (@ddcooldown > gettimetick(2)) goto L_Cooldown; +// if (@ddcooldown > gettimetick(2)) goto L_Cooldown; + if (sc_check(SC_COOLDOWN_MG)) goto L_Cooldown; + if (getmap() == "033-1") goto L_SpecialRules6; + goto L_Pay; + +L_Pay: delitem "TinyManaElixir", 1; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 15000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 15000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 100; misceffect FX_MAGIC_MAGGOT_CAST, strcharinfo(0); @@ -23,7 +29,8 @@ OnCast: if (.@puppet < 1) end; set .master, BL_ID, .@puppet; set .lifetime, (@spellpower*9)+60000, .@puppet; - set @ddcooldown, gettimetick(2)+70; // This is measured in seconds +// set @ddcooldown, gettimetick(2)+70; // This is measured in seconds + sc_start SC_COOLDOWN_MG, (@spellpower*9)+70000, 0, BL_ID; // .lifetime + OnSummon addnpctimer 10000, .@puppet$+"::OnSummon"; addnpctimer 11000, .@puppet$+"::OnDestroy"; end; @@ -50,6 +57,12 @@ L_Cooldown: message strcharinfo(0), "This skill is in forced cooldown; Please wait your first summon to expire."; end; +L_SpecialRules6: + if ($@KIMARR_EVENT < 1) goto L_Pay; + if ($@Fluffy_FighterID == BL_ID) goto L_Pay; + message strcharinfo(0), "You can't summon here unless hunting fluffies."; + end; + OnInit: set .school, SKILL_MAGIC_ASTRAL; set .invocation$, chr(MAGIC_SYMBOL) + "jande"; // used in npcs that refer to this spell diff --git a/world/map/npc/magic/event-summon-manatyrant.txt b/world/map/npc/magic/event-summon-manatyrant.txt index f91b2a87..fe1bf89b 100644 --- a/world/map/npc/magic/event-summon-manatyrant.txt +++ b/world/map/npc/magic/event-summon-manatyrant.txt @@ -9,10 +9,16 @@ OnCast: if (Sp < 100) end; if (getskilllv(SKILL_MAGIC) < .level) end; if (countitem("LargeManaElixir") < 1) end; - if (@dd4cooldown > gettimetick(2)) goto L_Cooldown; +// if (@dd4cooldown > gettimetick(2)) goto L_Cooldown; + if (sc_check(SC_COOLDOWN_MT)) goto L_Cooldown; + if (getmap() == "033-1") goto L_SpecialRules6; + goto L_Pay; + +L_Pay: delitem "LargeManaElixir", 1; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 15000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 15000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 100; misceffect FX_MAGIC_MAGGOT_CAST, strcharinfo(0); @@ -22,7 +28,8 @@ OnCast: if (.@puppet < 1) end; set .master, BL_ID, .@puppet; set .lifetime, (@spellpower*9)+150000, .@puppet; - set @dd4cooldown, gettimetick(2)+160; // This is measured in seconds +// set @dd4cooldown, gettimetick(2)+160; // This is measured in seconds + sc_start SC_COOLDOWN_MT, (@spellpower*9)+160000, 0, BL_ID; // .lifetime + OnSummon addnpctimer 10000, .@puppet$+"::OnSummon"; addnpctimer 11000, .@puppet$+"::OnDestroy"; // Causes caster to heal (I thought in converting MP to HP but meh) @@ -51,6 +58,12 @@ L_Cooldown: message strcharinfo(0), "This skill is in forced cooldown; Please wait your first summon to expire."; end; +L_SpecialRules6: + if ($@KIMARR_EVENT < 1) goto L_Pay; + if ($@Fluffy_FighterID == BL_ID) goto L_Pay; + message strcharinfo(0), "You can't summon here unless hunting fluffies."; + end; + OnInit: set .school, SKILL_MAGIC_ASTRAL; set .invocation$, chr(MAGIC_SYMBOL) + "manatez"; // used in npcs that refer to this spell diff --git a/world/map/npc/magic/level0-wand.txt b/world/map/npc/magic/level0-wand.txt index 1dd36624..b1dfb686 100644 --- a/world/map/npc/magic/level0-wand.txt +++ b/world/map/npc/magic/level0-wand.txt @@ -9,6 +9,7 @@ // here we install set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 500, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 500, 0, BL_ID; misceffect FX_MAGIC_WAND_CAST, strcharinfo(0); callfunc "magic_exp"; diff --git a/world/map/npc/magic/level1-aggravate.txt b/world/map/npc/magic/level1-aggravate.txt index c550efc3..97ae4151 100644 --- a/world/map/npc/magic/level1-aggravate.txt +++ b/world/map/npc/magic/level1-aggravate.txt @@ -5,6 +5,7 @@ if (getskilllv(SKILL_MAGIC) < .level) end; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 1000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 1000, 0, BL_ID; set @args$, ""; callfunc "adjust_spellpower"; // we reset @args$ because this spell should not have a target set @distance, (2 + (@spellpower / 50)); set Sp, Sp - 3; diff --git a/world/map/npc/magic/level1-detect-magic.txt b/world/map/npc/magic/level1-detect-magic.txt index e8a588a5..bfe320a4 100644 --- a/world/map/npc/magic/level1-detect-magic.txt +++ b/world/map/npc/magic/level1-detect-magic.txt @@ -5,6 +5,7 @@ if (getskilllv(SKILL_MAGIC) < .level) end; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 6000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 6000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 3; misceffect FX_MAGIC_DETECT_CAST, strcharinfo(0); diff --git a/world/map/npc/magic/level1-experience.txt b/world/map/npc/magic/level1-experience.txt index c29f57b3..76d6b888 100644 --- a/world/map/npc/magic/level1-experience.txt +++ b/world/map/npc/magic/level1-experience.txt @@ -9,6 +9,7 @@ if (Sp < 1) end; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 1000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 1000, 0, BL_ID; set @level, getskilllv(.school); if (@level < .level) end; callfunc "adjust_spellpower"; diff --git a/world/map/npc/magic/level1-flare-dart.txt b/world/map/npc/magic/level1-flare-dart.txt index e85ce3e8..1f23ec4f 100644 --- a/world/map/npc/magic/level1-flare-dart.txt +++ b/world/map/npc/magic/level1-flare-dart.txt @@ -8,6 +8,7 @@ elif (@level <= 2) end; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 500, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 500, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 10; misceffect FX_MAGIC_DART_CAST, strcharinfo(0); diff --git a/world/map/npc/magic/level1-grow-alizarin.txt b/world/map/npc/magic/level1-grow-alizarin.txt index 1d7bc696..476b215f 100644 --- a/world/map/npc/magic/level1-grow-alizarin.txt +++ b/world/map/npc/magic/level1-grow-alizarin.txt @@ -8,6 +8,7 @@ delitem "Root", 1; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 2000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 2000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 4; misceffect FX_MAGIC_GROW_CAST, strcharinfo(0); diff --git a/world/map/npc/magic/level1-grow-cobalt.txt b/world/map/npc/magic/level1-grow-cobalt.txt index dc84318d..ed34d7e4 100644 --- a/world/map/npc/magic/level1-grow-cobalt.txt +++ b/world/map/npc/magic/level1-grow-cobalt.txt @@ -8,6 +8,7 @@ delitem "Root", 1; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 2000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 2000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 4; misceffect FX_MAGIC_GROW_CAST, strcharinfo(0); diff --git a/world/map/npc/magic/level1-grow-gamboge.txt b/world/map/npc/magic/level1-grow-gamboge.txt index 25df5b03..741c4d2a 100644 --- a/world/map/npc/magic/level1-grow-gamboge.txt +++ b/world/map/npc/magic/level1-grow-gamboge.txt @@ -8,6 +8,7 @@ delitem "Root", 1; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 2000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 2000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 4; misceffect FX_MAGIC_GROW_CAST, strcharinfo(0); diff --git a/world/map/npc/magic/level1-grow-mauve.txt b/world/map/npc/magic/level1-grow-mauve.txt index 8c0d32ff..cebf34bc 100644 --- a/world/map/npc/magic/level1-grow-mauve.txt +++ b/world/map/npc/magic/level1-grow-mauve.txt @@ -8,6 +8,7 @@ delitem "Root", 1; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 2000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 2000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 4; misceffect FX_MAGIC_GROW_CAST, strcharinfo(0); diff --git a/world/map/npc/magic/level1-lesser-heal.txt b/world/map/npc/magic/level1-lesser-heal.txt index b2cd4741..051445fb 100644 --- a/world/map/npc/magic/level1-lesser-heal.txt +++ b/world/map/npc/magic/level1-lesser-heal.txt @@ -12,8 +12,13 @@ if (distance(BL_ID, @target_id) >= .@range) end; if (PVP_CHANNEL != get(PVP_CHANNEL, @target_id) && get(PVP_CHANNEL, @target_id) != 0) end; if (countitem("Lifestone") < 1) end; + if (getmap() == "033-1") goto L_SpecialRules6; + goto L_Pay; + +L_Pay: set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 500, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 500, 0, BL_ID; delitem "Lifestone", 1; callfunc "adjust_spellpower"; set Sp, Sp - 6; @@ -45,6 +50,13 @@ L_Mouboo: mes "Magic : ##3##BThis spell has no effect on animals."; close; +L_SpecialRules6: + if ($@KIMARR_EVENT < 1) goto L_Pay; + if (@target_id == BL_ID) goto L_Pay; + if ($@Fluffy_FighterID != @target_id) goto L_Pay; + message strcharinfo(0), "You can't heal others hunting here."; + end; + OnInit: set .school, SKILL_MAGIC_LIFE; set .invocation$, chr(MAGIC_SYMBOL) + "lum"; // used in npcs that refer to this spell diff --git a/world/map/npc/magic/level1-magic-blade.txt b/world/map/npc/magic/level1-magic-blade.txt index 1c6c891f..377cdd2d 100644 --- a/world/map/npc/magic/level1-magic-blade.txt +++ b/world/map/npc/magic/level1-magic-blade.txt @@ -10,6 +10,7 @@ if (.@component$ != "") delitem .@component$, 1; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 500, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 500, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 9; misceffect FX_MAGIC_BLADE_CAST, strcharinfo(0); diff --git a/world/map/npc/magic/level1-make-sulphur.txt b/world/map/npc/magic/level1-make-sulphur.txt index 89584954..fa728106 100644 --- a/world/map/npc/magic/level1-make-sulphur.txt +++ b/world/map/npc/magic/level1-make-sulphur.txt @@ -6,6 +6,7 @@ if (countitem("PileOfAsh") >= 1) delitem "PileOfAsh", 1; else end; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 4000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 4000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 4; misceffect FX_MAGIC_SULPHUR_CAST, strcharinfo(0); diff --git a/world/map/npc/magic/level1-summon-maggots.txt b/world/map/npc/magic/level1-summon-maggots.txt index 98ca6096..04e50bf8 100644 --- a/world/map/npc/magic/level1-summon-maggots.txt +++ b/world/map/npc/magic/level1-summon-maggots.txt @@ -8,10 +8,15 @@ OnCast: if (getmapflag(getmap(), MF_TOWN)) end; if (getskilllv(SKILL_MAGIC) < .level) end; if (countitem("MaggotSlime") < 1 || countitem("Root") < 1) end; + if (getmap() == "033-1") goto L_SpecialRules6; + goto L_Pay; + +L_Pay: delitem "MaggotSlime", 1; delitem "Root", 1; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 20000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 20000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 21; misceffect FX_MAGIC_MAGGOT_CAST, strcharinfo(0); @@ -47,6 +52,12 @@ S_SummonAll: if (.@i < .count) goto S_SummonAll; destroy; +L_SpecialRules6: + if ($@KIMARR_EVENT < 1) goto L_Pay; + if ($@Fluffy_FighterID == BL_ID) goto L_Pay; + message strcharinfo(0), "You can't summon here unless hunting fluffies."; + end; + OnInit: set .school, SKILL_MAGIC_ASTRAL; set .invocation$, chr(MAGIC_SYMBOL) + "kalmurk"; // used in npcs that refer to this spell diff --git a/world/map/npc/magic/level1-transmute-wood.txt b/world/map/npc/magic/level1-transmute-wood.txt index c2763f1c..2bb07251 100644 --- a/world/map/npc/magic/level1-transmute-wood.txt +++ b/world/map/npc/magic/level1-transmute-wood.txt @@ -6,6 +6,7 @@ if (countitem("RawLog") >= 1) delitem "RawLog", 1; else end; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 4000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 4000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 5; misceffect FX_MAGIC_WOOD_CAST, strcharinfo(0); diff --git a/world/map/npc/magic/level2-arrow-hail.txt b/world/map/npc/magic/level2-arrow-hail.txt index 24866b1c..6b6c78b9 100644 --- a/world/map/npc/magic/level2-arrow-hail.txt +++ b/world/map/npc/magic/level2-arrow-hail.txt @@ -11,13 +11,24 @@ OnCast: 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 (countitem("Arrow") >= 20 && countitem("SulphurPowder") >= 1) delitem "Arrow", 20; - elif (countitem("IronArrow") >= 20 && countitem("SulphurPowder") >= 1) delitem "IronArrow", 20; + if (countitem("Arrow") >= 20 && countitem("SulphurPowder") >= 1) goto L_Continue; + elif (countitem("IronArrow") >= 20 && countitem("SulphurPowder") >= 1) goto L_Continue; else end; + goto L_Continue; + +L_Continue: + if (getmap() == "033-1") goto L_SpecialRules6; + goto L_Pay; + +L_Pay: + if (countitem("Arrow") >= 20) delitem "Arrow", 20; + else delitem "IronArrow", 20; delitem "SulphurPowder", 1; set Sp, Sp - 25; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 5000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 5000, 0, BL_ID; + sc_start SC_COOLDOWN_AR, 30000, 0, BL_ID; // Set it to lenght of timeout setarray @away[0], POS_X, POS_Y, getdir(), (.range + 1), 0; callsub S_AwayFrom; @@ -70,7 +81,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 .hit, .hit + 1; - if(.hit > .max_hit) destroy; + if(.hit > .max_hit) goto L_Destroy; + goto L_Launch; + +L_Launch: set .launch, 0; callsub S_Launch; addnpctimer 250 + rand(50) + rand(50), strnpcinfo(0)+"::OnLaunch"; // loop until max @@ -87,8 +101,13 @@ S_Launch: set Hp, get(Hp, .caster) - (.damage + rand(.damage_bonus) + rand(.damage_bonus)), .caster; // injure caster set .launch, .launch + 1; if(.launch < 3) goto S_Launch; + return; +L_Destroy: + if (attachrid(.caster)) sc_end SC_COOLDOWN_AR; + destroy; + OnTimer30000: debugmes "frillyar timeout! [this shouldn't happen]"; destroy; @@ -107,6 +126,12 @@ OnHit: set .done, 1; end; +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_WAR; set .range, 7; diff --git a/world/map/npc/magic/level2-barrier.txt b/world/map/npc/magic/level2-barrier.txt index ed695b77..284209c0 100644 --- a/world/map/npc/magic/level2-barrier.txt +++ b/world/map/npc/magic/level2-barrier.txt @@ -5,24 +5,27 @@ set .@level, getskilllv(.school); if (.@level < .level) end; if (getskilllv(SKILL_MAGIC) < .level) end; - if (.@level <= 3 && countitem("SmallMushroom") >= 1) delitem "SmallMushroom", 1; - elif (.@level <= 3) end; + if (.@level <= 3 && countitem("SmallMushroom") < 1) end; set @target_id, getcharid(3, @args$); if (@target_id < 1 || !(isloggedin(@target_id)) || get(INVISIBLE, @target_id) == 1) set @target_id, BL_ID; // fallback to self + if (distance(BL_ID, @target_id) >= (@spellpower/30)+2) set @target_id, BL_ID; + if (BL_ID == @target_id) set @args$, strcharinfo(0); if (get(GM, @target_id) == 1) end; if (get(Hp, @target_id) < 1) end; if (getequipid(equip_head, strcharinfo(0, @target_id)) == 888) end; + if (getmap() == "033-1") goto L_SpecialRules6; + goto L_Pay; +L_Pay: + if (.@level <= 3) delitem "SmallMushroom", 1; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 1000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 1000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 15; misceffect FX_MAGIC_BARRIER_CAST, strcharinfo(0); callfunc "magic_exp"; - - if (distance(BL_ID, @target_id) >= (@spellpower/30)+2) set @target_id, BL_ID; - if (BL_ID == @target_id) set @args$, strcharinfo(0); if (BL_ID != @target_id) misceffect FX_MAGIC_BARRIER_HIT, @args$; set .@time, (@spellpower*200)+2000; set @asorm_time, .@time, @target_id; @@ -39,6 +42,12 @@ OnEnd: misceffect FX_MAGIC_BARRIER_END, strcharinfo(0); end; +L_SpecialRules6: + if ($@KIMARR_EVENT < 1) goto L_Pay; + if (@target_id == BL_ID) goto L_Pay; + message strcharinfo(0), "You can't cast this spell at others here."; + end; + OnInit: set .school, SKILL_MAGIC_ASTRAL; set .invocation$, chr(MAGIC_SYMBOL) + "asorm"; // used in npcs that refer to this spell diff --git a/world/map/npc/magic/level2-detect-players.txt b/world/map/npc/magic/level2-detect-players.txt index 20961ec6..828733a4 100644 --- a/world/map/npc/magic/level2-detect-players.txt +++ b/world/map/npc/magic/level2-detect-players.txt @@ -5,6 +5,7 @@ if (getskilllv(.school) < .level) end; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 300, "Magic Timer::OnClear"; + sc_start SC_COOLDOWN, 300, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 7; misceffect FX_MAGIC_WHO_CAST, strcharinfo(0); diff --git a/world/map/npc/magic/level2-enchant-lifestone.txt b/world/map/npc/magic/level2-enchant-lifestone.txt index b64f9855..178bf18c 100644 --- a/world/map/npc/magic/level2-enchant-lifestone.txt +++ b/world/map/npc/magic/level2-enchant-lifestone.txt @@ -19,6 +19,7 @@ L_Herbs: L_Proceed: set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 4000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 4000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 15; misceffect FX_MAGIC_STONE_CAST, strcharinfo(0); diff --git a/world/map/npc/magic/level2-flying-backpack.txt b/world/map/npc/magic/level2-flying-backpack.txt index 84c95e70..f8857120 100644 --- a/world/map/npc/magic/level2-flying-backpack.txt +++ b/world/map/npc/magic/level2-flying-backpack.txt @@ -5,21 +5,26 @@ set .@level, getskilllv(.school); if (.@level < .level) end; if (getskilllv(SKILL_MAGIC) < .level) end; - if (.@level <= 3 && countitem("SilkCocoon") >= 1) delitem "SilkCocoon", 1; - elif (.@level <= 3) end; + if (.@level <= 3 && countitem("SilkCocoon") < 1) end; + set @target_id, getcharid(3, @args$); + if (@target_id < 1 || !(isloggedin(@target_id)) || get(INVISIBLE, @target_id) == 1) + set @target_id, BL_ID; // fallback to self + if (distance(BL_ID, @target_id) >= (@spellpower/30)+2) set @target_id, BL_ID; + if (BL_ID == @target_id) set @args$, strcharinfo(0); + if (get(GM, @target_id) == 1) end; + if (getmap() == "033-1") goto L_SpecialRules6; + goto L_Pay; + +L_Pay: + if (.@level <= 3) delitem "SilkCocoon", 1; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 1000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 1000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 12; misceffect FX_MAGIC_FLYING_CAST, strcharinfo(0); callfunc "magic_exp"; - set @target_id, getcharid(3, @args$); - if (@target_id < 1 || !(isloggedin(@target_id)) || get(INVISIBLE, @target_id) == 1) - set @target_id, BL_ID; // fallback to self - if (distance(BL_ID, @target_id) >= (@spellpower/30)+2) set @target_id, BL_ID; - if (get(GM, @target_id) == 1) end; if (BL_ID != @target_id) misceffect FX_MAGIC_FLYING_HIT, @args$; - if (BL_ID == @target_id) set @args$, strcharinfo(0); set @plugh_time, (@spellpower*500)+5000, @target_id; sc_start SC_FLYING_BACKPACK, @plugh_time, 0, @target_id; message @args$, "Backpack : Your backpack is lifted by a mystical force; you no longer feel it pressing on your back."; @@ -34,6 +39,12 @@ OnEnd: misceffect FX_MAGIC_FLYING_END, strcharinfo(0); end; +L_SpecialRules6: + if ($@KIMARR_EVENT < 1) goto L_Pay; + if (@target_id == BL_ID) goto L_Pay; + message strcharinfo(0), "You can't cast this spell at others here."; + end; + OnInit: set .school, SKILL_MAGIC_NATURE; set .invocation$, chr(MAGIC_SYMBOL) + "plugh"; // used in npcs that refer to this spell diff --git a/world/map/npc/magic/level2-happy-curse.txt b/world/map/npc/magic/level2-happy-curse.txt index 535afa11..55516541 100644 --- a/world/map/npc/magic/level2-happy-curse.txt +++ b/world/map/npc/magic/level2-happy-curse.txt @@ -10,6 +10,7 @@ set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 1000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 1000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 13; misceffect FX_MAGIC_JOY_CAST, strcharinfo(0); diff --git a/world/map/npc/magic/level2-hide.txt b/world/map/npc/magic/level2-hide.txt index b129a163..6f78f1cf 100644 --- a/world/map/npc/magic/level2-hide.txt +++ b/world/map/npc/magic/level2-hide.txt @@ -13,6 +13,7 @@ if (get(GM, @target_id) == 1) end; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 1000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 1000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 11; misceffect FX_MAGIC_HIDE_CAST, strcharinfo(0); diff --git a/world/map/npc/magic/level2-lay-on-hands.txt b/world/map/npc/magic/level2-lay-on-hands.txt index 29d9292b..ee75a0d0 100644 --- a/world/map/npc/magic/level2-lay-on-hands.txt +++ b/world/map/npc/magic/level2-lay-on-hands.txt @@ -9,18 +9,20 @@ if (@target_id < 1 || !(isloggedin(@target_id)) || get(INVISIBLE, @target_id) || BL_ID == @target_id) end; if (get(GM, @target_id) == 1) end; if (Hp <= get(MaxHp, @target_id) / 20) end; // hp needs to be > 1/20 * target hp - callfunc "adjust_spellpower"; - if (getmap() == "099-4") goto L_SpecialRules4; - if (getmap() == "099-5") goto L_SpecialRules5; if (distance(BL_ID, @target_id) >= (((sqrt(@spellpower)*12)+@spellpower)/100)+2) end; if (sc_check(SC_HALT_REGENERATE,@target_id)) end; if (getequipid(equip_head, @args$) == 888) end; // magic gm top hat - set @needed, get(MaxHp, @target_id) - get(Hp, @target_id); + if (getmap() == "099-4") goto L_SpecialRules4; + if (getmap() == "099-5") goto L_SpecialRules5; + if (getmap() == "033-1") goto L_SpecialRules6; goto L_Pay; L_Pay: + set @needed, get(MaxHp, @target_id) - get(Hp, @target_id); set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 500, "Magic Timer::OnClear"; // XXX should this be 0 ? + sc_start SC_COOLDOWN, 500, 0, BL_ID; + callfunc "adjust_spellpower"; set Sp, Sp - 10; misceffect FX_MAGIC_LAY_CAST, strcharinfo(0); // on caster misceffect FX_MAGIC_LAY_HIT, @args$; // on target @@ -70,6 +72,11 @@ L_SpecialRules5: if (getequipid(equip_head, @args$) == 888) end; // magic gm top hat set @needed, get(MaxHp, @target_id) - get(Hp, @target_id); goto L_Pay; +L_SpecialRules6: + if ($@KIMARR_EVENT < 1) goto L_Pay; + if ($@Fluffy_FighterID != @target_id) goto L_Pay; + message strcharinfo(0), "You can't heal others hunting here."; + end; OnInit: set .school, SKILL_MAGIC_LIFE; diff --git a/world/map/npc/magic/level2-lightning-strike.txt b/world/map/npc/magic/level2-lightning-strike.txt index d454abc6..19083dfa 100644 --- a/world/map/npc/magic/level2-lightning-strike.txt +++ b/world/map/npc/magic/level2-lightning-strike.txt @@ -9,6 +9,7 @@ elif (.@level <= 3) end; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 1000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 1000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 20; misceffect FX_MAGIC_BOLT_CAST, strcharinfo(0); diff --git a/world/map/npc/magic/level2-magic-knuckles.txt b/world/map/npc/magic/level2-magic-knuckles.txt index 2063ad12..da276811 100644 --- a/world/map/npc/magic/level2-magic-knuckles.txt +++ b/world/map/npc/magic/level2-magic-knuckles.txt @@ -10,6 +10,7 @@ elif (.@level <= 3) end; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 500, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 500, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 20; misceffect FX_MAGIC_KNUCKLE_CAST, strcharinfo(0); diff --git a/world/map/npc/magic/level2-make-arrows.txt b/world/map/npc/magic/level2-make-arrows.txt index fa0a6b31..4451128f 100644 --- a/world/map/npc/magic/level2-make-arrows.txt +++ b/world/map/npc/magic/level2-make-arrows.txt @@ -8,6 +8,7 @@ delitem "RawLog", 1; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 5000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 5000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 8; misceffect FX_MAGIC_ARROW_CAST, strcharinfo(0); diff --git a/world/map/npc/magic/level2-make-iron-powder.txt b/world/map/npc/magic/level2-make-iron-powder.txt index 6f1c11b2..6181be8d 100644 --- a/world/map/npc/magic/level2-make-iron-powder.txt +++ b/world/map/npc/magic/level2-make-iron-powder.txt @@ -8,6 +8,7 @@ delitem "IronOre", 1; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 5000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 5000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 8; misceffect FX_MAGIC_IRONP_CAST, strcharinfo(0); diff --git a/world/map/npc/magic/level2-make-shirt.txt b/world/map/npc/magic/level2-make-shirt.txt index 838ffadd..dd42f79a 100644 --- a/world/map/npc/magic/level2-make-shirt.txt +++ b/world/map/npc/magic/level2-make-shirt.txt @@ -6,6 +6,7 @@ if (countitem("CottonCloth") >= 5) delitem "CottonCloth", 5; else end; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 5000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 5000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 25; misceffect FX_MAGIC_SHIRT_CAST, strcharinfo(0); diff --git a/world/map/npc/magic/level2-make-short-tanktop.txt b/world/map/npc/magic/level2-make-short-tanktop.txt index b722d9dd..0fd5d6d3 100644 --- a/world/map/npc/magic/level2-make-short-tanktop.txt +++ b/world/map/npc/magic/level2-make-short-tanktop.txt @@ -6,6 +6,7 @@ if (countitem("CottonCloth") >= 3) delitem "CottonCloth", 3; else end; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 5000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 5000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 25; misceffect FX_MAGIC_SHIRT_CAST, strcharinfo(0); diff --git a/world/map/npc/magic/level2-make-tanktop.txt b/world/map/npc/magic/level2-make-tanktop.txt index b8f40932..a416e7a0 100644 --- a/world/map/npc/magic/level2-make-tanktop.txt +++ b/world/map/npc/magic/level2-make-tanktop.txt @@ -6,6 +6,7 @@ if (countitem("CottonCloth") >= 4) delitem "CottonCloth", 4; else end; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 5000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 5000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 25; misceffect FX_MAGIC_SHIRT_CAST, strcharinfo(0); diff --git a/world/map/npc/magic/level2-protect.txt b/world/map/npc/magic/level2-protect.txt index 4e3b9f88..98380d7b 100644 --- a/world/map/npc/magic/level2-protect.txt +++ b/world/map/npc/magic/level2-protect.txt @@ -9,21 +9,24 @@ set @target_id, getcharid(3, @args$); if (@target_id < 1 || !(isloggedin(@target_id)) || get(INVISIBLE, @target_id)) set @target_id, BL_ID; // fallback to self + if (distance(BL_ID, @target_id) >= (@spellpower/30)+2) set @target_id, BL_ID; + if (BL_ID == @target_id) set @args$, strcharinfo(0); if (get(GM, @target_id) == 1) end; if (get(Hp, @target_id) < 1) end; if (getequipid(equip_head, strcharinfo(0, @target_id)) == 888) end; - - if (distance(BL_ID, @target_id) >= (@spellpower/30)+2) set @target_id, BL_ID; if (get(@antiprotect, @target_id) > 0) end; + if (getmap() == "033-1") goto L_SpecialRules6; + goto L_Pay; + +L_Pay: if (.@level <= 3) delitem "HardSpike", 1; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 1500, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 1500, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 14; misceffect FX_MAGIC_SHIELD_CAST, strcharinfo(0); callfunc "magic_exp"; - - if (BL_ID == @target_id) set @args$, strcharinfo(0); misceffect FX_MAGIC_SHIELD, @args$; set .@time, (@spellpower*1000)+5000; set @betsanc_time, .@time, @target_id; @@ -40,6 +43,12 @@ OnEnd: misceffect FX_MAGIC_SHIELD_ENDS, strcharinfo(0); end; +L_SpecialRules6: + if ($@KIMARR_EVENT < 1) goto L_Pay; + if (@target_id == BL_ID) goto L_Pay; + message strcharinfo(0), "You can't cast this spell at others here."; + end; + OnInit: set .school, SKILL_MAGIC_NATURE; set .invocation$, chr(MAGIC_SYMBOL) + "betsanc"; // used in npcs that refer to this spell 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 diff --git a/world/map/npc/magic/level2-shear.txt b/world/map/npc/magic/level2-shear.txt index 325e0863..c6141a1c 100644 --- a/world/map/npc/magic/level2-shear.txt +++ b/world/map/npc/magic/level2-shear.txt @@ -6,6 +6,7 @@ if (getskilllv(.school) < .level) end; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 1000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 1000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 23; misceffect FX_MAGIC_SHEAR_CAST, strcharinfo(0); diff --git a/world/map/npc/magic/level2-summon-fluffies.txt b/world/map/npc/magic/level2-summon-fluffies.txt index b614e4a3..942f48d4 100644 --- a/world/map/npc/magic/level2-summon-fluffies.txt +++ b/world/map/npc/magic/level2-summon-fluffies.txt @@ -9,10 +9,15 @@ OnCast: if (getskilllv(SKILL_MAGIC) < .level) end; if (getskilllv(.school) < .level) end; if (countitem("WhiteFur") < 1 || countitem("Root") < 1) end; + if (getmap() == "033-1") goto L_SpecialRules6; + goto L_Pay; + +L_Pay: delitem "WhiteFur", 1; delitem "Root", 1; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 20000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 20000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 39; misceffect FX_MAGIC_FLUFFY_CAST, strcharinfo(0); @@ -48,6 +53,12 @@ S_SummonAll: if (.@i < .count) goto S_SummonAll; destroy; +L_SpecialRules6: + if ($@KIMARR_EVENT < 1) goto L_Pay; + if ($@Fluffy_FighterID == BL_ID) goto L_Pay; + message strcharinfo(0), "You can't summon here unless hunting fluffies."; + end; + OnInit: set .school, SKILL_MAGIC_ASTRAL; set .invocation$, chr(MAGIC_SYMBOL) + "kalakarenk"; // used in npcs that refer to this spell diff --git a/world/map/npc/magic/level2-summon-mouboo.txt b/world/map/npc/magic/level2-summon-mouboo.txt index dfa60e57..abf54379 100644 --- a/world/map/npc/magic/level2-summon-mouboo.txt +++ b/world/map/npc/magic/level2-summon-mouboo.txt @@ -9,10 +9,15 @@ OnCast: if (getskilllv(SKILL_MAGIC) < .level) end; if (getskilllv(.school) < .level) end; if (countitem("MoubooFigurine") < 1 || countitem("Root") < 1) end; + if (getmap() == "033-1") goto L_SpecialRules6; + goto L_Pay; + +L_Pay: delitem "MoubooFigurine", 1; delitem "Root", 1; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 20000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 20000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 35; misceffect FX_MAGIC_MOUBOO_CAST, strcharinfo(0); @@ -48,6 +53,12 @@ S_SummonAll: if (.@i < .count) goto S_SummonAll; destroy; +L_SpecialRules6: + if ($@KIMARR_EVENT < 1) goto L_Pay; + if ($@Fluffy_FighterID == BL_ID) goto L_Pay; + message strcharinfo(0), "You can't summon here unless hunting fluffies."; + end; + OnInit: set .school, SKILL_MAGIC_ASTRAL; set .invocation$, chr(MAGIC_SYMBOL) + "kalboo"; // used in npcs that refer to this spell diff --git a/world/map/npc/magic/level2-summon-pinkie.txt b/world/map/npc/magic/level2-summon-pinkie.txt index efcb014c..773ab0c2 100644 --- a/world/map/npc/magic/level2-summon-pinkie.txt +++ b/world/map/npc/magic/level2-summon-pinkie.txt @@ -9,10 +9,15 @@ OnCast: if (getskilllv(SKILL_MAGIC) < .level) end; if (getskilllv(.school) < .level) end; if (countitem("PinkAntenna") < 1 || countitem("Root") < 1) end; + if (getmap() == "033-1") goto L_SpecialRules6; + goto L_Pay; + +L_Pay: delitem "PinkAntenna", 1; delitem "Root", 1; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 20000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 20000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 35; misceffect FX_MAGIC_PINKY_CAST, strcharinfo(0); @@ -48,6 +53,12 @@ S_SummonAll: if (.@i < .count) goto S_SummonAll; destroy; +L_SpecialRules6: + if ($@KIMARR_EVENT < 1) goto L_Pay; + if ($@Fluffy_FighterID == BL_ID) goto L_Pay; + message strcharinfo(0), "You can't summon here unless hunting fluffies."; + end; + OnInit: set .school, SKILL_MAGIC_ASTRAL; set .invocation$, chr(MAGIC_SYMBOL) + "kalgina"; // used in npcs that refer to this spell diff --git a/world/map/npc/magic/level2-summon-snakes.txt b/world/map/npc/magic/level2-summon-snakes.txt index 2e2021ae..a2bd5278 100644 --- a/world/map/npc/magic/level2-summon-snakes.txt +++ b/world/map/npc/magic/level2-summon-snakes.txt @@ -10,10 +10,15 @@ OnCast: if (getskilllv(.school) < .level) end; if (countitem("DarkCrystal") < 1 || countitem("SnakeEgg") < 1) end; if (OrumQuest <= 40) end; + if (getmap() == "033-1") goto L_SpecialRules6; + goto L_Pay; + +L_Pay: delitem "DarkCrystal", 1; delitem "SnakeEgg", 1; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 15000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 15000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 40; misceffect FX_MAGIC_SNAKE_CAST, strcharinfo(0); @@ -54,6 +59,12 @@ S_SummonAll: if (.@i < .count) goto S_SummonAll; destroy; +L_SpecialRules6: + if ($@KIMARR_EVENT < 1) goto L_Pay; + if ($@Fluffy_FighterID == BL_ID) goto L_Pay; + message strcharinfo(0), "You can't summon here unless hunting fluffies."; + end; + OnInit: set .school, SKILL_MAGIC_DARK; set .invocation$, chr(MAGIC_SYMBOL) + "halhiss"; // used in npcs that refer to this spell diff --git a/world/map/npc/magic/level2-summon-spiky-mushroom.txt b/world/map/npc/magic/level2-summon-spiky-mushroom.txt index ff861283..326c0d06 100644 --- a/world/map/npc/magic/level2-summon-spiky-mushroom.txt +++ b/world/map/npc/magic/level2-summon-spiky-mushroom.txt @@ -9,10 +9,15 @@ OnCast: if (getskilllv(SKILL_MAGIC) < .level) end; if (getskilllv(.school) < .level) end; if (countitem("HardSpike") < 1 || countitem("Root") < 1) end; + if (getmap() == "033-1") goto L_SpecialRules6; + goto L_Pay; + +L_Pay: delitem "HardSpike", 1; delitem "Root", 1; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 20000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 20000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 33; misceffect FX_MAGIC_SPIKY_CAST, strcharinfo(0); @@ -48,6 +53,12 @@ S_SummonAll: if (.@i < .count) goto S_SummonAll; destroy; +L_SpecialRules6: + if ($@KIMARR_EVENT < 1) goto L_Pay; + if ($@Fluffy_FighterID == BL_ID) goto L_Pay; + message strcharinfo(0), "You can't summon here unless hunting fluffies."; + end; + OnInit: set .school, SKILL_MAGIC_ASTRAL; set .invocation$, chr(MAGIC_SYMBOL) + "kalrenk"; // used in npcs that refer to this spell diff --git a/world/map/npc/magic/level2-summon-wickedmushroom.txt b/world/map/npc/magic/level2-summon-wickedmushroom.txt index dc5fb72d..c81904cf 100644 --- a/world/map/npc/magic/level2-summon-wickedmushroom.txt +++ b/world/map/npc/magic/level2-summon-wickedmushroom.txt @@ -10,10 +10,15 @@ OnCast: if (getskilllv(.school) < .level) end; if (countitem("DarkCrystal") < 1 || countitem("SmallMushroom") < 1) end; if (OrumQuest <= 36) end; + if (getmap() == "033-1") goto L_SpecialRules6; + goto L_Pay; + +L_Pay: delitem "DarkCrystal", 1; delitem "SmallMushroom", 1; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 15000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 15000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 35; misceffect FX_MAGIC_WICKED_CAST, strcharinfo(0); @@ -53,6 +58,12 @@ S_SummonAll: if (.@i < .count) goto S_SummonAll; destroy; +L_SpecialRules6: + if ($@KIMARR_EVENT < 1) goto L_Pay; + if ($@Fluffy_FighterID == BL_ID) goto L_Pay; + message strcharinfo(0), "You can't summon here unless hunting fluffies."; + end; + OnInit: set .school, SKILL_MAGIC_DARK; set .invocation$, chr(MAGIC_SYMBOL) + "helorp"; // used in npcs that refer to this spell diff --git a/world/map/npc/magic/level2-toxic-dart.txt b/world/map/npc/magic/level2-toxic-dart.txt index 5f611262..6f5e6da9 100644 --- a/world/map/npc/magic/level2-toxic-dart.txt +++ b/world/map/npc/magic/level2-toxic-dart.txt @@ -9,6 +9,7 @@ elif (.@level <= 2) end; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 500, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 500, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 15; misceffect FX_MAGIC_TDART_CAST, strcharinfo(0); diff --git a/world/map/npc/magic/level3-necromancy.txt b/world/map/npc/magic/level3-necromancy.txt index 2cd6724d..48dc1ebf 100644 --- a/world/map/npc/magic/level3-necromancy.txt +++ b/world/map/npc/magic/level3-necromancy.txt @@ -18,6 +18,7 @@ set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 20000, "Magic Timer::OnClear"; + sc_start SC_COOLDOWN, 20000, 0, BL_ID; set Sp, Sp - 50; misceffect FX_MAGIC_DARKRED, strcharinfo(0); // on caster misceffect FX_PENTAGRAM_BUILDUP, @args$; // on target -- cgit v1.2.3-70-g09d2