-|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: if (call("boss_powerup_checks")) end; if (getmapflag(getmap(), MF_TOWN)) goto L_Fail_town; set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 30000, "Magic Timer::OnClear"; // set the new debuff sc_start SC_COOLDOWN, 30000, 0, BL_ID; misceffect FX_RED_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"; end; OnHit: if ((get(Hp, @target_id)) < 1) end; // Do not touch dead message strcharinfo(0, @target_id), "[boss-to-the-abyss] : "+strcharinfo(0, BL_ID)+" ##B PULLS YOU TO THE ABYSS!!"; misceffect FX_RED_MAGIC_CAST, strcharinfo(0, @target_id); sc_start SC_SLOWMOVE, 6000, 10000; // Slow player temporarily to avoid movement VS warp DCs addtimer 500+rand(500), 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!) set Sp, 1; // Hurt target set Hp, (Hp/4); // Hurt target sc_start SC_POISON, 1, 10; // Poison target addtimer 1000, 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 2800, 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; }