diff options
Diffstat (limited to 'npc')
-rw-r--r-- | npc/functions/dungeon.txt | 33 |
1 files changed, 33 insertions, 0 deletions
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; + + } |