diff options
author | AJ K <aj@keresztes.us> | 2024-08-28 14:37:48 -0400 |
---|---|---|
committer | AJ K <aj@keresztes.us> | 2024-08-28 14:37:48 -0400 |
commit | e39be783e852f390d61776c51c006d444a131f0b (patch) | |
tree | 8183fcb880c427c10f0ff341e8981a4e1afa7e6f /world/map/npc/magic | |
parent | cca41e5ba8fcd2e971303fd54be8786c86d82c7e (diff) | |
parent | 59aa2316201d785beee4abe7a4cfe6b87f53beb1 (diff) | |
download | serverdata-master.tar.gz serverdata-master.tar.bz2 serverdata-master.tar.xz serverdata-master.zip |
Diffstat (limited to 'world/map/npc/magic')
-rw-r--r-- | world/map/npc/magic/event-summon-managuardian.txt | 1 | ||||
-rw-r--r-- | world/map/npc/magic/event-summon-manatyrant.txt | 1 | ||||
-rw-r--r-- | world/map/npc/magic/level1-summon-maggots.txt | 1 | ||||
-rw-r--r-- | world/map/npc/magic/level2-lightning-strike.txt | 4 | ||||
-rw-r--r-- | world/map/npc/magic/level2-magic-knuckles.txt | 38 | ||||
-rw-r--r-- | world/map/npc/magic/level2-make-bones.txt | 2 | ||||
-rw-r--r-- | world/map/npc/magic/level2-protect.txt | 5 | ||||
-rw-r--r-- | world/map/npc/magic/level2-rain.txt | 11 | ||||
-rw-r--r-- | world/map/npc/magic/level2-summon-fluffies.txt | 1 | ||||
-rw-r--r-- | world/map/npc/magic/level2-summon-mouboo.txt | 1 | ||||
-rw-r--r-- | world/map/npc/magic/level2-summon-pinkie.txt | 1 | ||||
-rw-r--r-- | world/map/npc/magic/level2-summon-snakes.txt | 1 | ||||
-rw-r--r-- | world/map/npc/magic/level2-summon-spiky-mushroom.txt | 1 | ||||
-rw-r--r-- | world/map/npc/magic/level2-summon-wickedmushroom.txt | 1 |
14 files changed, 38 insertions, 31 deletions
diff --git a/world/map/npc/magic/event-summon-managuardian.txt b/world/map/npc/magic/event-summon-managuardian.txt index e66c3eb7..1aa172ad 100644 --- a/world/map/npc/magic/event-summon-managuardian.txt +++ b/world/map/npc/magic/event-summon-managuardian.txt @@ -5,7 +5,6 @@ OnCast: if(call("magic_checks")) end; // FIXME: Incomplete check, should still work during sieges - if (getmapflag(getmap(), MF_TOWN)) end; if (Sp < 100) end; if (getskilllv(SKILL_MAGIC) < .level) end; if (countitem("TinyManaElixir") < 1) end; diff --git a/world/map/npc/magic/event-summon-manatyrant.txt b/world/map/npc/magic/event-summon-manatyrant.txt index bf2634c5..ff082930 100644 --- a/world/map/npc/magic/event-summon-manatyrant.txt +++ b/world/map/npc/magic/event-summon-manatyrant.txt @@ -5,7 +5,6 @@ OnCast: if(call("magic_checks")) end; if ($DOOMSDAY_SUMMON < 2) end; - if (getmapflag(getmap(), MF_TOWN)) end; if (Sp < 100) end; if (getskilllv(SKILL_MAGIC) < .level) end; if (countitem("LargeManaElixir") < 1) end; diff --git a/world/map/npc/magic/level1-summon-maggots.txt b/world/map/npc/magic/level1-summon-maggots.txt index 05cadbc8..ce95422c 100644 --- a/world/map/npc/magic/level1-summon-maggots.txt +++ b/world/map/npc/magic/level1-summon-maggots.txt @@ -5,7 +5,6 @@ OnCast: if(call("magic_checks")) end; if (Sp < 21) end; - if (getmapflag(getmap(), MF_TOWN)) end; if (getskilllv(SKILL_MAGIC) < .level) end; if (countitem("InsectSlime") < 1 || countitem("Root") < 1) end; if (getmap() == "033-1") goto L_SpecialRules6; diff --git a/world/map/npc/magic/level2-lightning-strike.txt b/world/map/npc/magic/level2-lightning-strike.txt index bdd311a6..0a97dc63 100644 --- a/world/map/npc/magic/level2-lightning-strike.txt +++ b/world/map/npc/magic/level2-lightning-strike.txt @@ -30,12 +30,11 @@ OnAttack: if (target(BL_ID, @target_id, 0x36) != 0x36) goto L_FreeRecast; // 0x10 | 0x02 | 0x04 | 0x20 - set .@p, get(.max_radius, "rain") + 1; set @ingravspell[5], @target_id; // store it because foreach overwrites it foreach 1, getmap(), POS_X-.@p, POS_Y-.@p, POS_X+.@p, POS_Y+.@p, strnpcinfo(0)+"::OnNpc"; set @target_id, @ingravspell[5]; // now restore it - + if (@ingravspell[2] <= 0) overrideattack; // workaround for caster in rain death case set @ingravspell[2], @ingravspell[2] - 1; if (@ingravspell[4] & 1) goto L_InRain; void call("elt_damage", @ingravspell[0], (@ingravspell[0]/2)+1, ELT_EARTH, ELT_WIND, FX_LIGHTNING1 + rand(3)); @@ -49,6 +48,7 @@ L_FreeRecast: OnDischarge: if (@ingravspell[2] < 1) end; set @ingravspell[2], 0; + set @ingravspell[4], 0; // Clean up "in rain" flag, it caused funny bugs. misceffect FX_MAGIC_DISCHARGE, strcharinfo(0); overrideattack; end; diff --git a/world/map/npc/magic/level2-magic-knuckles.txt b/world/map/npc/magic/level2-magic-knuckles.txt index 0674f689..cd86ba28 100644 --- a/world/map/npc/magic/level2-magic-knuckles.txt +++ b/world/map/npc/magic/level2-magic-knuckles.txt @@ -1,7 +1,7 @@ -|script|magic-knuckles|32767 { if @_U_BLOCK >= 1 goto L_Still_Exhausted; -/* + set @upmarmu_spell_npc_name$, "#Upmarmu#" + getcharid(3); // make a unique puppet name for every player set .upmarmu_spell_npc, getnpcid(@upmarmu_spell_npc_name$); if ( .upmarmu_spell_npc >= 1 ) goto L_NPC_Exists; // if this npc already exist reuse it so that idle recovery timer does not get destroyed @@ -12,7 +12,6 @@ goto L_NPC_Exists; L_NPC_Exists: -*/ if (call("magic_checks")) end; if (Sp < 20) end; if (getskilllv(SKILL_MAGIC) < .level) end; @@ -49,35 +48,29 @@ OnAttack: if (target(BL_ID, @target_id, 22) != 22) goto L_FreeRecast; // 0x10 | 0x02 | 0x04 void call("elt_damage", @upmarmuspell[0], (@upmarmuspell[3] + @upmarmuspell[4]), ELT_WATER, ELT_FIRE, FX_NONE); -// addtimer 0, @upmarmu_spell_npc_name$ + "::OnResetTimer"; + addtimer 0, @upmarmu_spell_npc_name$ + "::OnResetTimer"; set @upmarmuspell[1], @upmarmuspell[1] - 1; + + if @num_upmarmu_hits >= UPMARMU_HITS_TILL_EXHAUST goto L_FreeRecast; set @num_upmarmu_hits, @num_upmarmu_hits + 1; + if @num_upmarmu_hits >= UPMARMU_HITS_TILL_EXHAUST set .exhausted, 1, .upmarmu_spell_npc; - if @num_upmarmu_hits >= UPMARMU_HITS_TILL_EXHAUST goto L_Exhausted; goto L_FreeRecast; L_FreeRecast: if (@upmarmuspell[1] > 0) addtimer 0, strnpcinfo(0) + "::OnSetRecast"; + else + addtimer 0, @upmarmu_spell_npc_name$ + "::OnExhausted"; end; -L_Exhausted: - set @_U_BLOCK, 1; - set @upmarmuspell[1], 0; - misceffect FX_MAGIC_DISCHARGE, strcharinfo(0); - overrideattack; - addtimer UPMARMU_EXHAUST_DURATION, "Upmarmu Exhaust Timer::OnClear"; // set the exhaustion time - sc_start SC_COOLDOWN_UPMARMU, UPMARMU_EXHAUST_DURATION, 0, BL_ID; - smsg SMSG_FAILURE, "Magic: You are too exhausted to use this spell for a while!"; - goto L_StopTimer; - L_Still_Exhausted: smsg SMSG_FAILURE, "Magic: You are still too exhausted to use this spell for a while!"; end; L_StopTimer: -// addtimer 0, @upmarmu_spell_npc_name$ + "::OnStopTimer"; + addtimer 0, @upmarmu_spell_npc_name$ + "::OnStopTimer"; end; OnDischarge: @@ -91,7 +84,6 @@ OnSetRecast: overrideattack (@upmarmuspell[2] * @upmarmuspell[2]), 1, ATTACK_ICON_GENERIC, OVERRIDE_KNUCKLES, strnpcinfo(0)+"::OnAttack", @upmarmuspell[1]; // delay needs to be squared end; -/* OnResetTimer: // This timer is if you stopped somewhere below max hits then after 25sec you recover fully and start at 0 hits again stopnpctimer; @@ -117,9 +109,20 @@ OnTimer25000: setnpctimer 0; end; +OnExhausted: + if (.exhausted < 1) end; + + set @_U_BLOCK, 1; + set @upmarmuspell[1], 0; + set @num_upmarmu_hits, 0; + set .exhausted, 0; + addtimer UPMARMU_EXHAUST_DURATION, "Upmarmu Exhaust Timer::OnClear"; // set the exhaustion time + sc_start SC_COOLDOWN_UPMARMU, UPMARMU_EXHAUST_DURATION, 0, BL_ID; + smsg SMSG_FAILURE, "Magic: You are too exhausted to use this spell for a while!"; + goto L_StopTimer; + OnDestroy: destroy; -*/ OnInit: set .school, SKILL_MAGIC_WAR; @@ -136,6 +139,5 @@ OnInit: OnClear: set @_U_BLOCK, 0; - set @num_upmarmu_hits, 0; end; } diff --git a/world/map/npc/magic/level2-make-bones.txt b/world/map/npc/magic/level2-make-bones.txt index bc9bc6e5..b84cae6c 100644 --- a/world/map/npc/magic/level2-make-bones.txt +++ b/world/map/npc/magic/level2-make-bones.txt @@ -25,7 +25,7 @@ L_Resume: set CASTS, CASTS + 1; if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_ARROW_CAST, strcharinfo(0); - setarray @create_params[0], (@spellpower/32)+1+(rand(max(1,(800-@spellpower)))/80), 500; + setarray @create_params[0], (@spellpower/6)+1+(rand(max(1,(800-@spellpower)))/80), 500; setarray @create_items$[0], "BoneArrows", "IronArrow"; callfunc "magic_create_item"; callfunc "magic_exp"; diff --git a/world/map/npc/magic/level2-protect.txt b/world/map/npc/magic/level2-protect.txt index 7abc9a1a..87d010f8 100644 --- a/world/map/npc/magic/level2-protect.txt +++ b/world/map/npc/magic/level2-protect.txt @@ -1,5 +1,6 @@ -|script|protect|32767 { + if (sc_check(SC_PHYS_SHIELD_ITEM)) goto L_Itsanc; // itsanc has top priority and cant be overwritten by betsanc if(call("magic_checks")) end; if (Sp < 14) end; set .@level, getskilllv(.school); @@ -44,6 +45,10 @@ OnEnd: misceffect FX_MAGIC_SHIELD_ENDS, strcharinfo(0); end; +L_Itsanc: + message strcharinfo(0), "Shield : You are still itsanced, This blocks your spell."; + end; + L_SpecialRules6: if ($@KIMARR_EVENT < 1) goto L_Pay; if (@target_id == BL_ID) goto L_Pay; diff --git a/world/map/npc/magic/level2-rain.txt b/world/map/npc/magic/level2-rain.txt index 6a7f288b..291af009 100644 --- a/world/map/npc/magic/level2-rain.txt +++ b/world/map/npc/magic/level2-rain.txt @@ -102,9 +102,18 @@ 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(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; + if ($NO_RAIN_SPAWNS) end; // server-wide killswitch for rain pranks if spawns logic would backfire. + if (mobcount(getmap(), "rain::OnRainSpawnDeath") > 30) end; // Abort if too crowded. + if(get(Class, @target_id) == EntAbomination) // Rain hit Ent? This scores little perk! + monster getmap(), getnpcx(), getnpcy(), "", LogHead, 1+rand(1+(.max/150)), "rain::OnRainSpawnDeath"; + if((get(Class, @target_id) == LogHead) && (rand(5) == 3)) // Rain hit LogHead? Little perk as well (plants) + monster getmap(), getnpcx(), getnpcy(), "", MauvePlant+rand(5), 1, "rain::OnRainSpawnDeath"; + end; + +OnRainSpawnDeath: end; OnDestroy: diff --git a/world/map/npc/magic/level2-summon-fluffies.txt b/world/map/npc/magic/level2-summon-fluffies.txt index f10a86b5..fef40a17 100644 --- a/world/map/npc/magic/level2-summon-fluffies.txt +++ b/world/map/npc/magic/level2-summon-fluffies.txt @@ -5,7 +5,6 @@ OnCast: if(call("magic_checks")) end; if (Sp < 39) end; - if (getmapflag(getmap(), MF_TOWN)) end; if (getskilllv(SKILL_MAGIC) < .level) end; if (getskilllv(.school) < .level) end; if (countitem("WhiteFur") < 1 || countitem("Root") < 1) end; diff --git a/world/map/npc/magic/level2-summon-mouboo.txt b/world/map/npc/magic/level2-summon-mouboo.txt index c692e9cf..8a8603c6 100644 --- a/world/map/npc/magic/level2-summon-mouboo.txt +++ b/world/map/npc/magic/level2-summon-mouboo.txt @@ -5,7 +5,6 @@ OnCast: if(call("magic_checks")) end; if (Sp < 35) end; - if (getmapflag(getmap(), MF_TOWN)) end; if (getskilllv(SKILL_MAGIC) < .level) end; if (getskilllv(.school) < .level) end; if (countitem("MoubooFigurine") < 1 || countitem("Root") < 1) end; diff --git a/world/map/npc/magic/level2-summon-pinkie.txt b/world/map/npc/magic/level2-summon-pinkie.txt index 61af9eed..b4774584 100644 --- a/world/map/npc/magic/level2-summon-pinkie.txt +++ b/world/map/npc/magic/level2-summon-pinkie.txt @@ -5,7 +5,6 @@ OnCast: if(call("magic_checks")) end; if (Sp < 35) end; - if (getmapflag(getmap(), MF_TOWN)) end; if (getskilllv(SKILL_MAGIC) < .level) end; if (getskilllv(.school) < .level) end; if (countitem("PinkAntenna") < 1 || countitem("Root") < 1) end; diff --git a/world/map/npc/magic/level2-summon-snakes.txt b/world/map/npc/magic/level2-summon-snakes.txt index 0723961b..5815cef5 100644 --- a/world/map/npc/magic/level2-summon-snakes.txt +++ b/world/map/npc/magic/level2-summon-snakes.txt @@ -5,7 +5,6 @@ OnCast: if(call("magic_checks")) end; if (Sp < 40) end; - if (getmapflag(getmap(), MF_TOWN)) end; if (getskilllv(SKILL_MAGIC) < .level) end; if (getskilllv(.school) < .level) end; if (countitem("DarkCrystal") < 1 || countitem("SnakeEgg") < 1) end; diff --git a/world/map/npc/magic/level2-summon-spiky-mushroom.txt b/world/map/npc/magic/level2-summon-spiky-mushroom.txt index 701648d5..0f884185 100644 --- a/world/map/npc/magic/level2-summon-spiky-mushroom.txt +++ b/world/map/npc/magic/level2-summon-spiky-mushroom.txt @@ -5,7 +5,6 @@ OnCast: if(call("magic_checks")) end; if (Sp < 33) end; - if (getmapflag(getmap(), MF_TOWN)) end; if (getskilllv(SKILL_MAGIC) < .level) end; if (getskilllv(.school) < .level) end; if (countitem("HardSpike") < 1 || countitem("Root") < 1) end; diff --git a/world/map/npc/magic/level2-summon-wickedmushroom.txt b/world/map/npc/magic/level2-summon-wickedmushroom.txt index 014a5d80..7d0e93c1 100644 --- a/world/map/npc/magic/level2-summon-wickedmushroom.txt +++ b/world/map/npc/magic/level2-summon-wickedmushroom.txt @@ -5,7 +5,6 @@ OnCast: if(call("magic_checks")) end; if (Sp < 42) end; - if (getmapflag(getmap(), MF_TOWN)) end; if (getskilllv(SKILL_MAGIC) < .level) end; if (getskilllv(.school) < .level) end; if (countitem("DarkCrystal") < 1 || countitem("SmallMushroom") < 1) end; |