summaryrefslogtreecommitdiff
path: root/world/map/npc/magic/event-boss-powerup-manadrain.txt
diff options
context:
space:
mode:
authorHello=) <hello@themanaworld.org>2024-04-10 15:41:30 +0300
committerLed Mitz <smoothshifter@tuta.io>2024-04-11 04:58:52 +0000
commitf71f26affd599fa87a4c03319a979c6786f978f3 (patch)
tree027d57a4c8ffb34ae00c970c8c467e74a46a9a7f /world/map/npc/magic/event-boss-powerup-manadrain.txt
parent6312f7e082bdaae46cdcb9679dd74c7c778bf652 (diff)
downloadserverdata-f71f26affd599fa87a4c03319a979c6786f978f3.tar.gz
serverdata-f71f26affd599fa87a4c03319a979c6786f978f3.tar.bz2
serverdata-f71f26affd599fa87a4c03319a979c6786f978f3.tar.xz
serverdata-f71f26affd599fa87a4c03319a979c6786f978f3.zip
Initial commit of Dungeon Master/Boss Event spells/actions toolkit by Hello=)
Few things to keep in mind: 1) This commit lands DEBUG version of thing to give some ideas how it could happen. 2) This version is very "chatty" and spits a lot of debug messages to General chat. Next commits would remove most of non-essential spell messages. 3) This version allows ANYONE to invoke spells and should not be used on production! Next commits would address this, uplifting spell invocation requirements. 4) Cooldown times are too low, to facilitate testing. Should be fixed in next commits. Next commits would 5) Some effects need to be rewired, and few more spells could possibly be added.
Diffstat (limited to 'world/map/npc/magic/event-boss-powerup-manadrain.txt')
-rw-r--r--world/map/npc/magic/event-boss-powerup-manadrain.txt52
1 files changed, 52 insertions, 0 deletions
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;
+}