From 68ca62ec5e0dd3baa5c18f83ceae3086043134e7 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Wed, 18 May 2022 00:23:55 -0300 Subject: Fix shop startup sequence so new prices are shown --- db/constants.conf | 1 + npc/001-11/Soren.txt | 1 + npc/003-1/neko.txt | 1 + npc/003-1/shop.txt | 1 + npc/003-5/jeweler.txt | 1 + npc/005-4/shop.txt | 1 + npc/005-6/morgan.txt | 1 + npc/009-3/dangrostra.txt | 1 + npc/012-1/shoppakep.txt | 1 + npc/012-3/alan.txt | 1 + npc/012-5/nicholas.txt | 9 +++++---- npc/017-1/shops.txt | 2 ++ npc/020-5/bracco.txt | 1 + npc/024-9/barkeeper.txt | 1 + npc/025-1/yuko.txt | 1 + npc/029-0/event.txt | 20 +------------------- npc/032-1/episode.txt | 1 + npc/craft/price.txt | 8 ++++---- 18 files changed, 26 insertions(+), 27 deletions(-) diff --git a/db/constants.conf b/db/constants.conf index 7968252f8..7a7330e40 100644 --- a/db/constants.conf +++ b/db/constants.conf @@ -2392,6 +2392,7 @@ constants_db: { BCONFB_DROP: 100 BCONFN_DROP: 7 BCONFD_DROP: 0 + SHOPWAIT: 1750 // Time to wait for price initialization INT_MAX: 2147483647 comment__: "Maze Domain constants" diff --git a/npc/001-11/Soren.txt b/npc/001-11/Soren.txt index c840d92c5..ed3e64f5c 100644 --- a/npc/001-11/Soren.txt +++ b/npc/001-11/Soren.txt @@ -131,6 +131,7 @@ OnInit: setunitdata(.@npcId, UDT_HAIRCOLOR, 18); // Soren Shop + sleep(SHOPWAIT); /* sellitem AnimalBones, 90; sellitem Candy, 35; diff --git a/npc/003-1/neko.txt b/npc/003-1/neko.txt index 554f7d484..c80fdaf79 100644 --- a/npc/003-1/neko.txt +++ b/npc/003-1/neko.txt @@ -73,6 +73,7 @@ OnInit: setunitdata(.@npcId, UDT_HAIRSTYLE, 26); setunitdata(.@npcId, UDT_HAIRCOLOR, 2); + sleep(SHOPWAIT); tradertype(NST_MARKET); sellitem EarthPowder, 12000, 1; sellitem ShortTankTop, 8000, 1; diff --git a/npc/003-1/shop.txt b/npc/003-1/shop.txt index 07c25bc69..f06af1f46 100644 --- a/npc/003-1/shop.txt +++ b/npc/003-1/shop.txt @@ -5,6 +5,7 @@ 003-1,108,110,0 trader Shop#bazar1 NPC_NO_SPRITE,{ OnInit: + sleep(SHOPWAIT); tradertype(NST_MARKET); sellitem YellowDye, -1, 2; diff --git a/npc/003-5/jeweler.txt b/npc/003-5/jeweler.txt index 8b92626b0..a1b2b9dd9 100644 --- a/npc/003-5/jeweler.txt +++ b/npc/003-5/jeweler.txt @@ -193,6 +193,7 @@ OnInit: .sex = G_FEMALE; .distance = 5; + sleep(SHOPWAIT); tradertype(NST_MARKET); sellitem WeddingRing, 5000, 50; sellitem GoldenBlackPearlRing, 500000, 1; // I'm joking of course. Don't tell me you'll pay half MILLION for... this? diff --git a/npc/005-4/shop.txt b/npc/005-4/shop.txt index 01ec2d57d..67e1d5e87 100644 --- a/npc/005-4/shop.txt +++ b/npc/005-4/shop.txt @@ -7,6 +7,7 @@ 005-4,30,37,0 trader Shop#Candor NPC_NO_SPRITE,{ OnInit: + sleep(SHOPWAIT); tradertype(NST_MARKET); sellitem RoundLeatherShield, -1, 2; diff --git a/npc/005-6/morgan.txt b/npc/005-6/morgan.txt index fcc7ff67e..727c3342d 100644 --- a/npc/005-6/morgan.txt +++ b/npc/005-6/morgan.txt @@ -121,6 +121,7 @@ L_Cheat: close; OnInit: + sleep(SHOPWAIT); tradertype(NST_MARKET); sellitem CottonCloth, -1, 7; diff --git a/npc/009-3/dangrostra.txt b/npc/009-3/dangrostra.txt index a6e9c6af2..665cf63f7 100644 --- a/npc/009-3/dangrostra.txt +++ b/npc/009-3/dangrostra.txt @@ -35,6 +35,7 @@ OnInit: .sex = G_MALE; .distance = 5; + sleep(SHOPWAIT); tradertype(NST_MARKET); // Bows (rare) diff --git a/npc/012-1/shoppakep.txt b/npc/012-1/shoppakep.txt index 7967b3742..13fb8f360 100644 --- a/npc/012-1/shoppakep.txt +++ b/npc/012-1/shoppakep.txt @@ -25,6 +25,7 @@ OnInit: .distance = 5; + sleep(SHOPWAIT); tradertype(NST_MARKET); sellitem CottonTrousers, 80000, 1; sellitem CottonSkirt, 40000, 1; diff --git a/npc/012-3/alan.txt b/npc/012-3/alan.txt index b968a5c38..92cfc45e6 100644 --- a/npc/012-3/alan.txt +++ b/npc/012-3/alan.txt @@ -79,6 +79,7 @@ L_Close: OnInit: .sex = G_MALE; .distance = 5; + sleep(SHOPWAIT); tradertype(NST_MARKET); sellitem ShortBow, 8800, 1; diff --git a/npc/012-5/nicholas.txt b/npc/012-5/nicholas.txt index 426733d56..33241971a 100644 --- a/npc/012-5/nicholas.txt +++ b/npc/012-5/nicholas.txt @@ -247,13 +247,14 @@ L_Quiver: OnInit: - tradertype(NST_MARKET); - sellitem Dagger, 600, 5; - sellitem SharpKnife, 450, 10; - .sex = G_MALE; .distance = 5; setarray .WeaponsCraft, WoodenSword, BugSlayer, ShortGladius, RealBronzeGladius, Backsword; + + sleep(SHOPWAIT); + tradertype(NST_MARKET); + sellitem Dagger, 600, 5; + sellitem SharpKnife, 450, 10; end; OnClock0009: diff --git a/npc/017-1/shops.txt b/npc/017-1/shops.txt index b1c2e9a11..c74e1c0be 100644 --- a/npc/017-1/shops.txt +++ b/npc/017-1/shops.txt @@ -20,6 +20,7 @@ OnInit: .sex = G_MALE; .distance = 4; + sleep(SHOPWAIT); tradertype(NST_MARKET); sellitem LOFCoin, -1, 1; @@ -73,6 +74,7 @@ OnInit: .sex = G_FEMALE; .distance = 4; + sleep(SHOPWAIT); tradertype(NST_MARKET); sellitem TrainingWand, -1, 3; diff --git a/npc/020-5/bracco.txt b/npc/020-5/bracco.txt index 72fa3cf99..79692dd15 100644 --- a/npc/020-5/bracco.txt +++ b/npc/020-5/bracco.txt @@ -350,6 +350,7 @@ OnInit: setunitdata(.@npcId, UDT_HAIRSTYLE, 26); setunitdata(.@npcId, UDT_HAIRCOLOR, 2); + sleep(SHOPWAIT); tradertype(NST_MARKET); sellitem LeatherShirt, -1, 1; sellitem LeatherShield, 5000, 1; diff --git a/npc/024-9/barkeeper.txt b/npc/024-9/barkeeper.txt index 85a5a47e2..2bdd41970 100644 --- a/npc/024-9/barkeeper.txt +++ b/npc/024-9/barkeeper.txt @@ -12,6 +12,7 @@ close; OnInit: + sleep(SHOPWAIT); tradertype(NST_MARKET); sellitem DwarvenSake, 1100, 1; diff --git a/npc/025-1/yuko.txt b/npc/025-1/yuko.txt index a8e8b4b5a..f48e1dbce 100644 --- a/npc/025-1/yuko.txt +++ b/npc/025-1/yuko.txt @@ -27,6 +27,7 @@ OnInit: .sex = G_MALE; .distance = 4; + sleep(SHOPWAIT); tradertype(NST_MARKET); sellitem InsuranceContract, -1, 1; sellitem HomunResetPotion, -1, 5; diff --git a/npc/029-0/event.txt b/npc/029-0/event.txt index dad86dfa6..8b565dbeb 100644 --- a/npc/029-0/event.txt +++ b/npc/029-0/event.txt @@ -73,6 +73,7 @@ OnInit: .distance=5; .sex=G_MALE; + sleep(SHOPWAIT); sellitem Coal, -1, 50+($FIRESOFSTEAM*3-3); sellitem LeatherPatch, 800, 45+($FIRESOFSTEAM*3-3); sellitem RawLog, -1, 40+($FIRESOFSTEAM*3-3); @@ -130,25 +131,6 @@ OnInit: if (!$BETASERVER && !debug) disablenpc .name$; - - if ($BETASERVER &&!$@FOS_MOBDROP) { - /* This code is overriden by seasons.txt - addmonsterdrop(Scar, DarkCrystal, 500); - addmonsterdrop(Crafty, DarkCrystal, 500); - addmonsterdrop(GiantMutatedBat, DarkCrystal, 550); - addmonsterdrop(Forain, DarkCrystal, 500); - addmonsterdrop(GreenDragon, DarkCrystal, 500); - addmonsterdrop(EliteDuck, DarkCrystal, 550); - addmonsterdrop(Terranite, DarkCrystal, 500); - addmonsterdrop(JackO, DarkCrystal, 550); - addmonsterdrop(RedSkullSlime, DarkCrystal, 500); - addmonsterdrop(Michel, DarkCrystal, 500); - addmonsterdrop(CopperSkullSlime, DarkCrystal, 500); - addmonsterdrop(MonsterGeneral, DarkCrystal, 10000); - */ - setiteminfo(DarkCrystal, ITEMINFO_SELLPRICE, rand2(150, 250)); - $@FOS_MOBDROP=true; - } end; OnClock0001: diff --git a/npc/032-1/episode.txt b/npc/032-1/episode.txt index f028c453c..6e815e202 100644 --- a/npc/032-1/episode.txt +++ b/npc/032-1/episode.txt @@ -432,6 +432,7 @@ OnInit: end; OnInit: + sleep(SHOPWAIT); sellitem Bread, getiteminfo(Bread, ITEMINFO_BUYPRICE)*16/10; sellitem Cheese, getiteminfo(Cheese, ITEMINFO_BUYPRICE)*16/10; sellitem ChamomileTea, getiteminfo(ChamomileTea, ITEMINFO_BUYPRICE)*18/10; diff --git a/npc/craft/price.txt b/npc/craft/price.txt index ad05059cd..72762a1e7 100644 --- a/npc/craft/price.txt +++ b/npc/craft/price.txt @@ -196,11 +196,11 @@ function script fix_cPrice { _fix_cPrice(DarkKnightHelmet); _fix_cPrice(SamuraiHelmet); - // TODO: Verify drops and the new GP exploit - // TODO: Rewrite meltdown forge to similar formula - // Giving 30%~50% instead of 50%~70% - // Max rounded down, Min rounded up + // We're done freeloop(false); + + // Manual fixes (handling _fix_cPrice shortcomings) + setiteminfo(DarkCrystal, ITEMINFO_SELLPRICE, rand2(150, 250)); return; } -- cgit v1.2.3-70-g09d2