I'm trying to make it so i dont have to type in the price for buying an item for every shop. I have a variable for the price of each item. but I cant seem to use it. can someone help?
mob
Townsmen8
typechar = "ShopKeeper"
name = "SHOPBOY2K"
var/obj/armor/MetalArmor/S
var/obj/armor/BasicArmor/F
verb
speak()
set src in oview(1)
switch(input("What do u want","weapons") in list("Basic Armor", "Metal Armor"))
if("Basic Armor")
switch(input("Are you sure","weapons") in list("yes","no"))
if("yes")
if(usr.gold < 125)
return
else
usr.gold -= 125
new/obj/armor/BasicArmor(usr)
usr << "You get a Basic armor"
if("no")
return
if("Metal Armor")
switch(input("Are you sure you want Metal Armor","weapons") in list("Yes","no"))
if("Yes")
usr.gold -= 500
new/obj/armor/MetalArmor(usr)
usr << "You get a Metal Armor"
if("no")
usr<<"You do not have enough gold"
return
icon = 'Townsman1.dmi'
KiteShield
basetype = "shield"
defense = 3
durability = 75
price = 90
ID:177488
Sep 2 2002, 12:28 pm
|
|
Sep 2 2002, 3:06 pm
|
|
please help?
|
In response to Garthor
|
|
One jay!
|
Probably the best way to handle shopkeeper mobs is with a list of wares that they sell.
obj/var/price Hope that helps. :) |