From d8370fe103747984ce941b30c10e6221ecd029c5 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 28 Oct 2019 00:31:37 -0300 Subject: Thanksgiving card spinner (no effects) --- npc/003-3/malindou.txt | 5 +++- npc/commands/event.txt | 2 ++ npc/functions/event.txt | 66 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3-70-g09d2