summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-10-28 00:31:37 -0300
committerJesusaves <cpntb1@ymail.com>2019-10-28 00:31:37 -0300
commitd8370fe103747984ce941b30c10e6221ecd029c5 (patch)
treef30ae374dbb299420b1bfebec110b6e6f0375639 /npc
parent39e8b20e64ddabac08fd8ba4621cb3d28f04244e (diff)
downloadserverdata-d8370fe103747984ce941b30c10e6221ecd029c5.tar.gz
serverdata-d8370fe103747984ce941b30c10e6221ecd029c5.tar.bz2
serverdata-d8370fe103747984ce941b30c10e6221ecd029c5.tar.xz
serverdata-d8370fe103747984ce941b30c10e6221ecd029c5.zip
Thanksgiving card spinner (no effects)
Diffstat (limited to 'npc')
-rw-r--r--npc/003-3/malindou.txt5
-rw-r--r--npc/commands/event.txt2
-rw-r--r--npc/functions/event.txt66
3 files changed, 72 insertions, 1 deletions
diff --git a/npc/003-3/malindou.txt b/npc/003-3/malindou.txt
index 5e3978236..39ce3041d 100644
--- a/npc/003-3/malindou.txt
+++ b/npc/003-3/malindou.txt
@@ -605,8 +605,11 @@ OnPCLoginEvent:
// Newbie bonuses recalc
if (BaseLevel < 20) NewcomerEXPDROPUP();
- // Daily rewards (always the last)
+ // Daily rewards (The first with dialog interactions)
daily_login_bonus_handler();
+
+ // Thanksgiving Event
+ sThanksgiving();
end;
}
diff --git a/npc/commands/event.txt b/npc/commands/event.txt
index 61caed24b..3104ef49d 100644
--- a/npc/commands/event.txt
+++ b/npc/commands/event.txt
@@ -61,6 +61,8 @@ function script sClear {
DelAccRegFromEveryPlayer("#PATRICK_DAY");
DelAccRegFromEveryPlayer("#PATRICK_CTRL");
DelAccRegFromEveryPlayer("#TMW2_LOGINBONUS");
+ DelAccRegFromEveryPlayer("#THANKS_DAY");
+ DelAccRegFromEveryPlayer("#THANKS_STREAK");
// We must remove any event drop
charcommand("@reloadmobdb");
diff --git a/npc/functions/event.txt b/npc/functions/event.txt
index d27be4f67..4e4a30c81 100644
--- a/npc/functions/event.txt
+++ b/npc/functions/event.txt
@@ -66,6 +66,72 @@ OnCleanUp:
end;
}
+function script sThanksgiving {
+ // Variables:
+ // #THANKS_DAY
+ // #THANKS_STREAK
+ // @thanks_card
+
+ // Already spinned
+ if (#THANKS_DAY == gettime(5) || $EVENT$ != "Thanksgiving")
+ return;
+
+ // Not spinned yet
+ showavatar 1102;
+ mes l(".:: Thanksgiving ::.");
+ mesc l("Spin daily the card to get prizes!");
+
+ select
+ l("SPIN!"),
+ l("Later");
+ mes "";
+ if (@menu == 2) {
+ setskin "";
+ closeclientdialog;
+ return;
+ }
+ // Spin it
+ // Your prize is saved in .@luck. Rigged against fruits
+ .@luck=rand2(0,11);
+ .@luck=(.@luck == 10 ? rand2(0,11) : .@luck);
+ // A fruit before 7 days: rig to Arcmage or to blueprint
+ if (.@luck == 10 && #THANKS_STREAK < 7)
+ .@luck+=any(-1,1);
+ // Extra spins
+ .@extra=rand2(1,3);
+ .@spins=.@extra*11+.@luck;
+ //.@extra=0;
+
+ // Show the spins
+ for (.@i=0;.@i<=.@spins;.@i++) {
+ .@cur=(.@i%11);
+ showavatar 1103+.@cur;
+ sleep2(60);
+ }
+ mes l(".:: Congratulations ::.");
+ //#THANKS_DAY = gettime(5)
+ mes l("You got a %d", .@luck);
+ mesf "Spins: %d/%d (cur %d extra %d)", .@i, .@spins, .@cur, .@extra;
+ next;
+
+ // Close
+ setskin "";
+ closeclientdialog;
+ return;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
000-0,0,0,0 script #EventCore NPC_HIDDEN,{
end;