9
3

Items_CoE.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817
  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. bool item_locked;
  447. };
  448. #pragma pack()
  449. struct ItemStat{
  450. string stat_name;
  451. int8 stat_type;
  452. sint16 stat_subtype;
  453. int16 stat_type_combined;
  454. float value;
  455. };
  456. struct ItemLevelOverride{
  457. int8 adventure_class;
  458. int8 tradeskill_class;
  459. int16 level;
  460. };
  461. struct ItemClass{
  462. int8 adventure_class;
  463. int8 tradeskill_class;
  464. int16 level;
  465. };
  466. struct ItemAppearance{
  467. int16 type;
  468. int8 red;
  469. int8 green;
  470. int8 blue;
  471. int8 highlight_red;
  472. int8 highlight_green;
  473. int8 highlight_blue;
  474. };
  475. class PlayerItemList;
  476. class Item{
  477. public:
  478. #pragma pack(1)
  479. struct ItemStatString{
  480. EQ2_8BitString stat_string;
  481. };
  482. struct Generic_Info{
  483. int8 show_name;
  484. int8 creator_flag;
  485. int16 item_flags;
  486. int8 condition;
  487. int32 weight; // num/10
  488. int32 skill_req1;
  489. int32 skill_req2;
  490. int16 skill_min;
  491. 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
  492. int16 appearance_id;
  493. int8 appearance_red;
  494. int8 appearance_green;
  495. int8 appearance_blue;
  496. int8 appearance_highlight_red;
  497. int8 appearance_highlight_green;
  498. int8 appearance_highlight_blue;
  499. int8 collectable;
  500. int32 offers_quest_id;
  501. int32 part_of_quest_id;
  502. int16 max_charges;
  503. int8 display_charges;
  504. int64 adventure_classes;
  505. int64 tradeskill_classes;
  506. int16 adventure_default_level;
  507. int16 tradeskill_default_level;
  508. int8 usable;
  509. };
  510. struct Armor_Info {
  511. int16 mitigation_low;
  512. int16 mitigation_high;
  513. };
  514. struct Weapon_Info {
  515. int16 wield_type;
  516. int16 damage_low1;
  517. int16 damage_high1;
  518. int16 damage_low2;
  519. int16 damage_high2;
  520. int16 damage_low3;
  521. int16 damage_high3;
  522. int16 delay;
  523. float rating;
  524. };
  525. struct Shield_Info {
  526. Armor_Info armor_info;
  527. };
  528. struct Ranged_Info {
  529. Weapon_Info weapon_info;
  530. int16 range_low;
  531. int16 range_high;
  532. };
  533. struct Bag_Info {
  534. int8 num_slots;
  535. int16 weight_reduction;
  536. };
  537. struct Food_Info{
  538. int8 type; //0=water, 1=food
  539. int8 level;
  540. float duration;
  541. int8 satiation;
  542. };
  543. struct Bauble_Info{
  544. int16 cast;
  545. int16 recovery;
  546. int32 duration;
  547. float recast;
  548. int8 display_slot_optional;
  549. int8 display_cast_time;
  550. int8 display_bauble_type;
  551. float effect_radius;
  552. int32 max_aoe_targets;
  553. int8 display_until_cancelled;
  554. };
  555. struct Book_Info{
  556. int8 language;
  557. EQ2_16BitString author;
  558. EQ2_16BitString title;
  559. };
  560. struct Skill_Info{
  561. int32 spell_id;
  562. int32 spell_tier;
  563. };
  564. struct House_Info{
  565. int32 status_rent_reduction;
  566. };
  567. struct HouseContainer_Info{
  568. int16 disallowed_types;
  569. int16 allowed_types;
  570. int8 num_slots;
  571. };
  572. struct RecipeBook_Info{
  573. vector<string> recipes;
  574. int8 uses;
  575. };
  576. struct Thrown_Info{
  577. sint32 range;
  578. sint32 damage_modifier;
  579. float hit_bonus;
  580. int32 damage_type;
  581. };
  582. struct ItemEffect{
  583. EQ2_16BitString effect;
  584. int8 percentage;
  585. int8 subbulletflag;
  586. };
  587. #pragma pack()
  588. Item();
  589. Item(Item* in_item);
  590. ~Item();
  591. string lowername;
  592. string name;
  593. string description;
  594. int8 stack_count;
  595. int32 sell_price;
  596. int32 max_sell_value;
  597. bool save_needed;
  598. int8 weapon_type;
  599. string adornment;
  600. string creator;
  601. vector<ItemStat*> item_stats;
  602. vector<ItemStatString*> item_string_stats;
  603. vector<ItemLevelOverride*> item_level_overrides;
  604. vector<ItemEffect*> item_effects;
  605. Generic_Info generic_info;
  606. Weapon_Info* weapon_info;
  607. Ranged_Info* ranged_info;
  608. Armor_Info* armor_info;
  609. Bag_Info* bag_info;
  610. Food_Info* food_info;
  611. Bauble_Info* bauble_info;
  612. Book_Info* book_info;
  613. Skill_Info* skill_info;
  614. RecipeBook_Info* recipebook_info;
  615. Thrown_Info* thrown_info;
  616. vector<int8> slot_data;
  617. ItemCore details;
  618. int32 spell_id;
  619. int8 spell_tier;
  620. string item_script;
  621. void AddEffect(string effect, int8 percentage, int8 subbulletflag);
  622. int32 GetMaxSellValue();
  623. void SetMaxSellValue(int32 val);
  624. void SetItem(Item* old_item);
  625. int16 GetOverrideLevel(int8 adventure_class, int8 tradeskill_class);
  626. void AddLevelOverride(int8 adventure_class, int8 tradeskill_class, int16 level);
  627. void AddLevelOverride(ItemLevelOverride* class_);
  628. bool CheckClassLevel(int8 adventure_class, int8 tradeskill_class, int16 level);
  629. bool CheckClass(int8 adventure_class, int8 tradeskill_class);
  630. bool CheckLevel(int8 adventure_class, int8 tradeskill_class, int16 level);
  631. void SetAppearance(int16 type, int8 red, int8 green, int8 blue, int8 highlight_red, int8 highlight_green, int8 highlight_blue);
  632. void SetAppearance(ItemAppearance* appearance);
  633. void AddStat(ItemStat* in_stat);
  634. void AddStatString(ItemStatString* in_stat);
  635. void AddStat(int8 type, int16 subtype, float value, char* name = 0);
  636. void SetWeaponType(int8 type);
  637. int8 GetWeaponType();
  638. bool HasSlot(int8 slot, int8 slot2 = 255);
  639. bool IsNormal();
  640. bool IsWeapon();
  641. bool IsArmor();
  642. bool IsRanged();
  643. bool IsBag();
  644. bool IsFood();
  645. bool IsBauble();
  646. bool IsSkill();
  647. bool IsHouseItem();
  648. bool IsHouseContainer();
  649. bool IsShield();
  650. bool IsAdornment();
  651. bool IsAmmo();
  652. bool IsBook();
  653. bool IsChainArmor();
  654. bool IsClothArmor();
  655. bool IsCollectable();
  656. bool IsCloak();
  657. bool IsCrushWeapon();
  658. bool IsFoodFood();
  659. bool IsFoodDrink();
  660. bool IsJewelry();
  661. bool IsLeatherArmor();
  662. bool IsMisc();
  663. bool IsPierceWeapon();
  664. bool IsPlateArmor();
  665. bool IsPoison();
  666. bool IsPotion();
  667. bool IsRecipeBook();
  668. bool IsSalesDisplay();
  669. bool IsSlashWeapon();
  670. bool IsSpellScroll();
  671. bool IsTinkered();
  672. bool IsTradeskill();
  673. bool IsThrown();
  674. void SetItemScript(string name);
  675. const char* GetItemScript();
  676. int32 CalculateRepairCost();
  677. void SetItemType(int8 in_type);
  678. void serialize(PacketStruct* packet, bool show_name = false, Player* player = 0, int16 packet_type = 0, int8 subtype = 0, bool loot_item = false);
  679. 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);
  680. PacketStruct* PrepareItem(int16 version, bool merchant_item = false, bool loot_item = false);
  681. bool CheckFlag(int32 flag);
  682. void AddSlot(int8 slot_id);
  683. void SetSlots(int32 slots);
  684. bool needs_deletion;
  685. };
  686. class MasterItemList{
  687. public:
  688. ~MasterItemList();
  689. map<int32,Item*> items;
  690. Item* GetItem(int32 id);
  691. Item* GetItemByName(const char *name);
  692. ItemStatsValues* CalculateItemBonuses(int32 item_id);
  693. ItemStatsValues* CalculateItemBonuses(Item* desc, ItemStatsValues* values = 0);
  694. 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);
  695. vector<Item*>* GetItems(map<string, string> criteria);
  696. void AddItem(Item* item);
  697. bool IsBag(int32 item_id);
  698. void RemoveAll();
  699. static int32 NextUniqueID();
  700. static void ResetUniqueID(int32 new_id);
  701. static int32 next_unique_id;
  702. };
  703. class PlayerItemList {
  704. public:
  705. PlayerItemList();
  706. ~PlayerItemList();
  707. // int16 number;
  708. map<int32, Item*> indexed_items;
  709. map<sint32, map<int16, Item*> > items;
  710. // map< int8, Item* > inv_items;
  711. // map< int8, Item* > bank_items;
  712. bool SharedBankAddAllowed(Item* item);
  713. vector<Item*>* GetItemsFromBagID(sint32 bag_id);
  714. vector<Item*>* GetItemsInBag(Item* bag);
  715. Item* GetBag(int8 inventory_slot, bool lock = true);
  716. bool HasItem(int32 id, bool include_bank = false);
  717. Item* GetItemFromIndex(int32 index);
  718. void MoveItem(Item* item, sint32 inv_slot, int16 slot, bool erase_old = true);
  719. bool MoveItem(sint32 to_bag_id, int16 from_index, sint8 to, int8 charges);
  720. Item* GetItemFromUniqueID(int32 item_id, bool include_bank = false, bool lock = true);
  721. Item* GetItemFromID(int32 item_id, int8 count = 0, bool include_bank = false, bool lock = true);
  722. bool AssignItemToFreeSlot(Item* item);
  723. int16 GetNumberOfFreeSlots();
  724. int16 GetNumberOfItems();
  725. bool HasFreeSlot();
  726. bool HasFreeBagSlot();
  727. void DestroyItem(int16 index);
  728. Item* CanStack(Item* item, bool include_bank = false);
  729. void RemoveItem(Item* item, bool delete_item = false);
  730. void AddItem(Item* item);
  731. Item* GetItem(sint32 bag_slot, int16 slot);
  732. EQ2Packet* serialize(Player* player, int16 version);
  733. uchar* xor_packet;
  734. uchar* orig_packet;
  735. map<int32, Item*>* GetAllItems();
  736. bool HasFreeBankSlot();
  737. int8 FindFreeBankSlot();
  738. private:
  739. void Stack(Item* orig_item, Item* item);
  740. Mutex MPlayerItems;
  741. int16 packet_count;
  742. };
  743. class OverFlowItemList : public PlayerItemList {
  744. public:
  745. bool OverFlowSlotFull();
  746. int8 GetNextOverFlowSlot();
  747. bool AddItem(Item* item);
  748. Item* GetOverFlowItem();
  749. };
  750. class EquipmentItemList{
  751. public:
  752. EquipmentItemList();
  753. EquipmentItemList(const EquipmentItemList& list);
  754. ~EquipmentItemList();
  755. Item* items[NUM_SLOTS];
  756. vector<Item*>* GetAllEquippedItems();
  757. bool HasItem(int32 id);
  758. int8 GetNumberOfItems();
  759. Item* GetItemFromUniqueID(int32 item_id);
  760. Item* GetItemFromItemID(int32 item_id);
  761. void SetItem(int8 slot_id, Item* item);
  762. void RemoveItem(int8 slot, bool delete_item = false);
  763. Item* GetItem(int8 slot_id);
  764. bool AddItem(int8 slot, Item* item);
  765. bool CheckEquipSlot(Item* tmp, int8 slot);
  766. bool CanItemBeEquippedInSlot(Item* tmp, int8 slot);
  767. int8 GetFreeSlot(Item* tmp, int8 slot_id = 255);
  768. ItemStatsValues* CalculateEquipmentBonuses();
  769. EQ2Packet* serialize(int16 version);
  770. uchar* xor_packet;
  771. uchar* orig_packet;
  772. private:
  773. Mutex MEquipmentItems;
  774. };
  775. #endif