Items_DoV.h 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916
  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_ADORNING 100
  246. #define ITEM_STAT_AGGRESSION 101
  247. #define ITEM_STAT_ARTIFICING 102
  248. #define ITEM_STAT_ARTISTRY 103
  249. #define ITEM_STAT_CHEMISTRY 104
  250. #define ITEM_STAT_CRUSHING 105
  251. #define ITEM_STAT_DEFENSE 106
  252. #define ITEM_STAT_DEFLECTION 107
  253. #define ITEM_STAT_DISRUPTION 108
  254. #define ITEM_STAT_FISHING 109
  255. #define ITEM_STAT_FLETCHING 110
  256. #define ITEM_STAT_FOCUS 111
  257. #define ITEM_STAT_FORESTING 112
  258. #define ITEM_STAT_GATHERING 113
  259. #define ITEM_STAT_METAL_SHAPING 114
  260. #define ITEM_STAT_METALWORKING 115
  261. #define ITEM_STAT_MINING 116
  262. #define ITEM_STAT_MINISTRATION 117
  263. #define ITEM_STAT_ORDINATION 118
  264. #define ITEM_STAT_PARRY 119
  265. #define ITEM_STAT_PIERCING 120
  266. #define ITEM_STAT_RANGED 121
  267. #define ITEM_STAT_SAFE_FALL 122
  268. #define ITEM_STAT_SCRIBING 123
  269. #define ITEM_STAT_SCULPTING 124
  270. #define ITEM_STAT_SLASHING 125
  271. #define ITEM_STAT_SUBJUGATION 126
  272. #define ITEM_STAT_SWIMMING 127
  273. #define ITEM_STAT_TAILORING 128
  274. #define ITEM_STAT_TINKERING 129
  275. #define ITEM_STAT_TRANSMUTING 130
  276. #define ITEM_STAT_TRAPPING 131
  277. #define ITEM_STAT_WEAPON_SKILLS 132
  278. #define ITEM_STAT_VS_PHYSICAL 200
  279. #define ITEM_STAT_VS_HEAT 201 //elemental
  280. #define ITEM_STAT_VS_POISON 202 //noxious
  281. #define ITEM_STAT_VS_MAGIC 203 //arcane
  282. #define ITEM_STAT_VS_DROWNING 210
  283. #define ITEM_STAT_VS_FALLING 211
  284. #define ITEM_STAT_VS_PAIN 212
  285. #define ITEM_STAT_VS_MELEE 213
  286. #define ITEM_STAT_VS_SLASH 204
  287. #define ITEM_STAT_VS_CRUSH 205
  288. #define ITEM_STAT_VS_PIERCE 206
  289. //#define ITEM_STAT_VS_HEAT 203 //just so no build error
  290. #define ITEM_STAT_VS_COLD 207
  291. //#define ITEM_STAT_VS_MAGIC 205 //just so no build error
  292. #define ITEM_STAT_VS_MENTAL 208
  293. #define ITEM_STAT_VS_DIVINE 209
  294. #define ITEM_STAT_VS_DISEASE 214
  295. //#define ITEM_STAT_VS_POISON 209 //just so no build error
  296. //#define ITEM_STAT_VS_DROWNING 210 //just so no build error
  297. //#define ITEM_STAT_VS_FALLING 211 //just so no build error
  298. //#define ITEM_STAT_VS_PAIN 212 //just so no build error
  299. //#define ITEM_STAT_VS_MELEE 213 //just so no build error
  300. #define ITEM_STAT_DMG_SLASH 300
  301. #define ITEM_STAT_DMG_CRUSH 301
  302. #define ITEM_STAT_DMG_PIERCE 302
  303. #define ITEM_STAT_DMG_HEAT 303
  304. #define ITEM_STAT_DMG_COLD 304
  305. #define ITEM_STAT_DMG_MAGIC 305
  306. #define ITEM_STAT_DMG_MENTAL 306
  307. #define ITEM_STAT_DMG_DIVINE 307
  308. #define ITEM_STAT_DMG_DISEASE 308
  309. #define ITEM_STAT_DMG_POISON 309
  310. #define ITEM_STAT_DMG_DROWNING 310
  311. #define ITEM_STAT_DMG_FALLING 311
  312. #define ITEM_STAT_DMG_PAIN 312
  313. #define ITEM_STAT_DMG_MELEE 313
  314. #define ITEM_STAT_HEALTH 500
  315. #define ITEM_STAT_POWER 501
  316. #define ITEM_STAT_CONCENTRATION 502
  317. #define ITEM_STAT_HPREGEN 600
  318. #define ITEM_STAT_MANAREGEN 601
  319. #define ITEM_STAT_HPREGENPPT 602
  320. #define ITEM_STAT_MPREGENPPT 603
  321. #define ITEM_STAT_COMBATHPREGENPPT 604
  322. #define ITEM_STAT_COMBATMPREGENPPT 605
  323. #define ITEM_STAT_MAXHP 606
  324. #define ITEM_STAT_MAXHPPERC 607
  325. #define ITEM_STAT_SPEED 608
  326. #define ITEM_STAT_SLOW 609
  327. #define ITEM_STAT_MOUNTSPEED 610
  328. #define ITEM_STAT_MOUNTAIRSPEED 611
  329. #define ITEM_STAT_OFFENSIVESPEED 612
  330. #define ITEM_STAT_ATTACKSPEED 613
  331. #define ITEM_STAT_MAXMANA 614
  332. #define ITEM_STAT_MAXMANAPERC 615
  333. #define ITEM_STAT_MAXATTPERC 616
  334. #define ITEM_STAT_BLURVISION 617
  335. #define ITEM_STAT_MAGICLEVELIMMUNITY 618
  336. #define ITEM_STAT_HATEGAINMOD 619
  337. #define ITEM_STAT_COMBATEXPMOD 620
  338. #define ITEM_STAT_TRADESKILLEXPMOD 621
  339. #define ITEM_STAT_ACHIEVEMENTEXPMOD 622
  340. #define ITEM_STAT_SIZEMOD 623
  341. #define ITEM_STAT_DPS 624
  342. #define ITEM_STAT_STEALTH 625
  343. #define ITEM_STAT_INVIS 626
  344. #define ITEM_STAT_SEESTEALTH 627
  345. #define ITEM_STAT_SEEINVIS 628
  346. #define ITEM_STAT_EFFECTIVELEVELMOD 629
  347. #define ITEM_STAT_RIPOSTECHANCE 630
  348. #define ITEM_STAT_PARRYCHANCE 631
  349. #define ITEM_STAT_DODGECHANCE 632
  350. #define ITEM_STAT_AEAUTOATTACKCHANCE 633
  351. #define ITEM_STAT_MULTIATTACKCHANCE 634
  352. #define ITEM_STAT_SPELLMULTIATTACKCHANCE 635
  353. #define ITEM_STAT_FLURRY 636
  354. #define ITEM_STAT_MELEEDAMAGEMULTIPLIER 637
  355. #define ITEM_STAT_EXTRAHARVESTCHANCE 638
  356. #define ITEM_STAT_EXTRASHIELDBLOCKCHANCE 639
  357. #define ITEM_STAT_ITEMHPREGENPPT 640
  358. #define ITEM_STAT_ITEMPPREGENPPT 641
  359. #define ITEM_STAT_MELEECRITCHANCE 642
  360. #define ITEM_STAT_CRITAVOIDANCE 643
  361. #define ITEM_STAT_BENEFICIALCRITCHANCE 644
  362. #define ITEM_STAT_CRITBONUS 645
  363. #define ITEM_STAT_POTENCY 646
  364. #define ITEM_STAT_UNCONSCIOUSHPMOD 647
  365. #define ITEM_STAT_ABILITYREUSESPEED 648
  366. #define ITEM_STAT_ABILITYRECOVERYSPEED 649
  367. #define ITEM_STAT_ABILITYCASTINGSPEED 650
  368. #define ITEM_STAT_SPELLREUSESPEED 651
  369. #define ITEM_STAT_MELEEWEAPONRANGE 652
  370. #define ITEM_STAT_RANGEDWEAPONRANGE 653
  371. #define ITEM_STAT_FALLINGDAMAGEREDUCTION 654
  372. #define ITEM_STAT_RIPOSTEDAMAGE 655
  373. #define ITEM_STAT_MINIMUMDEFLECTIONCHANCE 656
  374. #define ITEM_STAT_MOVEMENTWEAVE 657
  375. #define ITEM_STAT_COMBATHPREGEN 658
  376. #define ITEM_STAT_COMBATMANAREGEN 659
  377. #define ITEM_STAT_CONTESTSPEEDBOOST 660
  378. #define ITEM_STAT_TRACKINGAVOIDANCE 661
  379. #define ITEM_STAT_STEALTHINVISSPEEDMOD 662
  380. #define ITEM_STAT_LOOT_COIN 663
  381. #define ITEM_STAT_ARMORMITIGATIONINCREASE 664
  382. #define ITEM_STAT_AMMOCONSERVATION 665
  383. #define ITEM_STAT_STRIKETHROUGH 666
  384. #define ITEM_STAT_STATUSBONUS 667
  385. #define ITEM_STAT_ACCURACY 668
  386. #define ITEM_STAT_COUNTERSTRIKE 669
  387. #define ITEM_STAT_SHIELDBASH 670
  388. #define ITEM_STAT_WEAPONDAMAGEBONUS 671
  389. #define ITEM_STAT_ADDITIONALRIPOSTECHANCE 672
  390. #define ITEM_STAT_CRITICALMITIGATION 673
  391. #define ITEM_STAT_PVPTOUGHNESS 674
  392. #define ITEM_STAT_STAMINABONUS 675
  393. #define ITEM_STAT_WISDOMITBONUS 676
  394. #define ITEM_STAT_HEALRECEIVE 677
  395. #define ITEM_STAT_HEALRECEIVEPERC 678
  396. #define ITEM_STAT_PVPCRITICALMITIGATION 679
  397. #define ITEM_STAT_BASEAVOIDANCEBONUS 680
  398. //#define ITEM_STAT_HPREGEN 600
  399. //#define ITEM_STAT_MANAREGEN 601
  400. //#define ITEM_STAT_HPREGENPPT 602
  401. //#define ITEM_STAT_MPREGENPPT 603
  402. //#define ITEM_STAT_COMBATHPREGENPPT 604
  403. //#define ITEM_STAT_COMBATMPREGENPPT 605
  404. //#define ITEM_STAT_MAXHP 606
  405. //#define ITEM_STAT_MAXHPPERC 607
  406. //#define ITEM_STAT_SPEED 608
  407. //#define ITEM_STAT_SLOW 609
  408. //#define ITEM_STAT_MOUNTSPEED 610
  409. //#define ITEM_STAT_OFFENSIVESPEED 611
  410. //#define ITEM_STAT_ATTACKSPEED 612
  411. //#define ITEM_STAT_MAXMANA 613
  412. //#define ITEM_STAT_MAXMANAPERC 614
  413. //#define ITEM_STAT_MAXATTPERC 615
  414. //#define ITEM_STAT_BLURVISION 616
  415. //#define ITEM_STAT_MAGICLEVELIMMUNITY 617
  416. //#define ITEM_STAT_HATEGAINMOD 618
  417. //#define ITEM_STAT_COMBATEXPMOD 619
  418. //#define ITEM_STAT_TRADESKILLEXPMOD 620
  419. //#define ITEM_STAT_ACHIEVEMENTEXPMOD 621
  420. //#define ITEM_STAT_SIZEMOD 622
  421. //#define ITEM_STAT_UNKNOWN 623
  422. //#define ITEM_STAT_STEALTH 624
  423. //#define ITEM_STAT_INVIS 625
  424. //#define ITEM_STAT_SEESTEALTH 626
  425. //#define ITEM_STAT_SEEINVIS 627
  426. //#define ITEM_STAT_EFFECTIVELEVELMOD 628
  427. //#define ITEM_STAT_RIPOSTECHANCE 629
  428. //#define ITEM_STAT_PARRYCHANCE 630
  429. //#define ITEM_STAT_DODGECHANCE 631
  430. //#define ITEM_STAT_AEAUTOATTACKCHANCE 632
  431. //#define ITEM_STAT_DOUBLEATTACKCHANCE 633
  432. //#define ITEM_STAT_RANGEDDOUBLEATTACKCHANCE 634
  433. //#define ITEM_STAT_SPELLDOUBLEATTACKCHANCE 635
  434. //#define ITEM_STAT_FLURRY 636
  435. //#define ITEM_STAT_EXTRAHARVESTCHANCE 637
  436. //#define ITEM_STAT_EXTRASHIELDBLOCKCHANCE 638
  437. #define ITEM_STAT_DEFLECTIONCHANCE 400 //just so no build error
  438. //#define ITEM_STAT_ITEMHPREGENPPT 640
  439. //#define ITEM_STAT_ITEMPPREGENPPT 641
  440. //#define ITEM_STAT_MELEECRITCHANCE 642
  441. //#define ITEM_STAT_RANGEDCRITCHANCE 643
  442. //#define ITEM_STAT_DMGSPELLCRITCHANCE 644
  443. //#define ITEM_STAT_HEALSPELLCRITCHANCE 645
  444. //#define ITEM_STAT_MELEECRITBONUS 646
  445. //#define ITEM_STAT_RANGEDCRITBONUS 647
  446. //#define ITEM_STAT_DMGSPELLCRITBONUS 648
  447. //#define ITEM_STAT_HEALSPELLCRITBONUS 649
  448. //#define ITEM_STAT_UNCONSCIOUSHPMOD 650
  449. //#define ITEM_STAT_SPELLTIMEREUSEPCT 651
  450. //#define ITEM_STAT_SPELLTIMERECOVERYPCT 652
  451. //#define ITEM_STAT_SPELLTIMECASTPCT 653
  452. //#define ITEM_STAT_MELEEWEAPONRANGE 654
  453. //#define ITEM_STAT_RANGEDWEAPONRANGE 655
  454. //#define ITEM_STAT_FALLINGDAMAGEREDUCTION 656
  455. //#define ITEM_STAT_SHIELDEFFECTIVENESS 657
  456. //#define ITEM_STAT_RIPOSTEDAMAGE 658
  457. //#define ITEM_STAT_MINIMUMDEFLECTIONCHANCE 659
  458. //#define ITEM_STAT_MOVEMENTWEAVE 660
  459. //#define ITEM_STAT_COMBATHPREGEN 661
  460. //#define ITEM_STAT_COMBATMANAREGEN 662
  461. //#define ITEM_STAT_CONTESTSPEEDBOOST 663
  462. //#define ITEM_STAT_TRACKINGAVOIDANCE 664
  463. //#define ITEM_STAT_STEALTHINVISSPEEDMOD 665
  464. //#define ITEM_STAT_LOOT_COIN 666
  465. //#define ITEM_STAT_ARMORMITIGATIONINCREASE 667
  466. //#define ITEM_STAT_AMMOCONSERVATION 668
  467. //#define ITEM_STAT_STRIKETHROUGH 669
  468. //#define ITEM_STAT_STATUSBONUS 670
  469. //#define ITEM_STAT_ACCURACY 671
  470. //#define ITEM_STAT_COUNTERSTRIKE 672
  471. //#define ITEM_STAT_SHIELDBASH 673
  472. //#define ITEM_STAT_WEAPONDAMAGEBONUS 674
  473. //#define ITEM_STAT_ADDITIONALRIPOSTECHANCE 675
  474. //#define ITEM_STAT_CRITICALMITIGATION 676
  475. //#define ITEM_STAT_COMBATARTDAMAGE 677
  476. //#define ITEM_STAT_SPELLDAMAGE 678
  477. //#define ITEM_STAT_HEALAMOUNT 679
  478. //#define ITEM_STAT_TAUNTAMOUNT 680
  479. #define ITEM_STAT_SPELL_DAMAGE 700
  480. #define ITEM_STAT_HEAL_AMOUNT 701
  481. #define ITEM_STAT_SPELL_AND_HEAL 702
  482. #define ITEM_STAT_COMBAT_ART_DAMAGE 703
  483. #define ITEM_STAT_SPELL_AND_COMBAT_ART_DAMAGE 704
  484. #define ITEM_STAT_TAUNT_AMOUNT 705
  485. #define ITEM_STAT_TAUNT_AND_COMBAT_ART_DAMAGE 706
  486. #define ITEM_STAT_ABILITY_MODIFIER 707
  487. #pragma pack(1)
  488. struct ItemStatsValues{
  489. sint16 str;
  490. sint16 sta;
  491. sint16 agi;
  492. sint16 wis;
  493. sint16 int_;
  494. sint16 vs_slash;
  495. sint16 vs_crush;
  496. sint16 vs_pierce;
  497. sint16 vs_heat;
  498. sint16 vs_cold;
  499. sint16 vs_magic;
  500. sint16 vs_mental;
  501. sint16 vs_divine;
  502. sint16 vs_disease;
  503. sint16 vs_poison;
  504. sint16 health;
  505. sint16 power;
  506. sint8 concentration;
  507. sint16 ability_modifier;
  508. sint16 criticalmitigation;
  509. sint16 extrashieldblockchance;
  510. sint16 beneficialcritchance;
  511. sint16 critbonus;
  512. sint16 potency;
  513. sint16 hategainmod;
  514. sint16 abilityreusespeed;
  515. sint16 abilitycastingspeed;
  516. sint16 abilityrecoveryspeed;
  517. sint16 spellreusespeed;
  518. sint16 spellmultiattackchance;
  519. sint16 dps;
  520. sint16 attackspeed;
  521. sint16 multiattackchance;
  522. sint16 aeautoattackchance;
  523. sint16 strikethrough;
  524. sint16 accuracy;
  525. sint16 offensivespeed;
  526. };
  527. struct ItemCore{
  528. int32 item_id;
  529. sint32 soe_id;
  530. int32 bag_id;
  531. sint32 inv_slot_id;
  532. sint16 slot_id;
  533. int8 index;
  534. int16 icon;
  535. int16 count;
  536. int8 tier;
  537. int8 num_slots;
  538. int32 unique_id;
  539. int8 num_free_slots;
  540. int16 recommended_level;
  541. bool item_locked;
  542. };
  543. #pragma pack()
  544. struct ItemStat{
  545. string stat_name;
  546. int8 stat_type;
  547. sint16 stat_subtype;
  548. int16 stat_type_combined;
  549. float value;
  550. };
  551. struct ItemLevelOverride{
  552. int8 adventure_class;
  553. int8 tradeskill_class;
  554. int16 level;
  555. };
  556. struct ItemClass{
  557. int8 adventure_class;
  558. int8 tradeskill_class;
  559. int16 level;
  560. };
  561. struct ItemAppearance{
  562. int16 type;
  563. int8 red;
  564. int8 green;
  565. int8 blue;
  566. int8 highlight_red;
  567. int8 highlight_green;
  568. int8 highlight_blue;
  569. };
  570. class PlayerItemList;
  571. class Item{
  572. public:
  573. #pragma pack(1)
  574. struct ItemStatString{
  575. EQ2_8BitString stat_string;
  576. };
  577. struct Generic_Info{
  578. int8 show_name;
  579. int8 creator_flag;
  580. int16 item_flags;
  581. int8 condition;
  582. int32 weight; // num/10
  583. int32 skill_req1;
  584. int32 skill_req2;
  585. int16 skill_min;
  586. 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
  587. int16 appearance_id;
  588. int8 appearance_red;
  589. int8 appearance_green;
  590. int8 appearance_blue;
  591. int8 appearance_highlight_red;
  592. int8 appearance_highlight_green;
  593. int8 appearance_highlight_blue;
  594. int8 collectable;
  595. int32 offers_quest_id;
  596. int32 part_of_quest_id;
  597. int16 max_charges;
  598. int8 display_charges;
  599. int64 adventure_classes;
  600. int64 tradeskill_classes;
  601. int16 adventure_default_level;
  602. int16 tradeskill_default_level;
  603. int8 usable;
  604. };
  605. struct Armor_Info {
  606. int16 mitigation_low;
  607. int16 mitigation_high;
  608. };
  609. struct Weapon_Info {
  610. int16 wield_type;
  611. int16 damage_low1;
  612. int16 damage_high1;
  613. int16 damage_low2;
  614. int16 damage_high2;
  615. int16 damage_low3;
  616. int16 damage_high3;
  617. int16 delay;
  618. float rating;
  619. };
  620. struct Shield_Info {
  621. Armor_Info armor_info;
  622. };
  623. struct Ranged_Info {
  624. Weapon_Info weapon_info;
  625. int16 range_low;
  626. int16 range_high;
  627. };
  628. struct Bag_Info {
  629. int8 num_slots;
  630. int16 weight_reduction;
  631. };
  632. struct Food_Info{
  633. int8 type; //0=water, 1=food
  634. int8 level;
  635. float duration;
  636. int8 satiation;
  637. };
  638. struct Bauble_Info{
  639. int16 cast;
  640. int16 recovery;
  641. int32 duration;
  642. float recast;
  643. int8 display_slot_optional;
  644. int8 display_cast_time;
  645. int8 display_bauble_type;
  646. float effect_radius;
  647. int32 max_aoe_targets;
  648. int8 display_until_cancelled;
  649. };
  650. struct Book_Info{
  651. int8 language;
  652. EQ2_16BitString author;
  653. EQ2_16BitString title;
  654. };
  655. struct Skill_Info{
  656. int32 spell_id;
  657. int32 spell_tier;
  658. };
  659. struct House_Info{
  660. int32 status_rent_reduction;
  661. };
  662. struct HouseContainer_Info{
  663. int16 disallowed_types;
  664. int16 allowed_types;
  665. int8 num_slots;
  666. };
  667. struct RecipeBook_Info{
  668. vector<string> recipes;
  669. int8 uses;
  670. };
  671. struct Thrown_Info{
  672. sint32 range;
  673. sint32 damage_modifier;
  674. float hit_bonus;
  675. int32 damage_type;
  676. };
  677. struct ItemEffect{
  678. EQ2_16BitString effect;
  679. int8 percentage;
  680. int8 subbulletflag;
  681. };
  682. #pragma pack()
  683. Item();
  684. Item(Item* in_item);
  685. ~Item();
  686. string lowername;
  687. string name;
  688. string description;
  689. int8 stack_count;
  690. int32 sell_price;
  691. int32 max_sell_value;
  692. bool save_needed;
  693. int8 weapon_type;
  694. string adornment;
  695. string creator;
  696. vector<ItemStat*> item_stats;
  697. vector<ItemStatString*> item_string_stats;
  698. vector<ItemLevelOverride*> item_level_overrides;
  699. vector<ItemEffect*> item_effects;
  700. Generic_Info generic_info;
  701. Weapon_Info* weapon_info;
  702. Ranged_Info* ranged_info;
  703. Armor_Info* armor_info;
  704. Bag_Info* bag_info;
  705. Food_Info* food_info;
  706. Bauble_Info* bauble_info;
  707. Book_Info* book_info;
  708. Skill_Info* skill_info;
  709. RecipeBook_Info* recipebook_info;
  710. Thrown_Info* thrown_info;
  711. vector<int8> slot_data;
  712. ItemCore details;
  713. int32 spell_id;
  714. int8 spell_tier;
  715. string item_script;
  716. void AddEffect(string effect, int8 percentage, int8 subbulletflag);
  717. int32 GetMaxSellValue();
  718. void SetMaxSellValue(int32 val);
  719. void SetItem(Item* old_item);
  720. int16 GetOverrideLevel(int8 adventure_class, int8 tradeskill_class);
  721. void AddLevelOverride(int8 adventure_class, int8 tradeskill_class, int16 level);
  722. void AddLevelOverride(ItemLevelOverride* class_);
  723. bool CheckClassLevel(int8 adventure_class, int8 tradeskill_class, int16 level);
  724. bool CheckClass(int8 adventure_class, int8 tradeskill_class);
  725. bool CheckLevel(int8 adventure_class, int8 tradeskill_class, int16 level);
  726. void SetAppearance(int16 type, int8 red, int8 green, int8 blue, int8 highlight_red, int8 highlight_green, int8 highlight_blue);
  727. void SetAppearance(ItemAppearance* appearance);
  728. void AddStat(ItemStat* in_stat);
  729. void AddStatString(ItemStatString* in_stat);
  730. void AddStat(int8 type, int16 subtype, float value, char* name = 0);
  731. void SetWeaponType(int8 type);
  732. int8 GetWeaponType();
  733. bool HasSlot(int8 slot, int8 slot2 = 255);
  734. bool IsNormal();
  735. bool IsWeapon();
  736. bool IsArmor();
  737. bool IsRanged();
  738. bool IsBag();
  739. bool IsFood();
  740. bool IsBauble();
  741. bool IsSkill();
  742. bool IsHouseItem();
  743. bool IsHouseContainer();
  744. bool IsShield();
  745. bool IsAdornment();
  746. bool IsAmmo();
  747. bool IsBook();
  748. bool IsChainArmor();
  749. bool IsClothArmor();
  750. bool IsCollectable();
  751. bool IsCloak();
  752. bool IsCrushWeapon();
  753. bool IsFoodFood();
  754. bool IsFoodDrink();
  755. bool IsJewelry();
  756. bool IsLeatherArmor();
  757. bool IsMisc();
  758. bool IsPierceWeapon();
  759. bool IsPlateArmor();
  760. bool IsPoison();
  761. bool IsPotion();
  762. bool IsRecipeBook();
  763. bool IsSalesDisplay();
  764. bool IsSlashWeapon();
  765. bool IsSpellScroll();
  766. bool IsTinkered();
  767. bool IsTradeskill();
  768. bool IsThrown();
  769. void SetItemScript(string name);
  770. const char* GetItemScript();
  771. int32 CalculateRepairCost();
  772. void SetItemType(int8 in_type);
  773. void serialize(PacketStruct* packet, bool show_name = false, Player* player = 0, int16 packet_type = 0, int8 subtype = 0, bool loot_item = false);
  774. 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);
  775. PacketStruct* PrepareItem(int16 version, bool merchant_item = false, bool loot_item = false);
  776. bool CheckFlag(int32 flag);
  777. void AddSlot(int8 slot_id);
  778. void SetSlots(int32 slots);
  779. bool needs_deletion;
  780. };
  781. class MasterItemList{
  782. public:
  783. ~MasterItemList();
  784. map<int32,Item*> items;
  785. Item* GetItem(int32 id);
  786. Item* GetItemByName(const char *name);
  787. ItemStatsValues* CalculateItemBonuses(int32 item_id, Entity* entity = 0);
  788. ItemStatsValues* CalculateItemBonuses(Item* desc, Entity* entity = 0, ItemStatsValues* values = 0);
  789. 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);
  790. vector<Item*>* GetItems(map<string, string> criteria);
  791. void AddItem(Item* item);
  792. bool IsBag(int32 item_id);
  793. void RemoveAll();
  794. static int32 NextUniqueID();
  795. static void ResetUniqueID(int32 new_id);
  796. static int32 next_unique_id;
  797. };
  798. class PlayerItemList {
  799. public:
  800. PlayerItemList();
  801. ~PlayerItemList();
  802. // int16 number;
  803. map<int32, Item*> indexed_items;
  804. map<sint32, map<int16, Item*> > items;
  805. // map< int8, Item* > inv_items;
  806. // map< int8, Item* > bank_items;
  807. bool SharedBankAddAllowed(Item* item);
  808. vector<Item*>* GetItemsFromBagID(sint32 bag_id);
  809. vector<Item*>* GetItemsInBag(Item* bag);
  810. Item* GetBag(int8 inventory_slot, bool lock = true);
  811. bool HasItem(int32 id, bool include_bank = false);
  812. Item* GetItemFromIndex(int32 index);
  813. void MoveItem(Item* item, sint32 inv_slot, int16 slot, bool erase_old = true);
  814. bool MoveItem(sint32 to_bag_id, int16 from_index, sint8 to, int8 charges);
  815. Item* GetItemFromUniqueID(int32 item_id, bool include_bank = false, bool lock = true);
  816. Item* GetItemFromID(int32 item_id, int8 count = 0, bool include_bank = false, bool lock = true);
  817. bool AssignItemToFreeSlot(Item* item);
  818. int16 GetNumberOfFreeSlots();
  819. int16 GetNumberOfItems();
  820. bool HasFreeSlot();
  821. bool HasFreeBagSlot();
  822. void DestroyItem(int16 index);
  823. Item* CanStack(Item* item, bool include_bank = false);
  824. void RemoveItem(Item* item, bool delete_item = false);
  825. void AddItem(Item* item);
  826. Item* GetItem(sint32 bag_slot, int16 slot);
  827. EQ2Packet* serialize(Player* player, int16 version);
  828. uchar* xor_packet;
  829. uchar* orig_packet;
  830. map<int32, Item*>* GetAllItems();
  831. bool HasFreeBankSlot();
  832. int8 FindFreeBankSlot();
  833. ///<summary>Get the first free slot and stor them in the provided variables</summary>
  834. ///<param name='bag_id'>Will contain the bag id of the first free spot</param>
  835. ///<param name='slot'>Will contain the slot id of the first free slot</param>
  836. ///<returns>True if a free slot was found</returns>
  837. bool GetFirstFreeSlot(sint32* bag_id, sint16* slot);
  838. private:
  839. void Stack(Item* orig_item, Item* item);
  840. Mutex MPlayerItems;
  841. int16 packet_count;
  842. };
  843. class OverFlowItemList : public PlayerItemList {
  844. public:
  845. bool OverFlowSlotFull();
  846. int8 GetNextOverFlowSlot();
  847. bool AddItem(Item* item);
  848. Item* GetOverFlowItem();
  849. };
  850. class EquipmentItemList{
  851. public:
  852. EquipmentItemList();
  853. EquipmentItemList(const EquipmentItemList& list);
  854. ~EquipmentItemList();
  855. Item* items[NUM_SLOTS];
  856. vector<Item*>* GetAllEquippedItems();
  857. bool HasItem(int32 id);
  858. int8 GetNumberOfItems();
  859. Item* GetItemFromUniqueID(int32 item_id);
  860. Item* GetItemFromItemID(int32 item_id);
  861. void SetItem(int8 slot_id, Item* item);
  862. void RemoveItem(int8 slot, bool delete_item = false);
  863. Item* GetItem(int8 slot_id);
  864. bool AddItem(int8 slot, Item* item);
  865. bool CheckEquipSlot(Item* tmp, int8 slot);
  866. bool CanItemBeEquippedInSlot(Item* tmp, int8 slot);
  867. int8 GetFreeSlot(Item* tmp, int8 slot_id = 255);
  868. ItemStatsValues* CalculateEquipmentBonuses(Entity* entity = 0);
  869. EQ2Packet* serialize(int16 version);
  870. uchar* xor_packet;
  871. uchar* orig_packet;
  872. private:
  873. Mutex MEquipmentItems;
  874. };
  875. #endif