Delinked current inventory slot enumeration and constants from EQEmu::constants and global definition

This commit is contained in:
Uleat
2016-04-22 07:34:55 -04:00
parent b3475d7b50
commit 1890d006a2
65 changed files with 1835 additions and 1849 deletions
+73 -73
View File
@@ -2732,7 +2732,7 @@ void Client::SetMaterial(int16 in_slot, uint32 item_id) {
if (item && (item->ItemClass==ItemClassCommon))
{
uint8 matslot = Inventory::CalcMaterialFromSlot(in_slot);
if (matslot != MaterialInvalid)
if (matslot != EQEmu::legacy::MaterialInvalid)
{
m_pp.item_material[matslot] = GetEquipmentMaterial(matslot);
}
@@ -3074,7 +3074,7 @@ void Client::SetTint(int16 in_slot, uint32 color) {
void Client::SetTint(int16 in_slot, Color_Struct& color) {
uint8 matslot = Inventory::CalcMaterialFromSlot(in_slot);
if (matslot != MaterialInvalid)
if (matslot != EQEmu::legacy::MaterialInvalid)
{
m_pp.item_tint[matslot].Color = color.Color;
database.SaveCharacterMaterialColor(this->CharacterID(), in_slot, color.Color);
@@ -3151,58 +3151,58 @@ void Client::LinkDead()
uint8 Client::SlotConvert(uint8 slot,bool bracer){
uint8 slot2 = 0; // why are we returning MainCharm instead of INVALID_INDEX? (must be a pre-charm segment...)
if(bracer)
return SlotWrist2;
switch(slot){
case MaterialHead:
slot2 = SlotHead;
break;
case MaterialChest:
slot2 = SlotChest;
break;
case MaterialArms:
slot2 = SlotArms;
break;
case MaterialWrist:
slot2 = SlotWrist1;
break;
case MaterialHands:
slot2 = SlotHands;
break;
case MaterialLegs:
slot2 = SlotLegs;
break;
case MaterialFeet:
slot2 = SlotFeet;
break;
}
return EQEmu::legacy::SlotWrist2;
switch(slot) {
case EQEmu::legacy::MaterialHead:
slot2 = EQEmu::legacy::SlotHead;
break;
case EQEmu::legacy::MaterialChest:
slot2 = EQEmu::legacy::SlotChest;
break;
case EQEmu::legacy::MaterialArms:
slot2 = EQEmu::legacy::SlotArms;
break;
case EQEmu::legacy::MaterialWrist:
slot2 = EQEmu::legacy::SlotWrist1;
break;
case EQEmu::legacy::MaterialHands:
slot2 = EQEmu::legacy::SlotHands;
break;
case EQEmu::legacy::MaterialLegs:
slot2 = EQEmu::legacy::SlotLegs;
break;
case EQEmu::legacy::MaterialFeet:
slot2 = EQEmu::legacy::SlotFeet;
break;
}
return slot2;
}
uint8 Client::SlotConvert2(uint8 slot){
uint8 slot2 = 0; // same as above...
switch(slot){
case SlotHead:
slot2 = MaterialHead;
break;
case SlotChest:
slot2 = MaterialChest;
break;
case SlotArms:
slot2 = MaterialArms;
break;
case SlotWrist1:
slot2 = MaterialWrist;
break;
case SlotHands:
slot2 = MaterialHands;
break;
case SlotLegs:
slot2 = MaterialLegs;
break;
case SlotFeet:
slot2 = MaterialFeet;
break;
}
case EQEmu::legacy::SlotHead:
slot2 = EQEmu::legacy::MaterialHead;
break;
case EQEmu::legacy::SlotChest:
slot2 = EQEmu::legacy::MaterialChest;
break;
case EQEmu::legacy::SlotArms:
slot2 = EQEmu::legacy::MaterialArms;
break;
case EQEmu::legacy::SlotWrist1:
slot2 = EQEmu::legacy::MaterialWrist;
break;
case EQEmu::legacy::SlotHands:
slot2 = EQEmu::legacy::MaterialHands;
break;
case EQEmu::legacy::SlotLegs:
slot2 = EQEmu::legacy::MaterialLegs;
break;
case EQEmu::legacy::SlotFeet:
slot2 = EQEmu::legacy::MaterialFeet;
break;
}
return slot2;
}
@@ -4204,14 +4204,14 @@ bool Client::GroupFollow(Client* inviter) {
uint16 Client::GetPrimarySkillValue()
{
SkillUseTypes skill = HIGHEST_SKILL; //because nullptr == 0, which is 1H Slashing, & we want it to return 0 from GetSkill
bool equiped = m_inv.GetItem(SlotPrimary);
bool equiped = m_inv.GetItem(EQEmu::legacy::SlotPrimary);
if (!equiped)
skill = SkillHandtoHand;
else {
uint8 type = m_inv.GetItem(SlotPrimary)->GetItem()->ItemType; //is this the best way to do this?
uint8 type = m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType; //is this the best way to do this?
switch (type)
{
@@ -5392,7 +5392,7 @@ bool Client::TryReward(uint32 claim_id)
// save
uint32 free_slot = 0xFFFFFFFF;
for (int i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; ++i) {
for (int i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; ++i) {
ItemInst *item = GetInv().GetItem(i);
if (!item) {
free_slot = i;
@@ -5738,7 +5738,7 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
}
}
inst = requestee->GetInv().GetItem(SlotPowerSource);
inst = requestee->GetInv().GetItem(EQEmu::legacy::SlotPowerSource);
if(inst) {
item = inst->GetItem();
@@ -5752,7 +5752,7 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
insr->itemicons[SoF::inventory::SlotPowerSource] = 0xFFFFFFFF;
}
inst = requestee->GetInv().GetItem(SlotAmmo);
inst = requestee->GetInv().GetItem(EQEmu::legacy::SlotAmmo);
if(inst) {
item = inst->GetItem();
@@ -6293,8 +6293,8 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
made_npc->Corrup = GetCorrup();
made_npc->PhR = GetPhR();
// looks
made_npc->texture = GetEquipmentMaterial(MaterialChest);
made_npc->helmtexture = GetEquipmentMaterial(MaterialHead);
made_npc->texture = GetEquipmentMaterial(EQEmu::legacy::MaterialChest);
made_npc->helmtexture = GetEquipmentMaterial(EQEmu::legacy::MaterialHead);
made_npc->haircolor = GetHairColor();
made_npc->beardcolor = GetBeardColor();
made_npc->eyecolor1 = GetEyeColor1();
@@ -6305,9 +6305,9 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
made_npc->drakkin_heritage = GetDrakkinHeritage();
made_npc->drakkin_tattoo = GetDrakkinTattoo();
made_npc->drakkin_details = GetDrakkinDetails();
made_npc->d_melee_texture1 = GetEquipmentMaterial(MaterialPrimary);
made_npc->d_melee_texture2 = GetEquipmentMaterial(MaterialSecondary);
for (int i = EQEmu::constants::MATERIAL_BEGIN; i <= EQEmu::constants::MATERIAL_END; i++) {
made_npc->d_melee_texture1 = GetEquipmentMaterial(EQEmu::legacy::MaterialPrimary);
made_npc->d_melee_texture2 = GetEquipmentMaterial(EQEmu::legacy::MaterialSecondary);
for (int i = EQEmu::legacy::MATERIAL_BEGIN; i <= EQEmu::legacy::MATERIAL_END; i++) {
made_npc->armor_tint[i] = GetEquipmentColor(i);
}
made_npc->loottable_id = 0;
@@ -7583,7 +7583,7 @@ void Client::GarbleMessage(char *message, uint8 variance)
for (size_t i = 0; i < strlen(message); i++) {
// Client expects hex values inside of a text link body
if (message[i] == delimiter) {
if (!(delimiter_count & 1)) { i += EQEmu::constants::TEXT_LINK_BODY_LENGTH; }
if (!(delimiter_count & 1)) { i += EQEmu::legacy::TEXT_LINK_BODY_LENGTH; }
++delimiter_count;
continue;
}
@@ -8008,17 +8008,17 @@ void Client::TickItemCheck()
if(zone->tick_items.empty()) { return; }
//Scan equip slots for items
for (i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::EQUIPMENT_END; i++)
for (i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; i++)
{
TryItemTick(i);
}
//Scan main inventory + cursor
for (i = EQEmu::constants::GENERAL_BEGIN; i <= SlotCursor; i++)
for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::SlotCursor; i++)
{
TryItemTick(i);
}
//Scan bags
for (i = EQEmu::constants::GENERAL_BAGS_BEGIN; i <= EQEmu::constants::CURSOR_BAG_END; i++)
for (i = EQEmu::legacy::GENERAL_BAGS_BEGIN; i <= EQEmu::legacy::CURSOR_BAG_END; i++)
{
TryItemTick(i);
}
@@ -8034,7 +8034,7 @@ void Client::TryItemTick(int slot)
if(zone->tick_items.count(iid) > 0)
{
if (GetLevel() >= zone->tick_items[iid].level && zone->random.Int(0, 100) >= (100 - zone->tick_items[iid].chance) && (zone->tick_items[iid].bagslot || slot <= EQEmu::constants::EQUIPMENT_END))
if (GetLevel() >= zone->tick_items[iid].level && zone->random.Int(0, 100) >= (100 - zone->tick_items[iid].chance) && (zone->tick_items[iid].bagslot || slot <= EQEmu::legacy::EQUIPMENT_END))
{
ItemInst* e_inst = (ItemInst*)inst;
parse->EventItem(EVENT_ITEM_TICK, this, e_inst, nullptr, "", slot);
@@ -8042,9 +8042,9 @@ void Client::TryItemTick(int slot)
}
//Only look at augs in main inventory
if (slot > EQEmu::constants::EQUIPMENT_END) { return; }
if (slot > EQEmu::legacy::EQUIPMENT_END) { return; }
for (int x = AUG_INDEX_BEGIN; x < EQEmu::constants::ITEM_COMMON_SIZE; ++x)
for (int x = AUG_INDEX_BEGIN; x < EQEmu::legacy::ITEM_COMMON_SIZE; ++x)
{
ItemInst * a_inst = inst->GetAugment(x);
if(!a_inst) { continue; }
@@ -8065,17 +8065,17 @@ void Client::TryItemTick(int slot)
void Client::ItemTimerCheck()
{
int i;
for (i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::EQUIPMENT_END; i++)
for (i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; i++)
{
TryItemTimer(i);
}
for (i = EQEmu::constants::GENERAL_BEGIN; i <= SlotCursor; i++)
for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::SlotCursor; i++)
{
TryItemTimer(i);
}
for (i = EQEmu::constants::GENERAL_BAGS_BEGIN; i <= EQEmu::constants::CURSOR_BAG_END; i++)
for (i = EQEmu::legacy::GENERAL_BAGS_BEGIN; i <= EQEmu::legacy::CURSOR_BAG_END; i++)
{
TryItemTimer(i);
}
@@ -8097,11 +8097,11 @@ void Client::TryItemTimer(int slot)
++it_iter;
}
if (slot > EQEmu::constants::EQUIPMENT_END) {
if (slot > EQEmu::legacy::EQUIPMENT_END) {
return;
}
for (int x = AUG_INDEX_BEGIN; x < EQEmu::constants::ITEM_COMMON_SIZE; ++x)
for (int x = AUG_INDEX_BEGIN; x < EQEmu::legacy::ITEM_COMMON_SIZE; ++x)
{
ItemInst * a_inst = inst->GetAugment(x);
if(!a_inst) {
@@ -8389,12 +8389,12 @@ void Client::ShowNumHits()
int Client::GetQuiverHaste(int delay)
{
const ItemInst *pi = nullptr;
for (int r = EQEmu::constants::GENERAL_BEGIN; r <= EQEmu::constants::GENERAL_END; r++) {
for (int r = EQEmu::legacy::GENERAL_BEGIN; r <= EQEmu::legacy::GENERAL_END; r++) {
pi = GetInv().GetItem(r);
if (pi && pi->IsType(ItemClassContainer) && pi->GetItem()->BagType == BagTypeQuiver &&
pi->GetItem()->BagWR > 0)
break;
if (r == EQEmu::constants::GENERAL_END)
if (r == EQEmu::legacy::GENERAL_END)
// we will get here if we don't find a valid quiver
return 0;
}
@@ -8435,7 +8435,7 @@ void Client::QuestReward(Mob* target, uint32 copper, uint32 silver, uint32 gold,
AddMoneyToPP(copper, silver, gold, platinum, false);
if (itemid > 0)
SummonItem(itemid, 0, 0, 0, 0, 0, 0, false, SlotPowerSource);
SummonItem(itemid, 0, 0, 0, 0, 0, 0, false, EQEmu::legacy::SlotPowerSource);
if (faction)
{