diff options
Diffstat (limited to 'npc/001-4')
-rw-r--r-- | npc/001-4/lilica.txt | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/npc/001-4/lilica.txt b/npc/001-4/lilica.txt index 509452c92..1e6ffc296 100644 --- a/npc/001-4/lilica.txt +++ b/npc/001-4/lilica.txt @@ -16,7 +16,7 @@ l("Scary..........."), -, l("Trade Silver Eggs"), L_Silver, l("Trade Golden Eggs"), L_Golden, - rif(EASTER_EVENT != gettime(7),l("I want an Eggshell Hat!")), L_Quest, + rif(getq(SQuest_Easter) != gettime(7), l("I want an Eggshell Hat!")), L_Quest, l("View LeaderBoard"), L_Leader; close; @@ -63,7 +63,8 @@ L_QuestDone: delitem GoldenEasteregg, 40; delitem SilverEasteregg, 10; //if (rand(0, 10000) < 1000) goto L_Unlucky; - EASTER_EVENT=gettime(7); + setq SQuest_Easter, gettime(7), 0; + //EASTER_EVENT=gettime(7); // The code below not allow hat to leave user account. A bad idea here so I left commented. //getitembound(.@Hat, 1, 1); getnameditem(.@Hat, strcharinfo(0)); @@ -97,6 +98,27 @@ OnInit: end; } +function script EasterCoinCheck { + for (.@i=0;.@i < getarraysize(@bought_nameid); .@i++) { + + if (debug || $@GM_OVERRIDE) + debugmes("%dx %s", @bought_quantity[.@i], getitemname(@bought_nameid[.@i])); + + if (@bought_nameid[.@i] == StrangeCoin) { + .@q2=getq2(SQuest_Easter)+@bought_quantity[.@i]; + if (.@q2 > 100) { + dispbottom l("Attempted to buy %d/%d %s, operation cancelled.", + @bought_quantity[.@i], 100-getq2(SQuest_Easter), + getitemlink(StrangeCoin)); + if (TUTORIAL) + dispbottom l("This quota is reset yearly, by completing %s's quest.", b("Lilica")); + end; + } + } + } + return; +} + // Silver Easter Egg exchange. 001-4,139,151,0 trader #eastershop1 NPC_HIDDEN,{ end; @@ -117,7 +139,10 @@ OnCountFunds: OnPayFunds: if( countitem(SilverEasteregg) < @price ) end; - delitem SilverEasteregg,@price; + // Strange Coins are different + EasterCoinCheck(); + // Complete purchase + delitem SilverEasteregg, @price; purchaseok(); end; } @@ -153,7 +178,10 @@ OnCountFunds: OnPayFunds: if( countitem(GoldenEasteregg) < @price ) end; - delitem GoldenEasteregg,@price; + // Strange Coins are different + EasterCoinCheck(); + // Complete purchase + delitem GoldenEasteregg, @price; purchaseok(); end; } |