summaryrefslogtreecommitdiff
path: root/npc/functions
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/functions
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/functions')
-rw-r--r--npc/functions/event.txt66
1 files changed, 66 insertions, 0 deletions
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;