Items.h 38 KB

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