mob
icon = 'yourchar.dmi'
shopkeeper
Shopkeeper2
description = "Welcome to Rob's Armory!"
name = "Rob"
icon_state = "shopkeeper"
inventory1 = list(new /obj/weapons/Axe,new /obj/weapons/Axe,new /obj/weapons/Axe,new /obj/weapons/Axe)
inventory2 = list(new /obj/weapons/Axe,new /obj/weapons/Axe,new /obj/weapons/Axe,new /obj/weapons/Axe)
inventory3= list(new /obj/weapons/Axe,new /obj/weapons/Axe)
verb
Buy()
set src in oview(2)
usr.shopkeeper = src
Shopkeeper2(usr)
Sell(var/obj/Item in usr.contents)
set src in oview(2)
if(Item.suffix == "Equipped")
usr << "Un-equip [Item] first!"
return
switch(input("Would you really like to sell this item?")in list ("Yes","No"))
if("Yes")
src.contents+=Item
var/give = round(Item.price / 1.5)
usr.gold += give
usr << "You sell the [Item]."
return
else
return
/*
In the New() is the shopkeepers inventory list.
You can code new items and add them here and it will display them
One of my favorite parts about this.
*/
New()
src.contents += list(new /obj/weapons/Axe,new /obj/weapons/Dagger)
New()
src.restock()
proc
Shopkeeper2()
for(var/mob/I in oview(2))
statpanel("Shop")
stat("[I.description]")
stat(I.contents)
Problem description:
Well i am trying to make it so when using verb buy... you get the statpanel with the shopkeepers inventory, if you need the entire code please reply saying so.
That's the basic way of doing this.