Items_DoV.h 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881
  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 ITEM_WIELD_TYPE_DUAL 1
  123. #define ITEM_WIELD_TYPE_SINGLE 2
  124. #define ITEM_WIELD_TYPE_TWO_HAND 4
  125. #define ITEM_TYPE_NORMAL 0
  126. #define ITEM_TYPE_WEAPON 1
  127. #define ITEM_TYPE_RANGED 2
  128. #define ITEM_TYPE_ARMOR 3
  129. #define ITEM_TYPE_SHIELD 4
  130. #define ITEM_TYPE_BAG 5
  131. #define ITEM_TYPE_SKILL 6
  132. #define ITEM_TYPE_RECIPE 7
  133. #define ITEM_TYPE_FOOD 8
  134. #define ITEM_TYPE_BAUBLE 9
  135. #define ITEM_TYPE_HOUSE 10
  136. #define ITEM_TYPE_THROWN 11
  137. #define ITEM_TYPE_HOUSE_CONTAINER 12
  138. #define ITEM_TYPE_BOOK 13
  139. #define ITEM_TYPE_ADORNMENT 14
  140. #define ITEM_TYPE_PATTERN 15
  141. #define ITEM_TYPE_ARMORSET 16
  142. #define ITEM_MENU_TYPE_GENERIC 1
  143. #define ITEM_MENU_TYPE_EQUIP 2
  144. #define ITEM_MENU_TYPE_BAG 4
  145. #define ITEM_MENU_TYPE_HOUSE 8
  146. #define ITEM_MENU_TYPE_SCRIBE 32
  147. #define ITEM_MENU_TYPE_INVALID 128
  148. #define ITEM_MENU_TYPE_BROKEN 512
  149. #define ITEM_MENU_TYPE_ATTUNED 2048
  150. #define ITEM_MENU_TYPE_ATTUNEABLE 4096
  151. #define ITEM_MENU_TYPE_BOOK 8192
  152. #define ITEM_MENU_TYPE_DISPLAY_CHARGES 16384
  153. #define ITEM_MENU_TYPE_NAMEPET 65536
  154. #define ITEM_MENU_TYPE_CONSUME 262144
  155. #define ITEM_MENU_TYPE_USE 524288
  156. #define ITEM_MENU_TYPE_DRINK 8388608
  157. #define ITEM_MENU_TYPE_REDEEM 536870912
  158. #define ITEM_TAG_UNCOMMON 3 //tier tags
  159. #define ITEM_TAG_TREASURED 4
  160. #define ITEM_TAG_LEGENDARY 7
  161. #define ITEM_TAG_FABLED 9
  162. #define ITEM_TAG_MYTHICAL 12
  163. #define ITEM_BROKER_TYPE_ANY 0xFFFFFFFF
  164. #define ITEM_BROKER_TYPE_ADORNMENT 134217728
  165. #define ITEM_BROKER_TYPE_AMMO 1024
  166. #define ITEM_BROKER_TYPE_ATTUNEABLE 16384
  167. #define ITEM_BROKER_TYPE_BAG 2048
  168. #define ITEM_BROKER_TYPE_BAUBLE 16777216
  169. #define ITEM_BROKER_TYPE_BOOK 128
  170. #define ITEM_BROKER_TYPE_CHAINARMOR 2097152
  171. #define ITEM_BROKER_TYPE_CLOAK 1073741824
  172. #define ITEM_BROKER_TYPE_CLOTHARMOR 524288
  173. #define ITEM_BROKER_TYPE_COLLECTABLE 67108864
  174. #define ITEM_BROKER_TYPE_CRUSHWEAPON 4
  175. #define ITEM_BROKER_TYPE_DRINK 131072
  176. #define ITEM_BROKER_TYPE_FOOD 4096
  177. #define ITEM_BROKER_TYPE_HOUSEITEM 512
  178. #define ITEM_BROKER_TYPE_JEWELRY 262144
  179. #define ITEM_BROKER_TYPE_LEATHERARMOR 1048576
  180. #define ITEM_BROKER_TYPE_LORE 8192
  181. #define ITEM_BROKER_TYPE_MISC 1
  182. #define ITEM_BROKER_TYPE_PIERCEWEAPON 8
  183. #define ITEM_BROKER_TYPE_PLATEARMOR 4194304
  184. #define ITEM_BROKER_TYPE_POISON 65536
  185. #define ITEM_BROKER_TYPE_POTION 32768
  186. #define ITEM_BROKER_TYPE_RECIPEBOOK 8388608
  187. #define ITEM_BROKER_TYPE_SALESDISPLAY 33554432
  188. #define ITEM_BROKER_TYPE_SHIELD 32
  189. #define ITEM_BROKER_TYPE_SLASHWEAPON 2
  190. #define ITEM_BROKER_TYPE_SPELLSCROLL 64
  191. #define ITEM_BROKER_TYPE_TINKERED 268435456
  192. #define ITEM_BROKER_TYPE_TRADESKILL 256
  193. #define ITEM_BROKER_SLOT_ANY 0xFFFFFFFF
  194. #define ITEM_BROKER_SLOT_AMMO 65536
  195. #define ITEM_BROKER_SLOT_CHARM 524288
  196. #define ITEM_BROKER_SLOT_CHEST 32
  197. #define ITEM_BROKER_SLOT_CLOAK 262144
  198. #define ITEM_BROKER_SLOT_DRINK 2097152
  199. #define ITEM_BROKER_SLOT_EARS 4096
  200. #define ITEM_BROKER_SLOT_FEET 1024
  201. #define ITEM_BROKER_SLOT_FOOD 1048576
  202. #define ITEM_BROKER_SLOT_FOREARMS 128
  203. #define ITEM_BROKER_SLOT_HANDS 256
  204. #define ITEM_BROKER_SLOT_HEAD 16
  205. #define ITEM_BROKER_SLOT_LEGS 512
  206. #define ITEM_BROKER_SLOT_NECK 8192
  207. #define ITEM_BROKER_SLOT_PRIMARY 1
  208. #define ITEM_BROKER_SLOT_PRIMARY_2H 2
  209. #define ITEM_BROKER_SLOT_RANGE_WEAPON 32768
  210. #define ITEM_BROKER_SLOT_RING 2048
  211. #define ITEM_BROKER_SLOT_SECONDARY 8
  212. #define ITEM_BROKER_SLOT_SHOULDERS 64
  213. #define ITEM_BROKER_SLOT_WAIST 131072
  214. #define ITEM_BROKER_SLOT_WRIST 16384
  215. #define ITEM_BROKER_STAT_TYPE_NONE 0
  216. #define ITEM_BROKER_STAT_TYPE_DEF 2
  217. #define ITEM_BROKER_STAT_TYPE_STR 4
  218. #define ITEM_BROKER_STAT_TYPE_STA 8
  219. #define ITEM_BROKER_STAT_TYPE_AGI 16
  220. #define ITEM_BROKER_STAT_TYPE_WIS 32
  221. #define ITEM_BROKER_STAT_TYPE_INT 64
  222. #define ITEM_BROKER_STAT_TYPE_HEALTH 128
  223. #define ITEM_BROKER_STAT_TYPE_POWER 256
  224. #define ITEM_BROKER_STAT_TYPE_HEAT 512
  225. #define ITEM_BROKER_STAT_TYPE_COLD 1024
  226. #define ITEM_BROKER_STAT_TYPE_MAGIC 2048
  227. #define ITEM_BROKER_STAT_TYPE_MENTAL 4096
  228. #define ITEM_BROKER_STAT_TYPE_DIVINE 8192
  229. #define ITEM_BROKER_STAT_TYPE_POISON 16384
  230. #define ITEM_BROKER_STAT_TYPE_DISEASE 32768
  231. #define ITEM_BROKER_STAT_TYPE_CRUSH 65536
  232. #define ITEM_BROKER_STAT_TYPE_SLASH 131072
  233. #define ITEM_BROKER_STAT_TYPE_PIERCE 262144
  234. #define ITEM_BROKER_STAT_TYPE_CRITICAL 524288
  235. #define ITEM_BROKER_STAT_TYPE_DBL_ATTACK 1048576
  236. #define ITEM_BROKER_STAT_TYPE_ABILITY_MOD 2097152
  237. #define ITEM_BROKER_STAT_TYPE_POTENCY 4194304
  238. #define OVERFLOW_SLOT 0xFFFFFFFE
  239. #define SLOT_INVALID 0xFFFF
  240. #define ITEM_STAT_STR 0
  241. #define ITEM_STAT_STA 1
  242. #define ITEM_STAT_AGI 2
  243. #define ITEM_STAT_WIS 3
  244. #define ITEM_STAT_INT 4
  245. #define ITEM_STAT_VS_PHYSICAL 200
  246. #define ITEM_STAT_VS_HEAT 201 //elemental
  247. #define ITEM_STAT_VS_POISON 202 //noxious
  248. #define ITEM_STAT_VS_MAGIC 203 //arcane
  249. #define ITEM_STAT_VS_DROWNING 210
  250. #define ITEM_STAT_VS_FALLING 211
  251. #define ITEM_STAT_VS_PAIN 212
  252. #define ITEM_STAT_VS_MELEE 213
  253. #define ITEM_STAT_VS_SLASH 204
  254. #define ITEM_STAT_VS_CRUSH 205
  255. #define ITEM_STAT_VS_PIERCE 206
  256. //#define ITEM_STAT_VS_HEAT 203 //just so no build error
  257. #define ITEM_STAT_VS_COLD 207
  258. //#define ITEM_STAT_VS_MAGIC 205 //just so no build error
  259. #define ITEM_STAT_VS_MENTAL 208
  260. #define ITEM_STAT_VS_DIVINE 209
  261. #define ITEM_STAT_VS_DISEASE 214
  262. //#define ITEM_STAT_VS_POISON 209 //just so no build error
  263. //#define ITEM_STAT_VS_DROWNING 210 //just so no build error
  264. //#define ITEM_STAT_VS_FALLING 211 //just so no build error
  265. //#define ITEM_STAT_VS_PAIN 212 //just so no build error
  266. //#define ITEM_STAT_VS_MELEE 213 //just so no build error
  267. #define ITEM_STAT_DMG_SLASH 300
  268. #define ITEM_STAT_DMG_CRUSH 301
  269. #define ITEM_STAT_DMG_PIERCE 302
  270. #define ITEM_STAT_DMG_HEAT 303
  271. #define ITEM_STAT_DMG_COLD 304
  272. #define ITEM_STAT_DMG_MAGIC 305
  273. #define ITEM_STAT_DMG_MENTAL 306
  274. #define ITEM_STAT_DMG_DIVINE 307
  275. #define ITEM_STAT_DMG_DISEASE 308
  276. #define ITEM_STAT_DMG_POISON 309
  277. #define ITEM_STAT_DMG_DROWNING 310
  278. #define ITEM_STAT_DMG_FALLING 311
  279. #define ITEM_STAT_DMG_PAIN 312
  280. #define ITEM_STAT_DMG_MELEE 313
  281. #define ITEM_STAT_HEALTH 500
  282. #define ITEM_STAT_POWER 501
  283. #define ITEM_STAT_CONCENTRATION 502
  284. #define ITEM_STAT_HPREGEN 600
  285. #define ITEM_STAT_MANAREGEN 601
  286. #define ITEM_STAT_HPREGENPPT 602
  287. #define ITEM_STAT_MPREGENPPT 603
  288. #define ITEM_STAT_COMBATHPREGENPPT 604
  289. #define ITEM_STAT_COMBATMPREGENPPT 605
  290. #define ITEM_STAT_MAXHP 606
  291. #define ITEM_STAT_MAXHPPERC 607
  292. #define ITEM_STAT_SPEED 608
  293. #define ITEM_STAT_SLOW 609
  294. #define ITEM_STAT_MOUNTSPEED 610
  295. #define ITEM_STAT_MOUNTAIRSPEED 611
  296. #define ITEM_STAT_OFFENSIVESPEED 612
  297. #define ITEM_STAT_ATTACKSPEED 613
  298. #define ITEM_STAT_MAXMANA 614
  299. #define ITEM_STAT_MAXMANAPERC 615
  300. #define ITEM_STAT_MAXATTPERC 616
  301. #define ITEM_STAT_BLURVISION 617
  302. #define ITEM_STAT_MAGICLEVELIMMUNITY 618
  303. #define ITEM_STAT_HATEGAINMOD 619
  304. #define ITEM_STAT_COMBATEXPMOD 620
  305. #define ITEM_STAT_TRADESKILLEXPMOD 621
  306. #define ITEM_STAT_ACHIEVEMENTEXPMOD 622
  307. #define ITEM_STAT_SIZEMOD 623
  308. #define ITEM_STAT_DPS 624
  309. #define ITEM_STAT_STEALTH 625
  310. #define ITEM_STAT_INVIS 626
  311. #define ITEM_STAT_SEESTEALTH 627
  312. #define ITEM_STAT_SEEINVIS 628
  313. #define ITEM_STAT_EFFECTIVELEVELMOD 629
  314. #define ITEM_STAT_RIPOSTECHANCE 630
  315. #define ITEM_STAT_PARRYCHANCE 631
  316. #define ITEM_STAT_DODGECHANCE 632
  317. #define ITEM_STAT_AEAUTOATTACKCHANCE 633
  318. #define ITEM_STAT_MULTIATTACKCHANCE 634
  319. #define ITEM_STAT_SPELLMULTIATTACKCHANCE 635
  320. #define ITEM_STAT_FLURRY 636
  321. #define ITEM_STAT_MELEEDAMAGEMULTIPLIER 637
  322. #define ITEM_STAT_EXTRAHARVESTCHANCE 638
  323. #define ITEM_STAT_EXTRASHIELDBLOCKCHANCE 639
  324. #define ITEM_STAT_ITEMHPREGENPPT 640
  325. #define ITEM_STAT_ITEMPPREGENPPT 641
  326. #define ITEM_STAT_MELEECRITCHANCE 642
  327. #define ITEM_STAT_CRITAVOIDANCE 643
  328. #define ITEM_STAT_BENEFICIALCRITCHANCE 644
  329. #define ITEM_STAT_CRITBONUS 645
  330. #define ITEM_STAT_POTENCY 646
  331. #define ITEM_STAT_UNCONSCIOUSHPMOD 647
  332. #define ITEM_STAT_ABILITYREUSESPEED 648
  333. #define ITEM_STAT_ABILITYRECOVERYSPEED 649
  334. #define ITEM_STAT_ABILITYCASTINGSPEED 650
  335. #define ITEM_STAT_SPELLREUSESPEED 651
  336. #define ITEM_STAT_MELEEWEAPONRANGE 652
  337. #define ITEM_STAT_RANGEDWEAPONRANGE 653
  338. #define ITEM_STAT_FALLINGDAMAGEREDUCTION 654
  339. #define ITEM_STAT_RIPOSTEDAMAGE 655
  340. #define ITEM_STAT_MINIMUMDEFLECTIONCHANCE 656
  341. #define ITEM_STAT_MOVEMENTWEAVE 657
  342. #define ITEM_STAT_COMBATHPREGEN 658
  343. #define ITEM_STAT_COMBATMANAREGEN 659
  344. #define ITEM_STAT_CONTESTSPEEDBOOST 660
  345. #define ITEM_STAT_TRACKINGAVOIDANCE 661
  346. #define ITEM_STAT_STEALTHINVISSPEEDMOD 662
  347. #define ITEM_STAT_LOOT_COIN 663
  348. #define ITEM_STAT_ARMORMITIGATIONINCREASE 664
  349. #define ITEM_STAT_AMMOCONSERVATION 665
  350. #define ITEM_STAT_STRIKETHROUGH 666
  351. #define ITEM_STAT_STATUSBONUS 667
  352. #define ITEM_STAT_ACCURACY 668
  353. #define ITEM_STAT_COUNTERSTRIKE 669
  354. #define ITEM_STAT_SHIELDBASH 670
  355. #define ITEM_STAT_WEAPONDAMAGEBONUS 671
  356. #define ITEM_STAT_ADDITIONALRIPOSTECHANCE 672
  357. #define ITEM_STAT_CRITICALMITIGATION 673
  358. #define ITEM_STAT_PVPTOUGHNESS 674
  359. #define ITEM_STAT_STAMINABONUS 675
  360. #define ITEM_STAT_WISDOMITBONUS 676
  361. #define ITEM_STAT_HEALRECEIVE 677
  362. #define ITEM_STAT_HEALRECEIVEPERC 678
  363. #define ITEM_STAT_PVPCRITICALMITIGATION 679
  364. #define ITEM_STAT_BASEAVOIDANCEBONUS 680
  365. //#define ITEM_STAT_HPREGEN 600
  366. //#define ITEM_STAT_MANAREGEN 601
  367. //#define ITEM_STAT_HPREGENPPT 602
  368. //#define ITEM_STAT_MPREGENPPT 603
  369. //#define ITEM_STAT_COMBATHPREGENPPT 604
  370. //#define ITEM_STAT_COMBATMPREGENPPT 605
  371. //#define ITEM_STAT_MAXHP 606
  372. //#define ITEM_STAT_MAXHPPERC 607
  373. //#define ITEM_STAT_SPEED 608
  374. //#define ITEM_STAT_SLOW 609
  375. //#define ITEM_STAT_MOUNTSPEED 610
  376. //#define ITEM_STAT_OFFENSIVESPEED 611
  377. //#define ITEM_STAT_ATTACKSPEED 612
  378. //#define ITEM_STAT_MAXMANA 613
  379. //#define ITEM_STAT_MAXMANAPERC 614
  380. //#define ITEM_STAT_MAXATTPERC 615
  381. //#define ITEM_STAT_BLURVISION 616
  382. //#define ITEM_STAT_MAGICLEVELIMMUNITY 617
  383. //#define ITEM_STAT_HATEGAINMOD 618
  384. //#define ITEM_STAT_COMBATEXPMOD 619
  385. //#define ITEM_STAT_TRADESKILLEXPMOD 620
  386. //#define ITEM_STAT_ACHIEVEMENTEXPMOD 621
  387. //#define ITEM_STAT_SIZEMOD 622
  388. //#define ITEM_STAT_UNKNOWN 623
  389. //#define ITEM_STAT_STEALTH 624
  390. //#define ITEM_STAT_INVIS 625
  391. //#define ITEM_STAT_SEESTEALTH 626
  392. //#define ITEM_STAT_SEEINVIS 627
  393. //#define ITEM_STAT_EFFECTIVELEVELMOD 628
  394. //#define ITEM_STAT_RIPOSTECHANCE 629
  395. //#define ITEM_STAT_PARRYCHANCE 630
  396. //#define ITEM_STAT_DODGECHANCE 631
  397. //#define ITEM_STAT_AEAUTOATTACKCHANCE 632
  398. //#define ITEM_STAT_DOUBLEATTACKCHANCE 633
  399. //#define ITEM_STAT_RANGEDDOUBLEATTACKCHANCE 634
  400. //#define ITEM_STAT_SPELLDOUBLEATTACKCHANCE 635
  401. //#define ITEM_STAT_FLURRY 636
  402. //#define ITEM_STAT_EXTRAHARVESTCHANCE 637
  403. //#define ITEM_STAT_EXTRASHIELDBLOCKCHANCE 638
  404. #define ITEM_STAT_DEFLECTIONCHANCE 400 //just so no build error
  405. //#define ITEM_STAT_ITEMHPREGENPPT 640
  406. //#define ITEM_STAT_ITEMPPREGENPPT 641
  407. //#define ITEM_STAT_MELEECRITCHANCE 642
  408. //#define ITEM_STAT_RANGEDCRITCHANCE 643
  409. //#define ITEM_STAT_DMGSPELLCRITCHANCE 644
  410. //#define ITEM_STAT_HEALSPELLCRITCHANCE 645
  411. //#define ITEM_STAT_MELEECRITBONUS 646
  412. //#define ITEM_STAT_RANGEDCRITBONUS 647
  413. //#define ITEM_STAT_DMGSPELLCRITBONUS 648
  414. //#define ITEM_STAT_HEALSPELLCRITBONUS 649
  415. //#define ITEM_STAT_UNCONSCIOUSHPMOD 650
  416. //#define ITEM_STAT_SPELLTIMEREUSEPCT 651
  417. //#define ITEM_STAT_SPELLTIMERECOVERYPCT 652
  418. //#define ITEM_STAT_SPELLTIMECASTPCT 653
  419. //#define ITEM_STAT_MELEEWEAPONRANGE 654
  420. //#define ITEM_STAT_RANGEDWEAPONRANGE 655
  421. //#define ITEM_STAT_FALLINGDAMAGEREDUCTION 656
  422. //#define ITEM_STAT_SHIELDEFFECTIVENESS 657
  423. //#define ITEM_STAT_RIPOSTEDAMAGE 658
  424. //#define ITEM_STAT_MINIMUMDEFLECTIONCHANCE 659
  425. //#define ITEM_STAT_MOVEMENTWEAVE 660
  426. //#define ITEM_STAT_COMBATHPREGEN 661
  427. //#define ITEM_STAT_COMBATMANAREGEN 662
  428. //#define ITEM_STAT_CONTESTSPEEDBOOST 663
  429. //#define ITEM_STAT_TRACKINGAVOIDANCE 664
  430. //#define ITEM_STAT_STEALTHINVISSPEEDMOD 665
  431. //#define ITEM_STAT_LOOT_COIN 666
  432. //#define ITEM_STAT_ARMORMITIGATIONINCREASE 667
  433. //#define ITEM_STAT_AMMOCONSERVATION 668
  434. //#define ITEM_STAT_STRIKETHROUGH 669
  435. //#define ITEM_STAT_STATUSBONUS 670
  436. //#define ITEM_STAT_ACCURACY 671
  437. //#define ITEM_STAT_COUNTERSTRIKE 672
  438. //#define ITEM_STAT_SHIELDBASH 673
  439. //#define ITEM_STAT_WEAPONDAMAGEBONUS 674
  440. //#define ITEM_STAT_ADDITIONALRIPOSTECHANCE 675
  441. //#define ITEM_STAT_CRITICALMITIGATION 676
  442. //#define ITEM_STAT_COMBATARTDAMAGE 677
  443. //#define ITEM_STAT_SPELLDAMAGE 678
  444. //#define ITEM_STAT_HEALAMOUNT 679
  445. //#define ITEM_STAT_TAUNTAMOUNT 680
  446. #define ITEM_STAT_SPELL_DAMAGE 700
  447. #define ITEM_STAT_HEAL_AMOUNT 701
  448. #define ITEM_STAT_SPELL_AND_HEAL 702
  449. #define ITEM_STAT_COMBAT_ART_DAMAGE 703
  450. #define ITEM_STAT_SPELL_AND_COMBAT_ART_DAMAGE 704
  451. #define ITEM_STAT_TAUNT_AMOUNT 705
  452. #define ITEM_STAT_TAUNT_AND_COMBAT_ART_DAMAGE 706
  453. #define ITEM_STAT_ABILITY_MODIFIER 707
  454. #pragma pack(1)
  455. struct ItemStatsValues{
  456. sint16 str;
  457. sint16 sta;
  458. sint16 agi;
  459. sint16 wis;
  460. sint16 int_;
  461. sint16 vs_slash;
  462. sint16 vs_crush;
  463. sint16 vs_pierce;
  464. sint16 vs_heat;
  465. sint16 vs_cold;
  466. sint16 vs_magic;
  467. sint16 vs_mental;
  468. sint16 vs_divine;
  469. sint16 vs_disease;
  470. sint16 vs_poison;
  471. sint16 health;
  472. sint16 power;
  473. sint8 concentration;
  474. sint16 ability_modifier;
  475. sint16 criticalmitigation;
  476. sint16 extrashieldblockchance;
  477. sint16 beneficialcritchance;
  478. sint16 critbonus;
  479. sint16 potency;
  480. sint16 hategainmod;
  481. sint16 abilityreusespeed;
  482. sint16 abilitycastingspeed;
  483. sint16 abilityrecoveryspeed;
  484. sint16 spellreusespeed;
  485. sint16 spellmultiattackchance;
  486. sint16 dps;
  487. sint16 attackspeed;
  488. sint16 multiattackchance;
  489. sint16 aeautoattackchance;
  490. sint16 strikethrough;
  491. sint16 accuracy;
  492. sint16 offensivespeed;
  493. };
  494. struct ItemCore{
  495. int32 item_id;
  496. sint32 soe_id;
  497. int32 bag_id;
  498. sint32 inv_slot_id;
  499. sint16 slot_id;
  500. int8 index;
  501. int16 icon;
  502. int16 count;
  503. int8 tier;
  504. int8 num_slots;
  505. int32 unique_id;
  506. int8 num_free_slots;
  507. int16 recommended_level;
  508. };
  509. #pragma pack()
  510. struct ItemStat{
  511. string stat_name;
  512. int8 stat_type;
  513. sint16 stat_subtype;
  514. int16 stat_type_combined;
  515. float value;
  516. };
  517. struct ItemLevelOverride{
  518. int8 adventure_class;
  519. int8 tradeskill_class;
  520. int16 level;
  521. };
  522. struct ItemClass{
  523. int8 adventure_class;
  524. int8 tradeskill_class;
  525. int16 level;
  526. };
  527. struct ItemAppearance{
  528. int16 type;
  529. int8 red;
  530. int8 green;
  531. int8 blue;
  532. int8 highlight_red;
  533. int8 highlight_green;
  534. int8 highlight_blue;
  535. };
  536. class PlayerItemList;
  537. class Item{
  538. public:
  539. #pragma pack(1)
  540. struct ItemStatString{
  541. EQ2_8BitString stat_string;
  542. };
  543. struct Generic_Info{
  544. int8 show_name;
  545. int8 creator_flag;
  546. int16 item_flags;
  547. int8 condition;
  548. int32 weight; // num/10
  549. int32 skill_req1;
  550. int32 skill_req2;
  551. int16 skill_min;
  552. 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
  553. int16 appearance_id;
  554. int8 appearance_red;
  555. int8 appearance_green;
  556. int8 appearance_blue;
  557. int8 appearance_highlight_red;
  558. int8 appearance_highlight_green;
  559. int8 appearance_highlight_blue;
  560. int8 collectable;
  561. int32 offers_quest_id;
  562. int32 part_of_quest_id;
  563. int16 max_charges;
  564. int8 display_charges;
  565. int64 adventure_classes;
  566. int64 tradeskill_classes;
  567. int16 adventure_default_level;
  568. int16 tradeskill_default_level;
  569. int8 usable;
  570. };
  571. struct Armor_Info {
  572. int16 mitigation_low;
  573. int16 mitigation_high;
  574. };
  575. struct Weapon_Info {
  576. int16 wield_type;
  577. int16 damage_low1;
  578. int16 damage_high1;
  579. int16 damage_low2;
  580. int16 damage_high2;
  581. int16 damage_low3;
  582. int16 damage_high3;
  583. int16 delay;
  584. float rating;
  585. };
  586. struct Shield_Info {
  587. Armor_Info armor_info;
  588. };
  589. struct Ranged_Info {
  590. Weapon_Info weapon_info;
  591. int16 range_low;
  592. int16 range_high;
  593. };
  594. struct Bag_Info {
  595. int8 num_slots;
  596. int16 weight_reduction;
  597. };
  598. struct Food_Info{
  599. int8 type; //0=water, 1=food
  600. int8 level;
  601. float duration;
  602. int8 satiation;
  603. };
  604. struct Bauble_Info{
  605. int16 cast;
  606. int16 recovery;
  607. int32 duration;
  608. float recast;
  609. int8 display_slot_optional;
  610. int8 display_cast_time;
  611. int8 display_bauble_type;
  612. float effect_radius;
  613. int32 max_aoe_targets;
  614. int8 display_until_cancelled;
  615. };
  616. struct Book_Info{
  617. int8 language;
  618. EQ2_16BitString author;
  619. EQ2_16BitString title;
  620. };
  621. struct Skill_Info{
  622. int32 spell_id;
  623. int32 spell_tier;
  624. };
  625. struct House_Info{
  626. int32 status_rent_reduction;
  627. };
  628. struct HouseContainer_Info{
  629. int16 disallowed_types;
  630. int16 allowed_types;
  631. int8 num_slots;
  632. };
  633. struct RecipeBook_Info{
  634. vector<string> recipes;
  635. int8 uses;
  636. };
  637. struct Thrown_Info{
  638. sint32 range;
  639. sint32 damage_modifier;
  640. float hit_bonus;
  641. int32 damage_type;
  642. };
  643. struct ItemEffect{
  644. EQ2_16BitString effect;
  645. int8 percentage;
  646. int8 subbulletflag;
  647. };
  648. #pragma pack()
  649. Item();
  650. Item(Item* in_item);
  651. ~Item();
  652. string lowername;
  653. string name;
  654. string description;
  655. int8 stack_count;
  656. int32 sell_price;
  657. int32 max_sell_value;
  658. bool save_needed;
  659. int8 weapon_type;
  660. string adornment;
  661. string creator;
  662. vector<ItemStat*> item_stats;
  663. vector<ItemStatString*> item_string_stats;
  664. vector<ItemLevelOverride*> item_level_overrides;
  665. vector<ItemEffect*> item_effects;
  666. Generic_Info generic_info;
  667. Weapon_Info* weapon_info;
  668. Ranged_Info* ranged_info;
  669. Armor_Info* armor_info;
  670. Bag_Info* bag_info;
  671. Food_Info* food_info;
  672. Bauble_Info* bauble_info;
  673. Book_Info* book_info;
  674. Skill_Info* skill_info;
  675. RecipeBook_Info* recipebook_info;
  676. Thrown_Info* thrown_info;
  677. vector<int8> slot_data;
  678. ItemCore details;
  679. int32 spell_id;
  680. int8 spell_tier;
  681. string item_script;
  682. void AddEffect(string effect, int8 percentage, int8 subbulletflag);
  683. int32 GetMaxSellValue();
  684. void SetMaxSellValue(int32 val);
  685. void SetItem(Item* old_item);
  686. int16 GetOverrideLevel(int8 adventure_class, int8 tradeskill_class);
  687. void AddLevelOverride(int8 adventure_class, int8 tradeskill_class, int16 level);
  688. void AddLevelOverride(ItemLevelOverride* class_);
  689. bool CheckClassLevel(int8 adventure_class, int8 tradeskill_class, int16 level);
  690. bool CheckClass(int8 adventure_class, int8 tradeskill_class);
  691. bool CheckLevel(int8 adventure_class, int8 tradeskill_class, int16 level);
  692. void SetAppearance(int16 type, int8 red, int8 green, int8 blue, int8 highlight_red, int8 highlight_green, int8 highlight_blue);
  693. void SetAppearance(ItemAppearance* appearance);
  694. void AddStat(ItemStat* in_stat);
  695. void AddStatString(ItemStatString* in_stat);
  696. void AddStat(int8 type, int16 subtype, float value, char* name = 0);
  697. void SetWeaponType(int8 type);
  698. int8 GetWeaponType();
  699. bool HasSlot(int8 slot, int8 slot2 = 255);
  700. bool IsNormal();
  701. bool IsWeapon();
  702. bool IsArmor();
  703. bool IsRanged();
  704. bool IsBag();
  705. bool IsFood();
  706. bool IsBauble();
  707. bool IsSkill();
  708. bool IsHouseItem();
  709. bool IsHouseContainer();
  710. bool IsShield();
  711. bool IsAdornment();
  712. bool IsAmmo();
  713. bool IsBook();
  714. bool IsChainArmor();
  715. bool IsClothArmor();
  716. bool IsCollectable();
  717. bool IsCloak();
  718. bool IsCrushWeapon();
  719. bool IsFoodFood();
  720. bool IsFoodDrink();
  721. bool IsJewelry();
  722. bool IsLeatherArmor();
  723. bool IsMisc();
  724. bool IsPierceWeapon();
  725. bool IsPlateArmor();
  726. bool IsPoison();
  727. bool IsPotion();
  728. bool IsRecipeBook();
  729. bool IsSalesDisplay();
  730. bool IsSlashWeapon();
  731. bool IsSpellScroll();
  732. bool IsTinkered();
  733. bool IsTradeskill();
  734. bool IsThrown();
  735. void SetItemScript(string name);
  736. const char* GetItemScript();
  737. int32 CalculateRepairCost();
  738. void SetItemType(int8 in_type);
  739. void serialize(PacketStruct* packet, bool show_name = false, Player* player = 0, int16 packet_type = 0, int8 subtype = 0, bool loot_item = false);
  740. 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);
  741. PacketStruct* PrepareItem(int16 version, bool merchant_item = false, bool loot_item = false);
  742. bool CheckFlag(int32 flag);
  743. void AddSlot(int8 slot_id);
  744. void SetSlots(int32 slots);
  745. bool needs_deletion;
  746. };
  747. class MasterItemList{
  748. public:
  749. ~MasterItemList();
  750. map<int32,Item*> items;
  751. Item* GetItem(int32 id);
  752. Item* GetItemByName(const char *name);
  753. ItemStatsValues* CalculateItemBonuses(int32 item_id, Entity* entity = 0);
  754. ItemStatsValues* CalculateItemBonuses(Item* desc, Entity* entity = 0, ItemStatsValues* values = 0);
  755. 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);
  756. vector<Item*>* GetItems(map<string, string> criteria);
  757. void AddItem(Item* item);
  758. bool IsBag(int32 item_id);
  759. void RemoveAll();
  760. static int32 NextUniqueID();
  761. static void ResetUniqueID(int32 new_id);
  762. static int32 next_unique_id;
  763. };
  764. class PlayerItemList {
  765. public:
  766. PlayerItemList();
  767. ~PlayerItemList();
  768. // int16 number;
  769. map<int32, Item*> indexed_items;
  770. map<sint32, map<int16, Item*> > items;
  771. // map< int8, Item* > inv_items;
  772. // map< int8, Item* > bank_items;
  773. bool SharedBankAddAllowed(Item* item);
  774. vector<Item*>* GetItemsFromBagID(sint32 bag_id);
  775. vector<Item*>* GetItemsInBag(Item* bag);
  776. Item* GetBag(int8 inventory_slot, bool lock = true);
  777. bool HasItem(int32 id, bool include_bank = false);
  778. Item* GetItemFromIndex(int32 index);
  779. void MoveItem(Item* item, sint32 inv_slot, int16 slot, bool erase_old = true);
  780. bool MoveItem(sint32 to_bag_id, int16 from_index, sint8 to, int8 charges);
  781. Item* GetItemFromUniqueID(int32 item_id, bool include_bank = false, bool lock = true);
  782. Item* GetItemFromID(int32 item_id, int8 count = 0, bool include_bank = false, bool lock = true);
  783. bool AssignItemToFreeSlot(Item* item);
  784. int16 GetNumberOfFreeSlots();
  785. int16 GetNumberOfItems();
  786. bool HasFreeSlot();
  787. bool HasFreeBagSlot();
  788. void DestroyItem(int16 index);
  789. Item* CanStack(Item* item, bool include_bank = false);
  790. void RemoveItem(Item* item, bool delete_item = false);
  791. void AddItem(Item* item);
  792. Item* GetItem(sint32 bag_slot, int16 slot);
  793. EQ2Packet* serialize(Player* player, int16 version);
  794. uchar* xor_packet;
  795. uchar* orig_packet;
  796. map<int32, Item*>* GetAllItems();
  797. bool HasFreeBankSlot();
  798. int8 FindFreeBankSlot();
  799. ///<summary>Get the first free slot and stor them in the provided variables</summary>
  800. ///<param name='bag_id'>Will contain the bag id of the first free spot</param>
  801. ///<param name='slot'>Will contain the slot id of the first free slot</param>
  802. ///<returns>True if a free slot was found</returns>
  803. bool GetFirstFreeSlot(sint32* bag_id, sint16* slot);
  804. private:
  805. void Stack(Item* orig_item, Item* item);
  806. Mutex MPlayerItems;
  807. int16 packet_count;
  808. };
  809. class OverFlowItemList : public PlayerItemList {
  810. public:
  811. bool OverFlowSlotFull();
  812. int8 GetNextOverFlowSlot();
  813. bool AddItem(Item* item);
  814. Item* GetOverFlowItem();
  815. };
  816. class EquipmentItemList{
  817. public:
  818. EquipmentItemList();
  819. EquipmentItemList(const EquipmentItemList& list);
  820. ~EquipmentItemList();
  821. Item* items[NUM_SLOTS];
  822. vector<Item*>* GetAllEquippedItems();
  823. bool HasItem(int32 id);
  824. int8 GetNumberOfItems();
  825. Item* GetItemFromUniqueID(int32 item_id);
  826. Item* GetItemFromItemID(int32 item_id);
  827. void SetItem(int8 slot_id, Item* item);
  828. void RemoveItem(int8 slot, bool delete_item = false);
  829. Item* GetItem(int8 slot_id);
  830. bool AddItem(int8 slot, Item* item);
  831. bool CheckEquipSlot(Item* tmp, int8 slot);
  832. bool CanItemBeEquippedInSlot(Item* tmp, int8 slot);
  833. int8 GetFreeSlot(Item* tmp, int8 slot_id = 255);
  834. ItemStatsValues* CalculateEquipmentBonuses(Entity* entity = 0);
  835. EQ2Packet* serialize(int16 version);
  836. uchar* xor_packet;
  837. uchar* orig_packet;
  838. private:
  839. Mutex MEquipmentItems;
  840. };
  841. #endif