Items.h 41 KB

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