From d2638ee465bbcc53dd8b12653c0e55e4c440e564 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sun, 2 Jan 2022 09:37:38 -0300 Subject: Prepare new dungeon effect: Bleeding Map --- npc/functions/dungeon.txt | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/npc/functions/dungeon.txt b/npc/functions/dungeon.txt index 822246974..2ae34f912 100644 --- a/npc/functions/dungeon.txt +++ b/npc/functions/dungeon.txt @@ -12,6 +12,7 @@ OnInit: setarray .heatmap$, "007-2"; setarray .cursemap$, "006-4", "006-4-1", "025-1"; setarray .sickmap$, "029-5"; + setarray .bleedmap$, "008-2"; // Placeholder end; ///////////////////////////////////////// @@ -113,6 +114,38 @@ OnSick: addtimer2 10000, .name$+"::OnSick"; end; + +///////////////////////////////////////// +// Heartbeat for Bleed effects +OnBleed: + // Did you left? + .@i=array_find(.bleedmap$, getmap()); + if (.@i < 0) { + @bleed$=""; + end; + } + + // First time seeing this + if (@bleed$ != getmap()) { + @bleed$=getmap(); + dispbottom l("This is a bleeding map, HP won't recover naturally, and bleeding may start."); + } + + // You are in a BLEEDMAP$, HP regeneration is disabled + if (@bleedio > gettimetick(2)) + sc_end SC_HALT_REGENERATION; + else + SC_Bonus(15, SC_HALT_REGENERATION, 1); + + // You may bleed at 2% chance per 15 seconds + if (rand2(50) == 25 && @bleedio < gettimetick(2)) + SC_Bonus(15, SC_BLOODING, 1); + + // New tick + addtimer2 15000, .name$+"::OnBleed"; + end; + + } -- cgit v1.2.3-70-g09d2