diff options
author | Jesusaves <cpntb1@ymail.com> | 2025-03-18 23:23:22 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2025-03-18 23:23:22 -0300 |
commit | 247ffa35e368668c2b8dbc7ed21d52008f3c1864 (patch) | |
tree | 186b30c883c70285d7946d54cac0ec1486105f91 | |
parent | e10720cbf4a3ecf07602159d8c3281df05c906ed (diff) | |
download | serverdata-247ffa35e368668c2b8dbc7ed21d52008f3c1864.tar.gz serverdata-247ffa35e368668c2b8dbc7ed21d52008f3c1864.tar.bz2 serverdata-247ffa35e368668c2b8dbc7ed21d52008f3c1864.tar.xz serverdata-247ffa35e368668c2b8dbc7ed21d52008f3c1864.zip |
Three new map mechanics which will be necessary for the Moubootaur Showdown
-rw-r--r-- | db/re/item_db.conf | 11 | ||||
-rw-r--r-- | npc/functions/dungeon.txt | 112 | ||||
-rw-r--r-- | npc/items/grenade.txt | 2 |
3 files changed, 120 insertions, 5 deletions
diff --git a/db/re/item_db.conf b/db/re/item_db.conf index 9c8139585..9a14011e1 100644 --- a/db/re/item_db.conf +++ b/db/re/item_db.conf @@ -305,6 +305,8 @@ item_db: ( if (rand(10000) < 1000) sc_start SC_POISON, 7000, 0; callfunc("ItHeal2", 1, 2); + // Gives you 3 extra minutes of cooldown + @leechio=max(gettimetick(2), @leechio)+180; "> }, { @@ -610,6 +612,7 @@ item_db: ( sc_end SC_FROSTMISTY; sc_end SC_VENOMBLEED; sc_end SC_QUAGMIRE; + sc_end SC_MOVESLOW_POTION; sc_end SC_FROSTMISTY; sc_end SC_HALT_REGENERATION; sc_end SC_BOTTER_SYNDROME; @@ -620,6 +623,9 @@ item_db: ( @sickio=max(gettimetick(2), @sickio)+30; @purifio=max(gettimetick(2), @purifio)+30; @bleedio=max(gettimetick(2), @bleedio)+30; + @frostio=max(gettimetick(2), @frostio)+30; + @leechio=max(gettimetick(2), @leechio)+30; + @windyio=max(gettimetick(2), @windyio)+30; "> }, { @@ -1874,6 +1880,7 @@ item_db: ( sc_start SC_POISON, 9000, 0, 3200; callfunc("ItHeal", 3, 18, 40); getitem EmptyBottle, 1; + @leechio=0; "> }, { @@ -2104,6 +2111,8 @@ item_db: ( if (rand(10000) < 6000) sc_start callfunc("any", SC_POISON, SC_SILENCE, SC_POISON, SC_CONFUSE, SC_POISON, SC_POISON), rand(10000, 30000), 0; itemheal 0, rand(10,200); + // Gives you 2 extra minutes of cooldown + @leechio=max(gettimetick(2), @leechio)+120; "> }, { @@ -3161,6 +3170,8 @@ item_db: ( sc_end SC_CURSE; sc_end SC_BLIND; percentheal 1, 10; + // Gives you 4 extra minutes of cooldown + @frostio=max(gettimetick(2), @frostio)+240; "> }, { diff --git a/npc/functions/dungeon.txt b/npc/functions/dungeon.txt index 580635623..261c9fce9 100644 --- a/npc/functions/dungeon.txt +++ b/npc/functions/dungeon.txt @@ -9,11 +9,14 @@ // Main initialization OnInit: - setarray .heatmap$, "007-2", "026-3"; - setarray .cursemap$, "006-4", "006-4-1", "025-1", "026-2"; - setarray .sickmap$, "029-5"; - setarray .bleedmap$, "006-9", "026-6", "026-7"; - setarray .clockmap$, "017-0", "032-2"; + setarray .heatmap$, "007-2", "026-3", "001-15"; + setarray .cursemap$, "006-4", "006-4-1", "025-1", "026-2", "001-15"; + setarray .sickmap$, "029-5", "001-15"; + setarray .bleedmap$, "006-9", "026-6", "026-7", "001-15"; + setarray .clockmap$, "017-0", "032-2", "001-15"; + setarray .windymap$, "001-15"; + setarray .leechmap$, "001-15"; + setarray .frostmap$, "001-15"; end; ///////////////////////////////////////// @@ -239,6 +242,105 @@ OnClocked: end; +///////////////////////////////////////// +// Heartbeat for Windy effects +OnWindy: + // Did you left? + .@i=array_find(.windymap$, getmap()); + if (.@i < 0) { + @windy$=""; + end; + } + + // First time seeing this + if (@windy$ != getmap()) { + @windy$=getmap(); + dispbottom l("This is a Windy map, walk speed and agility may be reduced."); + } + + // You are in a WINDYMAP$, Move speed is impacted until it is neutered + .@penalty = 40 - (max(100, rand2(readparam2(bVit))) / 5); + if (@windyio <= gettimetick(2) || Class != Orc) + SC_Bonus(15, SC_MOVESLOW_POTION, .@penalty); + else + SC_Bonus(15, SC_MOVESLOW_POTION, 5); + + // You may lose agility at 4% chance per 15 seconds + if (rand2(25) == 12) + sc_start2 SC_DEC_AGI, 15000, 20, 20, 10000, SCFLAG_NOAVOID|SCFLAG_FIXEDTICK|SCFLAG_FIXEDRATE; + + // New tick (15 seconds fixed cycle) + + addtimer2 15000, .name$+"::OnWindy"; + end; + + +///////////////////////////////////////// +// Heartbeat for Leech effects +OnLeech: + // Did you left? + .@i=array_find(.leechmap$, getmap()); + if (.@i < 0) { + @windy$=""; + end; + } + + // First time seeing this + if (@leech$ != getmap()) { + @leech$=getmap(); + dispbottom l("This map is infested by Parasites, your HP will be periodically leeched to enemies!"); + } + + // You are in a LEECHMAP$ so you lose HP and leech it to mobs (5%, 14x14 square) + if (@leechio <= gettimetick(2) || Class != Tritan) { + percentheal -5, 0; + grenade(14, -500, false); + } else { + percentheal -1, 0; + } + + // New tick (15 seconds fixed cycle) + addtimer2 15000, .name$+"::OnLeech"; + end; + + +///////////////////////////////////////// +// Heartbeat for Frost effects +OnFrost: + // Did you left? + .@i=array_find(.frostmap$, getmap()); + if (.@i < 0) { + @frost$=""; + end; + } + + // First time seeing this + if (@frost$ != getmap()) { + @frost$=getmap(); + dispbottom l("This map is extremely cold, and may cause frostbites."); + } + + // You are in a FROSTMAP$ and may get frostbites + if (@frostio <= gettimetick(2) || (Class != Elf && Class != Ukar)) { + // You get Frostbites at 100% probability + percentheal -2, 0; + // You may get cold at ~8% chance + if (rand2(12) == 10) + SC_Bonus(15, SC_COLD, 5); + // You may freeze at ~2% chance + if (rand2(50) == 25) + SC_Bonus(15, SC_FREEZE, 5); + } else { + // Only 25% chance of a weaker frostbite + if (rand2(4) == 2) + percentheal -1, 0; + } + + // New tick (15 seconds fixed cycle) + addtimer2 15000, .name$+"::OnFrost"; + end; + + } diff --git a/npc/items/grenade.txt b/npc/items/grenade.txt index a3ddf9fca..31a24934d 100644 --- a/npc/items/grenade.txt +++ b/npc/items/grenade.txt @@ -18,6 +18,8 @@ function script grenade { .@dm=max(1, .@hp*(10000-.@d)/10000); // Does it even make sense? if (getarg(2, false)) .@dm=max(1, .@hp-.@d); + if (.@d < 0) + .@dm=min(.@dm, getunitdata(.@mbs[.@i], UDT_MAXHP)); if (callfunc(.@f$)) { //debugmes "Hitting monster (%d hp) for %d damage", .@hp, .@dm; // TODO: use harm() instead? |