diff options
author | Jesusaves <cpntb1@ymail.com> | 2025-02-02 00:31:38 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2025-02-02 00:31:38 -0300 |
commit | 9d863ea65ad22583e8d9c70452578cb3377c183f (patch) | |
tree | 295a131e8d63974cf43ba5198f8fdca65150a972 | |
parent | 01c0cf4758bca22510b44227e3432458cbac78aa (diff) | |
download | serverdata-9d863ea65ad22583e8d9c70452578cb3377c183f.tar.gz serverdata-9d863ea65ad22583e8d9c70452578cb3377c183f.tar.bz2 serverdata-9d863ea65ad22583e8d9c70452578cb3377c183f.tar.xz serverdata-9d863ea65ad22583e8d9c70452578cb3377c183f.zip |
Replace Realm of Drops rule for seasonal drops.
It no longer give a 9% fixed rate, but it varies based on global drop rates.
It also no longer computes seasonal drops in skill eligibility rules.
-rw-r--r-- | npc/magic/drops.txt | 60 |
1 files changed, 32 insertions, 28 deletions
diff --git a/npc/magic/drops.txt b/npc/magic/drops.txt index 8ce992998..2a32693b0 100644 --- a/npc/magic/drops.txt +++ b/npc/magic/drops.txt @@ -35,49 +35,66 @@ function script SK_drops { copyarray(.@item[0], $@MobDrop_item[0], .@count); copyarray(.@rate[0], $@MobDrop_rate[0], .@count); + // Calculate total drop rates for the monster + .@total = array_sum(.@rate); + + // First we determine if you can, or cannot, get a bonus drop + if (.@total < 500) { + if (.@total < 200) { + // Hard limit: 2% of total drop rate (-1 prevents execution) + @skdrop[.@mobId]=-1; + return; + } else { + // Soft limit: Half the efficiency + if (@skdrop[.@mobId] % (.@min*2) != 0) + return; + } + } + // Include seasonal drops irrespective of monster type + // However, the actual % depends on monster drops switch (season()) { case SUMMER: array_push(.@item, CherryCocktail); - array_push(.@rate, 300); + array_push(.@rate, 300 * .@total / 900); array_push(.@item, CactusCocktail); - array_push(.@rate, 300); + array_push(.@rate, 300 * .@total / 900); array_push(.@item, AppleCocktail); - array_push(.@rate, 300); + array_push(.@rate, 300 * .@total / 900); .@count += 3; break; case AUTUMN: array_push(.@item, PumpkandySeed); - array_push(.@rate, 720); + array_push(.@rate, 720 * .@total / 900); array_push(.@item, PumpkinLollipop); - array_push(.@rate, 180); + array_push(.@rate, 180 * .@total / 900); .@count += 2; break; case WINTER: array_push(.@item, GingerBreadMan); - array_push(.@rate, 100); + array_push(.@rate, 100 * .@total / 900); array_push(.@item, CaramelCandy); - array_push(.@rate, 250); + array_push(.@rate, 250 * .@total / 900); array_push(.@item, Snowflake); - array_push(.@rate, 250); + array_push(.@rate, 250 * .@total / 900); array_push(.@item, SmallChocolateBar); - array_push(.@rate, 300); + array_push(.@rate, 300 * .@total / 900); .@count += 4; break; case SPRING: array_push(.@item, GrassSeeds); - array_push(.@rate, 150); + array_push(.@rate, 150 * .@total / 900); array_push(.@item, Tulip); - array_push(.@rate, 250); + array_push(.@rate, 250 * .@total / 900); array_push(.@item, Rose); - array_push(.@rate, 250); + array_push(.@rate, 250 * .@total / 900); array_push(.@item, Blueberries); - array_push(.@rate, 250); + array_push(.@rate, 250 * .@total / 900); .@count += 4; break; } - // .@total => sum of all drop rates + // .@total => sum of all drop rates (recalculated) // .@array => The real array for relative_array_random() .@total = 0; .@array = -1; @@ -88,20 +105,7 @@ function script SK_drops { .@total+=.@rate[.@i]; } - // Now we determine if you can, or cannot, get a bonus drop - if (.@total < 500) { - if (.@total < 200) { - // Hard limit: 2% of total drop rate (-1 prevents execution) - @skdrop[.@mobId]=-1; - return; - } else { - // Soft limit: Half the efficiency - if (@skdrop[.@mobId] % (.@min*2) != 0) - return; - } - } - - // You can! So give you a random bonus drop with proper ponderation + // Give you a random bonus drop with proper ponderation .@drop = relative_array_random(.@array); getmapxy(.@m$, .@x, .@y, 0); makeitem(.@drop, 1, .@m$, .@x, .@y); |