From f505932e7db9d8bd023c7eeb69820ae9d63e7f3f Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sun, 26 Jul 2020 01:47:43 -0300 Subject: Chocolate Day Event It happens at 07/07 and will make every monster drop chocolate. If you're lucky, of course. Drop chances are 0.4% per monster level. There is only 27% chance for some chocolate which is not a bar :> --- npc/functions/event.txt | 28 ++++++++++++++++++++++++++++ npc/functions/mobpoint.txt | 1 + 2 files changed, 29 insertions(+) (limited to 'npc/functions') diff --git a/npc/functions/event.txt b/npc/functions/event.txt index b57b55765..864182675 100644 --- a/npc/functions/event.txt +++ b/npc/functions/event.txt @@ -210,6 +210,34 @@ function script sThanksgiving { return; } +// ChocolateDay() +function script ChocolateDay { + if (!playerattached()) + return; + + // Date check + if (gettime(6) != JULY) + return; + if (gettime(5) != gettime(6)) + return; + + // Max. 80% chances, 0.4% per monster level + .@lv=min(200, getmonsterinfo(killedrid, MOB_LV)); + if (rand2(10000) < (.@lv*40)) { + // Chocolate Bar: 73%; Chocolate Dye: 6.7% + .@choco=any(ChocolateBar, ChocolateBar, ChocolateBar, ChocolateBar, + ChocolateMouboo, ChocolateBiscuit, ChocolateBunny, + ChocolateBar, ChocolateBar, ChocolateBar, ChocolateBar, + ChocolateDye, ChocolateBar, ChocolateBar, ChocolateBar); + getmapxy(.@m$, .@x, .@y); + .@x+=rand2(-1,1); + .@y+=rand2(-1,1); + makeitem(.@choco, 1, .@m$, .@x, .@y); + } + return; +} + + diff --git a/npc/functions/mobpoint.txt b/npc/functions/mobpoint.txt index e7623fdf2..80d7fdb92 100644 --- a/npc/functions/mobpoint.txt +++ b/npc/functions/mobpoint.txt @@ -75,6 +75,7 @@ OnNPCKillEvent: callfunc "dausen_mobtutorial"; callfunc "Guardhouse_RandQuestCheck"; callfunc "AuroraMobkill"; + callfunc "ChocolateDay"; // Unset killedrid. This affects multiple calls of this function // But it is in overall more reliable imao -- cgit v1.2.3-60-g2f50