diff options
-rw-r--r-- | world/map/npc/magic/_import.txt | 9 | ||||
-rw-r--r-- | world/map/npc/magic/_procedures.txt | 35 | ||||
-rw-r--r-- | world/map/npc/magic/event-boss-powerup-disarm.txt | 47 | ||||
-rw-r--r-- | world/map/npc/magic/event-boss-powerup-grenades.txt | 46 | ||||
-rw-r--r-- | world/map/npc/magic/event-boss-powerup-headshot.txt | 57 | ||||
-rw-r--r-- | world/map/npc/magic/event-boss-powerup-lifedrain.txt | 52 | ||||
-rw-r--r-- | world/map/npc/magic/event-boss-powerup-manadrain.txt | 52 | ||||
-rw-r--r-- | world/map/npc/magic/event-boss-powerup-poison.txt | 41 | ||||
-rw-r--r-- | world/map/npc/magic/event-boss-powerup-tormenta.txt | 40 | ||||
-rw-r--r-- | world/map/npc/magic/event-boss-powerup-totheabyss.txt | 63 | ||||
-rw-r--r-- | world/map/npc/magic/event-boss-powerup-tothecrypt.txt | 63 |
11 files changed, 505 insertions, 0 deletions
diff --git a/world/map/npc/magic/_import.txt b/world/map/npc/magic/_import.txt index 5b1ea65c..38e81608 100644 --- a/world/map/npc/magic/_import.txt +++ b/world/map/npc/magic/_import.txt @@ -46,3 +46,12 @@ npc: npc/magic/level2-make-shirt.txt npc: npc/magic/level3-necromancy.txt npc: npc/magic/event-summon-managuardian.txt npc: npc/magic/event-summon-manatyrant.txt +npc: npc/magic/event-boss-powerup-lifedrain.txt +npc: npc/magic/event-boss-powerup-manadrain.txt +npc: npc/magic/event-boss-powerup-poison.txt +npc: npc/magic/event-boss-powerup-tormenta.txt +npc: npc/magic/event-boss-powerup-totheabyss.txt +npc: npc/magic/event-boss-powerup-tothecrypt.txt +npc: npc/magic/event-boss-powerup-disarm.txt +npc: npc/magic/event-boss-powerup-grenades.txt +npc: npc/magic/event-boss-powerup-headshot.txt diff --git a/world/map/npc/magic/_procedures.txt b/world/map/npc/magic/_procedures.txt index eaacd774..c50f0ab5 100644 --- a/world/map/npc/magic/_procedures.txt +++ b/world/map/npc/magic/_procedures.txt @@ -94,6 +94,41 @@ L_Return: return 0; } + +// this function is call()-only +// Custom version of checks for Dungeon Masters boss "powerups". +// Both GMs and player eventers MAY eventually call boss powerups. +// That's why GM Lv check removed, some things relaxed. +// Its up to powerup "spell" itself to check who can call it or why. + +function|script|boss_powerup_checks +{ + set .@flags, getarg(0); + set .@nonmagic, .@flags & (1<<0); + + if ($BOSS_KILLSWITCH) goto L_Killswitch; // If things go wrong direction, boss powers can be disabled. + if(HIDDEN) goto L_Hidden; // can not cast with @hide + if(@_M_BLOCK) goto L_Blocked; // check if last debuff ended + if(Hp < 1) goto L_Dead; // can not cast when dead + return 0; + +L_Killswitch: + smsg SMSG_FAILURE, "BossPowers: disabled by kill switch!"; + return 7; + +L_Hidden: + smsg SMSG_FAILURE, "BossPowers: can't be used when hidden!"; + return 1; + +L_Blocked: + smsg SMSG_FAILURE, "BossPowers: cooldown is in effect. Please wait."; + return 2; + +L_Dead: + smsg SMSG_FAILURE, "BossPowers: you're dead!"; + return 3; +} + function|script|elt_damage { // args are damage, dmgplus(mutation), bonus_elt, malus_elt, effect diff --git a/world/map/npc/magic/event-boss-powerup-disarm.txt b/world/map/npc/magic/event-boss-powerup-disarm.txt new file mode 100644 index 00000000..b1fb1a42 --- /dev/null +++ b/world/map/npc/magic/event-boss-powerup-disarm.txt @@ -0,0 +1,47 @@ +-|script|powerup-disarm|32767 +{ + end; + +OnCast: + message strcharinfo(0), "[boss-disarm] : -> OnCast"; + if(call("boss_powerup_checks")) end; + message strcharinfo(0), "[boss-disarm] : after boss powerup check"; + if (getmapflag(getmap(), MF_TOWN)) goto L_Fail_town; + message strcharinfo(0), "[boss-disarm] : after mapflags check"; +// TBD who can use this. + set @_M_BLOCK, 1; // block casting, until the timer clears it + addtimer 10000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 10000, 0, BL_ID; + misceffect FX_MEDIUM_EXPLOSION, strcharinfo(0); + set @dist, 12; + foreach 0, getmap(), (POS_X - @dist), (POS_Y - @dist), (POS_X + @dist), (POS_Y + @dist), strnpcinfo(0) + "::OnHit"; + message strcharinfo(0), "[boss-disarm] : after foreach"; + message strcharinfo(0), "[boss-disarm] : <- OnCast"; + end; + +OnHit: + if (@target_id == BL_ID) end; // Do not disarm caster + if ((get(Hp, @target_id)) < 1) end; // Do not touch dead + message strcharinfo(0, @target_id), "[boss-disarm] : "+strcharinfo(0, BL_ID)+" disarms you!"; + addtimer 500, strnpcinfo(0)+"::OnUnequip", @target_id; + end; + +OnUnequip: + misceffect FX_EMOTE_SURPRISE, strcharinfo(0); + unequipbyid 8; // Hand ?1 + unequipbyid 9; // Hand ?2 + unequipbyid 10; // Ammo + end; + +L_Fail_town: + message strcharinfo(0), "[boss-disarm] : can't mass-poison in towns!"; + end; + +OnInit: + set .school, SKILL_MAGIC; + set .invocation$, chr(MAGIC_SYMBOL) + "mapdisarm"; // used in npcs that refer to this spell + void call("magic_register", "OnCast"); + set .level, 0; + set .exp_gain, 0; + end; +} diff --git a/world/map/npc/magic/event-boss-powerup-grenades.txt b/world/map/npc/magic/event-boss-powerup-grenades.txt new file mode 100644 index 00000000..9cd3acc6 --- /dev/null +++ b/world/map/npc/magic/event-boss-powerup-grenades.txt @@ -0,0 +1,46 @@ +-|script|powerup-grenades|32767 +{ + end; + +OnCast: + message strcharinfo(0), "[boss-grenades] : -> OnCast"; + if(call("boss_powerup_checks")) end; + message strcharinfo(0), "[boss-grenades] : after boss powerup check"; + if (getmapflag(getmap(), MF_TOWN)) goto L_Fail_town; + message strcharinfo(0), "[boss-grenades] : after mapflags check"; +// TBD who can use this. + set @_M_BLOCK, 1; // block casting, until the timer clears it + addtimer 10000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 10000, 0, BL_ID; + misceffect FX_MEDIUM_EXPLOSION, strcharinfo(0); + set @dist, 5; + foreach 0, getmap(), (POS_X - @dist), (POS_Y - @dist), (POS_X + @dist), (POS_Y + @dist), strnpcinfo(0) + "::OnHit"; + message strcharinfo(0), "[boss-grenades] : after foreach"; + message strcharinfo(0), "[boss-grenades] : <- OnCast"; + end; + +OnHit: + if (@target_id == BL_ID) end; // Do not hit caster + if ((get(Hp, @target_id))) < 1 end; // Do not touch dead + message strcharinfo(0, @target_id), "[boss-grenades] : "+strcharinfo(0, BL_ID)+" dropped grenade on you!"; + addtimer (100+rand(300)), strnpcinfo(0)+"::OnGrenadeHit", @target_id; + end; + +OnGrenadeHit: + misceffect FX_MEDIUM_SMOKE, strcharinfo(0); + heal (0 - rand(Hp)), 0; + set Sp, (Sp / 3); + end; + +L_Fail_town: + message strcharinfo(0), "[boss-grenades] : not allowed in towns!"; + end; + +OnInit: + set .school, SKILL_MAGIC; + set .invocation$, chr(MAGIC_SYMBOL) + "grenades"; // used in npcs that refer to this spell + void call("magic_register", "OnCast"); + set .level, 0; + set .exp_gain, 0; + end; +} diff --git a/world/map/npc/magic/event-boss-powerup-headshot.txt b/world/map/npc/magic/event-boss-powerup-headshot.txt new file mode 100644 index 00000000..5c05d477 --- /dev/null +++ b/world/map/npc/magic/event-boss-powerup-headshot.txt @@ -0,0 +1,57 @@ +-|script|powerup-headshot|32767 +{ + end; + +OnCast: + message strcharinfo(0), "[boss-headshot] : -> OnCast"; + if(call("boss_powerup_checks")) end; + message strcharinfo(0), "[boss-headshot] : after boss powerup check"; + if (getmapflag(getmap(), MF_TOWN)) goto L_Fail_town; + message strcharinfo(0), "[boss-headshot] : after mapflags check"; +// TBD who can use this. + set @target_id, getcharid(3, @args$); + if (@target_id < 1 || !(isloggedin(@target_id)) || get(INVISIBLE, @target_id) == 1) goto L_Fail_target; + if (distance(BL_ID, @target_id) > 9) goto L_Too_far; + if ((get(Hp, @target_id)) < 1) goto L_Too_dead; // Do not touch dead + if (target(BL_ID, @target_id, 0x20) != 0x20) goto L_No_los; + set @_M_BLOCK, 1; // block casting, until the timer clears it + addtimer 10000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 10000, 0, BL_ID; + + misceffect FX_MEDIUM_EXPLOSION, strcharinfo(0); + set @tgthp, (get(Hp, @target_id) / 2); + set Sp, 1, @target_id; // Hurt target + if (@tgthp < 1500) set @tgthp, 1; // Boss or not? (>3000 HP) + set Hp, @tgthp, @target_id; // Hurt target + message strcharinfo(0, @target_id), "[boss-headshot] : "+strcharinfo(0, BL_ID)+" shot you!"; + set @tgthp, 0; + end; + +L_Fail_town: + message strcharinfo(0), "[boss-headshot] : not allowed in towns!"; + end; + +L_Fail_target: + message strcharinfo(0), "[boss-headshot] : need valid target (player)."; + end; + +L_Too_far: + message strcharinfo(0), "[boss-headshot] : target is too far away."; + end; + +L_Too_dead: + message strcharinfo(0), "[boss-headshot] : why shoot already dead?!"; + end; + +L_No_los: + message strcharinfo(0), "[boss-headshot] : no line of sight to target"; + end; + +OnInit: + set .school, SKILL_MAGIC; + set .invocation$, chr(MAGIC_SYMBOL) + "headshot"; // used in npcs that refer to this spell + void call("magic_register", "OnCast"); + set .level, 0; + set .exp_gain, 0; + end; +} diff --git a/world/map/npc/magic/event-boss-powerup-lifedrain.txt b/world/map/npc/magic/event-boss-powerup-lifedrain.txt new file mode 100644 index 00000000..ce4c9e33 --- /dev/null +++ b/world/map/npc/magic/event-boss-powerup-lifedrain.txt @@ -0,0 +1,52 @@ +-|script|powerup-lifedrain|32767 +{ + end; + +OnCast: + message strcharinfo(0), "[boss-lifedrain] : -> OnCast"; + if(call("boss_powerup_checks")) end; + message strcharinfo(0), "[boss-lifedrain] : after boss powerup check"; + if (getmapflag(getmap(), MF_TOWN)) goto L_Fail_town; + message strcharinfo(0), "[boss-lifedrain] : after mapflags check"; + message strcharinfo(0), "[boss-lifedrain] : HP="+get(Hp, BL_ID); +// TBD who can use this. + set @_M_BLOCK, 1; // block casting, until the timer clears it + addtimer 10000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 10000, 0, BL_ID; + misceffect FX_PENTAGRAM_BURST, strcharinfo(0); + set @dist, 12; + foreach 0, getmap(), (POS_X - @dist), (POS_Y - @dist), (POS_X + @dist), (POS_Y + @dist), strnpcinfo(0) + "::OnHit"; + message strcharinfo(0), "[boss-lifedrain] : after foreach"; + message strcharinfo(0), "[boss-lifedrain] : HP="+get(Hp, BL_ID); + message strcharinfo(0), "[boss-lifedrain] : <- OnCast"; + end; + +OnHit: + if (@target_id == BL_ID) end; // Do not drain caster + set @targethp, get(Hp, @target_id); // Get HP of victim + if (@targethp > 0) goto L_cont; + set @targethp, 0; + end; // Do not drain dead! +L_cont: + set @hpgain, min((@targethp / 4), 500); // Boss could be beefy -> clamp + message strcharinfo(0, @target_id), "[boss-lifedrain] : "+strcharinfo(0, BL_ID)+" drains "+(@hpgain * 2)+" hitpoints!"; + misceffect FX_CHANNELLING_RAISE, strcharinfo(0, @target_id); + set Hp, (@targethp - (2 * @hpgain)), @target_id; // Drain victim + set @targethp, (get(Hp, BL_ID) + @hpgain); // Compute caster's HP + bonus + set Hp, (@targethp), BL_ID; // Heal caster by half drain + set @hpgain, 0; + set @targethp, 0; + end; + +L_Fail_town: + message strcharinfo(0), "[boss-lifedrain] : aura of this place doesn't lets you to drain life!"; + end; + +OnInit: + set .school, SKILL_MAGIC; + set .invocation$, chr(MAGIC_SYMBOL) + "maplifedrain"; // used in npcs that refer to this spell + void call("magic_register", "OnCast"); + set .level, 0; + set .exp_gain, 0; + end; +} diff --git a/world/map/npc/magic/event-boss-powerup-manadrain.txt b/world/map/npc/magic/event-boss-powerup-manadrain.txt new file mode 100644 index 00000000..69dae18a --- /dev/null +++ b/world/map/npc/magic/event-boss-powerup-manadrain.txt @@ -0,0 +1,52 @@ +-|script|powerup-manadrain|32767 +{ + end; + +OnCast: + message strcharinfo(0), "[boss-manadrain] : -> OnCast"; + if(call("boss_powerup_checks")) end; + message strcharinfo(0), "[boss-manadrain] : after boss powerup check"; + if (getmapflag(getmap(), MF_TOWN)) goto L_Fail_town; + message strcharinfo(0), "[boss-manadrain] : after mapflags check"; + message strcharinfo(0), "[boss-manadrain] : HP="+get(Hp, BL_ID); +// TBD who can use this. + set @_M_BLOCK, 1; // block casting, until the timer clears it + addtimer 10000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 10000, 0, BL_ID; + misceffect FX_BLUE_MAGIC_CAST, strcharinfo(0); + set @dist, 16; + foreach 0, getmap(), (POS_X - @dist), (POS_Y - @dist), (POS_X + @dist), (POS_Y + @dist), strnpcinfo(0) + "::OnHit"; + message strcharinfo(0), "[boss-manadrain] : after foreach"; + message strcharinfo(0), "[boss-manadrain] : HP="+get(Hp, BL_ID); + message strcharinfo(0), "[boss-manadrain] : <- OnCast"; + end; + +OnHit: + if (@target_id == BL_ID) end; // Do not drain caster + if ((get(Hp, @target_id)) < 1) end; // Do not touch dead + set @targetmp, get(Sp, @target_id); // Get MP of victim + if (@targetmp > 0) goto L_cont; + set @targetmp, 0; + end; // Do not drain dead! +L_cont: + set @hpgain, min((@targetmp * 2 ), 900); // Clamp in case of weird setups. + message strcharinfo(0, @target_id), "[boss-manadrain] : "+strcharinfo(0, BL_ID)+" drains all your mana!"; + misceffect FX_CHANNELLING_RAISE, strcharinfo(0, @target_id); + set Sp, 1, @target_id; // Drain victim + set Hp, (Hp + @hpgain), BL_ID; // Heal caster by computed amount + set @hpgain, 0; + set @targetmp, 0; + end; + +L_Fail_town: + message strcharinfo(0), "[boss-manadrain] : aura of this place doesn't lets you drain mana!"; + end; + +OnInit: + set .school, SKILL_MAGIC; + set .invocation$, chr(MAGIC_SYMBOL) + "mapmanadrain"; // used in npcs that refer to this spell + void call("magic_register", "OnCast"); + set .level, 0; + set .exp_gain, 0; + end; +} diff --git a/world/map/npc/magic/event-boss-powerup-poison.txt b/world/map/npc/magic/event-boss-powerup-poison.txt new file mode 100644 index 00000000..c5f343ab --- /dev/null +++ b/world/map/npc/magic/event-boss-powerup-poison.txt @@ -0,0 +1,41 @@ +-|script|powerup-masspoison|32767 +{ + end; + +OnCast: + message strcharinfo(0), "[boss-masspoison] : -> OnCast"; + if (call("boss_powerup_checks")) end; + message strcharinfo(0), "[boss-masspoison] : after boss powerup check"; + if (getmapflag(getmap(), MF_TOWN)) goto L_Fail_town; + message strcharinfo(0), "[boss-masspoison] : after mapflags check"; +// TBD who can use this. + set @_M_BLOCK, 1; // block casting, until the timer clears it + addtimer 10000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 10000, 0, BL_ID; + misceffect FX_MAGIC_SNAKE_CAST, strcharinfo(0); + set @dist, 12; + foreach 0, getmap(), (POS_X - @dist), (POS_Y - @dist), (POS_X + @dist), (POS_Y + @dist), strnpcinfo(0) + "::OnHit"; + message strcharinfo(0), "[boss-masspoison] : after foreach"; + message strcharinfo(0), "[boss-masspoison] : <- OnCast"; + end; + +OnHit: + if (@target_id == BL_ID) end; // Do not poison caster + if ((get(Hp, @target_id)) < 1) end; // Do not poison dead! + message strcharinfo(0, @target_id), "[boss-masspoison] : "+strcharinfo(0, BL_ID)+" poisoned you!"; + misceffect FX_EMOTE_DISGUST, strcharinfo(0, @target_id); + sc_start SC_POISON, 1, 60, @target_id; + end; + +L_Fail_town: + message strcharinfo(0), "[boss-masspoison] : can't mass-poison in towns!"; + end; + +OnInit: + set .school, SKILL_MAGIC; + set .invocation$, chr(MAGIC_SYMBOL) + "mappoison"; // used in npcs that refer to this spell + void call("magic_register", "OnCast"); + set .level, 0; + set .exp_gain, 0; + end; +} diff --git a/world/map/npc/magic/event-boss-powerup-tormenta.txt b/world/map/npc/magic/event-boss-powerup-tormenta.txt new file mode 100644 index 00000000..1ecf4bf0 --- /dev/null +++ b/world/map/npc/magic/event-boss-powerup-tormenta.txt @@ -0,0 +1,40 @@ +-|script|powerup-tormenta|32767 +{ + end; + +OnCast: + // TBD who can use this. + message strcharinfo(0), "[boss-tormenta] : -> OnCast"; + if(call("boss_powerup_checks")) end; + message strcharinfo(0), "[boss-tormenta] : after boss powerup check"; + bonus bMaxHP, 20000; + set Hp, (Hp+20000), BL_ID; + set Class, 1137, BL_ID; + warp getmap(), POS_X, POS_Y; // Refresh witch appearance + addtimer 1500, strnpcinfo(0)+"::OnFix"; + message strcharinfo(0), "[boss-tormenta] : Tormenta impersonation started!"; + message strcharinfo(0), "[boss-tormenta] : <- OnCast"; + end; + +OnFix: + set @fix_count, @fix_count + 1; + if (@fix_count > 1000) goto L_done; // Timed out. + if (get(Class, BL_ID) != 1137) goto L_done; // Caster attempted charclass? + set Class, 1142, BL_ID; + set Class, 1137, BL_ID; + addtimer 1500, strnpcinfo(0)+"::OnFix"; + end; +L_done: + message strcharinfo(0, BL_ID), "[boss-tormenta] : Tormenta impersonation ended!"; + set @fix_count, 0; + set Class, 0, BL_ID; + end; + +OnInit: + set .school, SKILL_MAGIC; + set .invocation$, chr(MAGIC_SYMBOL) + "tormenta"; // used in npcs that refer to this spell + void call("magic_register", "OnCast"); + set .level, 0; + set .exp_gain, 0; + end; +} diff --git a/world/map/npc/magic/event-boss-powerup-totheabyss.txt b/world/map/npc/magic/event-boss-powerup-totheabyss.txt new file mode 100644 index 00000000..d356dbea --- /dev/null +++ b/world/map/npc/magic/event-boss-powerup-totheabyss.txt @@ -0,0 +1,63 @@ +-|script|powerup-totheabyss|32767 +{ + end; + +// Armageddon-like action to be thrown by boss - by Hello=) +// Hurts everyone near boss, throws FX and teleports 'em to abyss! + +OnCast: + message strcharinfo(0), "[boss-totheabyss] : -> OnCast"; + if (call("boss_powerup_checks")) end; + message strcharinfo(0), "[boss-to-the-abyss] : after boss powerup check"; + if (getmapflag(getmap(), MF_TOWN)) goto L_Fail_town; + message strcharinfo(0), "[boss-to-the-abyss] : after mapflags check"; +// TBD who can use this. + set @_M_BLOCK, 1; // block casting, until the timer clears it + addtimer 10000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 10000, 0, BL_ID; + misceffect FX_BLUE_MAGIC_CAST, strcharinfo(0); + set @dist, 25; + foreach 0, getmap(), (POS_X - @dist), (POS_Y - @dist), (POS_X + @dist), (POS_Y + @dist), strnpcinfo(0) + "::OnHit"; + message strcharinfo(0), "[boss-to-the-abyss] : after foreach"; + message strcharinfo(0), "[boss-to-the-abyss] : <- OnCast"; + end; + +OnHit: + if ((get(Hp, @target_id)) < 1) end; // Do not touch dead + set Sp, 1, @target_id; // Hurt target + set Hp, min(((Hp/2)), 100), @target_id; // Hurt target + sc_start SC_POISON, 1, 10, @target_id; // Poison target + message strcharinfo(0, @target_id), "[boss-to-the-abyss] : "+strcharinfo(0, BL_ID)+" ##B PULLS YOU TO THE ABYSS!!"; + misceffect FX_CHANNELLING_RAISE, strcharinfo(0, @target_id); + addtimer 1000, strnpcinfo(0)+"::OnTeleport", @target_id; + end; + +// Runs attached to player, beware. Dont try access vars from former code! +OnTeleport: + warp "070-3", 40+rand(5), 25+rand(5); // warp (under char's RID!) + addtimer 1500, strnpcinfo(0)+"::OnArrival"; // To play FX after player's arrival -> map + end; // Done. + +// Runs attached to player, beware. Dont try access vars from former code! +OnArrival: + misceffect 50, strcharinfo(0); // Unfortunately hell glow lacks const. + addtimer 15000, strnpcinfo(0)+"::OnClean"; // To cancel former "infinite" FX. + end; // Done. + +// Runs attached to player, beware. Dont try access vars from former code! +OnClean: + warp getmap(), POS_X, POS_Y; // Actually to get rid of infinite FX + end; // Done. + +L_Fail_town: + message strcharinfo(0), "[boss-to-the-abyss] : portal to abyss can't be opened in towns!"; + end; + +OnInit: + set .school, SKILL_MAGIC; + set .invocation$, chr(MAGIC_SYMBOL) + "totheabyss"; // used in npcs that refer to this spell + void call("magic_register", "OnCast"); + set .level, 0; + set .exp_gain, 0; + end; +} diff --git a/world/map/npc/magic/event-boss-powerup-tothecrypt.txt b/world/map/npc/magic/event-boss-powerup-tothecrypt.txt new file mode 100644 index 00000000..3da6a2b9 --- /dev/null +++ b/world/map/npc/magic/event-boss-powerup-tothecrypt.txt @@ -0,0 +1,63 @@ +-|script|powerup-tothecrypt|32767 +{ + end; + +// Armageddon-like action to be thrown by boss - by Hello=) +// Hurts everyone near boss, throws FX and teleports 'em to crypt! + +OnCast: + message strcharinfo(0), "[boss-tothecrypt] : -> OnCast"; + if (call("boss_powerup_checks")) end; + message strcharinfo(0), "[boss-to-the-crypt] : after boss powerup check"; + if (getmapflag(getmap(), MF_TOWN)) goto L_Fail_town; + message strcharinfo(0), "[boss-to-the-crypt] : after mapflags check"; +// TBD who can use this. + set @_M_BLOCK, 1; // block casting, until the timer clears it + addtimer 10000, "Magic Timer::OnClear"; // set the new debuff + sc_start SC_COOLDOWN, 10000, 0, BL_ID; + misceffect FX_BLUE_MAGIC_CAST, strcharinfo(0); + set @dist, 25; + foreach 0, getmap(), (POS_X - @dist), (POS_Y - @dist), (POS_X + @dist), (POS_Y + @dist), strnpcinfo(0) + "::OnHit"; + message strcharinfo(0), "[boss-to-the-crypt] : after foreach"; + message strcharinfo(0), "[boss-to-the-crypt] : <- OnCast"; + end; + +OnHit: + if ((get(Hp, @target_id)) < 1) end; // Do not touch dead + set Sp, 1, @target_id; // Hurt target + set Hp, min(((Hp/2)), 100), @target_id; // Hurt target + sc_start SC_POISON, 1, 10, @target_id; // Poison target + message strcharinfo(0, @target_id), "[boss-to-the-crypt] : "+strcharinfo(0, BL_ID)+" ##B PULLS YOU TO THE CRYPT!!"; + misceffect FX_CHANNELLING_RAISE, strcharinfo(0, @target_id); + addtimer 1000, strnpcinfo(0)+"::OnTeleport", @target_id; + end; + +// Runs attached to player, beware. Dont try access vars from former code! +OnTeleport: + warp "027-5", 71+rand(3), 51+rand(3); // warp (under char's RID!) + addtimer 1500, strnpcinfo(0)+"::OnArrival"; // To play FX after player's arrival -> map + end; // Done. + +// Runs attached to player, beware. Dont try access vars from former code! +OnArrival: + misceffect 50, strcharinfo(0); // Unfortunately hell glow lacks const. + addtimer 15000, strnpcinfo(0)+"::OnClean"; // To cancel former "infinite" FX. + end; // Done. + +// Runs attached to player, beware. Dont try access vars from former code! +OnClean: + warp getmap(), POS_X, POS_Y; // Actually to get rid of infinite FX + end; // Done. + +L_Fail_town: + message strcharinfo(0), "[boss-to-the-crypt] : portal to crypt can't be opened in towns!"; + end; + +OnInit: + set .school, SKILL_MAGIC; + set .invocation$, chr(MAGIC_SYMBOL) + "tothecrypt"; // used in npcs that refer to this spell + void call("magic_register", "OnCast"); + set .level, 0; + set .exp_gain, 0; + end; +} |