summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/functions/event.txt28
-rw-r--r--npc/functions/mobpoint.txt1
2 files changed, 29 insertions, 0 deletions
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