summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-07-26 01:47:43 -0300
committerJesusaves <cpntb1@ymail.com>2020-07-26 01:47:43 -0300
commitf505932e7db9d8bd023c7eeb69820ae9d63e7f3f (patch)
tree4c6e59196f1a9211a9f60003743fbd14c5f54ece /npc
parent1bdfe3079c4ed829bc5adb9cb6d325479191abc3 (diff)
downloadserverdata-f505932e7db9d8bd023c7eeb69820ae9d63e7f3f.tar.gz
serverdata-f505932e7db9d8bd023c7eeb69820ae9d63e7f3f.tar.bz2
serverdata-f505932e7db9d8bd023c7eeb69820ae9d63e7f3f.tar.xz
serverdata-f505932e7db9d8bd023c7eeb69820ae9d63e7f3f.zip
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 :>
Diffstat (limited to 'npc')
-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