Moved struct Item_Struct into namespace EQEmu

This commit is contained in:
Uleat
2016-05-21 04:54:18 -04:00
parent ebe6f95e6e
commit 3031365e1f
70 changed files with 1757 additions and 1597 deletions
+1
View File
@@ -37,6 +37,7 @@ SET(common_sources
inventory_version.cpp
ipc_mutex.cpp
item.cpp
item_struct.cpp
light_source.cpp
md5.cpp
memory_mapped_file.cpp
+1 -1
View File
@@ -1,4 +1,4 @@
/* EQEMu: Everquest Server Emulator
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
+6 -326
View File
@@ -1,4 +1,5 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
@@ -13,337 +14,16 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef EQ_CONSTANTS_H
#define EQ_CONSTANTS_H
#ifndef COMMON_EQ_CONSTANTS_H
#define COMMON_EQ_CONSTANTS_H
#include "skills.h"
#include "types.h"
/*
** Item attributes
**
** (There are no grepwin hits other than these declarations... Do they have a use?)
*/
enum ItemAttributes : uint32
{
ItemAttrNone = 0x00000000,
ItemAttrLore = 0x00000001,
ItemAttrArtifact = 0x00000002,
ItemAttrSummoned = 0x00000004,
ItemAttrMagic = 0x00000008,
ItemAttrAugment = 0x00000010,
ItemAttrPendingLore = 0x00000020,
ItemAttrUnknown = 0xFFFFFFFF
};
/*
** Item class types
**
*/
enum ItemClassTypes
{
ItemClassCommon = 0,
ItemClassContainer,
ItemClassBook,
_ItemClassCount
};
/*
** Item use types
**
** (ref: database and eqstr_us.txt)
**
** (Looking at a recent database, it's possible that some of the item values may be off [10-27-2013])
*/
enum ItemUseTypes : uint8
{
/*9138*/ ItemType1HSlash = 0,
/*9141*/ ItemType2HSlash,
/*9140*/ ItemType1HPiercing,
/*9139*/ ItemType1HBlunt,
/*9142*/ ItemType2HBlunt,
/*5504*/ ItemTypeBow, // 5
/*----*/ ItemTypeUnknown1,
/*----*/ ItemTypeLargeThrowing,
/*5505*/ ItemTypeShield,
/*5506*/ ItemTypeScroll,
/*5507*/ ItemTypeArmor, // 10
/*5508*/ ItemTypeMisc, // a lot of random crap has this item use.
/*7564*/ ItemTypeLockPick,
/*----*/ ItemTypeUnknown2,
/*5509*/ ItemTypeFood,
/*5510*/ ItemTypeDrink, // 15
/*5511*/ ItemTypeLight,
/*5512*/ ItemTypeCombinable, // not all stackable items are this use...
/*5513*/ ItemTypeBandage,
/*----*/ ItemTypeSmallThrowing,
/*----*/ ItemTypeSpell, // 20 // spells and tomes
/*5514*/ ItemTypePotion,
/*----*/ ItemTypeUnknown3,
/*0406*/ ItemTypeWindInstrument,
/*0407*/ ItemTypeStringedInstrument,
/*0408*/ ItemTypeBrassInstrument, // 25
/*0405*/ ItemTypePercussionInstrument,
/*5515*/ ItemTypeArrow,
/*----*/ ItemTypeUnknown4,
/*5521*/ ItemTypeJewelry,
/*----*/ ItemTypeSkull, // 30
/*5516*/ ItemTypeBook, // skill-up tomes/books? (would probably need a pp flag if true...)
/*5517*/ ItemTypeNote,
/*5518*/ ItemTypeKey,
/*----*/ ItemTypeCoin,
/*5520*/ ItemType2HPiercing, // 35
/*----*/ ItemTypeFishingPole,
/*----*/ ItemTypeFishingBait,
/*5519*/ ItemTypeAlcohol,
/*----*/ ItemTypeKey2, // keys and satchels?? (questable keys?)
/*----*/ ItemTypeCompass, // 40
/*----*/ ItemTypeUnknown5,
/*----*/ ItemTypePoison, // might be wrong, but includes poisons
/*----*/ ItemTypeUnknown6,
/*----*/ ItemTypeUnknown7,
/*5522*/ ItemTypeMartial, // 45
/*----*/ ItemTypeUnknown8,
/*----*/ ItemTypeUnknown9,
/*----*/ ItemTypeUnknown10,
/*----*/ ItemTypeUnknown11,
/*----*/ ItemTypeSinging, // 50
/*5750*/ ItemTypeAllInstrumentTypes,
/*5776*/ ItemTypeCharm,
/*----*/ ItemTypeDye,
/*----*/ ItemTypeAugmentation,
/*----*/ ItemTypeAugmentationSolvent, // 55
/*----*/ ItemTypeAugmentationDistiller,
/*----*/ ItemTypeUnknown12,
/*----*/ ItemTypeFellowshipKit,
/*----*/ ItemTypeUnknown13,
/*----*/ ItemTypeRecipe, // 60
/*----*/ ItemTypeAdvancedRecipe,
/*----*/ ItemTypeJournal, // only one(1) database entry
/*----*/ ItemTypeAltCurrency, // alt-currency (as opposed to coinage)
/*5881*/ ItemTypePerfectedAugmentationDistiller,
/*----*/ _ItemTypeCount
/*
Unknowns:
Mounts?
Ornamentations?
GuildBanners?
Collectible?
Placeable?
(others?)
*/
};
/*
** Augmentation use type bitmasks (1-based)
**
** (ref: dbstr_us.txt)
**
*/
enum AugmentationUseTypeBitmasks : uint32 {
AugUseNone = 0x00000000,
AugUseGeneralSingleStat = 0x00000001, /*1^16^1 (General: Single Stat)^0*/
AugUseGeneralMultipleStat = 0x00000002, /*2^16^2 (General: Multiple Stat)^0*/
AugUseGeneralSpellEffect = 0x00000004, /*3^16^3 (General: Spell Effect)^0*/
AugUseWeaponGeneral = 0x00000008, /*4^16^4 (Weapon: General)^0*/
AugUseWeaponElemDamage = 0x00000010, /*5^16^5 (Weapon: Elem Damage)^0*/
AugUseWeaponBaseDamage = 0x00000020, /*6^16^6 (Weapon: Base Damage)^0*/
AugUseGeneralGroup = 0x00000040, /*7^16^7 (General: Group)^0*/
AugUseGeneralRaid = 0x00000080, /*8^16^8 (General: Raid)^0*/
AugUseGeneralDragonsPoints = 0x00000100, /*9^16^9 (General: Dragons Points)^0*/
AugUseCraftedCommon = 0x00000200, /*10^16^10 (Crafted: Common)^0*/
AugUseCraftedGroup1 = 0x00000400, /*11^16^11 (Crafted: Group)^0*/
AugUseCraftedRaid1 = 0x00000800, /*12^16^12 (Crafted: Raid)^0*/
AugUseEnergeiacGroup = 0x00001000, /*13^16^13 (Energeiac: Group)^0*/
AugUseEnergeiacRaid = 0x00002000, /*14^16^14 (Energeiac: Raid)^0*/
AugUseEmblem = 0x00004000, /*15^16^15 (Emblem)^0*/
AugUseCraftedGroup2 = 0x00008000, /*16^16^16 (Crafted: Group)^0*/
AugUseCraftedRaid2 = 0x00010000, /*17^16^17 (Crafted: Raid)^0*/
AugUseUnknown1 = 0x00020000, /*18^16^18^0*/
AugUseUnknown2 = 0x00040000, /*19^16^19^0*/
AugUseOrnamentation = 0x00080000, /*20^16^20 (Ornamentation)^0*/
AugUseSpecialOrnamentation = 0x00100000, /*21^16^21 (Special Ornamentation)^0*/
AugUseUnknown3 = 0x00200000, /*22^16^22^0*/
AugUseUnknown4 = 0x00400000, /*23^16^23^0*/
AugUseUnknown5 = 0x00800000, /*24^16^24^0*/
AugUseUnknown6 = 0x01000000, /*25^16^25^0*/
AugUseUnknown7 = 0x02000000, /*26^16^26^0*/
AugUseUnknown8 = 0x04000000, /*27^16^27^0*/
AugUseUnknown9 = 0x08000000, /*28^16^28^0*/
AugUseUnknown10 = 0x10000000, /*29^16^29^0*/
AugUseEpic25 = 0x20000000, /*30^16^30^0*/
AugUseTest = 0x40000000, /*31^16^Test^0*/ // listed as 31^16^31^0 in 5-10 client
AugUseAll = 0xFFFFFFFF
};
/*
** Augmentation use types (enumerated)
**
*/
enum AugmentationUseTypes : uint8 {
AugTypeNone = 0,
AugTypeGeneralSingleStat,
AugTypeGeneralMultipleStat,
AugTypeGeneralSpellEffect,
AugTypeWeaponGeneral,
AugTypeWeaponElemDamage, // 5
AugTypeWeaponBaseDamage,
AugTypeGeneralGroup,
AugTypeGeneralRaid,
AugTypeGeneralDragonsPoints,
AugTypeCraftedCommon, // 10
AugTypeCraftedGroup1,
AugTypeCraftedRaid1,
AugTypeEnergeiacGroup,
AugTypeEnergeiacRaid,
AugTypeEmblem, // 15
AugTypeCraftedGroup2,
AugTypeCraftedRaid2,
AugTypeUnknown1,
AugTypeUnknown2,
AugTypeOrnamentation, // 20
AugTypeSpecialOrnamentation,
AugTypeUnknown3,
AugTypeUnknown4,
AugTypeUnknown5,
AugTypeUnknown6, // 25
AugTypeUnknown7,
AugTypeUnknown8,
AugTypeUnknown9,
AugTypeUnknown10,
AugTypeEpic25, // 30
AugTypeTest,
_AugTypeCount,
AugTypeAll = 255
};
/*
** Augmentation restriction types (in-work)
**
** (ref: eqstr_us.txt)
**
*/
enum AugmentationRestrictionTypes : uint8 {
/*4690*/ AugRestrAny = 0,
/*9134*/ AugRestrArmor,
/*9135*/ AugRestrWeapons,
/*9136*/ AugRestr1HWeapons,
/*9137*/ AugRestr2HWeapons,
/*9138*/ AugRestr1HSlash, // 5
/*9139*/ AugRestr1HBlunt,
/*9140*/ AugRestrPiercing,
/*9148*/ AugRestrHandToHand,
/*9141*/ AugRestr2HSlash,
/*9142*/ AugRestr2HBlunt, // 10
/*9143*/ AugRestr2HPierce,
/*9144*/ AugRestrBows,
/*9145*/ AugRestrShields,
/*8052*/ AugRestr1HSlash1HBluntOrHandToHand,
/*9200*/ AugRestr1HBluntOrHandToHand, // 15 // no listed peq entries
// these three appear to be post-RoF (12-10-2012) and can not be verified until RoF (05-10-2013) is supported
/*????*/ AugRestrUnknown1,
/*????*/ AugRestrUnknown2,
/*????*/ AugRestrUnknown3, // last value in peq entries
_AugRestrCount
/*4687*/ //AugTypeAllItems, // ?? unknown atm
/*4688*/ //AugTypePrestige, // ?? unknown atm
/*4689*/ //AugTypeNonPrestige, // ?? unknown atm
};
/*
** Container use types
**
** This correlates to world 'object.type' (object.h/Object.cpp) as well as Item_Struct.BagType
**
** (ref: database, web forums and eqstr_us.txt)
*/
enum ContainerUseTypes : uint8
{
/*3400*/ BagTypeSmallBag = 0,
/*3401*/ BagTypeLargeBag,
/*3402*/ BagTypeQuiver,
/*3403*/ BagTypeBeltPouch,
/*3404*/ BagTypeWristPouch,
/*3405*/ BagTypeBackPack, // 5
/*3406*/ BagTypeSmallChest,
/*3407*/ BagTypeLargeChest,
/*----*/ BagTypeBandolier, // <*Database Reference Only>
/*3408*/ BagTypeMedicineBag,
/*3409*/ BagTypeToolBox, // 10
/*3410*/ BagTypeLexicon,
/*3411*/ BagTypeMortar,
/*3412*/ BagTypeSelfDusting, // Quest container (Auto-clear contents?)
/*3413*/ BagTypeMixingBowl,
/*3414*/ BagTypeOven, // 15
/*3415*/ BagTypeSewingKit,
/*3416*/ BagTypeForge,
/*3417*/ BagTypeFletchingKit,
/*3418*/ BagTypeBrewBarrel,
/*3419*/ BagTypeJewelersKit, // 20
/*3420*/ BagTypePotteryWheel,
/*3421*/ BagTypeKiln,
/*3422*/ BagTypeKeymaker, // (no database entries as of peq rev 69)
/*3423*/ BagTypeWizardsLexicon,
/*3424*/ BagTypeMagesLexicon, // 25
/*3425*/ BagTypeNecromancersLexicon,
/*3426*/ BagTypeEnchantersLexicon,
/*----*/ BagTypeUnknown1, // (a coin pouch/purse?) (no database entries as of peq rev 69)
/*----*/ BagTypeConcordanceofResearch, // <*Database Reference Only>
/*3427*/ BagTypeAlwaysWorks, // 30 // Quest container (Never-fail combines?)
/*3428*/ BagTypeKoadaDalForge, // High Elf
/*3429*/ BagTypeTeirDalForge, // Dark Elf
/*3430*/ BagTypeOggokForge, // Ogre
/*3431*/ BagTypeStormguardForge, // Dwarf
/*3432*/ BagTypeAkanonForge, // 35 // Gnome
/*3433*/ BagTypeNorthmanForge, // Barbarian
/*----*/ BagTypeUnknown2, // (no database entries as of peq rev 69)
/*3434*/ BagTypeCabilisForge, // Iksar
/*3435*/ BagTypeFreeportForge, // Human 1
/*3436*/ BagTypeRoyalQeynosForge, // 40 // Human 2
/*3439*/ BagTypeHalflingTailoringKit,
/*3438*/ BagTypeErudTailoringKit,
/*3440*/ BagTypeFierDalTailoringKit, // Wood Elf
/*3441*/ BagTypeFierDalFletchingKit, // Wood Elf
/*3437*/ BagTypeIksarPotteryWheel, // 45
/*3442*/ BagTypeTackleBox,
/*3443*/ BagTypeTrollForge,
/*3445*/ BagTypeFierDalForge, // Wood Elf
/*3444*/ BagTypeValeForge, // Halfling
/*3446*/ BagTypeErudForge, // 50
/*----*/ BagTypeTradersSatchel, // <*Database Reference Only> (db: Yellow Trader's Satchel Token?)
/*5785*/ BagTypeGuktaForge, // Froglok (no database entries as of peq rev 69)
/*3359*/ BagTypeAugmentationSealer,
/*----*/ BagTypeIceCreamChurn, // <*Database Reference Only>
/*6325*/ BagTypeTransformationmold, // 55 // Ornamentation
/*6340*/ BagTypeDetransformationmold, // Ornamentation Stripper
/*5400*/ BagTypeUnattuner,
/*7684*/ BagTypeTradeskillBag,
/*7692*/ BagTypeCollectibleBag,
/*----*/ _BagTypeCount
};
/*
** Item Effect Types
**
*/
enum {
ET_CombatProc = 0,
ET_ClickEffect = 1,
ET_WornEffect = 2,
ET_Expendable = 3,
ET_EquipClick = 4,
ET_ClickEffect2 = 5, //name unknown
ET_Focus = 6,
ET_Scroll = 7
};
//SpawnAppearance types: (compared two clients for server-originating types: SoF & RoF2)
#define AT_Die 0 // this causes the client to keel over and zone to bind point (default action)
#define AT_WhoLevel 1 // the level that shows up on /who
@@ -848,4 +528,4 @@ static const uint8 SkillDamageTypes[HIGHEST_SKILL + 1] = // change to _SkillServ
static const uint32 MAX_SPELL_DB_ID_VAL = 65535;
#endif
#endif /*COMMON_EQ_CONSTANTS_H*/
+1 -1
View File
@@ -2098,7 +2098,7 @@ struct AdventureLeaderboard_Struct
/*struct Item_Shop_Struct {
uint16 merchantid;
uint8 itemtype;
Item_Struct item;
EQEmu::Item_Struct item;
uint8 iss_unknown001[6];
};*/
+88 -111
View File
@@ -187,35 +187,35 @@ ItemInst* Inventory::GetItem(int16 slot_id) const
else if (slot_id >= EQEmu::legacy::TRADE_BAGS_BEGIN && slot_id <= EQEmu::legacy::TRADE_BAGS_END) {
// Trade bag slots
ItemInst* inst = _GetItem(m_trade, Inventory::CalcSlotId(slot_id));
if (inst && inst->IsType(ItemClassContainer)) {
if (inst && inst->IsClassBag()) {
result = inst->GetItem(Inventory::CalcBagIdx(slot_id));
}
}
else if (slot_id >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && slot_id <= EQEmu::legacy::SHARED_BANK_BAGS_END) {
// Shared Bank bag slots
ItemInst* inst = _GetItem(m_shbank, Inventory::CalcSlotId(slot_id));
if (inst && inst->IsType(ItemClassContainer)) {
if (inst && inst->IsClassBag()) {
result = inst->GetItem(Inventory::CalcBagIdx(slot_id));
}
}
else if (slot_id >= EQEmu::legacy::BANK_BAGS_BEGIN && slot_id <= EQEmu::legacy::BANK_BAGS_END) {
// Bank bag slots
ItemInst* inst = _GetItem(m_bank, Inventory::CalcSlotId(slot_id));
if (inst && inst->IsType(ItemClassContainer)) {
if (inst && inst->IsClassBag()) {
result = inst->GetItem(Inventory::CalcBagIdx(slot_id));
}
}
else if (slot_id >= EQEmu::legacy::CURSOR_BAG_BEGIN && slot_id <= EQEmu::legacy::CURSOR_BAG_END) {
// Cursor bag slots
ItemInst* inst = m_cursor.peek_front();
if (inst && inst->IsType(ItemClassContainer)) {
if (inst && inst->IsClassBag()) {
result = inst->GetItem(Inventory::CalcBagIdx(slot_id));
}
}
else if (slot_id >= EQEmu::legacy::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::legacy::GENERAL_BAGS_END) {
// Personal inventory bag slots
ItemInst* inst = _GetItem(m_inv, Inventory::CalcSlotId(slot_id));
if (inst && inst->IsType(ItemClassContainer)) {
if (inst && inst->IsClassBag()) {
result = inst->GetItem(Inventory::CalcBagIdx(slot_id));
}
}
@@ -359,7 +359,7 @@ ItemInst* Inventory::PopItem(int16 slot_id)
else {
// Is slot inside bag?
ItemInst* baginst = GetItem(Inventory::CalcSlotId(slot_id));
if (baginst != nullptr && baginst->IsType(ItemClassContainer)) {
if (baginst != nullptr && baginst->IsClassBag()) {
p = baginst->PopItem(Inventory::CalcBagIdx(slot_id));
}
}
@@ -368,7 +368,7 @@ ItemInst* Inventory::PopItem(int16 slot_id)
return p;
}
bool Inventory::HasSpaceForItem(const Item_Struct *ItemToTry, int16 Quantity) {
bool Inventory::HasSpaceForItem(const EQEmu::Item_Struct *ItemToTry, int16 Quantity) {
if (ItemToTry->Stackable) {
@@ -386,7 +386,7 @@ bool Inventory::HasSpaceForItem(const Item_Struct *ItemToTry, int16 Quantity) {
Quantity -= ChargeSlotsLeft;
}
if (InvItem && InvItem->IsType(ItemClassContainer)) {
if (InvItem && InvItem->IsClassBag()) {
int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_INDEX_BEGIN);
uint8 BagSize = InvItem->GetItem()->BagSlots;
@@ -430,7 +430,7 @@ bool Inventory::HasSpaceForItem(const Item_Struct *ItemToTry, int16 Quantity) {
}
}
else if (InvItem->IsType(ItemClassContainer) && CanItemFitInContainer(ItemToTry, InvItem->GetItem())) {
else if (InvItem->IsClassBag() && CanItemFitInContainer(ItemToTry, InvItem->GetItem())) {
int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_INDEX_BEGIN);
@@ -624,9 +624,9 @@ int16 Inventory::FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size, boo
if (!for_bag) {
for (int16 i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++) {
const ItemInst* inst = GetItem(i);
if (inst && inst->IsType(ItemClassContainer) && inst->GetItem()->BagSize >= min_size)
if (inst && inst->IsClassBag() && inst->GetItem()->BagSize >= min_size)
{
if (inst->GetItem()->BagType == BagTypeQuiver && inst->GetItem()->ItemType != ItemTypeArrow)
if (inst->GetItem()->BagType == EQEmu::item::BagTypeQuiver && inst->GetItem()->ItemType != EQEmu::item::ItemTypeArrow)
{
continue;
}
@@ -666,7 +666,7 @@ int16 Inventory::FindFreeSlotForTradeItem(const ItemInst* inst) {
return INVALID_INDEX;
// step 1: find room for bags (caller should really ask for slots for bags first to avoid sending them to cursor..and bag item loss)
if (inst->IsType(ItemClassContainer)) {
if (inst->IsClassBag()) {
for (int16 free_slot = EQEmu::legacy::GENERAL_BEGIN; free_slot <= EQEmu::legacy::GENERAL_END; ++free_slot) {
if (!m_inv[free_slot])
return free_slot;
@@ -693,7 +693,7 @@ int16 Inventory::FindFreeSlotForTradeItem(const ItemInst* inst) {
if (!main_inst)
continue;
if (main_inst->IsType(ItemClassContainer)) { // if item-specific containers already have bad items, we won't fix it here...
if (main_inst->IsClassBag()) { // if item-specific containers already have bad items, we won't fix it here...
for (uint8 free_bag_slot = SUB_INDEX_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++free_bag_slot) {
const ItemInst* sub_inst = main_inst->GetItem(free_bag_slot);
@@ -708,11 +708,11 @@ int16 Inventory::FindFreeSlotForTradeItem(const ItemInst* inst) {
}
// step 3a: find room for container-specific items (ItemClassArrow)
if (inst->GetItem()->ItemType == ItemTypeArrow) {
if (inst->GetItem()->ItemType == EQEmu::item::ItemTypeArrow) {
for (int16 free_slot = EQEmu::legacy::GENERAL_BEGIN; free_slot <= EQEmu::legacy::GENERAL_END; ++free_slot) {
const ItemInst* main_inst = m_inv[free_slot];
if (!main_inst || (main_inst->GetItem()->BagType != BagTypeQuiver) || !main_inst->IsType(ItemClassContainer))
if (!main_inst || (main_inst->GetItem()->BagType != EQEmu::item::BagTypeQuiver) || !main_inst->IsClassBag())
continue;
for (uint8 free_bag_slot = SUB_INDEX_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++free_bag_slot) {
@@ -723,11 +723,11 @@ int16 Inventory::FindFreeSlotForTradeItem(const ItemInst* inst) {
}
// step 3b: find room for container-specific items (ItemClassSmallThrowing)
if (inst->GetItem()->ItemType == ItemTypeSmallThrowing) {
if (inst->GetItem()->ItemType == EQEmu::item::ItemTypeSmallThrowing) {
for (int16 free_slot = EQEmu::legacy::GENERAL_BEGIN; free_slot <= EQEmu::legacy::GENERAL_END; ++free_slot) {
const ItemInst* main_inst = m_inv[free_slot];
if (!main_inst || (main_inst->GetItem()->BagType != BagTypeBandolier) || !main_inst->IsType(ItemClassContainer))
if (!main_inst || (main_inst->GetItem()->BagType != EQEmu::item::BagTypeBandolier) || !main_inst->IsClassBag())
continue;
for (uint8 free_bag_slot = SUB_INDEX_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++free_bag_slot) {
@@ -748,8 +748,8 @@ int16 Inventory::FindFreeSlotForTradeItem(const ItemInst* inst) {
for (int16 free_slot = EQEmu::legacy::GENERAL_BEGIN; free_slot <= EQEmu::legacy::GENERAL_END; ++free_slot) {
const ItemInst* main_inst = m_inv[free_slot];
if (main_inst && main_inst->IsType(ItemClassContainer)) {
if ((main_inst->GetItem()->BagSize < inst->GetItem()->Size) || (main_inst->GetItem()->BagType == BagTypeBandolier) || (main_inst->GetItem()->BagType == BagTypeQuiver))
if (main_inst && main_inst->IsClassBag()) {
if ((main_inst->GetItem()->BagSize < inst->GetItem()->Size) || (main_inst->GetItem()->BagType == EQEmu::item::BagTypeBandolier) || (main_inst->GetItem()->BagType == EQEmu::item::BagTypeQuiver))
continue;
for (uint8 free_bag_slot = SUB_INDEX_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++free_bag_slot) {
@@ -901,7 +901,7 @@ uint8 Inventory::CalcMaterialFromSlot(int16 equipslot)
}
}
bool Inventory::CanItemFitInContainer(const Item_Struct *ItemToTry, const Item_Struct *Container) {
bool Inventory::CanItemFitInContainer(const EQEmu::Item_Struct *ItemToTry, const EQEmu::Item_Struct *Container) {
if (!ItemToTry || !Container)
return false;
@@ -909,10 +909,10 @@ bool Inventory::CanItemFitInContainer(const Item_Struct *ItemToTry, const Item_S
if (ItemToTry->Size > Container->BagSize)
return false;
if ((Container->BagType == BagTypeQuiver) && (ItemToTry->ItemType != ItemTypeArrow))
if ((Container->BagType == EQEmu::item::BagTypeQuiver) && (ItemToTry->ItemType != EQEmu::item::ItemTypeArrow))
return false;
if ((Container->BagType == BagTypeBandolier) && (ItemToTry->ItemType != ItemTypeSmallThrowing))
if ((Container->BagType == EQEmu::item::BagTypeBandolier) && (ItemToTry->ItemType != EQEmu::item::ItemTypeSmallThrowing))
return false;
return true;
@@ -1019,7 +1019,7 @@ uint8 Inventory::FindBrightestLightType()
auto item = inst->GetItem();
if (item == nullptr) { continue; }
if (item->ItemClass != ItemClassCommon) { continue; }
if (!item->IsClassCommon()) { continue; }
if (item->Light < 9 || item->Light > 13) { continue; }
if (EQEmu::lightsource::TypeToLevel(item->Light))
@@ -1071,7 +1071,7 @@ int Inventory::GetSlotByItemInstCollection(const std::map<int16, ItemInst*> &col
return iter->first;
}
if (t_inst && !t_inst->IsType(ItemClassContainer)) {
if (t_inst && !t_inst->IsClassBag()) {
for (auto b_iter = t_inst->_cbegin(); b_iter != t_inst->_cend(); ++b_iter) {
if (b_iter->second == inst) {
return Inventory::CalcSlotId(iter->first, b_iter->first);
@@ -1099,7 +1099,7 @@ void Inventory::dumpItemCollection(const std::map<int16, ItemInst*> &collection)
void Inventory::dumpBagContents(ItemInst *inst, std::map<int16, ItemInst*>::const_iterator *it)
{
if (!inst || !inst->IsType(ItemClassContainer))
if (!inst || !inst->IsClassBag())
return;
// Go through bag, if bag
@@ -1177,7 +1177,7 @@ int16 Inventory::_PutItem(int16 slot_id, ItemInst* inst)
// Slot must be within a bag
parentSlot = Inventory::CalcSlotId(slot_id);
ItemInst* baginst = GetItem(parentSlot); // Get parent bag
if (baginst && baginst->IsType(ItemClassContainer))
if (baginst && baginst->IsClassBag())
{
baginst->_PutItem(Inventory::CalcBagIdx(slot_id), inst);
result = slot_id;
@@ -1212,7 +1212,7 @@ int16 Inventory::_HasItem(std::map<int16, ItemInst*>& bucket, uint32 item_id, ui
return EQEmu::legacy::SLOT_AUGMENT;
}
if (!inst->IsType(ItemClassContainer)) { continue; }
if (!inst->IsClassBag()) { continue; }
for (auto bag_iter = inst->_cbegin(); bag_iter != inst->_cend(); ++bag_iter) {
auto bag_inst = bag_iter->second;
@@ -1260,7 +1260,7 @@ int16 Inventory::_HasItem(ItemInstQueue& iqueue, uint32 item_id, uint8 quantity)
return EQEmu::legacy::SLOT_AUGMENT;
}
if (!inst->IsType(ItemClassContainer)) { continue; }
if (!inst->IsClassBag()) { continue; }
for (auto bag_iter = inst->_cbegin(); bag_iter != inst->_cend(); ++bag_iter) {
auto bag_inst = bag_iter->second;
@@ -1294,19 +1294,19 @@ int16 Inventory::_HasItemByUse(std::map<int16, ItemInst*>& bucket, uint8 use, ui
auto inst = iter->second;
if (inst == nullptr) { continue; }
if (inst->IsType(ItemClassCommon) && inst->GetItem()->ItemType == use) {
if (inst->IsClassCommon() && inst->GetItem()->ItemType == use) {
quantity_found += (inst->GetCharges() <= 0) ? 1 : inst->GetCharges();
if (quantity_found >= quantity)
return iter->first;
}
if (!inst->IsType(ItemClassContainer)) { continue; }
if (!inst->IsClassBag()) { continue; }
for (auto bag_iter = inst->_cbegin(); bag_iter != inst->_cend(); ++bag_iter) {
auto bag_inst = bag_iter->second;
if (bag_inst == nullptr) { continue; }
if (bag_inst->IsType(ItemClassCommon) && bag_inst->GetItem()->ItemType == use) {
if (bag_inst->IsClassCommon() && bag_inst->GetItem()->ItemType == use) {
quantity_found += (bag_inst->GetCharges() <= 0) ? 1 : bag_inst->GetCharges();
if (quantity_found >= quantity)
return Inventory::CalcSlotId(iter->first, bag_iter->first);
@@ -1326,19 +1326,19 @@ int16 Inventory::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, uint8 quantity)
auto inst = *iter;
if (inst == nullptr) { continue; }
if (inst->IsType(ItemClassCommon) && inst->GetItem()->ItemType == use) {
if (inst->IsClassCommon() && inst->GetItem()->ItemType == use) {
quantity_found += (inst->GetCharges() <= 0) ? 1 : inst->GetCharges();
if (quantity_found >= quantity)
return EQEmu::legacy::SlotCursor;
}
if (!inst->IsType(ItemClassContainer)) { continue; }
if (!inst->IsClassBag()) { continue; }
for (auto bag_iter = inst->_cbegin(); bag_iter != inst->_cend(); ++bag_iter) {
auto bag_inst = bag_iter->second;
if (bag_inst == nullptr) { continue; }
if (bag_inst->IsType(ItemClassCommon) && bag_inst->GetItem()->ItemType == use) {
if (bag_inst->IsClassCommon() && bag_inst->GetItem()->ItemType == use) {
quantity_found += (bag_inst->GetCharges() <= 0) ? 1 : bag_inst->GetCharges();
if (quantity_found >= quantity)
return Inventory::CalcSlotId(EQEmu::legacy::SlotCursor, bag_iter->first);
@@ -1369,13 +1369,13 @@ int16 Inventory::_HasItemByLoreGroup(std::map<int16, ItemInst*>& bucket, uint32
return EQEmu::legacy::SLOT_AUGMENT;
}
if (!inst->IsType(ItemClassContainer)) { continue; }
if (!inst->IsClassBag()) { continue; }
for (auto bag_iter = inst->_cbegin(); bag_iter != inst->_cend(); ++bag_iter) {
auto bag_inst = bag_iter->second;
if (bag_inst == nullptr) { continue; }
if (bag_inst->IsType(ItemClassCommon) && bag_inst->GetItem()->LoreGroup == loregroup)
if (bag_inst->IsClassCommon() && bag_inst->GetItem()->LoreGroup == loregroup)
return Inventory::CalcSlotId(iter->first, bag_iter->first);
for (int index = AUG_INDEX_BEGIN; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) {
@@ -1409,13 +1409,13 @@ int16 Inventory::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup)
return EQEmu::legacy::SLOT_AUGMENT;
}
if (!inst->IsType(ItemClassContainer)) { continue; }
if (!inst->IsClassBag()) { continue; }
for (auto bag_iter = inst->_cbegin(); bag_iter != inst->_cend(); ++bag_iter) {
auto bag_inst = bag_iter->second;
if (bag_inst == nullptr) { continue; }
if (bag_inst->IsType(ItemClassCommon) && bag_inst->GetItem()->LoreGroup == loregroup)
if (bag_inst->IsClassCommon() && bag_inst->GetItem()->LoreGroup == loregroup)
return Inventory::CalcSlotId(EQEmu::legacy::SlotCursor, bag_iter->first);
for (int index = AUG_INDEX_BEGIN; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) {
@@ -1438,10 +1438,10 @@ int16 Inventory::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup)
//
// class ItemInst
//
ItemInst::ItemInst(const Item_Struct* item, int16 charges) {
ItemInst::ItemInst(const EQEmu::Item_Struct* item, int16 charges) {
m_use_type = ItemInstNormal;
if(item) {
m_item = new Item_Struct(*item);
m_item = new EQEmu::Item_Struct(*item);
} else {
m_item = nullptr;
}
@@ -1449,7 +1449,7 @@ ItemInst::ItemInst(const Item_Struct* item, int16 charges) {
m_price = 0;
m_attuned = false;
m_merchantslot = 0;
if(m_item &&m_item->ItemClass == ItemClassCommon)
if (m_item && m_item->IsClassCommon())
m_color = m_item->Color;
else
m_color = 0;
@@ -1472,7 +1472,7 @@ ItemInst::ItemInst(SharedDatabase *db, uint32 item_id, int16 charges) {
m_use_type = ItemInstNormal;
m_item = db->GetItem(item_id);
if(m_item) {
m_item = new Item_Struct(*m_item);
m_item = new EQEmu::Item_Struct(*m_item);
}
else {
m_item = nullptr;
@@ -1482,7 +1482,7 @@ ItemInst::ItemInst(SharedDatabase *db, uint32 item_id, int16 charges) {
m_price = 0;
m_merchantslot = 0;
m_attuned=false;
if(m_item && m_item->ItemClass == ItemClassCommon)
if (m_item && m_item->IsClassCommon())
m_color = m_item->Color;
else
m_color = 0;
@@ -1527,7 +1527,7 @@ ItemInst::ItemInst(const ItemInst& copy)
{
m_use_type=copy.m_use_type;
if(copy.m_item)
m_item = new Item_Struct(*copy.m_item);
m_item = new EQEmu::Item_Struct(*copy.m_item);
else
m_item = nullptr;
@@ -1563,7 +1563,7 @@ ItemInst::ItemInst(const ItemInst& copy)
m_evolveLvl = copy.m_evolveLvl;
m_activated = copy.m_activated;
if (copy.m_scaledItem)
m_scaledItem = new Item_Struct(*copy.m_scaledItem);
m_scaledItem = new EQEmu::Item_Struct(*copy.m_scaledItem);
else
m_scaledItem = nullptr;
@@ -1589,12 +1589,12 @@ ItemInst::~ItemInst()
}
// Query item type
bool ItemInst::IsType(ItemClassTypes item_class) const
bool ItemInst::IsType(EQEmu::item::ItemClass item_class) const
{
// IsType(<ItemClassTypes>) does not protect against 'm_item = nullptr'
// Check usage type
if ((m_use_type == ItemInstWorldContainer) && (item_class == ItemClassContainer))
if ((m_use_type == ItemInstWorldContainer) && (item_class == EQEmu::item::ItemClassBag))
return true;
if (!m_item)
@@ -1603,6 +1603,21 @@ bool ItemInst::IsType(ItemClassTypes item_class) const
return (m_item->ItemClass == item_class);
}
bool ItemInst::IsClassCommon()
{
return (m_item && m_item->IsClassCommon());
}
bool ItemInst::IsClassBag()
{
return (m_item && m_item->IsClassBag());
}
bool ItemInst::IsClassBook()
{
return (m_item && m_item->IsClassBook());
}
// Is item stackable?
bool ItemInst::IsStackable() const
{
@@ -1667,7 +1682,7 @@ bool ItemInst::IsAugmentable() const
bool ItemInst::AvailableWearSlot(uint32 aug_wear_slots) const {
// TODO: check to see if incoming 'aug_wear_slots' "switches" bit assignments like above...
// (if wrong, would only affect MainAmmo and MainPowerSource augments)
if (!m_item || m_item->ItemClass != ItemClassCommon)
if (!m_item || !m_item->IsClassCommon())
return false;
int index = EQEmu::legacy::EQUIPMENT_BEGIN;
@@ -1683,7 +1698,7 @@ bool ItemInst::AvailableWearSlot(uint32 aug_wear_slots) const {
int8 ItemInst::AvailableAugmentSlot(int32 augtype) const
{
if (!m_item || m_item->ItemClass != ItemClassCommon)
if (!m_item || !m_item->IsClassCommon())
return INVALID_INDEX;
int index = AUG_INDEX_BEGIN;
@@ -1698,7 +1713,7 @@ int8 ItemInst::AvailableAugmentSlot(int32 augtype) const
bool ItemInst::IsAugmentSlotAvailable(int32 augtype, uint8 slot) const
{
if (!m_item || m_item->ItemClass != ItemClassCommon)
if (!m_item || !m_item->IsClassCommon())
return false;
if ((!GetItem(slot) && m_item->AugSlotVisible[slot]) && augtype == -1 || (m_item->AugSlotType[slot] && ((1 << (m_item->AugSlotType[slot] - 1)) & augtype))) {
@@ -1783,7 +1798,7 @@ void ItemInst::ClearByFlags(byFlagSetting is_nodrop, byFlagSetting is_norent)
continue;
}
const Item_Struct* item = inst->GetItem();
const EQEmu::Item_Struct* item = inst->GetItem();
if (item == nullptr) {
cur = m_contents.erase(cur);
continue;
@@ -1848,7 +1863,7 @@ uint8 ItemInst::GetTotalItemCount() const
{
uint8 item_count = 1;
if (m_item && m_item->ItemClass != ItemClassContainer) { return item_count; }
if (m_item && !m_item->IsClassBag()) { return item_count; }
for (int index = SUB_INDEX_BEGIN; index < m_item->BagSlots; ++index) { if (GetItem(index)) { ++item_count; } }
@@ -1857,7 +1872,7 @@ uint8 ItemInst::GetTotalItemCount() const
bool ItemInst::IsNoneEmptyContainer()
{
if (!m_item || m_item->ItemClass != ItemClassContainer)
if (!m_item || !m_item->IsClassBag())
return false;
for (int index = SUB_INDEX_BEGIN; index < m_item->BagSlots; ++index) {
@@ -1871,7 +1886,7 @@ bool ItemInst::IsNoneEmptyContainer()
// Retrieve augment inside item
ItemInst* ItemInst::GetAugment(uint8 slot) const
{
if (m_item && m_item->ItemClass == ItemClassCommon)
if (m_item && m_item->IsClassCommon())
return GetItem(slot);
return nullptr;
@@ -1879,7 +1894,7 @@ ItemInst* ItemInst::GetAugment(uint8 slot) const
ItemInst* ItemInst::GetOrnamentationAug(int32 ornamentationAugtype) const
{
if (!m_item || m_item->ItemClass != ItemClassCommon) { return nullptr; }
if (!m_item || !m_item->IsClassCommon()) { return nullptr; }
if (ornamentationAugtype == 0) { return nullptr; }
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++)
@@ -1916,7 +1931,7 @@ uint32 ItemInst::GetOrnamentHeroModel(int32 material_slot) const {
}
bool ItemInst::UpdateOrnamentationInfo() {
if (!m_item || m_item->ItemClass != ItemClassCommon)
if (!m_item || !m_item->IsClassCommon())
return false;
bool ornamentSet = false;
@@ -1924,7 +1939,7 @@ bool ItemInst::UpdateOrnamentationInfo() {
int32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
if (GetOrnamentationAug(ornamentationAugtype))
{
const Item_Struct* ornamentItem;
const EQEmu::Item_Struct* ornamentItem;
ornamentItem = GetOrnamentationAug(ornamentationAugtype)->GetItem();
if (ornamentItem != nullptr)
{
@@ -1951,10 +1966,10 @@ bool ItemInst::UpdateOrnamentationInfo() {
return ornamentSet;
}
bool ItemInst::CanTransform(const Item_Struct *ItemToTry, const Item_Struct *Container, bool AllowAll) {
bool ItemInst::CanTransform(const EQEmu::Item_Struct *ItemToTry, const EQEmu::Item_Struct *Container, bool AllowAll) {
if (!ItemToTry || !Container) return false;
if (ItemToTry->ItemType == ItemTypeArrow || strnlen(Container->CharmFile, 30) == 0)
if (ItemToTry->ItemType == EQEmu::item::ItemTypeArrow || strnlen(Container->CharmFile, 30) == 0)
return false;
if (AllowAll && strncasecmp(Container->CharmFile, "ITEMTRANSFIGSHIELD", 18) && strncasecmp(Container->CharmFile, "ITEMTransfigBow", 15)) {
@@ -1999,7 +2014,7 @@ bool ItemInst::CanTransform(const Item_Struct *ItemToTry, const Item_Struct *Con
uint32 ItemInst::GetAugmentItemID(uint8 slot) const
{
if (!m_item || m_item->ItemClass != ItemClassCommon)
if (!m_item || !m_item->IsClassCommon())
return NO_ITEM;
return GetItemID(slot);
@@ -2008,7 +2023,7 @@ uint32 ItemInst::GetAugmentItemID(uint8 slot) const
// Add an augment to the item
void ItemInst::PutAugment(uint8 slot, const ItemInst& augment)
{
if (!m_item || m_item->ItemClass != ItemClassCommon)
if (!m_item || !m_item->IsClassCommon())
return;
PutItem(slot, augment);
@@ -2029,7 +2044,7 @@ void ItemInst::PutAugment(SharedDatabase *db, uint8 slot, uint32 item_id)
// Remove augment from item and destroy it
void ItemInst::DeleteAugment(uint8 index)
{
if (!m_item || m_item->ItemClass != ItemClassCommon)
if (!m_item || !m_item->IsClassCommon())
return;
DeleteItem(index);
@@ -2038,7 +2053,7 @@ void ItemInst::DeleteAugment(uint8 index)
// Remove augment from item and return it
ItemInst* ItemInst::RemoveAugment(uint8 index)
{
if (!m_item || m_item->ItemClass != ItemClassCommon)
if (!m_item || !m_item->IsClassCommon())
return nullptr;
return PopItem(index);
@@ -2046,7 +2061,7 @@ ItemInst* ItemInst::RemoveAugment(uint8 index)
bool ItemInst::IsAugmented()
{
if (!m_item || m_item->ItemClass != ItemClassCommon)
if (!m_item || !m_item->IsClassCommon())
return false;
for (int index = AUG_INDEX_BEGIN; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) {
@@ -2060,10 +2075,10 @@ bool ItemInst::IsAugmented()
// Has attack/delay?
bool ItemInst::IsWeapon() const
{
if (!m_item || m_item->ItemClass != ItemClassCommon)
if (!m_item || !m_item->IsClassCommon())
return false;
if (m_item->ItemType == ItemTypeArrow && m_item->Damage != 0)
if (m_item->ItemType == EQEmu::item::ItemTypeArrow && m_item->Damage != 0)
return true;
else
return ((m_item->Damage != 0) && (m_item->Delay != 0));
@@ -2074,9 +2089,9 @@ bool ItemInst::IsAmmo() const
if (!m_item)
return false;
if ((m_item->ItemType == ItemTypeArrow) ||
(m_item->ItemType == ItemTypeLargeThrowing) ||
(m_item->ItemType == ItemTypeSmallThrowing)
if ((m_item->ItemType == EQEmu::item::ItemTypeArrow) ||
(m_item->ItemType == EQEmu::item::ItemTypeLargeThrowing) ||
(m_item->ItemType == EQEmu::item::ItemTypeSmallThrowing)
) {
return true;
}
@@ -2085,7 +2100,7 @@ bool ItemInst::IsAmmo() const
}
const Item_Struct* ItemInst::GetItem() const
const EQEmu::Item_Struct* ItemInst::GetItem() const
{
if (!m_item)
return nullptr;
@@ -2096,7 +2111,7 @@ const Item_Struct* ItemInst::GetItem() const
return m_item;
}
const Item_Struct* ItemInst::GetUnscaledItem() const
const EQEmu::Item_Struct* ItemInst::GetUnscaledItem() const
{
// No operator calls and defaults to nullptr
return m_item;
@@ -2204,10 +2219,10 @@ void ItemInst::ScaleItem() {
return;
if (m_scaledItem) {
memcpy(m_scaledItem, m_item, sizeof(Item_Struct));
memcpy(m_scaledItem, m_item, sizeof(EQEmu::Item_Struct));
}
else {
m_scaledItem = new Item_Struct(*m_item);
m_scaledItem = new EQEmu::Item_Struct(*m_item);
}
float Mult = (float)(GetExp()) / 10000; // scaling is determined by exp, with 10,000 being full stats
@@ -3051,41 +3066,3 @@ EvolveInfo::EvolveInfo(uint32 first, uint8 max, bool allkills, uint32 L2, uint32
EvolveInfo::~EvolveInfo() {
}
//
// struct Item_Struct
//
bool Item_Struct::IsEquipable(uint16 Race, uint16 Class_) const
{
bool IsRace = false;
bool IsClass = false;
uint32 Classes_ = Classes;
uint32 Races_ = Races;
uint32 Race_ = GetPlayerRaceValue(Race);
for (int CurrentClass = 1; CurrentClass <= PLAYER_CLASS_COUNT; ++CurrentClass) {
if (Classes_ & 1) {
if (CurrentClass == Class_) {
IsClass = true;
break;
}
}
Classes_ >>= 1;
}
Race_ = (Race_ == 18 ? 16 : Race_);
for (unsigned int CurrentRace = 1; CurrentRace <= PLAYER_RACE_COUNT; ++CurrentRace) {
if (Races_ & 1) {
if (CurrentRace == Race_) {
IsRace = true;
break;
}
}
Races_ >>= 1;
}
return (IsRace && IsClass);
}
+27 -17
View File
@@ -1,5 +1,6 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.net)
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,15 +14,16 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 04111-1307 USA
*/
// @merth notes:
// These classes could be optimized with database reads/writes by storing
// a status flag indicating how object needs to interact with database
#ifndef __ITEM_H
#define __ITEM_H
#ifndef COMMON_ITEM_H
#define COMMON_ITEM_H
class ItemParse; // Parses item packets
class EvolveInfo; // Stores information about an evolving item family
@@ -173,7 +175,7 @@ public:
ItemInst* PopItem(int16 slot_id);
// Check whether there is space for the specified number of the specified item.
bool HasSpaceForItem(const Item_Struct *ItemToTry, int16 Quantity);
bool HasSpaceForItem(const EQEmu::Item_Struct *ItemToTry, int16 Quantity);
// Check whether item exists in inventory
// where argument specifies OR'd list of invWhere constants to look
@@ -198,7 +200,7 @@ public:
static int16 CalcSlotFromMaterial(uint8 material);
static uint8 CalcMaterialFromSlot(int16 equipslot);
static bool CanItemFitInContainer(const Item_Struct *ItemToTry, const Item_Struct *Container);
static bool CanItemFitInContainer(const EQEmu::Item_Struct *ItemToTry, const EQEmu::Item_Struct *Container);
// Test for valid inventory casting slot
bool SupportsClickCasting(int16 slot_id);
@@ -275,7 +277,7 @@ public:
/////////////////////////
// Constructors/Destructor
ItemInst(const Item_Struct* item = nullptr, int16 charges = 0);
ItemInst(const EQEmu::Item_Struct* item = nullptr, int16 charges = 0);
ItemInst(SharedDatabase *db, uint32 item_id, int16 charges = 0);
@@ -286,7 +288,15 @@ public:
~ItemInst();
// Query item type
bool IsType(ItemClassTypes item_class) const;
bool IsType(EQEmu::item::ItemClass item_class) const;
bool IsClassCommon();
bool IsClassBag();
bool IsClassBook();
bool IsClassCommon() const { return const_cast<ItemInst*>(this)->IsClassCommon(); }
bool IsClassBag() const { return const_cast<ItemInst*>(this)->IsClassBag(); }
bool IsClassBook() const { return const_cast<ItemInst*>(this)->IsClassBook(); }
// Can item be stacked?
bool IsStackable() const;
@@ -305,7 +315,7 @@ public:
bool IsAugmentSlotAvailable(int32 augtype, uint8 slot) const;
inline int32 GetAugmentType() const { return ((m_item) ? m_item->AugType : NO_ITEM); }
inline bool IsExpendable() const { return ((m_item) ? ((m_item->Click.Type == ET_Expendable ) || (m_item->ItemType == ItemTypePotion)) : false); }
inline bool IsExpendable() const { return ((m_item) ? ((m_item->Click.Type == EQEmu::item::ItemEffectExpendable) || (m_item->ItemType == EQEmu::item::ItemTypePotion)) : false); }
//
// Contents
@@ -336,7 +346,7 @@ public:
bool IsAugmented();
ItemInst* GetOrnamentationAug(int32 ornamentationAugtype) const;
bool UpdateOrnamentationInfo();
static bool CanTransform(const Item_Struct *ItemToTry, const Item_Struct *Container, bool AllowAll = false);
static bool CanTransform(const EQEmu::Item_Struct *ItemToTry, const EQEmu::Item_Struct *Container, bool AllowAll = false);
// Has attack/delay?
bool IsWeapon() const;
@@ -345,8 +355,8 @@ public:
// Accessors
const uint32 GetID() const { return ((m_item) ? m_item->ID : NO_ITEM); }
const uint32 GetItemScriptID() const { return ((m_item) ? m_item->ScriptFileID : NO_ITEM); }
const Item_Struct* GetItem() const;
const Item_Struct* GetUnscaledItem() const;
const EQEmu::Item_Struct* GetItem() const;
const EQEmu::Item_Struct* GetUnscaledItem() const;
int16 GetCharges() const { return m_charges; }
void SetCharges(int16 charges) { m_charges = charges; }
@@ -414,8 +424,8 @@ public:
int8 GetMaxEvolveLvl() const;
uint32 GetKillsNeeded(uint8 currentlevel);
std::string Serialize(int16 slot_id) const { InternalSerializedItem_Struct s; s.slot_id = slot_id; s.inst = (const void*)this; std::string ser; ser.assign((char*)&s, sizeof(InternalSerializedItem_Struct)); return ser; }
void Serialize(EQEmu::OutBuffer& ob, int16 slot_id) const { InternalSerializedItem_Struct isi; isi.slot_id = slot_id; isi.inst = (const void*)this; ob.write((const char*)&isi, sizeof(isi)); }
std::string Serialize(int16 slot_id) const { EQEmu::InternalSerializedItem_Struct s; s.slot_id = slot_id; s.inst = (const void*)this; std::string ser; ser.assign((char*)&s, sizeof(EQEmu::InternalSerializedItem_Struct)); return ser; }
void Serialize(EQEmu::OutBuffer& ob, int16 slot_id) const { EQEmu::InternalSerializedItem_Struct isi; isi.slot_id = slot_id; isi.inst = (const void*)this; ob.write((const char*)&isi, sizeof(isi)); }
inline int32 GetSerialNumber() const { return m_SerialNumber; }
inline void SetSerialNumber(int32 id) { m_SerialNumber = id; }
@@ -490,7 +500,7 @@ protected:
void _PutItem(uint8 index, ItemInst* inst) { m_contents[index] = inst; }
ItemInstTypes m_use_type; // Usage type for item
const Item_Struct* m_item; // Ptr to item data
const EQEmu::Item_Struct* m_item; // Ptr to item data
int16 m_charges; // # of charges for chargeable items
uint32 m_price; // Bazaar /trader price
uint32 m_color;
@@ -502,7 +512,7 @@ protected:
uint32 m_exp;
int8 m_evolveLvl;
bool m_activated;
Item_Struct* m_scaledItem;
EQEmu::Item_Struct* m_scaledItem;
EvolveInfo* m_evolveInfo;
bool m_scaling;
uint32 m_ornamenticon;
@@ -531,4 +541,4 @@ public:
~EvolveInfo();
};
#endif // #define __ITEM_H
#endif /*COMMON_ITEM_H*/
+209
View File
@@ -0,0 +1,209 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "item_struct.h"
#include "classes.h"
#include "races.h"
//#include "deity.h"
uint32 EQEmu::item::ConvertAugTypeToAugTypeBit(uint8 aug_type)
{
switch (aug_type) {
case AugTypeGeneralSingleStat:
return bit_AugTypeGeneralSingleStat;
case AugTypeGeneralMultipleStat:
return bit_AugTypeGeneralMultipleStat;
case AugTypeGeneralSpellEffect:
return bit_AugTypeGeneralSpellEffect;
case AugTypeWeaponGeneral:
return bit_AugTypeWeaponGeneral;
case AugTypeWeaponElemDamage:
return bit_AugTypeWeaponElemDamage;
case AugTypeWeaponBaseDamage:
return bit_AugTypeWeaponBaseDamage;
case AugTypeGeneralGroup:
return bit_AugTypeGeneralGroup;
case AugTypeGeneralRaid:
return bit_AugTypeGeneralRaid;
case AugTypeGeneralDragonsPoints:
return bit_AugTypeGeneralDragonsPoints;
case AugTypeCraftedCommon:
return bit_AugTypeCraftedCommon;
case AugTypeCraftedGroup1:
return bit_AugTypeCraftedGroup1;
case AugTypeCraftedRaid1:
return bit_AugTypeCraftedRaid1;
case AugTypeEnergeiacGroup:
return bit_AugTypeEnergeiacGroup;
case AugTypeEnergeiacRaid:
return bit_AugTypeEnergeiacRaid;
case AugTypeEmblem:
return bit_AugTypeEmblem;
case AugTypeCraftedGroup2:
return bit_AugTypeCraftedGroup2;
case AugTypeCraftedRaid2:
return bit_AugTypeCraftedRaid2;
case AugTypeUnknown1:
return bit_AugTypeUnknown1;
case AugTypeUnknown2:
return bit_AugTypeUnknown2;
case AugTypeOrnamentation:
return bit_AugTypeOrnamentation;
case AugTypeSpecialOrnamentation:
return bit_AugTypeSpecialOrnamentation;
case AugTypeUnknown3:
return bit_AugTypeUnknown3;
case AugTypeUnknown4:
return bit_AugTypeUnknown4;
case AugTypeUnknown5:
return bit_AugTypeUnknown5;
case AugTypeUnknown6:
return bit_AugTypeUnknown6;
case AugTypeUnknown7:
return bit_AugTypeUnknown7;
case AugTypeUnknown8:
return bit_AugTypeUnknown8;
case AugTypeUnknown9:
return bit_AugTypeUnknown9;
case AugTypeUnknown10:
return bit_AugTypeUnknown10;
case AugTypeEpic2_5:
return bit_AugTypeEpic2_5;
case AugTypeTest:
return bit_AugTypeTest;
case AugTypeAll:
return bit_AugTypeAll;
default:
return bit_AugTypeNone;
}
}
uint8 EQEmu::item::ConvertAugTypeBitToAugType(uint32 aug_type_bit)
{
switch (aug_type_bit) {
case bit_AugTypeGeneralSingleStat:
return AugTypeGeneralSingleStat;
case bit_AugTypeGeneralMultipleStat:
return AugTypeGeneralMultipleStat;
case bit_AugTypeGeneralSpellEffect:
return AugTypeGeneralSpellEffect;
case bit_AugTypeWeaponGeneral:
return AugTypeWeaponGeneral;
case bit_AugTypeWeaponElemDamage:
return AugTypeWeaponElemDamage;
case bit_AugTypeWeaponBaseDamage:
return AugTypeWeaponBaseDamage;
case bit_AugTypeGeneralGroup:
return AugTypeGeneralGroup;
case bit_AugTypeGeneralRaid:
return AugTypeGeneralRaid;
case bit_AugTypeGeneralDragonsPoints:
return AugTypeGeneralDragonsPoints;
case bit_AugTypeCraftedCommon:
return AugTypeCraftedCommon;
case bit_AugTypeCraftedGroup1:
return AugTypeCraftedGroup1;
case bit_AugTypeCraftedRaid1:
return AugTypeCraftedRaid1;
case bit_AugTypeEnergeiacGroup:
return AugTypeEnergeiacGroup;
case bit_AugTypeEnergeiacRaid:
return AugTypeEnergeiacRaid;
case bit_AugTypeEmblem:
return AugTypeEmblem;
case bit_AugTypeCraftedGroup2:
return AugTypeCraftedGroup2;
case bit_AugTypeCraftedRaid2:
return AugTypeCraftedRaid2;
case bit_AugTypeUnknown1:
return AugTypeUnknown1;
case bit_AugTypeUnknown2:
return AugTypeUnknown2;
case bit_AugTypeOrnamentation:
return AugTypeOrnamentation;
case bit_AugTypeSpecialOrnamentation:
return AugTypeSpecialOrnamentation;
case bit_AugTypeUnknown3:
return AugTypeUnknown3;
case bit_AugTypeUnknown4:
return AugTypeUnknown4;
case bit_AugTypeUnknown5:
return AugTypeUnknown5;
case bit_AugTypeUnknown6:
return AugTypeUnknown6;
case bit_AugTypeUnknown7:
return AugTypeUnknown7;
case bit_AugTypeUnknown8:
return AugTypeUnknown8;
case bit_AugTypeUnknown9:
return AugTypeUnknown9;
case bit_AugTypeUnknown10:
return AugTypeUnknown10;
case bit_AugTypeEpic2_5:
return AugTypeEpic2_5;
case bit_AugTypeTest:
return AugTypeTest;
case bit_AugTypeAll:
return AugTypeAll;
default:
return AugTypeNone;
}
}
bool EQEmu::Item_Struct::IsEquipable(uint16 race_id, uint16 class_id)
{
if (!(Races & GetPlayerRaceBit(GetPlayerRaceValue(race_id))))
return false;
if (!(Classes & GetPlayerClassBit(GetPlayerClassValue(class_id))))
return false;
return true;
}
bool EQEmu::Item_Struct::IsClassCommon()
{
return (ItemClass == item::ItemClassCommon);
}
bool EQEmu::Item_Struct::IsClassBag()
{
return (ItemClass == item::ItemClassBag);
}
bool EQEmu::Item_Struct::IsClassBook()
{
return (ItemClass == item::ItemClassBook);
}
bool EQEmu::Item_Struct::IsType1HWeapon()
{
return ((ItemType == item::ItemType1HBlunt) || (ItemType == item::ItemType1HSlash) || (ItemType == item::ItemType1HPiercing));
}
bool EQEmu::Item_Struct::IsType2HWeapon()
{
return ((ItemType == item::ItemType2HBlunt) || (ItemType == item::ItemType2HSlash) || (ItemType == item::ItemType2HPiercing));
}
bool EQEmu::Item_Struct::IsTypeShield()
{
return (ItemType == item::ItemTypeShield);
}
+508 -197
View File
@@ -1,4 +1,5 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
@@ -13,11 +14,12 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 04111-1307 USA
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 04111-1307 USA
*/
#ifndef ITEM_STRUCT_H
#define ITEM_STRUCT_H
#ifndef COMMON_ITEM_STRUCT_H
#define COMMON_ITEM_STRUCT_H
/*
* Note: (Doodman)
@@ -44,211 +46,520 @@
#include "emu_constants.h"
namespace EQEmu
{
namespace item {
enum ItemAttributeBit : uint32 {
bit_ItemAttributeNone = 0x00000000,
bit_ItemAttributeLore = 0x00000001,
bit_ItemAttributeArtifact = 0x00000002,
bit_ItemAttributeSummoned = 0x00000004,
bit_ItemAttributeMagic = 0x00000008,
bit_ItemAttributeAugment = 0x00000010,
bit_ItemAttributePendingLore = 0x00000020,
bit_ItemAttributeUnknown = 0xFFFFFFFF
};
enum ItemClass {
ItemClassCommon = 0,
ItemClassBag,
ItemClassBook,
ItemClassCount
};
enum ItemType : uint8 {
/*9138*/ ItemType1HSlash = 0,
/*9141*/ ItemType2HSlash,
/*9140*/ ItemType1HPiercing,
/*9139*/ ItemType1HBlunt,
/*9142*/ ItemType2HBlunt,
/*5504*/ ItemTypeBow, // 5
/*----*/ ItemTypeUnknown1,
/*----*/ ItemTypeLargeThrowing,
/*5505*/ ItemTypeShield,
/*5506*/ ItemTypeScroll,
/*5507*/ ItemTypeArmor, // 10
/*5508*/ ItemTypeMisc, // a lot of random crap has this item use.
/*7564*/ ItemTypeLockPick,
/*----*/ ItemTypeUnknown2,
/*5509*/ ItemTypeFood,
/*5510*/ ItemTypeDrink, // 15
/*5511*/ ItemTypeLight,
/*5512*/ ItemTypeCombinable, // not all stackable items are this use...
/*5513*/ ItemTypeBandage,
/*----*/ ItemTypeSmallThrowing,
/*----*/ ItemTypeSpell, // 20 // spells and tomes
/*5514*/ ItemTypePotion,
/*----*/ ItemTypeUnknown3,
/*0406*/ ItemTypeWindInstrument,
/*0407*/ ItemTypeStringedInstrument,
/*0408*/ ItemTypeBrassInstrument, // 25
/*0405*/ ItemTypePercussionInstrument,
/*5515*/ ItemTypeArrow,
/*----*/ ItemTypeUnknown4,
/*5521*/ ItemTypeJewelry,
/*----*/ ItemTypeSkull, // 30
/*5516*/ ItemTypeBook, // skill-up tomes/books? (would probably need a pp flag if true...)
/*5517*/ ItemTypeNote,
/*5518*/ ItemTypeKey,
/*----*/ ItemTypeCoin,
/*5520*/ ItemType2HPiercing, // 35
/*----*/ ItemTypeFishingPole,
/*----*/ ItemTypeFishingBait,
/*5519*/ ItemTypeAlcohol,
/*----*/ ItemTypeKey2, // keys and satchels?? (questable keys?)
/*----*/ ItemTypeCompass, // 40
/*----*/ ItemTypeUnknown5,
/*----*/ ItemTypePoison, // might be wrong, but includes poisons
/*----*/ ItemTypeUnknown6,
/*----*/ ItemTypeUnknown7,
/*5522*/ ItemTypeMartial, // 45
/*----*/ ItemTypeUnknown8,
/*----*/ ItemTypeUnknown9,
/*----*/ ItemTypeUnknown10,
/*----*/ ItemTypeUnknown11,
/*----*/ ItemTypeSinging, // 50
/*5750*/ ItemTypeAllInstrumentTypes,
/*5776*/ ItemTypeCharm,
/*----*/ ItemTypeDye,
/*----*/ ItemTypeAugmentation,
/*----*/ ItemTypeAugmentationSolvent, // 55
/*----*/ ItemTypeAugmentationDistiller,
/*----*/ ItemTypeUnknown12,
/*----*/ ItemTypeFellowshipKit,
/*----*/ ItemTypeUnknown13,
/*----*/ ItemTypeRecipe, // 60
/*----*/ ItemTypeAdvancedRecipe,
/*----*/ ItemTypeJournal, // only one(1) database entry
/*----*/ ItemTypeAltCurrency, // alt-currency (as opposed to coinage)
/*5881*/ ItemTypePerfectedAugmentationDistiller,
/*----*/ ItemTypeCount
/*
** Child struct of Item_Struct:
** Effect data: Click, Proc, Focus, Worn, Scroll
**
Unknowns:
Mounts?
Ornamentations?
GuildBanners?
Collectible?
Placeable?
(others?)
*/
struct ItemEffect_Struct {
int32 Effect;
uint8 Type;
uint8 Level;
uint8 Level2;
//MaxCharges
//CastTime
//RecastDelay
//RecastType
//ProcRate
};
};
class ItemInst;
enum AugTypeBit : uint32 {
bit_AugTypeNone = 0x00000000,
bit_AugTypeGeneralSingleStat = 0x00000001, /*1^16^1 (General: Single Stat)^0*/
bit_AugTypeGeneralMultipleStat = 0x00000002, /*2^16^2 (General: Multiple Stat)^0*/
bit_AugTypeGeneralSpellEffect = 0x00000004, /*3^16^3 (General: Spell Effect)^0*/
bit_AugTypeWeaponGeneral = 0x00000008, /*4^16^4 (Weapon: General)^0*/
bit_AugTypeWeaponElemDamage = 0x00000010, /*5^16^5 (Weapon: Elem Damage)^0*/
bit_AugTypeWeaponBaseDamage = 0x00000020, /*6^16^6 (Weapon: Base Damage)^0*/
bit_AugTypeGeneralGroup = 0x00000040, /*7^16^7 (General: Group)^0*/
bit_AugTypeGeneralRaid = 0x00000080, /*8^16^8 (General: Raid)^0*/
bit_AugTypeGeneralDragonsPoints = 0x00000100, /*9^16^9 (General: Dragons Points)^0*/
bit_AugTypeCraftedCommon = 0x00000200, /*10^16^10 (Crafted: Common)^0*/
bit_AugTypeCraftedGroup1 = 0x00000400, /*11^16^11 (Crafted: Group)^0*/
bit_AugTypeCraftedRaid1 = 0x00000800, /*12^16^12 (Crafted: Raid)^0*/
bit_AugTypeEnergeiacGroup = 0x00001000, /*13^16^13 (Energeiac: Group)^0*/
bit_AugTypeEnergeiacRaid = 0x00002000, /*14^16^14 (Energeiac: Raid)^0*/
bit_AugTypeEmblem = 0x00004000, /*15^16^15 (Emblem)^0*/
bit_AugTypeCraftedGroup2 = 0x00008000, /*16^16^16 (Crafted: Group)^0*/
bit_AugTypeCraftedRaid2 = 0x00010000, /*17^16^17 (Crafted: Raid)^0*/
bit_AugTypeUnknown1 = 0x00020000, /*18^16^18^0*/
bit_AugTypeUnknown2 = 0x00040000, /*19^16^19^0*/
bit_AugTypeOrnamentation = 0x00080000, /*20^16^20 (Ornamentation)^0*/
bit_AugTypeSpecialOrnamentation = 0x00100000, /*21^16^21 (Special Ornamentation)^0*/
bit_AugTypeUnknown3 = 0x00200000, /*22^16^22^0*/
bit_AugTypeUnknown4 = 0x00400000, /*23^16^23^0*/
bit_AugTypeUnknown5 = 0x00800000, /*24^16^24^0*/
bit_AugTypeUnknown6 = 0x01000000, /*25^16^25^0*/
bit_AugTypeUnknown7 = 0x02000000, /*26^16^26^0*/
bit_AugTypeUnknown8 = 0x04000000, /*27^16^27^0*/
bit_AugTypeUnknown9 = 0x08000000, /*28^16^28^0*/
bit_AugTypeUnknown10 = 0x10000000, /*29^16^29^0*/
bit_AugTypeEpic2_5 = 0x20000000, /*30^16^30^0*/
bit_AugTypeTest = 0x40000000, /*31^16^Test^0*/ // listed as 31^16^31^0 in 5-10 client
bit_AugTypeAll = 0xFFFFFFFF
};
struct InternalSerializedItem_Struct {
int16 slot_id;
const void * inst;
};
enum AugType : uint8 {
AugTypeNone = 0,
AugTypeGeneralSingleStat,
AugTypeGeneralMultipleStat,
AugTypeGeneralSpellEffect,
AugTypeWeaponGeneral,
AugTypeWeaponElemDamage, // 5
AugTypeWeaponBaseDamage,
AugTypeGeneralGroup,
AugTypeGeneralRaid,
AugTypeGeneralDragonsPoints,
AugTypeCraftedCommon, // 10
AugTypeCraftedGroup1,
AugTypeCraftedRaid1,
AugTypeEnergeiacGroup,
AugTypeEnergeiacRaid,
AugTypeEmblem, // 15
AugTypeCraftedGroup2,
AugTypeCraftedRaid2,
AugTypeUnknown1,
AugTypeUnknown2,
AugTypeOrnamentation, // 20
AugTypeSpecialOrnamentation,
AugTypeUnknown3,
AugTypeUnknown4,
AugTypeUnknown5,
AugTypeUnknown6, // 25
AugTypeUnknown7,
AugTypeUnknown8,
AugTypeUnknown9,
AugTypeUnknown10,
AugTypeEpic2_5, // 30
AugTypeTest,
AugTypeCount,
AugTypeAll = 255
};
// use EmuConstants::ITEM_COMMON_SIZE
//#define MAX_AUGMENT_SLOTS 5
enum AugRestriction : uint8 {
/*4690*/ AugRestrictionAny = 0,
/*9134*/ AugRestrictionArmor,
/*9135*/ AugRestrictionWeapons,
/*9136*/ AugRestriction1HWeapons,
/*9137*/ AugRestriction2HWeapons,
/*9138*/ AugRestriction1HSlash, // 5
/*9139*/ AugRestriction1HBlunt,
/*9140*/ AugRestrictionPiercing,
/*9148*/ AugRestrictionHandToHand,
/*9141*/ AugRestriction2HSlash,
/*9142*/ AugRestriction2HBlunt, // 10
/*9143*/ AugRestriction2HPierce,
/*9144*/ AugRestrictionBows,
/*9145*/ AugRestrictionShields,
/*8052*/ AugRestriction1HSlash1HBluntOrHandToHand,
/*9200*/ AugRestriction1HBluntOrHandToHand, // 15 // no listed peq entries
struct Item_Struct {
bool IsEquipable(uint16 Race, uint16 Class) const;
// Non packet based fields
uint8 MinStatus;
// these three appear to be post-RoF (12-10-2012) and can not be verified until RoF (05-10-2013) is supported
/*????*/ AugRestrictionUnknown1,
/*????*/ AugRestrictionUnknown2,
/*????*/ AugRestrictionUnknown3, // last value in peq entries
AugRestrictionCount
// Packet based fields
uint8 ItemClass; // Item Type: 0=common, 1=container, 2=book
char Name[64]; // Name
char Lore[80]; // Lore Name: *=lore, &=summoned, #=artifact, ~=pending lore
char IDFile[30]; // Visible model
uint32 ID; // Unique ID (also PK for DB)
int32 Weight; // Item weight * 10
uint8 NoRent; // No Rent: 0=norent, 255=not norent
uint8 NoDrop; // No Drop: 0=nodrop, 255=not nodrop
uint8 Size; // Size: 0=tiny, 1=small, 2=medium, 3=large, 4=giant
uint32 Slots; // Bitfield for which slots this item can be used in
uint32 Price; // Item cost (?)
uint32 Icon; // Icon Number
uint32 LoreGroup; // Later items use LoreGroup instead of LoreFlag. we might want to see about changing this to int32 since it is commonly -1 and is constantly being cast from signed (-1) to unsigned (4294967295)
bool LoreFlag; // This will be true if LoreGroup is non-zero
bool PendingLoreFlag;
bool ArtifactFlag;
bool SummonedFlag;
uint8 FVNoDrop; // Firiona Vie nodrop flag
uint32 Favor; // Individual favor
uint32 GuildFavor; // Guild favor
uint32 PointType;
/*4687*/ //AugTypeAllItems, // ?? unknown atm
/*4688*/ //AugTypePrestige, // ?? unknown atm
/*4689*/ //AugTypeNonPrestige, // ?? unknown atm
};
//uint32 Unk117;
//uint32 Unk118;
//uint32 Unk121;
//uint32 Unk124;
enum BagType : uint8 {
/*3400*/ BagTypeSmallBag = 0,
/*3401*/ BagTypeLargeBag,
/*3402*/ BagTypeQuiver,
/*3403*/ BagTypeBeltPouch,
/*3404*/ BagTypeWristPouch,
/*3405*/ BagTypeBackPack, // 5
/*3406*/ BagTypeSmallChest,
/*3407*/ BagTypeLargeChest,
/*----*/ BagTypeBandolier, // <*Database Reference Only>
/*3408*/ BagTypeMedicineBag,
/*3409*/ BagTypeToolBox, // 10
/*3410*/ BagTypeLexicon,
/*3411*/ BagTypeMortar,
/*3412*/ BagTypeSelfDusting, // Quest container (Auto-clear contents?)
/*3413*/ BagTypeMixingBowl,
/*3414*/ BagTypeOven, // 15
/*3415*/ BagTypeSewingKit,
/*3416*/ BagTypeForge,
/*3417*/ BagTypeFletchingKit,
/*3418*/ BagTypeBrewBarrel,
/*3419*/ BagTypeJewelersKit, // 20
/*3420*/ BagTypePotteryWheel,
/*3421*/ BagTypeKiln,
/*3422*/ BagTypeKeymaker, // (no database entries as of peq rev 69)
/*3423*/ BagTypeWizardsLexicon,
/*3424*/ BagTypeMagesLexicon, // 25
/*3425*/ BagTypeNecromancersLexicon,
/*3426*/ BagTypeEnchantersLexicon,
/*----*/ BagTypeUnknown1, // (a coin pouch/purse?) (no database entries as of peq rev 69)
/*----*/ BagTypeConcordanceofResearch, // <*Database Reference Only>
/*3427*/ BagTypeAlwaysWorks, // 30 // Quest container (Never-fail combines?)
/*3428*/ BagTypeKoadaDalForge, // High Elf
/*3429*/ BagTypeTeirDalForge, // Dark Elf
/*3430*/ BagTypeOggokForge, // Ogre
/*3431*/ BagTypeStormguardForge, // Dwarf
/*3432*/ BagTypeAkanonForge, // 35 // Gnome
/*3433*/ BagTypeNorthmanForge, // Barbarian
/*----*/ BagTypeUnknown2, // (no database entries as of peq rev 69)
/*3434*/ BagTypeCabilisForge, // Iksar
/*3435*/ BagTypeFreeportForge, // Human 1
/*3436*/ BagTypeRoyalQeynosForge, // 40 // Human 2
/*3439*/ BagTypeHalflingTailoringKit,
/*3438*/ BagTypeErudTailoringKit,
/*3440*/ BagTypeFierDalTailoringKit, // Wood Elf
/*3441*/ BagTypeFierDalFletchingKit, // Wood Elf
/*3437*/ BagTypeIksarPotteryWheel, // 45
/*3442*/ BagTypeTackleBox,
/*3443*/ BagTypeTrollForge,
/*3445*/ BagTypeFierDalForge, // Wood Elf
/*3444*/ BagTypeValeForge, // Halfling
/*3446*/ BagTypeErudForge, // 50
/*----*/ BagTypeTradersSatchel, // <*Database Reference Only> (db: Yellow Trader's Satchel Token?)
/*5785*/ BagTypeGuktaForge, // Froglok (no database entries as of peq rev 69)
/*3359*/ BagTypeAugmentationSealer,
/*----*/ BagTypeIceCreamChurn, // <*Database Reference Only>
/*6325*/ BagTypeTransformationmold, // 55 // Ornamentation
/*6340*/ BagTypeDetransformationmold, // Ornamentation Stripper
/*5400*/ BagTypeUnattuner,
/*7684*/ BagTypeTradeskillBag,
/*7692*/ BagTypeCollectibleBag,
/*----*/ BagTypeCount
};
uint8 BagType; // 0:Small Bag, 1:Large Bag, 2:Quiver, 3:Belt Pouch ... there are 50 types
uint8 BagSlots; // Number of slots: can only be 2, 4, 6, 8, or 10
uint8 BagSize; // 0:TINY, 1:SMALL, 2:MEDIUM, 3:LARGE, 4:GIANT
uint8 BagWR; // 0->100
enum ItemEffect {
ItemEffectCombatProc = 0,
ItemEffectClick,
ItemEffectWorn,
ItemEffectExpendable,
ItemEffectEquipClick,
ItemEffectClick2, //5 //name unknown
ItemEffectFocus,
ItemEffectScroll,
ItemEffectCount
};
bool BenefitFlag;
bool Tradeskills; // Is this a tradeskill item?
int8 CR; // Save vs Cold
int8 DR; // Save vs Disease
int8 PR; // Save vs Poison
int8 MR; // Save vs Magic
int8 FR; // Save vs Fire
int8 AStr; // Strength
int8 ASta; // Stamina
int8 AAgi; // Agility
int8 ADex; // Dexterity
int8 ACha; // Charisma
int8 AInt; // Intelligence
int8 AWis; // Wisdom
int32 HP; // HP
int32 Mana; // Mana
int32 AC; // AC
uint32 Deity; // Bitmask of Deities that can equip this item
//uint32 Unk033
int32 SkillModValue; // % Mod to skill specified in SkillModType
int32 SkillModMax; // Max skill point modification
uint32 SkillModType; // Type of skill for SkillModValue to apply to
uint32 BaneDmgRace; // Bane Damage Race
int8 BaneDmgAmt; // Bane Damage Body Amount
uint32 BaneDmgBody; // Bane Damage Body
bool Magic; // True=Magic Item, False=not
int32 CastTime_;
uint8 ReqLevel; // Required Level to use item
uint32 BardType; // Bard Skill Type
int32 BardValue; // Bard Skill Amount
int8 Light; // Light
uint8 Delay; // Delay * 10
uint8 RecLevel; // Recommended level to use item
uint8 RecSkill; // Recommended skill to use item (refers to primary skill of item)
uint8 ElemDmgType; // Elemental Damage Type (1=magic, 2=fire)
uint8 ElemDmgAmt; // Elemental Damage
uint8 Range; // Range of item
uint32 Damage; // Delay between item usage (in 0.1 sec increments)
uint32 Color; // RR GG BB 00 <-- as it appears in pc
uint32 Classes; // Bitfield of classes that can equip item (1 << class#)
uint32 Races; // Bitfield of races that can equip item (1 << race#)
//uint32 Unk054;
int16 MaxCharges; // Maximum charges items can hold: -1 if not a chargeable item
uint8 ItemType; // Item Type/Skill (itemClass* from above)
uint8 Material; // Item material type
uint32 HerosForgeModel;// Hero's Forge Armor Model Type (2-13?)
float SellRate; // Sell rate
//uint32 Unk059;
union {
uint32 Fulfilment; // Food fulfilment (How long it lasts)
uint32 CastTime; // Cast Time for clicky effects, in milliseconds
enum ItemSize : uint8 {
ItemSizeTiny = 0,
ItemSizeSmall,
ItemSizeMedium,
ItemSizeLarge,
ItemSizeGiant,
ItemSizeCount
};
enum ItemDataType : uint8 {
ItemDataTypeBase = 0,
ItemDataTypeScaling,
ItemDataTypeEvolving,
ItemDataTypeCount
};
struct ItemEffect_Struct {
int16 Effect;
uint8 Type;
uint8 Level;
uint8 Level2;
//MaxCharges
//CastTime
//RecastDelay
//RecastType
//ProcRate
};
extern uint32 ConvertAugTypeToAugTypeBit(uint8 aug_type);
extern uint8 ConvertAugTypeBitToAugType(uint32 aug_type_bit);
} /*item*/
struct InternalSerializedItem_Struct {
int16 slot_id;
const void * inst;
};
uint32 EliteMaterial;
int32 ProcRate;
int8 CombatEffects; // PoP: Combat Effects +
int8 Shielding; // PoP: Shielding %
int8 StunResist; // PoP: Stun Resist %
int8 StrikeThrough; // PoP: Strike Through %
uint32 ExtraDmgSkill;
uint32 ExtraDmgAmt;
int8 SpellShield; // PoP: Spell Shield %
int8 Avoidance; // PoP: Avoidance +
int8 Accuracy; // PoP: Accuracy +
uint32 CharmFileID;
int32 FactionMod1; // Faction Mod 1
int32 FactionMod2; // Faction Mod 2
int32 FactionMod3; // Faction Mod 3
int32 FactionMod4; // Faction Mod 4
int32 FactionAmt1; // Faction Amt 1
int32 FactionAmt2; // Faction Amt 2
int32 FactionAmt3; // Faction Amt 3
int32 FactionAmt4; // Faction Amt 4
char CharmFile[32]; // ?
uint32 AugType;
uint8 AugSlotType[EQEmu::legacy::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Type
uint8 AugSlotVisible[EQEmu::legacy::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Visible
uint8 AugSlotUnk2[EQEmu::legacy::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Unknown Most likely Powersource related
uint32 LDoNTheme;
uint32 LDoNPrice;
uint32 LDoNSold;
uint32 BaneDmgRaceAmt;
uint32 AugRestrict;
uint32 Endur;
uint32 DotShielding;
uint32 Attack;
uint32 Regen;
uint32 ManaRegen;
uint32 EnduranceRegen;
uint32 Haste;
uint32 DamageShield;
uint32 RecastDelay;
uint32 RecastType;
uint32 AugDistiller;
bool Attuneable;
bool NoPet;
bool PotionBelt;
bool Stackable;
bool NoTransfer;
bool QuestItemFlag;
int16 StackSize;
uint8 PotionBeltSlots;
ItemEffect_Struct Click, Proc, Worn, Focus, Scroll, Bard;
uint8 Book; // 0=Not book, 1=Book
uint32 BookType;
char Filename[33]; // Filename for book data
// Begin SoF Fields
int32 SVCorruption;
uint32 Purity;
uint8 EvolvingItem;
uint32 EvolvingID;
uint8 EvolvingLevel;
uint8 EvolvingMax;
uint32 BackstabDmg;
uint32 DSMitigation;
int32 HeroicStr;
int32 HeroicInt;
int32 HeroicWis;
int32 HeroicAgi;
int32 HeroicDex;
int32 HeroicSta;
int32 HeroicCha;
int32 HeroicMR;
int32 HeroicFR;
int32 HeroicCR;
int32 HeroicDR;
int32 HeroicPR;
int32 HeroicSVCorrup;
int32 HealAmt;
int32 SpellDmg;
uint32 LDoNSellBackRate;
uint32 ScriptFileID;
uint16 ExpendableArrow;
uint32 Clairvoyance;
char ClickName[65];
char ProcName[65];
char WornName[65];
char FocusName[65];
char ScrollName[65];
struct Item_Struct {
// Non packet based fields
uint8 MinStatus;
//uint8 ItemDataType;
};
// Packet based fields
uint8 ItemClass; // Item Type: 0=common, 1=container, 2=book
char Name[64]; // Name
char Lore[80]; // Lore Name: *=lore, &=summoned, #=artifact, ~=pending lore
char IDFile[30]; // Visible model
uint32 ID; // Unique ID (also PK for DB)
int32 Weight; // Item weight * 10
uint8 NoRent; // No Rent: 0=norent, 255=not norent
uint8 NoDrop; // No Drop: 0=nodrop, 255=not nodrop
uint8 Size; // Size: 0=tiny, 1=small, 2=medium, 3=large, 4=giant
uint32 Slots; // Bitfield for which slots this item can be used in
uint32 Price; // Item cost (?)
uint32 Icon; // Icon Number
uint32 LoreGroup; // Later items use LoreGroup instead of LoreFlag. we might want to see about changing this to int32 since it is commonly -1 and is constantly being cast from signed (-1) to unsigned (4294967295)
bool LoreFlag; // This will be true if LoreGroup is non-zero
bool PendingLoreFlag;
bool ArtifactFlag;
bool SummonedFlag;
uint8 FVNoDrop; // Firiona Vie nodrop flag
uint32 Favor; // Individual favor
uint32 GuildFavor; // Guild favor
uint32 PointType;
#endif
//uint32 Unk117;
//uint32 Unk118;
//uint32 Unk121;
//uint32 Unk124;
uint8 BagType; // 0:Small Bag, 1:Large Bag, 2:Quiver, 3:Belt Pouch ... there are 50 types
uint8 BagSlots; // Number of slots: can only be 2, 4, 6, 8, or 10
uint8 BagSize; // 0:TINY, 1:SMALL, 2:MEDIUM, 3:LARGE, 4:GIANT
uint8 BagWR; // 0->100
bool BenefitFlag;
bool Tradeskills; // Is this a tradeskill item?
int8 CR; // Save vs Cold
int8 DR; // Save vs Disease
int8 PR; // Save vs Poison
int8 MR; // Save vs Magic
int8 FR; // Save vs Fire
int8 AStr; // Strength
int8 ASta; // Stamina
int8 AAgi; // Agility
int8 ADex; // Dexterity
int8 ACha; // Charisma
int8 AInt; // Intelligence
int8 AWis; // Wisdom
int32 HP; // HP
int32 Mana; // Mana
int32 AC; // AC
uint32 Deity; // Bitmask of Deities that can equip this item
//uint32 Unk033
int32 SkillModValue; // % Mod to skill specified in SkillModType
int32 SkillModMax; // Max skill point modification
uint32 SkillModType; // Type of skill for SkillModValue to apply to
uint32 BaneDmgRace; // Bane Damage Race
int8 BaneDmgAmt; // Bane Damage Body Amount
uint32 BaneDmgBody; // Bane Damage Body
bool Magic; // True=Magic Item, False=not
int32 CastTime_;
uint8 ReqLevel; // Required Level to use item
uint32 BardType; // Bard Skill Type
int32 BardValue; // Bard Skill Amount
int8 Light; // Light
uint8 Delay; // Delay * 10
uint8 RecLevel; // Recommended level to use item
uint8 RecSkill; // Recommended skill to use item (refers to primary skill of item)
uint8 ElemDmgType; // Elemental Damage Type (1=magic, 2=fire)
uint8 ElemDmgAmt; // Elemental Damage
uint8 Range; // Range of item
uint32 Damage; // Delay between item usage (in 0.1 sec increments)
uint32 Color; // RR GG BB 00 <-- as it appears in pc
uint32 Classes; // Bitfield of classes that can equip item (1 << class#)
uint32 Races; // Bitfield of races that can equip item (1 << race#)
//uint32 Unk054;
int16 MaxCharges; // Maximum charges items can hold: -1 if not a chargeable item
uint8 ItemType; // Item Type/Skill (itemClass* from above)
uint8 Material; // Item material type
uint32 HerosForgeModel;// Hero's Forge Armor Model Type (2-13?)
float SellRate; // Sell rate
//uint32 Unk059;
union {
uint32 Fulfilment; // Food fulfilment (How long it lasts)
uint32 CastTime; // Cast Time for clicky effects, in milliseconds
};
uint32 EliteMaterial;
int32 ProcRate;
int8 CombatEffects; // PoP: Combat Effects +
int8 Shielding; // PoP: Shielding %
int8 StunResist; // PoP: Stun Resist %
int8 StrikeThrough; // PoP: Strike Through %
uint32 ExtraDmgSkill;
uint32 ExtraDmgAmt;
int8 SpellShield; // PoP: Spell Shield %
int8 Avoidance; // PoP: Avoidance +
int8 Accuracy; // PoP: Accuracy +
uint32 CharmFileID;
int32 FactionMod1; // Faction Mod 1
int32 FactionMod2; // Faction Mod 2
int32 FactionMod3; // Faction Mod 3
int32 FactionMod4; // Faction Mod 4
int32 FactionAmt1; // Faction Amt 1
int32 FactionAmt2; // Faction Amt 2
int32 FactionAmt3; // Faction Amt 3
int32 FactionAmt4; // Faction Amt 4
char CharmFile[32]; // ?
uint32 AugType;
uint8 AugSlotType[EQEmu::legacy::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Type
uint8 AugSlotVisible[EQEmu::legacy::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Visible
uint8 AugSlotUnk2[EQEmu::legacy::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Unknown Most likely Powersource related
uint32 LDoNTheme;
uint32 LDoNPrice;
uint32 LDoNSold;
uint32 BaneDmgRaceAmt;
uint32 AugRestrict;
uint32 Endur;
uint32 DotShielding;
uint32 Attack;
uint32 Regen;
uint32 ManaRegen;
uint32 EnduranceRegen;
uint32 Haste;
uint32 DamageShield;
uint32 RecastDelay;
uint32 RecastType;
uint32 AugDistiller;
bool Attuneable;
bool NoPet;
bool PotionBelt;
bool Stackable;
bool NoTransfer;
bool QuestItemFlag;
int16 StackSize;
uint8 PotionBeltSlots;
item::ItemEffect_Struct Click, Proc, Worn, Focus, Scroll, Bard;
uint8 Book; // 0=Not book, 1=Book
uint32 BookType;
char Filename[33]; // Filename for book data
// Begin SoF Fields
int32 SVCorruption;
uint32 Purity;
uint8 EvolvingItem;
uint32 EvolvingID;
uint8 EvolvingLevel;
uint8 EvolvingMax;
uint32 BackstabDmg;
uint32 DSMitigation;
int32 HeroicStr;
int32 HeroicInt;
int32 HeroicWis;
int32 HeroicAgi;
int32 HeroicDex;
int32 HeroicSta;
int32 HeroicCha;
int32 HeroicMR;
int32 HeroicFR;
int32 HeroicCR;
int32 HeroicDR;
int32 HeroicPR;
int32 HeroicSVCorrup;
int32 HealAmt;
int32 SpellDmg;
uint32 LDoNSellBackRate;
uint32 ScriptFileID;
uint16 ExpendableArrow;
uint32 Clairvoyance;
char ClickName[65];
char ProcName[65];
char WornName[65];
char FocusName[65];
char ScrollName[65];
//BardName
bool IsEquipable(uint16 Race, uint16 Class);
bool IsClassCommon();
bool IsClassBag();
bool IsClassBook();
bool IsType1HWeapon();
bool IsType2HWeapon();
bool IsTypeShield();
bool IsEquipable(uint16 Race, uint16 Class) const { return const_cast<Item_Struct*>(this)->IsEquipable(Race, Class); }
bool IsClassCommon() const { return const_cast<Item_Struct*>(this)->IsClassCommon(); }
bool IsClassBag() const { return const_cast<Item_Struct*>(this)->IsClassBag(); }
bool IsClassBook() const { return const_cast<Item_Struct*>(this)->IsClassBook(); }
bool IsType1HWeapon() const { return const_cast<Item_Struct*>(this)->IsType1HWeapon(); }
bool IsType2HWeapon() const { return const_cast<Item_Struct*>(this)->IsType2HWeapon(); }
bool IsTypeShield() const { return const_cast<Item_Struct*>(this)->IsTypeShield(); }
};
} /*EQEmu*/
#endif /*COMMON_ITEM_STRUCT_H*/
+6 -6
View File
@@ -566,16 +566,16 @@ namespace RoF
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
int item_count = in->size / sizeof(InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) {
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct));
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
delete in;
return;
}
InternalSerializedItem_Struct* eq = (InternalSerializedItem_Struct*)in->pBuffer;
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
@@ -1510,7 +1510,7 @@ namespace RoF
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
InternalSerializedItem_Struct* int_struct = (InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::InternalSerializedItem_Struct* int_struct = (EQEmu::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
@@ -5193,7 +5193,7 @@ namespace RoF
void SerializeItem(EQEmu::OutBuffer& ob, const ItemInst *inst, int16 slot_id_in, uint8 depth)
{
const Item_Struct *item = inst->GetUnscaledItem();
const EQEmu::Item_Struct *item = inst->GetUnscaledItem();
RoF::structs::ItemSerializationHeader hdr;
+6 -6
View File
@@ -637,16 +637,16 @@ namespace RoF2
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
int item_count = in->size / sizeof(InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) {
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct));
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
delete in;
return;
}
InternalSerializedItem_Struct* eq = (InternalSerializedItem_Struct*)in->pBuffer;
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
@@ -1582,7 +1582,7 @@ namespace RoF2
uchar* __emu_buffer = in->pBuffer;
ItemPacket_Struct* old_item_pkt = (ItemPacket_Struct*)__emu_buffer;
InternalSerializedItem_Struct* int_struct = (InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::InternalSerializedItem_Struct* int_struct = (EQEmu::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
@@ -5465,7 +5465,7 @@ namespace RoF2
void SerializeItem(EQEmu::OutBuffer& ob, const ItemInst *inst, int16 slot_id_in, uint8 depth, ItemPacketType packet_type)
{
const Item_Struct *item = inst->GetUnscaledItem();
const EQEmu::Item_Struct *item = inst->GetUnscaledItem();
RoF2::structs::ItemSerializationHeader hdr;
+6 -6
View File
@@ -370,16 +370,16 @@ namespace SoD
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
int item_count = in->size / sizeof(InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) {
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct));
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
delete in;
return;
}
InternalSerializedItem_Struct* eq = (InternalSerializedItem_Struct*)in->pBuffer;
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
@@ -1041,7 +1041,7 @@ namespace SoD
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
InternalSerializedItem_Struct* int_struct = (InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::InternalSerializedItem_Struct* int_struct = (EQEmu::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
@@ -3553,7 +3553,7 @@ namespace SoD
void SerializeItem(EQEmu::OutBuffer& ob, const ItemInst *inst, int16 slot_id_in, uint8 depth)
{
const Item_Struct *item = inst->GetUnscaledItem();
const EQEmu::Item_Struct *item = inst->GetUnscaledItem();
SoD::structs::ItemSerializationHeader hdr;
+6 -6
View File
@@ -352,16 +352,16 @@ namespace SoF
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
int item_count = in->size / sizeof(InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) {
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct));
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
delete in;
return;
}
InternalSerializedItem_Struct* eq = (InternalSerializedItem_Struct*)in->pBuffer;
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
@@ -841,7 +841,7 @@ namespace SoF
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
InternalSerializedItem_Struct* int_struct = (InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::InternalSerializedItem_Struct* int_struct = (EQEmu::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
@@ -2878,7 +2878,7 @@ namespace SoF
void SerializeItem(EQEmu::OutBuffer& ob, const ItemInst *inst, int16 slot_id_in, uint8 depth)
{
const Item_Struct *item = inst->GetUnscaledItem();
const EQEmu::Item_Struct *item = inst->GetUnscaledItem();
SoF::structs::ItemSerializationHeader hdr;
+8 -7
View File
@@ -286,14 +286,15 @@ namespace Titanium
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
int itemcount = in->size / sizeof(InternalSerializedItem_Struct);
if (itemcount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) {
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct));
int itemcount = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
if (itemcount == 0 || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
delete in;
return;
}
InternalSerializedItem_Struct* eq = (InternalSerializedItem_Struct*)in->pBuffer;
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
//do the transform...
EQEmu::OutBuffer ob;
@@ -739,7 +740,7 @@ namespace Titanium
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
InternalSerializedItem_Struct* int_struct = (InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::InternalSerializedItem_Struct* int_struct = (EQEmu::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
@@ -2098,7 +2099,7 @@ namespace Titanium
void SerializeItem(EQEmu::OutBuffer& ob, const ItemInst *inst, int16 slot_id_in, uint8 depth)
{
const char* protection = "\\\\\\\\\\";
const Item_Struct* item = inst->GetUnscaledItem();
const EQEmu::Item_Struct* item = inst->GetUnscaledItem();
ob << StringFormat("%.*s%s", (depth ? (depth - 1) : 0), protection, (depth ? "\"" : "")); // For leading quotes (and protection) if a subitem;
@@ -2111,7 +2112,7 @@ namespace Titanium
ob << '|' << itoa((inst->IsScaling() ? (inst->GetExp() / 100) : 0)); // inst experience
ob << '|' << itoa((!inst->GetMerchantSlot() ? inst->GetSerialNumber() : inst->GetMerchantSlot())); // merchant serial number
ob << '|' << itoa(inst->GetRecastTimestamp()); // recast timestamp
ob << '|' << itoa(((inst->IsStackable() ? ((inst->GetItem()->ItemType == ItemTypePotion) ? 1 : 0) : inst->GetCharges()))); // charge count
ob << '|' << itoa(((inst->IsStackable() ? ((inst->GetItem()->ItemType == EQEmu::item::ItemTypePotion) ? 1 : 0) : inst->GetCharges()))); // charge count
ob << '|' << itoa((inst->IsAttuned() ? 1 : 0)); // inst attuned
ob << '|' << itoa(0); // unknown
ob << '|';
+7 -7
View File
@@ -508,16 +508,16 @@ namespace UF
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
int item_count = in->size / sizeof(InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) {
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct));
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
delete in;
return;
}
InternalSerializedItem_Struct* eq = (InternalSerializedItem_Struct*)in->pBuffer;
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
@@ -1267,7 +1267,7 @@ namespace UF
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
InternalSerializedItem_Struct* int_struct = (InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::InternalSerializedItem_Struct* int_struct = (EQEmu::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
@@ -3828,7 +3828,7 @@ namespace UF
void SerializeItem(EQEmu::OutBuffer& ob, const ItemInst *inst, int16 slot_id_in, uint8 depth)
{
const Item_Struct *item = inst->GetUnscaledItem();
const EQEmu::Item_Struct *item = inst->GetUnscaledItem();
UF::structs::ItemSerializationHeader hdr;
@@ -3872,7 +3872,7 @@ namespace UF
int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
uint16 ornaIcon = 0;
if (inst->GetOrnamentationAug(ornamentationAugtype)) {
const Item_Struct *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
const EQEmu::Item_Struct *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
ornaIcon = aug_weap->Icon;
ob.write(aug_weap->IDFile, strlen(aug_weap->IDFile));
+3 -3
View File
@@ -98,7 +98,7 @@ void EQEmu::saylink::SayLinkEngine::generate_body()
memset(&m_LinkBodyStruct, 0, sizeof(SayLinkBody_Struct));
const Item_Struct* item_data = nullptr;
const EQEmu::Item_Struct* item_data = nullptr;
switch (m_LinkType) {
case SayLinkBlank:
@@ -201,7 +201,7 @@ void EQEmu::saylink::SayLinkEngine::generate_text()
return;
}
const Item_Struct* item_data = nullptr;
const EQEmu::Item_Struct* item_data = nullptr;
switch (m_LinkType) {
case SayLinkBlank:
@@ -274,4 +274,4 @@ bool EQEmu::saylink::GenerateLinkBody(std::string& say_link_body, const SayLinkB
return false;
return true;
}
}
+5 -4
View File
@@ -25,13 +25,14 @@
#include <string>
struct Item_Struct;
struct ServerLootItem_Struct;
class ItemInst;
namespace EQEmu
{
struct Item_Struct;
namespace saylink {
struct SayLinkBody_Struct; // Current server mask: EQClientRoF2
@@ -73,7 +74,7 @@ public:
SayLinkEngine();
void SetLinkType(SayLinkType link_type) { m_LinkType = link_type; }
void SetItemData(const Item_Struct* item_data) { m_ItemData = item_data; }
void SetItemData(const EQEmu::Item_Struct* item_data) { m_ItemData = item_data; }
void SetLootData(const ServerLootItem_Struct* loot_data) { m_LootData = loot_data; }
void SetItemInst(const ItemInst* item_inst) { m_ItemInst = item_inst; }
@@ -109,7 +110,7 @@ private:
void generate_text();
int m_LinkType;
const Item_Struct* m_ItemData;
const EQEmu::Item_Struct* m_ItemData;
const ServerLootItem_Struct* m_LootData;
const ItemInst* m_ItemInst;
@@ -135,4 +136,4 @@ private:
bool m_Error;
};
#endif /* COMMON_SAY_LINK_H */
#endif /*COMMON_SAY_LINK_H*/
+24 -24
View File
@@ -191,11 +191,11 @@ bool SharedDatabase::SaveInventory(uint32 char_id, const ItemInst* inst, int16 s
bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, int16 slot_id) {
// need to check 'inst' argument for valid pointer
uint32 augslot[EQEmu::legacy::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM };
if (inst->IsType(ItemClassCommon)) {
uint32 augslot[EQEmu::legacy::ITEM_COMMON_SIZE] = { 0, 0, 0, 0, 0, 0 };
if (inst->IsClassCommon()) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
ItemInst *auginst = inst->GetItem(i);
augslot[i] = (auginst && auginst->GetItem()) ? auginst->GetItem()->ID : NO_ITEM;
augslot[i] = (auginst && auginst->GetItem()) ? auginst->GetItem()->ID : 0;
}
}
@@ -220,7 +220,7 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i
auto results = QueryDatabase(query);
// Save bag contents, if slot supports bag contents
if (inst->IsType(ItemClassContainer) && Inventory::SupportsContainers(slot_id))
if (inst->IsClassBag() && Inventory::SupportsContainers(slot_id))
// Limiting to bag slot count will get rid of 'hidden' duplicated items and 'Invalid Slot ID'
// messages through attrition (and the modded code in SaveInventory)
for (uint8 idx = SUB_INDEX_BEGIN; idx < inst->GetItem()->BagSlots && idx < EQEmu::legacy::ITEM_CONTAINER_SIZE; idx++) {
@@ -238,11 +238,11 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i
bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst, int16 slot_id) {
// need to check 'inst' argument for valid pointer
uint32 augslot[EQEmu::legacy::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM };
if (inst->IsType(ItemClassCommon)) {
uint32 augslot[EQEmu::legacy::ITEM_COMMON_SIZE] = { 0, 0, 0, 0, 0, 0 };
if (inst->IsClassCommon()) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
ItemInst *auginst = inst->GetItem(i);
augslot[i] = (auginst && auginst->GetItem()) ? auginst->GetItem()->ID : NO_ITEM;
augslot[i] = (auginst && auginst->GetItem()) ? auginst->GetItem()->ID : 0;
}
}
@@ -266,7 +266,7 @@ bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst,
auto results = QueryDatabase(query);
// Save bag contents, if slot supports bag contents
if (inst->IsType(ItemClassContainer) && Inventory::SupportsContainers(slot_id)) {
if (inst->IsClassBag() && Inventory::SupportsContainers(slot_id)) {
// Limiting to bag slot count will get rid of 'hidden' duplicated items and 'Invalid Slot ID'
// messages through attrition (and the modded code in SaveInventory)
for (uint8 idx = SUB_INDEX_BEGIN; idx < inst->GetItem()->BagSlots && idx < EQEmu::legacy::ITEM_CONTAINER_SIZE; idx++) {
@@ -363,7 +363,7 @@ bool SharedDatabase::SetSharedPlatinum(uint32 account_id, int32 amount_to_add) {
bool SharedDatabase::SetStartingItems(PlayerProfile_Struct* pp, Inventory* inv, uint32 si_race, uint32 si_class, uint32 si_deity, uint32 si_current_zone, char* si_name, int admin_level) {
const Item_Struct* myitem;
const EQEmu::Item_Struct* myitem;
std::string query = StringFormat("SELECT itemid, item_charges, slot FROM starting_items "
"WHERE (race = %i or race = 0) AND (class = %i or class = 0) AND "
@@ -435,7 +435,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory *inv, bool is_charid)
aug[4] = (uint32)atoi(row[7]);
aug[5] = (uint32)atoi(row[8]);
const Item_Struct *item = GetItem(item_id);
const EQEmu::Item_Struct *item = GetItem(item_id);
if (!item) {
Log.Out(Logs::General, Logs::Error,
@@ -447,7 +447,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory *inv, bool is_charid)
int16 put_slot_id = INVALID_INDEX;
ItemInst *inst = CreateBaseItem(item, charges);
if (inst && item->ItemClass == ItemClassCommon) {
if (inst && item->IsClassCommon()) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
if (aug[i])
inst->PutAugment(this, i, aug[i]);
@@ -537,7 +537,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory *inv)
uint32 ornament_idfile = (uint32)atoul(row[13]);
uint32 ornament_hero_model = (uint32)atoul(row[14]);
const Item_Struct *item = GetItem(item_id);
const EQEmu::Item_Struct *item = GetItem(item_id);
if (!item) {
Log.Out(Logs::General, Logs::Error,
@@ -607,7 +607,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory *inv)
inst->SetRecastTimestamp(0);
}
if (item->ItemClass == ItemClassCommon) {
if (item->IsClassCommon()) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
if (aug[i])
inst->PutAugment(this, i, aug[i]);
@@ -678,7 +678,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, Inventory *inv)
uint32 ornament_idfile = (uint32)atoul(row[13]);
uint32 ornament_hero_model = (uint32)atoul(row[14]);
const Item_Struct *item = GetItem(item_id);
const EQEmu::Item_Struct *item = GetItem(item_id);
int16 put_slot_id = INVALID_INDEX;
if (!item)
continue;
@@ -725,7 +725,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, Inventory *inv)
inst->SetCharges(charges);
if (item->ItemClass == ItemClassCommon) {
if (item->IsClassCommon()) {
for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
if (aug[i])
inst->PutAugment(this, i, aug[i]);
@@ -814,7 +814,7 @@ bool SharedDatabase::LoadItems(const std::string &prefix) {
mutex.Lock();
std::string file_name = std::string("shared/") + prefix + std::string("items");
items_mmf = std::unique_ptr<EQEmu::MemoryMappedFile>(new EQEmu::MemoryMappedFile(file_name));
items_hash = std::unique_ptr<EQEmu::FixedMemoryHashSet<Item_Struct>>(new EQEmu::FixedMemoryHashSet<Item_Struct>(reinterpret_cast<uint8*>(items_mmf->Get()), items_mmf->Size()));
items_hash = std::unique_ptr<EQEmu::FixedMemoryHashSet<EQEmu::Item_Struct>>(new EQEmu::FixedMemoryHashSet<EQEmu::Item_Struct>(reinterpret_cast<uint8*>(items_mmf->Get()), items_mmf->Size()));
mutex.Unlock();
} catch(std::exception& ex) {
Log.Out(Logs::General, Logs::Error, "Error Loading Items: %s", ex.what());
@@ -826,7 +826,7 @@ bool SharedDatabase::LoadItems(const std::string &prefix) {
void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_item_id)
{
EQEmu::FixedMemoryHashSet<Item_Struct> hash(reinterpret_cast<uint8 *>(data), size, items, max_item_id);
EQEmu::FixedMemoryHashSet<EQEmu::Item_Struct> hash(reinterpret_cast<uint8 *>(data), size, items, max_item_id);
std::string ndbuffer;
bool disableNoRent = false;
@@ -854,7 +854,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
}
}
Item_Struct item;
EQEmu::Item_Struct item;
const std::string query = "SELECT source,"
#define F(x) "`"#x"`,"
@@ -867,7 +867,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
}
for (auto row = results.begin(); row != results.end(); ++row) {
memset(&item, 0, sizeof(Item_Struct));
memset(&item, 0, sizeof(EQEmu::Item_Struct));
item.ItemClass = (uint8)atoi(row[ItemField::itemclass]);
strcpy(item.Name, row[ItemField::name]);
@@ -1084,7 +1084,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
}
}
const Item_Struct* SharedDatabase::GetItem(uint32 id) {
const EQEmu::Item_Struct* SharedDatabase::GetItem(uint32 id) {
if (id == 0)
{
return nullptr;
@@ -1103,7 +1103,7 @@ const Item_Struct* SharedDatabase::GetItem(uint32 id) {
return nullptr;
}
const Item_Struct* SharedDatabase::IterateItems(uint32* id) {
const EQEmu::Item_Struct* SharedDatabase::IterateItems(uint32* id) {
if(!items_hash || !id) {
return nullptr;
}
@@ -1250,7 +1250,7 @@ bool SharedDatabase::LoadNPCFactionLists(const std::string &prefix) {
// Create appropriate ItemInst class
ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, uint8 attuned)
{
const Item_Struct* item = nullptr;
const EQEmu::Item_Struct* item = nullptr;
ItemInst* inst = nullptr;
item = GetItem(item_id);
@@ -1277,7 +1277,7 @@ ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1,
// Create appropriate ItemInst class
ItemInst* SharedDatabase::CreateItem(const Item_Struct* item, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, uint8 attuned)
ItemInst* SharedDatabase::CreateItem(const EQEmu::Item_Struct* item, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, uint8 attuned)
{
ItemInst* inst = nullptr;
if (item) {
@@ -1301,7 +1301,7 @@ ItemInst* SharedDatabase::CreateItem(const Item_Struct* item, int16 charges, uin
return inst;
}
ItemInst* SharedDatabase::CreateBaseItem(const Item_Struct* item, int16 charges) {
ItemInst* SharedDatabase::CreateBaseItem(const EQEmu::Item_Struct* item, int16 charges) {
ItemInst* inst = nullptr;
if (item) {
// if maxcharges is -1 that means it is an unlimited use item.
+6 -6
View File
@@ -39,12 +39,12 @@ struct BaseDataStruct;
struct InspectMessage_Struct;
struct PlayerProfile_Struct;
struct SPDat_Spell_Struct;
struct Item_Struct;
struct NPCFactionList;
struct LootTable_Struct;
struct LootDrop_Struct;
namespace EQEmu
{
struct Item_Struct;
class MemoryMappedFile;
}
@@ -99,8 +99,8 @@ class SharedDatabase : public Database
Item Methods
*/
ItemInst* CreateItem(uint32 item_id, int16 charges = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, uint8 attuned = 0);
ItemInst* CreateItem(const Item_Struct* item, int16 charges = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, uint8 attuned = 0);
ItemInst* CreateBaseItem(const Item_Struct* item, int16 charges = 0);
ItemInst* CreateItem(const EQEmu::Item_Struct* item, int16 charges = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, uint8 attuned = 0);
ItemInst* CreateBaseItem(const EQEmu::Item_Struct* item, int16 charges = 0);
/*
Shared Memory crap
@@ -110,8 +110,8 @@ class SharedDatabase : public Database
void GetItemsCount(int32 &item_count, uint32 &max_id);
void LoadItems(void *data, uint32 size, int32 items, uint32 max_item_id);
bool LoadItems(const std::string &prefix);
const Item_Struct* IterateItems(uint32* id);
const Item_Struct* GetItem(uint32 id);
const EQEmu::Item_Struct* IterateItems(uint32* id);
const EQEmu::Item_Struct* GetItem(uint32 id);
const EvolveInfo* GetEvolveInfo(uint32 loregroup);
//faction lists
@@ -148,7 +148,7 @@ class SharedDatabase : public Database
std::unique_ptr<EQEmu::MemoryMappedFile> skill_caps_mmf;
std::unique_ptr<EQEmu::MemoryMappedFile> items_mmf;
std::unique_ptr<EQEmu::FixedMemoryHashSet<Item_Struct>> items_hash;
std::unique_ptr<EQEmu::FixedMemoryHashSet<EQEmu::Item_Struct>> items_hash;
std::unique_ptr<EQEmu::MemoryMappedFile> faction_mmf;
std::unique_ptr<EQEmu::FixedMemoryHashSet<NPCFactionList>> faction_hash;
std::unique_ptr<EQEmu::MemoryMappedFile> loot_table_mmf;