/mob/NPC/shopkeeper
mob/NPC/Shopkeeper
name = "ShopKeeper"
density = 1
icon = 'shopkeeper_m2.dmi'
icon_state = "shopkeeper"
Click()
var/itemstore = input("What Item do you want to buy?","Buy Items",) in list("Potion-40 gold","Dagger-60 gold","Giant Sword-500 gold","Nothing")
switch(itemstore)
if("Potion-40 gold")
if(usr.Gold<40)
usr << "Not enough gold."
else
usr.Gold -= 40
usr.contents += new /obj/Potion
if("Dagger-60 gold")
if(usr.Gold<60)
usr << "Not enough gold"
else
usr.Gold -= 60
usr.contents += new /obj/weapons/Dagger
if("Leather Helmet-50 gold")
if(usr.Gold<50)
usr << "Not enough gold"
else
usr.Gold -= 50
usr.contents += new /obj/helmet/Leather_Helmet
if("Leather Armor-70 gold")
if(usr.Gold<70)
usr << "Not enough gold"
else
usr.Gold -= 70
usr.contents += new /obj/armor/Leather_Armor
if("Giant Sword-500 gold")
if(usr.Gold<500)
usr << "Not enough gold"
else
usr.Gold -= 500
usr.contents += new /obj/weapons/Giant_Sword
if("Nothing")
return
/mob/NPC/Ali
mob/NPC/Ali
name = "Ali's Weapons"
density = 1
icon = 'citizen_m1.dmi'
icon_state = "Ali"
Click()
var/itemstore = input("What Item do you want to buy?","Buy Items",) in list("Potion-40 gold","Dagger-60 gold","Giant Sword-500 gold","Nothing")
switch(itemstore)
if("Asian Spear-800 gold")
if(usr.Gold<800)
usr << "Not enough gold"
else
usr.Gold -= 800
usr.contents += new /obj/weapons/Asian_Spear
if("Katana-900 gold")
if(usr.Gold<900)
usr << "Not enough gold"
else
usr.Gold -= 900
usr.contents += new /obj/weapons/Katana
if("Bladed_Rapier-1000 gold")
if(usr.Gold<1000)
usr << "Not enough gold"
else
usr.Gold -= 1000
usr.contents += new /obj/weapons/Bladed_Rapier
if("Long Sword-1200 gold")
if(usr.Gold<1200)
usr << "Not enough gold"
else
usr.Gold -= 1200
usr.contents += new /obj/weapons/Long_Sword
if("Nothing")
return
ID:175065
![]() Jun 17 2003, 12:31 pm
|
|
I have two different shop keepers that sell different things but they both sell only potions, daggers, and Giant swords. here is my code:
|
I highlighted the error for you.