Items_CoE.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782
  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_VS_PHYSICAL 200
  233. #define ITEM_STAT_VS_ELEMENTAL 201
  234. #define ITEM_STAT_VS_NOXIOUS 202
  235. #define ITEM_STAT_VS_ARCANE 203
  236. //#define ITEM_STAT_VS_SLASH 200
  237. //#define ITEM_STAT_VS_CRUSH 201
  238. //#define ITEM_STAT_VS_PIERCE 202
  239. //#define ITEM_STAT_VS_HEAT 203
  240. //#define ITEM_STAT_VS_COLD 204
  241. //#define ITEM_STAT_VS_MAGIC 205
  242. //#define ITEM_STAT_VS_MENTAL 206
  243. //#define ITEM_STAT_VS_DIVINE 207
  244. //#define ITEM_STAT_VS_DISEASE 208
  245. //#define ITEM_STAT_VS_POISON 209
  246. //#define ITEM_STAT_VS_DROWNING 210
  247. //#define ITEM_STAT_VS_FALLING 211
  248. //#define ITEM_STAT_VS_PAIN 212
  249. //#define ITEM_STAT_VS_MELEE 213
  250. #define ITEM_STAT_DMG_SLASH 300
  251. #define ITEM_STAT_DMG_CRUSH 301
  252. #define ITEM_STAT_DMG_PIERCE 302
  253. #define ITEM_STAT_DMG_HEAT 303
  254. #define ITEM_STAT_DMG_COLD 304
  255. #define ITEM_STAT_DMG_MAGIC 305
  256. #define ITEM_STAT_DMG_MENTAL 306
  257. #define ITEM_STAT_DMG_DIVINE 307
  258. #define ITEM_STAT_DMG_DISEASE 308
  259. #define ITEM_STAT_DMG_POISON 309
  260. #define ITEM_STAT_DMG_DROWNING 310
  261. #define ITEM_STAT_DMG_FALLING 311
  262. #define ITEM_STAT_DMG_PAIN 312
  263. #define ITEM_STAT_DMG_MELEE 313
  264. #define ITEM_STAT_HEALTH 500
  265. #define ITEM_STAT_POWER 501
  266. #define ITEM_STAT_CONCENTRATION 502
  267. #define ITEM_STAT_SAVAGERY 503
  268. #define ITEM_STAT_HPREGEN 600
  269. #define ITEM_STAT_MANAREGEN 601
  270. #define ITEM_STAT_HPREGENPPT 602
  271. #define ITEM_STAT_MPREGENPPT 603
  272. #define ITEM_STAT_COMBATHPREGENPPT 604
  273. #define ITEM_STAT_COMBATMPREGENPPT 605
  274. #define ITEM_STAT_MAXHP 606
  275. #define ITEM_STAT_MAXHPPERC 607
  276. #define ITEM_STAT_MAXHPPERCFINAL 608
  277. #define ITEM_STAT_SPEED 609
  278. #define ITEM_STAT_SLOW 610
  279. #define ITEM_STAT_MOUNTSPEED 611
  280. #define ITEM_STAT_MOUNTAIRSPEED 612
  281. #define ITEM_STAT_LEAPSPEED 613
  282. #define ITEM_STAT_LEAPTIME 614
  283. #define ITEM_STAT_GLIDEEFFICIENCY 615
  284. #define ITEM_STAT_OFFENSIVESPEED 616
  285. #define ITEM_STAT_ATTACKSPEED 617
  286. #define ITEM_STAT_SPELLWEAPONATTACKSPEED 618
  287. #define ITEM_STAT_MAXMANA 619
  288. #define ITEM_STAT_MAXMANAPERC 620
  289. #define ITEM_STAT_MAXATTPERC 621
  290. #define ITEM_STAT_BLURVISION 622
  291. #define ITEM_STAT_MAGICLEVELIMMUNITY 623
  292. #define ITEM_STAT_HATEGAINMOD 624
  293. #define ITEM_STAT_COMBATEXPMOD 625
  294. #define ITEM_STAT_TRADESKILLEXPMOD 626
  295. #define ITEM_STAT_ACHIEVEMENTEXPMOD 627
  296. #define ITEM_STAT_SIZEMOD 628
  297. #define ITEM_STAT_DPS 629
  298. #define ITEM_STAT_SPELLWEAPONDPS 630
  299. #define ITEM_STAT_STEALTH 631
  300. #define ITEM_STAT_INVIS 632
  301. #define ITEM_STAT_SEESTEALTH 633
  302. #define ITEM_STAT_SEEINVIS 634
  303. #define ITEM_STAT_EFFECTIVELEVELMOD 635
  304. #define ITEM_STAT_RIPOSTECHANCE 636
  305. #define ITEM_STAT_PARRYCHANCE 637
  306. #define ITEM_STAT_DODGECHANCE 638
  307. #define ITEM_STAT_AEAUTOATTACKCHANCE 639
  308. #define ITEM_STAT_SPELLWEAPONAEAUTOATTACKCHANCE 640
  309. #define ITEM_STAT_DOUBLEATTACKCHANCE 641
  310. #define ITEM_STAT_PVPDOUBLEATTACKCHANCE 642
  311. #define ITEM_STAT_SPELLWEAPONAEAUTOATTACKCHANCE 643
  312. #define ITEM_STAT_PVPSPELLWEAPONDOUBLEATTACKCHANCE 644
  313. #define ITEM_STAT_SPELLDOUBLEATTACKCHANCE 645
  314. #define ITEM_STAT_PVPSPELLDOUBLEATTACKCHANCE 646
  315. #define ITEM_STAT_FLURRY 647
  316. #define ITEM_STAT_SPELLWEAPONFLURRY 648
  317. #define ITEM_STAT_MELEEDAMAGEMULTIPLIER 649
  318. #define ITEM_STAT_EXTRAHARVESTCHANCE 650
  319. #define ITEM_STAT_EXTRASHIELDBLOCKCHANCE 651
  320. #define ITEM_STAT_ITEMHPREGENPPT 652
  321. #define ITEM_STAT_ITEMPPREGENPPT 653
  322. #define ITEM_STAT_MELEECRITCHANCE 654
  323. #define ITEM_STAT_CRITAVOIDANCE 655
  324. #define ITEM_STAT_BENEFICIALCRITCHANCE 656
  325. #define ITEM_STAT_CRITBONUS 657
  326. #define ITEM_STAT_PVPCRITBONUS 658
  327. #define ITEM_STAT_BASEMODIFIER 659
  328. #define ITEM_STAT_PVPBASEMODIFIER 660
  329. #define ITEM_STAT_UNCONSCIOUSHPMOD 661
  330. #define ITEM_STAT_SPELLTIMEREUSEPCT 662
  331. #define ITEM_STAT_SPELLTIMERECOVERYPCT 663
  332. #define ITEM_STAT_SPELLTIMECASTPCT 664
  333. #define ITEM_STAT_SPELLTIMEREUSESPELLONLY 665
  334. #define ITEM_STAT_MELEEWEAPONRANGE 666
  335. #define ITEM_STAT_RANGEDWEAPONRANGE 667
  336. #define ITEM_STAT_FALLINGDAMAGEREDUCTION 668
  337. #define ITEM_STAT_RIPOSTEDAMAGE 669
  338. #define ITEM_STAT_MINIMUMDEFLECTIONCHANCE 670
  339. #define ITEM_STAT_MOVEMENTWEAVE 671
  340. #define ITEM_STAT_COMBATHPREGEN 672
  341. #define ITEM_STAT_COMBATMANAREGEN 673
  342. #define ITEM_STAT_CONTESTSPEEDBOOST 674
  343. #define ITEM_STAT_TRACKINGAVOIDANCE 675
  344. #define ITEM_STAT_STEALTHINVISSPEEDMOD 676
  345. #define ITEM_STAT_LOOT_COIN 677
  346. #define ITEM_STAT_ARMORMITIGATIONINCREASE 678
  347. #define ITEM_STAT_AMMOCONSERVATION 679
  348. #define ITEM_STAT_STRIKETHROUGH 680
  349. #define ITEM_STAT_STATUSBONUS 681
  350. #define ITEM_STAT_ACCURACY 682
  351. #define ITEM_STAT_COUNTERSTRIKE 683
  352. #define ITEM_STAT_SHIELDBASH 684
  353. #define ITEM_STAT_WEAPONDAMAGEBONUS 685
  354. #define ITEM_STAT_WEAPONDAMAGEBONUSMELEEONLY 686
  355. #define ITEM_STAT_ADDITIONALRIPOSTECHANCE 687
  356. #define ITEM_STAT_CRITICALMITIGATION 688
  357. #define ITEM_STAT_PVPTOUGHNESS 689
  358. #define ITEM_STAT_PVPLETHALITY 690
  359. #define ITEM_STAT_STAMINABONUS 691
  360. #define ITEM_STAT_WISDOMMITBONUS 692
  361. #define ITEM_STAT_HEALRECEIVE 693
  362. #define ITEM_STAT_HEALRECEIVEPERC 694
  363. #define ITEM_STAT_PVPCRITICALMITIGATION 695
  364. #define ITEM_STAT_BASEAVOIDANCEBONUS 696
  365. #define ITEM_STAT_INCOMBATSAVAGERYREGEN 697
  366. #define ITEM_STAT_OUTOFCOMBATSAVAGERYREGEN 698
  367. #define ITEM_STAT_SAVAGERYREGEN 699
  368. #define ITEM_STAT_SAVAGERYGAINMOD 6100
  369. #define ITEM_STAT_MAXSAVAGERYLEVEL 6101
  370. #define ITEM_STAT_SPELL_DAMAGE 700
  371. #define ITEM_STAT_HEAL_AMOUNT 701
  372. #define ITEM_STAT_SPELL_AND_HEAL 702
  373. #define ITEM_STAT_COMBAT_ART_DAMAGE 703
  374. #define ITEM_STAT_SPELL_AND_COMBAT_ART_DAMAGE 704
  375. #define ITEM_STAT_TAUNT_AMOUNT 705
  376. #define ITEM_STAT_TAUNT_AND_COMBAT_ART_DAMAGE 706
  377. #define ITEM_STAT_ABILITY_MODIFIER 707
  378. #pragma pack(1)
  379. struct ItemStatsValues{
  380. sint16 str;
  381. sint16 sta;
  382. sint16 agi;
  383. sint16 wis;
  384. sint16 int_;
  385. sint16 vs_slash;
  386. sint16 vs_crush;
  387. sint16 vs_pierce;
  388. sint16 vs_heat;
  389. sint16 vs_cold;
  390. sint16 vs_magic;
  391. sint16 vs_mental;
  392. sint16 vs_divine;
  393. sint16 vs_disease;
  394. sint16 vs_poison;
  395. sint16 health;
  396. sint16 power;
  397. sint8 concentration;
  398. };
  399. struct ItemCore{
  400. int32 item_id;
  401. sint32 soe_id;
  402. int32 bag_id;
  403. sint32 inv_slot_id;
  404. sint16 slot_id;
  405. int8 index;
  406. int16 icon;
  407. int16 count;
  408. int8 tier;
  409. int8 num_slots;
  410. int32 unique_id;
  411. int8 num_free_slots;
  412. int16 recommended_level;
  413. };
  414. #pragma pack()
  415. struct ItemStat{
  416. string stat_name;
  417. int8 stat_type;
  418. sint16 stat_subtype;
  419. int16 stat_type_combined;
  420. float value;
  421. };
  422. struct ItemLevelOverride{
  423. int8 adventure_class;
  424. int8 tradeskill_class;
  425. int16 level;
  426. };
  427. struct ItemClass{
  428. int8 adventure_class;
  429. int8 tradeskill_class;
  430. int16 level;
  431. };
  432. struct ItemAppearance{
  433. int16 type;
  434. int8 red;
  435. int8 green;
  436. int8 blue;
  437. int8 highlight_red;
  438. int8 highlight_green;
  439. int8 highlight_blue;
  440. };
  441. class PlayerItemList;
  442. class Item{
  443. public:
  444. #pragma pack(1)
  445. struct ItemStatString{
  446. EQ2_8BitString stat_string;
  447. };
  448. struct Generic_Info{
  449. int8 show_name;
  450. int8 creator_flag;
  451. int16 item_flags;
  452. int8 condition;
  453. int32 weight; // num/10
  454. int32 skill_req1;
  455. int32 skill_req2;
  456. int16 skill_min;
  457. 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
  458. int16 appearance_id;
  459. int8 appearance_red;
  460. int8 appearance_green;
  461. int8 appearance_blue;
  462. int8 appearance_highlight_red;
  463. int8 appearance_highlight_green;
  464. int8 appearance_highlight_blue;
  465. int8 collectable;
  466. int32 offers_quest_id;
  467. int32 part_of_quest_id;
  468. int16 max_charges;
  469. int8 display_charges;
  470. int64 adventure_classes;
  471. int64 tradeskill_classes;
  472. int16 adventure_default_level;
  473. int16 tradeskill_default_level;
  474. int8 usable;
  475. };
  476. struct Armor_Info {
  477. int16 mitigation_low;
  478. int16 mitigation_high;
  479. };
  480. struct Weapon_Info {
  481. int16 wield_type;
  482. int16 damage_low1;
  483. int16 damage_high1;
  484. int16 damage_low2;
  485. int16 damage_high2;
  486. int16 damage_low3;
  487. int16 damage_high3;
  488. int16 delay;
  489. float rating;
  490. };
  491. struct Shield_Info {
  492. Armor_Info armor_info;
  493. };
  494. struct Ranged_Info {
  495. Weapon_Info weapon_info;
  496. int16 range_low;
  497. int16 range_high;
  498. };
  499. struct Bag_Info {
  500. int8 num_slots;
  501. int16 weight_reduction;
  502. };
  503. struct Food_Info{
  504. int8 type; //0=water, 1=food
  505. int8 level;
  506. float duration;
  507. int8 satiation;
  508. };
  509. struct Bauble_Info{
  510. int16 cast;
  511. int16 recovery;
  512. int32 duration;
  513. float recast;
  514. int8 display_slot_optional;
  515. int8 display_cast_time;
  516. int8 display_bauble_type;
  517. float effect_radius;
  518. int32 max_aoe_targets;
  519. int8 display_until_cancelled;
  520. };
  521. struct Book_Info{
  522. int8 language;
  523. EQ2_16BitString author;
  524. EQ2_16BitString title;
  525. };
  526. struct Skill_Info{
  527. int32 spell_id;
  528. int32 spell_tier;
  529. };
  530. struct House_Info{
  531. int32 status_rent_reduction;
  532. };
  533. struct HouseContainer_Info{
  534. int16 disallowed_types;
  535. int16 allowed_types;
  536. int8 num_slots;
  537. };
  538. struct RecipeBook_Info{
  539. vector<string> recipes;
  540. int8 uses;
  541. };
  542. struct Thrown_Info{
  543. sint32 range;
  544. sint32 damage_modifier;
  545. float hit_bonus;
  546. int32 damage_type;
  547. };
  548. struct ItemEffect{
  549. EQ2_16BitString effect;
  550. int8 percentage;
  551. int8 subbulletflag;
  552. };
  553. #pragma pack()
  554. Item();
  555. Item(Item* in_item);
  556. ~Item();
  557. string lowername;
  558. string name;
  559. string description;
  560. int8 stack_count;
  561. int32 sell_price;
  562. int32 max_sell_value;
  563. bool save_needed;
  564. int8 weapon_type;
  565. string adornment;
  566. string creator;
  567. vector<ItemStat*> item_stats;
  568. vector<ItemStatString*> item_string_stats;
  569. vector<ItemLevelOverride*> item_level_overrides;
  570. vector<ItemEffect*> item_effects;
  571. Generic_Info generic_info;
  572. Weapon_Info* weapon_info;
  573. Ranged_Info* ranged_info;
  574. Armor_Info* armor_info;
  575. Bag_Info* bag_info;
  576. Food_Info* food_info;
  577. Bauble_Info* bauble_info;
  578. Book_Info* book_info;
  579. Skill_Info* skill_info;
  580. RecipeBook_Info* recipebook_info;
  581. Thrown_Info* thrown_info;
  582. vector<int8> slot_data;
  583. ItemCore details;
  584. int32 spell_id;
  585. int8 spell_tier;
  586. string item_script;
  587. void AddEffect(string effect, int8 percentage, int8 subbulletflag);
  588. int32 GetMaxSellValue();
  589. void SetMaxSellValue(int32 val);
  590. void SetItem(Item* old_item);
  591. int16 GetOverrideLevel(int8 adventure_class, int8 tradeskill_class);
  592. void AddLevelOverride(int8 adventure_class, int8 tradeskill_class, int16 level);
  593. void AddLevelOverride(ItemLevelOverride* class_);
  594. bool CheckClassLevel(int8 adventure_class, int8 tradeskill_class, int16 level);
  595. bool CheckClass(int8 adventure_class, int8 tradeskill_class);
  596. bool CheckLevel(int8 adventure_class, int8 tradeskill_class, int16 level);
  597. void SetAppearance(int16 type, int8 red, int8 green, int8 blue, int8 highlight_red, int8 highlight_green, int8 highlight_blue);
  598. void SetAppearance(ItemAppearance* appearance);
  599. void AddStat(ItemStat* in_stat);
  600. void AddStatString(ItemStatString* in_stat);
  601. void AddStat(int8 type, int16 subtype, float value, char* name = 0);
  602. void SetWeaponType(int8 type);
  603. int8 GetWeaponType();
  604. bool HasSlot(int8 slot, int8 slot2 = 255);
  605. bool IsNormal();
  606. bool IsWeapon();
  607. bool IsArmor();
  608. bool IsRanged();
  609. bool IsBag();
  610. bool IsFood();
  611. bool IsBauble();
  612. bool IsSkill();
  613. bool IsHouseItem();
  614. bool IsHouseContainer();
  615. bool IsShield();
  616. bool IsAdornment();
  617. bool IsAmmo();
  618. bool IsBook();
  619. bool IsChainArmor();
  620. bool IsClothArmor();
  621. bool IsCollectable();
  622. bool IsCloak();
  623. bool IsCrushWeapon();
  624. bool IsFoodFood();
  625. bool IsFoodDrink();
  626. bool IsJewelry();
  627. bool IsLeatherArmor();
  628. bool IsMisc();
  629. bool IsPierceWeapon();
  630. bool IsPlateArmor();
  631. bool IsPoison();
  632. bool IsPotion();
  633. bool IsRecipeBook();
  634. bool IsSalesDisplay();
  635. bool IsSlashWeapon();
  636. bool IsSpellScroll();
  637. bool IsTinkered();
  638. bool IsTradeskill();
  639. bool IsThrown();
  640. void SetItemScript(string name);
  641. const char* GetItemScript();
  642. int32 CalculateRepairCost();
  643. void SetItemType(int8 in_type);
  644. void serialize(PacketStruct* packet, bool show_name = false, Player* player = 0, int16 packet_type = 0, int8 subtype = 0, bool loot_item = false);
  645. 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);
  646. PacketStruct* PrepareItem(int16 version, bool merchant_item = false, bool loot_item = false);
  647. bool CheckFlag(int32 flag);
  648. void AddSlot(int8 slot_id);
  649. void SetSlots(int32 slots);
  650. bool needs_deletion;
  651. };
  652. class MasterItemList{
  653. public:
  654. ~MasterItemList();
  655. map<int32,Item*> items;
  656. Item* GetItem(int32 id);
  657. Item* GetItemByName(const char *name);
  658. ItemStatsValues* CalculateItemBonuses(int32 item_id);
  659. ItemStatsValues* CalculateItemBonuses(Item* desc, ItemStatsValues* values = 0);
  660. 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);
  661. vector<Item*>* GetItems(map<string, string> criteria);
  662. void AddItem(Item* item);
  663. bool IsBag(int32 item_id);
  664. void RemoveAll();
  665. static int32 NextUniqueID();
  666. static void ResetUniqueID(int32 new_id);
  667. static int32 next_unique_id;
  668. };
  669. class PlayerItemList {
  670. public:
  671. PlayerItemList();
  672. ~PlayerItemList();
  673. // int16 number;
  674. map<int32, Item*> indexed_items;
  675. map<sint32, map<int16, Item*> > items;
  676. // map< int8, Item* > inv_items;
  677. // map< int8, Item* > bank_items;
  678. bool SharedBankAddAllowed(Item* item);
  679. vector<Item*>* GetItemsFromBagID(sint32 bag_id);
  680. vector<Item*>* GetItemsInBag(Item* bag);
  681. Item* GetBag(int8 inventory_slot, bool lock = true);
  682. bool HasItem(int32 id, bool include_bank = false);
  683. Item* GetItemFromIndex(int32 index);
  684. void MoveItem(Item* item, sint32 inv_slot, int16 slot, bool erase_old = true);
  685. bool MoveItem(sint32 to_bag_id, int16 from_index, sint8 to, int8 charges);
  686. Item* GetItemFromUniqueID(int32 item_id, bool include_bank = false, bool lock = true);
  687. Item* GetItemFromID(int32 item_id, int8 count = 0, bool include_bank = false, bool lock = true);
  688. bool AssignItemToFreeSlot(Item* item);
  689. int16 GetNumberOfFreeSlots();
  690. int16 GetNumberOfItems();
  691. bool HasFreeSlot();
  692. bool HasFreeBagSlot();
  693. void DestroyItem(int16 index);
  694. Item* CanStack(Item* item, bool include_bank = false);
  695. void RemoveItem(Item* item, bool delete_item = false);
  696. void AddItem(Item* item);
  697. Item* GetItem(sint32 bag_slot, int16 slot);
  698. EQ2Packet* serialize(Player* player, int16 version);
  699. uchar* xor_packet;
  700. uchar* orig_packet;
  701. map<int32, Item*>* GetAllItems();
  702. bool HasFreeBankSlot();
  703. int8 FindFreeBankSlot();
  704. private:
  705. void Stack(Item* orig_item, Item* item);
  706. Mutex MPlayerItems;
  707. int16 packet_count;
  708. };
  709. class OverFlowItemList : public PlayerItemList {
  710. public:
  711. bool OverFlowSlotFull();
  712. int8 GetNextOverFlowSlot();
  713. bool AddItem(Item* item);
  714. Item* GetOverFlowItem();
  715. };
  716. class EquipmentItemList{
  717. public:
  718. EquipmentItemList();
  719. EquipmentItemList(const EquipmentItemList& list);
  720. ~EquipmentItemList();
  721. Item* items[NUM_SLOTS];
  722. vector<Item*>* GetAllEquippedItems();
  723. bool HasItem(int32 id);
  724. int8 GetNumberOfItems();
  725. Item* GetItemFromUniqueID(int32 item_id);
  726. Item* GetItemFromItemID(int32 item_id);
  727. void SetItem(int8 slot_id, Item* item);
  728. void RemoveItem(int8 slot, bool delete_item = false);
  729. Item* GetItem(int8 slot_id);
  730. bool AddItem(int8 slot, Item* item);
  731. bool CheckEquipSlot(Item* tmp, int8 slot);
  732. bool CanItemBeEquippedInSlot(Item* tmp, int8 slot);
  733. int8 GetFreeSlot(Item* tmp, int8 slot_id = 255);
  734. ItemStatsValues* CalculateEquipmentBonuses();
  735. EQ2Packet* serialize(int16 version);
  736. uchar* xor_packet;
  737. uchar* orig_packet;
  738. private:
  739. Mutex MEquipmentItems;
  740. };
  741. #endif