From 224e6b764b0b4422e866d2a6f5e150b9daf05975 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 12 Sep 2019 08:52:52 -0300 Subject: Inar now charge taxes. New function: shop2(). In future, Shop#bazar1 will move to type HIDDEN and will have a placeholder instead to use shop2() functions. --- npc/003-1/inar.txt | 2 +- npc/003-1/shop.txt | 12 ++++++++++++ npc/005-4/shop.txt | 13 +++++++++++++ npc/012-1/shoppakep.txt | 6 +++--- npc/functions/shops.txt | 20 ++++++++++++++++++++ 5 files changed, 49 insertions(+), 4 deletions(-) (limited to 'npc') diff --git a/npc/003-1/inar.txt b/npc/003-1/inar.txt index 54bcd1687..8311c8ad5 100644 --- a/npc/003-1/inar.txt +++ b/npc/003-1/inar.txt @@ -12,7 +12,7 @@ l("Leave"), L_Close; closedialog; - shop "Shop#bazar1"; + shop2 "Shop#bazar1"; close; L_Close: diff --git a/npc/003-1/shop.txt b/npc/003-1/shop.txt index 56f386f37..cf51a70fa 100644 --- a/npc/003-1/shop.txt +++ b/npc/003-1/shop.txt @@ -44,5 +44,17 @@ OnClock0000: restoreshopitem CroconutBox, rand(2800,3050), 6; restoreshopitem EmptyBottle, 3; restoreshopitem EmptyBox, 4; + end; + +// Pay your taxes! +OnBuyItem: + debugmes("Purchase confirmed"); + PurchaseTaxes(); + end; + +OnSellItem: + debugmes("Sale confirmed"); + SaleTaxes(); + end; } diff --git a/npc/005-4/shop.txt b/npc/005-4/shop.txt index d73bc152a..01ec2d57d 100644 --- a/npc/005-4/shop.txt +++ b/npc/005-4/shop.txt @@ -30,5 +30,18 @@ OnClock0004: restoreshopitem TolchiAmmoBox, -1, 4; restoreshopitem LousyMoccasins, -1, 4; restoreshopitem TrainingBow, -1, 3; + end; + + +// Pay your taxes! +OnBuyItem: + debugmes("Purchase confirmed"); + PurchaseTaxes(); + end; + +OnSellItem: + debugmes("Sale confirmed"); + SaleTaxes(); + end; } diff --git a/npc/012-1/shoppakep.txt b/npc/012-1/shoppakep.txt index b542e5014..3f3e47e2c 100644 --- a/npc/012-1/shoppakep.txt +++ b/npc/012-1/shoppakep.txt @@ -25,7 +25,7 @@ OnInit: .CurrentItem=ShoppaKepItem(); - .ThisRebootAmou=rand(30,70); + .ThisRebootAmou=rand2(30,70); .sex = G_FEMALE; .distance = 5; @@ -46,7 +46,7 @@ OnInit: sellitem Chagashroom, -1, 3; sellitem PiouFeathers, -1, .ThisRebootAmou; - sellitem .CurrentItem, -1, rand(1,4); + sellitem .CurrentItem, -1, rand2(1,4); end; @@ -69,7 +69,7 @@ OnClock0546: stopselling(.CurrentItem); .CurrentItem=ShoppaKepItem(); - sellitem .CurrentItem, -1, rand(1,4); + sellitem .CurrentItem, -1, rand2(1,4); end; // Pay your taxes! diff --git a/npc/functions/shops.txt b/npc/functions/shops.txt index a4945c57e..39db86a66 100644 --- a/npc/functions/shops.txt +++ b/npc/functions/shops.txt @@ -21,3 +21,23 @@ function script restoreshopitem { sellitem getarg(0), .@price, .@amount; return; } + + +// shop2({NPC Name, {showmenu=true}}) +function script shop2 { + npctalk3 any( + l("The best wares!"), + l("Buy cheap, sell expensive!") + ); + .@n$=getarg(0, strnpcinfo(0)); + + npcshopattach(.@n$); + + if (getarg(1,true)) + shop .@n$; + else + openshop .@n$; + + closeclientdialog; + return; +} -- cgit v1.2.3-60-g2f50