tiago_gazzola

Untitled

May 31st, 2020
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.98 KB | None | 0 0
  1. ------------------------------------------------------------------------------------------
  2. //Creating enums
  3. //All Itens Id List
  4. enum ITEM_LIST
  5. {
  6. NOONE,
  7.  
  8. APPLE = 1,
  9. WOOD = 2,
  10. STONE = 3,
  11.  
  12. TOTAL
  13. }
  14.  
  15. //All Itens Properties
  16. enum ITEM_PROPERTIES
  17. {
  18. TYPE,
  19. NAME,
  20. BUY_VALUE,
  21. SELL_VALUE,
  22. TOOLTIP,
  23. MAX_PER_SLOT,
  24. RECIPE,
  25.  
  26. TOTAL
  27. }
  28.  
  29. //Itens Types
  30. enum ITEM_TYPE
  31. {
  32. NOONE,
  33.  
  34. MATERIAL,
  35. CONSUMABLE,
  36. TOOL,
  37. WEAPON,
  38. ACCESSORY,
  39. ARMOR,
  40. AMMO
  41. }
  42.  
  43. //Consumables
  44. enum CONSUMABLES_PROPERTIES
  45. {
  46. NOONE,
  47.  
  48. RECOVERED_LIFE,
  49. RECOVERED_STAMINA,
  50. BUFF,
  51. BUFF_DURATION,
  52. DEBUFF,
  53. DEBUFF_DURATION,
  54.  
  55. TOTAL
  56. }
  57. ------------------------------------------------------------------------------------------
  58.  
  59.  
  60.  
  61. ------------------------------------------------------------------------------------------
  62. //Creating all itens grid
  63. global.item_index = ds_grid_create(ITEM_LIST.TOTAL, ITEM_PROPERTIES.TOTAL);
  64. ds_grid_clear(global.item_index, 0);
  65. ------------------------------------------------------------------------------------------
  66.  
  67.  
  68.  
  69. ------------------------------------------------------------------------------------------
  70. //Script to create a item on the all itens grid
  71. /// @arg item_id
  72. /// @arg type
  73. /// @arg name
  74. /// @arg buy_value
  75. /// @arg sell_value
  76. /// @arg tooltip
  77. /// @arg max_per_slot
  78. /// @arg recipe
  79.  
  80. var _iid = argument[0];
  81. var _type = argument[1]
  82. var _name = argument[2]
  83. var _buy_value = argument[3]
  84. var _sell_value = argument[4]
  85. var _tooltip = argument[5]
  86. var _max_per_slot = argument[6]
  87. var _recipe = argument[7]
  88.  
  89. global.item_index[# _iid, ITEM_PROPERTIES.TYPE] = _type
  90. global.item_index[# _iid, ITEM_PROPERTIES.NAME] = _name
  91. global.item_index[# _iid, ITEM_PROPERTIES.BUY_VALUE] = _buy_value
  92. global.item_index[# _iid, ITEM_PROPERTIES.SELL_VALUE] = _sell_value
  93. global.item_index[# _iid, ITEM_PROPERTIES.TOOLTIP] = _tooltip
  94. global.item_index[# _iid, ITEM_PROPERTIES.MAX_PER_SLOT] = _max_per_slot
  95. global.item_index[# _iid, ITEM_PROPERTIES.RECIPE] = _recipe
  96. ------------------------------------------------------------------------------------------
  97.  
  98.  
  99.  
  100. ------------------------------------------------------------------------------------------
  101. //Adding a item to the grid using the script
  102. scr_items_properties(ITEM_LIST.APPLE, ITEM_TYPE.CONSUMABLE,
  103. "Apple", -1, 1, "A shiny red apple", 20,
  104. ------------------------------------------------------------------------------------------
  105.  
  106.  
  107.  
  108. ------------------------------------------------------------------------------------------
  109. //Creating consumables properties map
  110. global.consumables_properties= ds_map_create();
  111. ds_grid_clear(global.consumables_properties, 0);
  112. ------------------------------------------------------------------------------------------
  113.  
  114.  
  115.  
  116. ------------------------------------------------------------------------------------------
  117. /// @desc Seting consumables properties
  118.  
  119. /// @arg recovered_life
  120. /// @arg recovered_stamina
  121. /// @arg buff
  122. /// @arg buff_duration
  123. /// @arg debuff
  124. /// @arg debuff_duration
  125.  
  126. var _recovered_life = argument[0]
  127. var _recovered_stamina = argument[1]
  128. var _buff = argument[2]
  129. var _buff_duration = argument[3]
  130. var _debuff = argument[4]
  131. var _debuff_duration = argument[5]
  132.  
  133. arr[CONSUMABLES_PROPERTIES.RECOVERED_LIFE] = _recovered_life
  134. arr[CONSUMABLES_PROPERTIES.RECOVERED_STAMINA] = _recovered_stamina
  135. arr[CONSUMABLES_PROPERTIES.BUFF] = _buff
  136. arr[CONSUMABLES_PROPERTIES.BUFF_DURATION] = _buff_duration
  137. arr[CONSUMABLES_PROPERTIES.DEBUFF] = _debuff
  138. arr[CONSUMABLES_PROPERTIES.DEBUFF_DURATION] = _debuff_duration
  139. ------------------------------------------------------------------------------------------
  140.  
  141.  
  142.  
  143. ------------------------------------------------------------------------------------------
  144. //Creating/setting the consumables properties
  145. global.consumables[? ITEM_LIST.APPLE] = scr_create_consumables(10, 0, BUFF.NOONE, 0, DEBUFF.POISONED, 30)
  146. ------------------------------------------------------------------------------------------
Add Comment
Please, Sign In to add comment