From ea25cb9d91b82c4d2d430a94f5ae1c166cc52a56 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sun, 26 Jul 2020 01:53:27 -0300 Subject: Actually, and most importantly: Coffee Day. IT IS COFFEE. --- npc/functions/event.txt | 25 ++++++++++++++++++++++++- npc/functions/mobpoint.txt | 1 + 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/npc/functions/event.txt b/npc/functions/event.txt index 864182675..7c7b7a8e2 100644 --- a/npc/functions/event.txt +++ b/npc/functions/event.txt @@ -218,7 +218,7 @@ function script ChocolateDay { // Date check if (gettime(6) != JULY) return; - if (gettime(5) != gettime(6)) + if (gettime(5) != 7) return; // Max. 80% chances, 0.4% per monster level @@ -237,6 +237,29 @@ function script ChocolateDay { return; } +// CoffeeDay() +function script CoffeeDay { + if (!playerattached()) + return; + + // Date check + if (gettime(6) != OCTOBER) + return; + if (gettime(5) != 1) + return; + + // Max. 22% chances, 0.1% per monster level + .@lv=min(200, getmonsterinfo(killedrid, MOB_LV)); + if (rand2(10000) < (.@lv*11)) { + getmapxy(.@m$, .@x, .@y); + .@x+=rand2(-1,1); + .@y+=rand2(-1,1); + makeitem(Coffee, 1, .@m$, .@x, .@y); + } + return; +} + + diff --git a/npc/functions/mobpoint.txt b/npc/functions/mobpoint.txt index 80d7fdb92..d35d44331 100644 --- a/npc/functions/mobpoint.txt +++ b/npc/functions/mobpoint.txt @@ -76,6 +76,7 @@ OnNPCKillEvent: callfunc "Guardhouse_RandQuestCheck"; callfunc "AuroraMobkill"; callfunc "ChocolateDay"; + callfunc "CoffeeDay"; // Unset killedrid. This affects multiple calls of this function // But it is in overall more reliable imao -- cgit v1.2.3-60-g2f50