From 5a59b18ecdd42d71b272dd2d471bb264b36c493e Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 24 Dec 2022 21:23:25 -0300 Subject: Submodule update, Christmas 2022, Start syntax fixes --- world/map/npc/annuals/2022.txt | 97 ++++++++++++++++++++++++++++++++++++ world/map/npc/annuals/fathertime.txt | 18 +++++-- 2 files changed, 110 insertions(+), 5 deletions(-) (limited to 'world/map/npc/annuals') diff --git a/world/map/npc/annuals/2022.txt b/world/map/npc/annuals/2022.txt index 3c2d4dbb..58b9fa27 100644 --- a/world/map/npc/annuals/2022.txt +++ b/world/map/npc/annuals/2022.txt @@ -286,3 +286,100 @@ OnInit: end; } + +020-1,78,85,0|script|Santa#X2022|200 +{ + mesn l("Santa Claus"); + mesq l("Hey folks! I was using [@@5288|@@] to foil Baltashar attempts to ruin Christmas for the poor kids, but the plan turned against me this time! Hohoho!"); + next; + mesn l("Santa Claus"); + mesq l("That's because I forgot Jack Frost existed, hohoho! So, if you could collect the [@@5288|@@] back to me... Well, you would get a Christmas gift, that's for sure, hohoho!"); + next; + mesn l("Santa Claus"); + mesq l("I recovered "+$XMAS2022+" [@@5288|@@]. From these, you gave me "+XMAS2022+" [@@5288|@@]. Grinchboos have them but they only appear every hour in four maps, and the others were lost to time, so... Do you want to give me some more?"); + next; + menu + "Deliver", L_Deliver, + "Scoreboards", L_Scores, + "I'll get to it.", L_Close; + +L_Deliver: + set XMAS2022, XMAS2022 + countitem(Naftalin); + set $XMAS2022, $XMAS2022 + countitem(Naftalin); + delitem Naftalin, countitem(Naftalin); + set @loop, 0; + set @rank, 0; + goto L_MaybeInsertNext; + +L_MaybeInsertNext: + if (XMAS2022 > $Record_XXXmas_Kills[@rank]) + goto L_InsertScore; + // you already had a better score + if (strcharinfo(0) == $Record_XXXmas_Name$[@rank]) + goto L_Scores; + set @rank, @rank + 1; + if (@rank == MAX_HIGH_SCORES) + goto L_Scores; + goto L_MaybeInsertNext; + +L_InsertScore: + set @loop, @rank; + goto L_FindLastScore; + +L_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_XXXmas_Name$[@loop]) + goto L_MoveStuff; + + set @loop, @loop + 1; + if (@loop == MAX_HIGH_SCORES) + goto L_MoveStuff; + goto L_FindLastScore; + +L_MoveStuff: + if (@loop == @rank) + goto L_FinallyInsertMe; + set $Record_XXXmas_Kills[@loop], $Record_XXXmas_Kills[@loop - 1]; + set $Record_XXXmas_Name$[@loop], $Record_XXXmas_Name$[@loop - 1]; + set $Record_XXXmas_Date$[@loop], $Record_XXXmas_Date$[@loop - 1]; + set @loop, @loop - 1; + goto L_MoveStuff; + +L_FinallyInsertMe: + set $Record_XXXmas_Kills[@rank], XMAS2022; + set $Record_XXXmas_Name$[@rank], strcharinfo(0); + callfunc "time_stamp"; + set $Record_XXXmas_Date$[@rank], @ts_date$ + " " + @ts_time$; + set @ts_date$, ""; + set @ts_time$, ""; + goto L_Scores; + +L_Scores: + set @rank, 0; + set @loop, 0; + goto L_ShowNextRecord; + +L_ShowNextRecord: + if ($Record_XXXmas_Kills[@loop] == 0) + goto L_Close; + mes (@loop + 1) + " - " + $Record_XXXmas_Name$[@loop] + " - " + $Record_XXXmas_Kills[@loop] + " [@@5288|@@] delivered at " + $Record_XXXmas_Date$[@loop]; + set @loop, @loop + 1; + if (MAX_HIGH_SCORES > 4 && (@loop % 5) == 0 && $Record_XXXmas_Kills[@loop] > 0) + goto L_NextShowNextRecord; + goto L_ShowNextRecord; + +L_NextShowNextRecord: + next; + goto L_ShowNextRecord; + +L_Close: + close; +} + +// Override mapflags for Christmas 2022 +033-1|mapflag|town +034-1|mapflag|town +046-1|mapflag|town +047-1|mapflag|town + diff --git a/world/map/npc/annuals/fathertime.txt b/world/map/npc/annuals/fathertime.txt index 0670c3c9..c38eae2a 100644 --- a/world/map/npc/annuals/fathertime.txt +++ b/world/map/npc/annuals/fathertime.txt @@ -7,7 +7,7 @@ OnInit: if (debug >= 2) end; donpcevent strnpcinfo(0) + "::OnTimer20000"; - end; + goto L_Clock; OnTimer20000: donpcevent "#XmasConfig::OnCommandRestartQuest"; @@ -66,6 +66,14 @@ OnClock2313: goto L_Clock; L_Clock: + // Christmas 2022 code, remove it later + areamonster "034-1", 20, 20, 160, 110, "", 1162, 64; + areamonster "033-1", 20, 20, 120, 110, "", 1162, 64; + areamonster "046-1", 20, 20, 160, 115, "", 1162, 64; + areamonster "047-1", 20, 20, 200, 180, "", 1162, 240; + announce "Santa : Ho ho ho, I see a huge movement by the grinchboos!", 0; + + // Official code below: if (gettime(4) == 5) goto L_Friday; if (gettime(4) == 6) @@ -81,18 +89,18 @@ L_Friday: end; L_Pirate: - set $@BLANC, (getusers(1) / 5) + 1; + set $@BLANC, (getusers(1) / 4) + 1; areamonster "001-1", 20, 20, 120, 120, "Blanc's Minion", 1121, $@BLANC, "#HolidayConfig::OnLameShield"; areamonster "002-1", 20, 20, 120, 120, "Blanc's Minion", 1119, $@BLANC, "#HolidayConfig::OnLameShield"; - areamonster "003-4", 20, 20, 170, 120, "Blanc's Minion", 1122, 1, "#HolidayConfig::OnLameHat"; + areamonster "003-4", 20, 20, 170, 120, "Blanc's Minion", 1122, 2, "#HolidayConfig::OnLameHat"; areamonster "004-1", 20, 20, 100, 110, "Blanc's Minion", 1120, $@BLANC, "#HolidayConfig::OnLameShield"; areamonster "007-1", 20, 20, 120, 100, "Blanc's Minion", 1120, $@BLANC, "#HolidayConfig::OnLameShield"; areamonster "011-6", 20, 140, 180, 280, "Blanc's Minion", 1121, $@BLANC, "#HolidayConfig::OnLameShield"; - areamonster "018-1", 20, 20, 180, 100, "Blanc's Minion", 1122, 1, "#HolidayConfig::OnLameHat"; + areamonster "018-1", 20, 20, 180, 100, "Blanc's Minion", 1122, 2, "#HolidayConfig::OnLameHat"; areamonster "041-1", 20, 20, 75, 100, "Blanc's Minion", 1119, $@BLANC, "#HolidayConfig::OnLameShield"; areamonster "042-1", 20, 20, 140, 120, "Blanc's Minion", 1120, $@BLANC, "#HolidayConfig::OnLameShield"; areamonster "043-1", 20, 20, 100, 130, "Blanc's Minion", 1121, $@BLANC, "#HolidayConfig::OnLameShield"; - areamonster "057-1", 20, 60, 150, 100, "Blanc's Minion", 1122, 1, "#HolidayConfig::OnLameHat"; + areamonster "057-1", 20, 60, 150, 100, "Blanc's Minion", 1122, 2, "#HolidayConfig::OnLameHat"; end; OnFriday: -- cgit v1.2.3-60-g2f50