ID:177508
 
How do i make a shop using the basic NPC object idea???
-Daz
Alright Thorg, I'll help you out, but next time you need help with something, don't act so immature, be patient.

Anyway, making a shopkeeper isn't very tough at all, here's an example.

mob
ShopKeeper
icon = 'Keeper.dmi'
verb
Buy()
set src in oview(1)
switch(input("What do you want to buy today?")in list("Sword","Shield","Nothing"))
if("Sword")
usr << "alright!"
usr.Gold -= 100
usr.contents += new/obj/Sword //You have to make an object called sword for this to work properly
if("Shield")
usr << "Yes sir!"
usr.Gold -= 50
usr.contents += new/obj/Shield
if("Nothing")
usr << "Then get out of here and quit wasting my time!"

This should get the job done.

?The Wizard of How¿
In response to The Wizard of How
Thank you and i apologise for my immature behaviour
-Spoon!
Thorg wrote:
How do i make a shop using the basic NPC object idea???
-Daz

My BYONDscape article (non-subscription content) on associative lists covers how to do a shop; the code is fairly robust. You'll find the article in the BYONDscape archives.

Lummox JR