Items.h 40 KB

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