From 516cd42dccb974451e58accdae0c7dcbbf4b3df1 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 8 Jan 2021 02:37:23 -0300 Subject: Rewrite some internal functions and structure to be lighter (optmization) --- npc/functions/util.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'npc/functions/util.txt') diff --git a/npc/functions/util.txt b/npc/functions/util.txt index 042a9adb6..efd46e75b 100644 --- a/npc/functions/util.txt +++ b/npc/functions/util.txt @@ -1089,6 +1089,23 @@ function script NewcomerEXPDROPUP { return .@BONUS; } +// Easter Egg +// RegEasterEgg(EE_CODE, {CoinsAmount=3}) +function script RegEasterEgg { + .@code=getarg(0); + .@coin=getarg(1,3); + .@q=getq2(General_EasterEggs); + + if (!(.@q & .@code)) { + setq1 General_EasterEggs, 1; + setq2 General_EasterEggs, .@q|.@code; + dispbottom l("For finding an Easter Egg, you got Strange Coins!"); + getitem StrangeCoin, 2; + setq3 General_EasterEggs, bitmask_count(.@q|.@code); + } + return; +} + // Special function which makes a date as a number // numdate( - ) function script numdate { -- cgit v1.2.3-70-g09d2