Renamed Item_Struct to ItemData

This commit is contained in:
KimLS 2015-02-17 18:06:22 -08:00
parent b75e6308dd
commit 701e194ece
69 changed files with 477 additions and 381 deletions

View File

@ -30,8 +30,10 @@ SET(common_sources
faction.cpp faction.cpp
guild_base.cpp guild_base.cpp
guilds.cpp guilds.cpp
inventory.cpp
ipc_mutex.cpp ipc_mutex.cpp
item.cpp item.cpp
item_instance.cpp
md5.cpp md5.cpp
memory_mapped_file.cpp memory_mapped_file.cpp
misc.cpp misc.cpp
@ -135,10 +137,12 @@ SET(common_headers
global_define.h global_define.h
guild_base.h guild_base.h
guilds.h guilds.h
inventory.h
ipc_mutex.h ipc_mutex.h
item.h item.h
item_data.h
item_fieldlist.h item_fieldlist.h
item_struct.h item_instance.h
languages.h languages.h
linked_list.h linked_list.h
loottable.h loottable.h

View File

@ -259,7 +259,7 @@ enum AugmentationRestrictionTypes : uint8 {
/* /*
** Container use types ** Container use types
** **
** This correlates to world 'object.type' (object.h/Object.cpp) as well as Item_Struct.BagType ** This correlates to world 'object.type' (object.h/Object.cpp) as well as ItemData.BagType
** **
** (ref: database, web forums and eqstr_us.txt) ** (ref: database, web forums and eqstr_us.txt)
*/ */

View File

@ -24,7 +24,7 @@
#include <list> #include <list>
#include <time.h> #include <time.h>
#include "../common/version.h" #include "../common/version.h"
//#include "../common/item_struct.h" //#include "../common/item_data.h"
static const uint32 BUFF_COUNT = 25; static const uint32 BUFF_COUNT = 25;
static const uint32 MAX_MERC = 100; static const uint32 MAX_MERC = 100;
@ -2082,7 +2082,7 @@ struct AdventureLeaderboard_Struct
/*struct Item_Shop_Struct { /*struct Item_Shop_Struct {
uint16 merchantid; uint16 merchantid;
uint8 itemtype; uint8 itemtype;
Item_Struct item; ItemData item;
uint8 iss_unknown001[6]; uint8 iss_unknown001[6];
};*/ };*/

20
common/inventory.cpp Normal file
View File

@ -0,0 +1,20 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2015 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 "inventory.h"

32
common/inventory.h Normal file
View File

@ -0,0 +1,32 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2015 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
*/
#ifndef COMMON_INVENTORY_H
#define COMMON_INVENTORY_H
namespace EQEmu
{
class Inventory
{
public:
private:
};
} // EQEmu
#endif

View File

@ -368,7 +368,7 @@ ItemInst* InventoryOld::PopItem(int16 slot_id)
return p; return p;
} }
bool InventoryOld::HasSpaceForItem(const Item_Struct *ItemToTry, int16 Quantity) { bool InventoryOld::HasSpaceForItem(const ItemData *ItemToTry, int16 Quantity) {
if (ItemToTry->Stackable) { if (ItemToTry->Stackable) {
@ -901,7 +901,7 @@ uint8 InventoryOld::CalcMaterialFromSlot(int16 equipslot)
} }
} }
bool InventoryOld::CanItemFitInContainer(const Item_Struct *ItemToTry, const Item_Struct *Container) { bool InventoryOld::CanItemFitInContainer(const ItemData *ItemToTry, const ItemData *Container) {
if (!ItemToTry || !Container) if (!ItemToTry || !Container)
return false; return false;
@ -1429,7 +1429,7 @@ int16 InventoryOld::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup)
// //
// class ItemInst // class ItemInst
// //
ItemInst::ItemInst(const Item_Struct* item, int16 charges) { ItemInst::ItemInst(const ItemData* item, int16 charges) {
m_use_type = ItemInstNormal; m_use_type = ItemInstNormal;
m_item = item; m_item = item;
m_charges = charges; m_charges = charges;
@ -1539,7 +1539,7 @@ ItemInst::ItemInst(const ItemInst& copy)
m_evolveLvl = copy.m_evolveLvl; m_evolveLvl = copy.m_evolveLvl;
m_activated = copy.m_activated; m_activated = copy.m_activated;
if (copy.m_scaledItem) if (copy.m_scaledItem)
m_scaledItem = new Item_Struct(*copy.m_scaledItem); m_scaledItem = new ItemData(*copy.m_scaledItem);
else else
m_scaledItem = nullptr; m_scaledItem = nullptr;
@ -1758,7 +1758,7 @@ void ItemInst::ClearByFlags(byFlagSetting is_nodrop, byFlagSetting is_norent)
continue; continue;
} }
const Item_Struct* item = inst->GetItem(); const ItemData* item = inst->GetItem();
if (item == nullptr) { if (item == nullptr) {
cur = m_contents.erase(cur); cur = m_contents.erase(cur);
continue; continue;
@ -1899,7 +1899,7 @@ bool ItemInst::UpdateOrnamentationInfo() {
int32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType); int32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
if (GetOrnamentationAug(ornamentationAugtype)) if (GetOrnamentationAug(ornamentationAugtype))
{ {
const Item_Struct* ornamentItem; const ItemData* ornamentItem;
ornamentItem = GetOrnamentationAug(ornamentationAugtype)->GetItem(); ornamentItem = GetOrnamentationAug(ornamentationAugtype)->GetItem();
if (ornamentItem != nullptr) if (ornamentItem != nullptr)
{ {
@ -1926,7 +1926,7 @@ bool ItemInst::UpdateOrnamentationInfo() {
return ornamentSet; return ornamentSet;
} }
bool ItemInst::CanTransform(const Item_Struct *ItemToTry, const Item_Struct *Container, bool AllowAll) { bool ItemInst::CanTransform(const ItemData *ItemToTry, const ItemData *Container, bool AllowAll) {
if (!ItemToTry || !Container) return false; if (!ItemToTry || !Container) return false;
if (ItemToTry->ItemType == ItemTypeArrow || strnlen(Container->CharmFile, 30) == 0) if (ItemToTry->ItemType == ItemTypeArrow || strnlen(Container->CharmFile, 30) == 0)
@ -2060,7 +2060,7 @@ bool ItemInst::IsAmmo() const
} }
const Item_Struct* ItemInst::GetItem() const const ItemData* ItemInst::GetItem() const
{ {
if (!m_item) if (!m_item)
return nullptr; return nullptr;
@ -2071,7 +2071,7 @@ const Item_Struct* ItemInst::GetItem() const
return m_item; return m_item;
} }
const Item_Struct* ItemInst::GetUnscaledItem() const const ItemData* ItemInst::GetUnscaledItem() const
{ {
// No operator calls and defaults to nullptr // No operator calls and defaults to nullptr
return m_item; return m_item;
@ -2179,10 +2179,10 @@ void ItemInst::ScaleItem() {
return; return;
if (m_scaledItem) { if (m_scaledItem) {
memcpy(m_scaledItem, m_item, sizeof(Item_Struct)); memcpy(m_scaledItem, m_item, sizeof(ItemData));
} }
else { else {
m_scaledItem = new Item_Struct(*m_item); m_scaledItem = new ItemData(*m_item);
} }
float Mult = (float)(GetExp()) / 10000; // scaling is determined by exp, with 10,000 being full stats float Mult = (float)(GetExp()) / 10000; // scaling is determined by exp, with 10,000 being full stats
@ -2326,9 +2326,9 @@ EvolveInfo::~EvolveInfo() {
// //
// struct Item_Struct // struct ItemData
// //
bool Item_Struct::IsEquipable(uint16 Race, uint16 Class_) const bool ItemData::IsEquipable(uint16 Race, uint16 Class_) const
{ {
bool IsRace = false; bool IsRace = false;
bool IsClass = false; bool IsClass = false;

View File

@ -27,7 +27,7 @@ class ItemParse; // Parses item packets
class EvolveInfo; // Stores information about an evolving item family class EvolveInfo; // Stores information about an evolving item family
#include "../common/eq_constants.h" #include "../common/eq_constants.h"
#include "../common/item_struct.h" #include "../common/item_data.h"
#include "../common/timer.h" #include "../common/timer.h"
#include <list> #include <list>
@ -168,7 +168,7 @@ public:
ItemInst* PopItem(int16 slot_id); ItemInst* PopItem(int16 slot_id);
// Check whether there is space for the specified number of the specified item. // Check whether there is space for the specified number of the specified item.
bool HasSpaceForItem(const Item_Struct *ItemToTry, int16 Quantity); bool HasSpaceForItem(const ItemData *ItemToTry, int16 Quantity);
// Check whether item exists in inventory // Check whether item exists in inventory
// where argument specifies OR'd list of invWhere constants to look // where argument specifies OR'd list of invWhere constants to look
@ -193,7 +193,7 @@ public:
static int16 CalcSlotFromMaterial(uint8 material); static int16 CalcSlotFromMaterial(uint8 material);
static uint8 CalcMaterialFromSlot(int16 equipslot); static uint8 CalcMaterialFromSlot(int16 equipslot);
static bool CanItemFitInContainer(const Item_Struct *ItemToTry, const Item_Struct *Container); static bool CanItemFitInContainer(const ItemData *ItemToTry, const ItemData *Container);
// Test for valid inventory casting slot // Test for valid inventory casting slot
bool SupportsClickCasting(int16 slot_id); bool SupportsClickCasting(int16 slot_id);
@ -270,7 +270,7 @@ public:
///////////////////////// /////////////////////////
// Constructors/Destructor // Constructors/Destructor
ItemInst(const Item_Struct* item = nullptr, int16 charges = 0); ItemInst(const ItemData* item = nullptr, int16 charges = 0);
ItemInst(SharedDatabase *db, uint32 item_id, int16 charges = 0); ItemInst(SharedDatabase *db, uint32 item_id, int16 charges = 0);
@ -331,7 +331,7 @@ public:
bool IsAugmented(); bool IsAugmented();
ItemInst* GetOrnamentationAug(int32 ornamentationAugtype) const; ItemInst* GetOrnamentationAug(int32 ornamentationAugtype) const;
bool UpdateOrnamentationInfo(); bool UpdateOrnamentationInfo();
static bool CanTransform(const Item_Struct *ItemToTry, const Item_Struct *Container, bool AllowAll = false); static bool CanTransform(const ItemData *ItemToTry, const ItemData *Container, bool AllowAll = false);
// Has attack/delay? // Has attack/delay?
bool IsWeapon() const; bool IsWeapon() const;
@ -340,8 +340,8 @@ public:
// Accessors // Accessors
const uint32 GetID() const { return ((m_item) ? m_item->ID : NO_ITEM); } 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 uint32 GetItemScriptID() const { return ((m_item) ? m_item->ScriptFileID : NO_ITEM); }
const Item_Struct* GetItem() const; const ItemData* GetItem() const;
const Item_Struct* GetUnscaledItem() const; const ItemData* GetUnscaledItem() const;
int16 GetCharges() const { return m_charges; } int16 GetCharges() const { return m_charges; }
void SetCharges(int16 charges) { m_charges = charges; } void SetCharges(int16 charges) { m_charges = charges; }
@ -376,7 +376,7 @@ public:
// Allows treatment of this object as though it were a pointer to m_item // Allows treatment of this object as though it were a pointer to m_item
operator bool() const { return (m_item != nullptr); } operator bool() const { return (m_item != nullptr); }
// Compare inner Item_Struct of two ItemInst objects // Compare inner ItemData of two ItemInst objects
bool operator==(const ItemInst& right) const { return (this->m_item == right.m_item); } bool operator==(const ItemInst& right) const { return (this->m_item == right.m_item); }
bool operator!=(const ItemInst& right) const { return (this->m_item != right.m_item); } bool operator!=(const ItemInst& right) const { return (this->m_item != right.m_item); }
@ -431,7 +431,7 @@ protected:
void _PutItem(uint8 index, ItemInst* inst) { m_contents[index] = inst; } void _PutItem(uint8 index, ItemInst* inst) { m_contents[index] = inst; }
ItemInstTypes m_use_type; // Usage type for item ItemInstTypes m_use_type; // Usage type for item
const Item_Struct* m_item; // Ptr to item data const ItemData* m_item; // Ptr to item data
int16 m_charges; // # of charges for chargeable items int16 m_charges; // # of charges for chargeable items
uint32 m_price; // Bazaar /trader price uint32 m_price; // Bazaar /trader price
uint32 m_color; uint32 m_color;
@ -443,7 +443,7 @@ protected:
uint32 m_exp; uint32 m_exp;
int8 m_evolveLvl; int8 m_evolveLvl;
bool m_activated; bool m_activated;
Item_Struct* m_scaledItem; ItemData* m_scaledItem;
EvolveInfo* m_evolveInfo; EvolveInfo* m_evolveInfo;
bool m_scaling; bool m_scaling;
uint32 m_ornamenticon; uint32 m_ornamenticon;

View File

@ -16,8 +16,8 @@
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 #ifndef COMMON_ITEM_DATA_H
#define ITEM_STRUCT_H #define COMMON_ITEM_DATA_H
/* /*
* Note: (Doodman) * Note: (Doodman)
@ -35,7 +35,7 @@
* *
* Note #3: (Doodman) * Note #3: (Doodman)
* Please take care when adding new found data fields to add them * Please take care when adding new found data fields to add them
* to the appropriate structure. Item_Struct has elements that are * to the appropriate structure. ItemData has elements that are
* global to all types of items only. * global to all types of items only.
* *
* Note #4: (Doodman) * Note #4: (Doodman)
@ -46,7 +46,7 @@
#include "eq_dictionary.h" #include "eq_dictionary.h"
/* /*
** Child struct of Item_Struct: ** Child struct of ItemData:
** Effect data: Click, Proc, Focus, Worn, Scroll ** Effect data: Click, Proc, Focus, Worn, Scroll
** **
*/ */
@ -72,7 +72,7 @@ struct InternalSerializedItem_Struct {
// use EmuConstants::ITEM_COMMON_SIZE // use EmuConstants::ITEM_COMMON_SIZE
//#define MAX_AUGMENT_SLOTS 5 //#define MAX_AUGMENT_SLOTS 5
struct Item_Struct { struct ItemData {
bool IsEquipable(uint16 Race, uint16 Class) const; bool IsEquipable(uint16 Race, uint16 Class) const;
// Non packet based fields // Non packet based fields
uint8 MinStatus; uint8 MinStatus;
@ -99,17 +99,10 @@ struct Item_Struct {
uint32 Favor; // Individual favor uint32 Favor; // Individual favor
uint32 GuildFavor; // Guild favor uint32 GuildFavor; // Guild favor
uint32 PointType; uint32 PointType;
//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 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 BagSlots; // Number of slots
uint8 BagSize; // 0:TINY, 1:SMALL, 2:MEDIUM, 3:LARGE, 4:GIANT uint8 BagSize; // 0:TINY, 1:SMALL, 2:MEDIUM, 3:LARGE, 4:GIANT
uint8 BagWR; // 0->100 uint8 BagWR; // 0->100
bool BenefitFlag; bool BenefitFlag;
bool Tradeskills; // Is this a tradeskill item? bool Tradeskills; // Is this a tradeskill item?
int8 CR; // Save vs Cold int8 CR; // Save vs Cold
@ -128,7 +121,6 @@ struct Item_Struct {
int32 Mana; // Mana int32 Mana; // Mana
int32 AC; // AC int32 AC; // AC
uint32 Deity; // Bitmask of Deities that can equip this item uint32 Deity; // Bitmask of Deities that can equip this item
//uint32 Unk033
int32 SkillModValue; // % Mod to skill specified in SkillModType int32 SkillModValue; // % Mod to skill specified in SkillModType
uint32 SkillModType; // Type of skill for SkillModValue to apply to uint32 SkillModType; // Type of skill for SkillModValue to apply to
uint32 BaneDmgRace; // Bane Damage Race uint32 BaneDmgRace; // Bane Damage Race
@ -150,13 +142,11 @@ struct Item_Struct {
uint32 Color; // RR GG BB 00 <-- as it appears in pc uint32 Color; // RR GG BB 00 <-- as it appears in pc
uint32 Classes; // Bitfield of classes that can equip item (1 << class#) uint32 Classes; // Bitfield of classes that can equip item (1 << class#)
uint32 Races; // Bitfield of races that can equip item (1 << race#) 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 int16 MaxCharges; // Maximum charges items can hold: -1 if not a chargeable item
uint8 ItemType; // Item Type/Skill (itemClass* from above) uint8 ItemType; // Item Type/Skill (itemClass* from above)
uint8 Material; // Item material type uint8 Material; // Item material type
uint32 HerosForgeModel;// Hero's Forge Armor Model Type (2-13?) uint32 HerosForgeModel;// Hero's Forge Armor Model Type (2-13?)
float SellRate; // Sell rate float SellRate; // Sell rate
//uint32 Unk059;
union { union {
uint32 Fulfilment; // Food fulfilment (How long it lasts) uint32 Fulfilment; // Food fulfilment (How long it lasts)
int16 CastTime; // Cast Time for clicky effects, in milliseconds int16 CastTime; // Cast Time for clicky effects, in milliseconds
@ -211,7 +201,6 @@ struct Item_Struct {
int16 StackSize; int16 StackSize;
uint8 PotionBeltSlots; uint8 PotionBeltSlots;
ItemEffect_Struct Click, Proc, Worn, Focus, Scroll, Bard; ItemEffect_Struct Click, Proc, Worn, Focus, Scroll, Bard;
uint8 Book; // 0=Not book, 1=Book uint8 Book; // 0=Not book, 1=Book
uint32 BookType; uint32 BookType;
char Filename[33]; // Filename for book data char Filename[33]; // Filename for book data

19
common/item_instance.cpp Normal file
View File

@ -0,0 +1,19 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2015 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_instance.h"

32
common/item_instance.h Normal file
View File

@ -0,0 +1,32 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2015 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
*/
#ifndef COMMON_ITEM_INSTANCE_H
#define COMMON_ITEM_INSTANCE_H
namespace EQEmu
{
class ItemInstance
{
public:
private:
};
} // EQEmu
#endif

View File

@ -4972,7 +4972,7 @@ namespace RoF
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary); std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
const Item_Struct *item = inst->GetUnscaledItem(); const ItemData *item = inst->GetUnscaledItem();
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Serialize called for: %s", item->Name); //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Serialize called for: %s", item->Name);
RoF::structs::ItemSerializationHeader hdr; RoF::structs::ItemSerializationHeader hdr;

View File

@ -5136,7 +5136,7 @@ namespace RoF2
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary); std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
const Item_Struct *item = inst->GetUnscaledItem(); const ItemData *item = inst->GetUnscaledItem();
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Serialize called for: %s", item->Name); //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Serialize called for: %s", item->Name);
RoF2::structs::ItemSerializationHeader hdr; RoF2::structs::ItemSerializationHeader hdr;

View File

@ -2280,7 +2280,7 @@ struct AdventureLeaderboard_Struct
/*struct Item_Shop_Struct { /*struct Item_Shop_Struct {
uint16 merchantid; uint16 merchantid;
uint8 itemtype; uint8 itemtype;
Item_Struct item; ItemData item;
uint8 iss_unknown001[6]; uint8 iss_unknown001[6];
};*/ };*/

View File

@ -2309,7 +2309,7 @@ struct AdventureLeaderboard_Struct
/*struct Item_Shop_Struct { /*struct Item_Shop_Struct {
uint16 merchantid; uint16 merchantid;
uint8 itemtype; uint8 itemtype;
Item_Struct item; ItemData item;
uint8 iss_unknown001[6]; uint8 iss_unknown001[6];
};*/ };*/

View File

@ -3515,7 +3515,7 @@ namespace SoD
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary); std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
const Item_Struct *item = inst->GetUnscaledItem(); const ItemData *item = inst->GetUnscaledItem();
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Serialize called for: %s", item->Name); //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Serialize called for: %s", item->Name);
SoD::structs::ItemSerializationHeader hdr; SoD::structs::ItemSerializationHeader hdr;
hdr.stacksize = stackable ? charges : 1; hdr.stacksize = stackable ? charges : 1;

View File

@ -1958,7 +1958,7 @@ struct AdventureLeaderboard_Struct
/*struct Item_Shop_Struct { /*struct Item_Shop_Struct {
uint16 merchantid; uint16 merchantid;
uint8 itemtype; uint8 itemtype;
Item_Struct item; ItemData item;
uint8 iss_unknown001[6]; uint8 iss_unknown001[6];
};*/ };*/

View File

@ -2839,7 +2839,7 @@ namespace SoF
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary); std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
const Item_Struct *item = inst->GetUnscaledItem(); const ItemData *item = inst->GetUnscaledItem();
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Serialize called for: %s", item->Name); //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Serialize called for: %s", item->Name);
SoF::structs::ItemSerializationHeader hdr; SoF::structs::ItemSerializationHeader hdr;
hdr.stacksize = stackable ? charges : 1; hdr.stacksize = stackable ? charges : 1;

View File

@ -1931,7 +1931,7 @@ struct AdventureLeaderboard_Struct
/*struct Item_Shop_Struct { /*struct Item_Shop_Struct {
uint16 merchantid; uint16 merchantid;
uint8 itemtype; uint8 itemtype;
Item_Struct item; ItemData item;
uint8 iss_unknown001[6]; uint8 iss_unknown001[6];
};*/ };*/

View File

@ -1989,7 +1989,7 @@ namespace Titanium
int16 slot_id = ServerToTitaniumSlot(slot_id_in); int16 slot_id = ServerToTitaniumSlot(slot_id_in);
uint32 merchant_slot = inst->GetMerchantSlot(); uint32 merchant_slot = inst->GetMerchantSlot();
int16 charges = inst->GetCharges(); int16 charges = inst->GetCharges();
const Item_Struct *item = inst->GetUnscaledItem(); const ItemData *item = inst->GetUnscaledItem();
int i; int i;
uint32 sub_length; uint32 sub_length;

View File

@ -1687,7 +1687,7 @@ struct AdventureRequestResponse_Struct{
/*struct Item_Shop_Struct { /*struct Item_Shop_Struct {
uint16 merchantid; uint16 merchantid;
uint8 itemtype; uint8 itemtype;
Item_Struct item; ItemData item;
uint8 iss_unknown001[6]; uint8 iss_unknown001[6];
};*/ };*/

View File

@ -3760,7 +3760,7 @@ namespace UF
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary); std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
const Item_Struct *item = inst->GetUnscaledItem(); const ItemData *item = inst->GetUnscaledItem();
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Serialize called for: %s", item->Name); //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Serialize called for: %s", item->Name);
UF::structs::ItemSerializationHeader hdr; UF::structs::ItemSerializationHeader hdr;
hdr.stacksize = stackable ? charges : 1; hdr.stacksize = stackable ? charges : 1;
@ -3798,7 +3798,7 @@ namespace UF
//ORNAMENT IDFILE / ICON - //ORNAMENT IDFILE / ICON -
uint16 ornaIcon = 0; uint16 ornaIcon = 0;
if (inst->GetOrnamentationAug(ornamentationAugtype)) { if (inst->GetOrnamentationAug(ornamentationAugtype)) {
const Item_Struct *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem(); const ItemData *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
ss.write(aug_weap->IDFile, strlen(aug_weap->IDFile)); ss.write(aug_weap->IDFile, strlen(aug_weap->IDFile));
ss.write((const char*)&null_term, sizeof(uint8)); ss.write((const char*)&null_term, sizeof(uint8));
ornaIcon = aug_weap->Icon; ornaIcon = aug_weap->Icon;

View File

@ -2016,7 +2016,7 @@ struct AdventureLeaderboard_Struct
/*struct Item_Shop_Struct { /*struct Item_Shop_Struct {
uint16 merchantid; uint16 merchantid;
uint8 itemtype; uint8 itemtype;
Item_Struct item; ItemData item;
uint8 iss_unknown001[6]; uint8 iss_unknown001[6];
};*/ };*/

View File

@ -347,7 +347,7 @@ bool SharedDatabase::SetSharedPlatinum(uint32 account_id, int32 amount_to_add) {
bool SharedDatabase::SetStartingItems(PlayerProfile_Struct* pp, InventoryOld* inv, uint32 si_race, uint32 si_class, uint32 si_deity, uint32 si_current_zone, char* si_name, int admin_level) { bool SharedDatabase::SetStartingItems(PlayerProfile_Struct* pp, InventoryOld* 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 ItemData* myitem;
std::string query = StringFormat("SELECT itemid, item_charges, slot FROM starting_items " 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 " "WHERE (race = %i or race = 0) AND (class = %i or class = 0) AND "
@ -419,7 +419,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, InventoryOld *inv, bool is_charid)
aug[4] = (uint32)atoi(row[7]); aug[4] = (uint32)atoi(row[7]);
aug[5] = (uint32)atoi(row[8]); aug[5] = (uint32)atoi(row[8]);
const Item_Struct *item = GetItem(item_id); const ItemData *item = GetItem(item_id);
if (!item) { if (!item) {
Log.Out(Logs::General, Logs::Error, Log.Out(Logs::General, Logs::Error,
@ -521,7 +521,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, InventoryOld *inv)
uint32 ornament_idfile = (uint32)atoul(row[13]); uint32 ornament_idfile = (uint32)atoul(row[13]);
uint32 ornament_hero_model = (uint32)atoul(row[14]); uint32 ornament_hero_model = (uint32)atoul(row[14]);
const Item_Struct *item = GetItem(item_id); const ItemData *item = GetItem(item_id);
if (!item) { if (!item) {
Log.Out(Logs::General, Logs::Error, Log.Out(Logs::General, Logs::Error,
@ -662,7 +662,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, InventoryOld *i
uint32 ornament_idfile = (uint32)atoul(row[13]); uint32 ornament_idfile = (uint32)atoul(row[13]);
uint32 ornament_hero_model = (uint32)atoul(row[14]); uint32 ornament_hero_model = (uint32)atoul(row[14]);
const Item_Struct *item = GetItem(item_id); const ItemData *item = GetItem(item_id);
int16 put_slot_id = INVALID_INDEX; int16 put_slot_id = INVALID_INDEX;
if (!item) if (!item)
continue; continue;
@ -806,12 +806,12 @@ bool SharedDatabase::LoadItems() {
if(items == -1) { if(items == -1) {
EQ_EXCEPT("SharedDatabase", "Database returned no result"); EQ_EXCEPT("SharedDatabase", "Database returned no result");
} }
uint32 size = static_cast<uint32>(EQEmu::FixedMemoryHashSet<Item_Struct>::estimated_size(items, max_item)); uint32 size = static_cast<uint32>(EQEmu::FixedMemoryHashSet<ItemData>::estimated_size(items, max_item));
if(items_mmf->Size() != size) { if(items_mmf->Size() != size) {
EQ_EXCEPT("SharedDatabase", "Couldn't load items because items_mmf->Size() != size"); EQ_EXCEPT("SharedDatabase", "Couldn't load items because items_mmf->Size() != size");
} }
items_hash = new EQEmu::FixedMemoryHashSet<Item_Struct>(reinterpret_cast<uint8*>(items_mmf->Get()), size); items_hash = new EQEmu::FixedMemoryHashSet<ItemData>(reinterpret_cast<uint8*>(items_mmf->Get()), size);
mutex.Unlock(); mutex.Unlock();
} catch(std::exception& ex) { } catch(std::exception& ex) {
Log.Out(Logs::General, Logs::Error, "Error Loading Items: %s", ex.what()); Log.Out(Logs::General, Logs::Error, "Error Loading Items: %s", ex.what());
@ -822,7 +822,7 @@ bool SharedDatabase::LoadItems() {
} }
void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_item_id) { 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<ItemData> hash(reinterpret_cast<uint8*>(data), size, items, max_item_id);
char ndbuffer[4]; char ndbuffer[4];
bool disableNoRent = false; bool disableNoRent = false;
@ -850,7 +850,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
} }
} }
Item_Struct item; ItemData item;
const std::string query = "SELECT source," const std::string query = "SELECT source,"
#define F(x) "`"#x"`," #define F(x) "`"#x"`,"
@ -863,7 +863,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
} }
for(auto row = results.begin(); row != results.end(); ++row) { for(auto row = results.begin(); row != results.end(); ++row) {
memset(&item, 0, sizeof(Item_Struct)); memset(&item, 0, sizeof(ItemData));
item.ItemClass = (uint8)atoi(row[ItemField::itemclass]); item.ItemClass = (uint8)atoi(row[ItemField::itemclass]);
strcpy(item.Name,row[ItemField::name]); strcpy(item.Name,row[ItemField::name]);
@ -1078,7 +1078,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
} }
const Item_Struct* SharedDatabase::GetItem(uint32 id) { const ItemData* SharedDatabase::GetItem(uint32 id) {
if (id == 0) if (id == 0)
{ {
return nullptr; return nullptr;
@ -1097,7 +1097,7 @@ const Item_Struct* SharedDatabase::GetItem(uint32 id) {
return nullptr; return nullptr;
} }
const Item_Struct* SharedDatabase::IterateItems(uint32* id) { const ItemData* SharedDatabase::IterateItems(uint32* id) {
if(!items_hash || !id) { if(!items_hash || !id) {
return nullptr; return nullptr;
} }
@ -1255,7 +1255,7 @@ bool SharedDatabase::LoadNPCFactionLists() {
// Create appropriate ItemInst class // 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) 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 ItemData* item = nullptr;
ItemInst* inst = nullptr; ItemInst* inst = nullptr;
item = GetItem(item_id); item = GetItem(item_id);
@ -1282,7 +1282,7 @@ ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1,
// Create appropriate ItemInst class // 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 ItemData* item, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, uint8 attuned)
{ {
ItemInst* inst = nullptr; ItemInst* inst = nullptr;
if (item) { if (item) {
@ -1306,7 +1306,7 @@ ItemInst* SharedDatabase::CreateItem(const Item_Struct* item, int16 charges, uin
return inst; return inst;
} }
ItemInst* SharedDatabase::CreateBaseItem(const Item_Struct* item, int16 charges) { ItemInst* SharedDatabase::CreateBaseItem(const ItemData* item, int16 charges) {
ItemInst* inst = nullptr; ItemInst* inst = nullptr;
if (item) { if (item) {
// if maxcharges is -1 that means it is an unlimited use item. // if maxcharges is -1 that means it is an unlimited use item.

View File

@ -20,7 +20,7 @@ struct BaseDataStruct;
struct InspectMessage_Struct; struct InspectMessage_Struct;
struct PlayerProfile_Struct; struct PlayerProfile_Struct;
struct SPDat_Spell_Struct; struct SPDat_Spell_Struct;
struct Item_Struct; struct ItemData;
struct NPCFactionList; struct NPCFactionList;
struct LootTable_Struct; struct LootTable_Struct;
struct LootDrop_Struct; struct LootDrop_Struct;
@ -82,8 +82,8 @@ class SharedDatabase : public Database
Item Methods 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(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* CreateItem(const ItemData* 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* CreateBaseItem(const ItemData* item, int16 charges = 0);
/* /*
Shared Memory crap Shared Memory crap
@ -93,8 +93,8 @@ class SharedDatabase : public Database
void GetItemsCount(int32 &item_count, uint32 &max_id); void GetItemsCount(int32 &item_count, uint32 &max_id);
void LoadItems(void *data, uint32 size, int32 items, uint32 max_item_id); void LoadItems(void *data, uint32 size, int32 items, uint32 max_item_id);
bool LoadItems(); bool LoadItems();
const Item_Struct* IterateItems(uint32* id); const ItemData* IterateItems(uint32* id);
const Item_Struct* GetItem(uint32 id); const ItemData* GetItem(uint32 id);
const EvolveInfo* GetEvolveInfo(uint32 loregroup); const EvolveInfo* GetEvolveInfo(uint32 loregroup);
//faction lists //faction lists
@ -130,7 +130,7 @@ class SharedDatabase : public Database
EQEmu::MemoryMappedFile *skill_caps_mmf; EQEmu::MemoryMappedFile *skill_caps_mmf;
EQEmu::MemoryMappedFile *items_mmf; EQEmu::MemoryMappedFile *items_mmf;
EQEmu::FixedMemoryHashSet<Item_Struct> *items_hash; EQEmu::FixedMemoryHashSet<ItemData> *items_hash;
EQEmu::MemoryMappedFile *faction_mmf; EQEmu::MemoryMappedFile *faction_mmf;
EQEmu::FixedMemoryHashSet<NPCFactionList> *faction_hash; EQEmu::FixedMemoryHashSet<NPCFactionList> *faction_hash;
EQEmu::MemoryMappedFile *loot_table_mmf; EQEmu::MemoryMappedFile *loot_table_mmf;

View File

@ -22,7 +22,7 @@
#include "../common/ipc_mutex.h" #include "../common/ipc_mutex.h"
#include "../common/memory_mapped_file.h" #include "../common/memory_mapped_file.h"
#include "../common/eqemu_exception.h" #include "../common/eqemu_exception.h"
#include "../common/item_struct.h" #include "../common/item_data.h"
void LoadItems(SharedDatabase *database) { void LoadItems(SharedDatabase *database) {
EQEmu::IPCMutex mutex("items"); EQEmu::IPCMutex mutex("items");
@ -35,7 +35,7 @@ void LoadItems(SharedDatabase *database) {
EQ_EXCEPT("Shared Memory", "Unable to get any items from the database."); EQ_EXCEPT("Shared Memory", "Unable to get any items from the database.");
} }
uint32 size = static_cast<uint32>(EQEmu::FixedMemoryHashSet<Item_Struct>::estimated_size(items, max_item)); uint32 size = static_cast<uint32>(EQEmu::FixedMemoryHashSet<ItemData>::estimated_size(items, max_item));
EQEmu::MemoryMappedFile mmf("shared/items", size); EQEmu::MemoryMappedFile mmf("shared/items", size);
mmf.ZeroFile(); mmf.ZeroFile();

View File

@ -27,7 +27,7 @@ class FixedMemoryHashTest : public Test::Suite {
typedef void(FixedMemoryHashTest::*TestFunction)(void); typedef void(FixedMemoryHashTest::*TestFunction)(void);
public: public:
FixedMemoryHashTest() { FixedMemoryHashTest() {
size_ = EQEmu::FixedMemoryHashSet<Item_Struct>::estimated_size(72000, 190000); size_ = EQEmu::FixedMemoryHashSet<ItemData>::estimated_size(72000, 190000);
data_ = new uint8[size_]; data_ = new uint8[size_];
memset(data_, 0, size_); memset(data_, 0, size_);
TEST_ADD(FixedMemoryHashTest::InitTest); TEST_ADD(FixedMemoryHashTest::InitTest);
@ -49,7 +49,7 @@ public:
private: private:
void InitTest() { void InitTest() {
EQEmu::FixedMemoryHashSet<Item_Struct> hash(data_, size_, 72000, 190000); EQEmu::FixedMemoryHashSet<ItemData> hash(data_, size_, 72000, 190000);
TEST_ASSERT(!hash.exists(1001)); TEST_ASSERT(!hash.exists(1001));
TEST_ASSERT(hash.size() == 0); TEST_ASSERT(hash.size() == 0);
TEST_ASSERT(hash.max_size() == 72000); TEST_ASSERT(hash.max_size() == 72000);
@ -57,7 +57,7 @@ public:
} }
void LoadTest() { void LoadTest() {
EQEmu::FixedMemoryHashSet<Item_Struct> hash(data_, size_); EQEmu::FixedMemoryHashSet<ItemData> hash(data_, size_);
TEST_ASSERT(!hash.exists(1001)); TEST_ASSERT(!hash.exists(1001));
TEST_ASSERT(hash.size() == 0); TEST_ASSERT(hash.size() == 0);
TEST_ASSERT(hash.max_size() == 72000); TEST_ASSERT(hash.max_size() == 72000);
@ -65,8 +65,8 @@ public:
} }
void InsertTest() { void InsertTest() {
EQEmu::FixedMemoryHashSet<Item_Struct> hash(data_, size_); EQEmu::FixedMemoryHashSet<ItemData> hash(data_, size_);
Item_Struct item; ItemData item;
memset(&item, 0, sizeof(item)); memset(&item, 0, sizeof(item));
strcpy(item.Name, "Iron Sword"); strcpy(item.Name, "Iron Sword");
item.ID = 1001; item.ID = 1001;
@ -79,20 +79,20 @@ public:
} }
void RetrieveTest() { void RetrieveTest() {
EQEmu::FixedMemoryHashSet<Item_Struct> hash(data_, size_); EQEmu::FixedMemoryHashSet<ItemData> hash(data_, size_);
TEST_ASSERT(hash.exists(1001)); TEST_ASSERT(hash.exists(1001));
TEST_ASSERT(hash.size() == 1); TEST_ASSERT(hash.size() == 1);
TEST_ASSERT(hash.max_size() == 72000); TEST_ASSERT(hash.max_size() == 72000);
TEST_ASSERT(!hash.empty()); TEST_ASSERT(!hash.empty());
Item_Struct item = hash[1001]; ItemData item = hash[1001];
TEST_ASSERT(strcmp(item.Name, "Iron Sword") == 0); TEST_ASSERT(strcmp(item.Name, "Iron Sword") == 0);
TEST_ASSERT(item.ID == 1001); TEST_ASSERT(item.ID == 1001);
} }
void OverwriteTest() { void OverwriteTest() {
EQEmu::FixedMemoryHashSet<Item_Struct> hash(data_, size_); EQEmu::FixedMemoryHashSet<ItemData> hash(data_, size_);
Item_Struct item; ItemData item;
memset(&item, 0, sizeof(item)); memset(&item, 0, sizeof(item));
strcpy(item.Name, "Steel Sword"); strcpy(item.Name, "Steel Sword");
item.ID = 1001; item.ID = 1001;
@ -105,20 +105,20 @@ public:
} }
void OverwriteRetrieveTest() { void OverwriteRetrieveTest() {
EQEmu::FixedMemoryHashSet<Item_Struct> hash(data_, size_); EQEmu::FixedMemoryHashSet<ItemData> hash(data_, size_);
TEST_ASSERT(hash.exists(1001)); TEST_ASSERT(hash.exists(1001));
TEST_ASSERT(hash.size() == 1); TEST_ASSERT(hash.size() == 1);
TEST_ASSERT((hash.max_size() == 72000)); TEST_ASSERT((hash.max_size() == 72000));
TEST_ASSERT(!hash.empty()); TEST_ASSERT(!hash.empty());
Item_Struct item = hash[1001]; ItemData item = hash[1001];
TEST_ASSERT(strcmp(item.Name, "Steel Sword") == 0); TEST_ASSERT(strcmp(item.Name, "Steel Sword") == 0);
TEST_ASSERT(item.ID == 1001); TEST_ASSERT(item.ID == 1001);
} }
void InsertAgainTest() { void InsertAgainTest() {
EQEmu::FixedMemoryHashSet<Item_Struct> hash(data_, size_); EQEmu::FixedMemoryHashSet<ItemData> hash(data_, size_);
Item_Struct item; ItemData item;
memset(&item, 0, sizeof(item)); memset(&item, 0, sizeof(item));
strcpy(item.Name, "Iron Sword"); strcpy(item.Name, "Iron Sword");
item.ID = 1000; item.ID = 1000;
@ -132,14 +132,14 @@ public:
} }
void RetrieveAgainTest() { void RetrieveAgainTest() {
EQEmu::FixedMemoryHashSet<Item_Struct> hash(data_, size_); EQEmu::FixedMemoryHashSet<ItemData> hash(data_, size_);
TEST_ASSERT(hash.exists(1000)); TEST_ASSERT(hash.exists(1000));
TEST_ASSERT(hash.exists(1001)); TEST_ASSERT(hash.exists(1001));
TEST_ASSERT(hash.size() == 2); TEST_ASSERT(hash.size() == 2);
TEST_ASSERT(hash.max_size() == 72000); TEST_ASSERT(hash.max_size() == 72000);
TEST_ASSERT(!hash.empty()); TEST_ASSERT(!hash.empty());
Item_Struct item = hash[1000]; ItemData item = hash[1000];
TEST_ASSERT(strcmp(item.Name, "Iron Sword") == 0); TEST_ASSERT(strcmp(item.Name, "Iron Sword") == 0);
TEST_ASSERT(item.ID == 1000); TEST_ASSERT(item.ID == 1000);
@ -149,8 +149,8 @@ public:
} }
void InsertBeginTest() { void InsertBeginTest() {
EQEmu::FixedMemoryHashSet<Item_Struct> hash(data_, size_); EQEmu::FixedMemoryHashSet<ItemData> hash(data_, size_);
Item_Struct item; ItemData item;
memset(&item, 0, sizeof(item)); memset(&item, 0, sizeof(item));
strcpy(item.Name, "Bronze Sword"); strcpy(item.Name, "Bronze Sword");
item.ID = 0; item.ID = 0;
@ -165,7 +165,7 @@ public:
} }
void RetrieveBeginTest() { void RetrieveBeginTest() {
EQEmu::FixedMemoryHashSet<Item_Struct> hash(data_, size_); EQEmu::FixedMemoryHashSet<ItemData> hash(data_, size_);
TEST_ASSERT(hash.exists(1000)); TEST_ASSERT(hash.exists(1000));
TEST_ASSERT(hash.exists(1001)); TEST_ASSERT(hash.exists(1001));
TEST_ASSERT(hash.exists(0)); TEST_ASSERT(hash.exists(0));
@ -173,7 +173,7 @@ public:
TEST_ASSERT(hash.max_size() == 72000); TEST_ASSERT(hash.max_size() == 72000);
TEST_ASSERT(!hash.empty()); TEST_ASSERT(!hash.empty());
Item_Struct item = hash[1000]; ItemData item = hash[1000];
TEST_ASSERT(strcmp(item.Name, "Iron Sword") == 0); TEST_ASSERT(strcmp(item.Name, "Iron Sword") == 0);
TEST_ASSERT(item.ID == 1000); TEST_ASSERT(item.ID == 1000);
@ -187,8 +187,8 @@ public:
} }
void InsertEndTest() { void InsertEndTest() {
EQEmu::FixedMemoryHashSet<Item_Struct> hash(data_, size_); EQEmu::FixedMemoryHashSet<ItemData> hash(data_, size_);
Item_Struct item; ItemData item;
memset(&item, 0, sizeof(item)); memset(&item, 0, sizeof(item));
strcpy(item.Name, "Jade Sword"); strcpy(item.Name, "Jade Sword");
item.ID = 190000; item.ID = 190000;
@ -204,7 +204,7 @@ public:
} }
void RetrieveEndTest() { void RetrieveEndTest() {
EQEmu::FixedMemoryHashSet<Item_Struct> hash(data_, size_); EQEmu::FixedMemoryHashSet<ItemData> hash(data_, size_);
TEST_ASSERT(hash.exists(1000)); TEST_ASSERT(hash.exists(1000));
TEST_ASSERT(hash.exists(1001)); TEST_ASSERT(hash.exists(1001));
TEST_ASSERT(hash.exists(0)); TEST_ASSERT(hash.exists(0));
@ -213,7 +213,7 @@ public:
TEST_ASSERT(hash.max_size() == 72000); TEST_ASSERT(hash.max_size() == 72000);
TEST_ASSERT(!hash.empty()); TEST_ASSERT(!hash.empty());
Item_Struct item = hash[1000]; ItemData item = hash[1000];
TEST_ASSERT(strcmp(item.Name, "Iron Sword") == 0); TEST_ASSERT(strcmp(item.Name, "Iron Sword") == 0);
TEST_ASSERT(item.ID == 1000); TEST_ASSERT(item.ID == 1000);

View File

@ -170,7 +170,7 @@ void WorldDatabase::GetCharSelectInfo(uint32 account_id, CharacterSelect_Struct*
inv = new InventoryOld; inv = new InventoryOld;
if (GetInventory(account_id, cs->name[char_num], inv)) if (GetInventory(account_id, cs->name[char_num], inv))
{ {
const Item_Struct* item = nullptr; const ItemData* item = nullptr;
const ItemInst* inst = nullptr; const ItemInst* inst = nullptr;
int16 invslot = 0; int16 invslot = 0;

View File

@ -879,7 +879,7 @@ void Mob::WakeTheDead(uint16 spell_id, Mob *target, uint32 duration)
uint32 sitem = 0; uint32 sitem = 0;
sitem = CorpseToUse->GetWornItem(x); sitem = CorpseToUse->GetWornItem(x);
if(sitem){ if(sitem){
const Item_Struct * itm = database.GetItem(sitem); const ItemData * itm = database.GetItem(sitem);
npca->AddLootDrop(itm, &npca->itemlist, 1, 1, 127, true, true); npca->AddLootDrop(itm, &npca->itemlist, 1, 1, 127, true, true);
} }
} }

View File

@ -55,7 +55,7 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w
// Determine animation // Determine animation
int type = 0; int type = 0;
if (weapon && weapon->IsType(ItemClassCommon)) { if (weapon && weapon->IsType(ItemClassCommon)) {
const Item_Struct* item = weapon->GetItem(); const ItemData* item = weapon->GetItem();
Log.Out(Logs::Detail, Logs::Attack, "Weapon skill : %i", item->ItemType); Log.Out(Logs::Detail, Logs::Attack, "Weapon skill : %i", item->ItemType);
@ -806,9 +806,9 @@ int32 Client::GetMeleeMitDmg(Mob *attacker, int32 damage, int32 minhit,
//Returns the weapon damage against the input mob //Returns the weapon damage against the input mob
//if we cannot hit the mob with the current weapon we will get a value less than or equal to zero //if we cannot hit the mob with the current weapon we will get a value less than or equal to zero
//Else we know we can hit. //Else we know we can hit.
//GetWeaponDamage(mob*, const Item_Struct*) is intended to be used for mobs or any other situation where we do not have a client inventory item //GetWeaponDamage(mob*, const ItemData*) is intended to be used for mobs or any other situation where we do not have a client inventory item
//GetWeaponDamage(mob*, const ItemInst*) is intended to be used for situations where we have a client inventory item //GetWeaponDamage(mob*, const ItemInst*) is intended to be used for situations where we have a client inventory item
int Mob::GetWeaponDamage(Mob *against, const Item_Struct *weapon_item) { int Mob::GetWeaponDamage(Mob *against, const ItemData *weapon_item) {
int dmg = 0; int dmg = 0;
int banedmg = 0; int banedmg = 0;
@ -924,7 +924,7 @@ int Mob::GetWeaponDamage(Mob *against, const ItemInst *weapon_item, uint32 *hate
//check for items being illegally attained //check for items being illegally attained
if(weapon_item){ if(weapon_item){
const Item_Struct *mWeaponItem = weapon_item->GetItem(); const ItemData *mWeaponItem = weapon_item->GetItem();
if(mWeaponItem){ if(mWeaponItem){
if(mWeaponItem->ReqLevel > GetLevel()){ if(mWeaponItem->ReqLevel > GetLevel()){
return 0; return 0;
@ -1246,7 +1246,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
// Damage bonuses apply only to hits from the main hand (Hand == MainPrimary) by characters level 28 and above // Damage bonuses apply only to hits from the main hand (Hand == MainPrimary) by characters level 28 and above
// who belong to a melee class. If we're here, then all of these conditions apply. // who belong to a melee class. If we're here, then all of these conditions apply.
ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const Item_Struct*) nullptr ); ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const ItemData*) nullptr );
min_hit += (int) ucDamageBonus; min_hit += (int) ucDamageBonus;
max_hit += (int) ucDamageBonus; max_hit += (int) ucDamageBonus;
@ -1257,7 +1257,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
if (Hand == MainSecondary) { if (Hand == MainSecondary) {
if (aabonuses.SecondaryDmgInc || itembonuses.SecondaryDmgInc || spellbonuses.SecondaryDmgInc){ if (aabonuses.SecondaryDmgInc || itembonuses.SecondaryDmgInc || spellbonuses.SecondaryDmgInc){
ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const Item_Struct*) nullptr ); ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const ItemData*) nullptr );
min_hit += (int) ucDamageBonus; min_hit += (int) ucDamageBonus;
max_hit += (int) ucDamageBonus; max_hit += (int) ucDamageBonus;
@ -1739,7 +1739,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
} }
//figure out what weapon they are using, if any //figure out what weapon they are using, if any
const Item_Struct* weapon = nullptr; const ItemData* weapon = nullptr;
if (Hand == MainPrimary && equipment[MainPrimary] > 0) if (Hand == MainPrimary && equipment[MainPrimary] > 0)
weapon = database.GetItem(equipment[MainPrimary]); weapon = database.GetItem(equipment[MainPrimary]);
else if (equipment[MainSecondary]) else if (equipment[MainSecondary])
@ -2642,7 +2642,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) {
} }
} }
uint8 Mob::GetWeaponDamageBonus( const Item_Struct *Weapon ) uint8 Mob::GetWeaponDamageBonus( const ItemData *Weapon )
{ {
// This function calculates and returns the damage bonus for the weapon identified by the parameter "Weapon". // This function calculates and returns the damage bonus for the weapon identified by the parameter "Weapon".
// Modified 9/21/2008 by Cantus // Modified 9/21/2008 by Cantus
@ -3946,12 +3946,12 @@ void Mob::TryWeaponProc(const ItemInst* weapon_g, Mob *on, uint16 hand) {
} }
if(!weapon_g) { if(!weapon_g) {
TrySpellProc(nullptr, (const Item_Struct*)nullptr, on); TrySpellProc(nullptr, (const ItemData*)nullptr, on);
return; return;
} }
if(!weapon_g->IsType(ItemClassCommon)) { if(!weapon_g->IsType(ItemClassCommon)) {
TrySpellProc(nullptr, (const Item_Struct*)nullptr, on); TrySpellProc(nullptr, (const ItemData*)nullptr, on);
return; return;
} }
@ -3964,7 +3964,7 @@ void Mob::TryWeaponProc(const ItemInst* weapon_g, Mob *on, uint16 hand) {
return; return;
} }
void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, uint16 hand) void Mob::TryWeaponProc(const ItemInst *inst, const ItemData *weapon, Mob *on, uint16 hand)
{ {
if (!weapon) if (!weapon)
@ -4017,7 +4017,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on
const ItemInst *aug_i = inst->GetAugment(r); const ItemInst *aug_i = inst->GetAugment(r);
if (!aug_i) // no aug, try next slot! if (!aug_i) // no aug, try next slot!
continue; continue;
const Item_Struct *aug = aug_i->GetItem(); const ItemData *aug = aug_i->GetItem();
if (!aug) if (!aug)
continue; continue;
@ -4047,7 +4047,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on
return; return;
} }
void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, uint16 hand) void Mob::TrySpellProc(const ItemInst *inst, const ItemData *weapon, Mob *on, uint16 hand)
{ {
float ProcBonus = static_cast<float>(spellbonuses.SpellProcChance + float ProcBonus = static_cast<float>(spellbonuses.SpellProcChance +
itembonuses.SpellProcChance + aabonuses.SpellProcChance); itembonuses.SpellProcChance + aabonuses.SpellProcChance);
@ -4859,7 +4859,7 @@ void Client::SetAttackTimer()
attack_timer.SetAtTrigger(4000, true); attack_timer.SetAtTrigger(4000, true);
Timer *TimerToUse = nullptr; Timer *TimerToUse = nullptr;
const Item_Struct *PrimaryWeapon = nullptr; const ItemData *PrimaryWeapon = nullptr;
for (int i = MainRange; i <= MainSecondary; i++) { for (int i = MainRange; i <= MainSecondary; i++) {
//pick a timer //pick a timer
@ -4872,7 +4872,7 @@ void Client::SetAttackTimer()
else //invalid slot (hands will always hit this) else //invalid slot (hands will always hit this)
continue; continue;
const Item_Struct *ItemToUse = nullptr; const ItemData *ItemToUse = nullptr;
//find our item //find our item
ItemInst *ci = GetInv().GetItem(i); ItemInst *ci = GetInv().GetItem(i);

View File

@ -151,7 +151,7 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
AddItemBonuses(inst, newbon); AddItemBonuses(inst, newbon);
//These are given special flags due to how often they are checked for various spell effects. //These are given special flags due to how often they are checked for various spell effects.
const Item_Struct *item = inst->GetItem(); const ItemData *item = inst->GetItem();
if (i == MainSecondary && (item && item->ItemType == ItemTypeShield)) if (i == MainSecondary && (item && item->ItemType == ItemTypeShield))
SetShieldEquiped(true); SetShieldEquiped(true);
else if (i == MainPrimary && (item && item->ItemType == ItemType2HBlunt)) else if (i == MainPrimary && (item && item->ItemType == ItemType2HBlunt))
@ -206,7 +206,7 @@ void Client::AddItemBonuses(const ItemInst *inst, StatBonuses* newbon, bool isAu
return; return;
} }
const Item_Struct *item = inst->GetItem(); const ItemData *item = inst->GetItem();
if(!isTribute && !inst->IsEquipable(GetBaseRace(),GetClass())) if(!isTribute && !inst->IsEquipable(GetBaseRace(),GetClass()))
{ {
@ -570,7 +570,7 @@ void Client::AdditiveWornBonuses(const ItemInst *inst, StatBonuses* newbon, bool
if(inst->GetAugmentType()==0 && isAug == true) if(inst->GetAugmentType()==0 && isAug == true)
return; return;
const Item_Struct *item = inst->GetItem(); const ItemData *item = inst->GetItem();
if(!inst->IsEquipable(GetBaseRace(),GetClass())) if(!inst->IsEquipable(GetBaseRace(),GetClass()))
return; return;
@ -602,7 +602,7 @@ void Client::CalcEdibleBonuses(StatBonuses* newbon) {
break; break;
const ItemInst* inst = GetInv().GetItem(i); const ItemInst* inst = GetInv().GetItem(i);
if (inst && inst->GetItem() && inst->IsType(ItemClassCommon)) { if (inst && inst->GetItem() && inst->IsType(ItemClassCommon)) {
const Item_Struct *item=inst->GetItem(); const ItemData *item=inst->GetItem();
if (item->ItemType == ItemTypeFood && !food) if (item->ItemType == ItemTypeFood && !food)
food = true; food = true;
else if (item->ItemType == ItemTypeDrink && !drink) else if (item->ItemType == ItemTypeDrink && !drink)
@ -618,7 +618,7 @@ void Client::CalcEdibleBonuses(StatBonuses* newbon) {
break; break;
const ItemInst* inst = GetInv().GetItem(i); const ItemInst* inst = GetInv().GetItem(i);
if (inst && inst->GetItem() && inst->IsType(ItemClassCommon)) { if (inst && inst->GetItem() && inst->IsType(ItemClassCommon)) {
const Item_Struct *item=inst->GetItem(); const ItemData *item=inst->GetItem();
if (item->ItemType == ItemTypeFood && !food) if (item->ItemType == ItemTypeFood && !food)
food = true; food = true;
else if (item->ItemType == ItemTypeDrink && !drink) else if (item->ItemType == ItemTypeDrink && !drink)
@ -3053,7 +3053,7 @@ void NPC::CalcItemBonuses(StatBonuses *newbon)
if(newbon){ if(newbon){
for(int i = 0; i < EmuConstants::EQUIPMENT_SIZE; i++){ for(int i = 0; i < EmuConstants::EQUIPMENT_SIZE; i++){
const Item_Struct *cur = database.GetItem(equipment[i]); const ItemData *cur = database.GetItem(equipment[i]);
if(cur){ if(cur){
//basic stats //basic stats
newbon->AC += cur->AC; newbon->AC += cur->AC;

View File

@ -247,8 +247,8 @@ uint32 Bot::GetBotArcheryRange()
if (!range_inst || !ammo_inst) if (!range_inst || !ammo_inst)
return 0; return 0;
const Item_Struct *range_item = range_inst->GetItem(); const ItemData *range_item = range_inst->GetItem();
const Item_Struct *ammo_item = ammo_inst->GetItem(); const ItemData *ammo_item = ammo_inst->GetItem();
// no item struct for whatever reason // no item struct for whatever reason
if (!range_item || !ammo_item) if (!range_item || !ammo_item)
@ -2991,12 +2991,12 @@ void Bot::BotRangedAttack(Mob* other) {
} }
ItemInst* rangedItem = GetBotItem(MainRange); ItemInst* rangedItem = GetBotItem(MainRange);
const Item_Struct* RangeWeapon = 0; const ItemData* RangeWeapon = 0;
if(rangedItem) if(rangedItem)
RangeWeapon = rangedItem->GetItem(); RangeWeapon = rangedItem->GetItem();
ItemInst* ammoItem = GetBotItem(MainAmmo); ItemInst* ammoItem = GetBotItem(MainAmmo);
const Item_Struct* Ammo = 0; const ItemData* Ammo = 0;
if(ammoItem) if(ammoItem)
Ammo = ammoItem->GetItem(); Ammo = ammoItem->GetItem();
@ -3120,7 +3120,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
if(GetLevel() >= 28 && IsWarriorClass() ) if(GetLevel() >= 28 && IsWarriorClass() )
{ {
int ucDamageBonus = GetWeaponDamageBonus((const Item_Struct*) nullptr ); int ucDamageBonus = GetWeaponDamageBonus((const ItemData*) nullptr );
min_hit += (int) ucDamageBonus; min_hit += (int) ucDamageBonus;
max_hit += (int) ucDamageBonus; max_hit += (int) ucDamageBonus;
@ -3165,7 +3165,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
if(skillinuse == SkillBash){ if(skillinuse == SkillBash){
const ItemInst* inst = GetBotItem(MainSecondary); const ItemInst* inst = GetBotItem(MainSecondary);
const Item_Struct* botweapon = 0; const ItemData* botweapon = 0;
if(inst) if(inst)
botweapon = inst->GetItem(); botweapon = inst->GetItem();
if(botweapon) { if(botweapon) {
@ -3230,7 +3230,7 @@ void Bot::ApplySpecialAttackMod(SkillUseTypes skill, int32 &dmg, int32 &mindmg)
if (item_slot >= EmuConstants::EQUIPMENT_BEGIN){ if (item_slot >= EmuConstants::EQUIPMENT_BEGIN){
const ItemInst* inst = GetBotItem(item_slot); const ItemInst* inst = GetBotItem(item_slot);
const Item_Struct* botweapon = 0; const ItemData* botweapon = 0;
if(inst) if(inst)
botweapon = inst->GetItem(); botweapon = inst->GetItem();
if(botweapon) if(botweapon)
@ -3645,7 +3645,7 @@ void Bot::AI_Process() {
//now off hand //now off hand
if(GetTarget() && attack_dw_timer.Check() && CanThisClassDualWield()) { if(GetTarget() && attack_dw_timer.Check() && CanThisClassDualWield()) {
const ItemInst* instweapon = GetBotItem(MainSecondary); const ItemInst* instweapon = GetBotItem(MainSecondary);
const Item_Struct* weapon = 0; const ItemData* weapon = 0;
//can only dual wield without a weapon if you're a monk //can only dual wield without a weapon if you're a monk
if(instweapon || (botClass == MONK)) { if(instweapon || (botClass == MONK)) {
if(instweapon) if(instweapon)
@ -4381,7 +4381,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
ns->spawn.helm = helmtexture; //0xFF; ns->spawn.helm = helmtexture; //0xFF;
ns->spawn.equip_chest2 = texture; //0xFF; ns->spawn.equip_chest2 = texture; //0xFF;
const Item_Struct* item = 0; const ItemData* item = 0;
const ItemInst* inst = 0; const ItemInst* inst = 0;
uint32 spawnedbotid = 0; uint32 spawnedbotid = 0;
@ -5682,7 +5682,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
//EQoffline: will give the items to the bots and change the bot stats //EQoffline: will give the items to the bots and change the bot stats
if(inst && (GetBotOwner() == client->CastToMob()) && !IsEngaged()) { if(inst && (GetBotOwner() == client->CastToMob()) && !IsEngaged()) {
std::string TempErrorMessage; std::string TempErrorMessage;
const Item_Struct* mWeaponItem = inst->GetItem(); const ItemData* mWeaponItem = inst->GetItem();
bool failedLoreCheck = false; bool failedLoreCheck = false;
for (int m = AUG_BEGIN; m <EmuConstants::ITEM_COMMON_SIZE; ++m) { for (int m = AUG_BEGIN; m <EmuConstants::ITEM_COMMON_SIZE; ++m) {
ItemInst *itm = inst->GetAugment(m); ItemInst *itm = inst->GetAugment(m);
@ -5855,7 +5855,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
} }
} }
const Item_Struct* item2 = 0; const ItemData* item2 = 0;
for(int y=beginSlotID; y<=endSlotID; ++y) { for(int y=beginSlotID; y<=endSlotID; ++y) {
item2 = database.GetItem(items[y]); item2 = database.GetItem(items[y]);
if(item2) { if(item2) {
@ -6156,7 +6156,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
// Damage bonuses apply only to hits from the main hand (Hand == MainPrimary) by characters level 28 and above // Damage bonuses apply only to hits from the main hand (Hand == MainPrimary) by characters level 28 and above
// who belong to a melee class. If we're here, then all of these conditions apply. // who belong to a melee class. If we're here, then all of these conditions apply.
ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const Item_Struct*) nullptr ); ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const ItemData*) nullptr );
min_hit += (int) ucDamageBonus; min_hit += (int) ucDamageBonus;
max_hit += (int) ucDamageBonus; max_hit += (int) ucDamageBonus;
@ -6167,7 +6167,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
if (Hand==MainSecondary) { if (Hand==MainSecondary) {
if (aabonuses.SecondaryDmgInc || itembonuses.SecondaryDmgInc || spellbonuses.SecondaryDmgInc){ if (aabonuses.SecondaryDmgInc || itembonuses.SecondaryDmgInc || spellbonuses.SecondaryDmgInc){
ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const Item_Struct*) nullptr ); ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const ItemData*) nullptr );
min_hit += (int) ucDamageBonus; min_hit += (int) ucDamageBonus;
max_hit += (int) ucDamageBonus; max_hit += (int) ucDamageBonus;
@ -6755,8 +6755,8 @@ int32 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) {
//Check if item focus effect exists for the client. //Check if item focus effect exists for the client.
if (itembonuses.FocusEffects[bottype]){ if (itembonuses.FocusEffects[bottype]){
const Item_Struct* TempItem = 0; const ItemData* TempItem = 0;
const Item_Struct* UsedItem = 0; const ItemData* UsedItem = 0;
const ItemInst* TempInst = 0; const ItemInst* TempInst = 0;
uint16 UsedFocusID = 0; uint16 UsedFocusID = 0;
int32 Total = 0; int32 Total = 0;
@ -6804,7 +6804,7 @@ int32 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) {
aug = ins->GetAugment(y); aug = ins->GetAugment(y);
if(aug) if(aug)
{ {
const Item_Struct* TempItemAug = aug->GetItem(); const ItemData* TempItemAug = aug->GetItem();
if (TempItemAug && TempItemAug->Focus.Effect > 0 && TempItemAug->Focus.Effect != SPELL_UNKNOWN) { if (TempItemAug && TempItemAug->Focus.Effect > 0 && TempItemAug->Focus.Effect != SPELL_UNKNOWN) {
if(rand_effectiveness) { if(rand_effectiveness) {
focus_max = CalcBotFocusEffect(bottype, TempItemAug->Focus.Effect, spell_id, true); focus_max = CalcBotFocusEffect(bottype, TempItemAug->Focus.Effect, spell_id, true);
@ -7686,7 +7686,7 @@ void Bot::DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage,
if(skill == SkillBash) { if(skill == SkillBash) {
const ItemInst* inst = GetBotItem(MainSecondary); const ItemInst* inst = GetBotItem(MainSecondary);
const Item_Struct* botweapon = 0; const ItemData* botweapon = 0;
if(inst) if(inst)
botweapon = inst->GetItem(); botweapon = inst->GetItem();
if(botweapon) { if(botweapon) {
@ -7757,7 +7757,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) {
bool bCanFrontalBS = false; bool bCanFrontalBS = false;
const ItemInst* inst = GetBotItem(MainPrimary); const ItemInst* inst = GetBotItem(MainPrimary);
const Item_Struct* botpiercer = nullptr; const ItemData* botpiercer = nullptr;
if(inst) if(inst)
botpiercer = inst->GetItem(); botpiercer = inst->GetItem();
if(!botpiercer || (botpiercer->ItemType != ItemType1HPiercing)) { if(!botpiercer || (botpiercer->ItemType != ItemType1HPiercing)) {
@ -8396,7 +8396,7 @@ void Bot::EquipBot(std::string* errorMessage) {
GetBotItems(errorMessage, m_inv); GetBotItems(errorMessage, m_inv);
const ItemInst* inst = 0; const ItemInst* inst = 0;
const Item_Struct* item = 0; const ItemData* item = 0;
for(int i = EmuConstants::EQUIPMENT_BEGIN; i <= EmuConstants::EQUIPMENT_END; ++i) { for(int i = EmuConstants::EQUIPMENT_BEGIN; i <= EmuConstants::EQUIPMENT_END; ++i) {
inst = GetBotItem(i); inst = GetBotItem(i);
if(inst) { if(inst) {
@ -8596,7 +8596,7 @@ void Bot::SetAttackTimer() {
attack_timer.SetAtTrigger(4000, true); attack_timer.SetAtTrigger(4000, true);
Timer* TimerToUse = nullptr; Timer* TimerToUse = nullptr;
const Item_Struct* PrimaryWeapon = nullptr; const ItemData* PrimaryWeapon = nullptr;
for (int i = MainRange; i <= MainSecondary; i++) { for (int i = MainRange; i <= MainSecondary; i++) {
//pick a timer //pick a timer
@ -8609,7 +8609,7 @@ void Bot::SetAttackTimer() {
else //invalid slot (hands will always hit this) else //invalid slot (hands will always hit this)
continue; continue;
const Item_Struct* ItemToUse = nullptr; const ItemData* ItemToUse = nullptr;
ItemInst* ci = GetBotItem(i); ItemInst* ci = GetBotItem(i);
if (ci) if (ci)
ItemToUse = ci->GetItem(); ItemToUse = ci->GetItem();
@ -10818,7 +10818,7 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) {
insr->TargetID = inspectedBot->GetNPCTypeID(); insr->TargetID = inspectedBot->GetNPCTypeID();
insr->playerid = inspectedBot->GetID(); insr->playerid = inspectedBot->GetID();
const Item_Struct* item = 0; const ItemData* item = 0;
const ItemInst* inst = 0; const ItemInst* inst = 0;
// Modded to display power source items (will only show up on SoF+ client inspect windows though.) // Modded to display power source items (will only show up on SoF+ client inspect windows though.)
@ -10871,7 +10871,7 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) {
void Bot::CalcItemBonuses() void Bot::CalcItemBonuses()
{ {
memset(&itembonuses, 0, sizeof(StatBonuses)); memset(&itembonuses, 0, sizeof(StatBonuses));
const Item_Struct* itemtmp = 0; const ItemData* itemtmp = 0;
for (int i = EmuConstants::EQUIPMENT_BEGIN; i <= EmuConstants::EQUIPMENT_END; ++i) { for (int i = EmuConstants::EQUIPMENT_BEGIN; i <= EmuConstants::EQUIPMENT_END; ++i) {
const ItemInst* item = GetBotItem(i); const ItemInst* item = GetBotItem(i);
@ -11111,7 +11111,7 @@ void Bot::CalcBotStats(bool showtext) {
} }
} }
bool Bot::CheckLoreConflict(const Item_Struct* item) { bool Bot::CheckLoreConflict(const ItemData* item) {
if (!item) if (!item)
return false; return false;
if (!(item->LoreFlag)) if (!(item->LoreFlag))
@ -11723,7 +11723,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
"Left Finger", "Right Finger", "Chest", "Legs", "Feet", "Waist", "Ammo" }; "Left Finger", "Right Finger", "Chest", "Legs", "Feet", "Waist", "Ammo" };
const ItemInst* inst = nullptr; const ItemInst* inst = nullptr;
const Item_Struct* item = nullptr; const ItemData* item = nullptr;
bool is2Hweapon = false; bool is2Hweapon = false;
std::string item_link; std::string item_link;
@ -11793,7 +11793,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
"Left Wrist", "Right Wrist", "Range", "Hands", "Primary Hand", "Secondary Hand", "Left Wrist", "Right Wrist", "Range", "Hands", "Primary Hand", "Secondary Hand",
"Left Finger", "Right Finger", "Chest", "Legs", "Feet", "Waist", "Ammo" }; "Left Finger", "Right Finger", "Chest", "Legs", "Feet", "Waist", "Ammo" };
const Item_Struct* itm = nullptr; const ItemData* itm = nullptr;
const ItemInst* itminst = c->GetTarget()->CastToBot()->GetBotItem(slotId); const ItemInst* itminst = c->GetTarget()->CastToBot()->GetBotItem(slotId);
if(itminst) if(itminst)
itm = itminst->GetItem(); itm = itminst->GetItem();
@ -16015,7 +16015,7 @@ int Bot::GetRawACNoShield(int &shield_ac)
uint32 Bot::CalcCurrentWeight() { uint32 Bot::CalcCurrentWeight() {
const Item_Struct* TempItem = 0; const ItemData* TempItem = 0;
ItemInst* inst; ItemInst* inst;
uint32 Total = 0; uint32 Total = 0;

View File

@ -330,7 +330,7 @@ public:
void BotTradeSwapItem(Client* client, int16 lootSlot, const ItemInst* inst, const ItemInst* inst_swap, uint32 equipableSlots, std::string* errorMessage, bool swap = true); void BotTradeSwapItem(Client* client, int16 lootSlot, const ItemInst* inst, const ItemInst* inst_swap, uint32 equipableSlots, std::string* errorMessage, bool swap = true);
void BotTradeAddItem(uint32 id, const ItemInst* inst, int16 charges, uint32 equipableSlots, uint16 lootSlot, std::string* errorMessage, bool addToDb = true); void BotTradeAddItem(uint32 id, const ItemInst* inst, int16 charges, uint32 equipableSlots, uint16 lootSlot, std::string* errorMessage, bool addToDb = true);
void EquipBot(std::string* errorMessage); void EquipBot(std::string* errorMessage);
bool CheckLoreConflict(const Item_Struct* item); bool CheckLoreConflict(const ItemData* item);
uint32 GetEquipmentColor(uint8 material_slot) const; uint32 GetEquipmentColor(uint8 material_slot) const;
virtual void UpdateEquipLightValue() { equip_light = m_inv.FindHighestLightValue(); } virtual void UpdateEquipLightValue() { equip_light = m_inv.FindHighestLightValue(); }

View File

@ -2508,7 +2508,7 @@ void Client::SetFeigned(bool in_feigned) {
feigned=in_feigned; feigned=in_feigned;
} }
void Client::LogMerchant(Client* player, Mob* merchant, uint32 quantity, uint32 price, const Item_Struct* item, bool buying) void Client::LogMerchant(Client* player, Mob* merchant, uint32 quantity, uint32 price, const ItemData* item, bool buying)
{ {
if(!player || !merchant || !item) if(!player || !merchant || !item)
return; return;
@ -2702,7 +2702,7 @@ bool Client::BindWound(Mob* bindmob, bool start, bool fail){
} }
void Client::SetMaterial(int16 in_slot, uint32 item_id) { void Client::SetMaterial(int16 in_slot, uint32 item_id) {
const Item_Struct* item = database.GetItem(item_id); const ItemData* item = database.GetItem(item_id);
if (item && (item->ItemClass==ItemClassCommon)) if (item && (item->ItemClass==ItemClassCommon))
{ {
uint8 matslot = InventoryOld::CalcMaterialFromSlot(in_slot); uint8 matslot = InventoryOld::CalcMaterialFromSlot(in_slot);
@ -3748,7 +3748,7 @@ void Client::SendOPTranslocateConfirm(Mob *Caster, uint16 SpellID) {
return; return;
} }
void Client::SendPickPocketResponse(Mob *from, uint32 amt, int type, const Item_Struct* item){ void Client::SendPickPocketResponse(Mob *from, uint32 amt, int type, const ItemData* item){
EQApplicationPacket* outapp = new EQApplicationPacket(OP_PickPocket, sizeof(sPickPocket_Struct)); EQApplicationPacket* outapp = new EQApplicationPacket(OP_PickPocket, sizeof(sPickPocket_Struct));
sPickPocket_Struct* pick_out = (sPickPocket_Struct*) outapp->pBuffer; sPickPocket_Struct* pick_out = (sPickPocket_Struct*) outapp->pBuffer;
pick_out->coin = amt; pick_out->coin = amt;
@ -3920,7 +3920,7 @@ bool Client::KeyRingCheck(uint32 item_id)
void Client::KeyRingList() void Client::KeyRingList()
{ {
Message(4,"Keys on Keyring:"); Message(4,"Keys on Keyring:");
const Item_Struct *item = 0; const ItemData *item = 0;
for(std::list<uint32>::iterator iter = keyring.begin(); for(std::list<uint32>::iterator iter = keyring.begin();
iter != keyring.end(); iter != keyring.end();
++iter) ++iter)
@ -5691,7 +5691,7 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
insr->TargetID = requester->GetID(); insr->TargetID = requester->GetID();
insr->playerid = requestee->GetID(); insr->playerid = requestee->GetID();
const Item_Struct* item = nullptr; const ItemData* item = nullptr;
const ItemInst* inst = nullptr; const ItemInst* inst = nullptr;
int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType); int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
for(int16 L = 0; L <= 20; L++) { for(int16 L = 0; L <= 20; L++) {
@ -5703,7 +5703,7 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
strcpy(insr->itemnames[L], item->Name); strcpy(insr->itemnames[L], item->Name);
if (inst && inst->GetOrnamentationAug(ornamentationAugtype)) if (inst && inst->GetOrnamentationAug(ornamentationAugtype))
{ {
const Item_Struct *aug_item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem(); const ItemData *aug_item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
insr->itemicons[L] = aug_item->Icon; insr->itemicons[L] = aug_item->Icon;
} }
else if (inst && inst->GetOrnamentationIcon()) else if (inst && inst->GetOrnamentationIcon())
@ -6882,7 +6882,7 @@ void Client::SendAltCurrencies() {
uint32 i = 0; uint32 i = 0;
std::list<AltCurrencyDefinition_Struct>::iterator iter = zone->AlternateCurrencies.begin(); std::list<AltCurrencyDefinition_Struct>::iterator iter = zone->AlternateCurrencies.begin();
while(iter != zone->AlternateCurrencies.end()) { while(iter != zone->AlternateCurrencies.end()) {
const Item_Struct* item = database.GetItem((*iter).item_id); const ItemData* item = database.GetItem((*iter).item_id);
altc->entries[i].currency_number = (*iter).id; altc->entries[i].currency_number = (*iter).id;
altc->entries[i].unknown00 = 1; altc->entries[i].unknown00 = 1;
altc->entries[i].currency_number2 = (*iter).id; altc->entries[i].currency_number2 = (*iter).id;
@ -7474,7 +7474,7 @@ void Client::DuplicateLoreMessage(uint32 ItemID)
return; return;
} }
const Item_Struct *item = database.GetItem(ItemID); const ItemData *item = database.GetItem(ItemID);
if(!item) if(!item)
return; return;
@ -8217,7 +8217,7 @@ void Client::SetConsumption(int32 in_hunger, int32 in_thirst)
safe_delete(outapp); safe_delete(outapp);
} }
void Client::Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_consume) void Client::Consume(const ItemData *item, uint8 type, int16 slot, bool auto_consume)
{ {
if(!item) { return; } if(!item) { return; }
@ -8421,7 +8421,7 @@ void Client::TextLink::generate_body()
memset(&m_LinkBodyStruct, 0, sizeof(TextLinkBody_Struct)); memset(&m_LinkBodyStruct, 0, sizeof(TextLinkBody_Struct));
const Item_Struct* item_data = nullptr; const ItemData* item_data = nullptr;
switch (m_LinkType) { switch (m_LinkType) {
case linkBlank: case linkBlank:
@ -8501,7 +8501,7 @@ void Client::TextLink::generate_text()
return; return;
} }
const Item_Struct* item_data = nullptr; const ItemData* item_data = nullptr;
switch (m_LinkType) { switch (m_LinkType) {
case linkBlank: case linkBlank:

View File

@ -27,7 +27,7 @@ class Object;
class Raid; class Raid;
class Seperator; class Seperator;
class ServerPacket; class ServerPacket;
struct Item_Struct; struct ItemData;
#include "../common/timer.h" #include "../common/timer.h"
#include "../common/ptimer.h" #include "../common/ptimer.h"
@ -42,7 +42,7 @@ struct Item_Struct;
#include "../common/seperator.h" #include "../common/seperator.h"
#include "../common/item.h" #include "../common/item.h"
#include "../common/guilds.h" #include "../common/guilds.h"
#include "../common/item_struct.h" #include "../common/item_data.h"
#include "../common/clientversions.h" #include "../common/clientversions.h"
#include "aa.h" #include "aa.h"
@ -288,7 +288,7 @@ public:
void FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho); void FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho);
virtual bool Process(); virtual bool Process();
void LogMerchant(Client* player, Mob* merchant, uint32 quantity, uint32 price, const Item_Struct* item, bool buying); void LogMerchant(Client* player, Mob* merchant, uint32 quantity, uint32 price, const ItemData* item, bool buying);
void SendPacketQueue(bool Block = true); void SendPacketQueue(bool Block = true);
void QueuePacket(const EQApplicationPacket* app, bool ack_req = true, CLIENT_CONN_STATUS = CLIENT_CONNECTINGALL, eqFilterType filter=FilterNone); void QueuePacket(const EQApplicationPacket* app, bool ack_req = true, CLIENT_CONN_STATUS = CLIENT_CONNECTINGALL, eqFilterType filter=FilterNone);
void FastQueuePacket(EQApplicationPacket** app, bool ack_req = true, CLIENT_CONN_STATUS = CLIENT_CONNECTINGALL); void FastQueuePacket(EQApplicationPacket** app, bool ack_req = true, CLIENT_CONN_STATUS = CLIENT_CONNECTINGALL);
@ -396,7 +396,7 @@ public:
inline uint8 GetLanguageSkill(uint16 n) const { return m_pp.languages[n]; } inline uint8 GetLanguageSkill(uint16 n) const { return m_pp.languages[n]; }
void SendPickPocketResponse(Mob *from, uint32 amt, int type, const Item_Struct* item = nullptr); void SendPickPocketResponse(Mob *from, uint32 amt, int type, const ItemData* item = nullptr);
inline const char* GetLastName() const { return lastname; } inline const char* GetLastName() const { return lastname; }
@ -592,7 +592,7 @@ public:
void AssignToInstance(uint16 instance_id); void AssignToInstance(uint16 instance_id);
void RemoveFromInstance(uint16 instance_id); void RemoveFromInstance(uint16 instance_id);
void WhoAll(); void WhoAll();
bool CheckLoreConflict(const Item_Struct* item); bool CheckLoreConflict(const ItemData* item);
void ChangeLastName(const char* in_lastname); void ChangeLastName(const char* in_lastname);
void GetGroupAAs(GroupLeadershipAA_Struct *into) const; void GetGroupAAs(GroupLeadershipAA_Struct *into) const;
void GetRaidAAs(RaidLeadershipAA_Struct *into) const; void GetRaidAAs(RaidLeadershipAA_Struct *into) const;
@ -833,7 +833,7 @@ public:
TextLink() { Reset(); } TextLink() { Reset(); }
void SetLinkType(LinkType linkType) { m_LinkType = linkType; } void SetLinkType(LinkType linkType) { m_LinkType = linkType; }
void SetItemData(const Item_Struct* itemData) { m_ItemData = itemData; } void SetItemData(const ItemData* itemData) { m_ItemData = itemData; }
void SetLootData(const ServerLootItem_Struct* lootData) { m_LootData = lootData; } void SetLootData(const ServerLootItem_Struct* lootData) { m_LootData = lootData; }
void SetItemInst(const ItemInst* itemInst) { m_ItemInst = itemInst; } void SetItemInst(const ItemInst* itemInst) { m_ItemInst = itemInst; }
void SetProxyItemID(uint32 proxyItemID) { m_ProxyItemID = proxyItemID; } // mainly for saylinks..but, not limited to void SetProxyItemID(uint32 proxyItemID) { m_ProxyItemID = proxyItemID; } // mainly for saylinks..but, not limited to
@ -857,7 +857,7 @@ public:
void generate_text(); void generate_text();
int m_LinkType; int m_LinkType;
const Item_Struct* m_ItemData; const ItemData* m_ItemData;
const ServerLootItem_Struct* m_LootData; const ServerLootItem_Struct* m_LootData;
const ItemInst* m_ItemInst; const ItemInst* m_ItemInst;
uint32 m_ProxyItemID; uint32 m_ProxyItemID;
@ -870,7 +870,7 @@ public:
bool m_Error; bool m_Error;
}; };
int GetItemLinkHash(const ItemInst* inst); // move to Item_Struct..or make use of the pre-calculated database field int GetItemLinkHash(const ItemInst* inst); // move to ItemData..or make use of the pre-calculated database field
void SendItemLink(const ItemInst* inst, bool sendtoall=false); void SendItemLink(const ItemInst* inst, bool sendtoall=false);
void SendLootItemInPacket(const ItemInst* inst, int16 slot_id); void SendLootItemInPacket(const ItemInst* inst, int16 slot_id);
@ -1214,7 +1214,7 @@ public:
void LoadAccountFlags(); void LoadAccountFlags();
void SetAccountFlag(std::string flag, std::string val); void SetAccountFlag(std::string flag, std::string val);
std::string GetAccountFlag(std::string flag); float GetDamageMultiplier(SkillUseTypes); std::string GetAccountFlag(std::string flag); float GetDamageMultiplier(SkillUseTypes);
void Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_consume); void Consume(const ItemData *item, uint8 type, int16 slot, bool auto_consume);
void PlayMP3(const char* fname); void PlayMP3(const char* fname);
void ExpeditionSay(const char *str, int ExpID); void ExpeditionSay(const char *str, int ExpID);
int mod_client_damage(int damage, SkillUseTypes skillinuse, int hand, const ItemInst* weapon, Mob* other); int mod_client_damage(int damage, SkillUseTypes skillinuse, int hand, const ItemInst* weapon, Mob* other);
@ -1236,9 +1236,9 @@ public:
int32 mod_client_xp(int32 in_exp, NPC *npc); int32 mod_client_xp(int32 in_exp, NPC *npc);
uint32 mod_client_xp_for_level(uint32 xp, uint16 check_level); uint32 mod_client_xp_for_level(uint32 xp, uint16 check_level);
int mod_client_haste_cap(int cap); int mod_client_haste_cap(int cap);
int mod_consume(Item_Struct *item, ItemUseTypes type, int change); int mod_consume(ItemData *item, ItemUseTypes type, int change);
int mod_food_value(const Item_Struct *item, int change); int mod_food_value(const ItemData *item, int change);
int mod_drink_value(const Item_Struct *item, int change); int mod_drink_value(const ItemData *item, int change);
void SetEngagedRaidTarget(bool value) { EngagedRaidTarget = value; } void SetEngagedRaidTarget(bool value) { EngagedRaidTarget = value; }
bool GetEngagedRaidTarget() const { return EngagedRaidTarget; } bool GetEngagedRaidTarget() const { return EngagedRaidTarget; }

View File

@ -1302,7 +1302,7 @@ int32 Client::CalcManaRegenCap()
uint32 Client::CalcCurrentWeight() uint32 Client::CalcCurrentWeight()
{ {
const Item_Struct* TempItem = 0; const ItemData* TempItem = 0;
ItemInst* ins; ItemInst* ins;
uint32 Total = 0; uint32 Total = 0;
int x; int x;

View File

@ -1914,7 +1914,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app)
merchantid = tmp->CastToNPC()->MerchantType; merchantid = tmp->CastToNPC()->MerchantType;
const Item_Struct* item = nullptr; const ItemData* item = nullptr;
bool found = false; bool found = false;
std::list<MerchantList> merlist = zone->merchanttable[merchantid]; std::list<MerchantList> merlist = zone->merchanttable[merchantid];
std::list<MerchantList>::const_iterator itr; std::list<MerchantList>::const_iterator itr;
@ -2090,7 +2090,7 @@ void Client::Handle_OP_AdventureMerchantRequest(const EQApplicationPacket *app)
merchantid = tmp->CastToNPC()->MerchantType; merchantid = tmp->CastToNPC()->MerchantType;
tmp->CastToNPC()->FaceTarget(this->CastToMob()); tmp->CastToNPC()->FaceTarget(this->CastToMob());
const Item_Struct *item = 0; const ItemData *item = 0;
std::list<MerchantList> merlist = zone->merchanttable[merchantid]; std::list<MerchantList> merlist = zone->merchanttable[merchantid];
std::list<MerchantList>::const_iterator itr; std::list<MerchantList>::const_iterator itr;
for (itr = merlist.begin(); itr != merlist.end() && count<255; ++itr){ for (itr = merlist.begin(); itr != merlist.end() && count<255; ++itr){
@ -2189,7 +2189,7 @@ void Client::Handle_OP_AdventureMerchantSell(const EQApplicationPacket *app)
return; return;
} }
const Item_Struct* item = database.GetItem(itemid); const ItemData* item = database.GetItem(itemid);
ItemInst* inst = GetInv().GetItem(ams_in->slot); ItemInst* inst = GetInv().GetItem(ams_in->slot);
if (!item || !inst){ if (!item || !inst){
Message(13, "You seemed to have misplaced that item..."); Message(13, "You seemed to have misplaced that item...");
@ -2464,7 +2464,7 @@ void Client::Handle_OP_AltCurrencyMerchantRequest(const EQApplicationPacket *app
ss << alt_cur_id << "|1|" << alt_cur_id; ss << alt_cur_id << "|1|" << alt_cur_id;
uint32 count = 0; uint32 count = 0;
uint32 merchant_id = tar->MerchantType; uint32 merchant_id = tar->MerchantType;
const Item_Struct *item = nullptr; const ItemData *item = nullptr;
std::list<MerchantList> merlist = zone->merchanttable[merchant_id]; std::list<MerchantList> merlist = zone->merchanttable[merchant_id];
std::list<MerchantList>::const_iterator itr; std::list<MerchantList>::const_iterator itr;
@ -2524,7 +2524,7 @@ void Client::Handle_OP_AltCurrencyPurchase(const EQApplicationPacket *app)
return; return;
} }
const Item_Struct* item = nullptr; const ItemData* item = nullptr;
uint32 cost = 0; uint32 cost = 0;
uint32 current_currency = GetAlternateCurrencyValue(alt_cur_id); uint32 current_currency = GetAlternateCurrencyValue(alt_cur_id);
uint32 merchant_id = tar->MerchantType; uint32 merchant_id = tar->MerchantType;
@ -2670,7 +2670,7 @@ void Client::Handle_OP_AltCurrencySell(const EQApplicationPacket *app)
return; return;
} }
const Item_Struct* item = nullptr; const ItemData* item = nullptr;
uint32 cost = 0; uint32 cost = 0;
uint32 current_currency = GetAlternateCurrencyValue(alt_cur_id); uint32 current_currency = GetAlternateCurrencyValue(alt_cur_id);
uint32 merchant_id = tar->MerchantType; uint32 merchant_id = tar->MerchantType;
@ -2763,7 +2763,7 @@ void Client::Handle_OP_AltCurrencySellSelection(const EQApplicationPacket *app)
return; return;
} }
const Item_Struct* item = nullptr; const ItemData* item = nullptr;
uint32 cost = 0; uint32 cost = 0;
uint32 current_currency = GetAlternateCurrencyValue(alt_cur_id); uint32 current_currency = GetAlternateCurrencyValue(alt_cur_id);
uint32 merchant_id = tar->MerchantType; uint32 merchant_id = tar->MerchantType;
@ -2938,7 +2938,7 @@ void Client::Handle_OP_AugmentInfo(const EQApplicationPacket *app)
} }
AugmentInfo_Struct* AugInfo = (AugmentInfo_Struct*)app->pBuffer; AugmentInfo_Struct* AugInfo = (AugmentInfo_Struct*)app->pBuffer;
const Item_Struct * item = database.GetItem(AugInfo->itemid); const ItemData * item = database.GetItem(AugInfo->itemid);
if (item) { if (item) {
strn0cpy(AugInfo->augment_info, item->Name, 64); strn0cpy(AugInfo->augment_info, item->Name, 64);
@ -3378,7 +3378,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app)
{ {
BarterItemSearchLinkRequest_Struct* bislr = (BarterItemSearchLinkRequest_Struct*)app->pBuffer; BarterItemSearchLinkRequest_Struct* bislr = (BarterItemSearchLinkRequest_Struct*)app->pBuffer;
const Item_Struct* item = database.GetItem(bislr->ItemID); const ItemData* item = database.GetItem(bislr->ItemID);
if (!item) if (!item)
Message(13, "Error: This item does not exist!"); Message(13, "Error: This item does not exist!");
@ -3411,7 +3411,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app)
{ {
BuyerItemSearchLinkRequest_Struct* bislr = (BuyerItemSearchLinkRequest_Struct*)app->pBuffer; BuyerItemSearchLinkRequest_Struct* bislr = (BuyerItemSearchLinkRequest_Struct*)app->pBuffer;
const Item_Struct* item = database.GetItem(bislr->ItemID); const ItemData* item = database.GetItem(bislr->ItemID);
if (!item) if (!item)
Message(13, "Error: This item does not exist!"); Message(13, "Error: This item does not exist!");
@ -3450,7 +3450,7 @@ void Client::Handle_OP_BazaarInspect(const EQApplicationPacket *app)
BazaarInspect_Struct* bis = (BazaarInspect_Struct*)app->pBuffer; BazaarInspect_Struct* bis = (BazaarInspect_Struct*)app->pBuffer;
const Item_Struct* item = database.GetItem(bis->ItemID); const ItemData* item = database.GetItem(bis->ItemID);
if (!item) { if (!item) {
Message(13, "Error: This item does not exist!"); Message(13, "Error: This item does not exist!");
@ -3905,7 +3905,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app)
//bool cancast = true; //bool cancast = true;
if (inst && inst->IsType(ItemClassCommon)) if (inst && inst->IsType(ItemClassCommon))
{ {
const Item_Struct* item = inst->GetItem(); const ItemData* item = inst->GetItem();
if (item->Click.Effect != (uint32)castspell->spell_id) if (item->Click.Effect != (uint32)castspell->spell_id)
{ {
database.SetMQDetectionFlag(account_name, name, "OP_CastSpell with item, tried to cast a different spell.", zone->GetShortName()); database.SetMQDetectionFlag(account_name, name, "OP_CastSpell with item, tried to cast a different spell.", zone->GetShortName());
@ -4746,7 +4746,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app)
return; return;
} }
const Item_Struct* eat_item = myitem->GetItem(); const ItemData* eat_item = myitem->GetItem();
if (pcs->type == 0x01) { if (pcs->type == 0x01) {
Consume(eat_item, ItemTypeFood, pcs->slot, (pcs->auto_consumed == 0xffffffff)); Consume(eat_item, ItemTypeFood, pcs->slot, (pcs->auto_consumed == 0xffffffff));
} }
@ -6826,7 +6826,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
return; return;
} }
const Item_Struct* CursorItem = CursorItemInst->GetItem(); const ItemData* CursorItem = CursorItemInst->GetItem();
if (!CursorItem->NoDrop || CursorItemInst->IsAttuned()) if (!CursorItem->NoDrop || CursorItemInst->IsAttuned())
{ {
@ -7895,7 +7895,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app)
EQApplicationPacket* outapp = app->Copy(); EQApplicationPacket* outapp = app->Copy();
InspectResponse_Struct* insr = (InspectResponse_Struct*)outapp->pBuffer; InspectResponse_Struct* insr = (InspectResponse_Struct*)outapp->pBuffer;
Mob* tmp = entity_list.GetMob(insr->TargetID); Mob* tmp = entity_list.GetMob(insr->TargetID);
const Item_Struct* item = nullptr; const ItemData* item = nullptr;
int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType); int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
for (int16 L = EmuConstants::EQUIPMENT_BEGIN; L <= MainWaist; L++) { for (int16 L = EmuConstants::EQUIPMENT_BEGIN; L <= MainWaist; L++) {
@ -7905,7 +7905,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app)
if (item) { if (item) {
strcpy(insr->itemnames[L], item->Name); strcpy(insr->itemnames[L], item->Name);
if (inst && inst->GetOrnamentationAug(ornamentationAugtype)) { if (inst && inst->GetOrnamentationAug(ornamentationAugtype)) {
const Item_Struct *aug_item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem(); const ItemData *aug_item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
insr->itemicons[L] = aug_item->Icon; insr->itemicons[L] = aug_item->Icon;
} }
else if (inst->GetOrnamentationIcon()) { else if (inst->GetOrnamentationIcon()) {
@ -8003,7 +8003,7 @@ void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app)
//todo: verify ivrs->link_hash based on a rule, in case we don't care about people being able to sniff data from the item DB //todo: verify ivrs->link_hash based on a rule, in case we don't care about people being able to sniff data from the item DB
const Item_Struct* item = database.GetItem(ivrs->item_id); const ItemData* item = database.GetItem(ivrs->item_id);
if (!item) { if (!item) {
if (ivrs->item_id > 500000) if (ivrs->item_id > 500000)
{ {
@ -8113,7 +8113,7 @@ void Client::Handle_OP_ItemName(const EQApplicationPacket *app)
return; return;
} }
ItemNamePacket_Struct *p = (ItemNamePacket_Struct*)app->pBuffer; ItemNamePacket_Struct *p = (ItemNamePacket_Struct*)app->pBuffer;
const Item_Struct *item = 0; const ItemData *item = 0;
if ((item = database.GetItem(p->item_id)) != nullptr) { if ((item = database.GetItem(p->item_id)) != nullptr) {
EQApplicationPacket* outapp = new EQApplicationPacket(OP_ItemName, sizeof(ItemNamePacket_Struct)); EQApplicationPacket* outapp = new EQApplicationPacket(OP_ItemName, sizeof(ItemNamePacket_Struct));
p = (ItemNamePacket_Struct*)outapp->pBuffer; p = (ItemNamePacket_Struct*)outapp->pBuffer;
@ -8129,7 +8129,7 @@ void Client::Handle_OP_ItemPreview(const EQApplicationPacket *app)
VERIFY_PACKET_LENGTH(OP_ItemPreview, app, ItemPreview_Struct); VERIFY_PACKET_LENGTH(OP_ItemPreview, app, ItemPreview_Struct);
ItemPreview_Struct *ips = (ItemPreview_Struct *)app->pBuffer; ItemPreview_Struct *ips = (ItemPreview_Struct *)app->pBuffer;
const Item_Struct* item = database.GetItem(ips->itemid); const ItemData* item = database.GetItem(ips->itemid);
if (item) { if (item) {
EQApplicationPacket* outapp = new EQApplicationPacket(OP_ItemPreview, strlen(item->Name) + strlen(item->Lore) + strlen(item->IDFile) + 898); EQApplicationPacket* outapp = new EQApplicationPacket(OP_ItemPreview, strlen(item->Name) + strlen(item->Lore) + strlen(item->IDFile) + 898);
@ -8345,7 +8345,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
return; return;
} }
const Item_Struct* item = inst->GetItem(); const ItemData* item = inst->GetItem();
if (!item) { if (!item) {
Message(0, "Error: item not found in inventory slot #%i", slot_id); Message(0, "Error: item not found in inventory slot #%i", slot_id);
DeleteItemInInventory(slot_id, 0, true); DeleteItemInInventory(slot_id, 0, true);
@ -8393,13 +8393,13 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
int r; int r;
bool tryaug = false; bool tryaug = false;
ItemInst* clickaug = 0; ItemInst* clickaug = 0;
Item_Struct* augitem = 0; ItemData* augitem = 0;
for (r = 0; r < EmuConstants::ITEM_COMMON_SIZE; r++) { for (r = 0; r < EmuConstants::ITEM_COMMON_SIZE; r++) {
const ItemInst* aug_i = inst->GetAugment(r); const ItemInst* aug_i = inst->GetAugment(r);
if (!aug_i) if (!aug_i)
continue; continue;
const Item_Struct* aug = aug_i->GetItem(); const ItemData* aug = aug_i->GetItem();
if (!aug) if (!aug)
continue; continue;
@ -8407,7 +8407,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
{ {
tryaug = true; tryaug = true;
clickaug = (ItemInst*)aug_i; clickaug = (ItemInst*)aug_i;
augitem = (Item_Struct*)aug; augitem = (ItemData*)aug;
spell_id = aug->Click.Effect; spell_id = aug->Click.Effect;
break; break;
} }
@ -10440,7 +10440,7 @@ void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app)
} }
if (mptbs->Action == 0) { if (mptbs->Action == 0) {
const Item_Struct *BaseItem = database.GetItem(mptbs->ItemID); const ItemData *BaseItem = database.GetItem(mptbs->ItemID);
if (BaseItem) { if (BaseItem) {
m_pp.potionbelt.items[mptbs->SlotNumber].item_id = BaseItem->ID; m_pp.potionbelt.items[mptbs->SlotNumber].item_id = BaseItem->ID;
m_pp.potionbelt.items[mptbs->SlotNumber].icon = BaseItem->Icon; m_pp.potionbelt.items[mptbs->SlotNumber].icon = BaseItem->Icon;
@ -11896,7 +11896,7 @@ void Client::Handle_OP_Shielding(const EQApplicationPacket *app)
return; return;
if (inst) if (inst)
{ {
const Item_Struct* shield = inst->GetItem(); const ItemData* shield = inst->GetItem();
if (shield && shield->ItemType == ItemTypeShield) if (shield && shield->ItemType == ItemTypeShield)
{ {
for (int x = 0; x < 2; x++) for (int x = 0; x < 2; x++)
@ -12004,7 +12004,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app)
break; break;
} }
} }
const Item_Struct* item = nullptr; const ItemData* item = nullptr;
uint32 prevcharges = 0; uint32 prevcharges = 0;
if (item_id == 0) { //check to see if its on the temporary table if (item_id == 0) { //check to see if its on the temporary table
std::list<TempMerchantList> tmp_merlist = zone->tmpmerchanttable[tmp->GetNPCTypeID()]; std::list<TempMerchantList> tmp_merlist = zone->tmpmerchanttable[tmp->GetNPCTypeID()];
@ -12241,7 +12241,7 @@ void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app)
uint32 itemid = GetItemIDAt(mp->itemslot); uint32 itemid = GetItemIDAt(mp->itemslot);
if (itemid == 0) if (itemid == 0)
return; return;
const Item_Struct* item = database.GetItem(itemid); const ItemData* item = database.GetItem(itemid);
ItemInst* inst = GetInv().GetItem(mp->itemslot); ItemInst* inst = GetInv().GetItem(mp->itemslot);
if (!item || !inst){ if (!item || !inst){
Message(13, "You seemed to have misplaced that item.."); Message(13, "You seemed to have misplaced that item..");
@ -13338,7 +13338,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app)
TradeItemsValid = false; TradeItemsValid = false;
break; break;
} }
const Item_Struct *Item = database.GetItem(gis->Items[i]); const ItemData *Item = database.GetItem(gis->Items[i]);
if (!Item) { if (!Item) {
Message(13, "Unexpected error. Unable to start trader mode"); Message(13, "Unexpected error. Unable to start trader mode");

View File

@ -966,12 +966,12 @@ void Client::BulkSendInventoryItems()
#endif*/ #endif*/
void Client::BulkSendMerchantInventory(int merchant_id, int npcid) { void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
const Item_Struct* handyitem = nullptr; const ItemData* handyitem = nullptr;
uint32 numItemSlots = 80; //The max number of items passed in the transaction. uint32 numItemSlots = 80; //The max number of items passed in the transaction.
if (ClientVersionBit & BIT_RoFAndLater) { // RoF+ can send 200 items if (ClientVersionBit & BIT_RoFAndLater) { // RoF+ can send 200 items
numItemSlots = 200; numItemSlots = 200;
} }
const Item_Struct *item; const ItemData *item;
std::list<MerchantList> merlist = zone->merchanttable[merchant_id]; std::list<MerchantList> merlist = zone->merchanttable[merchant_id];
std::list<MerchantList>::const_iterator itr; std::list<MerchantList>::const_iterator itr;
Mob* merch = entity_list.GetMobByNpcTypeID(npcid); Mob* merch = entity_list.GetMobByNpcTypeID(npcid);
@ -1229,7 +1229,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app)
if(inst && inst->IsType(ItemClassCommon)) if(inst && inst->IsType(ItemClassCommon))
{ {
const Item_Struct* item = inst->GetItem(); const ItemData* item = inst->GetItem();
if(item && item->Scroll.Effect == (int32)(memspell->spell_id)) if(item && item->Scroll.Effect == (int32)(memspell->spell_id))
{ {

View File

@ -2553,7 +2553,7 @@ void command_peekinv(Client *c, const Seperator *sep)
Client* targetClient = c->GetTarget()->CastToClient(); Client* targetClient = c->GetTarget()->CastToClient();
const ItemInst* inst_main = nullptr; const ItemInst* inst_main = nullptr;
const ItemInst* inst_sub = nullptr; const ItemInst* inst_sub = nullptr;
const Item_Struct* item_data = nullptr; const ItemData* item_data = nullptr;
std::string item_link; std::string item_link;
Client::TextLink linker; Client::TextLink linker;
linker.SetLinkType(linker.linkItemInst); linker.SetLinkType(linker.linkItemInst);
@ -5413,7 +5413,7 @@ void command_summonitem(Client *c, const Seperator *sep)
else { else {
uint32 itemid = atoi(sep->arg[1]); uint32 itemid = atoi(sep->arg[1]);
int16 item_status = 0; int16 item_status = 0;
const Item_Struct* item = database.GetItem(itemid); const ItemData* item = database.GetItem(itemid);
if(item) { if(item) {
item_status = static_cast<int16>(item->MinStatus); item_status = static_cast<int16>(item->MinStatus);
} }
@ -5452,7 +5452,7 @@ void command_giveitem(Client *c, const Seperator *sep)
Client *t = c->GetTarget()->CastToClient(); Client *t = c->GetTarget()->CastToClient();
uint32 itemid = atoi(sep->arg[1]); uint32 itemid = atoi(sep->arg[1]);
int16 item_status = 0; int16 item_status = 0;
const Item_Struct* item = database.GetItem(itemid); const ItemData* item = database.GetItem(itemid);
if(item) { if(item) {
item_status = static_cast<int16>(item->MinStatus); item_status = static_cast<int16>(item->MinStatus);
} }
@ -5505,7 +5505,7 @@ void command_itemsearch(Client *c, const Seperator *sep)
{ {
const char *search_criteria=sep->argplus[1]; const char *search_criteria=sep->argplus[1];
const Item_Struct* item = nullptr; const ItemData* item = nullptr;
std::string item_link; std::string item_link;
Client::TextLink linker; Client::TextLink linker;
linker.SetLinkType(linker.linkItemData); linker.SetLinkType(linker.linkItemData);
@ -10179,7 +10179,7 @@ void command_zopp(Client *c, const Seperator *sep)
uint32 itemid = atoi(sep->arg[3]); uint32 itemid = atoi(sep->arg[3]);
int16 charges = sep->argnum == 4 ? atoi(sep->arg[4]) : 1; // defaults to 1 charge if not specified int16 charges = sep->argnum == 4 ? atoi(sep->arg[4]) : 1; // defaults to 1 charge if not specified
const Item_Struct* FakeItem = database.GetItem(itemid); const ItemData* FakeItem = database.GetItem(itemid);
if (!FakeItem) { if (!FakeItem) {
c->Message(13, "Error: Item [%u] is not a valid item id.", itemid); c->Message(13, "Error: Item [%u] is not a valid item id.", itemid);
@ -10187,7 +10187,7 @@ void command_zopp(Client *c, const Seperator *sep)
} }
int16 item_status = 0; int16 item_status = 0;
const Item_Struct* item = database.GetItem(itemid); const ItemData* item = database.GetItem(itemid);
if(item) { if(item) {
item_status = static_cast<int16>(item->MinStatus); item_status = static_cast<int16>(item->MinStatus);
} }

View File

@ -971,7 +971,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
safe_delete(outapp); safe_delete(outapp);
if(Loot_Request_Type == 5) { if(Loot_Request_Type == 5) {
int pkitem = GetPlayerKillItem(); int pkitem = GetPlayerKillItem();
const Item_Struct* item = database.GetItem(pkitem); const ItemData* item = database.GetItem(pkitem);
ItemInst* inst = database.CreateItem(item, item->MaxCharges); ItemInst* inst = database.CreateItem(item, item->MaxCharges);
if(inst) { if(inst) {
if (item->RecastDelay) if (item->RecastDelay)
@ -986,7 +986,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
} }
int i = 0; int i = 0;
const Item_Struct* item = 0; const ItemData* item = 0;
ItemList::iterator cur,end; ItemList::iterator cur,end;
cur = itemlist.begin(); cur = itemlist.begin();
end = itemlist.end(); end = itemlist.end();
@ -1101,7 +1101,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
being_looted_by = 0xFFFFFFFF; being_looted_by = 0xFFFFFFFF;
return; return;
} }
const Item_Struct* item = 0; const ItemData* item = 0;
ItemInst *inst = 0; ItemInst *inst = 0;
ServerLootItem_Struct* item_data = nullptr, *bag_item_data[10]; ServerLootItem_Struct* item_data = nullptr, *bag_item_data[10];
@ -1296,7 +1296,7 @@ void Corpse::QueryLoot(Client* to) {
else else
x < corpselootlimit ? sitem->lootslot = x : sitem->lootslot = 0xFFFF; x < corpselootlimit ? sitem->lootslot = x : sitem->lootslot = 0xFFFF;
const Item_Struct* item = database.GetItem(sitem->item_id); const ItemData* item = database.GetItem(sitem->item_id);
if (item) if (item)
to->Message((sitem->lootslot == 0xFFFF), "LootSlot: %i (EquipSlot: %i) Item: %s (%d), Count: %i", static_cast<int16>(sitem->lootslot), sitem->equip_slot, item->Name, item->ID, sitem->charges); to->Message((sitem->lootslot == 0xFFFF), "LootSlot: %i (EquipSlot: %i) Item: %s (%d), Count: %i", static_cast<int16>(sitem->lootslot), sitem->equip_slot, item->Name, item->ID, sitem->charges);
@ -1310,7 +1310,7 @@ void Corpse::QueryLoot(Client* to) {
} }
else { else {
sitem->lootslot=y; sitem->lootslot=y;
const Item_Struct* item = database.GetItem(sitem->item_id); const ItemData* item = database.GetItem(sitem->item_id);
if (item) if (item)
to->Message(0, "LootSlot: %i Item: %s (%d), Count: %i", sitem->lootslot, item->Name, item->ID, sitem->charges); to->Message(0, "LootSlot: %i Item: %s (%d), Count: %i", sitem->lootslot, item->Name, item->ID, sitem->charges);
@ -1405,7 +1405,7 @@ uint32 Corpse::GetEquipment(uint8 material_slot) const {
} }
uint32 Corpse::GetEquipmentColor(uint8 material_slot) const { uint32 Corpse::GetEquipmentColor(uint8 material_slot) const {
const Item_Struct *item; const ItemData *item;
if(material_slot > EmuConstants::MATERIAL_END) { if(material_slot > EmuConstants::MATERIAL_END) {
return 0; return 0;

View File

@ -459,7 +459,7 @@ int32 Client::GetActSpellCasttime(uint16 spell_id, int32 casttime)
bool Client::TrainDiscipline(uint32 itemid) { bool Client::TrainDiscipline(uint32 itemid) {
//get the item info //get the item info
const Item_Struct *item = database.GetItem(itemid); const ItemData *item = database.GetItem(itemid);
if(item == nullptr) { if(item == nullptr) {
Message(13, "Unable to find the tome you turned in!"); Message(13, "Unable to find the tome you turned in!");
Log.Out(Logs::General, Logs::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid); Log.Out(Logs::General, Logs::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid);

View File

@ -864,7 +864,7 @@ void PerlembParser::GetQuestPackageName(bool &isPlayerQuest, bool &isGlobalPlaye
} }
else if(isItemQuest) { else if(isItemQuest) {
// need a valid ItemInst pointer check here..unsure how to cancel this process -U // need a valid ItemInst pointer check here..unsure how to cancel this process -U
const Item_Struct* item = iteminst->GetItem(); const ItemData* item = iteminst->GetItem();
package_name = "qst_item_"; package_name = "qst_item_";
package_name += itoa(item->ID); package_name += itoa(item->ID);
} }

View File

@ -29,7 +29,7 @@
const char *getItemName(unsigned itemid) const char *getItemName(unsigned itemid)
{ {
const Item_Struct* item = nullptr; const ItemData* item = nullptr;
item = database.GetItem(itemid); item = database.GetItem(itemid);
if (item) if (item)

View File

@ -1860,7 +1860,7 @@ void EntityList::QueueClientsGuildBankItemUpdate(const GuildBankItemUpdate_Struc
memcpy(outgbius, gbius, sizeof(GuildBankItemUpdate_Struct)); memcpy(outgbius, gbius, sizeof(GuildBankItemUpdate_Struct));
const Item_Struct *Item = database.GetItem(gbius->ItemID); const ItemData *Item = database.GetItem(gbius->ItemID);
auto it = client_list.begin(); auto it = client_list.begin();
while (it != client_list.end()) { while (it != client_list.end()) {
@ -3746,7 +3746,7 @@ void EntityList::GroupMessage(uint32 gid, const char *from, const char *message)
uint16 EntityList::CreateGroundObject(uint32 itemid, const glm::vec4& position, uint32 decay_time) uint16 EntityList::CreateGroundObject(uint32 itemid, const glm::vec4& position, uint32 decay_time)
{ {
const Item_Struct *is = database.GetItem(itemid); const ItemData *is = database.GetItem(itemid);
if (!is) if (!is)
return 0; return 0;

View File

@ -295,7 +295,7 @@ void Client::GoFish()
food_id = common_fish_ids[index]; food_id = common_fish_ids[index];
} }
const Item_Struct* food_item = database.GetItem(food_id); const ItemData* food_item = database.GetItem(food_id);
Message_StringID(MT_Skills, FISHING_SUCCESS); Message_StringID(MT_Skills, FISHING_SUCCESS);
ItemInst* inst = database.CreateItem(food_item, 1); ItemInst* inst = database.CreateItem(food_item, 1);
@ -387,7 +387,7 @@ void Client::ForageItem(bool guarantee) {
foragedfood = common_food_ids[index]; foragedfood = common_food_ids[index];
} }
const Item_Struct* food_item = database.GetItem(foragedfood); const ItemData* food_item = database.GetItem(foragedfood);
if(!food_item) { if(!food_item) {
Log.Out(Logs::General, Logs::Error, "nullptr returned from database.GetItem in ClientForageItem"); Log.Out(Logs::General, Logs::Error, "nullptr returned from database.GetItem in ClientForageItem");

View File

@ -692,7 +692,7 @@ void GuildBankManager::SendGuildBank(Client *c)
{ {
if((*Iterator)->Items.DepositArea[i].ItemID > 0) if((*Iterator)->Items.DepositArea[i].ItemID > 0)
{ {
const Item_Struct *Item = database.GetItem((*Iterator)->Items.DepositArea[i].ItemID); const ItemData *Item = database.GetItem((*Iterator)->Items.DepositArea[i].ItemID);
if(!Item) if(!Item)
continue; continue;
@ -728,7 +728,7 @@ void GuildBankManager::SendGuildBank(Client *c)
{ {
if((*Iterator)->Items.MainArea[i].ItemID > 0) if((*Iterator)->Items.MainArea[i].ItemID > 0)
{ {
const Item_Struct *Item = database.GetItem((*Iterator)->Items.MainArea[i].ItemID); const ItemData *Item = database.GetItem((*Iterator)->Items.MainArea[i].ItemID);
if(!Item) if(!Item)
continue; continue;
@ -859,7 +859,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32
return false; return false;
} }
const Item_Struct *Item = database.GetItem(ItemID); const ItemData *Item = database.GetItem(ItemID);
GuildBankItemUpdate_Struct gbius; GuildBankItemUpdate_Struct gbius;
@ -925,7 +925,7 @@ int GuildBankManager::Promote(uint32 guildID, int slotID)
(*iter)->Items.DepositArea[slotID].ItemID = 0; (*iter)->Items.DepositArea[slotID].ItemID = 0;
const Item_Struct *Item = database.GetItem((*iter)->Items.MainArea[mainSlot].ItemID); const ItemData *Item = database.GetItem((*iter)->Items.MainArea[mainSlot].ItemID);
GuildBankItemUpdate_Struct gbius; GuildBankItemUpdate_Struct gbius;
@ -981,7 +981,7 @@ void GuildBankManager::SetPermissions(uint32 guildID, uint16 slotID, uint32 perm
else else
(*iter)->Items.MainArea[slotID].WhoFor[0] = '\0'; (*iter)->Items.MainArea[slotID].WhoFor[0] = '\0';
const Item_Struct *Item = database.GetItem((*iter)->Items.MainArea[slotID].ItemID); const ItemData *Item = database.GetItem((*iter)->Items.MainArea[slotID].ItemID);
GuildBankItemUpdate_Struct gbius; GuildBankItemUpdate_Struct gbius;
@ -1112,7 +1112,7 @@ bool GuildBankManager::DeleteItem(uint32 guildID, uint16 area, uint16 slotID, ui
bool deleted = true; bool deleted = true;
const Item_Struct *Item = database.GetItem(BankArea[slotID].ItemID); const ItemData *Item = database.GetItem(BankArea[slotID].ItemID);
if(!Item->Stackable || (quantity >= BankArea[slotID].Quantity)) { if(!Item->Stackable || (quantity >= BankArea[slotID].Quantity)) {
std::string query = StringFormat("DELETE FROM `guild_bank` WHERE `guildid` = %i " std::string query = StringFormat("DELETE FROM `guild_bank` WHERE `guildid` = %i "
@ -1173,7 +1173,7 @@ bool GuildBankManager::MergeStacks(uint32 GuildID, uint16 SlotID)
if(BankArea[SlotID].ItemID == 0) if(BankArea[SlotID].ItemID == 0)
return false; return false;
const Item_Struct *Item = database.GetItem(BankArea[SlotID].ItemID); const ItemData *Item = database.GetItem(BankArea[SlotID].ItemID);
if(!Item->Stackable) if(!Item->Stackable)
return false; return false;
@ -1271,7 +1271,7 @@ bool GuildBankManager::SplitStack(uint32 GuildID, uint16 SlotID, uint32 Quantity
if(BankArea[SlotID].Quantity <= Quantity || Quantity == 0) if(BankArea[SlotID].Quantity <= Quantity || Quantity == 0)
return false; return false;
const Item_Struct *Item = database.GetItem(BankArea[SlotID].ItemID); const ItemData *Item = database.GetItem(BankArea[SlotID].ItemID);
if(!Item->Stackable) if(!Item->Stackable)
return false; return false;

View File

@ -177,7 +177,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
} }
bool Client::CheckLoreConflict(const Item_Struct* item) bool Client::CheckLoreConflict(const ItemData* item)
{ {
if (!item) { return false; } if (!item) { return false; }
if (!item->LoreFlag) { return false; } if (!item->LoreFlag) { return false; }
@ -195,7 +195,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
// TODO: update calling methods and script apis to handle a failure return // TODO: update calling methods and script apis to handle a failure return
const Item_Struct* item = database.GetItem(item_id); const ItemData* item = database.GetItem(item_id);
// make sure the item exists // make sure the item exists
if(item == nullptr) { if(item == nullptr) {
@ -247,7 +247,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
bool enforceusable = RuleB(Inventory, EnforceAugmentUsability); bool enforceusable = RuleB(Inventory, EnforceAugmentUsability);
for (int iter = AUG_BEGIN; iter < EmuConstants::ITEM_COMMON_SIZE; ++iter) { for (int iter = AUG_BEGIN; iter < EmuConstants::ITEM_COMMON_SIZE; ++iter) {
const Item_Struct* augtest = database.GetItem(augments[iter]); const ItemData* augtest = database.GetItem(augments[iter]);
if(augtest == nullptr) { if(augtest == nullptr) {
if(augments[iter]) { if(augments[iter]) {
@ -1037,7 +1037,7 @@ void Client::MoveItemCharges(ItemInst &from, int16 to_slot, uint8 type)
#if 0 #if 0
// TODO: needs clean-up to save references // TODO: needs clean-up to save references
bool MakeItemLink(char* &ret_link, const Item_Struct *item, uint32 aug0, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint8 evolving, uint8 evolvedlevel) { bool MakeItemLink(char* &ret_link, const ItemData *item, uint32 aug0, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint8 evolving, uint8 evolvedlevel) {
//we're sending back the entire "link", minus the null characters & item name //we're sending back the entire "link", minus the null characters & item name
//that way, we can use it for regular links & Task links //that way, we can use it for regular links & Task links
//note: initiator needs to pass us ret_link //note: initiator needs to pass us ret_link
@ -1152,7 +1152,7 @@ int Client::GetItemLinkHash(const ItemInst* inst) {
if (!inst) //have to have an item to make the hash if (!inst) //have to have an item to make the hash
return 0; return 0;
const Item_Struct* item = inst->GetItem(); const ItemData* item = inst->GetItem();
char* hash_str = 0; char* hash_str = 0;
/*register */int hash = 0; /*register */int hash = 0;
@ -1246,7 +1246,7 @@ packet with the item number in it, but I cant seem to find it right now
if (!inst) if (!inst)
return; return;
const Item_Struct* item = inst->GetItem(); const ItemData* item = inst->GetItem();
const char* name2 = &item->Name[0]; const char* name2 = &item->Name[0];
EQApplicationPacket* outapp = new EQApplicationPacket(OP_ItemLinkText,strlen(name2)+68); EQApplicationPacket* outapp = new EQApplicationPacket(OP_ItemLinkText,strlen(name2)+68);
char buffer2[135] = {0}; char buffer2[135] = {0};
@ -1518,7 +1518,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
else { else {
auto ndh_item = ndh_inst->GetItem(); auto ndh_item = ndh_inst->GetItem();
if (ndh_item == nullptr) { if (ndh_item == nullptr) {
ndh_item_data.append("[nullptr on Item_Struct*]"); ndh_item_data.append("[nullptr on ItemData*]");
} }
else { else {
ndh_item_data.append(StringFormat("name=%s", ndh_item->Name)); ndh_item_data.append(StringFormat("name=%s", ndh_item->Name));
@ -1560,8 +1560,8 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
m_inv.DeleteItem(src_slot_id); m_inv.DeleteItem(src_slot_id);
} }
else { else {
const Item_Struct* world_item = world_inst->GetItem(); const ItemData* world_item = world_inst->GetItem();
const Item_Struct* src_item = src_inst->GetItem(); const ItemData* src_item = src_inst->GetItem();
if (world_item && src_item) { if (world_item && src_item) {
// Case 2: Same item on cursor, stacks, transfer of charges needed // Case 2: Same item on cursor, stacks, transfer of charges needed
if ((world_item->ID == src_item->ID) && src_inst->IsStackable()) { if ((world_item->ID == src_item->ID) && src_inst->IsStackable()) {
@ -1801,7 +1801,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
int16 resync_slot = (InventoryOld::CalcSlotId(move_slots->from_slot) == INVALID_INDEX) ? move_slots->from_slot : InventoryOld::CalcSlotId(move_slots->from_slot); int16 resync_slot = (InventoryOld::CalcSlotId(move_slots->from_slot) == INVALID_INDEX) ? move_slots->from_slot : InventoryOld::CalcSlotId(move_slots->from_slot);
if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) { if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) {
// This prevents the client from crashing when closing any 'phantom' bags -U // This prevents the client from crashing when closing any 'phantom' bags -U
const Item_Struct* token_struct = database.GetItem(22292); // 'Copper Coin' const ItemData* token_struct = database.GetItem(22292); // 'Copper Coin'
ItemInst* token_inst = database.CreateItem(token_struct, 1); ItemInst* token_inst = database.CreateItem(token_struct, 1);
SendItemPacket(resync_slot, token_inst, ItemPacketTrade); SendItemPacket(resync_slot, token_inst, ItemPacketTrade);
@ -1826,7 +1826,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
int16 resync_slot = (InventoryOld::CalcSlotId(move_slots->from_slot) == INVALID_INDEX) ? move_slots->from_slot : InventoryOld::CalcSlotId(move_slots->from_slot); int16 resync_slot = (InventoryOld::CalcSlotId(move_slots->from_slot) == INVALID_INDEX) ? move_slots->from_slot : InventoryOld::CalcSlotId(move_slots->from_slot);
if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) { if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) {
if(m_inv[resync_slot]) { if(m_inv[resync_slot]) {
const Item_Struct* token_struct = database.GetItem(22292); // 'Copper Coin' const ItemData* token_struct = database.GetItem(22292); // 'Copper Coin'
ItemInst* token_inst = database.CreateItem(token_struct, 1); ItemInst* token_inst = database.CreateItem(token_struct, 1);
SendItemPacket(resync_slot, token_inst, ItemPacketTrade); SendItemPacket(resync_slot, token_inst, ItemPacketTrade);
@ -1843,7 +1843,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
if((move_slots->to_slot >= EmuConstants::EQUIPMENT_BEGIN && move_slots->to_slot <= EmuConstants::CURSOR_BAG_END) || move_slots->to_slot == MainPowerSource) { if((move_slots->to_slot >= EmuConstants::EQUIPMENT_BEGIN && move_slots->to_slot <= EmuConstants::CURSOR_BAG_END) || move_slots->to_slot == MainPowerSource) {
int16 resync_slot = (InventoryOld::CalcSlotId(move_slots->to_slot) == INVALID_INDEX) ? move_slots->to_slot : InventoryOld::CalcSlotId(move_slots->to_slot); int16 resync_slot = (InventoryOld::CalcSlotId(move_slots->to_slot) == INVALID_INDEX) ? move_slots->to_slot : InventoryOld::CalcSlotId(move_slots->to_slot);
if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) { if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) {
const Item_Struct* token_struct = database.GetItem(22292); // 'Copper Coin' const ItemData* token_struct = database.GetItem(22292); // 'Copper Coin'
ItemInst* token_inst = database.CreateItem(token_struct, 1); ItemInst* token_inst = database.CreateItem(token_struct, 1);
SendItemPacket(resync_slot, token_inst, ItemPacketTrade); SendItemPacket(resync_slot, token_inst, ItemPacketTrade);
@ -1868,7 +1868,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
int16 resync_slot = (InventoryOld::CalcSlotId(move_slots->to_slot) == INVALID_INDEX) ? move_slots->to_slot : InventoryOld::CalcSlotId(move_slots->to_slot); int16 resync_slot = (InventoryOld::CalcSlotId(move_slots->to_slot) == INVALID_INDEX) ? move_slots->to_slot : InventoryOld::CalcSlotId(move_slots->to_slot);
if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) { if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) {
if(m_inv[resync_slot]) { if(m_inv[resync_slot]) {
const Item_Struct* token_struct = database.GetItem(22292); // 'Copper Coin' const ItemData* token_struct = database.GetItem(22292); // 'Copper Coin'
ItemInst* token_inst = database.CreateItem(token_struct, 1); ItemInst* token_inst = database.CreateItem(token_struct, 1);
SendItemPacket(resync_slot, token_inst, ItemPacketTrade); SendItemPacket(resync_slot, token_inst, ItemPacketTrade);
@ -2022,7 +2022,7 @@ void Client::DyeArmor(DyeStruct* dye){
#if 0 #if 0
bool Client::DecreaseByItemType(uint32 type, uint8 amt) { bool Client::DecreaseByItemType(uint32 type, uint8 amt) {
const Item_Struct* TempItem = 0; const ItemData* TempItem = 0;
ItemInst* ins; ItemInst* ins;
int x; int x;
for(x=EmuConstants::POSSESSIONS_BEGIN; x <= EmuConstants::POSSESSIONS_END; x++) for(x=EmuConstants::POSSESSIONS_BEGIN; x <= EmuConstants::POSSESSIONS_END; x++)
@ -2074,7 +2074,7 @@ bool Client::DecreaseByItemType(uint32 type, uint8 amt) {
#endif #endif
bool Client::DecreaseByID(uint32 type, uint8 amt) { bool Client::DecreaseByID(uint32 type, uint8 amt) {
const Item_Struct* TempItem = nullptr; const ItemData* TempItem = nullptr;
ItemInst* ins = nullptr; ItemInst* ins = nullptr;
int x; int x;
int num = 0; int num = 0;
@ -2401,7 +2401,7 @@ uint32 Client::GetEquipment(uint8 material_slot) const
#if 0 #if 0
int32 Client::GetEquipmentMaterial(uint8 material_slot) int32 Client::GetEquipmentMaterial(uint8 material_slot)
{ {
const Item_Struct *item; const ItemData *item;
item = database.GetItem(GetEquipment(material_slot)); item = database.GetItem(GetEquipment(material_slot));
if(item != 0) if(item != 0)
@ -2418,7 +2418,7 @@ uint32 Client::GetEquipmentColor(uint8 material_slot) const
if (material_slot > EmuConstants::MATERIAL_END) if (material_slot > EmuConstants::MATERIAL_END)
return 0; return 0;
const Item_Struct *item = database.GetItem(GetEquipment(material_slot)); const ItemData *item = database.GetItem(GetEquipment(material_slot));
if(item != nullptr) if(item != nullptr)
return ((m_pp.item_tint[material_slot].rgb.use_tint) ? m_pp.item_tint[material_slot].color : item->Color); return ((m_pp.item_tint[material_slot].rgb.use_tint) ? m_pp.item_tint[material_slot].color : item->Color);
@ -2501,7 +2501,7 @@ void Client::CreateBandolier(const EQApplicationPacket *app) {
strcpy(m_pp.bandoliers[bs->number].name, bs->name); strcpy(m_pp.bandoliers[bs->number].name, bs->name);
const ItemInst* InvItem = nullptr; const ItemInst* InvItem = nullptr;
const Item_Struct *BaseItem = nullptr; const ItemData *BaseItem = nullptr;
int16 WeaponSlot; int16 WeaponSlot;
for(int BandolierSlot = bandolierMainHand; BandolierSlot <= bandolierAmmo; BandolierSlot++) { for(int BandolierSlot = bandolierMainHand; BandolierSlot <= bandolierAmmo; BandolierSlot++) {

View File

@ -119,7 +119,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml
int charges = lds->Entries[i].multiplier; int charges = lds->Entries[i].multiplier;
for(int j = 0; j < charges; ++j) { for(int j = 0; j < charges; ++j) {
if(zone->random.Real(0.0, 100.0) <= lds->Entries[i].chance) { if(zone->random.Real(0.0, 100.0) <= lds->Entries[i].chance) {
const Item_Struct* dbitem = GetItem(lds->Entries[i].item_id); const ItemData* dbitem = GetItem(lds->Entries[i].item_id);
npc->AddLootDrop(dbitem, itemlist, lds->Entries[i].item_charges, lds->Entries[i].minlevel, npc->AddLootDrop(dbitem, itemlist, lds->Entries[i].item_charges, lds->Entries[i].minlevel,
lds->Entries[i].maxlevel, lds->Entries[i].equip_item > 0 ? true : false, false); lds->Entries[i].maxlevel, lds->Entries[i].equip_item > 0 ? true : false, false);
} }
@ -139,7 +139,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml
float roll_t = 0.0f; float roll_t = 0.0f;
bool active_item_list = false; bool active_item_list = false;
for(uint32 i = 0; i < lds->NumEntries; ++i) { for(uint32 i = 0; i < lds->NumEntries; ++i) {
const Item_Struct* db_item = GetItem(lds->Entries[i].item_id); const ItemData* db_item = GetItem(lds->Entries[i].item_id);
if(db_item) { if(db_item) {
roll_t += lds->Entries[i].chance; roll_t += lds->Entries[i].chance;
active_item_list = true; active_item_list = true;
@ -157,7 +157,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml
for(int i = 0; i < item_count; ++i) { for(int i = 0; i < item_count; ++i) {
float roll = (float)zone->random.Real(0.0, roll_t); float roll = (float)zone->random.Real(0.0, roll_t);
for(uint32 j = 0; j < lds->NumEntries; ++j) { for(uint32 j = 0; j < lds->NumEntries; ++j) {
const Item_Struct* db_item = GetItem(lds->Entries[j].item_id); const ItemData* db_item = GetItem(lds->Entries[j].item_id);
if(db_item) { if(db_item) {
if(roll < lds->Entries[j].chance) { if(roll < lds->Entries[j].chance) {
npc->AddLootDrop(db_item, itemlist, lds->Entries[j].item_charges, lds->Entries[j].minlevel, npc->AddLootDrop(db_item, itemlist, lds->Entries[j].item_charges, lds->Entries[j].minlevel,
@ -191,7 +191,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml
} }
//if itemlist is null, just send wear changes //if itemlist is null, just send wear changes
void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charges, uint8 minlevel, uint8 maxlevel, bool equipit, bool wearchange) { void NPC::AddLootDrop(const ItemData *item2, ItemList* itemlist, int16 charges, uint8 minlevel, uint8 maxlevel, bool equipit, bool wearchange) {
if(item2 == nullptr) if(item2 == nullptr)
return; return;
@ -228,7 +228,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
if (equipit) { if (equipit) {
uint8 eslot = 0xFF; uint8 eslot = 0xFF;
char newid[20]; char newid[20];
const Item_Struct* compitem = nullptr; const ItemData* compitem = nullptr;
bool found = false; // track if we found an empty slot we fit into bool found = false; // track if we found an empty slot we fit into
int32 foundslot = -1; // for multi-slot items int32 foundslot = -1; // for multi-slot items
@ -380,14 +380,14 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
SendAppearancePacket(AT_Light, GetActiveLightValue()); SendAppearancePacket(AT_Light, GetActiveLightValue());
} }
void NPC::AddItem(const Item_Struct* item, uint16 charges, bool equipitem) { void NPC::AddItem(const ItemData* item, uint16 charges, bool equipitem) {
//slot isnt needed, its determined from the item. //slot isnt needed, its determined from the item.
AddLootDrop(item, &itemlist, charges, 1, 127, equipitem, equipitem); AddLootDrop(item, &itemlist, charges, 1, 127, equipitem, equipitem);
} }
void NPC::AddItem(uint32 itemid, uint16 charges, bool equipitem) { void NPC::AddItem(uint32 itemid, uint16 charges, bool equipitem) {
//slot isnt needed, its determined from the item. //slot isnt needed, its determined from the item.
const Item_Struct * i = database.GetItem(itemid); const ItemData * i = database.GetItem(itemid);
if(i == nullptr) if(i == nullptr)
return; return;
AddLootDrop(i, &itemlist, charges, 1, 127, equipitem, equipitem); AddLootDrop(i, &itemlist, charges, 1, 127, equipitem, equipitem);

View File

@ -7,7 +7,7 @@
#include "lua_item.h" #include "lua_item.h"
Lua_Item::Lua_Item(uint32 item_id) { Lua_Item::Lua_Item(uint32 item_id) {
const Item_Struct *t = database.GetItem(item_id); const ItemData *t = database.GetItem(item_id);
SetLuaPtrData(t); SetLuaPtrData(t);
} }

View File

@ -4,7 +4,7 @@
#include "lua_ptr.h" #include "lua_ptr.h"
struct Item_Struct; struct ItemData;
namespace luabind { namespace luabind {
struct scope; struct scope;
@ -12,17 +12,17 @@ namespace luabind {
luabind::scope lua_register_item(); luabind::scope lua_register_item();
class Lua_Item : public Lua_Ptr<const Item_Struct> class Lua_Item : public Lua_Ptr<const ItemData>
{ {
typedef const Item_Struct NativeType; typedef const ItemData NativeType;
public: public:
Lua_Item(uint32 item_id); Lua_Item(uint32 item_id);
Lua_Item() : Lua_Ptr(nullptr) { } Lua_Item() : Lua_Ptr(nullptr) { }
Lua_Item(const Item_Struct *d) : Lua_Ptr(d) { } Lua_Item(const ItemData *d) : Lua_Ptr(d) { }
virtual ~Lua_Item() { } virtual ~Lua_Item() { }
operator const Item_Struct*() { operator const ItemData*() {
return reinterpret_cast<const Item_Struct*>(GetLuaPtrData()); return reinterpret_cast<const ItemData*>(GetLuaPtrData());
} }
int GetMinStatus(); int GetMinStatus();

View File

@ -297,7 +297,7 @@ void handle_player_timer(QuestInterface *parse, lua_State* L, Client* client, st
void handle_player_discover_item(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data, void handle_player_discover_item(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
std::vector<EQEmu::Any> *extra_pointers) { std::vector<EQEmu::Any> *extra_pointers) {
const Item_Struct *item = database.GetItem(extra_data); const ItemData *item = database.GetItem(extra_data);
if(item) { if(item) {
Lua_Item l_item(item); Lua_Item l_item(item);
luabind::adl::object l_item_o = luabind::adl::object(L, l_item); luabind::adl::object l_item_o = luabind::adl::object(L, l_item);

View File

@ -209,7 +209,7 @@ void Merc::CalcItemBonuses(StatBonuses* newbon) {
for (i=0; i<MainAmmo; i++) { for (i=0; i<MainAmmo; i++) {
if(equipment[i] == 0) if(equipment[i] == 0)
continue; continue;
const Item_Struct * itm = database.GetItem(equipment[i]); const ItemData * itm = database.GetItem(equipment[i]);
if(itm) if(itm)
AddItemBonuses(itm, newbon); AddItemBonuses(itm, newbon);
} }
@ -235,7 +235,7 @@ void Merc::CalcItemBonuses(StatBonuses* newbon) {
SetAttackTimer(); SetAttackTimer();
} }
void Merc::AddItemBonuses(const Item_Struct *item, StatBonuses* newbon) { void Merc::AddItemBonuses(const ItemData *item, StatBonuses* newbon) {
if(GetLevel() < item->ReqLevel) if(GetLevel() < item->ReqLevel)
{ {
@ -1213,7 +1213,7 @@ void Merc::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
{ {
continue; continue;
} }
const Item_Struct* item = database.GetItem(equipment[i]); const ItemData* item = database.GetItem(equipment[i]);
if(item) if(item)
{ {
ns->spawn.equipment[i].material = item->Material; ns->spawn.equipment[i].material = item->Material;
@ -2537,8 +2537,8 @@ int16 Merc::GetFocusEffect(focusType type, uint16 spell_id) {
//Check if item focus effect exists for the client. //Check if item focus effect exists for the client.
if (itembonuses.FocusEffects[type]){ if (itembonuses.FocusEffects[type]){
const Item_Struct* TempItem = 0; const ItemData* TempItem = 0;
const Item_Struct* UsedItem = 0; const ItemData* UsedItem = 0;
uint16 UsedFocusID = 0; uint16 UsedFocusID = 0;
int16 Total = 0; int16 Total = 0;
int16 focus_max = 0; int16 focus_max = 0;
@ -4400,7 +4400,7 @@ void Merc::DoClassAttacks(Mob *target) {
DoAnim(animKick); DoAnim(animKick);
int32 dmg = 0; int32 dmg = 0;
if(GetWeaponDamage(target, (const Item_Struct*)nullptr) <= 0){ if(GetWeaponDamage(target, (const ItemData*)nullptr) <= 0){
dmg = -5; dmg = -5;
} }
else{ else{
@ -4422,7 +4422,7 @@ void Merc::DoClassAttacks(Mob *target) {
DoAnim(animTailRake); DoAnim(animTailRake);
int32 dmg = 0; int32 dmg = 0;
if(GetWeaponDamage(target, (const Item_Struct*)nullptr) <= 0){ if(GetWeaponDamage(target, (const ItemData*)nullptr) <= 0){
dmg = -5; dmg = -5;
} }
else{ else{

View File

@ -8,7 +8,7 @@ class Corpse;
class Group; class Group;
class Mob; class Mob;
class Raid; class Raid;
struct Item_Struct; struct ItemData;
struct MercTemplate; struct MercTemplate;
struct NPCType; struct NPCType;
struct NewSpawn_Struct; struct NewSpawn_Struct;
@ -278,7 +278,7 @@ public:
protected: protected:
void CalcItemBonuses(StatBonuses* newbon); void CalcItemBonuses(StatBonuses* newbon);
void AddItemBonuses(const Item_Struct *item, StatBonuses* newbon); void AddItemBonuses(const ItemData *item, StatBonuses* newbon);
int CalcRecommendedLevelBonus(uint8 level, uint8 reclevel, int basestat); int CalcRecommendedLevelBonus(uint8 level, uint8 reclevel, int basestat);
int16 GetFocusEffect(focusType type, uint16 spell_id); int16 GetFocusEffect(focusType type, uint16 spell_id);

View File

@ -2206,7 +2206,7 @@ bool Mob::CanThisClassDualWield(void) const {
// 2HS, 2HB, or 2HP // 2HS, 2HB, or 2HP
if(pinst && pinst->IsWeapon()) { if(pinst && pinst->IsWeapon()) {
const Item_Struct* item = pinst->GetItem(); const ItemData* item = pinst->GetItem();
if((item->ItemType == ItemType2HBlunt) || (item->ItemType == ItemType2HSlash) || (item->ItemType == ItemType2HPiercing)) if((item->ItemType == ItemType2HBlunt) || (item->ItemType == ItemType2HSlash) || (item->ItemType == ItemType2HPiercing))
return false; return false;
@ -2635,7 +2635,7 @@ int32 Mob::GetEquipmentMaterial(uint8 material_slot) const
{ {
uint32 equipmaterial = 0; uint32 equipmaterial = 0;
int32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType); int32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
const Item_Struct *item; const ItemData *item;
item = database.GetItem(GetEquipment(material_slot)); item = database.GetItem(GetEquipment(material_slot));
if (item != 0) if (item != 0)
@ -2688,7 +2688,7 @@ int32 Mob::GetHerosForgeModel(uint8 material_slot) const
if (material_slot >= 0 && material_slot < MaterialPrimary) if (material_slot >= 0 && material_slot < MaterialPrimary)
{ {
uint32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType); uint32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
const Item_Struct *item; const ItemData *item;
item = database.GetItem(GetEquipment(material_slot)); item = database.GetItem(GetEquipment(material_slot));
int16 invslot = InventoryOld::CalcSlotFromMaterial(material_slot); int16 invslot = InventoryOld::CalcSlotFromMaterial(material_slot);
@ -2742,7 +2742,7 @@ int32 Mob::GetHerosForgeModel(uint8 material_slot) const
uint32 Mob::GetEquipmentColor(uint8 material_slot) const uint32 Mob::GetEquipmentColor(uint8 material_slot) const
{ {
const Item_Struct *item; const ItemData *item;
if (armor_tint[material_slot]) if (armor_tint[material_slot])
{ {
@ -2758,7 +2758,7 @@ uint32 Mob::GetEquipmentColor(uint8 material_slot) const
uint32 Mob::IsEliteMaterialItem(uint8 material_slot) const uint32 Mob::IsEliteMaterialItem(uint8 material_slot) const
{ {
const Item_Struct *item; const ItemData *item;
item = database.GetItem(GetEquipment(material_slot)); item = database.GetItem(GetEquipment(material_slot));
if(item != 0) if(item != 0)
@ -3669,7 +3669,7 @@ int32 Mob::GetItemStat(uint32 itemid, const char *identifier)
if (!inst) if (!inst)
return 0; return 0;
const Item_Struct* item = inst->GetItem(); const ItemData* item = inst->GetItem();
if (!item) if (!item)
return 0; return 0;
@ -5367,7 +5367,7 @@ int32 Mob::GetSpellStat(uint32 spell_id, const char *identifier, uint8 slot)
bool Mob::CanClassEquipItem(uint32 item_id) bool Mob::CanClassEquipItem(uint32 item_id)
{ {
const Item_Struct* itm = nullptr; const ItemData* itm = nullptr;
itm = database.GetItem(item_id); itm = database.GetItem(item_id);
if (!itm) if (!itm)

View File

@ -38,7 +38,7 @@ class Group;
class ItemInst; class ItemInst;
class NPC; class NPC;
class Raid; class Raid;
struct Item_Struct; struct ItemData;
struct NewSpawn_Struct; struct NewSpawn_Struct;
struct PlayerPositionUpdateServer_Struct; struct PlayerPositionUpdateServer_Struct;
@ -711,7 +711,7 @@ public:
inline void SetExtraHaste(int Haste) { ExtraHaste = Haste; } inline void SetExtraHaste(int Haste) { ExtraHaste = Haste; }
virtual int GetHaste(); virtual int GetHaste();
uint8 GetWeaponDamageBonus(const Item_Struct* Weapon); uint8 GetWeaponDamageBonus(const ItemData* Weapon);
uint16 GetDamageTable(SkillUseTypes skillinuse); uint16 GetDamageTable(SkillUseTypes skillinuse);
virtual int GetMonkHandToHandDamage(void); virtual int GetMonkHandToHandDamage(void);
@ -735,10 +735,10 @@ public:
int32 ReduceAllDamage(int32 damage); int32 ReduceAllDamage(int32 damage);
virtual void DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage, int32 min_damage = 1, int32 hate_override = -1, int ReuseTime = 10, bool HitChance=false, bool CanAvoid=true); virtual void DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage, int32 min_damage = 1, int32 hate_override = -1, int ReuseTime = 10, bool HitChance=false, bool CanAvoid=true);
virtual void DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon=nullptr, const Item_Struct* AmmoItem=nullptr, uint16 weapon_damage=0, int16 chance_mod=0,int16 focus=0, int ReuseTime=0, uint32 range_id=0, int AmmoSlot=0, float speed = 4.0f); virtual void DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon=nullptr, const ItemData* AmmoItem=nullptr, uint16 weapon_damage=0, int16 chance_mod=0,int16 focus=0, int ReuseTime=0, uint32 range_id=0, int AmmoSlot=0, float speed = 4.0f);
virtual void DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes skillinuse, int16 chance_mod=0, int16 focus=0, bool CanRiposte=false, int ReuseTime=0); virtual void DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes skillinuse, int16 chance_mod=0, int16 focus=0, bool CanRiposte=false, int ReuseTime=0);
virtual void DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon=nullptr, const ItemInst* Ammo=nullptr, uint16 weapon_damage=0, int16 chance_mod=0, int16 focus=0, int ReuseTime=0, uint32 range_id=0, uint32 ammo_id=0, const Item_Struct *AmmoItem=nullptr, int AmmoSlot=0, float speed= 4.0f); virtual void DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon=nullptr, const ItemInst* Ammo=nullptr, uint16 weapon_damage=0, int16 chance_mod=0, int16 focus=0, int ReuseTime=0, uint32 range_id=0, uint32 ammo_id=0, const ItemData *AmmoItem=nullptr, int AmmoSlot=0, float speed= 4.0f);
bool TryProjectileAttack(Mob* other, const Item_Struct *item, SkillUseTypes skillInUse, uint16 weapon_dmg, const ItemInst* RangeWeapon, const ItemInst* Ammo, int AmmoSlot, float speed); bool TryProjectileAttack(Mob* other, const ItemData *item, SkillUseTypes skillInUse, uint16 weapon_dmg, const ItemInst* RangeWeapon, const ItemInst* Ammo, int AmmoSlot, float speed);
void ProjectileAttack(); void ProjectileAttack();
inline bool HasProjectileAttack() const { return ActiveProjectileATK; } inline bool HasProjectileAttack() const { return ActiveProjectileATK; }
inline void SetProjectileAttack(bool value) { ActiveProjectileATK = value; } inline void SetProjectileAttack(bool value) { ActiveProjectileATK = value; }
@ -858,7 +858,7 @@ public:
// HP Event // HP Event
inline int GetNextHPEvent() const { return nexthpevent; } inline int GetNextHPEvent() const { return nexthpevent; }
void SetNextHPEvent( int hpevent ); void SetNextHPEvent( int hpevent );
void SendItemAnimation(Mob *to, const Item_Struct *item, SkillUseTypes skillInUse, float velocity= 4.0); void SendItemAnimation(Mob *to, const ItemData *item, SkillUseTypes skillInUse, float velocity= 4.0);
inline int& GetNextIncHPEvent() { return nextinchpevent; } inline int& GetNextIncHPEvent() { return nextinchpevent; }
void SetNextIncHPEvent( int inchpevent ); void SetNextIncHPEvent( int inchpevent );
@ -1038,8 +1038,8 @@ protected:
bool PassLimitToSkill(uint16 spell_id, uint16 skill); bool PassLimitToSkill(uint16 spell_id, uint16 skill);
bool PassLimitClass(uint32 Classes_, uint16 Class_); bool PassLimitClass(uint32 Classes_, uint16 Class_);
void TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand = MainPrimary); void TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand = MainPrimary);
void TryWeaponProc(const ItemInst* inst, const Item_Struct* weapon, Mob *on, uint16 hand = MainPrimary); void TryWeaponProc(const ItemInst* inst, const ItemData* weapon, Mob *on, uint16 hand = MainPrimary);
void TrySpellProc(const ItemInst* inst, const Item_Struct* weapon, Mob *on, uint16 hand = MainPrimary); void TrySpellProc(const ItemInst* inst, const ItemData* weapon, Mob *on, uint16 hand = MainPrimary);
void TryWeaponProc(const ItemInst* weapon, Mob *on, uint16 hand = MainPrimary); void TryWeaponProc(const ItemInst* weapon, Mob *on, uint16 hand = MainPrimary);
void ExecWeaponProc(const ItemInst* weapon, uint16 spell_id, Mob *on); void ExecWeaponProc(const ItemInst* weapon, uint16 spell_id, Mob *on);
virtual float GetProcChances(float ProcBonus, uint16 hand = MainPrimary); virtual float GetProcChances(float ProcBonus, uint16 hand = MainPrimary);
@ -1048,7 +1048,7 @@ protected:
virtual float GetAssassinateProcChances(uint16 ReuseTime); virtual float GetAssassinateProcChances(uint16 ReuseTime);
virtual float GetSkillProcChances(uint16 ReuseTime, uint16 hand = 0); // hand = MainCharm? virtual float GetSkillProcChances(uint16 ReuseTime, uint16 hand = 0); // hand = MainCharm?
uint16 GetWeaponSpeedbyHand(uint16 hand); uint16 GetWeaponSpeedbyHand(uint16 hand);
int GetWeaponDamage(Mob *against, const Item_Struct *weapon_item); int GetWeaponDamage(Mob *against, const ItemData *weapon_item);
int GetWeaponDamage(Mob *against, const ItemInst *weapon_item, uint32 *hate = nullptr); int GetWeaponDamage(Mob *against, const ItemInst *weapon_item, uint32 *hate = nullptr);
int GetKickDamage(); int GetKickDamage();
int GetBashDamage(); int GetBashDamage();

View File

@ -9,7 +9,7 @@ class ItemInst;
class Spawn2; class Spawn2;
struct Consider_Struct; struct Consider_Struct;
struct DBTradeskillRecipe_Struct; struct DBTradeskillRecipe_Struct;
struct Item_Struct; struct ItemData;
extern EntityList entity_list; extern EntityList entity_list;
extern Zone* zone; extern Zone* zone;
@ -26,7 +26,7 @@ void Zone::mod_repop() { return; }
void NPC::mod_prespawn(Spawn2 *sp) { return; } void NPC::mod_prespawn(Spawn2 *sp) { return; }
//Base damage from NPC::Attack //Base damage from NPC::Attack
int NPC::mod_npc_damage(int damage, SkillUseTypes skillinuse, int hand, const Item_Struct* weapon, Mob* other) { return(damage); } int NPC::mod_npc_damage(int damage, SkillUseTypes skillinuse, int hand, const ItemData* weapon, Mob* other) { return(damage); }
//Mob c has been given credit for a kill. This is called after the regular EVENT_KILLED_MERIT event. //Mob c has been given credit for a kill. This is called after the regular EVENT_KILLED_MERIT event.
void NPC::mod_npc_killed_merit(Mob* c) { return; } void NPC::mod_npc_killed_merit(Mob* c) { return; }
@ -104,8 +104,8 @@ int32 Client::mod_client_xp(int32 in_xp, NPC *npc) { return(in_xp); }
uint32 Client::mod_client_xp_for_level(uint32 xp, uint16 check_level) { return(xp); } uint32 Client::mod_client_xp_for_level(uint32 xp, uint16 check_level) { return(xp); }
//Food and drink values as computed by consume requests. Return < 0 to abort the request. //Food and drink values as computed by consume requests. Return < 0 to abort the request.
int Client::mod_food_value(const Item_Struct *item, int change) { return(change); } int Client::mod_food_value(const ItemData *item, int change) { return(change); }
int Client::mod_drink_value(const Item_Struct *item, int change) { return(change); } int Client::mod_drink_value(const ItemData *item, int change) { return(change); }
//effect_vallue - Spell effect value as calculated by default formulas. You will want to ignore effects that don't lend themselves to scaling - pet ID's, gate coords, etc. //effect_vallue - Spell effect value as calculated by default formulas. You will want to ignore effects that don't lend themselves to scaling - pet ID's, gate coords, etc.
int Mob::mod_effect_value(int effect_value, uint16 spell_id, int effect_type, Mob* caster) { return(effect_value); } int Mob::mod_effect_value(int effect_value, uint16 spell_id, int effect_type, Mob* caster) { return(effect_value); }

View File

@ -27,7 +27,7 @@
#include "../common/clientversions.h" #include "../common/clientversions.h"
#include "../common/features.h" #include "../common/features.h"
#include "../common/item.h" #include "../common/item.h"
#include "../common/item_struct.h" #include "../common/item_data.h"
#include "../common/linked_list.h" #include "../common/linked_list.h"
#include "../common/servertalk.h" #include "../common/servertalk.h"
@ -509,7 +509,7 @@ void NPC::QueryLoot(Client* to)
int x = 0; int x = 0;
for(ItemList::iterator cur = itemlist.begin(); cur != itemlist.end(); ++cur, ++x) { for(ItemList::iterator cur = itemlist.begin(); cur != itemlist.end(); ++cur, ++x) {
const Item_Struct* item = database.GetItem((*cur)->item_id); const ItemData* item = database.GetItem((*cur)->item_id);
if (item == nullptr) { if (item == nullptr) {
Log.Out(Logs::General, Logs::Error, "Database error, invalid item"); Log.Out(Logs::General, Logs::Error, "Database error, invalid item");
continue; continue;
@ -1375,7 +1375,7 @@ void NPC::PickPocket(Client* thief) {
end = itemlist.end(); end = itemlist.end();
for(; cur != end && x < 49; ++cur) { for(; cur != end && x < 49; ++cur) {
ServerLootItem_Struct* citem = *cur; ServerLootItem_Struct* citem = *cur;
const Item_Struct* item = database.GetItem(citem->item_id); const ItemData* item = database.GetItem(citem->item_id);
if (item) if (item)
{ {
inst = database.CreateItem(item, citem->charges); inst = database.CreateItem(item, citem->charges);
@ -1401,7 +1401,7 @@ void NPC::PickPocket(Client* thief) {
inst = database.CreateItem(steal_items[random], charges[random]); inst = database.CreateItem(steal_items[random], charges[random]);
if (inst) if (inst)
{ {
const Item_Struct* item = inst->GetItem(); const ItemData* item = inst->GetItem();
if (item) if (item)
{ {
if (/*item->StealSkill || */steal_skill >= stealchance) if (/*item->StealSkill || */steal_skill >= stealchance)

View File

@ -90,7 +90,7 @@ class Client;
class Group; class Group;
class Raid; class Raid;
class Spawn2; class Spawn2;
struct Item_Struct; struct ItemData;
class NPC : public Mob class NPC : public Mob
{ {
@ -172,7 +172,7 @@ public:
virtual void SpellProcess(); virtual void SpellProcess();
virtual void FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho); virtual void FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho);
void AddItem(const Item_Struct* item, uint16 charges, bool equipitem = true); void AddItem(const ItemData* item, uint16 charges, bool equipitem = true);
void AddItem(uint32 itemid, uint16 charges, bool equipitem = true); void AddItem(uint32 itemid, uint16 charges, bool equipitem = true);
void AddLootTable(); void AddLootTable();
void AddLootTable(uint32 ldid); void AddLootTable(uint32 ldid);
@ -264,7 +264,7 @@ public:
bool IsTaunting() const { return taunting; } bool IsTaunting() const { return taunting; }
void PickPocket(Client* thief); void PickPocket(Client* thief);
void StartSwarmTimer(uint32 duration) { swarm_timer.Start(duration); } void StartSwarmTimer(uint32 duration) { swarm_timer.Start(duration); }
void AddLootDrop(const Item_Struct*dbitem, ItemList* itemlistconst, int16 charges, uint8 minlevel, uint8 maxlevel, bool equipit, bool wearchange = false); void AddLootDrop(const ItemData*dbitem, ItemList* itemlistconst, int16 charges, uint8 minlevel, uint8 maxlevel, bool equipit, bool wearchange = false);
virtual void DoClassAttacks(Mob *target); virtual void DoClassAttacks(Mob *target);
void CheckSignal(); void CheckSignal();
inline bool IsNotTargetableWithHotkey() const { return no_target_hotkey; } inline bool IsNotTargetableWithHotkey() const { return no_target_hotkey; }
@ -394,7 +394,7 @@ public:
void SetMerchantProbability(uint8 amt) { probability = amt; } void SetMerchantProbability(uint8 amt) { probability = amt; }
uint8 GetMerchantProbability() { return probability; } uint8 GetMerchantProbability() { return probability; }
void mod_prespawn(Spawn2 *sp); void mod_prespawn(Spawn2 *sp);
int mod_npc_damage(int damage, SkillUseTypes skillinuse, int hand, const Item_Struct* weapon, Mob* other); int mod_npc_damage(int damage, SkillUseTypes skillinuse, int hand, const ItemData* weapon, Mob* other);
void mod_npc_killed_merit(Mob* c); void mod_npc_killed_merit(Mob* c);
void mod_npc_killed(Mob* oos); void mod_npc_killed(Mob* oos);
void AISpellsList(Client *c); void AISpellsList(Client *c);

View File

@ -138,7 +138,7 @@ Object::Object(Client* client, const ItemInst* inst)
// Set object name // Set object name
if (inst) { if (inst) {
const Item_Struct* item = inst->GetItem(); const ItemData* item = inst->GetItem();
if (item && item->IDFile) { if (item && item->IDFile) {
if (strlen(item->IDFile) == 0) { if (strlen(item->IDFile) == 0) {
strcpy(m_data.object_name, DEFAULT_OBJECT_NAME); strcpy(m_data.object_name, DEFAULT_OBJECT_NAME);
@ -194,7 +194,7 @@ Object::Object(const ItemInst *inst, float x, float y, float z, float heading, u
// Set object name // Set object name
if (inst) { if (inst) {
const Item_Struct* item = inst->GetItem(); const ItemData* item = inst->GetItem();
if (item && item->IDFile) { if (item && item->IDFile) {
if (strlen(item->IDFile) == 0) { if (strlen(item->IDFile) == 0) {
strcpy(m_data.object_name, DEFAULT_OBJECT_NAME); strcpy(m_data.object_name, DEFAULT_OBJECT_NAME);
@ -860,7 +860,7 @@ uint32 Object::GetItemID()
return 0; return 0;
} }
const Item_Struct* item = this->m_inst->GetItem(); const ItemData* item = this->m_inst->GetItem();
if (item == 0) if (item == 0)
{ {

View File

@ -8054,7 +8054,7 @@ XS(XS_Mob_DoThrowingAttackDmg)
Mob * THIS; Mob * THIS;
Mob* target; Mob* target;
ItemInst* RangeWeapon = nullptr; ItemInst* RangeWeapon = nullptr;
Item_Struct* item = nullptr; ItemData* item = nullptr;
uint16 weapon_damage = (uint16)SvIV(ST(4)); uint16 weapon_damage = (uint16)SvIV(ST(4));
int16 chance_mod = (int16)SvIV(ST(5)); int16 chance_mod = (int16)SvIV(ST(5));
int16 focus = (int16)SvIV(ST(6)); int16 focus = (int16)SvIV(ST(6));

View File

@ -407,7 +407,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower,
// like the special back items some focused pets may receive. // like the special back items some focused pets may receive.
uint32 petinv[EmuConstants::EQUIPMENT_SIZE]; uint32 petinv[EmuConstants::EQUIPMENT_SIZE];
memset(petinv, 0, sizeof(petinv)); memset(petinv, 0, sizeof(petinv));
const Item_Struct *item = 0; const ItemData *item = 0;
if (database.GetBasePetItems(record.equipmentset, petinv)) { if (database.GetBasePetItems(record.equipmentset, petinv)) {
for (int i = 0; i<EmuConstants::EQUIPMENT_SIZE; i++) for (int i = 0; i<EmuConstants::EQUIPMENT_SIZE; i++)
@ -634,7 +634,7 @@ void NPC::SetPetState(SpellBuff_Struct *pet_buffs, uint32 *items) {
if(items[i] == 0) if(items[i] == 0)
continue; continue;
const Item_Struct* item2 = database.GetItem(items[i]); const ItemData* item2 = database.GetItem(items[i]);
if (item2 && item2->NoDrop != 0) { if (item2 && item2->NoDrop != 0) {
//dont bother saving item charges for now, NPCs never use them //dont bother saving item charges for now, NPCs never use them
//and nobody should be able to get them off the corpse..? //and nobody should be able to get them off the corpse..?

View File

@ -737,7 +737,7 @@ void QuestManager::traindisc(int discipline_tome_item_id) {
} }
bool QuestManager::isdisctome(int item_id) { bool QuestManager::isdisctome(int item_id) {
const Item_Struct *item = database.GetItem(item_id); const ItemData *item = database.GetItem(item_id);
if(item == nullptr) { if(item == nullptr) {
return(false); return(false);
} }
@ -1227,7 +1227,7 @@ void QuestManager::settime(uint8 new_hour, uint8 new_min) {
void QuestManager::itemlink(int item_id) { void QuestManager::itemlink(int item_id) {
QuestManagerCurrentQuestVars(); QuestManagerCurrentQuestVars();
if (initiator) { if (initiator) {
const Item_Struct* item = database.GetItem(item_id); const ItemData* item = database.GetItem(item_id);
if (item == nullptr) if (item == nullptr)
return; return;
@ -2425,7 +2425,7 @@ void QuestManager::MerchantSetItem(uint32 NPCid, uint32 itemid, uint32 quantity)
if (merchant == 0 || !merchant->IsNPC() || (merchant->GetClass() != MERCHANT)) if (merchant == 0 || !merchant->IsNPC() || (merchant->GetClass() != MERCHANT))
return; // don't do anything if NPCid isn't a merchant return; // don't do anything if NPCid isn't a merchant
const Item_Struct* item = nullptr; const ItemData* item = nullptr;
item = database.GetItem(itemid); item = database.GetItem(itemid);
if (!item) return; // if the item id doesn't correspond to a real item, do nothing if (!item) return; // if the item id doesn't correspond to a real item, do nothing
@ -2438,7 +2438,7 @@ uint32 QuestManager::MerchantCountItem(uint32 NPCid, uint32 itemid) {
if (merchant == 0 || !merchant->IsNPC() || (merchant->GetClass() != MERCHANT)) if (merchant == 0 || !merchant->IsNPC() || (merchant->GetClass() != MERCHANT))
return 0; // if it isn't a merchant, it doesn't have any items return 0; // if it isn't a merchant, it doesn't have any items
const Item_Struct* item = nullptr; const ItemData* item = nullptr;
item = database.GetItem(itemid); item = database.GetItem(itemid);
if (!item) if (!item)
return 0; // if it isn't a valid item, the merchant doesn't have any return 0; // if it isn't a valid item, the merchant doesn't have any
@ -2461,7 +2461,7 @@ uint32 QuestManager::MerchantCountItem(uint32 NPCid, uint32 itemid) {
// Item Link for use in Variables - "my $example_link = quest::varlink(item_id);" // Item Link for use in Variables - "my $example_link = quest::varlink(item_id);"
const char* QuestManager::varlink(char* perltext, int item_id) { const char* QuestManager::varlink(char* perltext, int item_id) {
QuestManagerCurrentQuestVars(); QuestManagerCurrentQuestVars();
const Item_Struct* item = database.GetItem(item_id); const ItemData* item = database.GetItem(item_id);
if (!item) if (!item)
return "INVALID ITEM ID IN VARLINK"; return "INVALID ITEM ID IN VARLINK";

View File

@ -119,7 +119,7 @@ void Mob::DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage,
{ {
hate += item->GetItem()->AC; hate += item->GetItem()->AC;
} }
const Item_Struct *itm = item->GetItem(); const ItemData *itm = item->GetItem();
hate = hate * (100 + GetFuriousBash(itm->Focus.Effect)) / 100; hate = hate * (100 + GetFuriousBash(itm->Focus.Effect)) / 100;
} }
} }
@ -474,7 +474,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type)
} }
} }
else{ else{
if(GetWeaponDamage(other, (const Item_Struct*)nullptr) <= 0){ if(GetWeaponDamage(other, (const ItemData*)nullptr) <= 0){
ndamage = -5; ndamage = -5;
} }
} }
@ -705,8 +705,8 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
return; return;
} }
const Item_Struct* RangeItem = RangeWeapon->GetItem(); const ItemData* RangeItem = RangeWeapon->GetItem();
const Item_Struct* AmmoItem = Ammo->GetItem(); const ItemData* AmmoItem = Ammo->GetItem();
if(RangeItem->ItemType != ItemTypeBow) { if(RangeItem->ItemType != ItemTypeBow) {
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Ranged item is not a bow. type %d.", RangeItem->ItemType); Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Ranged item is not a bow. type %d.", RangeItem->ItemType);
@ -730,7 +730,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
const ItemInst *pi = m_inv[r]; const ItemInst *pi = m_inv[r];
if(pi == nullptr || !pi->IsType(ItemClassContainer)) if(pi == nullptr || !pi->IsType(ItemClassContainer))
continue; continue;
const Item_Struct* bagitem = pi->GetItem(); const ItemData* bagitem = pi->GetItem();
if(!bagitem || bagitem->BagType != BagTypeQuiver) if(!bagitem || bagitem->BagType != BagTypeQuiver)
continue; continue;
@ -809,7 +809,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
} }
void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const ItemInst* Ammo, uint16 weapon_damage, int16 chance_mod, int16 focus, int ReuseTime, void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const ItemInst* Ammo, uint16 weapon_damage, int16 chance_mod, int16 focus, int ReuseTime,
uint32 range_id, uint32 ammo_id, const Item_Struct *AmmoItem, int AmmoSlot, float speed) { uint32 range_id, uint32 ammo_id, const ItemData *AmmoItem, int AmmoSlot, float speed) {
if ((other == nullptr || if ((other == nullptr ||
((IsClient() && CastToClient()->dead) || ((IsClient() && CastToClient()->dead) ||
@ -824,7 +824,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
const ItemInst* _RangeWeapon = nullptr; const ItemInst* _RangeWeapon = nullptr;
const ItemInst* _Ammo = nullptr; const ItemInst* _Ammo = nullptr;
const Item_Struct* ammo_lost = nullptr; const ItemData* ammo_lost = nullptr;
/* /*
If LaunchProjectile is false this function will do archery damage on target, If LaunchProjectile is false this function will do archery damage on target,
@ -1017,7 +1017,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
} }
} }
bool Mob::TryProjectileAttack(Mob* other, const Item_Struct *item, SkillUseTypes skillInUse, uint16 weapon_dmg, const ItemInst* RangeWeapon, const ItemInst* Ammo, int AmmoSlot, float speed){ bool Mob::TryProjectileAttack(Mob* other, const ItemData *item, SkillUseTypes skillInUse, uint16 weapon_dmg, const ItemInst* RangeWeapon, const ItemInst* Ammo, int AmmoSlot, float speed){
if (!other) if (!other)
return false; return false;
@ -1322,7 +1322,7 @@ void NPC::DoRangedAttackDmg(Mob* other, bool Launch, int16 damage_mod, int16 cha
//try proc on hits and misses //try proc on hits and misses
if(other && !other->HasDied()) if(other && !other->HasDied())
TrySpellProc(nullptr, (const Item_Struct*)nullptr, other, MainRange); TrySpellProc(nullptr, (const ItemData*)nullptr, other, MainRange);
if (HasSkillProcs() && other && !other->HasDied()) if (HasSkillProcs() && other && !other->HasDied())
TrySkillProc(other, skillInUse, 0, false, MainRange); TrySkillProc(other, skillInUse, 0, false, MainRange);
@ -1376,7 +1376,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
return; return;
} }
const Item_Struct* item = RangeWeapon->GetItem(); const ItemData* item = RangeWeapon->GetItem();
if(item->ItemType != ItemTypeLargeThrowing && item->ItemType != ItemTypeSmallThrowing) { if(item->ItemType != ItemTypeLargeThrowing && item->ItemType != ItemTypeSmallThrowing) {
Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Ranged item %d is not a throwing weapon. type %d.", item->ItemType); Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Ranged item %d is not a throwing weapon. type %d.", item->ItemType);
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(MainRange)); Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(MainRange));
@ -1437,7 +1437,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
CommonBreakInvisible(); CommonBreakInvisible();
} }
void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Item_Struct* AmmoItem, uint16 weapon_damage, int16 chance_mod,int16 focus, int ReuseTime, uint32 range_id, int AmmoSlot, float speed) void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const ItemData* AmmoItem, uint16 weapon_damage, int16 chance_mod,int16 focus, int ReuseTime, uint32 range_id, int AmmoSlot, float speed)
{ {
if ((other == nullptr || if ((other == nullptr ||
((IsClient() && CastToClient()->dead) || ((IsClient() && CastToClient()->dead) ||
@ -1451,7 +1451,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
} }
const ItemInst* _RangeWeapon = nullptr; const ItemInst* _RangeWeapon = nullptr;
const Item_Struct* ammo_lost = nullptr; const ItemData* ammo_lost = nullptr;
/* /*
If LaunchProjectile is false this function will do archery damage on target, If LaunchProjectile is false this function will do archery damage on target,
@ -1575,7 +1575,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
} }
} }
void Mob::SendItemAnimation(Mob *to, const Item_Struct *item, SkillUseTypes skillInUse, float velocity) { void Mob::SendItemAnimation(Mob *to, const ItemData *item, SkillUseTypes skillInUse, float velocity) {
EQApplicationPacket *outapp = new EQApplicationPacket(OP_SomeItemPacketMaybe, sizeof(Arrow_Struct)); EQApplicationPacket *outapp = new EQApplicationPacket(OP_SomeItemPacketMaybe, sizeof(Arrow_Struct));
Arrow_Struct *as = (Arrow_Struct *) outapp->pBuffer; Arrow_Struct *as = (Arrow_Struct *) outapp->pBuffer;
as->type = 1; as->type = 1;
@ -1625,7 +1625,7 @@ void Mob::ProjectileAnimation(Mob* to, int item_id, bool IsArrow, float speed, f
if (!to) if (!to)
return; return;
const Item_Struct* item = nullptr; const ItemData* item = nullptr;
uint8 item_type = 0; uint8 item_type = 0;
if(!item_id) { if(!item_id) {
@ -1766,7 +1766,7 @@ void NPC::DoClassAttacks(Mob *target) {
DoAnim(animKick); DoAnim(animKick);
int32 dmg = 0; int32 dmg = 0;
if(GetWeaponDamage(target, (const Item_Struct*)nullptr) <= 0){ if(GetWeaponDamage(target, (const ItemData*)nullptr) <= 0){
dmg = -5; dmg = -5;
} }
else{ else{
@ -1787,7 +1787,7 @@ void NPC::DoClassAttacks(Mob *target) {
DoAnim(animTailRake); DoAnim(animTailRake);
int32 dmg = 0; int32 dmg = 0;
if(GetWeaponDamage(target, (const Item_Struct*)nullptr) <= 0){ if(GetWeaponDamage(target, (const ItemData*)nullptr) <= 0){
dmg = -5; dmg = -5;
} }
else{ else{
@ -1840,7 +1840,7 @@ void NPC::DoClassAttacks(Mob *target) {
DoAnim(animKick); DoAnim(animKick);
int32 dmg = 0; int32 dmg = 0;
if(GetWeaponDamage(target, (const Item_Struct*)nullptr) <= 0){ if(GetWeaponDamage(target, (const ItemData*)nullptr) <= 0){
dmg = -5; dmg = -5;
} }
else{ else{
@ -1865,7 +1865,7 @@ void NPC::DoClassAttacks(Mob *target) {
DoAnim(animTailRake); DoAnim(animTailRake);
int32 dmg = 0; int32 dmg = 0;
if(GetWeaponDamage(target, (const Item_Struct*)nullptr) <= 0){ if(GetWeaponDamage(target, (const ItemData*)nullptr) <= 0){
dmg = -5; dmg = -5;
} }
else{ else{
@ -2377,7 +2377,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
int32 max_hit = (2 * weapon_damage*GetDamageTable(skillinuse)) / 100; int32 max_hit = (2 * weapon_damage*GetDamageTable(skillinuse)) / 100;
if(GetLevel() >= 28 && IsWarriorClass() ) { if(GetLevel() >= 28 && IsWarriorClass() ) {
int ucDamageBonus = GetWeaponDamageBonus((const Item_Struct*) nullptr ); int ucDamageBonus = GetWeaponDamageBonus((const ItemData*) nullptr );
min_hit += (int) ucDamageBonus; min_hit += (int) ucDamageBonus;
max_hit += (int) ucDamageBonus; max_hit += (int) ucDamageBonus;
hate += ucDamageBonus; hate += ucDamageBonus;
@ -2390,7 +2390,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
if(item->GetItem()->ItemType == ItemTypeShield) { if(item->GetItem()->ItemType == ItemTypeShield) {
hate += item->GetItem()->AC; hate += item->GetItem()->AC;
} }
const Item_Struct *itm = item->GetItem(); const ItemData *itm = item->GetItem();
hate = hate * (100 + GetFuriousBash(itm->Focus.Effect)) / 100; hate = hate * (100 + GetFuriousBash(itm->Focus.Effect)) / 100;
} }
} }

View File

@ -1143,7 +1143,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
case SE_SummonItem: case SE_SummonItem:
{ {
const Item_Struct *item = database.GetItem(spell.base[i]); const ItemData *item = database.GetItem(spell.base[i]);
#ifdef SPELL_EFFECT_SPAM #ifdef SPELL_EFFECT_SPAM
const char *itemname = item ? item->Name : "*Unknown Item*"; const char *itemname = item ? item->Name : "*Unknown Item*";
snprintf(effect_desc, _EDLEN, "Summon Item: %s (id %d)", itemname, spell.base[i]); snprintf(effect_desc, _EDLEN, "Summon Item: %s (id %d)", itemname, spell.base[i]);
@ -1179,7 +1179,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
} }
case SE_SummonItemIntoBag: case SE_SummonItemIntoBag:
{ {
const Item_Struct *item = database.GetItem(spell.base[i]); const ItemData *item = database.GetItem(spell.base[i]);
#ifdef SPELL_EFFECT_SPAM #ifdef SPELL_EFFECT_SPAM
const char *itemname = item ? item->Name : "*Unknown Item*"; const char *itemname = item ? item->Name : "*Unknown Item*";
snprintf(effect_desc, _EDLEN, "Summon Item In Bag: %s (id %d)", itemname, spell.base[i]); snprintf(effect_desc, _EDLEN, "Summon Item In Bag: %s (id %d)", itemname, spell.base[i]);
@ -5191,7 +5191,7 @@ int16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) {
//item focus //item focus
if (itembonuses.FocusEffects[type]){ if (itembonuses.FocusEffects[type]){
const Item_Struct* TempItem = 0; const ItemData* TempItem = 0;
for(int x = EmuConstants::EQUIPMENT_BEGIN; x <= EmuConstants::EQUIPMENT_END; x++) for(int x = EmuConstants::EQUIPMENT_BEGIN; x <= EmuConstants::EQUIPMENT_END; x++)
{ {
@ -5222,7 +5222,7 @@ int16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) {
aug = ins->GetAugment(y); aug = ins->GetAugment(y);
if(aug) if(aug)
{ {
const Item_Struct* TempItemAug = aug->GetItem(); const ItemData* TempItemAug = aug->GetItem();
if (TempItemAug && TempItemAug->Focus.Effect > 0 && IsValidSpell(TempItemAug->Focus.Effect)) { if (TempItemAug && TempItemAug->Focus.Effect > 0 && IsValidSpell(TempItemAug->Focus.Effect)) {
proc_spellid = CalcFocusEffect(type, TempItemAug->Focus.Effect, spell_id); proc_spellid = CalcFocusEffect(type, TempItemAug->Focus.Effect, spell_id);
if (IsValidSpell(proc_spellid)){ if (IsValidSpell(proc_spellid)){
@ -5317,8 +5317,8 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id) {
//Check if item focus effect exists for the client. //Check if item focus effect exists for the client.
if (itembonuses.FocusEffects[type]){ if (itembonuses.FocusEffects[type]){
const Item_Struct* TempItem = 0; const ItemData* TempItem = 0;
const Item_Struct* UsedItem = 0; const ItemData* UsedItem = 0;
uint16 UsedFocusID = 0; uint16 UsedFocusID = 0;
int16 Total = 0; int16 Total = 0;
int16 focus_max = 0; int16 focus_max = 0;
@ -5365,7 +5365,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id) {
aug = ins->GetAugment(y); aug = ins->GetAugment(y);
if(aug) if(aug)
{ {
const Item_Struct* TempItemAug = aug->GetItem(); const ItemData* TempItemAug = aug->GetItem();
if (TempItemAug && TempItemAug->Focus.Effect > 0 && TempItemAug->Focus.Effect != SPELL_UNKNOWN) { if (TempItemAug && TempItemAug->Focus.Effect > 0 && TempItemAug->Focus.Effect != SPELL_UNKNOWN) {
if(rand_effectiveness) { if(rand_effectiveness) {
focus_max = CalcFocusEffect(type, TempItemAug->Focus.Effect, spell_id, true); focus_max = CalcFocusEffect(type, TempItemAug->Focus.Effect, spell_id, true);
@ -5548,8 +5548,8 @@ int16 NPC::GetFocusEffect(focusType type, uint16 spell_id) {
if (RuleB(Spells, NPC_UseFocusFromItems) && itembonuses.FocusEffects[type]){ if (RuleB(Spells, NPC_UseFocusFromItems) && itembonuses.FocusEffects[type]){
const Item_Struct* TempItem = 0; const ItemData* TempItem = 0;
const Item_Struct* UsedItem = 0; const ItemData* UsedItem = 0;
uint16 UsedFocusID = 0; uint16 UsedFocusID = 0;
int16 Total = 0; int16 Total = 0;
int16 focus_max = 0; int16 focus_max = 0;
@ -5557,7 +5557,7 @@ int16 NPC::GetFocusEffect(focusType type, uint16 spell_id) {
//item focus //item focus
for(int i = 0; i < EmuConstants::EQUIPMENT_SIZE; i++){ for(int i = 0; i < EmuConstants::EQUIPMENT_SIZE; i++){
const Item_Struct *cur = database.GetItem(equipment[i]); const ItemData *cur = database.GetItem(equipment[i]);
if(!cur) if(!cur)
continue; continue;

View File

@ -1140,7 +1140,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot,
missingreags=true; missingreags=true;
} }
const Item_Struct *item = database.GetItem(component); const ItemData *item = database.GetItem(component);
if(item) { if(item) {
c->Message_StringID(13, MISSING_SPELL_COMP_ITEM, item->Name); c->Message_StringID(13, MISSING_SPELL_COMP_ITEM, item->Name);
Log.Out(Logs::Detail, Logs::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, item->Name, component); Log.Out(Logs::Detail, Logs::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, item->Name, component);
@ -1200,7 +1200,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot,
{ {
bool fromaug = false; bool fromaug = false;
const ItemInst* inst = CastToClient()->GetInv()[inventory_slot]; const ItemInst* inst = CastToClient()->GetInv()[inventory_slot];
Item_Struct* augitem = 0; ItemData* augitem = 0;
uint32 recastdelay = 0; uint32 recastdelay = 0;
uint32 recasttype = 0; uint32 recasttype = 0;
@ -1213,7 +1213,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot,
if (!aug_i) if (!aug_i)
continue; continue;
const Item_Struct* aug = aug_i->GetItem(); const ItemData* aug = aug_i->GetItem();
if (!aug) if (!aug)
continue; continue;
@ -1249,7 +1249,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot,
if (inst && inst->IsType(ItemClassCommon) && (inst->GetItem()->Click.Effect == spell_id) && inst->GetCharges() || fromaug) if (inst && inst->IsType(ItemClassCommon) && (inst->GetItem()->Click.Effect == spell_id) && inst->GetCharges() || fromaug)
{ {
//const Item_Struct* item = inst->GetItem(); //const ItemData* item = inst->GetItem();
int16 charges = inst->GetItem()->MaxCharges; int16 charges = inst->GetItem()->MaxCharges;
if(fromaug) { charges = -1; } //Don't destroy the parent item if(fromaug) { charges = -1; } //Don't destroy the parent item

View File

@ -1866,7 +1866,7 @@ void ClientTaskState::RewardTask(Client *c, TaskInformation *Task) {
if(!Task || !c) return; if(!Task || !c) return;
const Item_Struct* Item; const ItemData* Item;
std::vector<int> RewardList; std::vector<int> RewardList;
switch(Task->RewardMethod) { switch(Task->RewardMethod) {
@ -2759,7 +2759,7 @@ void TaskManager::SendActiveTaskDescription(Client *c, int TaskID, int SequenceN
} }
if(ItemID) { if(ItemID) {
const Item_Struct* reward_item = database.GetItem(ItemID); const ItemData* reward_item = database.GetItem(ItemID);
Client::TextLink linker; Client::TextLink linker;
linker.SetLinkType(linker.linkItemData); linker.SetLinkType(linker.linkItemData);

View File

@ -61,7 +61,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme
inst = user_inv.GetItem(in_augment->container_slot); inst = user_inv.GetItem(in_augment->container_slot);
if (inst) if (inst)
{ {
const Item_Struct* item = inst->GetItem(); const ItemData* item = inst->GetItem();
if (item && inst->IsType(ItemClassContainer) && item->BagType == 53) if (item && inst->IsType(ItemClassContainer) && item->BagType == 53)
{ {
// We have found an appropriate inventory augmentation sealer // We have found an appropriate inventory augmentation sealer
@ -267,7 +267,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
else { else {
inst = user_inv.GetItem(in_combine->container_slot); inst = user_inv.GetItem(in_combine->container_slot);
if (inst) { if (inst) {
const Item_Struct* item = inst->GetItem(); const ItemData* item = inst->GetItem();
if (item && inst->IsType(ItemClassContainer)) { if (item && inst->IsType(ItemClassContainer)) {
c_type = item->BagType; c_type = item->BagType;
some_id = item->ID; some_id = item->ID;
@ -285,7 +285,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
const ItemInst* inst = container->GetItem(0); const ItemInst* inst = container->GetItem(0);
bool AllowAll = RuleB(Inventory, AllowAnyWeaponTransformation); bool AllowAll = RuleB(Inventory, AllowAnyWeaponTransformation);
if (inst && ItemInst::CanTransform(inst->GetItem(), container->GetItem(), AllowAll)) { if (inst && ItemInst::CanTransform(inst->GetItem(), container->GetItem(), AllowAll)) {
const Item_Struct* new_weapon = inst->GetItem(); const ItemData* new_weapon = inst->GetItem();
user->DeleteItemInInventory(InventoryOld::CalcSlotId(in_combine->container_slot, 0), 0, true); user->DeleteItemInInventory(InventoryOld::CalcSlotId(in_combine->container_slot, 0), 0, true);
container->Clear(); container->Clear();
user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), MainCursor, container->GetItem()->Icon, atoi(container->GetItem()->IDFile + 2)); user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), MainCursor, container->GetItem()->Icon, atoi(container->GetItem()->IDFile + 2));
@ -305,7 +305,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
if (container->GetItem() && container->GetItem()->BagType == BagTypeDetransformationmold) { if (container->GetItem() && container->GetItem()->BagType == BagTypeDetransformationmold) {
const ItemInst* inst = container->GetItem(0); const ItemInst* inst = container->GetItem(0);
if (inst && inst->GetOrnamentationIcon() && inst->GetOrnamentationIcon()) { if (inst && inst->GetOrnamentationIcon() && inst->GetOrnamentationIcon()) {
const Item_Struct* new_weapon = inst->GetItem(); const ItemData* new_weapon = inst->GetItem();
user->DeleteItemInInventory(InventoryOld::CalcSlotId(in_combine->container_slot, 0), 0, true); user->DeleteItemInInventory(InventoryOld::CalcSlotId(in_combine->container_slot, 0), 0, true);
container->Clear(); container->Clear();
user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), MainCursor, 0, 0); user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), MainCursor, 0, 0);
@ -529,7 +529,7 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac
for(std::list<int>::iterator it = MissingItems.begin(); it != MissingItems.end(); ++it) for(std::list<int>::iterator it = MissingItems.begin(); it != MissingItems.end(); ++it)
{ {
const Item_Struct* item = database.GetItem(*it); const ItemData* item = database.GetItem(*it);
if(item) if(item)
user->Message_StringID(MT_Skills, TRADESKILL_MISSING_ITEM, item->Name); user->Message_StringID(MT_Skills, TRADESKILL_MISSING_ITEM, item->Name);
@ -953,7 +953,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
break; break;
} }
} }
const Item_Struct* item = nullptr; const ItemData* item = nullptr;
if (spec->tradeskill == SkillBlacksmithing) { if (spec->tradeskill == SkillBlacksmithing) {
switch(GetAA(aaBlacksmithingMastery)) { switch(GetAA(aaBlacksmithingMastery)) {
@ -1202,7 +1202,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3
if (!inst) if (!inst)
continue; continue;
const Item_Struct* item = GetItem(inst->GetItem()->ID); const ItemData* item = GetItem(inst->GetItem()->ID);
if (!item) if (!item)
continue; continue;
@ -1331,7 +1331,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3
if(!inst) if(!inst)
continue; continue;
const Item_Struct* item = GetItem(inst->GetItem()->ID); const ItemData* item = GetItem(inst->GetItem()->ID);
if (!item) if (!item)
continue; continue;

View File

@ -885,7 +885,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
continue; continue;
} }
const Item_Struct* item = inst->GetItem(); const ItemData* item = inst->GetItem();
if(item && quest_npc == false) { if(item && quest_npc == false) {
// if it was not a NO DROP or Attuned item (or if a GM is trading), let the NPC have it // if it was not a NO DROP or Attuned item (or if a GM is trading), let the NPC have it
if(GetGM() || (item->NoDrop != 0 && inst->IsAttuned() == false)) { if(GetGM() || (item->NoDrop != 0 && inst->IsAttuned() == false)) {
@ -894,7 +894,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
for(int16 bslot = SUB_BEGIN; bslot < item->BagSlots; bslot++) { for(int16 bslot = SUB_BEGIN; bslot < item->BagSlots; bslot++) {
const ItemInst* baginst = inst->GetItem(bslot); const ItemInst* baginst = inst->GetItem(bslot);
if (baginst) { if (baginst) {
const Item_Struct* bagitem = baginst->GetItem(); const ItemData* bagitem = baginst->GetItem();
if (bagitem && (GetGM() || (bagitem->NoDrop != 0 && baginst->IsAttuned() == false))) { if (bagitem && (GetGM() || (bagitem->NoDrop != 0 && baginst->IsAttuned() == false))) {
tradingWith->CastToNPC()->AddLootDrop(bagitem, &tradingWith->CastToNPC()->itemlist, tradingWith->CastToNPC()->AddLootDrop(bagitem, &tradingWith->CastToNPC()->itemlist,
baginst->GetCharges(), 1, 127, true, true); baginst->GetCharges(), 1, 127, true, true);
@ -1158,7 +1158,7 @@ void Client::SendTraderItem(uint32 ItemID, uint16 Quantity) {
std::string Packet; std::string Packet;
int16 FreeSlotID=0; int16 FreeSlotID=0;
const Item_Struct* item = database.GetItem(ItemID); const ItemData* item = database.GetItem(ItemID);
if(!item){ if(!item){
Log.Out(Logs::Detail, Logs::Trading, "Bogus item deleted in Client::SendTraderItem!\n"); Log.Out(Logs::Detail, Logs::Trading, "Bogus item deleted in Client::SendTraderItem!\n");
@ -1192,7 +1192,7 @@ void Client::SendSingleTraderItem(uint32 CharID, int SerialNumber) {
} }
void Client::BulkSendTraderInventory(uint32 char_id) { void Client::BulkSendTraderInventory(uint32 char_id) {
const Item_Struct *item; const ItemData *item;
TraderCharges_Struct* TraderItems = database.LoadTraderItemWithCharges(char_id); TraderCharges_Struct* TraderItems = database.LoadTraderItemWithCharges(char_id);
@ -2021,7 +2021,7 @@ static void UpdateTraderCustomerItemsAdded(uint32 CustomerID, TraderCharges_Stru
if(!Customer) return; if(!Customer) return;
const Item_Struct *item = database.GetItem(ItemID); const ItemData *item = database.GetItem(ItemID);
if(!item) return; if(!item) return;
@ -2065,7 +2065,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St
if(!Customer) return; if(!Customer) return;
const Item_Struct *item = database.GetItem(ItemID); const ItemData *item = database.GetItem(ItemID);
if(!item) return; if(!item) return;
@ -2224,7 +2224,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) {
} }
const Item_Struct *item = 0; const ItemData *item = 0;
if(IDOfItemToAdd) if(IDOfItemToAdd)
item = database.GetItem(IDOfItemToAdd); item = database.GetItem(IDOfItemToAdd);
@ -2390,7 +2390,7 @@ void Client::SendBuyerResults(char* searchString, uint32 searchID) {
char *buf = (char *)outapp->pBuffer; char *buf = (char *)outapp->pBuffer;
const Item_Struct* item = database.GetItem(itemID); const ItemData* item = database.GetItem(itemID);
if(!item) if(!item)
continue; continue;
@ -2482,7 +2482,7 @@ void Client::ShowBuyLines(const EQApplicationPacket *app) {
char *Buf = (char *)outapp->pBuffer; char *Buf = (char *)outapp->pBuffer;
const Item_Struct* item = database.GetItem(ItemID); const ItemData* item = database.GetItem(ItemID);
if(!item) if(!item)
continue; continue;
@ -2524,7 +2524,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) {
/*uint32 BuyerID2 =*/ VARSTRUCT_SKIP_TYPE(uint32, Buf); //unused /*uint32 BuyerID2 =*/ VARSTRUCT_SKIP_TYPE(uint32, Buf); //unused
/*uint32 Unknown3 =*/ VARSTRUCT_SKIP_TYPE(uint32, Buf); //unused /*uint32 Unknown3 =*/ VARSTRUCT_SKIP_TYPE(uint32, Buf); //unused
const Item_Struct *item = database.GetItem(ItemID); const ItemData *item = database.GetItem(ItemID);
if(!item || !Quantity || !Price || !QtyBuyerWants) return; if(!item || !Quantity || !Price || !QtyBuyerWants) return;
@ -2915,7 +2915,7 @@ void Client::UpdateBuyLine(const EQApplicationPacket *app) {
/*uint32 UnknownZ =*/ VARSTRUCT_SKIP_TYPE(uint32, Buf); //unused /*uint32 UnknownZ =*/ VARSTRUCT_SKIP_TYPE(uint32, Buf); //unused
uint32 ItemCount = VARSTRUCT_DECODE_TYPE(uint32, Buf); uint32 ItemCount = VARSTRUCT_DECODE_TYPE(uint32, Buf);
const Item_Struct *item = database.GetItem(ItemID); const ItemData *item = database.GetItem(ItemID);
if(!item) return; if(!item) return;
@ -2979,7 +2979,7 @@ void Client::BuyerItemSearch(const EQApplicationPacket *app) {
BuyerItemSearchResults_Struct* bisr = (BuyerItemSearchResults_Struct*)outapp->pBuffer; BuyerItemSearchResults_Struct* bisr = (BuyerItemSearchResults_Struct*)outapp->pBuffer;
const Item_Struct* item = 0; const ItemData* item = 0;
int Count=0; int Count=0;

View File

@ -630,7 +630,7 @@ int32 Client::GetMeleeDamage(Mob* other, bool GetMinDamage)
if( Hand == MainPrimary && GetLevel() >= 28 && IsWarriorClass() ) if( Hand == MainPrimary && GetLevel() >= 28 && IsWarriorClass() )
{ {
ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const Item_Struct*) nullptr ); ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const ItemData*) nullptr );
min_hit += (int) ucDamageBonus; min_hit += (int) ucDamageBonus;
max_hit += (int) ucDamageBonus; max_hit += (int) ucDamageBonus;

View File

@ -629,7 +629,7 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) {
int Charges = atoi(row[3]); int Charges = atoi(row[3]);
int Cost = atoi(row[4]); int Cost = atoi(row[4]);
const Item_Struct *item = database.GetItem(ItemID); const ItemData *item = database.GetItem(ItemID);
if(!item) { if(!item) {
Log.Out(Logs::Detail, Logs::Trading, "Unable to create item\n"); Log.Out(Logs::Detail, Logs::Trading, "Unable to create item\n");
@ -684,7 +684,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg
Log.Out(Logs::Detail, Logs::Trading, "ZoneDatabase::UpdateTraderPrice(%i, %i, %i, %i)", CharID, ItemID, Charges, NewPrice); Log.Out(Logs::Detail, Logs::Trading, "ZoneDatabase::UpdateTraderPrice(%i, %i, %i, %i)", CharID, ItemID, Charges, NewPrice);
const Item_Struct *item = database.GetItem(ItemID); const ItemData *item = database.GetItem(ItemID);
if(!item) if(!item)
return; return;
@ -1225,7 +1225,7 @@ bool ZoneDatabase::LoadCharacterPotions(uint32 character_id, PlayerProfile_Struc
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
i = atoi(row[0]); /* Potion belt slot number */ i = atoi(row[0]); /* Potion belt slot number */
uint32 item_id = atoi(row[1]); uint32 item_id = atoi(row[1]);
const Item_Struct *item = database.GetItem(item_id); const ItemData *item = database.GetItem(item_id);
if(!item) if(!item)
continue; continue;