diff options
author | Fedja Beader <fedja@protonmail.ch> | 2025-04-29 20:15:24 +0200 |
---|---|---|
committer | Fedja Beader <fedja@protonmail.ch> | 2025-05-02 10:50:58 +0200 |
commit | 268f42b1d1ead1be8406c1717c9f0934d79a45e3 (patch) | |
tree | 963451047a295c73173848c6c86877c9a57d0a72 | |
parent | df8cce5728bdf0a3155e6412a39cd7544570a1db (diff) | |
download | serverdata-lilica_yeartime.tar.gz serverdata-lilica_yeartime.tar.bz2 serverdata-lilica_yeartime.tar.xz serverdata-lilica_yeartime.zip |
lilica: use GETTIME_YEAR named constant instead of 7lilica_yeartime
+ failed attempt to deduplicate the arrays. (initially I wanted to
setarray in OnInit, but then realise this would cause an unused
array to float around most of the year. Add a function to get the
hat, with year as parameter?
-rw-r--r-- | npc/001-4/lilica.txt | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/npc/001-4/lilica.txt b/npc/001-4/lilica.txt index 9e5c78ac0..31e14bc32 100644 --- a/npc/001-4/lilica.txt +++ b/npc/001-4/lilica.txt @@ -20,8 +20,8 @@ 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, + rif(getq(SQuest_Easter) == gettime(GETTIME_YEAR), l("Limited Shop")), L_Limited, + rif(getq(SQuest_Easter) != gettime(GETTIME_YEAR), l("I want an Eggshell Hat!")), L_Quest, l("View LeaderBoard"), L_Leader; close; @@ -53,8 +53,9 @@ L_Leader: close; L_Quest: + // Every year you get a different hat setarray .@Seasonal, EggshellHat, VioletEggshellHat, YellowEggshellHat, RedEggshellHat, GreenEggshellHat, CyanEggshellHat, OrangeEggshellHat, BlueEggshellHat; - .@Hat=.@Seasonal[gettime(7)%8]; // Magically choose the hat from the array + .@currentHat = .@Seasonal[gettime(GETTIME_YEAR) % getarraysize(.@Seasonal)]; mesn; mesq l("Good choice! This year we're having a @@!", getitemlink(.@Hat)); next; @@ -67,13 +68,13 @@ L_Quest: close; L_QuestDone: - inventoryplace .@Hat, 1; + inventoryplace .@currentHat, 1; delitem GoldenEasteregg, 40; delitem SilverEasteregg, 10; if (rand2(10000) < 100) goto L_Unlucky; - setq SQuest_Easter, gettime(7), min(500, getq2(SQuest_Easter)+100), 0; + setq SQuest_Easter, gettime(GETTIME_YEAR), min(500, getq2(SQuest_Easter)+100), 0; npctalk3 l("Strange Coins stock on shops was restored!"); - getnameditem(.@Hat, strcharinfo(0)); + getnameditem(.@currentHat, strcharinfo(0)); mesn; mesq l("Here you go! Happy easter! Bhop bhop!"); close; @@ -336,12 +337,14 @@ OnPayFunds: OnInit: tradertype(NST_CUSTOM); setarray .@Seasonal, EggshellHat, VioletEggshellHat, YellowEggshellHat, RedEggshellHat, GreenEggshellHat, CyanEggshellHat, OrangeEggshellHat, BlueEggshellHat; - .Hat=.@Seasonal[(gettime(7)+1)%8]; // Magically choose the hat from the array - .PrevHat=.@Seasonal[(gettime(7)-1)%8]; // Magically choose the hat from the array - - // Seasonal item - sellitem .Hat,200; - sellitem .PrevHat,500; + // Every year you can also buy next and previous year's hat. + // For a hefty markup. + .@nextHat = .@Seasonal[(gettime(GETTIME_YEAR)+1) % getarraysize(.@Seasonal)]; + .@prevHat = .@Seasonal[(gettime(GETTIME_YEAR)-1) % getarraysize(.@Seasonal)]; + + //.@Seasonal item + sellitem .@nextHat,200; + sellitem .@prevHat,500; // Determine the current game shift // Range: 0 ~ 12 (Roughly) |