Advertisement
Guest User

new one

a guest
May 24th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. mob
  2. var
  3. mob/npc/shopkeeper
  4.  
  5. client/Topic(href,href_list[])
  6. var/item_type = href_list["type"]
  7. if(item_type)
  8. var/obj/i = new item_type()
  9. if(usr.gold >= i.Price)
  10. usr << "Enjoy your new item!"
  11. usr.gold -= i.Price
  12. i.Move(usr)
  13. usr.shopkeeper:Shopkeeper2()
  14. else
  15. usr << "Sorry you dont have enough money!"
  16. usr.shopkeeper:Shopkeeper2()
  17.  
  18.  
  19. mob
  20. npc
  21. Shopkeeper
  22. icon = 'ron.dmi'
  23. name = "Twilfitt"
  24. icon_state = "Ron"
  25. var/html
  26. verb
  27. Buy()
  28. set src in oview(1)
  29. usr.shopkeeper = src
  30. Shopkeeper2(usr)
  31. /*
  32. The code below loops through all of the items in the shopkeeper's
  33. contents and then displays them. You can change the first part before
  34. the loop without hurting anything. But it is all relatively
  35. modifiable.
  36. */
  37.  
  38. proc
  39. Shopkeeper2()
  40. usr << "Running proc"
  41. html = {"
  42. <style>
  43. body{background:#C0C0C0}
  44. </style>
  45. <b>Welcome to Twilfitt</b>
  46. <p>Here we supply all of the clothes!</p>
  47. <table border = "3" cellspacing = "1" cellpadding = "1">
  48. <Caption>Items</Caption>
  49. "}
  50. for(var/obj/A in src.contents)
  51. html += {"
  52. <tr><td align = "center">[A.icon]</td>
  53. <tr><td align = "center">[A.name]</td>
  54. <td align = "center">Price : [Gold(A.Price)]"]</td>
  55. <td align = "center"><a href='?src=\ref[usr];type=[A.type];action=buy'>Get</a></td>
  56. </tr>
  57. "}
  58. usr << browse(html)
  59.  
  60.  
  61.  
  62. /*
  63. In the New() is the shopkeepers inventory list.
  64. You can code new items and add them here and it will display them
  65. One of my favorite parts about this.
  66. */
  67. New()
  68. src.contents += list(new/obj/Clothing/Pants/School_Pants)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement