mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-22 08:08:25 +00:00
Renamed struct EQEmu::ItemBase to EQEmu::ItemData and class ItemInst to EQEmu::ItemInstance
This commit is contained in:
+20
-20
@@ -146,13 +146,13 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
|
||||
unsigned int i;
|
||||
// Update: MainAmmo should only calc skill mods (TODO: Check for other cases)
|
||||
for (i = EQEmu::legacy::SlotCharm; i <= EQEmu::legacy::SlotAmmo; i++) {
|
||||
const ItemInst* inst = m_inv[i];
|
||||
const EQEmu::ItemInstance* inst = m_inv[i];
|
||||
if(inst == 0)
|
||||
continue;
|
||||
AddItemBonuses(inst, newbon, false, false, 0, (i == EQEmu::legacy::SlotAmmo));
|
||||
|
||||
//These are given special flags due to how often they are checked for various spell effects.
|
||||
const EQEmu::ItemBase *item = inst->GetItem();
|
||||
const EQEmu::ItemData *item = inst->GetItem();
|
||||
if (i == EQEmu::legacy::SlotSecondary && (item && item->ItemType == EQEmu::item::ItemTypeShield))
|
||||
SetShieldEquiped(true);
|
||||
else if (i == EQEmu::legacy::SlotPrimary && (item && item->ItemType == EQEmu::item::ItemType2HBlunt)) {
|
||||
@@ -166,14 +166,14 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
|
||||
//Power Source Slot
|
||||
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
|
||||
{
|
||||
const ItemInst* inst = m_inv[EQEmu::legacy::SlotPowerSource];
|
||||
const EQEmu::ItemInstance* inst = m_inv[EQEmu::legacy::SlotPowerSource];
|
||||
if(inst)
|
||||
AddItemBonuses(inst, newbon);
|
||||
}
|
||||
|
||||
//tribute items
|
||||
for (i = 0; i < EQEmu::legacy::TRIBUTE_SIZE; i++) {
|
||||
const ItemInst* inst = m_inv[EQEmu::legacy::TRIBUTE_BEGIN + i];
|
||||
const EQEmu::ItemInstance* inst = m_inv[EQEmu::legacy::TRIBUTE_BEGIN + i];
|
||||
if(inst == 0)
|
||||
continue;
|
||||
AddItemBonuses(inst, newbon, false, true);
|
||||
@@ -182,7 +182,7 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
|
||||
//Optional ability to have worn effects calculate as an addititive bonus instead of highest value
|
||||
if (RuleI(Spells, AdditiveBonusWornType) && RuleI(Spells, AdditiveBonusWornType) != EQEmu::item::ItemEffectWorn){
|
||||
for (i = EQEmu::legacy::SlotCharm; i < EQEmu::legacy::SlotAmmo; i++) {
|
||||
const ItemInst* inst = m_inv[i];
|
||||
const EQEmu::ItemInstance* inst = m_inv[i];
|
||||
if(inst == 0)
|
||||
continue;
|
||||
AdditiveWornBonuses(inst, newbon);
|
||||
@@ -208,7 +208,7 @@ void Client::ProcessItemCaps()
|
||||
itembonuses.ATK = std::min(itembonuses.ATK, CalcItemATKCap());
|
||||
}
|
||||
|
||||
void Client::AddItemBonuses(const ItemInst *inst, StatBonuses *newbon, bool isAug, bool isTribute, int rec_override, bool ammo_slot_item)
|
||||
void Client::AddItemBonuses(const EQEmu::ItemInstance *inst, StatBonuses *newbon, bool isAug, bool isTribute, int rec_override, bool ammo_slot_item)
|
||||
{
|
||||
if (!inst || !inst->IsClassCommon()) {
|
||||
return;
|
||||
@@ -218,7 +218,7 @@ void Client::AddItemBonuses(const ItemInst *inst, StatBonuses *newbon, bool isAu
|
||||
return;
|
||||
}
|
||||
|
||||
const EQEmu::ItemBase *item = inst->GetItem();
|
||||
const EQEmu::ItemData *item = inst->GetItem();
|
||||
|
||||
if (!isTribute && !inst->IsEquipable(GetBaseRace(), GetClass())) {
|
||||
if (item->ItemType != EQEmu::item::ItemTypeFood && item->ItemType != EQEmu::item::ItemTypeDrink)
|
||||
@@ -532,7 +532,7 @@ void Client::AddItemBonuses(const ItemInst *inst, StatBonuses *newbon, bool isAu
|
||||
}
|
||||
}
|
||||
|
||||
void Client::AdditiveWornBonuses(const ItemInst *inst, StatBonuses* newbon, bool isAug) {
|
||||
void Client::AdditiveWornBonuses(const EQEmu::ItemInstance *inst, StatBonuses* newbon, bool isAug) {
|
||||
|
||||
/*
|
||||
Powerful Non-live like option allows developers to add worn effects on items that
|
||||
@@ -550,7 +550,7 @@ void Client::AdditiveWornBonuses(const ItemInst *inst, StatBonuses* newbon, bool
|
||||
if(inst->GetAugmentType()==0 && isAug == true)
|
||||
return;
|
||||
|
||||
const EQEmu::ItemBase *item = inst->GetItem();
|
||||
const EQEmu::ItemData *item = inst->GetItem();
|
||||
|
||||
if(!inst->IsEquipable(GetBaseRace(),GetClass()))
|
||||
return;
|
||||
@@ -580,9 +580,9 @@ void Client::CalcEdibleBonuses(StatBonuses* newbon) {
|
||||
{
|
||||
if (food && drink)
|
||||
break;
|
||||
const ItemInst* inst = GetInv().GetItem(i);
|
||||
const EQEmu::ItemInstance* inst = GetInv().GetItem(i);
|
||||
if (inst && inst->GetItem() && inst->IsClassCommon()) {
|
||||
const EQEmu::ItemBase *item = inst->GetItem();
|
||||
const EQEmu::ItemData *item = inst->GetItem();
|
||||
if (item->ItemType == EQEmu::item::ItemTypeFood && !food)
|
||||
food = true;
|
||||
else if (item->ItemType == EQEmu::item::ItemTypeDrink && !drink)
|
||||
@@ -596,9 +596,9 @@ void Client::CalcEdibleBonuses(StatBonuses* newbon) {
|
||||
{
|
||||
if (food && drink)
|
||||
break;
|
||||
const ItemInst* inst = GetInv().GetItem(i);
|
||||
const EQEmu::ItemInstance* inst = GetInv().GetItem(i);
|
||||
if (inst && inst->GetItem() && inst->IsClassCommon()) {
|
||||
const EQEmu::ItemBase *item = inst->GetItem();
|
||||
const EQEmu::ItemData *item = inst->GetItem();
|
||||
if (item->ItemType == EQEmu::item::ItemTypeFood && !food)
|
||||
food = true;
|
||||
else if (item->ItemType == EQEmu::item::ItemTypeDrink && !drink)
|
||||
@@ -3205,7 +3205,7 @@ void NPC::CalcItemBonuses(StatBonuses *newbon)
|
||||
if(newbon){
|
||||
|
||||
for (int i = 0; i < EQEmu::legacy::EQUIPMENT_SIZE; i++){
|
||||
const EQEmu::ItemBase *cur = database.GetItem(equipment[i]);
|
||||
const EQEmu::ItemData *cur = database.GetItem(equipment[i]);
|
||||
if(cur){
|
||||
//basic stats
|
||||
newbon->AC += cur->AC;
|
||||
@@ -3317,7 +3317,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) {
|
||||
if (i == EQEmu::legacy::SlotAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
|
||||
continue;
|
||||
|
||||
ItemInst* inst = m_inv.GetItem(i);
|
||||
EQEmu::ItemInstance* inst = m_inv.GetItem(i);
|
||||
|
||||
if(inst == nullptr)
|
||||
continue;
|
||||
@@ -3325,7 +3325,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) {
|
||||
// TEST CODE: test for bazaar trader crashing with charm items
|
||||
if (Trader)
|
||||
if (i >= EQEmu::legacy::GENERAL_BAGS_BEGIN && i <= EQEmu::legacy::GENERAL_BAGS_END) {
|
||||
ItemInst* parent_item = m_inv.GetItem(Inventory::CalcSlotId(i));
|
||||
EQEmu::ItemInstance* parent_item = m_inv.GetItem(Inventory::CalcSlotId(i));
|
||||
if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel
|
||||
continue;
|
||||
}
|
||||
@@ -3346,7 +3346,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) {
|
||||
//iterate all augments
|
||||
for (int x = AUG_INDEX_BEGIN; x < EQEmu::legacy::ITEM_COMMON_SIZE; ++x)
|
||||
{
|
||||
ItemInst * a_inst = inst->GetAugment(x);
|
||||
EQEmu::ItemInstance * a_inst = inst->GetAugment(x);
|
||||
if(!a_inst)
|
||||
continue;
|
||||
|
||||
@@ -3410,7 +3410,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
|
||||
if (i == EQEmu::legacy::SlotAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
|
||||
continue;
|
||||
|
||||
ItemInst* inst = m_inv.GetItem(i);
|
||||
EQEmu::ItemInstance* inst = m_inv.GetItem(i);
|
||||
|
||||
if(!inst)
|
||||
continue;
|
||||
@@ -3418,7 +3418,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
|
||||
// TEST CODE: test for bazaar trader crashing with charm items
|
||||
if (Trader)
|
||||
if (i >= EQEmu::legacy::GENERAL_BAGS_BEGIN && i <= EQEmu::legacy::GENERAL_BAGS_END) {
|
||||
ItemInst* parent_item = m_inv.GetItem(Inventory::CalcSlotId(i));
|
||||
EQEmu::ItemInstance* parent_item = m_inv.GetItem(Inventory::CalcSlotId(i));
|
||||
if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel
|
||||
continue;
|
||||
}
|
||||
@@ -3449,7 +3449,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
|
||||
//iterate all augments
|
||||
for (int x = AUG_INDEX_BEGIN; x < EQEmu::legacy::ITEM_COMMON_SIZE; ++x)
|
||||
{
|
||||
ItemInst *a_inst = inst->GetAugment(x);
|
||||
EQEmu::ItemInstance *a_inst = inst->GetAugment(x);
|
||||
if(!a_inst)
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user