Items_CoE.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816
  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. extern MasterItemList master_item_list;
  29. #define EQ2_PRIMARY_SLOT 0
  30. #define EQ2_SECONDARY_SLOT 1
  31. #define EQ2_HEAD_SLOT 2
  32. #define EQ2_CHEST_SLOT 3
  33. #define EQ2_SHOULDERS_SLOT 4
  34. #define EQ2_FOREARMS_SLOT 5
  35. #define EQ2_HANDS_SLOT 6
  36. #define EQ2_LEGS_SLOT 7
  37. #define EQ2_FEET_SLOT 8
  38. #define EQ2_LRING_SLOT 9
  39. #define EQ2_RRING_SLOT 10
  40. #define EQ2_EARS_SLOT_1 11
  41. #define EQ2_EARS_SLOT_2 12
  42. #define EQ2_NECK_SLOT 13
  43. #define EQ2_LWRIST_SLOT 14
  44. #define EQ2_RWRIST_SLOT 15
  45. #define EQ2_RANGE_SLOT 16
  46. #define EQ2_AMMO_SLOT 17
  47. #define EQ2_WAIST_SLOT 18
  48. #define EQ2_CLOAK_SLOT 19
  49. #define EQ2_CHARM_SLOT_1 20
  50. #define EQ2_CHARM_SLOT_2 21
  51. #define EQ2_FOOD_SLOT 22
  52. #define EQ2_DRINK_SLOT 23
  53. #define EQ2_TEXTURES_SLOT 24
  54. #define EQ2_UNKNOWN_SLOT 25
  55. #define PRIMARY_SLOT 1
  56. #define SECONDARY_SLOT 2
  57. #define HEAD_SLOT 4
  58. #define CHEST_SLOT 8
  59. #define SHOULDERS_SLOT 16
  60. #define FOREARMS_SLOT 32
  61. #define HANDS_SLOT 64
  62. #define LEGS_SLOT 128
  63. #define FEET_SLOT 256
  64. #define LRING_SLOT 512
  65. #define RRING_SLOT 1024
  66. #define EARS_SLOT_1 2048
  67. #define EARS_SLOT_2 4096
  68. #define NECK_SLOT 8192
  69. #define LWRIST_SLOT 16384
  70. #define RWRIST_SLOT 32768
  71. #define RANGE_SLOT 65536
  72. #define AMMO_SLOT 131072
  73. #define WAIST_SLOT 262144
  74. #define CLOAK_SLOT 524288
  75. #define CHARM_SLOT_1 1048576
  76. #define CHARM_SLOT_2 2097152
  77. #define FOOD_SLOT 4194304
  78. #define DRINK_SLOT 8388608
  79. #define TEXTURES_SLOT 16777216
  80. #define NUM_BANK_SLOTS 12
  81. #define NUM_SHARED_BANK_SLOTS 8
  82. #define NUM_SLOTS 25
  83. #define NUM_INV_SLOTS 6
  84. #define INV_SLOT1 0
  85. #define INV_SLOT2 50
  86. #define INV_SLOT3 100
  87. #define INV_SLOT4 150
  88. #define INV_SLOT5 200
  89. #define INV_SLOT6 250
  90. #define BANK_SLOT1 1000
  91. #define BANK_SLOT2 1100
  92. #define BANK_SLOT3 1200
  93. #define BANK_SLOT4 1300
  94. #define BANK_SLOT5 1400
  95. #define BANK_SLOT6 1500
  96. #define BANK_SLOT7 1600
  97. #define BANK_SLOT8 1700
  98. #define ATTUNED 1
  99. #define ATTUNEABLE 2
  100. #define ARTIFACT 4
  101. #define LORE 8
  102. #define TEMPORARY 16
  103. #define NO_TRADE 32
  104. #define NO_VALUE 64
  105. #define NO_ZONE 128
  106. #define NO_DESTROY 256
  107. #define CRAFTED 512
  108. #define GOOD_ONLY 1024
  109. #define EVIL_ONLY 2048
  110. #define ITEM_WIELD_TYPE_DUAL 1
  111. #define ITEM_WIELD_TYPE_SINGLE 2
  112. #define ITEM_WIELD_TYPE_TWO_HAND 4
  113. #define ITEM_TYPE_NORMAL 0
  114. #define ITEM_TYPE_WEAPON 1
  115. #define ITEM_TYPE_RANGED 2
  116. #define ITEM_TYPE_ARMOR 3
  117. #define ITEM_TYPE_SHIELD 4
  118. #define ITEM_TYPE_BAG 5
  119. #define ITEM_TYPE_SKILL 6
  120. #define ITEM_TYPE_RECIPE 7
  121. #define ITEM_TYPE_FOOD 8
  122. #define ITEM_TYPE_BAUBLE 9
  123. #define ITEM_TYPE_HOUSE 10
  124. #define ITEM_TYPE_THROWN 11
  125. #define ITEM_TYPE_HOUSE_CONTAINER 12
  126. #define ITEM_TYPE_BOOK 13
  127. #define ITEM_TYPE_ADORNMENT 14
  128. #define ITEM_TYPE_PATTERN 15
  129. #define ITEM_TYPE_ARMORSET 16
  130. #define ITEM_MENU_TYPE_GENERIC 1
  131. #define ITEM_MENU_TYPE_EQUIP 2
  132. #define ITEM_MENU_TYPE_BAG 4
  133. #define ITEM_MENU_TYPE_HOUSE 8
  134. #define ITEM_MENU_TYPE_SCRIBE 32
  135. #define ITEM_MENU_TYPE_INVALID 128
  136. #define ITEM_MENU_TYPE_BROKEN 512
  137. #define ITEM_MENU_TYPE_ATTUNED 2048
  138. #define ITEM_MENU_TYPE_ATTUNEABLE 4096
  139. #define ITEM_MENU_TYPE_BOOK 8192
  140. #define ITEM_MENU_TYPE_DISPLAY_CHARGES 16384
  141. #define ITEM_MENU_TYPE_NAMEPET 65536
  142. #define ITEM_MENU_TYPE_USE 524288
  143. #define ITEM_MENU_TYPE_DRINK 8388608
  144. #define ITEM_MENU_TYPE_REDEEM 536870912
  145. #define ITEM_TAG_UNCOMMON 3 //tier tags
  146. #define ITEM_TAG_TREASURED 4
  147. #define ITEM_TAG_LEGENDARY 7
  148. #define ITEM_TAG_FABLED 9
  149. #define ITEM_TAG_MYTHICAL 12
  150. #define ITEM_BROKER_TYPE_ANY 0xFFFFFFFF
  151. #define ITEM_BROKER_TYPE_ADORNMENT 134217728
  152. #define ITEM_BROKER_TYPE_AMMO 1024
  153. #define ITEM_BROKER_TYPE_ATTUNEABLE 16384
  154. #define ITEM_BROKER_TYPE_BAG 2048
  155. #define ITEM_BROKER_TYPE_BAUBLE 16777216
  156. #define ITEM_BROKER_TYPE_BOOK 128
  157. #define ITEM_BROKER_TYPE_CHAINARMOR 2097152
  158. #define ITEM_BROKER_TYPE_CLOAK 1073741824
  159. #define ITEM_BROKER_TYPE_CLOTHARMOR 524288
  160. #define ITEM_BROKER_TYPE_COLLECTABLE 67108864
  161. #define ITEM_BROKER_TYPE_CRUSHWEAPON 4
  162. #define ITEM_BROKER_TYPE_DRINK 131072
  163. #define ITEM_BROKER_TYPE_FOOD 4096
  164. #define ITEM_BROKER_TYPE_HOUSEITEM 512
  165. #define ITEM_BROKER_TYPE_JEWELRY 262144
  166. #define ITEM_BROKER_TYPE_LEATHERARMOR 1048576
  167. #define ITEM_BROKER_TYPE_LORE 8192
  168. #define ITEM_BROKER_TYPE_MISC 1
  169. #define ITEM_BROKER_TYPE_PIERCEWEAPON 8
  170. #define ITEM_BROKER_TYPE_PLATEARMOR 4194304
  171. #define ITEM_BROKER_TYPE_POISON 65536
  172. #define ITEM_BROKER_TYPE_POTION 32768
  173. #define ITEM_BROKER_TYPE_RECIPEBOOK 8388608
  174. #define ITEM_BROKER_TYPE_SALESDISPLAY 33554432
  175. #define ITEM_BROKER_TYPE_SHIELD 32
  176. #define ITEM_BROKER_TYPE_SLASHWEAPON 2
  177. #define ITEM_BROKER_TYPE_SPELLSCROLL 64
  178. #define ITEM_BROKER_TYPE_TINKERED 268435456
  179. #define ITEM_BROKER_TYPE_TRADESKILL 256
  180. #define ITEM_BROKER_SLOT_ANY 0xFFFFFFFF
  181. #define ITEM_BROKER_SLOT_AMMO 65536
  182. #define ITEM_BROKER_SLOT_CHARM 524288
  183. #define ITEM_BROKER_SLOT_CHEST 32
  184. #define ITEM_BROKER_SLOT_CLOAK 262144
  185. #define ITEM_BROKER_SLOT_DRINK 2097152
  186. #define ITEM_BROKER_SLOT_EARS 4096
  187. #define ITEM_BROKER_SLOT_FEET 1024
  188. #define ITEM_BROKER_SLOT_FOOD 1048576
  189. #define ITEM_BROKER_SLOT_FOREARMS 128
  190. #define ITEM_BROKER_SLOT_HANDS 256
  191. #define ITEM_BROKER_SLOT_HEAD 16
  192. #define ITEM_BROKER_SLOT_LEGS 512
  193. #define ITEM_BROKER_SLOT_NECK 8192
  194. #define ITEM_BROKER_SLOT_PRIMARY 1
  195. #define ITEM_BROKER_SLOT_PRIMARY_2H 2
  196. #define ITEM_BROKER_SLOT_RANGE_WEAPON 32768
  197. #define ITEM_BROKER_SLOT_RING 2048
  198. #define ITEM_BROKER_SLOT_SECONDARY 8
  199. #define ITEM_BROKER_SLOT_SHOULDERS 64
  200. #define ITEM_BROKER_SLOT_WAIST 131072
  201. #define ITEM_BROKER_SLOT_WRIST 16384
  202. #define ITEM_BROKER_STAT_TYPE_NONE 0
  203. #define ITEM_BROKER_STAT_TYPE_DEF 2
  204. #define ITEM_BROKER_STAT_TYPE_STR 4
  205. #define ITEM_BROKER_STAT_TYPE_STA 8
  206. #define ITEM_BROKER_STAT_TYPE_AGI 16
  207. #define ITEM_BROKER_STAT_TYPE_WIS 32
  208. #define ITEM_BROKER_STAT_TYPE_INT 64
  209. #define ITEM_BROKER_STAT_TYPE_HEALTH 128
  210. #define ITEM_BROKER_STAT_TYPE_POWER 256
  211. #define ITEM_BROKER_STAT_TYPE_HEAT 512
  212. #define ITEM_BROKER_STAT_TYPE_COLD 1024
  213. #define ITEM_BROKER_STAT_TYPE_MAGIC 2048
  214. #define ITEM_BROKER_STAT_TYPE_MENTAL 4096
  215. #define ITEM_BROKER_STAT_TYPE_DIVINE 8192
  216. #define ITEM_BROKER_STAT_TYPE_POISON 16384
  217. #define ITEM_BROKER_STAT_TYPE_DISEASE 32768
  218. #define ITEM_BROKER_STAT_TYPE_CRUSH 65536
  219. #define ITEM_BROKER_STAT_TYPE_SLASH 131072
  220. #define ITEM_BROKER_STAT_TYPE_PIERCE 262144
  221. #define ITEM_BROKER_STAT_TYPE_CRITICAL 524288
  222. #define ITEM_BROKER_STAT_TYPE_DBL_ATTACK 1048576
  223. #define ITEM_BROKER_STAT_TYPE_ABILITY_MOD 2097152
  224. #define ITEM_BROKER_STAT_TYPE_POTENCY 4194304
  225. #define OVERFLOW_SLOT 0xFFFFFFFE
  226. #define SLOT_INVALID 0xFFFF
  227. #define ITEM_STAT_STR 0
  228. #define ITEM_STAT_STA 1
  229. #define ITEM_STAT_AGI 2
  230. #define ITEM_STAT_WIS 3
  231. #define ITEM_STAT_INT 4
  232. #define ITEM_STAT_ADORNING 100
  233. #define ITEM_STAT_AGGRESSION 101
  234. #define ITEM_STAT_ARTIFICING 102
  235. #define ITEM_STAT_ARTISTRY 103
  236. #define ITEM_STAT_CHEMISTRY 104
  237. #define ITEM_STAT_CRUSHING 105
  238. #define ITEM_STAT_DEFENSE 106
  239. #define ITEM_STAT_DEFLECTION 107
  240. #define ITEM_STAT_DISRUPTION 108
  241. #define ITEM_STAT_FISHING 109
  242. #define ITEM_STAT_FLETCHING 110
  243. #define ITEM_STAT_FOCUS 111
  244. #define ITEM_STAT_FORESTING 112
  245. #define ITEM_STAT_GATHERING 113
  246. #define ITEM_STAT_METAL_SHAPING 114
  247. #define ITEM_STAT_METALWORKING 115
  248. #define ITEM_STAT_MINING 116
  249. #define ITEM_STAT_MINISTRATION 117
  250. #define ITEM_STAT_ORDINATION 118
  251. #define ITEM_STAT_PARRY 119
  252. #define ITEM_STAT_PIERCING 120
  253. #define ITEM_STAT_RANGED 121
  254. #define ITEM_STAT_SAFE_FALL 122
  255. #define ITEM_STAT_SCRIBING 123
  256. #define ITEM_STAT_SCULPTING 124
  257. #define ITEM_STAT_SLASHING 125
  258. #define ITEM_STAT_SUBJUGATION 126
  259. #define ITEM_STAT_SWIMMING 127
  260. #define ITEM_STAT_TAILORING 128
  261. #define ITEM_STAT_TINKERING 129
  262. #define ITEM_STAT_TRANSMUTING 130
  263. #define ITEM_STAT_TRAPPING 131
  264. #define ITEM_STAT_WEAPON_SKILLS 132
  265. #define ITEM_STAT_VS_PHYSICAL 200
  266. #define ITEM_STAT_VS_ELEMENTAL 201
  267. #define ITEM_STAT_VS_NOXIOUS 202
  268. #define ITEM_STAT_VS_ARCANE 203
  269. //#define ITEM_STAT_VS_SLASH 200
  270. //#define ITEM_STAT_VS_CRUSH 201
  271. //#define ITEM_STAT_VS_PIERCE 202
  272. //#define ITEM_STAT_VS_HEAT 203
  273. //#define ITEM_STAT_VS_COLD 204
  274. //#define ITEM_STAT_VS_MAGIC 205
  275. //#define ITEM_STAT_VS_MENTAL 206
  276. //#define ITEM_STAT_VS_DIVINE 207
  277. //#define ITEM_STAT_VS_DISEASE 208
  278. //#define ITEM_STAT_VS_POISON 209
  279. //#define ITEM_STAT_VS_DROWNING 210
  280. //#define ITEM_STAT_VS_FALLING 211
  281. //#define ITEM_STAT_VS_PAIN 212
  282. //#define ITEM_STAT_VS_MELEE 213
  283. #define ITEM_STAT_DMG_SLASH 300
  284. #define ITEM_STAT_DMG_CRUSH 301
  285. #define ITEM_STAT_DMG_PIERCE 302
  286. #define ITEM_STAT_DMG_HEAT 303
  287. #define ITEM_STAT_DMG_COLD 304
  288. #define ITEM_STAT_DMG_MAGIC 305
  289. #define ITEM_STAT_DMG_MENTAL 306
  290. #define ITEM_STAT_DMG_DIVINE 307
  291. #define ITEM_STAT_DMG_DISEASE 308
  292. #define ITEM_STAT_DMG_POISON 309
  293. #define ITEM_STAT_DMG_DROWNING 310
  294. #define ITEM_STAT_DMG_FALLING 311
  295. #define ITEM_STAT_DMG_PAIN 312
  296. #define ITEM_STAT_DMG_MELEE 313
  297. #define ITEM_STAT_HEALTH 500
  298. #define ITEM_STAT_POWER 501
  299. #define ITEM_STAT_CONCENTRATION 502
  300. #define ITEM_STAT_SAVAGERY 503
  301. #define ITEM_STAT_HPREGEN 600
  302. #define ITEM_STAT_MANAREGEN 601
  303. #define ITEM_STAT_HPREGENPPT 602
  304. #define ITEM_STAT_MPREGENPPT 603
  305. #define ITEM_STAT_COMBATHPREGENPPT 604
  306. #define ITEM_STAT_COMBATMPREGENPPT 605
  307. #define ITEM_STAT_MAXHP 606
  308. #define ITEM_STAT_MAXHPPERC 607
  309. #define ITEM_STAT_MAXHPPERCFINAL 608
  310. #define ITEM_STAT_SPEED 609
  311. #define ITEM_STAT_SLOW 610
  312. #define ITEM_STAT_MOUNTSPEED 611
  313. #define ITEM_STAT_MOUNTAIRSPEED 612
  314. #define ITEM_STAT_LEAPSPEED 613
  315. #define ITEM_STAT_LEAPTIME 614
  316. #define ITEM_STAT_GLIDEEFFICIENCY 615
  317. #define ITEM_STAT_OFFENSIVESPEED 616
  318. #define ITEM_STAT_ATTACKSPEED 617
  319. #define ITEM_STAT_SPELLWEAPONATTACKSPEED 618
  320. #define ITEM_STAT_MAXMANA 619
  321. #define ITEM_STAT_MAXMANAPERC 620
  322. #define ITEM_STAT_MAXATTPERC 621
  323. #define ITEM_STAT_BLURVISION 622
  324. #define ITEM_STAT_MAGICLEVELIMMUNITY 623
  325. #define ITEM_STAT_HATEGAINMOD 624
  326. #define ITEM_STAT_COMBATEXPMOD 625
  327. #define ITEM_STAT_TRADESKILLEXPMOD 626
  328. #define ITEM_STAT_ACHIEVEMENTEXPMOD 627
  329. #define ITEM_STAT_SIZEMOD 628
  330. #define ITEM_STAT_DPS 629
  331. #define ITEM_STAT_SPELLWEAPONDPS 630
  332. #define ITEM_STAT_STEALTH 631
  333. #define ITEM_STAT_INVIS 632
  334. #define ITEM_STAT_SEESTEALTH 633
  335. #define ITEM_STAT_SEEINVIS 634
  336. #define ITEM_STAT_EFFECTIVELEVELMOD 635
  337. #define ITEM_STAT_RIPOSTECHANCE 636
  338. #define ITEM_STAT_PARRYCHANCE 637
  339. #define ITEM_STAT_DODGECHANCE 638
  340. #define ITEM_STAT_AEAUTOATTACKCHANCE 639
  341. #define ITEM_STAT_SPELLWEAPONAEAUTOATTACKCHANCE 640
  342. #define ITEM_STAT_DOUBLEATTACKCHANCE 641
  343. #define ITEM_STAT_PVPDOUBLEATTACKCHANCE 642
  344. #define ITEM_STAT_SPELLWEAPONAEAUTOATTACKCHANCE 643
  345. #define ITEM_STAT_PVPSPELLWEAPONDOUBLEATTACKCHANCE 644
  346. #define ITEM_STAT_SPELLDOUBLEATTACKCHANCE 645
  347. #define ITEM_STAT_PVPSPELLDOUBLEATTACKCHANCE 646
  348. #define ITEM_STAT_FLURRY 647
  349. #define ITEM_STAT_SPELLWEAPONFLURRY 648
  350. #define ITEM_STAT_MELEEDAMAGEMULTIPLIER 649
  351. #define ITEM_STAT_EXTRAHARVESTCHANCE 650
  352. #define ITEM_STAT_EXTRASHIELDBLOCKCHANCE 651
  353. #define ITEM_STAT_ITEMHPREGENPPT 652
  354. #define ITEM_STAT_ITEMPPREGENPPT 653
  355. #define ITEM_STAT_MELEECRITCHANCE 654
  356. #define ITEM_STAT_CRITAVOIDANCE 655
  357. #define ITEM_STAT_BENEFICIALCRITCHANCE 656
  358. #define ITEM_STAT_CRITBONUS 657
  359. #define ITEM_STAT_PVPCRITBONUS 658
  360. #define ITEM_STAT_BASEMODIFIER 659
  361. #define ITEM_STAT_PVPBASEMODIFIER 660
  362. #define ITEM_STAT_UNCONSCIOUSHPMOD 661
  363. #define ITEM_STAT_SPELLTIMEREUSEPCT 662
  364. #define ITEM_STAT_SPELLTIMERECOVERYPCT 663
  365. #define ITEM_STAT_SPELLTIMECASTPCT 664
  366. #define ITEM_STAT_SPELLTIMEREUSESPELLONLY 665
  367. #define ITEM_STAT_MELEEWEAPONRANGE 666
  368. #define ITEM_STAT_RANGEDWEAPONRANGE 667
  369. #define ITEM_STAT_FALLINGDAMAGEREDUCTION 668
  370. #define ITEM_STAT_RIPOSTEDAMAGE 669
  371. #define ITEM_STAT_MINIMUMDEFLECTIONCHANCE 670
  372. #define ITEM_STAT_MOVEMENTWEAVE 671
  373. #define ITEM_STAT_COMBATHPREGEN 672
  374. #define ITEM_STAT_COMBATMANAREGEN 673
  375. #define ITEM_STAT_CONTESTSPEEDBOOST 674
  376. #define ITEM_STAT_TRACKINGAVOIDANCE 675
  377. #define ITEM_STAT_STEALTHINVISSPEEDMOD 676
  378. #define ITEM_STAT_LOOT_COIN 677
  379. #define ITEM_STAT_ARMORMITIGATIONINCREASE 678
  380. #define ITEM_STAT_AMMOCONSERVATION 679
  381. #define ITEM_STAT_STRIKETHROUGH 680
  382. #define ITEM_STAT_STATUSBONUS 681
  383. #define ITEM_STAT_ACCURACY 682
  384. #define ITEM_STAT_COUNTERSTRIKE 683
  385. #define ITEM_STAT_SHIELDBASH 684
  386. #define ITEM_STAT_WEAPONDAMAGEBONUS 685
  387. #define ITEM_STAT_WEAPONDAMAGEBONUSMELEEONLY 686
  388. #define ITEM_STAT_ADDITIONALRIPOSTECHANCE 687
  389. #define ITEM_STAT_CRITICALMITIGATION 688
  390. #define ITEM_STAT_PVPTOUGHNESS 689
  391. #define ITEM_STAT_PVPLETHALITY 690
  392. #define ITEM_STAT_STAMINABONUS 691
  393. #define ITEM_STAT_WISDOMMITBONUS 692
  394. #define ITEM_STAT_HEALRECEIVE 693
  395. #define ITEM_STAT_HEALRECEIVEPERC 694
  396. #define ITEM_STAT_PVPCRITICALMITIGATION 695
  397. #define ITEM_STAT_BASEAVOIDANCEBONUS 696
  398. #define ITEM_STAT_INCOMBATSAVAGERYREGEN 697
  399. #define ITEM_STAT_OUTOFCOMBATSAVAGERYREGEN 698
  400. #define ITEM_STAT_SAVAGERYREGEN 699
  401. #define ITEM_STAT_SAVAGERYGAINMOD 6100
  402. #define ITEM_STAT_MAXSAVAGERYLEVEL 6101
  403. #define ITEM_STAT_SPELL_DAMAGE 700
  404. #define ITEM_STAT_HEAL_AMOUNT 701
  405. #define ITEM_STAT_SPELL_AND_HEAL 702
  406. #define ITEM_STAT_COMBAT_ART_DAMAGE 703
  407. #define ITEM_STAT_SPELL_AND_COMBAT_ART_DAMAGE 704
  408. #define ITEM_STAT_TAUNT_AMOUNT 705
  409. #define ITEM_STAT_TAUNT_AND_COMBAT_ART_DAMAGE 706
  410. #define ITEM_STAT_ABILITY_MODIFIER 707
  411. #pragma pack(1)
  412. struct ItemStatsValues{
  413. sint16 str;
  414. sint16 sta;
  415. sint16 agi;
  416. sint16 wis;
  417. sint16 int_;
  418. sint16 vs_slash;
  419. sint16 vs_crush;
  420. sint16 vs_pierce;
  421. sint16 vs_heat;
  422. sint16 vs_cold;
  423. sint16 vs_magic;
  424. sint16 vs_mental;
  425. sint16 vs_divine;
  426. sint16 vs_disease;
  427. sint16 vs_poison;
  428. sint16 health;
  429. sint16 power;
  430. sint8 concentration;
  431. };
  432. struct ItemCore{
  433. int32 item_id;
  434. sint32 soe_id;
  435. int32 bag_id;
  436. sint32 inv_slot_id;
  437. sint16 slot_id;
  438. int8 index;
  439. int16 icon;
  440. int16 count;
  441. int8 tier;
  442. int8 num_slots;
  443. int32 unique_id;
  444. int8 num_free_slots;
  445. int16 recommended_level;
  446. };
  447. #pragma pack()
  448. struct ItemStat{
  449. string stat_name;
  450. int8 stat_type;
  451. sint16 stat_subtype;
  452. int16 stat_type_combined;
  453. float value;
  454. };
  455. struct ItemLevelOverride{
  456. int8 adventure_class;
  457. int8 tradeskill_class;
  458. int16 level;
  459. };
  460. struct ItemClass{
  461. int8 adventure_class;
  462. int8 tradeskill_class;
  463. int16 level;
  464. };
  465. struct ItemAppearance{
  466. int16 type;
  467. int8 red;
  468. int8 green;
  469. int8 blue;
  470. int8 highlight_red;
  471. int8 highlight_green;
  472. int8 highlight_blue;
  473. };
  474. class PlayerItemList;
  475. class Item{
  476. public:
  477. #pragma pack(1)
  478. struct ItemStatString{
  479. EQ2_8BitString stat_string;
  480. };
  481. struct Generic_Info{
  482. int8 show_name;
  483. int8 creator_flag;
  484. int16 item_flags;
  485. int8 condition;
  486. int32 weight; // num/10
  487. int32 skill_req1;
  488. int32 skill_req2;
  489. int16 skill_min;
  490. int8 item_type; //0=normal, 1=weapon, 2=range, 3=armor, 4=shield, 5=container, 6=spell scroll, 7=recipe book, 8=food/drink, 9=bauble, 10=house item, 11=ammo, 12=house container
  491. int16 appearance_id;
  492. int8 appearance_red;
  493. int8 appearance_green;
  494. int8 appearance_blue;
  495. int8 appearance_highlight_red;
  496. int8 appearance_highlight_green;
  497. int8 appearance_highlight_blue;
  498. int8 collectable;
  499. int32 offers_quest_id;
  500. int32 part_of_quest_id;
  501. int16 max_charges;
  502. int8 display_charges;
  503. int64 adventure_classes;
  504. int64 tradeskill_classes;
  505. int16 adventure_default_level;
  506. int16 tradeskill_default_level;
  507. int8 usable;
  508. };
  509. struct Armor_Info {
  510. int16 mitigation_low;
  511. int16 mitigation_high;
  512. };
  513. struct Weapon_Info {
  514. int16 wield_type;
  515. int16 damage_low1;
  516. int16 damage_high1;
  517. int16 damage_low2;
  518. int16 damage_high2;
  519. int16 damage_low3;
  520. int16 damage_high3;
  521. int16 delay;
  522. float rating;
  523. };
  524. struct Shield_Info {
  525. Armor_Info armor_info;
  526. };
  527. struct Ranged_Info {
  528. Weapon_Info weapon_info;
  529. int16 range_low;
  530. int16 range_high;
  531. };
  532. struct Bag_Info {
  533. int8 num_slots;
  534. int16 weight_reduction;
  535. };
  536. struct Food_Info{
  537. int8 type; //0=water, 1=food
  538. int8 level;
  539. float duration;
  540. int8 satiation;
  541. };
  542. struct Bauble_Info{
  543. int16 cast;
  544. int16 recovery;
  545. int32 duration;
  546. float recast;
  547. int8 display_slot_optional;
  548. int8 display_cast_time;
  549. int8 display_bauble_type;
  550. float effect_radius;
  551. int32 max_aoe_targets;
  552. int8 display_until_cancelled;
  553. };
  554. struct Book_Info{
  555. int8 language;
  556. EQ2_16BitString author;
  557. EQ2_16BitString title;
  558. };
  559. struct Skill_Info{
  560. int32 spell_id;
  561. int32 spell_tier;
  562. };
  563. struct House_Info{
  564. int32 status_rent_reduction;
  565. };
  566. struct HouseContainer_Info{
  567. int16 disallowed_types;
  568. int16 allowed_types;
  569. int8 num_slots;
  570. };
  571. struct RecipeBook_Info{
  572. vector<string> recipes;
  573. int8 uses;
  574. };
  575. struct Thrown_Info{
  576. sint32 range;
  577. sint32 damage_modifier;
  578. float hit_bonus;
  579. int32 damage_type;
  580. };
  581. struct ItemEffect{
  582. EQ2_16BitString effect;
  583. int8 percentage;
  584. int8 subbulletflag;
  585. };
  586. #pragma pack()
  587. Item();
  588. Item(Item* in_item);
  589. ~Item();
  590. string lowername;
  591. string name;
  592. string description;
  593. int8 stack_count;
  594. int32 sell_price;
  595. int32 max_sell_value;
  596. bool save_needed;
  597. int8 weapon_type;
  598. string adornment;
  599. string creator;
  600. vector<ItemStat*> item_stats;
  601. vector<ItemStatString*> item_string_stats;
  602. vector<ItemLevelOverride*> item_level_overrides;
  603. vector<ItemEffect*> item_effects;
  604. Generic_Info generic_info;
  605. Weapon_Info* weapon_info;
  606. Ranged_Info* ranged_info;
  607. Armor_Info* armor_info;
  608. Bag_Info* bag_info;
  609. Food_Info* food_info;
  610. Bauble_Info* bauble_info;
  611. Book_Info* book_info;
  612. Skill_Info* skill_info;
  613. RecipeBook_Info* recipebook_info;
  614. Thrown_Info* thrown_info;
  615. vector<int8> slot_data;
  616. ItemCore details;
  617. int32 spell_id;
  618. int8 spell_tier;
  619. string item_script;
  620. void AddEffect(string effect, int8 percentage, int8 subbulletflag);
  621. int32 GetMaxSellValue();
  622. void SetMaxSellValue(int32 val);
  623. void SetItem(Item* old_item);
  624. int16 GetOverrideLevel(int8 adventure_class, int8 tradeskill_class);
  625. void AddLevelOverride(int8 adventure_class, int8 tradeskill_class, int16 level);
  626. void AddLevelOverride(ItemLevelOverride* class_);
  627. bool CheckClassLevel(int8 adventure_class, int8 tradeskill_class, int16 level);
  628. bool CheckClass(int8 adventure_class, int8 tradeskill_class);
  629. bool CheckLevel(int8 adventure_class, int8 tradeskill_class, int16 level);
  630. void SetAppearance(int16 type, int8 red, int8 green, int8 blue, int8 highlight_red, int8 highlight_green, int8 highlight_blue);
  631. void SetAppearance(ItemAppearance* appearance);
  632. void AddStat(ItemStat* in_stat);
  633. void AddStatString(ItemStatString* in_stat);
  634. void AddStat(int8 type, int16 subtype, float value, char* name = 0);
  635. void SetWeaponType(int8 type);
  636. int8 GetWeaponType();
  637. bool HasSlot(int8 slot, int8 slot2 = 255);
  638. bool IsNormal();
  639. bool IsWeapon();
  640. bool IsArmor();
  641. bool IsRanged();
  642. bool IsBag();
  643. bool IsFood();
  644. bool IsBauble();
  645. bool IsSkill();
  646. bool IsHouseItem();
  647. bool IsHouseContainer();
  648. bool IsShield();
  649. bool IsAdornment();
  650. bool IsAmmo();
  651. bool IsBook();
  652. bool IsChainArmor();
  653. bool IsClothArmor();
  654. bool IsCollectable();
  655. bool IsCloak();
  656. bool IsCrushWeapon();
  657. bool IsFoodFood();
  658. bool IsFoodDrink();
  659. bool IsJewelry();
  660. bool IsLeatherArmor();
  661. bool IsMisc();
  662. bool IsPierceWeapon();
  663. bool IsPlateArmor();
  664. bool IsPoison();
  665. bool IsPotion();
  666. bool IsRecipeBook();
  667. bool IsSalesDisplay();
  668. bool IsSlashWeapon();
  669. bool IsSpellScroll();
  670. bool IsTinkered();
  671. bool IsTradeskill();
  672. bool IsThrown();
  673. void SetItemScript(string name);
  674. const char* GetItemScript();
  675. int32 CalculateRepairCost();
  676. void SetItemType(int8 in_type);
  677. void serialize(PacketStruct* packet, bool show_name = false, Player* player = 0, int16 packet_type = 0, int8 subtype = 0, bool loot_item = false);
  678. 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);
  679. PacketStruct* PrepareItem(int16 version, bool merchant_item = false, bool loot_item = false);
  680. bool CheckFlag(int32 flag);
  681. void AddSlot(int8 slot_id);
  682. void SetSlots(int32 slots);
  683. bool needs_deletion;
  684. };
  685. class MasterItemList{
  686. public:
  687. ~MasterItemList();
  688. map<int32,Item*> items;
  689. Item* GetItem(int32 id);
  690. Item* GetItemByName(const char *name);
  691. ItemStatsValues* CalculateItemBonuses(int32 item_id);
  692. ItemStatsValues* CalculateItemBonuses(Item* desc, ItemStatsValues* values = 0);
  693. 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);
  694. vector<Item*>* GetItems(map<string, string> criteria);
  695. void AddItem(Item* item);
  696. bool IsBag(int32 item_id);
  697. void RemoveAll();
  698. static int32 NextUniqueID();
  699. static void ResetUniqueID(int32 new_id);
  700. static int32 next_unique_id;
  701. };
  702. class PlayerItemList {
  703. public:
  704. PlayerItemList();
  705. ~PlayerItemList();
  706. // int16 number;
  707. map<int32, Item*> indexed_items;
  708. map<sint32, map<int16, Item*> > items;
  709. // map< int8, Item* > inv_items;
  710. // map< int8, Item* > bank_items;
  711. bool SharedBankAddAllowed(Item* item);
  712. vector<Item*>* GetItemsFromBagID(sint32 bag_id);
  713. vector<Item*>* GetItemsInBag(Item* bag);
  714. Item* GetBag(int8 inventory_slot, bool lock = true);
  715. bool HasItem(int32 id, bool include_bank = false);
  716. Item* GetItemFromIndex(int32 index);
  717. void MoveItem(Item* item, sint32 inv_slot, int16 slot, bool erase_old = true);
  718. bool MoveItem(sint32 to_bag_id, int16 from_index, sint8 to, int8 charges);
  719. Item* GetItemFromUniqueID(int32 item_id, bool include_bank = false, bool lock = true);
  720. Item* GetItemFromID(int32 item_id, int8 count = 0, bool include_bank = false, bool lock = true);
  721. bool AssignItemToFreeSlot(Item* item);
  722. int16 GetNumberOfFreeSlots();
  723. int16 GetNumberOfItems();
  724. bool HasFreeSlot();
  725. bool HasFreeBagSlot();
  726. void DestroyItem(int16 index);
  727. Item* CanStack(Item* item, bool include_bank = false);
  728. void RemoveItem(Item* item, bool delete_item = false);
  729. void AddItem(Item* item);
  730. Item* GetItem(sint32 bag_slot, int16 slot);
  731. EQ2Packet* serialize(Player* player, int16 version);
  732. uchar* xor_packet;
  733. uchar* orig_packet;
  734. map<int32, Item*>* GetAllItems();
  735. bool HasFreeBankSlot();
  736. int8 FindFreeBankSlot();
  737. private:
  738. void Stack(Item* orig_item, Item* item);
  739. Mutex MPlayerItems;
  740. int16 packet_count;
  741. };
  742. class OverFlowItemList : public PlayerItemList {
  743. public:
  744. bool OverFlowSlotFull();
  745. int8 GetNextOverFlowSlot();
  746. bool AddItem(Item* item);
  747. Item* GetOverFlowItem();
  748. };
  749. class EquipmentItemList{
  750. public:
  751. EquipmentItemList();
  752. EquipmentItemList(const EquipmentItemList& list);
  753. ~EquipmentItemList();
  754. Item* items[NUM_SLOTS];
  755. vector<Item*>* GetAllEquippedItems();
  756. bool HasItem(int32 id);
  757. int8 GetNumberOfItems();
  758. Item* GetItemFromUniqueID(int32 item_id);
  759. Item* GetItemFromItemID(int32 item_id);
  760. void SetItem(int8 slot_id, Item* item);
  761. void RemoveItem(int8 slot, bool delete_item = false);
  762. Item* GetItem(int8 slot_id);
  763. bool AddItem(int8 slot, Item* item);
  764. bool CheckEquipSlot(Item* tmp, int8 slot);
  765. bool CanItemBeEquippedInSlot(Item* tmp, int8 slot);
  766. int8 GetFreeSlot(Item* tmp, int8 slot_id = 255);
  767. ItemStatsValues* CalculateEquipmentBonuses();
  768. EQ2Packet* serialize(int16 version);
  769. uchar* xor_packet;
  770. uchar* orig_packet;
  771. private:
  772. Mutex MEquipmentItems;
  773. };
  774. #endif