Items.h 34 KB

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