summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-09-15 16:03:49 -0300
committerJesusaves <cpntb1@ymail.com>2020-09-15 16:03:49 -0300
commit716914f5b74325442b88cb55adc465dda2e38936 (patch)
treec5c828ec39bc7f1529c40f302264b27febd2c1ba
parent6abaef4376959cc33b0e8f11809a8717b722c7a1 (diff)
downloadserverdata-716914f5b74325442b88cb55adc465dda2e38936.tar.gz
serverdata-716914f5b74325442b88cb55adc465dda2e38936.tar.bz2
serverdata-716914f5b74325442b88cb55adc465dda2e38936.tar.xz
serverdata-716914f5b74325442b88cb55adc465dda2e38936.zip
This adds a secondary, temporary scoreboard on Kimarr for CRC's event.
This commit can and should be reverted once the event is over. Bikeshedding alert - The code did not receive the usual review and quality control required to be formally merged on upstream; It is a TEMPORARY commit. This is a modified version of cherry-picking which allows it to be kept for longer.
-rw-r--r--world/map/npc/033-1/kimarr.txt124
-rw-r--r--world/map/npc/commands/numa.txt5
2 files changed, 128 insertions, 1 deletions
diff --git a/world/map/npc/033-1/kimarr.txt b/world/map/npc/033-1/kimarr.txt
index a0da1a9f..76451891 100644
--- a/world/map/npc/033-1/kimarr.txt
+++ b/world/map/npc/033-1/kimarr.txt
@@ -92,6 +92,21 @@ L_ExplainGame:
// dialog starts here if you've asked about it but not done it (@state == 1)
L_Ask:
+ if ($@KIMARR_EVENT)
+ goto L_WithEvent;
+ goto L_WithoutEvent;
+
+L_WithEvent:
+ mes "[Kimarr]";
+ mes "\"So, are you going to try?\"";
+ menu
+ "Yeah, let's start!",L_Game,
+ "Could you explain again?",L_ExplainGame,
+ "Can you tell me who were the most successful Fluffy hunters?",L_ShowRecord,
+ "On the event, who were the most successful Fluffy hunters?",L_CRC_ShowRecord,
+ "Maybe later.",L_Close;
+
+L_WithoutEvent:
mes "[Kimarr]";
mes "\"So, are you going to try?\"";
menu
@@ -148,6 +163,20 @@ L_Full_Inv:
// dialog starts here after you've completed this quest
L_Again:
+ if ($@KIMARR_EVENT)
+ goto L_AgainWithEvent;
+ goto L_AgainWithoutEvent;
+
+L_AgainWithEvent:
+ mes "[Kimarr]";
+ mes "\"Does the hunter " + strcharinfo(0) + " want to hunt some Fluffies again?\"";
+ menu
+ "Yeah!",L_Game,
+ "Can you tell me who were the most successful Fluffy hunters?",L_ShowRecord,
+ "On the event, who were the most successful Fluffy hunters?",L_CRC_ShowRecord,
+ "Not now.",L_Close;
+
+L_AgainWithoutEvent:
mes "[Kimarr]";
mes "\"Does the hunter " + strcharinfo(0) + " want to hunt some Fluffies again?\"";
menu
@@ -357,9 +386,13 @@ S_Clean:
L_MaybeRecordScore:
warp "033-1", 77, 34;
+ set @loop, 0;
+ set @rank, 0;
+ if ($@KIMARR_EVENT)
+ goto L_CRC_MaybeInsertNext;
+ // No event, keep as usual
if ($@Fluffy_Kills < $@Fluffy_Min)
goto L_NotGoodEnough;
- set @rank, 0;
goto L_MaybeInsertNext;
L_MaybeInsertNext:
@@ -430,6 +463,75 @@ L_NextShowNextRecord:
next;
goto L_ShowNextRecord;
+L_CRC_MaybeRecordScore:
+ if ($@Fluffy_Kills < $@Fluffy_Min)
+ goto L_NotGoodEnough;
+ set @rank, 0;
+ set @loop, 0;
+ goto L_MaybeInsertNext;
+
+L_CRC_MaybeInsertNext:
+ if ($@Fluffy_Kills > $Record_CRC_Fluffy_Kills[@rank])
+ goto L_CRC_InsertScore;
+ // you already had a better score
+ if (strcharinfo(0) == $Record_CRC_Fluffy_Name$[@rank])
+ goto L_CRC_MaybeRecordScore;
+ set @rank, @rank + 1;
+ if (@rank == MAX_HIGH_SCORES)
+ goto L_CRC_MaybeRecordScore;
+ goto L_CRC_MaybeInsertNext;
+
+L_CRC_InsertScore:
+ set @loop, @rank;
+ goto L_CRC_FindLastScore;
+
+L_CRC_FindLastScore:
+ // comment this out to allow the player to be in the list more than once
+ // though actually, it might be better just to assume the list is full
+ if (strcharinfo(0) == $Record_CRC_Fluffy_Name$[@loop])
+ goto L_CRC_MoveStuff;
+
+ set @loop, @loop + 1;
+ if (@loop == MAX_HIGH_SCORES)
+ goto L_CRC_MoveStuff;
+ goto L_CRC_FindLastScore;
+
+L_CRC_MoveStuff:
+ if (@loop == @rank)
+ goto L_CRC_FinallyInsertMe;
+ set $Record_CRC_Fluffy_Kills[@loop], $Record_CRC_Fluffy_Kills[@loop - 1];
+ set $Record_CRC_Fluffy_Name$[@loop], $Record_CRC_Fluffy_Name$[@loop - 1];
+ set $Record_CRC_Fluffy_Date$[@loop], $Record_CRC_Fluffy_Date$[@loop - 1];
+ set @loop, @loop - 1;
+ goto L_CRC_MoveStuff;
+
+L_CRC_FinallyInsertMe:
+ set $Record_CRC_Fluffy_Kills[@rank], $@Fluffy_Kills;
+ set $Record_CRC_Fluffy_Name$[@rank], strcharinfo(0);
+ callfunc "time_stamp";
+ set $Record_CRC_Fluffy_Date$[@rank], @ts_date$ + " " + @ts_time$;
+ set @ts_date$, "";
+ set @ts_time$, "";
+ goto L_CRC_MaybeRecordScore;
+
+L_CRC_ShowRecord:
+ set @rank, 0;
+ set @loop, 0;
+ goto L_CRC_ShowNextRecord;
+
+L_CRC_ShowNextRecord:
+ if ($Record_CRC_Fluffy_Kills[@loop] == 0)
+ goto L_Close;
+ mes (@loop + 1) + " - " + $Record_CRC_Fluffy_Name$[@loop] + " - " + $Record_CRC_Fluffy_Kills[@loop] + " Fluffies killed at " + $Record_CRC_Fluffy_Date$[@loop];
+ set @loop, @loop + 1;
+ if (MAX_HIGH_SCORES > 4 && (@loop % 5) == 0 && $Record_CRC_Fluffy_Kills[@loop] > 0)
+ goto L_CRC_NextShowNextRecord;
+ goto L_CRC_ShowNextRecord;
+
+L_CRC_NextShowNextRecord:
+ next;
+ goto L_CRC_ShowNextRecord;
+
L_Close:
// clear all temporary player variables that are not otherwise cleared
@@ -447,3 +549,23 @@ S_Update_Mask:
(QUEST_Barbarians & ~($@Q_Barbarians_MASK)) | (@state << $@Q_Barbarians_SHIFT);
return;
}
+
+function|script|FluffyDebug
+{
+ mes "[Numa]";
+ mes "Please select an action.";
+ menu
+ "Enable/Disable Event Scoreboards", L_Enable,
+ "Reset event scoreboards", L_Reset;
+
+L_Enable:
+ set $@KIMARR_EVENT, !$@KIMARR_EVENT;
+ return;
+
+L_Reset:
+ cleararray $Record_CRC_Fluffy_Kills, 0, MAX_HIGH_SCORES;
+ cleararray $Record_CRC_Fluffy_Name$, "", MAX_HIGH_SCORES;
+ cleararray $Record_CRC_Fluffy_Date$, "", MAX_HIGH_SCORES;
+ gmlog strcharinfo(0) + " wiped Fluffy Hunt Event Scoreboards.";
+ return;
+}
diff --git a/world/map/npc/commands/numa.txt b/world/map/npc/commands/numa.txt
index 5d6f64f0..b8d24aea 100644
--- a/world/map/npc/commands/numa.txt
+++ b/world/map/npc/commands/numa.txt
@@ -127,6 +127,7 @@ L_World:
next;
menu
"Doomsday", L_Doomsday,
+ "Kimarr", L_Fluffy,
"Choose a continent", L_ChooseContinent,
"Close", L_Return;
@@ -142,4 +143,8 @@ L_Valia:
L_Doomsday:
callfunc "DoomsdayDebug";
goto L_Return;
+
+L_Fluffy:
+ callfunc "FluffyDebug";
+ goto L_Return;
}