summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-01-08 02:37:23 -0300
committerJesusaves <cpntb1@ymail.com>2021-01-08 02:37:23 -0300
commit516cd42dccb974451e58accdae0c7dcbbf4b3df1 (patch)
tree0d22ec6d7f33d7375e43035d8e429f5e3bb466e7
parent35cae09f141d065d4dcb9d38dfac58ede81ce4d0 (diff)
downloadserverdata-516cd42dccb974451e58accdae0c7dcbbf4b3df1.tar.gz
serverdata-516cd42dccb974451e58accdae0c7dcbbf4b3df1.tar.bz2
serverdata-516cd42dccb974451e58accdae0c7dcbbf4b3df1.tar.xz
serverdata-516cd42dccb974451e58accdae0c7dcbbf4b3df1.zip
Rewrite some internal functions and structure to be lighter (optmization)
-rw-r--r--npc/003-0-1/hiddenwarp.txt9
-rw-r--r--npc/003-1/sewer.txt9
-rw-r--r--npc/003-2-1/demure.txt8
-rw-r--r--npc/005-2-1/note.txt8
-rw-r--r--npc/006-4-1/painting.txt8
-rw-r--r--npc/017-1/paxel.txt8
-rw-r--r--npc/functions/clientversion.txt11
-rw-r--r--npc/functions/util.txt17
8 files changed, 34 insertions, 44 deletions
diff --git a/npc/003-0-1/hiddenwarp.txt b/npc/003-0-1/hiddenwarp.txt
index d6f339b58..98874a9ac 100644
--- a/npc/003-0-1/hiddenwarp.txt
+++ b/npc/003-0-1/hiddenwarp.txt
@@ -9,13 +9,6 @@
OnTouch:
warp "003-1", 49, 24;
- .@q=getq(General_EasterEggs);
-
- if (!(.@q & EE_MAGICSCHOOL)) {
- setq General_EasterEggs, .@q|EE_MAGICSCHOOL;
- dispbottom l("For finding an Easter Egg, you got Strange Coins!");
- getitem StrangeCoin, 3;
- }
-
+ RegEasterEgg(EE_MAGICSCHOOL, 3);
end;
}
diff --git a/npc/003-1/sewer.txt b/npc/003-1/sewer.txt
index b490f9923..5f4c6f320 100644
--- a/npc/003-1/sewer.txt
+++ b/npc/003-1/sewer.txt
@@ -44,13 +44,6 @@
OnTouch:
warp "003-9-1", 27, 37;
- .@q=getq(General_EasterEggs);
-
- if (!(.@q & EE_THEATER)) {
- setq General_EasterEggs, .@q|EE_THEATER;
- dispbottom l("For finding an Easter Egg, you got Strange Coins!");
- getitem StrangeCoin, 2;
- }
-
+ RegEasterEgg(EE_THEATER, 2);
end;
}
diff --git a/npc/003-2-1/demure.txt b/npc/003-2-1/demure.txt
index 56199ead3..35b532522 100644
--- a/npc/003-2-1/demure.txt
+++ b/npc/003-2-1/demure.txt
@@ -5,13 +5,7 @@
003-2-1,51,41,0 script NotSoBot NPC_FEMALE,{
- .@q=getq(General_EasterEggs);
-
- if (!(.@q & EE_DEMURE)) {
- setq General_EasterEggs, .@q|EE_DEMURE;
- dispbottom l("For finding an Easter Egg, you got Strange Coins!");
- getitem StrangeCoin, 5;
- }
+ RegEasterEgg(EE_DEMURE, 5);
// Let's try without freeloop
mesn any("NotSoBot", "Demure");
diff --git a/npc/005-2-1/note.txt b/npc/005-2-1/note.txt
index 6add835ba..c77c50fb6 100644
--- a/npc/005-2-1/note.txt
+++ b/npc/005-2-1/note.txt
@@ -7,13 +7,7 @@
005-2-1,41,33,0 script Note#saxsocave NPC_PAPER_NOTE,{
mesc l("I leave this basement that start to be too dangerous!");
- .@q=getq(General_EasterEggs);
-
- if (!(.@q & EE_SAXSO)) {
- setq General_EasterEggs, .@q|EE_SAXSO;
- dispbottom l("For finding an Easter Egg, you got Strange Coins!");
- getitem StrangeCoin, 5;
- }
+ RegEasterEgg(EE_SAXSO, 5);
close;
OnInit:
diff --git a/npc/006-4-1/painting.txt b/npc/006-4-1/painting.txt
index 8a3cfb1d5..82172d304 100644
--- a/npc/006-4-1/painting.txt
+++ b/npc/006-4-1/painting.txt
@@ -3,13 +3,7 @@
// Jesusalva
006-4-1,59,29,0 script #jakPortrait1 NPC_NO_SPRITE,{
- .@q=getq(General_EasterEggs);
-
- if (!(.@q & EE_JAK1)) {
- setq General_EasterEggs, .@q|EE_JAK1;
- dispbottom l("For finding an Easter Egg, you got Strange Coins!");
- getitem StrangeCoin, 1;
- }
+ RegEasterEgg(EE_JAK1, 1);
mesc ".:: " + l("Researcher Jak's Residence") + " ::.";
mes "";
mesc l("And his sister,");
diff --git a/npc/017-1/paxel.txt b/npc/017-1/paxel.txt
index 0d1df6687..8a461c23f 100644
--- a/npc/017-1/paxel.txt
+++ b/npc/017-1/paxel.txt
@@ -235,15 +235,9 @@ OnOmattizator4:
addtimer(100, "Paxel::OnOmattizator");
end;
}
- .@q=getq(General_EasterEggs);
+ RegEasterEgg(EE_PRSM, 3);
npctalk3 l("DIE!");
- if (!(.@q & EE_PRSM)) {
- setq General_EasterEggs, .@q|EE_PRSM;
- dispbottom l("For finding an Easter Egg, you got Strange Coins!");
- getitem StrangeCoin, 3;
- }
-
slide 130, 23;
emotion E_FURIOUS;
die();
diff --git a/npc/functions/clientversion.txt b/npc/functions/clientversion.txt
index 2d386a21f..c36a12f3a 100644
--- a/npc/functions/clientversion.txt
+++ b/npc/functions/clientversion.txt
@@ -1064,6 +1064,17 @@ function script clientupdater {
else if (strcharinfo(0) == "Woody")
getitem StrangeCoin, 20;
}
+ // Easter Eggs
+ // qua jul 29 06:52:00 BRT 2020
+ if (UPDATE < 1610083840) {
+ UPDATE=1610083840;
+ .@q=getq(General_EasterEggs);
+ if (.@q) {
+ setq General_EasterEggs, 1, .@q, bitmask_count(.@q);
+ dispbottom l("Easter Egg quest updated. Total found: %02d/06",
+ bitmask_count(.@q));
+ }
+ }
// :// End of Regular Update System
////////////////////////////////////
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 {