now i am putting in the buying/selling items codes.
i already have the "buy" part of the codes in, but the codes didnt come with a "sell", nor did it come with the codes that need to be in the item coding for when an item is sold.
so far, this is what i have..
turf/Merchant //The name bob can be changed to what you want if you want to do that and the turf makes it so you cant attack him(much easier than making him a mob)
icon = 'NPC.dmi' //This can also be changed to what you want
icon_state = "man"
verb
Buy()
set src in oview(2) //I choose oview 2 becuase i like to have my shop keeper behind a desk or you can just use a bump proc.
switch(input("What do you want to buy.","Title of the store")in list("rusty sword(free)","short sword","Nothing")) //You dont have to use the names i provied but if you cange these make sure your if("Sword") changes as well
if("rusty sword(free)")//Checks if you picked the sword
if(usr.Gold>=0)//Checks to see if you have enough gold
usr.contents+=new/obj/Rusty_Sword//This adds the obj you bought to your inventory slot plus you need to make the objects for the stuff to buy
usr.Gold-=0//This takes away gold from the usr
alert("Thanks for taking that crappy sword from off my hands.")//You can use usr <<"Thanx for buyin the sword." as well but i prefer alert
else//This means they didnt have enough for it
alert("You don't have enough gold. Please come back with more gold.")
if("short sword")//Checks if they picked the spear.
if(usr.Gold>=90)//Checks to see if the usr has enough gold.
usr.contents+=new/obj/Short_Sword//This adds the obj you bought to your inventory slot plus you need to make the objects for the stuff to buy
usr.Gold-=90//This takes 200 gold away for buying it
alert("Thanx for buying the Spear.")//You can use usr <<"Thanx for buyin the sword." as well but i prefer alert
else//This means they didnt have enough
alert("You dont have enough")
if("Nothing")//This checks to see if the usr picked nothing
alert("Well thanx for stopping buy anyways")//This just means they didnt want any
Sell()
set src in oview(2) //I choose oview 2 becuase i like to have my shop keeper behind a desk or you can just use a bump proc.
switch(input("What do you want to sell?","Title of the store")in list
after "in list", i can't think of what is supposed to be there. any help?
that would get all the items that the player has on them
you would need to check to see if that item is equiped before you let them sell it.