form.edit.item.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. <?php
  2. $ic = 'item-edit-input'; //input class.
  3. require('inc/data.item.icons.php'); //icon data constants
  4. require('inc/data.item.skills.php'); //item skill requirement constants
  5. $exclude_debug_fieldlist = [
  6. 'icon','id','name','item_type','description',
  7. 'lore' ,'lore_equip' ,'stacklore' ,'temporary' ,
  8. 'artifact' ,'notrade' ,'nodestroy' ,'show_name',
  9. 'crafted','attuneable','heirloom','nozone','norepair',
  10. 'good_only','evil_only','novalue','ornate','etheral',
  11. 'appearance_only','reforged','refined','usable',
  12. 'collectable','tier','count','weight','slots',
  13. 'skill_id_req2','display_charges','harvest','unlocked',
  14. 'max_charges','skill_min','flags_16384','flags_32768',
  15. 'flags2_256', 'set_name','soe_item_id','soe_item_crc',
  16. 'recommended_level','adventure_default_level','stack_count',
  17. 'sell_price', 'sell_status_amount','adornment_slot1',
  18. 'adornment_slot2','adornment_slot3','adornment_slot4',
  19. 'adornment_slot5','adornment_slot6','offers_quest_id',
  20. 'soe_autoquest_id','part_of_quest_id','lua_script',
  21. 'quest_unknown','adornment_description','skill_id_req',
  22. 'tradeskill_default_level','adventure_classes',
  23. 'tradeskill_classes'
  24. ];
  25. ?>
  26. <div class="col-xl-12">
  27. <div class="row">
  28. <!-- Item Icon Edit -->
  29. <div class="col-xs-4 col-sm-3 col-md-3 col-lg-3 col-xl-2 text-center">
  30. <div class="edit-item-ico-ctn">
  31. <img class="edit-item-ico vm" src="img/eq2/items/<?php echo $item['icon']; ?>.png"/>
  32. <br/>
  33. <small><strong>Icon ID</strong>: <?php echo $item['icon']; ?></small>
  34. </div>
  35. <button class="btn btn-xs btn-default btn-block ico-picker-btn">
  36. <i class="fad fa-eye-dropper color-info-500"></i> Icon Picker
  37. </button>
  38. </div>
  39. <!-- End: Item Icon Edit -->
  40. <!-- Item Basic Details -->
  41. <div class="col-xs-8 col-sm-9 col-md-9 col-lg-9 col-xl-10">
  42. <div class="row">
  43. <div class="col-sm-12 col-xl-7">
  44. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'name','value'=>$item['name'],'id'=>$item['id'],'title'=>'Name','icon'=>'fad fa-tag','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Enter item name ...']); ?>
  45. </div>
  46. <div class="col-sm-12 col-xl-5">
  47. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'set_name','value'=>$item['set_name'],'id'=>$item['id'],'title'=>'Set Name','icon'=>'fad fa-tags','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Enter a set name...']); ?>
  48. </div>
  49. <div class="col-sm-6 col-xl-6">
  50. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'icon','value'=>$item['icon'],'id'=>$item['id'],'title'=>'Icon ID','icon'=>'fad fa-images','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Enter icon id ...', 'type'=>'number']); ?>
  51. </div>
  52. <div class="col-sm-6 col-xl-6">
  53. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'item_type','value'=>$item['item_type'],'id'=>$item['id'],'title'=>'Item Type','icon'=>'fad fa-disease','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>NULL, 'field_type'=>'select', 'options'=>$itemCategories]); ?>
  54. </div>
  55. </div>
  56. </div>
  57. <!-- End: Item Basic Details -->
  58. </div>
  59. </div>
  60. <!-- Description Row -->
  61. <div class="col-xl-12">
  62. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'description','value'=>$item['description'],'id'=>$item['id'],'title'=>'Description','icon'=>'fad fa-file-signature','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Enter an item description ...', 'field_type'=>'textarea']); ?>
  63. </div>
  64. <!-- End: Description Row -->
  65. <div class="col-xl-12">
  66. <div class="row">
  67. <!-- Stats & Reqs Panel -->
  68. <div class="col-xs-7 col-sm-7 col-md-7 col-lg-7 col-xl-7">
  69. <!-- Requisites -->
  70. <div id="itemeditor-reqs" class="panel">
  71. <div class="panel-hdr">
  72. <h4 class="mb-0 color-secondary"><i class="fas fa-badge-check color-warning-900"></i>&nbsp;Requisites</h4>
  73. </div>
  74. <div class="panel-container show" style="">
  75. <div class="panel-content">
  76. <div class="row">
  77. <div class="col-xs-12 col-sm-12 col-md-12 col-lg-8 col-xl-8">
  78. <?php
  79. $_skillsReq = get_skills($_itemSkills['req'],true);
  80. echo build_edit_input(['key'=>'id','table'=>'items','field'=>'skill_id_req','value'=>$item['skill_id_req'],'id'=>$item['id'],'title'=>'Skill Req.','icon'=>'fas fa-shield-cross color-success-700','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>'Primary skill requirement.','placeholder'=>NULL, 'field_type'=>'select', 'options'=>$_skillsReq]);
  81. $_skillsReq = NULL; // Clear memory usage.
  82. ?>
  83. </div>
  84. <div class="col-xs-12 col-sm-12 col-md-12 col-lg-4 col-xl-4">
  85. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'skill_min','value'=>$item['skill_min'],'id'=>$item['id'],'title'=>'Min. Skill','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>'The minimum skill required.','placeholder'=>'0','type'=>'number']); ?>
  86. </div>
  87. <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
  88. <?php
  89. $_skillsReq2 = get_skills($_itemSkills['req2'],true);
  90. echo build_edit_input(['key'=>'id','table'=>'items','field'=>'skill_id_req2','value'=>$item['skill_id_req2'],'id'=>$item['id'],'title'=>'Skill Req.','icon'=>'fas fa-bow-arrow color-info-700','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>'Secondary skill requirement for this item.','placeholder'=>NULL, 'field_type'=>'select', 'options'=>$_skillsReq2]);
  91. $_skillsReq2 = NULL; // Clear memory usage.
  92. ?>
  93. </div>
  94. <div class="col-xl-12"><h1><hr></hr></h1></div>
  95. <div class="col-xs-12 col-sm-12 col-md-7 col-lg-7 col-xl-6">
  96. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'adventure_default_level','value'=>$item['adventure_default_level'],'id'=>$item['id'],'title'=>'Adventure Level','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>'Default Adventure Level.','placeholder'=>'0','type'=>'number']); ?>
  97. </div>
  98. <div class="col-xs-12 col-sm-12 col-md-5 col-lg-5 col-xl-6">
  99. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'recommended_level','value'=>$item['recommended_level'],'id'=>$item['id'],'title'=>'Rec. Level','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>'Recommended player level.','placeholder'=>'0','type'=>'number']); ?>
  100. </div>
  101. <div class="col-xs-12 col-sm-12 col-md-5 col-lg-5 col-xl-6">
  102. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'tradeskill_default_level','value'=>$item['tradeskill_default_level'],'id'=>$item['id'],'title'=>'Tradeskill Level','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>'Default Tradeskill Level','placeholder'=>'0','type'=>'number']); ?>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. <!-- End: Requisites -->
  109. <!-- Stats -->
  110. <div id="itemeditor-props" class="panel">
  111. <div class="panel-hdr">
  112. <h4 class="mb-0 color-secondary"><i class="fas fa-book-spells color-primary-500"></i>&nbsp;Stats</h4>
  113. </div>
  114. <div class="panel-container show" style="">
  115. <div class="panel-content">
  116. <div class="row">
  117. <p>Item Stats</p>
  118. <div class="col-xl-12"><h1><hr></hr></h1></div>
  119. <div class="col-xl-5">
  120. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'sell_price','value'=>$item['sell_price'],'id'=>$item['id'],'title'=>'Sell Price','icon'=>'fas fa-toilet-paper color-success-700','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>'Merchant sell price.','placeholder'=>'0','type'=>'number']); ?>
  121. </div>
  122. <div class="col-xl-7">
  123. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'sell_status_amount','value'=>$item['sell_status_amount'],'id'=>$item['id'],'title'=>'Sell Status Amt.','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>'Sell status amount. Whatever that means...','placeholder'=>'0','type'=>'number']); ?>
  124. </div>
  125. <div class="col-xl-12"><h1><hr></hr></h1></div>
  126. <div class="col-xl-6">
  127. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'tier','value'=>$item['tier'],'id'=>$item['id'],'title'=>'Tier','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'0','type'=>'number']); ?>
  128. </div>
  129. <div class="col-xl-6">
  130. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'count','value'=>$item['count'],'id'=>$item['id'],'title'=>'Count','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Count - whatever that means...','type'=>'number']); ?>
  131. </div>
  132. <div class="col-xl-6">
  133. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'weight','value'=>$item['weight'],'id'=>$item['id'],'title'=>'Weight','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'0','type'=>'number']); ?>
  134. </div>
  135. <div class="col-xl-6">
  136. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'stack_count','value'=>$item['stack_count'],'id'=>$item['id'],'title'=>'Stack Count','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Stack count (int)','type'=>'number']); ?>
  137. </div>
  138. <div class="col-xl-6">
  139. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'slots','value'=>$item['slots'],'id'=>$item['id'],'title'=>'Slots','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Slots (int)','type'=>'number']); ?>
  140. </div>
  141. <div class="col-xl-12"><h4 class="mb-0">Adornment Slots<hr class="mb-2 mt-1"></hr></h4></div>
  142. <div class="col-xs-12 col-sm-6 col-md-6 col-lg-4 col-xl-4">
  143. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'adornment_slot1','value'=>$item['adornment_slot1'],'id'=>$item['id'],'title'=>'Slot 1','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>NULL,'placeholder'=>'0','type'=>'number']); ?>
  144. </div>
  145. <div class="col-xs-12 col-sm-6 col-md-6 col-lg-4 col-xl-4">
  146. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'adornment_slot2','value'=>$item['adornment_slot2'],'id'=>$item['id'],'title'=>'Slot 2','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>NULL,'placeholder'=>'0','type'=>'number']); ?>
  147. </div>
  148. <div class="col-xs-12 col-sm-6 col-md-6 col-lg-4 col-xl-4">
  149. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'adornment_slot3','value'=>$item['adornment_slot3'],'id'=>$item['id'],'title'=>'Slot 3','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>NULL,'placeholder'=>'0','type'=>'number']); ?>
  150. </div>
  151. <div class="col-xs-12 col-sm-6 col-md-6 col-lg-4 col-xl-4">
  152. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'adornment_slot4','value'=>$item['adornment_slot4'],'id'=>$item['id'],'title'=>'Slot 4','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>NULL,'placeholder'=>'0','type'=>'number']); ?>
  153. </div>
  154. <div class="col-xs-12 col-sm-6 col-md-6 col-lg-4 col-xl-4">
  155. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'adornment_slot5','value'=>$item['adornment_slot5'],'id'=>$item['id'],'title'=>'Slot 5','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>NULL,'placeholder'=>'0','type'=>'number']); ?>
  156. </div>
  157. <div class="col-xs-12 col-sm-6 col-md-6 col-lg-4 col-xl-4">
  158. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'adornment_slot6','value'=>$item['adornment_slot6'],'id'=>$item['id'],'title'=>'Slot 6','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>NULL,'placeholder'=>'0','type'=>'number']); ?>
  159. </div>
  160. <div class="col-xl-12">
  161. <?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'adornment_description','value'=>$item['adornment_description'],'id'=>$item['id'],'title'=>'Adornment Description','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Enter an adornment description ...', 'field_type'=>'textarea']); ?>
  162. </div>
  163. </div>
  164. </div> <!-- fas fa-toilet-paper, fas fa-book-spells -->
  165. </div>
  166. </div>
  167. </div>
  168. <!-- Right Slim Column -->
  169. <div class="col-xs-5 col-sm-5 col-md-5 col-lg-5 col-xl-5">
  170. <!-- Flags Panel -->
  171. <div id="itemeditor-props" class="panel">
  172. <div class="panel-hdr">
  173. <h4 class="mb-0 color-secondary"><i class="fas fa-flag color-danger-700"></i>&nbsp;Flags</h4>
  174. </div>
  175. <div class="panel-container show" style="">
  176. <div class="panel-content">
  177. <div class="row">
  178. <?php
  179. $_switches = [
  180. 'lore' => ['title'=>'Lore', 'ico'=>''],
  181. 'lore_equip' => ['title'=>'Lore Equip', 'ico'=>''],
  182. 'stacklore' => ['title'=>'Stack Lore', 'ico'=>''],
  183. 'temporary' => ['title'=>'Temporary', 'ico'=>''],
  184. 'artifact' => ['title'=>'Artifact', 'ico'=>''],
  185. 'notrade' => ['title'=>'Untradable', 'ico'=>''],
  186. 'nodestroy' => ['title'=>'Indestructible', 'ico'=>''],
  187. 'show_name' => ['title'=>'Show Name', 'ico'=>''],
  188. 'crafted' => ['title'=>'Crafted', 'ico'=>''],
  189. 'attuneable' => ['title'=>'Attuneable', 'ico'=>''],
  190. 'heirloom' => ['title'=>'Heirloom', 'ico'=>''],
  191. 'nozone' => ['title'=>'No Zone', 'ico'=>''],
  192. 'norepair' => ['title'=>'No Repair', 'ico'=>''],
  193. 'good_only' => ['title'=>'Good Only', 'ico'=>''],
  194. 'evil_only' => ['title'=>'Evil Only', 'ico'=>''],
  195. 'novalue' => ['title'=>'No Value', 'ico'=>''],
  196. 'ornate' => ['title'=>'Ornate', 'ico'=>''],
  197. 'etheral' => ['title'=>'Etheral', 'ico'=>''],
  198. 'appearance_only' => ['title'=>'Appearance Only', 'ico'=>''],
  199. 'reforged' => ['title'=>'Reforged', 'ico'=>''],
  200. 'refined' => ['title'=>'Refined', 'ico'=>''],
  201. 'usable' => ['title'=>'Usable', 'ico'=>''],
  202. 'harvest' => ['title'=>'Harvest', 'ico'=>''],
  203. 'collectable' => ['title'=>'Collectable', 'ico'=>''],
  204. 'unlocked' => ['title'=>'Unlocked', 'ico'=>'']
  205. ];
  206. foreach($_switches as $k => $v) {
  207. echo '
  208. <div class="col-xs-12 col-sm-6 col-md-6 col-lg-6 col-xl-6">
  209. '.build_edit_input(['key'=>'id','table'=>'items','field'=>$k,'value'=>$item[$k],'icon'=>$v['ico'],'title'=>$v['title'],'id'=>$item['id'],'show-label'=>true,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>NULL, 'field_type'=>'switch']).'
  210. </div>';
  211. }
  212. ?>
  213. </div>
  214. </div> <!-- fas fa-toilet-paper, fas fa-book-spells -->
  215. </div>
  216. </div>
  217. <!-- End: Flags Panel -->
  218. <!-- Spell Effects Panel -->
  219. <div id="itemeditor-fx" class="panel">
  220. <div class="panel-hdr">
  221. <h4 class="mb-0 color-secondary"><i class="fad fa-flask-potion color-info-700"></i>&nbsp;Effects</h4>
  222. </div>
  223. <div class="panel-container show" style="">
  224. <div class="panel-content">
  225. <div class="row">
  226. <div class="col-xl-12">
  227. <?php
  228. echo build_edit_input(['key'=>'id','table'=>'items','field'=>'max_charges','value'=>$item['max_charges'],'id'=>$item['id'],'title'=>'Max Charges','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Number of charges for the clickable item effect.','type'=>'number']);
  229. echo build_edit_input(['key'=>'id','table'=>'items','field'=>'display_charges','value'=>$item['display_charges'],'icon'=>NULL,'title'=>'Show Charges','id'=>$item['id'],'show-label'=>true,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>NULL, 'field_type'=>'switch']);
  230. ?>
  231. </div>
  232. </div>
  233. </div>
  234. </div>
  235. </div>
  236. <!-- End: Spell Effects Panel -->
  237. </div>
  238. <!-- End: Right Slim Column -->
  239. <?php
  240. $_unknownFields = [
  241. 'flags_16384','flags_32768','flags2_256','soe_item_id','soe_item_crc',
  242. 'offers_quest_id','soe_autoquest_id','part_of_quest_id','quest_unknown',
  243. 'tradeskill_classes','adventure_classes'
  244. ];
  245. ?>
  246. <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
  247. <!-- Unknown Columns Panel -->
  248. <div id="itemeditor-unknown" class="panel">
  249. <div class="panel-hdr">
  250. <h4 class="mb-0 color-secondary"><i class="fad fa-map-marker-question color-primary-700"></i>&nbsp;Unknown Fields</h4>
  251. </div>
  252. <div class="panel-container show" style="">
  253. <div class="panel-content">
  254. <div class="row">
  255. <?php
  256. foreach($_unknownFields as $f) {
  257. echo '<div class="col-xl-4">
  258. '.build_edit_input(['key'=>'id','table'=>'items','field'=>$f,'value'=>$item[$f],'id'=>$item['id'],'title'=>$f,'icon'=>'fad fa-tag','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Enter item name ...']).'
  259. </div>';
  260. }
  261. ?>
  262. </div>
  263. </div>
  264. </div>
  265. </div>
  266. <!-- End: Unknown Columns Panel -->
  267. </div>
  268. </div> <!-- Row -->
  269. </div> <!-- Col -->