From d9ef8d92e65ea0680c89118392f0f42a55ac0c85 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 8 Apr 2022 09:25:12 -0300 Subject: Backport Chronos changes. But without personal trading limit. The reason for the personal limit is the existing stacks of points. These should be liquidated before the Evolved merge. (And if not, this means BP costs go up, so.) --- npc/099-7/_import.txt | 2 +- npc/099-7/boss.txt | 3 + npc/099-7/chronos.txt | 177 +++++++++++++++++++++++++++++++++++++++++++ npc/099-7/cronos.txt | 156 -------------------------------------- npc/functions/clear_vars.txt | 6 ++ 5 files changed, 187 insertions(+), 157 deletions(-) create mode 100644 npc/099-7/chronos.txt delete mode 100644 npc/099-7/cronos.txt diff --git a/npc/099-7/_import.txt b/npc/099-7/_import.txt index 998db4ea..081e29c6 100644 --- a/npc/099-7/_import.txt +++ b/npc/099-7/_import.txt @@ -1,4 +1,4 @@ // Map 099-7: Ruined Swamps // This file is generated automatically. All manually added changes will be removed when running the Converter. "npc/099-7/boss.txt", -"npc/099-7/cronos.txt", +"npc/099-7/chronos.txt", diff --git a/npc/099-7/boss.txt b/npc/099-7/boss.txt index 65be12b5..302c7cb2 100644 --- a/npc/099-7/boss.txt +++ b/npc/099-7/boss.txt @@ -730,6 +730,9 @@ L_Done: mes ""; getexp 1000000, 0; warp "027-2", 50, 29; + #CHRONOS = 0; + if ($CHRONOS_STOCK < 3) + $CHRONOS_STOCK = 3; close; } diff --git a/npc/099-7/chronos.txt b/npc/099-7/chronos.txt new file mode 100644 index 00000000..1a0ab6ed --- /dev/null +++ b/npc/099-7/chronos.txt @@ -0,0 +1,177 @@ +// Cronos, the lord of time and apparently a shopkeeper +// There's also Father Time in the GM stuff + +099-7,99,30,0 script Chronos NPC313,{ + function outOfStock; + mesn; + mesq l("I'm Chronos, lord of time, the immortal, the head editor of the Almanach, the... Alright, let's forget that."); + if (BOSS_POINTS < .price) + close; + // Boss Points validation + .@cur=(BOSS_POINTS / .price); + .@dif=.@cur - BOSS_MEDALS; + if (.@dif) { + next; + getitembound BossMedal, .@dif, IBT_ACCOUNT; + BOSS_MEDALS+=.@dif; + mesn; + mesq l("For your deeds, I shall bestow upon you %d %s. Use them wisely, they are the results of your hard effort.", .@dif, getitemlink(BossMedal)); + mesc l("Boss Medals are earned each %s boss points. They are account-bound and cannot be given to other players.", fnum(.price)); + next; + } + + // Check for stock. + // Adding a limit to individual purchases would be a pain so I didn't. + // But code is commented below + //.@cur_date = (gettime(7) * 100 + gettime(6)); + //if (#CHRONOS == .@cur_date) outOfStock(); + if ($CHRONOS_STOCK < 1) outOfStock(); + + // Shopkeeping + mesc l("All things shall pass, but with the limited time you have, please enjoy shopkeeping."); + if (countitem(UnderworldKey)) { + select + l("Thanks."), + l("Do you know what the Underworld Key is for?"); + mes ""; + if (@menu == 2) { + mesn; + mesq l("Yes, I do. But now is not the time. One day, when the event horizon aligns itself and the lazy titans move, then I shall tell you what you need to know."); // lazy titans = The developers and shout out to Kronus from mythology + close; + } + } else { + next; + } + openshop; + closeclientdialog; + close; + +function outOfStock { + mesn; + mesq l("I'm afraid I don't have anything now, please wait until my next travel, or complete the Tree of Knowledge quest for my amusement."); + close; +} + +OnClock0010: + if (gettime(5) == 1) + set $CHRONOS_STOCK, 5; + end; + +OnInit: + tradertype(NST_CUSTOM); + .distance=4; + .price=5000; + if ($CHRONOS_STOCK < 1) + set $CHRONOS_STOCK, 3; + + sellitem MovieCap, 1; + sellitem BlueWolfHelmet, 1; + sellitem CloverHat, 1; + sellitem RabbitEars, 1; + sellitem Goggles, 1; + sellitem LeatherGoggles, 1; + sellitem Crown, 1; + sellitem Cap, 1; + + sellitem GuyFawkesMask, 1; + sellitem WitchDoctorsMask, 1; + sellitem ElfNightcap, 1; + sellitem Sunglasses, 1; + sellitem ChristmasTreeHat, 1; + sellitem SantaBeardHat, 1; + sellitem MoubooHead, 1; + sellitem PaperBag, 1; + sellitem BunchOfParsley, 1; + sellitem SkullMask, 1; + + sellitem SnowGoggles, 1; + sellitem HeartGlasses, 1; + sellitem OperaMask, 1; + sellitem JesterMask, 1; + sellitem WitchHat, 1; + sellitem GoblinMask, 1; + + sellitem ChefHat, 1; + sellitem EskimoHat, 1; + sellitem AFKCap, 1; + sellitem SmileyCap, 1; + + sellitem RedShades, 1; + sellitem GreenShades, 1; + sellitem DarkBlueShades, 1; + sellitem YellowShades, 1; + sellitem LightBlueShades, 1; + sellitem PinkShades, 1; + sellitem BlackShades, 1; + sellitem OrangeShades, 1; + sellitem PurpleShades, 1; + sellitem DarkGreenShades, 1; + + sellitem SnowLauncher, 1; + + sellitem Eyepatch, 2; + sellitem TopHat, 2; + sellitem FunkyHat, 2; + sellitem MushHat, 2; + sellitem ShroomHat, 2; + sellitem ChristmasElfHat, 2; + sellitem FaceMask, 2; + sellitem CaptainsHat, 2; + sellitem TamOShanter, 2; + sellitem BunnyEars, 2; + sellitem PanHat, 2; + sellitem PilotHat, 2; + sellitem CarbonGasMask, 2; + sellitem GroovyHat, 2; + sellitem JazzyHat, 2; + sellitem AnniversaryHat, 2; + sellitem ChicSantaHat, 2; + sellitem ReadingGlasses, 2; + sellitem EggshellHat, 2; + sellitem Pipe, 2; + sellitem ScarabArmlet, 2; + sellitem BlinkingEvil, 2; + sellitem BlinkingEvilRed, 2; + sellitem BlinkingEvilBlue, 2; + sellitem BlinkingEvilPink, 2; + sellitem BlinkingEvilYellow, 2; + sellitem BlinkingHocus, 2; + sellitem GoldenPlatemail, 2; + sellitem Earmuffs, 2; + //sellitem DesertHelmet, 2; // UNRELEASED + + sellitem BlinkingEvilHalloween, 3; + sellitem MoonshroomHat, 3; + sellitem WhiteEvokersRobeBlue, 3; + sellitem BlackEvokersRobeBlue, 3; + sellitem ApprenticeRobe, 3; + sellitem GoldenWarlordPlate, 3; + sellitem MageRing, 3; + + sellitem OverlordsHelmet, 4; + sellitem DarkTalisman, 4; + sellitem Aureole, 4; + sellitem PaladinsHelmet, 4; + sellitem EnchantersAmulet, 4; + sellitem HeartOfIsis, 4; + sellitem BansheeBow, 4; + sellitem BullHelmet, 4; + sellitem AssassinShirt, 4; + sellitem LazuriteRobe, 4; + sellitem DarkHelm, 4; + sellitem UnderworldMask, 4; + sellitem Phylactery, 4; + end; + +OnCountFunds: + setcurrency(countitem(BossMedal)); + end; + +OnPayFunds: + if( countitem(BossMedal) < @price ) + end; + delitem BossMedal, @price; + purchaseok(); + end; +} + diff --git a/npc/099-7/cronos.txt b/npc/099-7/cronos.txt deleted file mode 100644 index c933571c..00000000 --- a/npc/099-7/cronos.txt +++ /dev/null @@ -1,156 +0,0 @@ -// Cronos, the lord of time and apparently a shopkeeper -// There's also Father Time in the GM stuff - -099-7,99,30,0 script Chronos NPC313,{ - mesn; - mesq l("I'm Chronos, lord of time, the immortal, the head editor of the Almanach, the... Alright, let's forget that."); - if (BOSS_POINTS < .price) - close; - // Boss Points validation - .@cur=(BOSS_POINTS / .price); - .@dif=.@cur - BOSS_MEDALS; - if (.@dif) { - next; - getitembound BossMedal, .@dif, IBT_ACCOUNT; - BOSS_MEDALS+=.@dif; - mesn; - mesq l("For your deeds, I shall bestow upon you %d %s. Use them wisely, they are the results of your hard effort.", .@dif, getitemlink(BossMedal)); - mesc l("Boss Medals are earned each %s boss points. They are account-bound and cannot be given to other players.", fnum(.price)); - next; - } - - // Shopkeeping - mesc l("All things shall pass, but with the limited time you have, please enjoy shopkeeping."); - if (countitem(UnderworldKey)) { - select - l("Thanks."), - l("Do you know what the Underworld Key is for?"); - mes ""; - if (@menu == 2) { - mesn; - mesq l("Yes, I do. But now is not the time. One day, when the event horizon aligns itself and the lazy titans move, then I shall tell you what you need to know."); // lazy titans = The developers and shout out to Kronus from mythology - close; - } - } else { - next; - } - openshop; - closeclientdialog; - close; - -OnInit: - tradertype(NST_CUSTOM); - .distance=4; - .price=5000; - - sellitem MovieCap, 1; - sellitem BlueWolfHelmet, 1; - sellitem CloverHat, 1; - sellitem RabbitEars, 1; - sellitem Goggles, 1; - sellitem LeatherGoggles, 1; - sellitem Crown, 1; - sellitem Cap, 1; - - sellitem GuyFawkesMask, 1; - sellitem WitchDoctorsMask, 1; - sellitem ElfNightcap, 1; - sellitem Sunglasses, 1; - sellitem ChristmasTreeHat, 1; - sellitem SantaBeardHat, 1; - sellitem MoubooHead, 1; - sellitem PaperBag, 1; - sellitem BunchOfParsley, 1; - sellitem SkullMask, 1; - - sellitem SnowGoggles, 1; - sellitem HeartGlasses, 1; - sellitem OperaMask, 1; - sellitem JesterMask, 1; - sellitem WitchHat, 1; - sellitem GoblinMask, 1; - - sellitem ChefHat, 1; - sellitem EskimoHat, 1; - sellitem AFKCap, 1; - sellitem SmileyCap, 1; - - sellitem RedShades, 1; - sellitem GreenShades, 1; - sellitem DarkBlueShades, 1; - sellitem YellowShades, 1; - sellitem LightBlueShades, 1; - sellitem PinkShades, 1; - sellitem BlackShades, 1; - sellitem OrangeShades, 1; - sellitem PurpleShades, 1; - sellitem DarkGreenShades, 1; - - sellitem SnowLauncher, 1; - - sellitem Eyepatch, 2; - sellitem TopHat, 2; - sellitem FunkyHat, 2; - sellitem MushHat, 2; - sellitem ShroomHat, 2; - sellitem ChristmasElfHat, 2; - sellitem FaceMask, 2; - sellitem CaptainsHat, 2; - sellitem TamOShanter, 2; - sellitem BunnyEars, 2; - sellitem PanHat, 2; - sellitem PilotHat, 2; - sellitem CarbonGasMask, 2; - sellitem GroovyHat, 2; - sellitem JazzyHat, 2; - sellitem AnniversaryHat, 2; - sellitem ChicSantaHat, 2; - sellitem ReadingGlasses, 2; - sellitem EggshellHat, 2; - sellitem Pipe, 2; - sellitem ScarabArmlet, 2; - sellitem BlinkingEvil, 2; - sellitem BlinkingEvilRed, 2; - sellitem BlinkingEvilBlue, 2; - sellitem BlinkingEvilPink, 2; - sellitem BlinkingEvilYellow, 2; - sellitem BlinkingHocus, 2; - sellitem GoldenPlatemail, 2; - sellitem Earmuffs, 2; - //sellitem DesertHelmet, 2; // UNRELEASED - - sellitem BlinkingEvilHalloween, 3; - sellitem MoonshroomHat, 3; - sellitem WhiteEvokersRobeBlue, 3; - sellitem BlackEvokersRobeBlue, 3; - sellitem ApprenticeRobe, 3; - sellitem GoldenWarlordPlate, 3; - sellitem MageRing, 3; - - sellitem OverlordsHelmet, 4; - sellitem DarkTalisman, 4; - sellitem Aureole, 4; - sellitem PaladinsHelmet, 4; - sellitem EnchantersAmulet, 4; - sellitem HeartOfIsis, 4; - sellitem BansheeBow, 4; - sellitem BullHelmet, 4; - sellitem AssassinShirt, 4; - sellitem LazuriteRobe, 4; - sellitem DarkHelm, 4; - sellitem UnderworldMask, 4; - sellitem Phylactery, 4; - end; - -OnCountFunds: - setcurrency(countitem(BossMedal)); - end; - -OnPayFunds: - if( countitem(BossMedal) < @price ) - end; - delitem BossMedal, @price; - purchaseok(); - end; -} - diff --git a/npc/functions/clear_vars.txt b/npc/functions/clear_vars.txt index 65d21291..537012c8 100644 --- a/npc/functions/clear_vars.txt +++ b/npc/functions/clear_vars.txt @@ -21,6 +21,12 @@ function script ClearVariables { setq Quest_Doomsday, 2; #DD5_TALLY = 0; // Whatever, one is enough } + if (#CHRONOS) { + #CHRONOS = 0; // No longer used + } + if (#X21) { + #X21 = 0; // Flag for old events + } if (#BankAccount) { BankVault += #BankAccount; #BankAccount = 0; -- cgit v1.2.3-60-g2f50