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/029-5/_config.txt | 16 ++++++++++++++++ npc/029-5/_import.txt | 1 + npc/functions/clientversion.txt | 2 +- npc/functions/dungeon.txt | 40 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 npc/029-5/_config.txt (limited to 'npc') diff --git a/npc/029-5/_config.txt b/npc/029-5/_config.txt new file mode 100644 index 000000000..99e975a46 --- /dev/null +++ b/npc/029-5/_config.txt @@ -0,0 +1,16 @@ +// This file is generated automatically. All manually added changes will be removed when running the Converter. +// Map 029-5: Crypt Sub-Basement Two conf + +029-5,126,18,0 script #029-5_126_18 NPC_HIDDEN,3,0,{ + end; +OnTouch: + doevent "#DungeonCore::OnSick"; + end; +} + +029-5,71,26,0 script #029-5_71_26 NPC_HIDDEN,3,0,{ + end; +OnTouch: + doevent "#DungeonCore::OnSick"; + end; +} diff --git a/npc/029-5/_import.txt b/npc/029-5/_import.txt index ac75177d0..43d51fb30 100644 --- a/npc/029-5/_import.txt +++ b/npc/029-5/_import.txt @@ -1,3 +1,4 @@ // Map 029-5: Crypt Sub-Basement Two // This file is generated automatically. All manually added changes will be removed when running the Converter. +"npc/029-5/_config.txt", "npc/029-5/_warps.txt", 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-70-g09d2