9
3

Items.h 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043
  1. /*
  2. EQ2Emulator: Everquest II Server Emulator
  3. Copyright (C) 2007 EQ2EMulator Development Team (http://www.eq2emulator.net)
  4. This file is part of EQ2Emulator.
  5. EQ2Emulator is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. EQ2Emulator is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with EQ2Emulator. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #ifndef __EQ2_ITEMS__
  17. #define __EQ2_ITEMS__
  18. #include <map>
  19. #include <vector>
  20. #include "../../common/types.h"
  21. #include "../../common/DataBuffer.h"
  22. #include "../../common/MiscFunctions.h"
  23. #include "../Commands/Commands.h"
  24. #include "../../common/ConfigReader.h"
  25. using namespace std;
  26. class MasterItemList;
  27. class Player;
  28. class Entity;
  29. extern MasterItemList master_item_list;
  30. #define EQ2_PRIMARY_SLOT 0
  31. #define EQ2_SECONDARY_SLOT 1
  32. #define EQ2_HEAD_SLOT 2
  33. #define EQ2_CHEST_SLOT 3
  34. #define EQ2_SHOULDERS_SLOT 4
  35. #define EQ2_FOREARMS_SLOT 5
  36. #define EQ2_HANDS_SLOT 6
  37. #define EQ2_LEGS_SLOT 7
  38. #define EQ2_FEET_SLOT 8
  39. #define EQ2_LRING_SLOT 9
  40. #define EQ2_RRING_SLOT 10
  41. #define EQ2_EARS_SLOT_1 11
  42. #define EQ2_EARS_SLOT_2 12
  43. #define EQ2_NECK_SLOT 13
  44. #define EQ2_LWRIST_SLOT 14
  45. #define EQ2_RWRIST_SLOT 15
  46. #define EQ2_RANGE_SLOT 16
  47. #define EQ2_AMMO_SLOT 17
  48. #define EQ2_WAIST_SLOT 18
  49. #define EQ2_CLOAK_SLOT 19
  50. #define EQ2_CHARM_SLOT_1 20
  51. #define EQ2_CHARM_SLOT_2 21
  52. #define EQ2_FOOD_SLOT 22
  53. #define EQ2_DRINK_SLOT 23
  54. #define EQ2_TEXTURES_SLOT 24
  55. #define EQ2_HAIR_SLOT 25
  56. #define EQ2_BEARD_SLOT 26
  57. #define EQ2_WINGS_SLOT 27
  58. #define EQ2_NAKED_CHEST_SLOT 28
  59. #define EQ2_NAKED_LEGS_SLOT 29
  60. #define EQ2_BACK_SLOT 30
  61. #define EQ2_ORIG_FOOD_SLOT 18
  62. #define EQ2_ORIG_DRINK_SLOT 19
  63. #define PRIMARY_SLOT 1
  64. #define SECONDARY_SLOT 2
  65. #define HEAD_SLOT 4
  66. #define CHEST_SLOT 8
  67. #define SHOULDERS_SLOT 16
  68. #define FOREARMS_SLOT 32
  69. #define HANDS_SLOT 64
  70. #define LEGS_SLOT 128
  71. #define FEET_SLOT 256
  72. #define LRING_SLOT 512
  73. #define RRING_SLOT 1024
  74. #define EARS_SLOT_1 2048
  75. #define EARS_SLOT_2 4096
  76. #define NECK_SLOT 8192
  77. #define LWRIST_SLOT 16384
  78. #define RWRIST_SLOT 32768
  79. #define RANGE_SLOT 65536
  80. #define AMMO_SLOT 131072
  81. #define WAIST_SLOT 262144
  82. #define CLOAK_SLOT 524288
  83. #define CHARM_SLOT_1 1048576
  84. #define CHARM_SLOT_2 2097152
  85. #define FOOD_SLOT 4194304
  86. #define DRINK_SLOT 8388608
  87. #define TEXTURES_SLOT 16777216
  88. #define HAIR_SLOT 33554432
  89. #define BEARD_SLOT 67108864
  90. #define WINGS_SLOT 134217728
  91. #define NAKED_CHEST_SLOT 268435456
  92. #define NAKED_LEGS_SLOT 536870912
  93. #define BACK_SLOT 1073741824
  94. #define ORIG_FOOD_SLOT 524288
  95. #define ORIG_DRINK_SLOT 1048576
  96. #define CLASSIC_EQ_MAX_BAG_SLOTS 20
  97. #define NUM_BANK_SLOTS 12
  98. #define NUM_SHARED_BANK_SLOTS 8
  99. #define NUM_SLOTS 25
  100. #define NUM_INV_SLOTS 6
  101. #define INV_SLOT1 0
  102. #define INV_SLOT2 50
  103. #define INV_SLOT3 100
  104. #define INV_SLOT4 150
  105. #define INV_SLOT5 200
  106. #define INV_SLOT6 250
  107. #define BANK_SLOT1 1000
  108. #define BANK_SLOT2 1100
  109. #define BANK_SLOT3 1200
  110. #define BANK_SLOT4 1300
  111. #define BANK_SLOT5 1400
  112. #define BANK_SLOT6 1500
  113. #define BANK_SLOT7 1600
  114. #define BANK_SLOT8 1700
  115. #define ATTUNED 1
  116. #define ATTUNEABLE 2
  117. #define ARTIFACT 4
  118. #define LORE 8
  119. #define TEMPORARY 16
  120. #define NO_TRADE 32
  121. #define NO_VALUE 64
  122. #define NO_ZONE 128
  123. #define NO_DESTROY 256
  124. #define CRAFTED 512
  125. #define GOOD_ONLY 1024
  126. #define EVIL_ONLY 2048
  127. #define STACK_LORE 4096
  128. #define LORE_EQUIP 8192
  129. #define FLAGS_16384 16384
  130. #define FLAGS_32768 32768
  131. #define ORNATE 1
  132. #define HEIRLOOM 2
  133. #define APPEARANCE_ONLY 4
  134. #define UNLOCKED 8
  135. #define REFORGED 16
  136. #define NO_REPAIR 32
  137. #define ETHERAL 64
  138. #define REFINED 128
  139. #define FLAGS2_256 256 //not used at this time
  140. #define FLAGS2_512 512//not used at this time
  141. #define FLAGS2_1024 1024//not used at this time
  142. #define FLAGS2_2048 2048//not used at this time
  143. #define FLAGS2_4096 4096//not used at this time
  144. #define FLAGS2_8192 8192//not used at this time
  145. #define FLAGS2_16384 16384//not used at this time
  146. #define FLAGS2_32768 32768//not used at this time
  147. #define ITEM_WIELD_TYPE_DUAL 1
  148. #define ITEM_WIELD_TYPE_SINGLE 2
  149. #define ITEM_WIELD_TYPE_TWO_HAND 4
  150. #define ITEM_TYPE_NORMAL 0
  151. #define ITEM_TYPE_WEAPON 1
  152. #define ITEM_TYPE_RANGED 2
  153. #define ITEM_TYPE_ARMOR 3
  154. #define ITEM_TYPE_SHIELD 4
  155. #define ITEM_TYPE_BAG 5
  156. #define ITEM_TYPE_SKILL 6
  157. #define ITEM_TYPE_RECIPE 7
  158. #define ITEM_TYPE_FOOD 8
  159. #define ITEM_TYPE_BAUBLE 9
  160. #define ITEM_TYPE_HOUSE 10
  161. #define ITEM_TYPE_THROWN 11
  162. #define ITEM_TYPE_HOUSE_CONTAINER 12
  163. #define ITEM_TYPE_ADORNMENT 13
  164. #define ITEM_TYPE_GENERIC_ADORNMENT 14
  165. #define ITEM_TYPE_PROFILE 16
  166. #define ITEM_TYPE_PATTERN 17
  167. #define ITEM_TYPE_ARMORSET 18
  168. #define ITEM_TYPE_ITEMCRATE 18
  169. #define ITEM_TYPE_BOOK 19
  170. #define ITEM_TYPE_DECORATION 20
  171. #define ITEM_TYPE_DUNGEON_MAKER 21
  172. #define ITEM_TYPE_MARKETPLACE 22
  173. //DOV defines everything till 13 is the same
  174. //#define ITEM_TYPE_BOOK 13
  175. //#define ITEM_TYPE_ADORNMENT 14
  176. //#define ITEM_TYPE_PATTERN 15
  177. //#define ITEM_TYPE_ARMORSET 16
  178. #define ITEM_MENU_TYPE_GENERIC 1 //0
  179. #define ITEM_MENU_TYPE_EQUIP 2 //1
  180. #define ITEM_MENU_TYPE_BAG 4//2
  181. #define ITEM_MENU_TYPE_HOUSE 8 //3 Place
  182. #define ITEM_MENU_TYPE_EMPTY_BAG 16 //4
  183. #define ITEM_MENU_TYPE_SCRIBE 32//5
  184. #define ITEM_MENU_TYPE_BANK_BAG 64//6
  185. #define ITEM_MENU_TYPE_INSUFFICIENT_KNOWLEDGE 128//7
  186. #define ITEM_MENU_TYPE_ACTIVATE 256//8
  187. #define ITEM_MENU_TYPE_BROKEN 512//9
  188. #define ITEM_MENU_TYPE_TWO_HANDED 1024//10
  189. #define ITEM_MENU_TYPE_ATTUNED 2048//11
  190. #define ITEM_MENU_TYPE_ATTUNEABLE 4096//12
  191. #define ITEM_MENU_TYPE_BOOK 8192//13
  192. #define ITEM_MENU_TYPE_DISPLAY_CHARGES 16384//14
  193. #define ITEM_MENU_TYPE_TEST1 32768//15 Possibly toogle decorator mode
  194. #define ITEM_MENU_TYPE_NAMEPET 65536 //16 Right CLick Menu
  195. #define ITEM_MENU_TYPE_TEST2 131072 //sets a purple background on item
  196. #define ITEM_MENU_TYPE_CONSUME 262144//18
  197. #define ITEM_MENU_TYPE_USE 524288//19
  198. #define ITEM_MENU_TYPE_CONSUME_OFF 1048576//20
  199. #define ITEM_MENU_TYPE_TEST3 1310720// bad number combo of 2 bits
  200. #define ITEM_MENU_TYPE_TEST4 2097152//21
  201. #define ITEM_MENU_TYPE_TEST5 4194304//22 infusable
  202. #define ITEM_MENU_TYPE_TEST6 8388608 //drink option on menu
  203. #define ITEM_MENU_TYPE_TEST7 16777216//24
  204. #define ITEM_MENU_TYPE_TEST8 33554432 // bit 25 use option in bags
  205. #define ITEM_MENU_TYPE_TEST9 67108864//26
  206. #define ITEM_MENU_TYPE_DAMAGED 134217728 //27
  207. #define ITEM_MENU_TYPE_BROKEN2 268435456 //28
  208. #define ITEM_MENU_TYPE_REDEEM 536870912 //29 //READ??
  209. #define ITEM_MENU_TYPE_TEST10 1073741824 //30
  210. #define ITEM_MENU_TYPE_UNPACK 2147483648//31 * on items i found this unpack is used at same time as UNPACK below
  211. #define ORIG_ITEM_MENU_TYPE_FOOD 2048
  212. #define ORIG_ITEM_MENU_TYPE_DRINK 4096
  213. #define ORIG_ITEM_MENU_TYPE_ATTUNED 8192
  214. #define ORIG_ITEM_MENU_TYPE_ATTUNEABLE 16384
  215. #define ORIG_ITEM_MENU_TYPE_BOOK 32768
  216. #define ORIG_ITEM_MENU_TYPE_STACKABLE 65536
  217. #define ITEM_MENU_TYPE2_TEST1 1 //0 auto consume on
  218. #define ITEM_MENU_TYPE2_TEST2 2 //1
  219. #define ITEM_MENU_TYPE2_UNPACK 4//2
  220. #define ITEM_MENU_TYPE2_TEST4 8 //3
  221. #define ITEM_MENU_TYPE2_TEST5 16 //4
  222. #define ITEM_MENU_TYPE2_TEST6 32//5
  223. #define ITEM_MENU_TYPE2_TEST7 64//6
  224. #define ITEM_MENU_TYPE2_TEST8 128//7
  225. #define ITEM_MENU_TYPE2_TEST9 256//8
  226. #define ITEM_MENU_TYPE2_TEST10 512//9
  227. #define ITEM_MENU_TYPE2_TEST11 1024//10
  228. #define ITEM_MENU_TYPE2_TEST12 2048//11
  229. #define ITEM_MENU_TYPE2_TEST13 4096//12
  230. #define ITEM_MENU_TYPE2_TEST14 8192//13
  231. #define ITEM_MENU_TYPE2_TEST15 16384//14
  232. #define ITEM_MENU_TYPE2_TEST16 32768//15
  233. #define ITEM_TAG_UNCOMMON 3 //tier tags
  234. #define ITEM_TAG_TREASURED 4
  235. #define ITEM_TAG_LEGENDARY 7
  236. #define ITEM_TAG_FABLED 9
  237. #define ITEM_TAG_MYTHICAL 12
  238. #define ITEM_BROKER_TYPE_ANY 0xFFFFFFFF
  239. #define ITEM_BROKER_TYPE_ADORNMENT 134217728
  240. #define ITEM_BROKER_TYPE_AMMO 1024
  241. #define ITEM_BROKER_TYPE_ATTUNEABLE 16384
  242. #define ITEM_BROKER_TYPE_BAG 2048
  243. #define ITEM_BROKER_TYPE_BAUBLE 16777216
  244. #define ITEM_BROKER_TYPE_BOOK 128
  245. #define ITEM_BROKER_TYPE_CHAINARMOR 2097152
  246. #define ITEM_BROKER_TYPE_CLOAK 1073741824
  247. #define ITEM_BROKER_TYPE_CLOTHARMOR 524288
  248. #define ITEM_BROKER_TYPE_COLLECTABLE 67108864
  249. #define ITEM_BROKER_TYPE_CRUSHWEAPON 4
  250. #define ITEM_BROKER_TYPE_DRINK 131072
  251. #define ITEM_BROKER_TYPE_FOOD 4096
  252. #define ITEM_BROKER_TYPE_HOUSEITEM 512
  253. #define ITEM_BROKER_TYPE_JEWELRY 262144
  254. #define ITEM_BROKER_TYPE_LEATHERARMOR 1048576
  255. #define ITEM_BROKER_TYPE_LORE 8192
  256. #define ITEM_BROKER_TYPE_MISC 1
  257. #define ITEM_BROKER_TYPE_PIERCEWEAPON 8
  258. #define ITEM_BROKER_TYPE_PLATEARMOR 4194304
  259. #define ITEM_BROKER_TYPE_POISON 65536
  260. #define ITEM_BROKER_TYPE_POTION 32768
  261. #define ITEM_BROKER_TYPE_RECIPEBOOK 8388608
  262. #define ITEM_BROKER_TYPE_SALESDISPLAY 33554432
  263. #define ITEM_BROKER_TYPE_SHIELD 32
  264. #define ITEM_BROKER_TYPE_SLASHWEAPON 2
  265. #define ITEM_BROKER_TYPE_SPELLSCROLL 64
  266. #define ITEM_BROKER_TYPE_TINKERED 268435456
  267. #define ITEM_BROKER_TYPE_TRADESKILL 256
  268. #define ITEM_BROKER_SLOT_ANY 0xFFFFFFFF
  269. #define ITEM_BROKER_SLOT_AMMO 65536
  270. #define ITEM_BROKER_SLOT_CHARM 524288
  271. #define ITEM_BROKER_SLOT_CHEST 32
  272. #define ITEM_BROKER_SLOT_CLOAK 262144
  273. #define ITEM_BROKER_SLOT_DRINK 2097152
  274. #define ITEM_BROKER_SLOT_EARS 4096
  275. #define ITEM_BROKER_SLOT_FEET 1024
  276. #define ITEM_BROKER_SLOT_FOOD 1048576
  277. #define ITEM_BROKER_SLOT_FOREARMS 128
  278. #define ITEM_BROKER_SLOT_HANDS 256
  279. #define ITEM_BROKER_SLOT_HEAD 16
  280. #define ITEM_BROKER_SLOT_LEGS 512
  281. #define ITEM_BROKER_SLOT_NECK 8192
  282. #define ITEM_BROKER_SLOT_PRIMARY 1
  283. #define ITEM_BROKER_SLOT_PRIMARY_2H 2
  284. #define ITEM_BROKER_SLOT_RANGE_WEAPON 32768
  285. #define ITEM_BROKER_SLOT_RING 2048
  286. #define ITEM_BROKER_SLOT_SECONDARY 8
  287. #define ITEM_BROKER_SLOT_SHOULDERS 64
  288. #define ITEM_BROKER_SLOT_WAIST 131072
  289. #define ITEM_BROKER_SLOT_WRIST 16384
  290. #define ITEM_BROKER_STAT_TYPE_NONE 0
  291. #define ITEM_BROKER_STAT_TYPE_DEF 2
  292. #define ITEM_BROKER_STAT_TYPE_STR 4
  293. #define ITEM_BROKER_STAT_TYPE_STA 8
  294. #define ITEM_BROKER_STAT_TYPE_AGI 16
  295. #define ITEM_BROKER_STAT_TYPE_WIS 32
  296. #define ITEM_BROKER_STAT_TYPE_INT 64
  297. #define ITEM_BROKER_STAT_TYPE_HEALTH 128
  298. #define ITEM_BROKER_STAT_TYPE_POWER 256
  299. #define ITEM_BROKER_STAT_TYPE_HEAT 512
  300. #define ITEM_BROKER_STAT_TYPE_COLD 1024
  301. #define ITEM_BROKER_STAT_TYPE_MAGIC 2048
  302. #define ITEM_BROKER_STAT_TYPE_MENTAL 4096
  303. #define ITEM_BROKER_STAT_TYPE_DIVINE 8192
  304. #define ITEM_BROKER_STAT_TYPE_POISON 16384
  305. #define ITEM_BROKER_STAT_TYPE_DISEASE 32768
  306. #define ITEM_BROKER_STAT_TYPE_CRUSH 65536
  307. #define ITEM_BROKER_STAT_TYPE_SLASH 131072
  308. #define ITEM_BROKER_STAT_TYPE_PIERCE 262144
  309. #define ITEM_BROKER_STAT_TYPE_CRITICAL 524288
  310. #define ITEM_BROKER_STAT_TYPE_DBL_ATTACK 1048576
  311. #define ITEM_BROKER_STAT_TYPE_ABILITY_MOD 2097152
  312. #define ITEM_BROKER_STAT_TYPE_POTENCY 4194304
  313. #define OVERFLOW_SLOT 0xFFFFFFFE
  314. #define SLOT_INVALID 0xFFFF
  315. #define ITEM_STAT_STR 0
  316. #define ITEM_STAT_STA 1
  317. #define ITEM_STAT_AGI 2
  318. #define ITEM_STAT_WIS 3
  319. #define ITEM_STAT_INT 4
  320. #define ITEM_STAT_VS_PHYSICAL 200
  321. #define ITEM_STAT_VS_HEAT 201 //elemental
  322. #define ITEM_STAT_VS_POISON 202 //noxious
  323. #define ITEM_STAT_VS_MAGIC 203 //arcane
  324. #define ITEM_STAT_VS_DROWNING 210
  325. #define ITEM_STAT_VS_FALLING 211
  326. #define ITEM_STAT_VS_PAIN 212
  327. #define ITEM_STAT_VS_MELEE 213
  328. #define ITEM_STAT_VS_SLASH 204
  329. #define ITEM_STAT_VS_CRUSH 205
  330. #define ITEM_STAT_VS_PIERCE 206
  331. //#define ITEM_STAT_VS_HEAT 203 //just so no build error
  332. #define ITEM_STAT_VS_COLD 207
  333. //#define ITEM_STAT_VS_MAGIC 205 //just so no build error
  334. #define ITEM_STAT_VS_MENTAL 208
  335. #define ITEM_STAT_VS_DIVINE 209
  336. #define ITEM_STAT_VS_DISEASE 214
  337. //#define ITEM_STAT_VS_POISON 209 //just so no build error
  338. //#define ITEM_STAT_VS_DROWNING 210 //just so no build error
  339. //#define ITEM_STAT_VS_FALLING 211 //just so no build error
  340. //#define ITEM_STAT_VS_PAIN 212 //just so no build error
  341. //#define ITEM_STAT_VS_MELEE 213 //just so no build error
  342. #define ITEM_STAT_DMG_SLASH 300
  343. #define ITEM_STAT_DMG_CRUSH 301
  344. #define ITEM_STAT_DMG_PIERCE 302
  345. #define ITEM_STAT_DMG_HEAT 303
  346. #define ITEM_STAT_DMG_COLD 304
  347. #define ITEM_STAT_DMG_MAGIC 305
  348. #define ITEM_STAT_DMG_MENTAL 306
  349. #define ITEM_STAT_DMG_DIVINE 307
  350. #define ITEM_STAT_DMG_DISEASE 308
  351. #define ITEM_STAT_DMG_POISON 309
  352. #define ITEM_STAT_DMG_DROWNING 310
  353. #define ITEM_STAT_DMG_FALLING 311
  354. #define ITEM_STAT_DMG_PAIN 312
  355. #define ITEM_STAT_DMG_MELEE 313
  356. #define ITEM_STAT_DEFLECTIONCHANCE 400 //just so no build error
  357. #define ITEM_STAT_HEALTH 500
  358. #define ITEM_STAT_POWER 501
  359. #define ITEM_STAT_CONCENTRATION 502
  360. #define ITEM_STAT_SAVAGERY 503
  361. //this is the master stat list you should be using and names match what is in census. it is based off of DoV. the comment is what is displayed on items when examining
  362. //the itemstats table will maintain the custom lists per expansion
  363. // emu # is digits after the 6
  364. #define ITEM_STAT_HPREGEN 600 //Health Regeneration
  365. #define ITEM_STAT_MANAREGEN 601 //Power Regeneration
  366. #define ITEM_STAT_HPREGENPPT 602 //Out-of-Combat Health Regeneration %%?
  367. #define ITEM_STAT_MPREGENPPT 603 //Out-of-Combat Power Regeneration %%?
  368. #define ITEM_STAT_COMBATHPREGENPPT 604 //In-Combat Health Regeneration %%?
  369. #define ITEM_STAT_COMBATMPREGENPPT 605 //In-Combat Power Regeneration %%?
  370. #define ITEM_STAT_MAXHP 606 //Max Health
  371. #define ITEM_STAT_MAXHPPERC 607
  372. #define ITEM_STAT_MAXHPPERCFINAL 608 //% Max Mealth
  373. #define ITEM_STAT_SPEED 609 //Out of Combat Run Speed
  374. #define ITEM_STAT_SLOW 610 //Slow
  375. #define ITEM_STAT_MOUNTSPEED 611 //Ground Mount Speed
  376. #define ITEM_STAT_MOUNTAIRSPEED 612 //Mount Air Speed
  377. #define ITEM_STAT_LEAPSPEED 613
  378. #define ITEM_STAT_LEAPTIME 614
  379. #define ITEM_STAT_GLIDEEFFICIENCY 615
  380. #define ITEM_STAT_OFFENSIVESPEED 616 //In Combat Run Speed
  381. #define ITEM_STAT_ATTACKSPEED 617 //% Attack Speed
  382. #define ITEM_STAT_SPELLWEAPONATTACKSPEED 618
  383. #define ITEM_STAT_MAXMANA 619 //Max Power
  384. #define ITEM_STAT_MAXMANAPERC 620 //% Max Power
  385. #define ITEM_STAT_MAXATTPERC 621 //All Attributes //is this a percent or is it a stat change
  386. #define ITEM_STAT_BLURVISION 622 //Blurs Vision
  387. #define ITEM_STAT_MAGICLEVELIMMUNITY 623 //Magic Level Immunity
  388. #define ITEM_STAT_HATEGAINMOD 624 //% Hate Gain
  389. #define ITEM_STAT_COMBATEXPMOD 625 //Combat XP Gain
  390. #define ITEM_STAT_TRADESKILLEXPMOD 626 //Tradeskill XP Gain
  391. #define ITEM_STAT_ACHIEVEMENTEXPMOD 627 //AA XP Gain
  392. #define ITEM_STAT_SIZEMOD 628 //Size
  393. #define ITEM_STAT_DPS 629 //%Damage Per Second
  394. #define ITEM_STAT_SPELLWEAPONDPS 630 //%Damage Per Second
  395. #define ITEM_STAT_STEALTH 631 //Stealth
  396. #define ITEM_STAT_INVIS 632 //Invisibility
  397. #define ITEM_STAT_SEESTEALTH 633 //See Stealth
  398. #define ITEM_STAT_SEEINVIS 634 //See Invisible
  399. #define ITEM_STAT_EFFECTIVELEVELMOD 635 //Effective Level
  400. #define ITEM_STAT_RIPOSTECHANCE 636 //%Extra Riposte Chance
  401. #define ITEM_STAT_PARRYCHANCE 637 //%Extra Parry Chance
  402. #define ITEM_STAT_DODGECHANCE 638 //%Extra Dodge Chance
  403. #define ITEM_STAT_AEAUTOATTACKCHANCE 639 //% AE Autoattck Chance
  404. #define ITEM_STAT_SPELLWEAPONAEAUTOATTACKCHANCE 640 //
  405. #define ITEM_STAT_MULTIATTACKCHANCE 641 //% Multi Attack Chance // inconsistant with db
  406. #define ITEM_STAT_PVPDOUBLEATTACKCHANCE 642
  407. #define ITEM_STAT_SPELLWEAPONDOUBLEATTACKCHANCE 643 // missing in db
  408. #define ITEM_STAT_PVPSPELLWEAPONDOUBLEATTACKCHANCE 644
  409. #define ITEM_STAT_SPELLMULTIATTACKCHANCE 645 //% Spell Multi Atttack Chance
  410. #define ITEM_STAT_PVPSPELLDOUBLEATTACKCHANCE 646
  411. #define ITEM_STAT_FLURRY 647 //%Flurry
  412. #define ITEM_STAT_SPELLWEAPONFLURRY 648
  413. #define ITEM_STAT_MELEEDAMAGEMULTIPLIER 649 //Melee Damage Multiplier
  414. #define ITEM_STAT_EXTRAHARVESTCHANCE 650 //Extra Harvest Chance
  415. #define ITEM_STAT_EXTRASHIELDBLOCKCHANCE 651 //Block Chance
  416. #define ITEM_STAT_ITEMHPREGENPPT 652 //In-Combat Health Regeneration
  417. #define ITEM_STAT_ITEMPPREGENPPT 653 //In-Combat Power Regeneration
  418. #define ITEM_STAT_MELEECRITCHANCE 654 //% Crit Chance
  419. #define ITEM_STAT_CRITAVOIDANCE 655 //% Crit Avoidance
  420. #define ITEM_STAT_BENEFICIALCRITCHANCE 656 //% Beneficial Crit Chance
  421. #define ITEM_STAT_CRITBONUS 657 //% Crit Bonus
  422. #define ITEM_STAT_PVPCRITBONUS 658
  423. #define ITEM_STAT_POTENCY 659 //% Potency
  424. #define ITEM_STAT_PVPPOTENCY 660
  425. #define ITEM_STAT_UNCONSCIOUSHPMOD 661 //Unconcious Health
  426. #define ITEM_STAT_ABILITYREUSESPEED 662 //% Ability Reuse Speed
  427. #define ITEM_STAT_ABILITYRECOVERYSPEED 663 //% Ability Recovery Speed
  428. #define ITEM_STAT_ABILITYCASTINGSPEED 664 //% Ability Casting Speed
  429. #define ITEM_STAT_SPELLREUSESPEED 665 //% Spell Reuse Speed
  430. #define ITEM_STAT_MELEEWEAPONRANGE 666 //% Melee Weapon Range Increase
  431. #define ITEM_STAT_RANGEDWEAPONRANGE 667 //% Ranged Weapon Range Increase
  432. #define ITEM_STAT_FALLINGDAMAGEREDUCTION 668 //Fallling Damage Reduction
  433. #define ITEM_STAT_RIPOSTEDAMAGE 669 //% Riposte Damage
  434. #define ITEM_STAT_MINIMUMDEFLECTIONCHANCE 670 //% Minimum Block Chance
  435. #define ITEM_STAT_MOVEMENTWEAVE 671 //Movement Weave
  436. #define ITEM_STAT_COMBATHPREGEN 672 //Combat HP Regen
  437. #define ITEM_STAT_COMBATMANAREGEN 673 //Combat Mana Regen
  438. #define ITEM_STAT_CONTESTSPEEDBOOST 674 //Contest Only Speed
  439. #define ITEM_STAT_TRACKINGAVOIDANCE 675 //Tracking avoidance
  440. #define ITEM_STAT_STEALTHINVISSPEEDMOD 676 //Movement Bonus whie Stealthed or Invisible
  441. #define ITEM_STAT_LOOT_COIN 677 //Loot Coin
  442. #define ITEM_STAT_ARMORMITIGATIONINCREASE 678 //% Mitigation Increase
  443. #define ITEM_STAT_AMMOCONSERVATION 679 // Ammo Conservation
  444. #define ITEM_STAT_STRIKETHROUGH 680 //Strikethrough
  445. #define ITEM_STAT_STATUSBONUS 681 //Status Bonus
  446. #define ITEM_STAT_ACCURACY 682 //% Accuracy
  447. #define ITEM_STAT_COUNTERSTRIKE 683 //CounterStrike
  448. #define ITEM_STAT_SHIELDBASH 684 //Shield Bash
  449. #define ITEM_STAT_WEAPONDAMAGEBONUS 685 //Weapon Damage Bonus
  450. #define ITEM_STAT_WEAPONDAMAGEBONUSMELEEONLY 686 //additional chance to Riposte
  451. #define ITEM_STAT_ADDITIONALRIPOSTECHANCE 687 //additional chance to Riposte
  452. #define ITEM_STAT_CRITICALMITIGATION 688 //Critical Mitigation
  453. #define ITEM_STAT_PVPTOUGHNESS 689 //Toughness
  454. #define ITEM_STAT_PVPLETHALITY 690 //
  455. #define ITEM_STAT_STAMINABONUS 691 //Stamina Bonus
  456. #define ITEM_STAT_WISDOMMITBONUS 692 //Wisdom Mitigation Bonus
  457. #define ITEM_STAT_HEALRECEIVE 693 //Applied Heals
  458. #define ITEM_STAT_HEALRECEIVEPERC 694 //% Applied Heals
  459. #define ITEM_STAT_PVPCRITICALMITIGATION 695 //PvP Critical Mitigation
  460. #define ITEM_STAT_BASEAVOIDANCEBONUS 696
  461. #define ITEM_STAT_INCOMBATSAVAGERYREGEN 697
  462. #define ITEM_STAT_OUTOFCOMBATSAVAGERYREGEN 698
  463. #define ITEM_STAT_SAVAGERYREGEN 699
  464. #define ITEM_STAT_SAVAGERYGAINMOD 6100
  465. #define ITEM_STAT_MAXSAVAGERYLEVEL 6101
  466. #define ITEM_STAT_SPELLWEAPONDAMAGEBONUS 6102
  467. #define ITEM_STAT_INCOMBATDISSONANCEREGEN 6103
  468. #define ITEM_STAT_OUTOFCOMBATDISSONANCEREGEN 6104
  469. #define ITEM_STAT_DISSONANCEREGEN 6105
  470. #define ITEM_STAT_DISSONANCEGAINMOD 6106
  471. #define ITEM_STAT_AEAUTOATTACKAVOID 6107
  472. #define ITEM_STAT_AGNOSTICDAMAGEBONUS 6108
  473. #define ITEM_STAT_AGNOSTICHEALBONUS 6109
  474. #define ITEM_STAT_TITHEGAIN 6110
  475. #define ITEM_STAT_FERVER 6111
  476. #define ITEM_STAT_RESOLVE 6112
  477. #define ITEM_STAT_COMBATMITIGATION 6113
  478. #define ITEM_STAT_ABILITYMITIGATION 6114
  479. #define ITEM_STAT_MULTIATTACKAVOIDANCE 6115
  480. #define ITEM_STAT_DOUBLECASTAVOIDANCE 6116
  481. #define ITEM_STAT_ABILITYDOUBLECASTAVOIDANCE 6117
  482. #define ITEM_STAT_DAMAGEPERSECONDMITIGATION 6118
  483. #define ITEM_STAT_FERVERMITIGATION 6119
  484. #define ITEM_STAT_FLURRYAVOIDANCE 6120
  485. #define ITEM_STAT_WEAPONDAMAGEBONUSMITIGATION 6121
  486. #define ITEM_STAT_ABILITYDOUBLECASTCHANCE 6122
  487. #define ITEM_STAT_ABILITYMODIFIERMITIGATATION 6123
  488. #define ITEM_STAT_STATUSEARNED 6124
  489. #define ITEM_STAT_SPELL_DAMAGE 700
  490. #define ITEM_STAT_HEAL_AMOUNT 701
  491. #define ITEM_STAT_SPELL_AND_HEAL 702
  492. #define ITEM_STAT_COMBAT_ART_DAMAGE 703
  493. #define ITEM_STAT_SPELL_AND_COMBAT_ART_DAMAGE 704
  494. #define ITEM_STAT_TAUNT_AMOUNT 705
  495. #define ITEM_STAT_TAUNT_AND_COMBAT_ART_DAMAGE 706
  496. #define ITEM_STAT_ABILITY_MODIFIER 707
  497. // Other stats not listed above (not sent from the server), never send these to the client
  498. // using type 8 as it is not used by the client as far as we know
  499. #define ITEM_STAT_DURABILITY_MOD 800
  500. #define ITEM_STAT_DURABILITY_ADD 801
  501. #define ITEM_STAT_PROGRESS_ADD 802
  502. #define ITEM_STAT_PROGRESS_MOD 803
  503. #define ITEM_STAT_SUCCESS_MOD 804
  504. #define ITEM_STAT_CRIT_SUCCESS_MOD 805
  505. #define ITEM_STAT_EX_DURABILITY_MOD 806
  506. #define ITEM_STAT_EX_DURABILITY_ADD 807
  507. #define ITEM_STAT_EX_PROGRESS_MOD 808
  508. #define ITEM_STAT_EX_PROGRESS_ADD 809
  509. #define ITEM_STAT_EX_SUCCESS_MOD 810
  510. #define ITEM_STAT_EX_CRIT_SUCCESS_MOD 811
  511. #define ITEM_STAT_EX_CRIT_FAILURE_MOD 812
  512. #define ITEM_STAT_RARE_HARVEST_CHANCE 813
  513. #define ITEM_STAT_MAX_CRAFTING 814
  514. #define ITEM_STAT_COMPONENT_REFUND 815
  515. #define ITEM_STAT_BOUNTIFUL_HARVEST 816
  516. #define ITEM_STAT_UNCONTESTED_PARRY 850
  517. #define ITEM_STAT_UNCONTESTED_BLOCK 851
  518. #define ITEM_STAT_UNCONTESTED_DODGE 852
  519. #define ITEM_STAT_UNCONTESTED_RIPOSTE 853
  520. #pragma pack(1)
  521. struct ItemStatsValues{
  522. sint16 str;
  523. sint16 sta;
  524. sint16 agi;
  525. sint16 wis;
  526. sint16 int_;
  527. sint16 vs_slash;
  528. sint16 vs_crush;
  529. sint16 vs_pierce;
  530. sint16 vs_heat;
  531. sint16 vs_cold;
  532. sint16 vs_magic;
  533. sint16 vs_mental;
  534. sint16 vs_divine;
  535. sint16 vs_disease;
  536. sint16 vs_poison;
  537. sint16 health;
  538. sint16 power;
  539. sint8 concentration;
  540. sint16 ability_modifier;
  541. sint16 criticalmitigation;
  542. sint16 extrashieldblockchance;
  543. sint16 beneficialcritchance;
  544. sint16 critbonus;
  545. sint16 potency;
  546. sint16 hategainmod;
  547. sint16 abilityreusespeed;
  548. sint16 abilitycastingspeed;
  549. sint16 abilityrecoveryspeed;
  550. sint16 spellreusespeed;
  551. sint16 spellmultiattackchance;
  552. sint16 dps;
  553. sint16 attackspeed;
  554. sint16 multiattackchance;
  555. sint16 flurry;
  556. sint16 aeautoattackchance;
  557. sint16 strikethrough;
  558. sint16 accuracy;
  559. sint16 offensivespeed;
  560. float uncontested_parry;
  561. float uncontested_block;
  562. float uncontested_dodge;
  563. float uncontested_riposte;
  564. };
  565. struct ItemCore{
  566. int32 item_id;
  567. sint32 soe_id;
  568. int32 bag_id;
  569. sint32 inv_slot_id;
  570. sint16 slot_id;
  571. int8 index;
  572. int16 icon;
  573. int16 count;
  574. int8 tier;
  575. int8 num_slots;
  576. int32 unique_id;
  577. int8 num_free_slots;
  578. int16 recommended_level;
  579. };
  580. #pragma pack()
  581. struct ItemStat{
  582. string stat_name;
  583. int8 stat_type;
  584. sint16 stat_subtype;
  585. int16 stat_type_combined;
  586. float value;
  587. };
  588. struct ItemSet{
  589. int32 item_id;
  590. int32 item_crc;
  591. int16 item_icon;
  592. int16 item_stack_size;
  593. int32 item_list_color;
  594. };
  595. struct Classifications{
  596. int32 classification_id; //classifications MJ
  597. string classification_name;
  598. };
  599. struct ItemLevelOverride{
  600. int8 adventure_class;
  601. int8 tradeskill_class;
  602. int16 level;
  603. };
  604. struct ItemClass{
  605. int8 adventure_class;
  606. int8 tradeskill_class;
  607. int16 level;
  608. };
  609. struct ItemAppearance{
  610. int16 type;
  611. int8 red;
  612. int8 green;
  613. int8 blue;
  614. int8 highlight_red;
  615. int8 highlight_green;
  616. int8 highlight_blue;
  617. };
  618. class PlayerItemList;
  619. class Item{
  620. public:
  621. #pragma pack(1)
  622. struct ItemStatString{
  623. EQ2_8BitString stat_string;
  624. };
  625. struct Generic_Info{
  626. int8 show_name;
  627. int8 creator_flag;
  628. int16 item_flags;
  629. int16 item_flags2;
  630. int8 condition;
  631. int32 weight; // num/10
  632. int32 skill_req1;
  633. int32 skill_req2;
  634. int16 skill_min;
  635. int8 item_type; //0=normal, 1=weapon, 2=range, 3=armor, 4=shield, 5=bag, 6=scroll, 7=recipe, 8=food, 9=bauble, 10=house item, 11=thrown, 12=house container, 13=adormnet, 14=??, 16=profile, 17=patter set, 18=item set, 19=book, 20=decoration, 21=dungeon maker, 22=marketplace
  636. int16 appearance_id;
  637. int8 appearance_red;
  638. int8 appearance_green;
  639. int8 appearance_blue;
  640. int8 appearance_highlight_red;
  641. int8 appearance_highlight_green;
  642. int8 appearance_highlight_blue;
  643. int8 collectable;
  644. int32 offers_quest_id;
  645. int32 part_of_quest_id;
  646. int16 max_charges;
  647. int8 display_charges;
  648. int64 adventure_classes;
  649. int64 tradeskill_classes;
  650. int16 adventure_default_level;
  651. int16 tradeskill_default_level;
  652. int8 usable;
  653. int8 harvest;
  654. };
  655. struct Armor_Info {
  656. int16 mitigation_low;
  657. int16 mitigation_high;
  658. };
  659. struct Adornment_Info {
  660. float duration;
  661. int16 item_types;
  662. int16 slot_type;
  663. };
  664. struct Weapon_Info {
  665. int16 wield_type;
  666. int16 damage_low1;
  667. int16 damage_high1;
  668. int16 damage_low2;
  669. int16 damage_high2;
  670. int16 damage_low3;
  671. int16 damage_high3;
  672. int16 delay;
  673. float rating;
  674. };
  675. struct Shield_Info {
  676. Armor_Info armor_info;
  677. };
  678. struct Ranged_Info {
  679. Weapon_Info weapon_info;
  680. int16 range_low;
  681. int16 range_high;
  682. };
  683. struct Bag_Info {
  684. int8 num_slots;
  685. int16 weight_reduction;
  686. };
  687. struct Food_Info{
  688. int8 type; //0=water, 1=food
  689. int8 level;
  690. float duration;
  691. int8 satiation;
  692. };
  693. struct Bauble_Info{
  694. int16 cast;
  695. int16 recovery;
  696. int32 duration;
  697. float recast;
  698. int8 display_slot_optional;
  699. int8 display_cast_time;
  700. int8 display_bauble_type;
  701. float effect_radius;
  702. int32 max_aoe_targets;
  703. int8 display_until_cancelled;
  704. };
  705. struct Book_Info{
  706. int8 language;
  707. EQ2_16BitString author;
  708. EQ2_16BitString title;
  709. };
  710. struct Book_Info_Pages {
  711. int8 page;
  712. EQ2_16BitString page_text;
  713. int8 page_text_valign;
  714. int8 page_text_halign;
  715. };
  716. struct Skill_Info{
  717. int32 spell_id;
  718. int32 spell_tier;
  719. };
  720. struct HouseItem_Info{
  721. int32 status_rent_reduction;
  722. float coin_rent_reduction;
  723. int8 house_only;
  724. };
  725. struct HouseContainer_Info{
  726. int64 allowed_types;
  727. int8 num_slots;
  728. int8 broker_commission;
  729. int8 fence_commission;
  730. };
  731. struct RecipeBook_Info{
  732. vector<string> recipes;
  733. int8 uses;
  734. };
  735. struct ItemSet_Info{
  736. int32 item_id;
  737. int32 item_crc;
  738. int16 item_icon;
  739. int32 item_stack_size;
  740. int32 item_list_color;
  741. };
  742. struct Thrown_Info{
  743. sint32 range;
  744. sint32 damage_modifier;
  745. float hit_bonus;
  746. int32 damage_type;
  747. };
  748. struct ItemEffect{
  749. EQ2_16BitString effect;
  750. int8 percentage;
  751. int8 subbulletflag;
  752. };
  753. struct BookPage {
  754. int8 page;
  755. EQ2_16BitString page_text;
  756. int8 valign;
  757. int8 halign;
  758. };
  759. #pragma pack()
  760. Item();
  761. Item(Item* in_item);
  762. ~Item();
  763. string lowername;
  764. string name;
  765. string description;
  766. int16 stack_count;
  767. int32 sell_price;
  768. int32 sell_status;
  769. int32 max_sell_value;
  770. bool save_needed;
  771. int8 weapon_type;
  772. string adornment;
  773. string creator;
  774. int32 adorn0;
  775. int32 adorn1;
  776. int32 adorn2;
  777. vector<Classifications*>classifications; //classifications MJ
  778. vector<ItemStat*> item_stats;
  779. vector<ItemSet*> item_sets;
  780. vector<ItemStatString*> item_string_stats;
  781. vector<ItemLevelOverride*> item_level_overrides;
  782. vector<ItemEffect*> item_effects;
  783. vector<BookPage*> book_pages;
  784. Generic_Info generic_info;
  785. Weapon_Info* weapon_info;
  786. Ranged_Info* ranged_info;
  787. Armor_Info* armor_info;
  788. Adornment_Info* adornment_info;
  789. Bag_Info* bag_info;
  790. Food_Info* food_info;
  791. Bauble_Info* bauble_info;
  792. Book_Info* book_info;
  793. Book_Info_Pages* book_info_pages;
  794. HouseItem_Info* houseitem_info;
  795. HouseContainer_Info* housecontainer_info;
  796. Skill_Info* skill_info;
  797. RecipeBook_Info* recipebook_info;
  798. ItemSet_Info* itemset_info;
  799. Thrown_Info* thrown_info;
  800. vector<int8> slot_data;
  801. ItemCore details;
  802. int32 spell_id;
  803. int8 spell_tier;
  804. string item_script;
  805. void AddEffect(string effect, int8 percentage, int8 subbulletflag);
  806. void AddBookPage(int8 page, string page_text,int8 valign, int8 halign);
  807. int32 GetMaxSellValue();
  808. void SetMaxSellValue(int32 val);
  809. void SetItem(Item* old_item);
  810. int16 GetOverrideLevel(int8 adventure_class, int8 tradeskill_class);
  811. void AddLevelOverride(int8 adventure_class, int8 tradeskill_class, int16 level);
  812. void AddLevelOverride(ItemLevelOverride* class_);
  813. bool CheckClassLevel(int8 adventure_class, int8 tradeskill_class, int16 level);
  814. bool CheckClass(int8 adventure_class, int8 tradeskill_class);
  815. bool CheckLevel(int8 adventure_class, int8 tradeskill_class, int16 level);
  816. void SetAppearance(int16 type, int8 red, int8 green, int8 blue, int8 highlight_red, int8 highlight_green, int8 highlight_blue);
  817. void SetAppearance(ItemAppearance* appearance);
  818. void AddStat(ItemStat* in_stat);
  819. bool HasStat(uint32 statID);
  820. void AddSet(ItemSet* in_set);
  821. void AddStatString(ItemStatString* in_stat);
  822. void AddStat(int8 type, int16 subtype, float value, char* name = 0);
  823. void AddSet(int32 item_id, int32 item_crc, int16 item_icon, int32 item_stack_size, int32 item_list_color);
  824. void SetWeaponType(int8 type);
  825. int8 GetWeaponType();
  826. bool HasSlot(int8 slot, int8 slot2 = 255);
  827. bool HasAdorn0();
  828. bool HasAdorn1();
  829. bool HasAdorn2();
  830. bool IsNormal();
  831. bool IsWeapon();
  832. bool IsArmor();
  833. bool IsRanged();
  834. bool IsBag();
  835. bool IsFood();
  836. bool IsBauble();
  837. bool IsSkill();
  838. bool IsHouseItem();
  839. bool IsHouseContainer();
  840. bool IsShield();
  841. bool IsAdornment();
  842. bool IsAmmo();
  843. bool IsBook();
  844. bool IsChainArmor();
  845. bool IsClothArmor();
  846. bool IsCollectable();
  847. bool IsCloak();
  848. bool IsCrushWeapon();
  849. bool IsFoodFood();
  850. bool IsFoodDrink();
  851. bool IsJewelry();
  852. bool IsLeatherArmor();
  853. bool IsMisc();
  854. bool IsPierceWeapon();
  855. bool IsPlateArmor();
  856. bool IsPoison();
  857. bool IsPotion();
  858. bool IsRecipeBook();
  859. bool IsSalesDisplay();
  860. bool IsSlashWeapon();
  861. bool IsSpellScroll();
  862. bool IsTinkered();
  863. bool IsTradeskill();
  864. bool IsThrown();
  865. bool IsHarvest();
  866. void SetItemScript(string name);
  867. const char* GetItemScript();
  868. int32 CalculateRepairCost();
  869. string CreateItemLink(bool bUseUniqueID);
  870. void SetItemType(int8 in_type);
  871. void serialize(PacketStruct* packet, bool show_name = false, Player* player = 0, int16 packet_type = 0, int8 subtype = 0, bool loot_item = false);
  872. EQ2Packet* serialize(int16 version, bool show_name = false, Player* player = 0, bool include_twice = true, int16 packet_type = 0, int8 subtype = 0, bool merchant_item = false, bool loot_item = false);
  873. PacketStruct* PrepareItem(int16 version, bool merchant_item = false, bool loot_item = false);
  874. bool CheckFlag(int32 flag);
  875. bool CheckFlag2(int32 flag);
  876. void AddSlot(int8 slot_id);
  877. void SetSlots(int32 slots);
  878. bool needs_deletion;
  879. };
  880. class MasterItemList{
  881. public:
  882. ~MasterItemList();
  883. map<int32,Item*> items;
  884. Item* GetItem(int32 id);
  885. Item* GetItemByName(const char *name);
  886. ItemStatsValues* CalculateItemBonuses(int32 item_id, Entity* entity = 0);
  887. ItemStatsValues* CalculateItemBonuses(Item* desc, Entity* entity = 0, ItemStatsValues* values = 0);
  888. vector<Item*>* GetItems(string name, int32 itype, int32 ltype, int32 btype, int64 minprice, int64 maxprice, int8 minskill, int8 maxskill, string seller, string adornment, int8 mintier, int8 maxtier, int16 minlevel, int16 maxlevel, sint8 itemclass);
  889. vector<Item*>* GetItems(map<string, string> criteria);
  890. void AddItem(Item* item);
  891. bool IsBag(int32 item_id);
  892. void RemoveAll();
  893. static int32 NextUniqueID();
  894. static void ResetUniqueID(int32 new_id);
  895. static int32 next_unique_id;
  896. };
  897. class PlayerItemList {
  898. public:
  899. PlayerItemList();
  900. ~PlayerItemList();
  901. // int16 number;
  902. map<int32, Item*> indexed_items;
  903. map<sint32, map<int16, Item*> > items;
  904. // map< int8, Item* > inv_items;
  905. // map< int8, Item* > bank_items;
  906. bool SharedBankAddAllowed(Item* item);
  907. vector<Item*>* GetItemsFromBagID(sint32 bag_id);
  908. vector<Item*>* GetItemsInBag(Item* bag);
  909. Item* GetBag(int8 inventory_slot, bool lock = true);
  910. bool HasItem(int32 id, bool include_bank = false);
  911. Item* GetItemFromIndex(int32 index);
  912. void MoveItem(Item* item, sint32 inv_slot, int16 slot, bool erase_old = true);
  913. bool MoveItem(sint32 to_bag_id, int16 from_index, sint8 to, int8 charges);
  914. Item* GetItemFromUniqueID(int32 item_id, bool include_bank = false, bool lock = true);
  915. Item* GetItemFromID(int32 item_id, int8 count = 0, bool include_bank = false, bool lock = true);
  916. bool AssignItemToFreeSlot(Item* item);
  917. int16 GetNumberOfFreeSlots();
  918. int16 GetNumberOfItems();
  919. bool HasFreeSlot();
  920. bool HasFreeBagSlot();
  921. void DestroyItem(int16 index);
  922. Item* CanStack(Item* item, bool include_bank = false);
  923. void RemoveItem(Item* item, bool delete_item = false);
  924. void AddItem(Item* item);
  925. Item* GetItem(sint32 bag_slot, int16 slot);
  926. EQ2Packet* serialize(Player* player, int16 version);
  927. uchar* xor_packet;
  928. uchar* orig_packet;
  929. map<int32, Item*>* GetAllItems();
  930. bool HasFreeBankSlot();
  931. int8 FindFreeBankSlot();
  932. ///<summary>Get the first free slot and store them in the provided variables</summary>
  933. ///<param name='bag_id'>Will contain the bag id of the first free spot</param>
  934. ///<param name='slot'>Will contain the slot id of the first free slot</param>
  935. ///<returns>True if a free slot was found</returns>
  936. bool GetFirstFreeSlot(sint32* bag_id, sint16* slot);
  937. /// <summary>Get the first free slot in the bank and store it in the provided variables
  938. /// <param name='bag_id'>Will contain the bag id of the first free bank slot</param>
  939. /// <param name='slot'>Will contain the slot id of the first free bank slot</param>
  940. /// <returns>True if a free bank slot was found</returns>
  941. bool GetFirstFreeBankSlot(sint32* bag_id, sint16* slot);
  942. /// <summary></summary>
  943. Item* GetBankBag(int8 inventory_slot, bool lock = true);
  944. /// <summary></summary>
  945. bool AddOverflowItem(Item* item);
  946. Item* GetOverflowItem();
  947. void RemoveOverflowItem(Item* item);
  948. vector<Item*>* GetOverflowItemList();
  949. private:
  950. void AddItemToPacket(PacketStruct* packet, Player* player, Item* item, int16 i, bool overflow = false);
  951. void Stack(Item* orig_item, Item* item);
  952. Mutex MPlayerItems;
  953. int16 packet_count;
  954. vector<Item*> overflowItems;
  955. };
  956. class EquipmentItemList{
  957. public:
  958. EquipmentItemList();
  959. EquipmentItemList(const EquipmentItemList& list);
  960. ~EquipmentItemList();
  961. Item* items[NUM_SLOTS];
  962. vector<Item*>* GetAllEquippedItems();
  963. bool HasItem(int32 id);
  964. int8 GetNumberOfItems();
  965. Item* GetItemFromUniqueID(int32 item_id);
  966. Item* GetItemFromItemID(int32 item_id);
  967. void SetItem(int8 slot_id, Item* item);
  968. void RemoveItem(int8 slot, bool delete_item = false);
  969. Item* GetItem(int8 slot_id);
  970. bool AddItem(int8 slot, Item* item);
  971. bool CheckEquipSlot(Item* tmp, int8 slot);
  972. bool CanItemBeEquippedInSlot(Item* tmp, int8 slot);
  973. int8 GetFreeSlot(Item* tmp, int8 slot_id = 255);
  974. int8 GetSlotByItem(Item* item);
  975. ItemStatsValues* CalculateEquipmentBonuses(Entity* entity = 0);
  976. EQ2Packet* serialize(int16 version, Player* player = 0);
  977. uchar* xor_packet;
  978. uchar* orig_packet;
  979. private:
  980. Mutex MEquipmentItems;
  981. };
  982. #endif