Hey there, I'm back again
I managed to get the hardest part over with some days ago and I'm now working on the details.
So it's almost done and you will probably have it tomorrow or tuesday in worst case.
Here is the log:
//= 1.0 first version :
// -player creates his shop by using the '@shop' command
// -possibility to add a cost to the shop creation and a tax to the items sold, PLEASE REFER TO THE "ADDING SHOPS" PART IF YOU WANT TO ADD SHOPS
// -if you are the owner of a shop and buy an item in it, you won't have to pay the tax
// -player can manage his shop by clicking on it or using the '@shopadd' , '@shopdel' , '@shopcancel' commands
// -any owner of any shop can log in and out at any moment, he'll always get his money and items in case he sold something and/or his shop was deleted
//
//= things to do:
// -modify '@shopadd' in case player already sells this item and either it's an equip or or consummable
// -modify '@shopdel' in case player wants to delete equips
// -adding '@shopmod <item id> <new price>' command
and a few screenshots:
*here the shop displays 100z but I fixed the problem already*
Ok it's done !
shop.txt
shop.txt gave you my previous save sry^^
I got rid of the non-essentials commands so you only have to remember the '@shop' command.
If you don't have a shop the '@shop' command will create you one and if you already own a shop this command will make you able to manage it.
Don't forget to edit this part:
- script ShopManager -1,{
function GetShop ; function CheckOwner ; function CheckNumber ; function SetShop ; function AddToShop ; function CheckShopBound ; function GiveItemsBack;
OnInit:
//===========================player setuo=========================
.ShopAmount = 10; //amount of shops availables
.TimeDelay = 24; //amount of time a shop will last (in hours)
.Cost = 1000; //Cost to create a shop
.Tax = 10; //tax deducted from sales (in percent)
//=======================end of player setup======================
Currently there are 10 shops but if you want to add more, please refer to this part :
/*=============================================ADDING SHOPS==================================================================
*if you want to add more shops, please refer to this part:*
1)copy paste this >> - shop Subshop<NUMBER OF YOUR SHOP> -1,512:-1
2)copy paste this V V (you can place the shop wherever you want since it'll be warped on player location)
<SHOP LOCATION>,<X>,<Y>,4 script Shop#<NUMBER OF YOUR SHOP> 464,{
@BuyingShopSpec = 1;
callshop "Subshop"+strnpcinfo(2),1;
end;
OnBuyItem:
callfunc "BuyItem",getcharid(3,strcharinfo(0)),strnpcinfo(2);
end;
OnInit:
npcshopattach "Subshop"+strnpcinfo(2);
disablenpc strnpcinfo(3) ; setd "$Shop"+strnpcinfo(2)+"enable" , 0;
end;
OnEnable:
enablenpc strnpcinfo(3) ; setd "$Shop"+strnpcinfo(2)+"enable" , 1;
unitwarp getnpcid(0) , .map$ , .x , .y;
waitingroom .shopname$,0;
end;
}
3)edit the '.ShopAmount' var in the player setup >> .Shopamount = <AMOUNT OF SHOPS>
===========================================END OF ADDING SHOPS=============================================================*/
Hope you'll enjoy
shop.txt