summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2025-06-14 20:42:23 -0300
committerJesusaves <cpntb1@ymail.com>2025-06-14 20:42:23 -0300
commit04c8d5bd37832a4698a38c7adee9bdd55792513d (patch)
tree22ac3c92253f92eb3cf0f04fc5f8c44f4a9bb67e
parentdf06ead82ec81b462cf4f8ee0ca90e3f4be76227 (diff)
downloadserverdata-04c8d5bd37832a4698a38c7adee9bdd55792513d.tar.gz
serverdata-04c8d5bd37832a4698a38c7adee9bdd55792513d.tar.bz2
serverdata-04c8d5bd37832a4698a38c7adee9bdd55792513d.tar.xz
serverdata-04c8d5bd37832a4698a38c7adee9bdd55792513d.zip
The Bazaar can now open, but not all shops are in.
-rw-r--r--db/constants.conf2
-rw-r--r--db/re/item_db.conf6
-rw-r--r--npc/003-1/shop.txt314
-rw-r--r--npc/029-0/event.txt56
-rw-r--r--npc/functions/aurora.txt5
-rw-r--r--npc/functions/event.txt21
-rw-r--r--npc/functions/politics.txt26
-rw-r--r--npc/functions/util.txt5
8 files changed, 362 insertions, 73 deletions
diff --git a/db/constants.conf b/db/constants.conf
index 6ecb676d8..9c6baf0c8 100644
--- a/db/constants.conf
+++ b/db/constants.conf
@@ -1853,6 +1853,7 @@ constants_db: {
NPC_ANGELA2: 238
NPC_DIMOND: 240
NPC_BARD_HARPS: 241
+ NPC_WEIRDSELLER: 242
NPC_VAULT: 243
NPC_INDIGENOUS_YOUNG: 244
NPC_INDIGENOUS_OLD: 245
@@ -2572,6 +2573,7 @@ constants_db: {
BCONFN_DROP: 7
BCONFD_DROP: 0
SHOPWAIT: 1750 // Time to wait for price initialization
+ BAZAARFREQ: 8 // How many weeks between bazaars
INT_MAX: 2147483647
comment__: "Maze Domain constants"
diff --git a/db/re/item_db.conf b/db/re/item_db.conf
index abcc1acf7..476cbaafe 100644
--- a/db/re/item_db.conf
+++ b/db/re/item_db.conf
@@ -1770,7 +1770,7 @@ item_db: (
AegisName: "SnakeEgg"
Name: "Snake Egg"
Type: "IT_HEALING"
- Buy: 400
+ Buy: 350
Sell: 70
Weight: 8
Refine: false
@@ -5112,7 +5112,7 @@ item_db: (
AegisName: "MountainSnakeTongue"
Name: "Mountain Snake Tongue"
Type: "IT_ETC"
- Buy: 200
+ Buy: 222
Sell: 111
Weight: 2
},
@@ -5130,7 +5130,7 @@ item_db: (
AegisName: "CaveSnakeSkin"
Name: "Cave Snake Skin"
Type: "IT_ETC"
- Buy: 600
+ Buy: 450
Sell: 95
Weight: 13
},
diff --git a/npc/003-1/shop.txt b/npc/003-1/shop.txt
index 3a8406c4d..0e3f0a6d3 100644
--- a/npc/003-1/shop.txt
+++ b/npc/003-1/shop.txt
@@ -85,15 +85,103 @@ function script BazaarFunds {
.@maxFund += (FINAL_WINNER ? 50000 : 0);
// [200k] Being the World Hero lets you spend another 100k
.@maxFund += ($MOST_HEROIC$ == strcharinfo(0) ? 100000 : 0);
- // [300k]
+ // [300k] If you finished the Towel Day (Stranger Riddle), add 15k
+ .@maxFund += (getq(LoFQuest_Hitchhiker) >= 2 ? 15000 : 0);
+ // [315k] Town procured bonuses (up to 185k)
+ .@maxFund += min(185000, $BAZAAR_EXTRASTOCK);
+ // [500k] In some specific cases, town procured bonuses can be larger
+ .@leftovr = max(0, $BAZAAR_EXTRASTOCK - 185000);
+ if (!FINAL_WINNER) {
+ .@maxFund += limit(0, .@leftovr, 25000);
+ .@leftovr -= limit(0, .@leftovr, 25000);
+ }
+ if ($MOST_HEROIC$ != strcharinfo(0)) {
+ .@maxFund += limit(0, .@leftovr, 50000);
+ .@leftovr -= limit(0, .@leftovr, 50000);
+ }
+ // [500k]
return .@maxFund;
}
-// Tulimshar Bazaar
-003-1,98,110,0 script Esperia Tiki NPC_TIKI,{
+// Function which handles Bazaar. May terminate script
+function script BazaarPurchase {
+ // Merge both in case M+/MV get fixed/changed
+ @price += @points;
+ // You don't have enough money, simple like that
+ if ( Zeny < @price )
+ end;
+ // This purchase would exceed the Bazaar limit
+ if (TULIM_BAZAAR + @price > BazaarFunds()) {
+ dispbottom l("This purchase would put you %s GP over budget for the current Bazaar.", fnum((TULIM_BAZAAR + @price) - BazaarFunds()));
+ end;
+ }
+ // The Bazaar has closed
+ if ($BAZAAR_TIMER % BAZAARFREQ != 0 && !is_admin()) {
+ dispbottom l("Sorry, but the Bazaar ended and I'm packing things to go home. See you in two months!");
+ end;
+ }
+ // Everything is fine, spend the money
+ Zeny -= @price;
+ TULIM_BAZAAR += @price;
+ // Pay your taxes!
+ PurchaseTaxes();
+ // Signal it may proceed
+ purchaseok();
+ return;
+}
+
+// Enable or Disable Bazaar, move NPCs
+// BazaarToggle( on|off )
+function script BazaarToggle {
+ .@lof = ($BAZAAR_TIMER / BAZAARFREQ) % 2;
+ if (getarg(0)) {
+ // Begin the Bazaar!
+ // Esperia Vendor
+ enablenpc "Foreign Tiki";
+ .@gid = getnpcid("Foreign Tiki");
+ if (.@lof)
+ unitwarp(.@gid, "017-1", 151, 185);
+ else
+ unitwarp(.@gid, "003-1", 98, 110);
+ // Candor Vendor
+ enablenpc "Candor Vendor";
+ setnpcdisplay "Candor Vendor", any(NPC_ELMO_ARTIS, NPC_SAPARTAN);
+ .@gid = getnpcid("Candor Vendor");
+ if (.@lof)
+ unitwarp(.@gid, "017-1", 0, 0);
+ else
+ unitwarp(.@gid, "003-1", 93, 100);
+ // Hurnscald Vendor
+ enablenpc "Hurnscald Vendor";
+ setnpcdisplay "Hurnscald Vendor", any(NPC_OSCAR, NPC_ORC_MAN);
+ .@gid = getnpcid("Hurnscald Vendor");
+ if (.@lof)
+ unitwarp(.@gid, "017-1", 0, 0);
+ else
+ unitwarp(.@gid, "003-1", 102, 111);
+ // Halinarzo Vendor
+ enablenpc "Halinarzo Vendor";
+ setnpcdisplay "Halinarzo Vendor", rand2(244, 248);
+ .@gid = getnpcid("Halinarzo Vendor");
+ if (.@lof)
+ unitwarp(.@gid, "017-1", 0, 0);
+ else
+ unitwarp(.@gid, "003-1", 113, 101);
+ } else {
+ // Close the Bazaar!
+ disablenpc "Foreign Tiki";
+ disablenpc "Candor Vendor";
+ disablenpc "Hurnscald Vendor";
+ disablenpc "Halinarzo Vendor";
+ }
+ return;
+}
+
+// Esperia Vendor
+003-1,98,110,0 script Foreign Tiki NPC_TIKI,{
mesn;
mes l("Aloha! Welcome to my shop! Come to shop!!!");
- mesc l("You can still spend %s GP at Tulimshar Bazaar.", fnum(BazaarFunds() - TULIM_BAZAAR));
+ mesc l("You can still spend %s GP at the Bazaar.", fnum(BazaarFunds() - TULIM_BAZAAR));
next;
closeclientdialog;
npcshopattach(.name$);
@@ -101,44 +189,35 @@ function script BazaarFunds {
goodbye;
close;
-// price( Item , Multiplier=1.0x )
-function price {
- return getiteminfo(getarg(0), ITEMINFO_BUYPRICE) * getarg(1, 10) / 10;
-}
-
OnInit:
- .sex = G_MALE;
+ .sex = G_OTHER;
.distance = 3;
+ sleep(SHOPWAIT);
tradertype(NST_CUSTOM);
sellitem Mashmallow, price(Mashmallow, 12);
- sellitem Coal, price(Coal, 11);
- sellitem RawLog, price(RawLog, 11);
- sellitem WoodenLog, price(WoodenLog, 12);
sellitem AnimalBones, price(AnimalBones, 11);
- sellitem LeatherPatch, price(LeatherPatch, 10);
sellitem Dragonfruit, price(Dragonfruit, 10);
sellitem Lifestone, price(Lifestone, 9);
sellitem ArcmageBoxset, price(ArcmageBoxset, 15);
- sellitem TitaniumOre, price(TitaniumOre, 13);
sellitem ScholarshipBadge, price(ScholarshipBadge, 8);
- sellitem AlchemyBlueprintC, price(AlchemyBlueprintC, 10);
- sellitem EquipmentBlueprintC, price(EquipmentBlueprintC, 10);
+ sellitem AlchemyBlueprintA, price(AlchemyBlueprintA, 10);
+ sellitem EquipmentBlueprintA, price(EquipmentBlueprintA, 10);
+ sellitem AlchemyBlueprintB, price(AlchemyBlueprintB, ($GAME_STORYLINE >= 2 ? 10 : 14));
+ sellitem EquipmentBlueprintB, price(EquipmentBlueprintB, ($GAME_STORYLINE >= 2 ? 10 : 14));
+ sellitem AlchemyBlueprintC, price(AlchemyBlueprintC, ($GAME_STORYLINE >= 3 ? 10 : 14));
+ sellitem EquipmentBlueprintC, price(EquipmentBlueprintC, ($GAME_STORYLINE >= 3 ? 10 : 14));
if ($GAME_STORYLINE >= 4) {
- sellitem AlchemyBlueprintD, price(AlchemyBlueprintD, 10);
- sellitem EquipmentBlueprintD, price(EquipmentBlueprintD, 10);
+ sellitem AlchemyBlueprintD, price(AlchemyBlueprintD, 11);
+ sellitem EquipmentBlueprintD, price(EquipmentBlueprintD, 11);
+ sellitem AlchemyBlueprintE, price(AlchemyBlueprintE, 12);
+ sellitem EquipmentBlueprintE, price(EquipmentBlueprintE, 12);
}
- sellitem EarthPowder, price(EarthPowder, 15);
- if ($GAME_STORYLINE >= 4) {
- sellitem AlchemyBlueprintE, price(AlchemyBlueprintE, 10);
- sellitem EquipmentBlueprintE, price(EquipmentBlueprintE, 10);
- sellitem IridiumOre, price(IridiumOre, 13);
- // Platinum Ore is only stocked if Platinum Mines are liberated
- if ($FORTRESS_STATE)
- sellitem PlatinumOre, price(PlatinumOre, 12);
+ sellitem AncientBlueprint, ($EVENT$ == "Steam" ? 12500 : 16500);
+ if ($GAME_STORYLINE >= 5) {
+ sellitem SaviorBlueprint, price(SaviorBlueprint, 160);
}
- sellitem AncientBlueprint, ($EVENT$ == "Steam" ? 12500 : 18000);
- sellitem EverburnPowder, price(EverburnPowder, 15);
+ disablenpc .name$;
end;
// We need to use NST_CUSTOM so we can reject the trade when over-budget
@@ -151,23 +230,168 @@ OnCountFunds:
/* @price is total cost; @points is if we accept two items as currency. */
OnPayFunds:
- // Merge both in case M+/MV get fixed/changed
- @price += @points;
- // You don't have enough money, simple like that
- if ( Zeny < @price )
- end;
- // This purchase would exceed the Bazaar limit
- if (TULIM_BAZAAR + @price > BazaarFunds()) {
- dispbottom l("This purchase would put you %s GP over budget for the current Bazaar.", fnum((TULIM_BAZAAR + @price) - BazaarFunds()));
- end;
+ BazaarPurchase();
+ end;
+}
+
+
+// Candor Vendor
+003-1,93,100,0 script Candor Vendor NPC_ELMO_ARTIS,{
+ mesn;
+ mes l("Fresh food from Candor! You can't beat the price!");
+ mesc l("You can still spend %s GP at the Bazaar.", fnum(BazaarFunds() - TULIM_BAZAAR));
+ next;
+ closeclientdialog;
+ npcshopattach(.name$);
+ shop .name$;
+ goodbye;
+ close;
+
+OnInit:
+ .sex = G_OTHER;
+ .distance = 3;
+ sleep(SHOPWAIT);
+ tradertype(NST_CUSTOM);
+ sellitem Piberries, price(Piberries, 9);
+ sellitem Moss, price(Moss, 11);
+ sellitem LettuceLeaf, price(LettuceLeaf, 9);
+ sellitem BugLeg, price(BugLeg, 10);
+ sellitem Bread, price(Bread, 8);
+ sellitem Cheese, price(Cheese, 9);
+ sellitem RustyKnife, price(RustyKnife, 9);
+ sellitem Aquada, price(Aquada, 9);
+ sellitem TolchiAmmoBox, price(TolchiAmmoBox, 9);
+ sellitem TrainingAmmoBox, price(TrainingAmmoBox, 8);
+
+ disablenpc .name$;
+ end;
+
+OnCountFunds:
+ setcurrency(Zeny, BazaarFunds() - TULIM_BAZAAR);
+ end;
+
+OnPayFunds:
+ BazaarPurchase();
+ end;
+}
+
+
+// Hurnscald Vendor
+003-1,102,111,0 script Hurnscald Vendor NPC_OSCAR,{
+ mesn;
+ mes l("Hurnscald has all sort of edibles you could imagine!");
+ mesc l("You can still spend %s GP at the Bazaar.", fnum(BazaarFunds() - TULIM_BAZAAR));
+ next;
+ closeclientdialog;
+ npcshopattach(.name$);
+ shop .name$;
+ goodbye;
+ close;
+
+OnInit:
+ .sex = G_OTHER;
+ .distance = 3;
+ sleep(SHOPWAIT);
+ tradertype(NST_CUSTOM);
+ sellitem RawLog, price(RawLog, 11);
+ sellitem WoodenLog, price(WoodenLog, 12);
+
+ sellitem Acorn, price(Acorn, 9);
+ sellitem Plushroom, price(Plushroom, 8);
+ sellitem Chagashroom, price(Chagashroom, 8);
+ sellitem Milk, price(Milk, 10);
+ sellitem SmallMushroom, price(SmallMushroom, 12);
+ sellitem Honey, price(Honey, 15);
+ sellitem Manana, price(Manana, 10);
+ sellitem MoubooSteak, price(MoubooSteak, 11);
+ sellitem ReturnPotion, price(ReturnPotion, 10);
+
+ if ($ARKIM_ST >= 1200)
+ sellitem PiberriesInfusion, price(PiberriesInfusion, 10);
+ if ($ARKIM_ST >= 2600)
+ sellitem FatesPotion, price(FatesPotion, 12);
+ if ($ARKIM_ST >= 4000)
+ sellitem ClothoLiquor, price(ClothoLiquor, 13);
+ if ($ARKIM_ST >= 4700)
+ sellitem LachesisBrew, price(LachesisBrew, 14);
+ if ($ARKIM_ST >= 6600)
+ sellitem AtroposMixture, price(AtroposMixture, 15);
+
+ sellitem ArrowAmmoBox, price(ArrowAmmoBox, 10);
+ sellitem IronAmmoBox, price(IronAmmoBox, 9);
+ if ($ARKIM_ST >= 1400)
+ sellitem CursedAmmoBox, price(CursedAmmoBox, 11);
+ if ($ARKIM_ST >= 2800)
+ sellitem PoisonAmmoBox, price(PoisonAmmoBox, 11);
+
+ disablenpc .name$;
+ end;
+
+OnCountFunds:
+ setcurrency(Zeny, BazaarFunds() - TULIM_BAZAAR);
+ end;
+
+OnPayFunds:
+ BazaarPurchase();
+ end;
+}
+
+
+// Halinarzo Vendor
+003-1,113,101,0 script Halinarzo Vendor NPC_INDIGENOUS_YOUNG,{
+ mesn;
+ mes l("The mines can still yield some ore, and our people work with leather.");
+ mesc l("You can still spend %s GP at the Bazaar.", fnum(BazaarFunds() - TULIM_BAZAAR));
+ next;
+ closeclientdialog;
+ npcshopattach(.name$);
+ shop .name$;
+ goodbye;
+ close;
+
+OnInit:
+ .sex = G_OTHER;
+ .distance = 3;
+ sleep(SHOPWAIT);
+ tradertype(NST_CUSTOM);
+ sellitem CaveSnakeEgg, price(CaveSnakeEgg, 10);
+ sellitem SnakeEgg, price(SnakeEgg, 11);
+ sellitem MountainSnakeEgg, price(MountainSnakeEgg, 11);
+ sellitem CaveSnakeLamp, price(CaveSnakeLamp, 11);
+ sellitem CaveSnakeTongue, price(CaveSnakeTongue, 10);
+ sellitem SnakeTongue, price(SnakeTongue, 11);
+ sellitem MountainSnakeTongue, price(MountainSnakeTongue, 11);
+ sellitem CaveSnakeSkin, price(CaveSnakeSkin, 10);
+ sellitem SnakeSkin, price(SnakeSkin, 11);
+ sellitem MountainSnakeSkin, price(MountainSnakeSkin, 11);
+ sellitem LeatherPatch, price(LeatherPatch, 10);
+
+ sellitem Coal, price(Coal, 11);
+ sellitem IronOre, price(IronOre, 11);
+ sellitem CopperOre, price(CopperOre, 12);
+ sellitem SilverOre, price(SilverOre, 12);
+ sellitem GoldOre, price(GoldOre, 13);
+ sellitem TinOre, price(TinOre, 13);
+ sellitem LeadOre, price(LeadOre, 13);
+ sellitem TitaniumOre, price(TitaniumOre, 13);
+ if ($GAME_STORYLINE >= 4) {
+ sellitem IridiumOre, price(IridiumOre, 13);
+ // Platinum Ore is only stocked if Platinum Mines are liberated
+ if ($FORTRESS_STATE)
+ sellitem PlatinumOre, price(PlatinumOre, 12);
}
- // Everything is fine, spend the money
- Zeny -= @price;
- TULIM_BAZAAR += @price;
- // Pay your taxes!
- PurchaseTaxes();
- // Signal it may proceed
- purchaseok();
+ sellitem EarthPowder, price(EarthPowder, 16);
+ sellitem EverburnPowder, price(EverburnPowder, 15);
+
+ disablenpc .name$;
+ end;
+
+OnCountFunds:
+ setcurrency(Zeny, BazaarFunds() - TULIM_BAZAAR);
+ end;
+
+OnPayFunds:
+ BazaarPurchase();
end;
}
diff --git a/npc/029-0/event.txt b/npc/029-0/event.txt
index 1c9c81509..4f4f840f6 100644
--- a/npc/029-0/event.txt
+++ b/npc/029-0/event.txt
@@ -101,40 +101,50 @@ OnInit:
.@steam /= 2;
sleep(SHOPWAIT);
- sellitem IronOre, -1, 30+(.@steam*3-3);
- sellitem CopperOre, 1000, 20+(.@steam*2-2);
- sellitem SilverOre, 2000, 14+(.@steam*2-2);
- sellitem GoldOre, 3000, 14+(.@steam*2-2);
- sellitem TinOre, 3600, 15+(.@steam*2-2);
- sellitem LeadOre, 4000, 15+(.@steam*2-2);
-
- sellitem RustyKnife, -1, 5+.@steam-1;
+
sellitem TrainingWand, -1, 5+.@steam-1;
sellitem TrainingBow, -1, 5+.@steam-1;
- // Always stock blueprints at initialization time
- sellitem AlchemyBlueprintA, -1, 5+.@steam-1;
- sellitem AlchemyBlueprintB, -1, 4+.@steam-1;
-
- sellitem EquipmentBlueprintA, -1, 5+.@steam-1;
- sellitem EquipmentBlueprintB, -1, 4+.@steam-1;
-
sellitem Bullet, 4, 90000+(.@steam*1000-1000);
- sellitem Bread, -1, 450+.@steam-1;
- sellitem Cheese, -1, 300+.@steam-1;
- sellitem Aquada, -1, 200+.@steam-1;
sellitem WhiteFur, -1, 1+rand2(50)+.@steam;
- sellitem Piberries, -1, 1+rand2(50)+.@steam;
sellitem CherryCake, -1, 1+rand2(50)+.@steam;
- sellitem LettuceLeaf, -1, 1+rand2(50)+.@steam;
- sellitem BugLeg, -1, 1+rand2(50)+.@steam;
sellitem RoastedMaggot, -1, 1+rand2(50)+.@steam;
- sellitem Moss, -1, 1+rand2(50)+.@steam;
- sellitem Milk, -1, 1+rand2(50)+.@steam;
sellitem Root, -1, 40+.@steam;
sellitem ManaPiouFeathers, -1, 1+rand2(300)+.@steam;
+ //600, l("Treasure Map")), 1,
+ //1000, l("Lock Picks")), 2,
+ //2200, l("Return Potion")), 4,
+ //500k, l("Golden Pearl Ring")), 8,
+ //4000, l("Mysterious Bottle")), 16,
+ //15000, l("Ancient Blueprint")), 32,
+ //21000, l("Arcmage Boxset")), 64,
+ //30~50k($ARKIM_ST > 7500, l("Dark Desert Mushroom")),
+
+ // NPC_ELMO_ARTIS / NPC_SAPARTAN -> Candor (Sea Food) OK
+ // NPC_OSCAR / NPC_ORC_MAN -> Hurnscald (Shrooms, Woods, Potions, Arrows) OK
+
+ // NPC_ELVEN_MAN_TRADER -> Nivalis (Ice, cold)
+ // white fur, ice bottle, coffee, merc boxes, purif potion, insurances
+ // anyof(244 - 248) indigenous folks -> Halinarzo (Minerals)
+ // ores and snake parts
+ // NPC_GUGLI -> Tulimshar (Monster Parts and Dyes)
+ // Cactus potions, apana cake,roasted maggot, cherry cake, tonori delight
+ // dyes and random drops
+ // NPC_ARTAXE -> Frostia (Forged Goods)
+ // empty warp crystal,
+ // LOF_TRAVMERC -> LoF (Magic, Science)
+ // manapple, potatoz, dragonfruit, magic apple, maps,
+ // TIKI -> Esperia/Artis (Odd stuff, Rare stuff)
+ // chicken leg, golden apple, divine apple, tea, cake
+ // blueprints
+ // NPC_EURNI / NPC_WEIRDSELLER -> Nowhere (Illegal, Contraband Goods)
+ // death potion, grenades, mysterious fruit (500k),
+
+ // NPC_LYDON: If you have a stand for her
+ // NPC_QONAN (orc facing right)
+
if (!$BETASERVER && !debug)
disablenpc .name$;
end;
diff --git a/npc/functions/aurora.txt b/npc/functions/aurora.txt
index c1eb61f53..8d6f15fe6 100644
--- a/npc/functions/aurora.txt
+++ b/npc/functions/aurora.txt
@@ -851,6 +851,11 @@ function script FYE_Normalize {
setmapflag($REGNUM_BLESSMAP$, mf_bexp, 300);
setmapflag($REGNUM_BLESSMAP$, mf_jexp, 300);
}
+ // Re-open Tulimshar Bazaar if necessary
+ if ($BAZAAR_TIMER % BAZAARFREQ == 0) {
+ sleep(SHOPWAIT + 300);
+ callfunc "BazaarToggle", true;
+ }
return;
}
diff --git a/npc/functions/event.txt b/npc/functions/event.txt
index 6800ce5af..ffa0dd014 100644
--- a/npc/functions/event.txt
+++ b/npc/functions/event.txt
@@ -1010,6 +1010,27 @@ OnClock0000:
$EVENT$="";
}
}
+
+ // Handle Tulimshar Bazaar, which starts on fridays
+ if (.@o == FRIDAY && !.@isinit) {
+ $BAZAAR_TIMER += 1;
+ // Time to close the Bazaar
+ if ($BAZAAR_TIMER % BAZAARFREQ == 1) {
+ $BAZAAR_EXTRASTOCK = 0;
+ DelChrRegFromEveryPlayer("TULIM_BAZAAR");
+ callfunc "BazaarToggle", false;
+ kamibroadcast("Tulimshar Bazaar has ended!");
+ // Time to open the Bazaar
+ } else if ($BAZAAR_TIMER % BAZAARFREQ == 0) {
+ .@lof = ($BAZAAR_TIMER / BAZAARFREQ) % 2;
+ if (.@lof)
+ kamibroadcast("Land of Fire's Bimonthly Bazaar is now open!");
+ else
+ kamibroadcast("Tulimshar's Bimonthly Bazaar is now open!");
+ callfunc "BazaarToggle", true;
+ }
+ }
+
debugmes "EVENT CORE has finished";
end;
}
diff --git a/npc/functions/politics.txt b/npc/functions/politics.txt
index 9450af4f3..d02bb5a7e 100644
--- a/npc/functions/politics.txt
+++ b/npc/functions/politics.txt
@@ -438,6 +438,7 @@ function script POL_Manage {
rif(.@left >= 6, l("Exile a player")), 70,
rif(.@left >= 6, l("Revert a player exile")), 71,
rif(.@left, l("Raise server wide EXP")), 80,
+ rif(.@left, l("Invest in Tulimshar Bazaar")), 83,
rif(Zeny > $ALLIANCE_TAX1, l("Donate to town")), 90,
l("Resign"), 99;
mes "";
@@ -569,9 +570,9 @@ function script POL_Manage {
next;
}
break;
- // Moubootaur
+ // Moubootaur
case 61:
- .@cost = 25000 - (.@TX * 5); // TX Cap 1500
+ .@cost = 25000 - (.@TX * 5); // TX Cap 7500
mesc l("Moubootaur Showdown Preparations"), 3;
mesc l("You need @@ GP to make this investment.", fnum(.@cost));
mesc l("This investment will allow the Alliance to make a better effort when facing down the Moubootaur.");
@@ -737,6 +738,27 @@ function script POL_Manage {
end;
}
break;
+ case 83:
+ .@cost = 50000 - (.@TX * 8); // TX Cap 12000
+ mesc l("Tulimshar Bazaar Investment"), 3;
+ mesc l("You need @@ GP to make this investment.", fnum(.@cost));
+ mesc l("Allows players to spend more money during the bimonthly bazaar (held in Tulim and LoF) by increasing vendors stock. This will also increase your town exports and reputation.");
+ if (.@GP < .@cost)
+ break;
+ mesc l("Are you sure?");
+ if (askyesno() == ASK_YES) {
+ setd(.@town$+"_MONEY", .@GP-.@cost);
+ TOWN_ACTIONS[.@TP]+=1;
+ $BAZAAR_EXTRASTOCK += rand2(1500, 3500); // 1.5~3.5k base
+ $BAZAAR_EXTRASTOCK += rand2(.@RP*20); // up to 2k bonus
+ $BAZAAR_EXTRASTOCK += rand2(min(.@EX/10, 4500)); // up to 4.5k bonus
+ setd(.@town$+"_EXPORT", .@EX+rand2(150, 350));
+ setd(.@town$+"_REPUTATION", min(100, .@RP+2));
+ mesc l("Investments were made."), 1;
+ mesc l("Next Baazar will happen on Friday, in %d weeks.", BAZAARFREQ - ($BAZAAR_TIMER % BAZAARFREQ));
+ next;
+ }
+ break;
// Mark 90: Office
case 90:
mesc l("The alliance will take %s GP as fee, +%d%% tax over donations.", fnum($ALLIANCE_TAX1), $ALLIANCE_TAX2), 1;
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index a7e40da0b..80a0c6de7 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -1336,6 +1336,11 @@ function script immortal {
return;
}
+// price( Item , Multiplier=1.0x )
+function script price {
+ return getiteminfo(getarg(0), ITEMINFO_BUYPRICE) * getarg(1, 10) / 10;
+}
+
// Special function which makes a date as a number
// numdate( - )
function script numdate {