From 15d81154c2ed1ba989924f89fbef672a49965d38 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Tue, 23 Mar 2021 11:16:07 -0300 Subject: 029-5 is now a map which causes diseases. Mitigates slime mother farming. HP > 70%: Bleeding HP > 40%: Poison HP < 00%: Deadly Poison PS. Formula likely wrong. --- npc/functions/clientversion.txt | 2 +- npc/functions/dungeon.txt | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) (limited to 'npc/functions') diff --git a/npc/functions/clientversion.txt b/npc/functions/clientversion.txt index ea8af1be2..53587237a 100644 --- a/npc/functions/clientversion.txt +++ b/npc/functions/clientversion.txt @@ -1033,7 +1033,7 @@ function script checkclientversion { mesc l("Warning."), 1; mesc l("Warning: You are using an old client."), 1; next; - mesc l("Please install the new client from [@@https://manaplus.org/|https://manaplus.org/@@]"); + //mesc l("Please install the new client from [@@https://manaplus.org/|https://manaplus.org/@@]"); mesc l("Alternatively, download a bleeding edge build at [@@https://manaplus.germantmw.de/|https://manaplus.germantmw.de/@@]"); mesc l("Or use our awesome [@@https://tmw2.org/manalauncher/InstallManaLauncher.exe|Mana Launcher@@] if you're on Windows or Linux."); next; diff --git a/npc/functions/dungeon.txt b/npc/functions/dungeon.txt index 1b3f29f2f..ef0bcc08e 100644 --- a/npc/functions/dungeon.txt +++ b/npc/functions/dungeon.txt @@ -11,6 +11,7 @@ OnInit: setarray .heatmap$, "007-2"; setarray .cursemap$, "006-4", "006-4-1", "025-1"; + setarray .sickmap$, "029-5"; end; ///////////////////////////////////////// @@ -75,10 +76,49 @@ OnCurse: end; } +///////////////////////////////////////// +// Heartbeat for Disease effects +OnSick: + // Did you left? + .@i=array_find(.sickmap$, getmap()); + if (.@i < 0) { + @sick$=""; + end; + } + + // First time seeing this + if (@sick$ != getmap()) { + @sick$=getmap(); + dispbottom l("This map contains poisonous class and may cause diseases."); + } + + // The effect is based on HP + if (MaxHp*7/10 > Hp) + .@eff = SC_BLOODING; + else if (MaxHp*4/10 > Hp) + .@eff = SC_POISON; + else + .@eff = SC_DPOISON; + + // You are in a SICKMAP$, so suffer damage from disease + if (@sickio > gettimetick(2)) { + heal -50, 0; + } else { + heal -rand2(50, 200), 0; + SC_Bonus(10, .@eff, 1); + } + + // New tick (10 seconds fixed cycle) + addtimer2 10000, .name$+"::OnSick"; + end; + + + ////////////////////////////// 007-2 mapflag nosave 007-1,99,189 006-4 mapflag nosave 006-3,54,36 006-4-1 mapflag nosave 006-3,54,36 +029-5 mapflag nosave 029-4,21,97 -- cgit v1.2.3-60-g2f50