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
+16 -16
View File
@@ -214,7 +214,7 @@ void Merc::CalcItemBonuses(StatBonuses* newbon) {
unsigned int i;
//should not include 21 (SLOT_AMMO)
for (i = 0; i < SlotAmmo; i++) {
for (i = 0; i < EQEmu::legacy::SlotAmmo; i++) {
if(equipment[i] == 0)
continue;
const Item_Struct * itm = database.GetItem(equipment[i]);
@@ -1559,24 +1559,24 @@ void Merc::AI_Process() {
//try main hand first
if(attack_timer.Check())
{
Attack(GetTarget(), SlotPrimary);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary);
bool tripleSuccess = false;
if(GetOwner() && GetTarget() && CanThisClassDoubleAttack())
{
if(GetOwner()) {
Attack(GetTarget(), SlotPrimary, true);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true);
}
if(GetOwner() && GetTarget() && GetSpecialAbility(SPECATK_TRIPLE)) {
tripleSuccess = true;
Attack(GetTarget(), SlotPrimary, true);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true);
}
//quad attack, does this belong here??
if(GetOwner() && GetTarget() && GetSpecialAbility(SPECATK_QUAD)) {
Attack(GetTarget(), SlotPrimary, true);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true);
}
}
@@ -1588,8 +1588,8 @@ void Merc::AI_Process() {
if(zone->random.Roll(flurrychance))
{
Message_StringID(MT_NPCFlurry, YOU_FLURRY);
Attack(GetTarget(), SlotPrimary, false);
Attack(GetTarget(), SlotPrimary, false);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false);
}
}
@@ -1598,7 +1598,7 @@ void Merc::AI_Process() {
if (GetTarget() && ExtraAttackChanceBonus) {
if(zone->random.Roll(ExtraAttackChanceBonus))
{
Attack(GetTarget(), SlotPrimary, false);
Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false);
}
}
}
@@ -1633,11 +1633,11 @@ void Merc::AI_Process() {
// Max 78% of DW
if (zone->random.Roll(DualWieldProbability))
{
Attack(GetTarget(), SlotSecondary); // Single attack with offhand
Attack(GetTarget(), EQEmu::legacy::SlotSecondary); // Single attack with offhand
if(CanThisClassDoubleAttack()) {
if(GetTarget() && GetTarget()->GetHP() > -10)
Attack(GetTarget(), SlotSecondary); // Single attack with offhand
Attack(GetTarget(), EQEmu::legacy::SlotSecondary); // Single attack with offhand
}
}
}
@@ -2552,7 +2552,7 @@ int16 Merc::GetFocusEffect(focusType type, uint16 spell_id) {
int16 focus_max_real = 0;
//item focus
for (int x = 0; x < EQEmu::constants::EQUIPMENT_SIZE; ++x)
for (int x = 0; x < EQEmu::legacy::EQUIPMENT_SIZE; ++x)
{
TempItem = nullptr;
if (equipment[x] == 0)
@@ -5025,12 +5025,12 @@ void Merc::ScaleStats(int scalepercent, bool setmax) {
void Merc::UpdateMercAppearance() {
// Copied from Bot Code:
uint32 itemID = NO_ITEM;
uint8 materialFromSlot = MaterialInvalid;
for (int i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::EQUIPMENT_END; ++i) {
uint8 materialFromSlot = EQEmu::legacy::MaterialInvalid;
for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) {
itemID = equipment[i];
if(itemID != NO_ITEM) {
materialFromSlot = Inventory::CalcMaterialFromSlot(i);
if(materialFromSlot != MaterialInvalid)
if (materialFromSlot != EQEmu::legacy::MaterialInvalid)
this->SendWearChange(materialFromSlot);
}
}
@@ -5044,8 +5044,8 @@ void Merc::UpdateEquipmentLight()
m_Light.Type.Equipment = 0;
m_Light.Level.Equipment = 0;
for (int index = SLOT_BEGIN; index < EQEmu::constants::EQUIPMENT_SIZE; ++index) {
if (index == SlotAmmo) { continue; }
for (int index = SLOT_BEGIN; index < EQEmu::legacy::EQUIPMENT_SIZE; ++index) {
if (index == EQEmu::legacy::SlotAmmo) { continue; }
auto item = database.GetItem(equipment[index]);
if (item == nullptr) { continue; }