diff options
author | Jesusaves <cpntb1@ymail.com> | 2024-04-18 16:32:50 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2024-04-18 16:32:50 -0300 |
commit | bec368e8495b641dc7bb364910d983c72642bfce (patch) | |
tree | 8360bfa8792fc8ec505c6b7c71946fdc80c870c8 /npc/001-4/lilica.txt | |
parent | f419be1045429752abc2d39bb6cec5b7ce94568c (diff) | |
download | serverdata-bec368e8495b641dc7bb364910d983c72642bfce.tar.gz serverdata-bec368e8495b641dc7bb364910d983c72642bfce.tar.bz2 serverdata-bec368e8495b641dc7bb364910d983c72642bfce.tar.xz serverdata-bec368e8495b641dc7bb364910d983c72642bfce.zip |
Easter Rewards reestructuration. May the games begin, and may the blood flow.
Diffstat (limited to 'npc/001-4/lilica.txt')
-rw-r--r-- | npc/001-4/lilica.txt | 133 |
1 files changed, 128 insertions, 5 deletions
diff --git a/npc/001-4/lilica.txt b/npc/001-4/lilica.txt index 5d7f152e5..44c3e741f 100644 --- a/npc/001-4/lilica.txt +++ b/npc/001-4/lilica.txt @@ -3,6 +3,10 @@ // Jesusalva // Description: // Lilica is TMW-BR Scary Scary Easter Bunny and will help your trading stuff. +// Data layout: +// SQuest_Easter +// (year of eggshell hat, strange coin limit, limited shop purchases) +// Strage Coin Limit: 500, or last year + 100, the bigger of both 001-4,139,151,0 script Lilica#easter NPC_EASTER,{ mesn; @@ -16,6 +20,7 @@ l("Scary..........."), -, l("Trade Silver Eggs"), L_Silver, l("Trade Golden Eggs"), L_Golden, + rif(getq(SQuest_Easter) == gettime(7), l("Limited Shop")), L_Limited, rif(getq(SQuest_Easter) != gettime(7), l("I want an Eggshell Hat!")), L_Quest, l("View LeaderBoard"), L_Leader; close; @@ -26,6 +31,9 @@ L_Silver: close; L_Golden: + mes l("You can still purchase %d %s.", getq2(SQuest_Easter), + getitemlink(StrangeCoin)); + next; openshop "#eastershop2"; closedialog; close; @@ -63,7 +71,7 @@ L_QuestDone: delitem GoldenEasteregg, 40; delitem SilverEasteregg, 10; if (rand2(10000) < 100) goto L_Unlucky; - setq SQuest_Easter, gettime(7), min(500, getq2(SQuest_Easter)+100); + setq SQuest_Easter, gettime(7), min(500, getq2(SQuest_Easter)+100), 0; npctalk3 l("Strange Coins stock on shops was restored!"); getnameditem(.@Hat, strcharinfo(0)); mesn; @@ -80,6 +88,7 @@ L_Unlucky: mes l("Better luck next time!\""); close; +// Leaderboard functions, and initialization OnClock0100: OnClock1300: if ($EVENT$ == "Easter") @@ -93,6 +102,109 @@ OnInit: if ($EVENT$ == "Easter") sEaster(); end; + +// Special shop functions +function EEX_check { + .@tier = getarg(0); // Minimum reward level + .@clas = getarg(1); // EEX code + .@preq = getarg(2, 0); // Pre-requisite purchase + + if (!.@clas || .@clas == .@preq) return false; // Fail-safe + + .@s = getq3(SQuest_Easter); + .@lv = (TOP3AVERAGELVL() / 25) + $GAME_STORYLINE; + + if (.@preq) + return (!(.@s & .@clas) && .@lv >= .@tier && (.@s & .@preq)); + else + return (!(.@s & .@clas) && .@lv >= .@tier); +} + +function EEX_trade { + .@clas = getarg(2); // Easter EXchange code (EEX) + .@item = getarg(1); // Item ID + .@pric = getarg(0); // Price in Golden Eggs + + if (!.@item || !.@clas) return; // Fail-safe + if (countitem(GoldenEasteregg) < .@pric) { + mesc l("You only have %d/%d %s, so the transaction was cancelled.", countitem(GoldenEasteregg), .@pric, getitemlink(GoldenEasteregg)), 1; + close; // TERMINATE the script + } + + inventoryplace .@item, 1; // may TERMINATE the script + delitem GoldenEasteregg, .@pric; + setq3 SQuest_Easter, getq3(SQuest_Easter) | .@clas; + getitem .@item, 1; + return; +} + +L_Limited: + mes l("You can only make each purchase only. Some purchases unlock other purchases."); + mesc l("The limited shop will not be available once event ends."), 1; + mesc l("Trade here will lower your ranking on Easter event. Be careful."), 1; + mes l("Current golden eggs: %s", fnum(countitem(GoldenEasteregg))); + menuint + l("Nothing, thanks."), -1, + rif(EEX_check(1, EEX_bronze), + l("Bronze Gift (%d eggs)", 50)), EEX_bronze, + rif(EEX_check(3, EEX_silver, EEX_bronze), + l("Silver Gift (%d eggs)", 100)), EEX_silver, + rif(EEX_check(5, EEX_golden, EEX_silver), + l("Golden Gift (%d eggs)", 150)), EEX_golden, + rif(EEX_check(7, EEX_prism, EEX_golden), + l("Prism Gift (%d eggs)", 250)), EEX_prism, + rif(EEX_check(9, EEX_supreme, EEX_prism), + l("Supreme Gift (%d eggs)", 500)), EEX_supreme, + + rif(EEX_check(2, EEX_gapple), + l("Golden Apple (%d eggs)", 35)), EEX_gapple, + rif(EEX_check(4, EEX_napple, EEX_gapple), + l("Manapple (%d eggs)", 75)), EEX_napple, + rif(EEX_check(6, EEX_elixir, EEX_napple), + l("Elixir of Life (%d eggs)", 150)), EEX_elixir, + rif(EEX_check(8, EEX_dapple, EEX_elixir), + l("Divine Apple (%d eggs)", 300)), EEX_dapple, + rif(EEX_check(10, EEX_mapple, EEX_dapple), + l("Magic Apple (%d eggs)", 300)), EEX_mapple, + + rif(EEX_check(0, EEX_merc1), + l("1 ★ Mercenary (%d eggs)", 20)), EEX_merc1, + rif(EEX_check(3, EEX_merc2, EEX_merc1), + l("2 ★ Mercenary (%d eggs)", 40)), EEX_merc2, + rif(EEX_check(6, EEX_merc3, EEX_merc2), + l("3 ★ Mercenary (%d eggs)", 60)), EEX_merc3, + rif(EEX_check(9, EEX_merc4, EEX_merc3), + l("4 ★ Mercenary (%d eggs)", 80)), EEX_merc4, + rif(EEX_check(11, EEX_merc5, EEX_merc4), + l("5 ★ Mercenary (%d eggs)", 100)), EEX_merc5, + + l("I have to go."), -1; + + mes ""; + switch (@menuret) { + case EEX_bronze: EEX_trade( 50, BronzeGift, EEX_bronze); break; + case EEX_silver: EEX_trade( 100, SilverGift, EEX_silver); break; + case EEX_golden: EEX_trade( 150, GoldenGift, EEX_golden); break; + case EEX_prism: EEX_trade( 250, PrismGift, EEX_prism); break; + case EEX_supreme: EEX_trade( 500, SupremeGift, EEX_supreme); break; + + case EEX_gapple: EEX_trade( 35, GoldenApple, EEX_gapple); break; + case EEX_napple: EEX_trade( 75, Manapple, EEX_napple); break; + case EEX_elixir: EEX_trade( 150, ElixirOfLife, EEX_elixir); break; + case EEX_dapple: EEX_trade( 300, DivineApple, EEX_dapple); break; + case EEX_mapple: EEX_trade( 300, MagicApple, EEX_mapple); break; + + case EEX_merc1: EEX_trade( 20, MercBoxAA, EEX_merc1); break; + case EEX_merc2: EEX_trade( 40, MercBoxBB, EEX_merc2); break; + case EEX_merc3: EEX_trade( 60, MercBoxCC, EEX_merc3); break; + case EEX_merc4: EEX_trade( 80, MercBoxDD, EEX_merc4); break; + case EEX_merc5: EEX_trade( 100, MercBoxEE, EEX_merc5); break; + + default: closeclientdialog; close; + } + mesc l("Enjoy your purchase!"), 3; + next; + goto L_Limited; } function script EasterCoinCheck { @@ -158,11 +270,22 @@ OnInit: sellitem .Hat,200; sellitem .PrevHat,500; + // Determine the current game shift + // Range: 0 ~ 12 (Roughly) + .@lv = (TOP3AVERAGELVL() / 25) + $GAME_STORYLINE; + .@ol = max(1, 12-.@lv); // The opposite from the above function + // Rare and not-so-rare Items - sellitem MercBoxE,1500; - sellitem MercBoxD,1000; - sellitem MercBoxC,500; - sellitem Boots,450; + if (.@lv >= 4) + sellitem MercBoxE,125*.@ol; + if (.@lv >= 3) + sellitem MercBoxD,80*.@ol; + if (.@lv >= 2) + sellitem MercBoxC,40*.@ol; + if (.@lv >= 1) + sellitem Boots,37*.@ol; + + // These are better limited to a max amount of purchases sellitem BronzeGift,100; sellitem BunnyEars,50; sellitem StrangeCoin,10; |