Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mob
- var
- mob/npc/shopkeeper
- client/Topic(href,href_list[])
- var/item_type = href_list["type"]
- if(item_type)
- var/obj/i = new item_type()
- if(usr.gold >= i.Price)
- usr << "Enjoy your new item!"
- usr.gold -= i.Price
- i.Move(usr)
- usr.shopkeeper:Shopkeeper2()
- else
- usr << "Sorry you dont have enough money!"
- usr.shopkeeper:Shopkeeper2()
- mob
- npc
- Shopkeeper
- icon = 'ron.dmi'
- name = "Twilfitt"
- icon_state = "Ron"
- var/html
- verb
- Buy()
- set src in oview(1)
- usr.shopkeeper = src
- Shopkeeper2(usr)
- /*
- The code below loops through all of the items in the shopkeeper's
- contents and then displays them. You can change the first part before
- the loop without hurting anything. But it is all relatively
- modifiable.
- */
- proc
- Shopkeeper2()
- usr << "Running proc"
- html = {"
- <style>
- body{background:#C0C0C0}
- </style>
- <b>Welcome to Twilfitt</b>
- <p>Here we supply all of the clothes!</p>
- <table border = "3" cellspacing = "1" cellpadding = "1">
- <Caption>Items</Caption>
- "}
- for(var/obj/A in src.contents)
- html += {"
- <tr><td align = "center">[A.icon]</td>
- <tr><td align = "center">[A.name]</td>
- <td align = "center">Price : [Gold(A.Price)]"]</td>
- <td align = "center"><a href='?src=\ref[usr];type=[A.type];action=buy'>Get</a></td>
- </tr>
- "}
- usr << browse(html)
- /*
- 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/Clothing/Pants/School_Pants)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement