summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2025-06-14 11:06:35 -0300
committerJesusaves <cpntb1@ymail.com>2025-06-14 11:06:35 -0300
commitb615dcdf0a0b2b572cf5aab3c47845883b20b248 (patch)
tree22af048834e04b3d1532859f76f5abd80e23d471
parentdf2928a2d497d87c4725ae6eac819b0b82e907de (diff)
downloadserverdata-b615dcdf0a0b2b572cf5aab3c47845883b20b248.tar.gz
serverdata-b615dcdf0a0b2b572cf5aab3c47845883b20b248.tar.bz2
serverdata-b615dcdf0a0b2b572cf5aab3c47845883b20b248.tar.xz
serverdata-b615dcdf0a0b2b572cf5aab3c47845883b20b248.zip
Prepare to replace the Cheat Shop. However, right now, the bazaar is static
I did not add all vendors, nor when event starts, ends, and town admin gimmick
-rw-r--r--npc/003-1/shop.txt106
-rw-r--r--npc/029-0/event.txt30
-rw-r--r--npc/functions/politics.txt4
3 files changed, 108 insertions, 32 deletions
diff --git a/npc/003-1/shop.txt b/npc/003-1/shop.txt
index 86ca29bc8..3a8406c4d 100644
--- a/npc/003-1/shop.txt
+++ b/npc/003-1/shop.txt
@@ -1,6 +1,7 @@
// TMW2 scripts.
// Author:
// Saulc
+// Jesusalva
003-1,108,110,0 trader Shop#bazar1 NPC_NO_SPRITE,{
@@ -65,3 +66,108 @@ OnSellItem:
end;
}
+/* ************************************************************************** */
+// .:: Tulimshar Bazaar Scripts and Functions ::.
+
+// Calculate how much GP you can spend in Tulimshar Bazaar, across all vendors
+function script BazaarFunds {
+ // [000k] You can spend a base of 22k
+ .@maxFund = 22000;
+ // [022k] Every rebirth adds 5k to your max purchases
+ .@maxFund += REBIRTH * 5000;
+ // [027k] Every player story stage adds another 1k (up to 23)
+ .@maxFund += min(23, getq(General_Narrator)) * 1000;
+ // [050k] Each world act adds another 10k
+ .@maxFund += $GAME_STORYLINE * 10000;
+ // [100k] Completing Milly quest adds 25k each step
+ .@maxFund += min(2, getq(General_Milly)) * 25000;
+ // [150k] Beating the Moubootaur adds 50k
+ .@maxFund += (FINAL_WINNER ? 50000 : 0);
+ // [200k] Being the World Hero lets you spend another 100k
+ .@maxFund += ($MOST_HEROIC$ == strcharinfo(0) ? 100000 : 0);
+ // [300k]
+ return .@maxFund;
+}
+
+// Tulimshar Bazaar
+003-1,98,110,0 script Esperia 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));
+ next;
+ closeclientdialog;
+ npcshopattach(.name$);
+ shop .name$;
+ goodbye;
+ close;
+
+// price( Item , Multiplier=1.0x )
+function price {
+ return getiteminfo(getarg(0), ITEMINFO_BUYPRICE) * getarg(1, 10) / 10;
+}
+
+OnInit:
+ .sex = G_MALE;
+ .distance = 3;
+ 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);
+ if ($GAME_STORYLINE >= 4) {
+ sellitem AlchemyBlueprintD, price(AlchemyBlueprintD, 10);
+ sellitem EquipmentBlueprintD, price(EquipmentBlueprintD, 10);
+ }
+ 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 : 18000);
+ sellitem EverburnPowder, price(EverburnPowder, 15);
+
+ end;
+
+// We need to use NST_CUSTOM so we can reject the trade when over-budget
+OnCountFunds:
+ // We use the second currency to inform how much funds you still have
+ // FIXME: MV however doesn't display it currently, but...
+ // ...ThinkSome will eventually get annoyed by not knowing his budget and fix it
+ setcurrency(Zeny, BazaarFunds() - TULIM_BAZAAR);
+ end;
+
+/* @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;
+ }
+ // Everything is fine, spend the money
+ Zeny -= @price;
+ TULIM_BAZAAR += @price;
+ // Pay your taxes!
+ PurchaseTaxes();
+ // Signal it may proceed
+ purchaseok();
+ end;
+}
+
diff --git a/npc/029-0/event.txt b/npc/029-0/event.txt
index 8b51167be..1c9c81509 100644
--- a/npc/029-0/event.txt
+++ b/npc/029-0/event.txt
@@ -101,27 +101,13 @@ OnInit:
.@steam /= 2;
sleep(SHOPWAIT);
- sellitem Coal, -1, 50+(.@steam*3-3);
- sellitem LeatherPatch, 800, 45+(.@steam*3-3);
- sellitem RawLog, -1, 40+(.@steam*3-3);
- sellitem WoodenLog, -1, 40+(.@steam*3-3);
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 TitaniumOre, 6000, 9+(.@steam*2-2);
- if ($GAME_STORYLINE >= 4) {
- sellitem IridiumOre, 16000, 6+(.@steam*2-2);
- // Platinum Ore is only stocked if Platinum Mines are liberated
- if ($FORTRESS_STATE)
- sellitem PlatinumOre, 24000, 3+(.@steam*2-2);
- }
- sellitem EarthPowder, -1, 3+.@steam-1;
- sellitem EverburnPowder, 15000, 2+.@steam-1;
- sellitem AncientBlueprint, ($EVENT$ == "Steam" ? 12500 : 18000), 4+.@steam/2;
sellitem RustyKnife, -1, 5+.@steam-1;
sellitem TrainingWand, -1, 5+.@steam-1;
sellitem TrainingBow, -1, 5+.@steam-1;
@@ -129,24 +115,11 @@ OnInit:
// Always stock blueprints at initialization time
sellitem AlchemyBlueprintA, -1, 5+.@steam-1;
sellitem AlchemyBlueprintB, -1, 4+.@steam-1;
- sellitem AlchemyBlueprintC, -1, 3+.@steam-1;
- if ($GAME_STORYLINE >= 4) {
- sellitem AlchemyBlueprintD, -1, 2+.@steam-1;
- sellitem AlchemyBlueprintE, -1, 1+.@steam/2;
- }
sellitem EquipmentBlueprintA, -1, 5+.@steam-1;
sellitem EquipmentBlueprintB, -1, 4+.@steam-1;
- sellitem EquipmentBlueprintC, -1, 3+.@steam-1;
- if ($GAME_STORYLINE >= 4) {
- sellitem EquipmentBlueprintD, -1, 2+.@steam-1;
- sellitem EquipmentBlueprintE, -1, 1+.@steam/2;
- }
- sellitem ArcmageBoxset, 10000, 4+.@steam-1;
- sellitem ScholarshipBadge, -1, 3+.@steam-1;
sellitem Bullet, 4, 90000+(.@steam*1000-1000);
- sellitem Lifestone, -1, 500+.@steam-1;
sellitem Bread, -1, 450+.@steam-1;
sellitem Cheese, -1, 300+.@steam-1;
sellitem Aquada, -1, 200+.@steam-1;
@@ -158,10 +131,7 @@ OnInit:
sellitem BugLeg, -1, 1+rand2(50)+.@steam;
sellitem RoastedMaggot, -1, 1+rand2(50)+.@steam;
sellitem Moss, -1, 1+rand2(50)+.@steam;
- sellitem AnimalBones, -1, 1+rand2(40)+.@steam;
sellitem Milk, -1, 1+rand2(50)+.@steam;
- sellitem Mashmallow, -1, 1+rand2(50)+.@steam;
- sellitem Dragonfruit, 1200, 1+rand2(50)+.@steam;
sellitem Root, -1, 40+.@steam;
sellitem ManaPiouFeathers, -1, 1+rand2(300)+.@steam;
diff --git a/npc/functions/politics.txt b/npc/functions/politics.txt
index d10b1dacc..9450af4f3 100644
--- a/npc/functions/politics.txt
+++ b/npc/functions/politics.txt
@@ -18,7 +18,7 @@
// $LOC_CANDIDATE$ - Candidate for Office
// $LOC_VOTES - Number of votes of Candidate
-// Proccess Taxes from purchases
+// Process Taxes from purchases
// PurchaseTaxes( Location )
function script PurchaseTaxes {
.@tax=0;
@@ -42,7 +42,7 @@ function script PurchaseTaxes {
return;
}
-// Proccess Taxes from sales (20% from purchase tax)
+// Process Taxes from sales (20% from purchase tax)
// SaleTaxes( Location )
function script SaleTaxes {
.@tax=0;