diff --git a/changelog.txt b/changelog.txt index b019e8024..c4eff06b3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- == 04/22/2016 == Uleat: Reworked ClientVersion into namespace EQEmu; Added InventoryVersion +Uleat: Delinked current inventory slot enumeration and constants from EQEmu::constants and global definition (inv2 pre-work) == 04/19/2016 == Uleat: Changed the recent EQEmu rework to eliminate the nested class design (possible cause of VS2015 update crashes - unverified) diff --git a/common/database.cpp b/common/database.cpp index d2b28f4ee..a54de2bd5 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -708,7 +708,7 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven /* Insert starting inventory... */ std::string invquery; - for (int16 i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::BANK_BAGS_END;) { + for (int16 i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::BANK_BAGS_END;) { const ItemInst* newinv = inv->GetItem(i); if (newinv) { invquery = StringFormat("INSERT INTO `inventory` (charid, slotid, itemid, charges, color) VALUES (%u, %i, %u, %i, %u)", @@ -717,16 +717,16 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven auto results = QueryDatabase(invquery); } - if (i == SlotCursor) { - i = EQEmu::constants::GENERAL_BAGS_BEGIN; + if (i == EQEmu::legacy::SlotCursor) { + i = EQEmu::legacy::GENERAL_BAGS_BEGIN; continue; } - else if (i == EQEmu::constants::CURSOR_BAG_END) { - i = EQEmu::constants::BANK_BEGIN; + else if (i == EQEmu::legacy::CURSOR_BAG_END) { + i = EQEmu::legacy::BANK_BEGIN; continue; } - else if (i == EQEmu::constants::BANK_END) { - i = EQEmu::constants::BANK_BAGS_BEGIN; + else if (i == EQEmu::legacy::BANK_END) { + i = EQEmu::legacy::BANK_BAGS_BEGIN; continue; } i++; diff --git a/common/database_conversions.cpp b/common/database_conversions.cpp index 35c0ec939..058c3ad2c 100644 --- a/common/database_conversions.cpp +++ b/common/database_conversions.cpp @@ -186,7 +186,7 @@ namespace Convert { /*002*/ uint32 HP; /*006*/ uint32 Mana; /*010*/ Convert::SpellBuff_Struct Buffs[BUFF_COUNT]; - /*510*/ uint32 Items[MaterialCount]; + /*510*/ uint32 Items[EQEmu::legacy::MaterialCount]; /*546*/ char Name[64]; /*610*/ }; @@ -227,9 +227,9 @@ namespace Convert { /*0304*/ uint8 ability_time_minutes; /*0305*/ uint8 ability_time_hours; //place holder /*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag? - /*0312*/ uint32 item_material[MaterialCount]; // Item texture/material of worn/held items + /*0312*/ uint32 item_material[EQEmu::legacy::MaterialCount]; // Item texture/material of worn/held items /*0348*/ uint8 unknown0348[44]; - /*0392*/ Convert::Color_Struct item_tint[MaterialCount]; + /*0392*/ Convert::Color_Struct item_tint[EQEmu::legacy::MaterialCount]; /*0428*/ Convert::AA_Array aa_array[MAX_PP_AA_ARRAY]; /*2348*/ float unknown2384; //seen ~128, ~47 /*2352*/ char servername[32]; // length probably not right @@ -330,7 +330,7 @@ namespace Convert { /*7212*/ uint32 tribute_points; /*7216*/ uint32 unknown7252; /*7220*/ uint32 tribute_active; //1=active - /*7224*/ Convert::Tribute_Struct tributes[EQEmu::constants::TRIBUTE_SIZE]; + /*7224*/ Convert::Tribute_Struct tributes[EQEmu::legacy::TRIBUTE_SIZE]; /*7264*/ Convert::Disciplines_Struct disciplines; /*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use) /*7744*/ char unknown7780[160]; @@ -1416,7 +1416,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){ if (rquery != ""){ results = QueryDatabase(rquery); } /* Run Material Color Convert */ first_entry = 0; rquery = ""; - for (i = 0; i < MaterialCount; i++){ + for (i = 0; i < EQEmu::legacy::MaterialCount; i++){ if (pp->item_tint[i].color > 0){ if (first_entry != 1){ rquery = StringFormat("REPLACE INTO `character_material` (id, slot, blue, green, red, use_tint, color) VALUES (%u, %u, %u, %u, %u, %u, %u)", character_id, i, pp->item_tint[i].rgb.blue, pp->item_tint[i].rgb.green, pp->item_tint[i].rgb.red, pp->item_tint[i].rgb.use_tint, pp->item_tint[i].color); @@ -1428,7 +1428,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){ if (rquery != ""){ results = QueryDatabase(rquery); } /* Run Tribute Convert */ first_entry = 0; rquery = ""; - for (i = 0; i < EQEmu::constants::TRIBUTE_SIZE; i++){ + for (i = 0; i < EQEmu::legacy::TRIBUTE_SIZE; i++){ if (pp->tributes[i].tribute > 0 && pp->tributes[i].tribute != 4294967295){ if (first_entry != 1){ rquery = StringFormat("REPLACE INTO `character_tribute` (id, tier, tribute) VALUES (%u, %u, %u)", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); diff --git a/common/emu_constants.cpp b/common/emu_constants.cpp index b8024ee9e..8085f3004 100644 --- a/common/emu_constants.cpp +++ b/common/emu_constants.cpp @@ -24,56 +24,56 @@ uint16 EQEmu::constants::InventoryTypeSize(int16 type_index) { switch (type_index) { - case TypePossessions: - return TYPE_POSSESSIONS_SIZE; - case TypeBank: - return TYPE_BANK_SIZE; - case TypeSharedBank: - return TYPE_SHARED_BANK_SIZE; - case TypeTrade: - return TYPE_TRADE_SIZE; - case TypeWorld: - return TYPE_WORLD_SIZE; - case TypeLimbo: - return TYPE_LIMBO_SIZE; - case TypeTribute: - return TYPE_TRIBUTE_SIZE; - case TypeTrophyTribute: - return TYPE_TROPHY_TRIBUTE_SIZE; - case TypeGuildTribute: - return TYPE_GUILD_TRIBUTE_SIZE; - case TypeMerchant: - return TYPE_MERCHANT_SIZE; - case TypeDeleted: - return TYPE_DELETED_SIZE; - case TypeCorpse: - return TYPE_CORPSE_SIZE; - case TypeBazaar: - return TYPE_BAZAAR_SIZE; - case TypeInspect: - return TYPE_INSPECT_SIZE; - case TypeRealEstate: - return TYPE_REAL_ESTATE_SIZE; - case TypeViewMODPC: - return TYPE_VIEW_MOD_PC_SIZE; - case TypeViewMODBank: - return TYPE_VIEW_MOD_BANK_SIZE; - case TypeViewMODSharedBank: - return TYPE_VIEW_MOD_SHARED_BANK_SIZE; - case TypeViewMODLimbo: - return TYPE_VIEW_MOD_LIMBO_SIZE; - case TypeAltStorage: - return TYPE_ALT_STORAGE_SIZE; - case TypeArchived: - return TYPE_ARCHIVED_SIZE; - case TypeMail: - return TYPE_MAIL_SIZE; - case TypeGuildTrophyTribute: - return TYPE_GUILD_TROPHY_TRIBUTE_SIZE; - case TypeKrono: - return TYPE_KRONO_SIZE; - case TypeOther: - return TYPE_OTHER_SIZE; + case legacy::TypePossessions: + return legacy::TYPE_POSSESSIONS_SIZE; + case legacy::TypeBank: + return legacy::TYPE_BANK_SIZE; + case legacy::TypeSharedBank: + return legacy::TYPE_SHARED_BANK_SIZE; + case legacy::TypeTrade: + return legacy::TYPE_TRADE_SIZE; + case legacy::TypeWorld: + return legacy::TYPE_WORLD_SIZE; + case legacy::TypeLimbo: + return legacy::TYPE_LIMBO_SIZE; + case legacy::TypeTribute: + return legacy::TYPE_TRIBUTE_SIZE; + case legacy::TypeTrophyTribute: + return legacy::TYPE_TROPHY_TRIBUTE_SIZE; + case legacy::TypeGuildTribute: + return legacy::TYPE_GUILD_TRIBUTE_SIZE; + case legacy::TypeMerchant: + return legacy::TYPE_MERCHANT_SIZE; + case legacy::TypeDeleted: + return legacy::TYPE_DELETED_SIZE; + case legacy::TypeCorpse: + return legacy::TYPE_CORPSE_SIZE; + case legacy::TypeBazaar: + return legacy::TYPE_BAZAAR_SIZE; + case legacy::TypeInspect: + return legacy::TYPE_INSPECT_SIZE; + case legacy::TypeRealEstate: + return legacy::TYPE_REAL_ESTATE_SIZE; + case legacy::TypeViewMODPC: + return legacy::TYPE_VIEW_MOD_PC_SIZE; + case legacy::TypeViewMODBank: + return legacy::TYPE_VIEW_MOD_BANK_SIZE; + case legacy::TypeViewMODSharedBank: + return legacy::TYPE_VIEW_MOD_SHARED_BANK_SIZE; + case legacy::TypeViewMODLimbo: + return legacy::TYPE_VIEW_MOD_LIMBO_SIZE; + case legacy::TypeAltStorage: + return legacy::TYPE_ALT_STORAGE_SIZE; + case legacy::TypeArchived: + return legacy::TYPE_ARCHIVED_SIZE; + case legacy::TypeMail: + return legacy::TYPE_MAIL_SIZE; + case legacy::TypeGuildTrophyTribute: + return legacy::TYPE_GUILD_TROPHY_TRIBUTE_SIZE; + case legacy::TypeKrono: + return legacy::TYPE_KRONO_SIZE; + case legacy::TypeOther: + return legacy::TYPE_OTHER_SIZE; default: return NOT_USED; } @@ -94,55 +94,55 @@ const char* EQEmu::constants::InventoryTypeName(int16 type_index) switch (type_index) { case INVALID_INDEX: return "Invalid Type"; - case TypePossessions: + case legacy::TypePossessions: return "Possessions"; - case TypeBank: + case legacy::TypeBank: return "Bank"; - case TypeSharedBank: + case legacy::TypeSharedBank: return "SharedBank"; - case TypeTrade: + case legacy::TypeTrade: return "Trade"; - case TypeWorld: + case legacy::TypeWorld: return "World"; - case TypeLimbo: + case legacy::TypeLimbo: return "Limbo"; - case TypeTribute: + case legacy::TypeTribute: return "Tribute"; - case TypeTrophyTribute: + case legacy::TypeTrophyTribute: return "TrophyTribute"; - case TypeGuildTribute: + case legacy::TypeGuildTribute: return "GuildTribute"; - case TypeMerchant: + case legacy::TypeMerchant: return "Merchant"; - case TypeDeleted: + case legacy::TypeDeleted: return "Deleted"; - case TypeCorpse: + case legacy::TypeCorpse: return "Corpse"; - case TypeBazaar: + case legacy::TypeBazaar: return "Bazaar"; - case TypeInspect: + case legacy::TypeInspect: return "Inspect"; - case TypeRealEstate: + case legacy::TypeRealEstate: return "RealEstate"; - case TypeViewMODPC: + case legacy::TypeViewMODPC: return "ViewMODPC"; - case TypeViewMODBank: + case legacy::TypeViewMODBank: return "ViewMODBank"; - case TypeViewMODSharedBank: + case legacy::TypeViewMODSharedBank: return "ViewMODSharedBank"; - case TypeViewMODLimbo: + case legacy::TypeViewMODLimbo: return "ViewMODLimbo"; - case TypeAltStorage: + case legacy::TypeAltStorage: return "AltStorage"; - case TypeArchived: + case legacy::TypeArchived: return "Archived"; - case TypeMail: + case legacy::TypeMail: return "Mail"; - case TypeGuildTrophyTribute: + case legacy::TypeGuildTrophyTribute: return "GuildTrophyTribute"; - case TypeKrono: + case legacy::TypeKrono: return "Krono"; - case TypeOther: + case legacy::TypeOther: return "Other"; default: return "Unknown Type"; @@ -154,75 +154,75 @@ const char* EQEmu::constants::InventorySlotName(int16 slot_index) switch (slot_index) { case INVALID_INDEX: return "Invalid Slot"; - case SlotCharm: + case legacy::SlotCharm: return "Charm"; - case SlotEar1: + case legacy::SlotEar1: return "Ear1"; - case SlotHead: + case legacy::SlotHead: return "Head"; - case SlotFace: + case legacy::SlotFace: return "Face"; - case SlotEar2: + case legacy::SlotEar2: return "Ear2"; - case SlotNeck: + case legacy::SlotNeck: return "Neck"; - case SlotShoulders: + case legacy::SlotShoulders: return "Shoulders"; - case SlotArms: + case legacy::SlotArms: return "Arms"; - case SlotBack: + case legacy::SlotBack: return "Back"; - case SlotWrist1: + case legacy::SlotWrist1: return "Wrist1"; - case SlotWrist2: + case legacy::SlotWrist2: return "Wrist2"; - case SlotRange: + case legacy::SlotRange: return "Range"; - case SlotHands: + case legacy::SlotHands: return "Hands"; - case SlotPrimary: + case legacy::SlotPrimary: return "Primary"; - case SlotSecondary: + case legacy::SlotSecondary: return "Secondary"; - case SlotFinger1: + case legacy::SlotFinger1: return "Finger1"; - case SlotFinger2: + case legacy::SlotFinger2: return "Finger2"; - case SlotChest: + case legacy::SlotChest: return "Chest"; - case SlotLegs: + case legacy::SlotLegs: return "Legs"; - case SlotFeet: + case legacy::SlotFeet: return "Feet"; - case SlotWaist: + case legacy::SlotWaist: return "Waist"; - case SlotPowerSource: + case legacy::SlotPowerSource: return "PowerSource"; - case SlotAmmo: + case legacy::SlotAmmo: return "Ammo"; - case SlotGeneral1: + case legacy::SlotGeneral1: return "General1"; - case SlotGeneral2: + case legacy::SlotGeneral2: return "General2"; - case SlotGeneral3: + case legacy::SlotGeneral3: return "General3"; - case SlotGeneral4: + case legacy::SlotGeneral4: return "General4"; - case SlotGeneral5: + case legacy::SlotGeneral5: return "General5"; - case SlotGeneral6: + case legacy::SlotGeneral6: return "General6"; - case SlotGeneral7: + case legacy::SlotGeneral7: return "General7"; - case SlotGeneral8: + case legacy::SlotGeneral8: return "General8"; /* - case SlotGeneral9: + case legacy::SlotGeneral9: return "General9"; - case SlotGeneral10: + case legacy::SlotGeneral10: return "General10"; */ - case SlotCursor: + case legacy::SlotCursor: return "Cursor"; default: return "Unknown Slot"; @@ -234,7 +234,7 @@ const char* EQEmu::constants::InventorySubName(int16 sub_index) if (sub_index == INVALID_INDEX) return "Invalid Sub"; - if ((uint16)sub_index >= ITEM_CONTAINER_SIZE) + if ((uint16)sub_index >= legacy::ITEM_CONTAINER_SIZE) return "Unknown Sub"; static std::string ret_str; @@ -248,7 +248,7 @@ const char* EQEmu::constants::InventoryAugName(int16 aug_index) if (aug_index == INVALID_INDEX) return "Invalid Aug"; - if ((uint16)aug_index >= ITEM_COMMON_SIZE) + if ((uint16)aug_index >= legacy::ITEM_COMMON_SIZE) return "Unknown Aug"; static std::string ret_str; diff --git a/common/emu_constants.h b/common/emu_constants.h index 1cc6c9e5a..a012e8534 100644 --- a/common/emu_constants.h +++ b/common/emu_constants.h @@ -55,99 +55,6 @@ namespace EQEmu extern const char* InventorySlotName(int16 slot_index); extern const char* InventorySubName(int16 sub_index); extern const char* InventoryAugName(int16 aug_index); - - // these are currently hard-coded for existing inventory system..do not use in place of special client version handlers until ready - static const uint16 TYPE_POSSESSIONS_SIZE = SlotCount; - static const uint16 TYPE_BANK_SIZE = 24; - static const uint16 TYPE_SHARED_BANK_SIZE = 2; - static const uint16 TYPE_TRADE_SIZE = 8; - static const uint16 TYPE_WORLD_SIZE = 10; - static const uint16 TYPE_LIMBO_SIZE = 36; - static const uint16 TYPE_TRIBUTE_SIZE = 5; // (need client values) - static const uint16 TYPE_TROPHY_TRIBUTE_SIZE = 0; - static const uint16 TYPE_GUILD_TRIBUTE_SIZE = 0; - static const uint16 TYPE_MERCHANT_SIZE = 0; - static const uint16 TYPE_DELETED_SIZE = 0; - static const uint16 TYPE_CORPSE_SIZE = SlotCount; // no bitmask use..limits to size of client corpse window (see EQLimits::InventoryMapSize(MapCorpse, or NOT_USED value to avoid unnecessary issues - static const uint16 local[TypeCount][versions::InventoryVersionCount] = { + static const uint16 local[legacy::TypeCount][versions::InventoryVersionCount] = { // server and database are sync'd to current TypePossessions's client as set in 'using namespace RoF::slots;' and // 'constants::TYPE_POSSESSIONS_SIZE' - use/update EquipmentBitmask(), GeneralBitmask() and CursorBitmask() // for partial range validation checks and 'constants::TYPE_POSSESSIONS_SIZE' for full range iterations { // local[TypePossessions] /*Unknown*/ NOT_USED, -/*62*/ constants::TYPE_POSSESSIONS_SIZE, -/*Titanium*/ constants::TYPE_POSSESSIONS_SIZE, -/*SoF*/ constants::TYPE_POSSESSIONS_SIZE, -/*SoD*/ constants::TYPE_POSSESSIONS_SIZE, -/*Underfoot*/ constants::TYPE_POSSESSIONS_SIZE, -/*RoF*/ constants::TYPE_POSSESSIONS_SIZE, -/*RoF2*/ constants::TYPE_POSSESSIONS_SIZE, +/*62*/ legacy::TYPE_POSSESSIONS_SIZE, +/*Titanium*/ legacy::TYPE_POSSESSIONS_SIZE, +/*SoF*/ legacy::TYPE_POSSESSIONS_SIZE, +/*SoD*/ legacy::TYPE_POSSESSIONS_SIZE, +/*Underfoot*/ legacy::TYPE_POSSESSIONS_SIZE, +/*RoF*/ legacy::TYPE_POSSESSIONS_SIZE, +/*RoF2*/ legacy::TYPE_POSSESSIONS_SIZE, -/*NPC*/ constants::TYPE_POSSESSIONS_SIZE, -/*Merc*/ constants::TYPE_POSSESSIONS_SIZE, -/*Bot*/ constants::TYPE_POSSESSIONS_SIZE, -/*Pet*/ constants::TYPE_POSSESSIONS_SIZE +/*NPC*/ legacy::TYPE_POSSESSIONS_SIZE, +/*Merc*/ legacy::TYPE_POSSESSIONS_SIZE, +/*Bot*/ legacy::TYPE_POSSESSIONS_SIZE, +/*Pet*/ legacy::TYPE_POSSESSIONS_SIZE }, { // local[TypeBank] /*Unknown*/ NOT_USED, /*62*/ NOT_USED, /*Titanium*/ Titanium::consts::TYPE_BANK_SIZE, -/*SoF*/ constants::TYPE_BANK_SIZE, -/*SoD*/ constants::TYPE_BANK_SIZE, -/*Underfoot*/ constants::TYPE_BANK_SIZE, -/*RoF*/ constants::TYPE_BANK_SIZE, -/*RoF2*/ constants::TYPE_BANK_SIZE, +/*SoF*/ legacy::TYPE_BANK_SIZE, +/*SoD*/ legacy::TYPE_BANK_SIZE, +/*Underfoot*/ legacy::TYPE_BANK_SIZE, +/*RoF*/ legacy::TYPE_BANK_SIZE, +/*RoF2*/ legacy::TYPE_BANK_SIZE, /*NPC*/ NOT_USED, /*Merc*/ NOT_USED, @@ -92,13 +92,13 @@ uint16 EQEmu::limits::InventoryTypeSize(versions::InventoryVersion inventory_ver }, { // local[TypeSharedBank] /*Unknown*/ NOT_USED, -/*62*/ constants::TYPE_SHARED_BANK_SIZE, -/*Titanium*/ constants::TYPE_SHARED_BANK_SIZE, -/*SoF*/ constants::TYPE_SHARED_BANK_SIZE, -/*SoD*/ constants::TYPE_SHARED_BANK_SIZE, -/*Underfoot*/ constants::TYPE_SHARED_BANK_SIZE, -/*RoF*/ constants::TYPE_SHARED_BANK_SIZE, -/*RoF2*/ constants::TYPE_SHARED_BANK_SIZE, +/*62*/ legacy::TYPE_SHARED_BANK_SIZE, +/*Titanium*/ legacy::TYPE_SHARED_BANK_SIZE, +/*SoF*/ legacy::TYPE_SHARED_BANK_SIZE, +/*SoD*/ legacy::TYPE_SHARED_BANK_SIZE, +/*Underfoot*/ legacy::TYPE_SHARED_BANK_SIZE, +/*RoF*/ legacy::TYPE_SHARED_BANK_SIZE, +/*RoF2*/ legacy::TYPE_SHARED_BANK_SIZE, /*NPC*/ NOT_USED, /*Merc*/ NOT_USED, @@ -107,28 +107,28 @@ uint16 EQEmu::limits::InventoryTypeSize(versions::InventoryVersion inventory_ver }, { // local[TypeTrade] /*Unknown*/ NOT_USED, -/*62*/ constants::TYPE_TRADE_SIZE, -/*Titanium*/ constants::TYPE_TRADE_SIZE, -/*SoF*/ constants::TYPE_TRADE_SIZE, -/*SoD*/ constants::TYPE_TRADE_SIZE, -/*Underfoot*/ constants::TYPE_TRADE_SIZE, -/*RoF*/ constants::TYPE_TRADE_SIZE, -/*RoF2*/ constants::TYPE_TRADE_SIZE, +/*62*/ legacy::TYPE_TRADE_SIZE, +/*Titanium*/ legacy::TYPE_TRADE_SIZE, +/*SoF*/ legacy::TYPE_TRADE_SIZE, +/*SoD*/ legacy::TYPE_TRADE_SIZE, +/*Underfoot*/ legacy::TYPE_TRADE_SIZE, +/*RoF*/ legacy::TYPE_TRADE_SIZE, +/*RoF2*/ legacy::TYPE_TRADE_SIZE, /*NPC*/ 4, /*Merc*/ 4, -/*Bot*/ constants::TYPE_TRADE_SIZE, // client thinks this is another client +/*Bot*/ legacy::TYPE_TRADE_SIZE, // client thinks this is another client /*Pet*/ 4 }, { // local[TypeWorld] /*Unknown*/ NOT_USED, -/*62*/ constants::TYPE_WORLD_SIZE, -/*Titanium*/ constants::TYPE_WORLD_SIZE, -/*SoF*/ constants::TYPE_WORLD_SIZE, -/*SoD*/ constants::TYPE_WORLD_SIZE, -/*Underfoot*/ constants::TYPE_WORLD_SIZE, -/*RoF*/ constants::TYPE_WORLD_SIZE, -/*RoF2*/ constants::TYPE_WORLD_SIZE, +/*62*/ legacy::TYPE_WORLD_SIZE, +/*Titanium*/ legacy::TYPE_WORLD_SIZE, +/*SoF*/ legacy::TYPE_WORLD_SIZE, +/*SoD*/ legacy::TYPE_WORLD_SIZE, +/*Underfoot*/ legacy::TYPE_WORLD_SIZE, +/*RoF*/ legacy::TYPE_WORLD_SIZE, +/*RoF2*/ legacy::TYPE_WORLD_SIZE, /*NPC*/ NOT_USED, /*Merc*/ NOT_USED, @@ -137,13 +137,13 @@ uint16 EQEmu::limits::InventoryTypeSize(versions::InventoryVersion inventory_ver }, { // local[TypeLimbo] /*Unknown*/ NOT_USED, -/*62*/ constants::TYPE_LIMBO_SIZE, -/*Titanium*/ constants::TYPE_LIMBO_SIZE, -/*SoF*/ constants::TYPE_LIMBO_SIZE, -/*SoD*/ constants::TYPE_LIMBO_SIZE, -/*Underfoot*/ constants::TYPE_LIMBO_SIZE, -/*RoF*/ constants::TYPE_LIMBO_SIZE, -/*RoF2*/ constants::TYPE_LIMBO_SIZE, +/*62*/ legacy::TYPE_LIMBO_SIZE, +/*Titanium*/ legacy::TYPE_LIMBO_SIZE, +/*SoF*/ legacy::TYPE_LIMBO_SIZE, +/*SoD*/ legacy::TYPE_LIMBO_SIZE, +/*Underfoot*/ legacy::TYPE_LIMBO_SIZE, +/*RoF*/ legacy::TYPE_LIMBO_SIZE, +/*RoF2*/ legacy::TYPE_LIMBO_SIZE, /*NPC*/ NOT_USED, /*Merc*/ NOT_USED, @@ -152,13 +152,13 @@ uint16 EQEmu::limits::InventoryTypeSize(versions::InventoryVersion inventory_ver }, { // local[TypeTribute] /*Unknown*/ NOT_USED, -/*62*/ constants::TYPE_TRIBUTE_SIZE, -/*Titanium*/ constants::TYPE_TRIBUTE_SIZE, -/*SoF*/ constants::TYPE_TRIBUTE_SIZE, -/*SoD*/ constants::TYPE_TRIBUTE_SIZE, -/*Underfoot*/ constants::TYPE_TRIBUTE_SIZE, -/*RoF*/ constants::TYPE_TRIBUTE_SIZE, -/*RoF2*/ constants::TYPE_TRIBUTE_SIZE, +/*62*/ legacy::TYPE_TRIBUTE_SIZE, +/*Titanium*/ legacy::TYPE_TRIBUTE_SIZE, +/*SoF*/ legacy::TYPE_TRIBUTE_SIZE, +/*SoD*/ legacy::TYPE_TRIBUTE_SIZE, +/*Underfoot*/ legacy::TYPE_TRIBUTE_SIZE, +/*RoF*/ legacy::TYPE_TRIBUTE_SIZE, +/*RoF2*/ legacy::TYPE_TRIBUTE_SIZE, /*NPC*/ 0, /*Merc*/ 0, @@ -172,8 +172,8 @@ uint16 EQEmu::limits::InventoryTypeSize(versions::InventoryVersion inventory_ver /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ constants::TYPE_TROPHY_TRIBUTE_SIZE, -/*RoF2*/ constants::TYPE_TROPHY_TRIBUTE_SIZE, +/*RoF*/ legacy::TYPE_TROPHY_TRIBUTE_SIZE, +/*RoF2*/ legacy::TYPE_TROPHY_TRIBUTE_SIZE, /*NPC*/ 0, /*Merc*/ 0, @@ -187,8 +187,8 @@ uint16 EQEmu::limits::InventoryTypeSize(versions::InventoryVersion inventory_ver /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ constants::TYPE_GUILD_TRIBUTE_SIZE, -/*RoF2*/ constants::TYPE_GUILD_TRIBUTE_SIZE, +/*RoF*/ legacy::TYPE_GUILD_TRIBUTE_SIZE, +/*RoF2*/ legacy::TYPE_GUILD_TRIBUTE_SIZE, /*NPC*/ 0, /*Merc*/ 0, @@ -202,8 +202,8 @@ uint16 EQEmu::limits::InventoryTypeSize(versions::InventoryVersion inventory_ver /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ constants::TYPE_MERCHANT_SIZE, -/*RoF2*/ constants::TYPE_MERCHANT_SIZE, +/*RoF*/ legacy::TYPE_MERCHANT_SIZE, +/*RoF2*/ legacy::TYPE_MERCHANT_SIZE, /*NPC*/ 0, /*Merc*/ 0, @@ -217,8 +217,8 @@ uint16 EQEmu::limits::InventoryTypeSize(versions::InventoryVersion inventory_ver /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ constants::TYPE_DELETED_SIZE, -/*RoF2*/ constants::TYPE_DELETED_SIZE, +/*RoF*/ legacy::TYPE_DELETED_SIZE, +/*RoF2*/ legacy::TYPE_DELETED_SIZE, /*NPC*/ 0, /*Merc*/ 0, @@ -242,15 +242,15 @@ uint16 EQEmu::limits::InventoryTypeSize(versions::InventoryVersion inventory_ver }, { // local[TypeBazaar] /*Unknown*/ NOT_USED, -/*62*/ constants::TYPE_BAZAAR_SIZE, -/*Titanium*/ constants::TYPE_BAZAAR_SIZE, -/*SoF*/ constants::TYPE_BAZAAR_SIZE, -/*SoD*/ constants::TYPE_BAZAAR_SIZE, -/*Underfoot*/ constants::TYPE_BAZAAR_SIZE, -/*RoF*/ constants::TYPE_BAZAAR_SIZE, -/*RoF2*/ constants::TYPE_BAZAAR_SIZE, +/*62*/ legacy::TYPE_BAZAAR_SIZE, +/*Titanium*/ legacy::TYPE_BAZAAR_SIZE, +/*SoF*/ legacy::TYPE_BAZAAR_SIZE, +/*SoD*/ legacy::TYPE_BAZAAR_SIZE, +/*Underfoot*/ legacy::TYPE_BAZAAR_SIZE, +/*RoF*/ legacy::TYPE_BAZAAR_SIZE, +/*RoF2*/ legacy::TYPE_BAZAAR_SIZE, -/*NPC*/ 0, // this may need to be 'constants::TYPE_BAZAAR_SIZE' if offline client traders respawn as an npc +/*NPC*/ 0, // this may need to be 'legacy::TYPE_BAZAAR_SIZE' if offline client traders respawn as an npc /*Merc*/ 0, /*Bot*/ 0, /*Pet*/ 0 @@ -277,8 +277,8 @@ uint16 EQEmu::limits::InventoryTypeSize(versions::InventoryVersion inventory_ver /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ constants::TYPE_REAL_ESTATE_SIZE, -/*RoF2*/ constants::TYPE_REAL_ESTATE_SIZE, +/*RoF*/ legacy::TYPE_REAL_ESTATE_SIZE, +/*RoF2*/ legacy::TYPE_REAL_ESTATE_SIZE, /*NPC*/ 0, /*Merc*/ 0, @@ -292,8 +292,8 @@ uint16 EQEmu::limits::InventoryTypeSize(versions::InventoryVersion inventory_ver /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ constants::TYPE_VIEW_MOD_PC_SIZE, -/*RoF2*/ constants::TYPE_VIEW_MOD_PC_SIZE, +/*RoF*/ legacy::TYPE_VIEW_MOD_PC_SIZE, +/*RoF2*/ legacy::TYPE_VIEW_MOD_PC_SIZE, /*NPC*/ 0, /*Merc*/ 0, @@ -307,8 +307,8 @@ uint16 EQEmu::limits::InventoryTypeSize(versions::InventoryVersion inventory_ver /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ constants::TYPE_VIEW_MOD_BANK_SIZE, -/*RoF2*/ constants::TYPE_VIEW_MOD_BANK_SIZE, +/*RoF*/ legacy::TYPE_VIEW_MOD_BANK_SIZE, +/*RoF2*/ legacy::TYPE_VIEW_MOD_BANK_SIZE, /*NPC*/ 0, /*Merc*/ 0, @@ -322,8 +322,8 @@ uint16 EQEmu::limits::InventoryTypeSize(versions::InventoryVersion inventory_ver /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ constants::TYPE_VIEW_MOD_SHARED_BANK_SIZE, -/*RoF2*/ constants::TYPE_VIEW_MOD_SHARED_BANK_SIZE, +/*RoF*/ legacy::TYPE_VIEW_MOD_SHARED_BANK_SIZE, +/*RoF2*/ legacy::TYPE_VIEW_MOD_SHARED_BANK_SIZE, /*NPC*/ 0, /*Merc*/ 0, @@ -337,8 +337,8 @@ uint16 EQEmu::limits::InventoryTypeSize(versions::InventoryVersion inventory_ver /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ constants::TYPE_VIEW_MOD_LIMBO_SIZE, -/*RoF2*/ constants::TYPE_VIEW_MOD_LIMBO_SIZE, +/*RoF*/ legacy::TYPE_VIEW_MOD_LIMBO_SIZE, +/*RoF2*/ legacy::TYPE_VIEW_MOD_LIMBO_SIZE, /*NPC*/ 0, /*Merc*/ 0, @@ -352,8 +352,8 @@ uint16 EQEmu::limits::InventoryTypeSize(versions::InventoryVersion inventory_ver /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ constants::TYPE_ALT_STORAGE_SIZE, -/*RoF2*/ constants::TYPE_ALT_STORAGE_SIZE, +/*RoF*/ legacy::TYPE_ALT_STORAGE_SIZE, +/*RoF2*/ legacy::TYPE_ALT_STORAGE_SIZE, /*NPC*/ 0, /*Merc*/ 0, @@ -367,8 +367,8 @@ uint16 EQEmu::limits::InventoryTypeSize(versions::InventoryVersion inventory_ver /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ constants::TYPE_ARCHIVED_SIZE, -/*RoF2*/ constants::TYPE_ARCHIVED_SIZE, +/*RoF*/ legacy::TYPE_ARCHIVED_SIZE, +/*RoF2*/ legacy::TYPE_ARCHIVED_SIZE, /*NPC*/ 0, /*Merc*/ 0, @@ -382,8 +382,8 @@ uint16 EQEmu::limits::InventoryTypeSize(versions::InventoryVersion inventory_ver /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ constants::TYPE_MAIL_SIZE, -/*RoF2*/ constants::TYPE_MAIL_SIZE, +/*RoF*/ legacy::TYPE_MAIL_SIZE, +/*RoF2*/ legacy::TYPE_MAIL_SIZE, /*NPC*/ 0, /*Merc*/ 0, @@ -397,8 +397,8 @@ uint16 EQEmu::limits::InventoryTypeSize(versions::InventoryVersion inventory_ver /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ constants::TYPE_GUILD_TROPHY_TRIBUTE_SIZE, -/*RoF2*/ constants::TYPE_GUILD_TROPHY_TRIBUTE_SIZE, +/*RoF*/ legacy::TYPE_GUILD_TROPHY_TRIBUTE_SIZE, +/*RoF2*/ legacy::TYPE_GUILD_TROPHY_TRIBUTE_SIZE, /*NPC*/ 0, /*Merc*/ 0, @@ -412,8 +412,8 @@ uint16 EQEmu::limits::InventoryTypeSize(versions::InventoryVersion inventory_ver /*SoF*/ NOT_USED, /*SoD*/ NOT_USED, /*Underfoot*/ NOT_USED, -/*RoF*/ constants::TYPE_KRONO_SIZE, -/*RoF2*/ constants::TYPE_KRONO_SIZE, +/*RoF*/ legacy::TYPE_KRONO_SIZE, +/*RoF2*/ legacy::TYPE_KRONO_SIZE, /*NPC*/ 0, /*Merc*/ 0, @@ -427,8 +427,8 @@ uint16 EQEmu::limits::InventoryTypeSize(versions::InventoryVersion inventory_ver /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ constants::TYPE_OTHER_SIZE, -/*RoF2*/ constants::TYPE_OTHER_SIZE, +/*RoF*/ legacy::TYPE_OTHER_SIZE, +/*RoF2*/ legacy::TYPE_OTHER_SIZE, /*NPC*/ 0, /*Merc*/ 0, @@ -437,7 +437,7 @@ uint16 EQEmu::limits::InventoryTypeSize(versions::InventoryVersion inventory_ver } }; - if ((uint16)inv_type < TypeCount) + if ((uint16)inv_type < legacy::TypeCount) return local[inv_type][static_cast(versions::ValidateInventoryVersion(inventory_version))]; return NOT_USED; @@ -584,18 +584,18 @@ uint16 EQEmu::limits::ItemCommonSize(versions::InventoryVersion inventory_versio { static const uint16 local[versions::InventoryVersionCount] = { /*Unknown*/ NOT_USED, -/*62*/ constants::ITEM_COMMON_SIZE, -/*Titanium*/ constants::ITEM_COMMON_SIZE, -/*SoF*/ constants::ITEM_COMMON_SIZE, -/*SoD*/ constants::ITEM_COMMON_SIZE, -/*Underfoot*/ constants::ITEM_COMMON_SIZE, -/*RoF*/ constants::ITEM_COMMON_SIZE, -/*RoF2*/ constants::ITEM_COMMON_SIZE, +/*62*/ legacy::ITEM_COMMON_SIZE, +/*Titanium*/ legacy::ITEM_COMMON_SIZE, +/*SoF*/ legacy::ITEM_COMMON_SIZE, +/*SoD*/ legacy::ITEM_COMMON_SIZE, +/*Underfoot*/ legacy::ITEM_COMMON_SIZE, +/*RoF*/ legacy::ITEM_COMMON_SIZE, +/*RoF2*/ legacy::ITEM_COMMON_SIZE, -/*NPC*/ constants::ITEM_COMMON_SIZE, -/*Merc*/ constants::ITEM_COMMON_SIZE, -/*Bot*/ constants::ITEM_COMMON_SIZE, -/*Pet*/ constants::ITEM_COMMON_SIZE +/*NPC*/ legacy::ITEM_COMMON_SIZE, +/*Merc*/ legacy::ITEM_COMMON_SIZE, +/*Bot*/ legacy::ITEM_COMMON_SIZE, +/*Pet*/ legacy::ITEM_COMMON_SIZE }; return local[static_cast(versions::ValidateInventoryVersion(inventory_version))]; @@ -605,18 +605,18 @@ uint16 EQEmu::limits::ItemContainerSize(versions::InventoryVersion inventory_ver { static const uint16 local[versions::InventoryVersionCount] = { /*Unknown*/ NOT_USED, -/*62*/ constants::ITEM_CONTAINER_SIZE, -/*Titanium*/ constants::ITEM_CONTAINER_SIZE, -/*SoF*/ constants::ITEM_CONTAINER_SIZE, -/*SoD*/ constants::ITEM_CONTAINER_SIZE, -/*Underfoot*/ constants::ITEM_CONTAINER_SIZE, -/*RoF*/ constants::ITEM_CONTAINER_SIZE, -/*RoF2*/ constants::ITEM_CONTAINER_SIZE, +/*62*/ legacy::ITEM_CONTAINER_SIZE, +/*Titanium*/ legacy::ITEM_CONTAINER_SIZE, +/*SoF*/ legacy::ITEM_CONTAINER_SIZE, +/*SoD*/ legacy::ITEM_CONTAINER_SIZE, +/*Underfoot*/ legacy::ITEM_CONTAINER_SIZE, +/*RoF*/ legacy::ITEM_CONTAINER_SIZE, +/*RoF2*/ legacy::ITEM_CONTAINER_SIZE, -/*NPC*/ constants::ITEM_CONTAINER_SIZE, -/*Merc*/ constants::ITEM_CONTAINER_SIZE, -/*Bot*/ constants::ITEM_CONTAINER_SIZE, -/*Pet*/ constants::ITEM_CONTAINER_SIZE +/*NPC*/ legacy::ITEM_CONTAINER_SIZE, +/*Merc*/ legacy::ITEM_CONTAINER_SIZE, +/*Bot*/ legacy::ITEM_CONTAINER_SIZE, +/*Pet*/ legacy::ITEM_CONTAINER_SIZE }; return local[static_cast(versions::ValidateInventoryVersion(inventory_version))]; diff --git a/common/eq_packet_structs.h b/common/eq_packet_structs.h index 0f7283c5a..2e470714b 100644 --- a/common/eq_packet_structs.h +++ b/common/eq_packet_structs.h @@ -293,7 +293,7 @@ struct Spawn_Struct { /*0000*/ EquipStruct equip_primary; // Equipment: Main visual /*0000*/ EquipStruct equip_secondary; // Equipment: Off visual } equip; - /*0000*/ EquipStruct equipment[MaterialCount]; + /*0000*/ EquipStruct equipment[EQEmu::legacy::MaterialCount]; }; /*0233*/ float runspeed; // Speed when running /*0036*/ uint8 afk; // 0=no, 1=afk @@ -339,7 +339,7 @@ union /*0376*/ Color_Struct color_primary; // Color of primary item /*0380*/ Color_Struct color_secondary; // Color of secondary item } equipment_colors; - /*0348*/ Color_Struct colors[MaterialCount]; // Array elements correspond to struct equipment_colors above + /*0348*/ Color_Struct colors[EQEmu::legacy::MaterialCount]; // Array elements correspond to struct equipment_colors above }; /*0384*/ uint8 lfg; // 0=off, 1=lfg on /*0385*/ @@ -776,7 +776,7 @@ struct BandolierItem_Struct struct Bandolier_Struct { char Name[32]; - BandolierItem_Struct Items[EQEmu::constants::BANDOLIER_ITEM_COUNT]; + BandolierItem_Struct Items[EQEmu::legacy::BANDOLIER_ITEM_COUNT]; }; //len = 72 @@ -790,7 +790,7 @@ struct PotionBeltItem_Struct //len = 288 struct PotionBelt_Struct { - PotionBeltItem_Struct Items[EQEmu::constants::POTION_BELT_ITEM_COUNT]; + PotionBeltItem_Struct Items[EQEmu::legacy::POTION_BELT_ITEM_COUNT]; }; struct MovePotionToBelt_Struct @@ -881,7 +881,7 @@ struct SuspendedMinion_Struct /*002*/ uint32 HP; /*006*/ uint32 Mana; /*010*/ SpellBuff_Struct Buffs[BUFF_COUNT]; - /*510*/ uint32 Items[MaterialCount]; + /*510*/ uint32 Items[EQEmu::legacy::MaterialCount]; /*546*/ char Name[64]; /*610*/ }; @@ -989,9 +989,9 @@ struct PlayerProfile_Struct /*0304*/ uint8 ability_time_minutes; /*0305*/ uint8 ability_time_hours; //place holder /*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag? -/*0312*/ uint32 item_material[MaterialCount]; // Item texture/material of worn/held items +/*0312*/ uint32 item_material[EQEmu::legacy::MaterialCount]; // Item texture/material of worn/held items /*0348*/ uint8 unknown0348[44]; -/*0392*/ Color_Struct item_tint[MaterialCount]; +/*0392*/ Color_Struct item_tint[EQEmu::legacy::MaterialCount]; /*0428*/ AA_Array aa_array[MAX_PP_AA_ARRAY]; /*2348*/ float unknown2384; //seen ~128, ~47 /*2352*/ char servername[32]; // length probably not right @@ -1092,7 +1092,7 @@ struct PlayerProfile_Struct /*7212*/ uint32 tribute_points; /*7216*/ uint32 unknown7252; /*7220*/ uint32 tribute_active; //1=active -/*7224*/ Tribute_Struct tributes[EQEmu::constants::TRIBUTE_SIZE]; +/*7224*/ Tribute_Struct tributes[EQEmu::legacy::TRIBUTE_SIZE]; /*7264*/ Disciplines_Struct disciplines; /*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use) /*7744*/ char unknown7780[160]; @@ -1119,7 +1119,7 @@ struct PlayerProfile_Struct /*12800*/ uint32 expAA; /*12804*/ uint32 aapoints; //avaliable, unspent /*12808*/ uint8 unknown12844[36]; -/*12844*/ Bandolier_Struct bandoliers[EQEmu::constants::BANDOLIERS_SIZE]; +/*12844*/ Bandolier_Struct bandoliers[EQEmu::legacy::BANDOLIERS_SIZE]; /*14124*/ uint8 unknown14160[4506]; /*18630*/ SuspendedMinion_Struct SuspendedMinion; // No longer in use /*19240*/ uint32 timeentitledonaccount; @@ -2124,7 +2124,7 @@ struct Illusion_Struct { //size: 256 - SoF /*092*/ uint32 drakkin_heritage; // /*096*/ uint32 drakkin_tattoo; // /*100*/ uint32 drakkin_details; // -/*104*/ uint32 armor_tint[MaterialCount]; // +/*104*/ uint32 armor_tint[EQEmu::legacy::MaterialCount]; // /*140*/ uint8 eyecolor1; // Field Not Identified in any Illusion Struct /*141*/ uint8 eyecolor2; // Field Not Identified in any Illusion Struct /*142*/ uint8 unknown138[114]; // @@ -3411,7 +3411,7 @@ struct DyeStruct struct Color_Struct secondary; // or this } dyes; - struct Color_Struct dye[MaterialCount]; + struct Color_Struct dye[EQEmu::legacy::MaterialCount]; }; }; @@ -3472,8 +3472,8 @@ struct SelectTributeReply_Struct { struct TributeInfo_Struct { uint32 active; //0 == inactive, 1 == active - uint32 tributes[EQEmu::constants::TRIBUTE_SIZE]; //-1 == NONE - uint32 tiers[EQEmu::constants::TRIBUTE_SIZE]; //all 00's + uint32 tributes[EQEmu::legacy::TRIBUTE_SIZE]; //-1 == NONE + uint32 tiers[EQEmu::legacy::TRIBUTE_SIZE]; //all 00's uint32 tribute_master_id; }; diff --git a/common/extprofile.h b/common/extprofile.h index dc1124096..9713c2e60 100644 --- a/common/extprofile.h +++ b/common/extprofile.h @@ -40,7 +40,7 @@ struct ExtendedProfile_Struct { uint16 old_pet_hp; /* Not Used */ uint16 old_pet_mana; /* Not Used */ SpellBuff_Struct pet_buffs[BUFF_COUNT]; /* Not Used */ - uint32 pet_items[MaterialCount]; /* Not Used */ + uint32 pet_items[EQEmu::legacy::MaterialCount]; /* Not Used */ char merc_name[64]; /* Used */ uint32 aa_effects; /* Used */ diff --git a/common/item.cpp b/common/item.cpp index a9c0df3c2..25bf7d886 100644 --- a/common/item.cpp +++ b/common/item.cpp @@ -156,63 +156,63 @@ ItemInst* Inventory::GetItem(int16 slot_id) const ItemInst* result = nullptr; // Cursor - if (slot_id == SlotCursor) { + if (slot_id == EQEmu::legacy::SlotCursor) { // Cursor slot result = m_cursor.peek_front(); } // Non bag slots - else if (slot_id >= EQEmu::constants::TRADE_BEGIN && slot_id <= EQEmu::constants::TRADE_END) { + else if (slot_id >= EQEmu::legacy::TRADE_BEGIN && slot_id <= EQEmu::legacy::TRADE_END) { result = _GetItem(m_trade, slot_id); } - else if (slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && slot_id <= EQEmu::constants::SHARED_BANK_END) { + else if (slot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id <= EQEmu::legacy::SHARED_BANK_END) { // Shared Bank slots result = _GetItem(m_shbank, slot_id); } - else if (slot_id >= EQEmu::constants::BANK_BEGIN && slot_id <= EQEmu::constants::BANK_END) { + else if (slot_id >= EQEmu::legacy::BANK_BEGIN && slot_id <= EQEmu::legacy::BANK_END) { // Bank slots result = _GetItem(m_bank, slot_id); } - else if ((slot_id >= EQEmu::constants::GENERAL_BEGIN && slot_id <= EQEmu::constants::GENERAL_END)) { + else if ((slot_id >= EQEmu::legacy::GENERAL_BEGIN && slot_id <= EQEmu::legacy::GENERAL_END)) { // Personal inventory slots result = _GetItem(m_inv, slot_id); } - else if ((slot_id >= EQEmu::constants::EQUIPMENT_BEGIN && slot_id <= EQEmu::constants::EQUIPMENT_END) || - (slot_id >= EQEmu::constants::TRIBUTE_BEGIN && slot_id <= EQEmu::constants::TRIBUTE_END) || (slot_id == SlotPowerSource)) { + else if ((slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN && slot_id <= EQEmu::legacy::EQUIPMENT_END) || + (slot_id >= EQEmu::legacy::TRIBUTE_BEGIN && slot_id <= EQEmu::legacy::TRIBUTE_END) || (slot_id == EQEmu::legacy::SlotPowerSource)) { // Equippable slots (on body) result = _GetItem(m_worn, slot_id); } // Inner bag slots - else if (slot_id >= EQEmu::constants::TRADE_BAGS_BEGIN && slot_id <= EQEmu::constants::TRADE_BAGS_END) { + else if (slot_id >= EQEmu::legacy::TRADE_BAGS_BEGIN && slot_id <= EQEmu::legacy::TRADE_BAGS_END) { // Trade bag slots ItemInst* inst = _GetItem(m_trade, Inventory::CalcSlotId(slot_id)); if (inst && inst->IsType(ItemClassContainer)) { result = inst->GetItem(Inventory::CalcBagIdx(slot_id)); } } - else if (slot_id >= EQEmu::constants::SHARED_BANK_BAGS_BEGIN && slot_id <= EQEmu::constants::SHARED_BANK_BAGS_END) { + else if (slot_id >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && slot_id <= EQEmu::legacy::SHARED_BANK_BAGS_END) { // Shared Bank bag slots ItemInst* inst = _GetItem(m_shbank, Inventory::CalcSlotId(slot_id)); if (inst && inst->IsType(ItemClassContainer)) { result = inst->GetItem(Inventory::CalcBagIdx(slot_id)); } } - else if (slot_id >= EQEmu::constants::BANK_BAGS_BEGIN && slot_id <= EQEmu::constants::BANK_BAGS_END) { + else if (slot_id >= EQEmu::legacy::BANK_BAGS_BEGIN && slot_id <= EQEmu::legacy::BANK_BAGS_END) { // Bank bag slots ItemInst* inst = _GetItem(m_bank, Inventory::CalcSlotId(slot_id)); if (inst && inst->IsType(ItemClassContainer)) { result = inst->GetItem(Inventory::CalcBagIdx(slot_id)); } } - else if (slot_id >= EQEmu::constants::CURSOR_BAG_BEGIN && slot_id <= EQEmu::constants::CURSOR_BAG_END) { + else if (slot_id >= EQEmu::legacy::CURSOR_BAG_BEGIN && slot_id <= EQEmu::legacy::CURSOR_BAG_END) { // Cursor bag slots ItemInst* inst = m_cursor.peek_front(); if (inst && inst->IsType(ItemClassContainer)) { result = inst->GetItem(Inventory::CalcBagIdx(slot_id)); } } - else if (slot_id >= EQEmu::constants::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::constants::GENERAL_BAGS_END) { + else if (slot_id >= EQEmu::legacy::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::legacy::GENERAL_BAGS_END) { // Personal inventory bag slots ItemInst* inst = _GetItem(m_inv, Inventory::CalcSlotId(slot_id)); if (inst && inst->IsType(ItemClassContainer)) { @@ -248,7 +248,7 @@ int16 Inventory::PutItem(int16 slot_id, const ItemInst& inst) int16 Inventory::PushCursor(const ItemInst& inst) { m_cursor.push(inst.Clone()); - return SlotCursor; + return EQEmu::legacy::SlotCursor; } ItemInst* Inventory::GetCursorItem() @@ -314,7 +314,7 @@ bool Inventory::CheckNoDrop(int16 slot_id) { if (!inst) return false; if (!inst->GetItem()->NoDrop) return true; if (inst->GetItem()->ItemClass == 1) { - for (uint8 i = SUB_INDEX_BEGIN; i < EQEmu::constants::ITEM_CONTAINER_SIZE; i++) { + for (uint8 i = SUB_INDEX_BEGIN; i < EQEmu::legacy::ITEM_CONTAINER_SIZE; i++) { ItemInst* bagitem = GetItem(Inventory::CalcSlotId(slot_id, i)); if (bagitem && !bagitem->GetItem()->NoDrop) return true; @@ -329,30 +329,30 @@ ItemInst* Inventory::PopItem(int16 slot_id) { ItemInst* p = nullptr; - if (slot_id == SlotCursor) { + if (slot_id == EQEmu::legacy::SlotCursor) { p = m_cursor.pop(); } - else if ((slot_id >= EQEmu::constants::EQUIPMENT_BEGIN && slot_id <= EQEmu::constants::EQUIPMENT_END) || (slot_id == SlotPowerSource)) { + else if ((slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN && slot_id <= EQEmu::legacy::EQUIPMENT_END) || (slot_id == EQEmu::legacy::SlotPowerSource)) { p = m_worn[slot_id]; m_worn.erase(slot_id); } - else if ((slot_id >= EQEmu::constants::GENERAL_BEGIN && slot_id <= EQEmu::constants::GENERAL_END)) { + else if ((slot_id >= EQEmu::legacy::GENERAL_BEGIN && slot_id <= EQEmu::legacy::GENERAL_END)) { p = m_inv[slot_id]; m_inv.erase(slot_id); } - else if (slot_id >= EQEmu::constants::TRIBUTE_BEGIN && slot_id <= EQEmu::constants::TRIBUTE_END) { + else if (slot_id >= EQEmu::legacy::TRIBUTE_BEGIN && slot_id <= EQEmu::legacy::TRIBUTE_END) { p = m_worn[slot_id]; m_worn.erase(slot_id); } - else if (slot_id >= EQEmu::constants::BANK_BEGIN && slot_id <= EQEmu::constants::BANK_END) { + else if (slot_id >= EQEmu::legacy::BANK_BEGIN && slot_id <= EQEmu::legacy::BANK_END) { p = m_bank[slot_id]; m_bank.erase(slot_id); } - else if (slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && slot_id <= EQEmu::constants::SHARED_BANK_END) { + else if (slot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id <= EQEmu::legacy::SHARED_BANK_END) { p = m_shbank[slot_id]; m_shbank.erase(slot_id); } - else if (slot_id >= EQEmu::constants::TRADE_BEGIN && slot_id <= EQEmu::constants::TRADE_END) { + else if (slot_id >= EQEmu::legacy::TRADE_BEGIN && slot_id <= EQEmu::legacy::TRADE_END) { p = m_trade[slot_id]; m_trade.erase(slot_id); } @@ -372,7 +372,7 @@ bool Inventory::HasSpaceForItem(const Item_Struct *ItemToTry, int16 Quantity) { if (ItemToTry->Stackable) { - for (int16 i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++) { + for (int16 i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++) { ItemInst* InvItem = GetItem(i); @@ -409,7 +409,7 @@ bool Inventory::HasSpaceForItem(const Item_Struct *ItemToTry, int16 Quantity) { } } - for (int16 i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++) { + for (int16 i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++) { ItemInst* InvItem = GetItem(i); @@ -615,14 +615,14 @@ int16 Inventory::HasItemByLoreGroup(uint32 loregroup, uint8 where) int16 Inventory::FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size, bool is_arrow) { // Check basic inventory - for (int16 i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++) { + for (int16 i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++) { if (!GetItem(i)) // Found available slot in personal inventory return i; } if (!for_bag) { - for (int16 i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++) { + for (int16 i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++) { const ItemInst* inst = GetItem(i); if (inst && inst->IsType(ItemClassContainer) && inst->GetItem()->BagSize >= min_size) { @@ -648,7 +648,7 @@ int16 Inventory::FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size, boo if (try_cursor) { // Always room on cursor (it's a queue) // (we may wish to cap this in the future) - return SlotCursor; + return EQEmu::legacy::SlotCursor; } // No available slots @@ -667,17 +667,17 @@ int16 Inventory::FindFreeSlotForTradeItem(const ItemInst* inst) { // step 1: find room for bags (caller should really ask for slots for bags first to avoid sending them to cursor..and bag item loss) if (inst->IsType(ItemClassContainer)) { - for (int16 free_slot = EQEmu::constants::GENERAL_BEGIN; free_slot <= EQEmu::constants::GENERAL_END; ++free_slot) { + for (int16 free_slot = EQEmu::legacy::GENERAL_BEGIN; free_slot <= EQEmu::legacy::GENERAL_END; ++free_slot) { if (!m_inv[free_slot]) return free_slot; } - return SlotCursor; // return cursor since bags do not stack and will not fit inside other bags..yet...) + return EQEmu::legacy::SlotCursor; // return cursor since bags do not stack and will not fit inside other bags..yet...) } // step 2: find partial room for stackables if (inst->IsStackable()) { - for (int16 free_slot = EQEmu::constants::GENERAL_BEGIN; free_slot <= EQEmu::constants::GENERAL_END; ++free_slot) { + for (int16 free_slot = EQEmu::legacy::GENERAL_BEGIN; free_slot <= EQEmu::legacy::GENERAL_END; ++free_slot) { const ItemInst* main_inst = m_inv[free_slot]; if (!main_inst) @@ -687,14 +687,14 @@ int16 Inventory::FindFreeSlotForTradeItem(const ItemInst* inst) { return free_slot; } - for (int16 free_slot = EQEmu::constants::GENERAL_BEGIN; free_slot <= EQEmu::constants::GENERAL_END; ++free_slot) { + for (int16 free_slot = EQEmu::legacy::GENERAL_BEGIN; free_slot <= EQEmu::legacy::GENERAL_END; ++free_slot) { const ItemInst* main_inst = m_inv[free_slot]; if (!main_inst) continue; if (main_inst->IsType(ItemClassContainer)) { // if item-specific containers already have bad items, we won't fix it here... - for (uint8 free_bag_slot = SUB_INDEX_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::constants::ITEM_CONTAINER_SIZE); ++free_bag_slot) { + for (uint8 free_bag_slot = SUB_INDEX_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++free_bag_slot) { const ItemInst* sub_inst = main_inst->GetItem(free_bag_slot); if (!sub_inst) @@ -709,13 +709,13 @@ int16 Inventory::FindFreeSlotForTradeItem(const ItemInst* inst) { // step 3a: find room for container-specific items (ItemClassArrow) if (inst->GetItem()->ItemType == ItemTypeArrow) { - for (int16 free_slot = EQEmu::constants::GENERAL_BEGIN; free_slot <= EQEmu::constants::GENERAL_END; ++free_slot) { + for (int16 free_slot = EQEmu::legacy::GENERAL_BEGIN; free_slot <= EQEmu::legacy::GENERAL_END; ++free_slot) { const ItemInst* main_inst = m_inv[free_slot]; if (!main_inst || (main_inst->GetItem()->BagType != BagTypeQuiver) || !main_inst->IsType(ItemClassContainer)) continue; - for (uint8 free_bag_slot = SUB_INDEX_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::constants::ITEM_CONTAINER_SIZE); ++free_bag_slot) { + for (uint8 free_bag_slot = SUB_INDEX_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++free_bag_slot) { if (!main_inst->GetItem(free_bag_slot)) return Inventory::CalcSlotId(free_slot, free_bag_slot); } @@ -724,13 +724,13 @@ int16 Inventory::FindFreeSlotForTradeItem(const ItemInst* inst) { // step 3b: find room for container-specific items (ItemClassSmallThrowing) if (inst->GetItem()->ItemType == ItemTypeSmallThrowing) { - for (int16 free_slot = EQEmu::constants::GENERAL_BEGIN; free_slot <= EQEmu::constants::GENERAL_END; ++free_slot) { + for (int16 free_slot = EQEmu::legacy::GENERAL_BEGIN; free_slot <= EQEmu::legacy::GENERAL_END; ++free_slot) { const ItemInst* main_inst = m_inv[free_slot]; if (!main_inst || (main_inst->GetItem()->BagType != BagTypeBandolier) || !main_inst->IsType(ItemClassContainer)) continue; - for (uint8 free_bag_slot = SUB_INDEX_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::constants::ITEM_CONTAINER_SIZE); ++free_bag_slot) { + for (uint8 free_bag_slot = SUB_INDEX_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++free_bag_slot) { if (!main_inst->GetItem(free_bag_slot)) return Inventory::CalcSlotId(free_slot, free_bag_slot); } @@ -738,21 +738,21 @@ int16 Inventory::FindFreeSlotForTradeItem(const ItemInst* inst) { } // step 4: just find an empty slot - for (int16 free_slot = EQEmu::constants::GENERAL_BEGIN; free_slot <= EQEmu::constants::GENERAL_END; ++free_slot) { + for (int16 free_slot = EQEmu::legacy::GENERAL_BEGIN; free_slot <= EQEmu::legacy::GENERAL_END; ++free_slot) { const ItemInst* main_inst = m_inv[free_slot]; if (!main_inst) return free_slot; } - for (int16 free_slot = EQEmu::constants::GENERAL_BEGIN; free_slot <= EQEmu::constants::GENERAL_END; ++free_slot) { + for (int16 free_slot = EQEmu::legacy::GENERAL_BEGIN; free_slot <= EQEmu::legacy::GENERAL_END; ++free_slot) { const ItemInst* main_inst = m_inv[free_slot]; if (main_inst && main_inst->IsType(ItemClassContainer)) { if ((main_inst->GetItem()->BagSize < inst->GetItem()->Size) || (main_inst->GetItem()->BagType == BagTypeBandolier) || (main_inst->GetItem()->BagType == BagTypeQuiver)) continue; - for (uint8 free_bag_slot = SUB_INDEX_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::constants::ITEM_CONTAINER_SIZE); ++free_bag_slot) { + for (uint8 free_bag_slot = SUB_INDEX_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++free_bag_slot) { if (!main_inst->GetItem(free_bag_slot)) return Inventory::CalcSlotId(free_slot, free_bag_slot); } @@ -760,7 +760,7 @@ int16 Inventory::FindFreeSlotForTradeItem(const ItemInst* inst) { } //return INVALID_INDEX; // everything else pushes to the cursor - return SlotCursor; + return EQEmu::legacy::SlotCursor; } // Opposite of below: Get parent bag slot_id from a slot inside of bag @@ -772,20 +772,20 @@ int16 Inventory::CalcSlotId(int16 slot_id) { // parent_slot_id = EmuConstants::BANK_BEGIN + (slot_id - EmuConstants::BANK_BEGIN) / EmuConstants::ITEM_CONTAINER_SIZE; //else if (slot_id >= 3100 && slot_id <= 3179) should be {3031..3110}..where did this range come from!!? (verified db save range) - if (slot_id >= EQEmu::constants::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::constants::GENERAL_BAGS_END) { - parent_slot_id = EQEmu::constants::GENERAL_BEGIN + (slot_id - EQEmu::constants::GENERAL_BAGS_BEGIN) / EQEmu::constants::ITEM_CONTAINER_SIZE; + if (slot_id >= EQEmu::legacy::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::legacy::GENERAL_BAGS_END) { + parent_slot_id = EQEmu::legacy::GENERAL_BEGIN + (slot_id - EQEmu::legacy::GENERAL_BAGS_BEGIN) / EQEmu::legacy::ITEM_CONTAINER_SIZE; } - else if (slot_id >= EQEmu::constants::CURSOR_BAG_BEGIN && slot_id <= EQEmu::constants::CURSOR_BAG_END) { - parent_slot_id = SlotCursor; + else if (slot_id >= EQEmu::legacy::CURSOR_BAG_BEGIN && slot_id <= EQEmu::legacy::CURSOR_BAG_END) { + parent_slot_id = EQEmu::legacy::SlotCursor; } - else if (slot_id >= EQEmu::constants::BANK_BAGS_BEGIN && slot_id <= EQEmu::constants::BANK_BAGS_END) { - parent_slot_id = EQEmu::constants::BANK_BEGIN + (slot_id - EQEmu::constants::BANK_BAGS_BEGIN) / EQEmu::constants::ITEM_CONTAINER_SIZE; + else if (slot_id >= EQEmu::legacy::BANK_BAGS_BEGIN && slot_id <= EQEmu::legacy::BANK_BAGS_END) { + parent_slot_id = EQEmu::legacy::BANK_BEGIN + (slot_id - EQEmu::legacy::BANK_BAGS_BEGIN) / EQEmu::legacy::ITEM_CONTAINER_SIZE; } - else if (slot_id >= EQEmu::constants::SHARED_BANK_BAGS_BEGIN && slot_id <= EQEmu::constants::SHARED_BANK_BAGS_END) { - parent_slot_id = EQEmu::constants::SHARED_BANK_BEGIN + (slot_id - EQEmu::constants::SHARED_BANK_BAGS_BEGIN) / EQEmu::constants::ITEM_CONTAINER_SIZE; + else if (slot_id >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && slot_id <= EQEmu::legacy::SHARED_BANK_BAGS_END) { + parent_slot_id = EQEmu::legacy::SHARED_BANK_BEGIN + (slot_id - EQEmu::legacy::SHARED_BANK_BAGS_BEGIN) / EQEmu::legacy::ITEM_CONTAINER_SIZE; } - else if (slot_id >= EQEmu::constants::TRADE_BAGS_BEGIN && slot_id <= EQEmu::constants::TRADE_BAGS_END) { - parent_slot_id = EQEmu::constants::TRADE_BEGIN + (slot_id - EQEmu::constants::TRADE_BAGS_BEGIN) / EQEmu::constants::ITEM_CONTAINER_SIZE; + else if (slot_id >= EQEmu::legacy::TRADE_BAGS_BEGIN && slot_id <= EQEmu::legacy::TRADE_BAGS_END) { + parent_slot_id = EQEmu::legacy::TRADE_BEGIN + (slot_id - EQEmu::legacy::TRADE_BAGS_BEGIN) / EQEmu::legacy::ITEM_CONTAINER_SIZE; } return parent_slot_id; @@ -798,20 +798,20 @@ int16 Inventory::CalcSlotId(int16 bagslot_id, uint8 bagidx) { int16 slot_id = INVALID_INDEX; - if (bagslot_id == SlotCursor || bagslot_id == 8000) { - slot_id = EQEmu::constants::CURSOR_BAG_BEGIN + bagidx; + if (bagslot_id == EQEmu::legacy::SlotCursor || bagslot_id == 8000) { + slot_id = EQEmu::legacy::CURSOR_BAG_BEGIN + bagidx; } - else if (bagslot_id >= EQEmu::constants::GENERAL_BEGIN && bagslot_id <= EQEmu::constants::GENERAL_END) { - slot_id = EQEmu::constants::GENERAL_BAGS_BEGIN + (bagslot_id - EQEmu::constants::GENERAL_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE + bagidx; + else if (bagslot_id >= EQEmu::legacy::GENERAL_BEGIN && bagslot_id <= EQEmu::legacy::GENERAL_END) { + slot_id = EQEmu::legacy::GENERAL_BAGS_BEGIN + (bagslot_id - EQEmu::legacy::GENERAL_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE + bagidx; } - else if (bagslot_id >= EQEmu::constants::BANK_BEGIN && bagslot_id <= EQEmu::constants::BANK_END) { - slot_id = EQEmu::constants::BANK_BAGS_BEGIN + (bagslot_id - EQEmu::constants::BANK_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE + bagidx; + else if (bagslot_id >= EQEmu::legacy::BANK_BEGIN && bagslot_id <= EQEmu::legacy::BANK_END) { + slot_id = EQEmu::legacy::BANK_BAGS_BEGIN + (bagslot_id - EQEmu::legacy::BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE + bagidx; } - else if (bagslot_id >= EQEmu::constants::SHARED_BANK_BEGIN && bagslot_id <= EQEmu::constants::SHARED_BANK_END) { - slot_id = EQEmu::constants::SHARED_BANK_BAGS_BEGIN + (bagslot_id - EQEmu::constants::SHARED_BANK_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE + bagidx; + else if (bagslot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && bagslot_id <= EQEmu::legacy::SHARED_BANK_END) { + slot_id = EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + (bagslot_id - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE + bagidx; } - else if (bagslot_id >= EQEmu::constants::TRADE_BEGIN && bagslot_id <= EQEmu::constants::TRADE_END) { - slot_id = EQEmu::constants::TRADE_BAGS_BEGIN + (bagslot_id - EQEmu::constants::TRADE_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE + bagidx; + else if (bagslot_id >= EQEmu::legacy::TRADE_BEGIN && bagslot_id <= EQEmu::legacy::TRADE_END) { + slot_id = EQEmu::legacy::TRADE_BAGS_BEGIN + (bagslot_id - EQEmu::legacy::TRADE_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE + bagidx; } return slot_id; @@ -824,23 +824,23 @@ uint8 Inventory::CalcBagIdx(int16 slot_id) { //else if (slot_id >= EmuConstants::BANK_BEGIN && slot_id <= EmuConstants::BANK_END) // index = (slot_id - EmuConstants::BANK_BEGIN) % EmuConstants::ITEM_CONTAINER_SIZE; - if (slot_id >= EQEmu::constants::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::constants::GENERAL_BAGS_END) { - index = (slot_id - EQEmu::constants::GENERAL_BAGS_BEGIN) % EQEmu::constants::ITEM_CONTAINER_SIZE; + if (slot_id >= EQEmu::legacy::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::legacy::GENERAL_BAGS_END) { + index = (slot_id - EQEmu::legacy::GENERAL_BAGS_BEGIN) % EQEmu::legacy::ITEM_CONTAINER_SIZE; } - else if (slot_id >= EQEmu::constants::CURSOR_BAG_BEGIN && slot_id <= EQEmu::constants::CURSOR_BAG_END) { - index = (slot_id - EQEmu::constants::CURSOR_BAG_BEGIN); // % EQEmu::Constants::ITEM_CONTAINER_SIZE; - not needed since range is 10 slots + else if (slot_id >= EQEmu::legacy::CURSOR_BAG_BEGIN && slot_id <= EQEmu::legacy::CURSOR_BAG_END) { + index = (slot_id - EQEmu::legacy::CURSOR_BAG_BEGIN); // % EQEmu::legacy::ITEM_CONTAINER_SIZE; - not needed since range is 10 slots } - else if (slot_id >= EQEmu::constants::BANK_BAGS_BEGIN && slot_id <= EQEmu::constants::BANK_BAGS_END) { - index = (slot_id - EQEmu::constants::BANK_BAGS_BEGIN) % EQEmu::constants::ITEM_CONTAINER_SIZE; + else if (slot_id >= EQEmu::legacy::BANK_BAGS_BEGIN && slot_id <= EQEmu::legacy::BANK_BAGS_END) { + index = (slot_id - EQEmu::legacy::BANK_BAGS_BEGIN) % EQEmu::legacy::ITEM_CONTAINER_SIZE; } - else if (slot_id >= EQEmu::constants::SHARED_BANK_BAGS_BEGIN && slot_id <= EQEmu::constants::SHARED_BANK_BAGS_END) { - index = (slot_id - EQEmu::constants::SHARED_BANK_BAGS_BEGIN) % EQEmu::constants::ITEM_CONTAINER_SIZE; + else if (slot_id >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && slot_id <= EQEmu::legacy::SHARED_BANK_BAGS_END) { + index = (slot_id - EQEmu::legacy::SHARED_BANK_BAGS_BEGIN) % EQEmu::legacy::ITEM_CONTAINER_SIZE; } - else if (slot_id >= EQEmu::constants::TRADE_BAGS_BEGIN && slot_id <= EQEmu::constants::TRADE_BAGS_END) { - index = (slot_id - EQEmu::constants::TRADE_BAGS_BEGIN) % EQEmu::constants::ITEM_CONTAINER_SIZE; + else if (slot_id >= EQEmu::legacy::TRADE_BAGS_BEGIN && slot_id <= EQEmu::legacy::TRADE_BAGS_END) { + index = (slot_id - EQEmu::legacy::TRADE_BAGS_BEGIN) % EQEmu::legacy::ITEM_CONTAINER_SIZE; } - else if (slot_id >= EQEmu::constants::WORLD_BEGIN && slot_id <= EQEmu::constants::WORLD_END) { - index = (slot_id - EQEmu::constants::WORLD_BEGIN); // % EQEmu::Constants::ITEM_CONTAINER_SIZE; - not needed since range is 10 slots + else if (slot_id >= EQEmu::legacy::WORLD_BEGIN && slot_id <= EQEmu::legacy::WORLD_END) { + index = (slot_id - EQEmu::legacy::WORLD_BEGIN); // % EQEmu::legacy::ITEM_CONTAINER_SIZE; - not needed since range is 10 slots } return index; @@ -850,24 +850,24 @@ int16 Inventory::CalcSlotFromMaterial(uint8 material) { switch (material) { - case MaterialHead: - return SlotHead; - case MaterialChest: - return SlotChest; - case MaterialArms: - return SlotArms; - case MaterialWrist: - return SlotWrist1; // there's 2 bracers, only one bracer material - case MaterialHands: - return SlotHands; - case MaterialLegs: - return SlotLegs; - case MaterialFeet: - return SlotFeet; - case MaterialPrimary: - return SlotPrimary; - case MaterialSecondary: - return SlotSecondary; + case EQEmu::legacy::MaterialHead: + return EQEmu::legacy::SlotHead; + case EQEmu::legacy::MaterialChest: + return EQEmu::legacy::SlotChest; + case EQEmu::legacy::MaterialArms: + return EQEmu::legacy::SlotArms; + case EQEmu::legacy::MaterialWrist: + return EQEmu::legacy::SlotWrist1; // there's 2 bracers, only one bracer material + case EQEmu::legacy::MaterialHands: + return EQEmu::legacy::SlotHands; + case EQEmu::legacy::MaterialLegs: + return EQEmu::legacy::SlotLegs; + case EQEmu::legacy::MaterialFeet: + return EQEmu::legacy::SlotFeet; + case EQEmu::legacy::MaterialPrimary: + return EQEmu::legacy::SlotPrimary; + case EQEmu::legacy::MaterialSecondary: + return EQEmu::legacy::SlotSecondary; default: return INVALID_INDEX; } @@ -877,27 +877,27 @@ uint8 Inventory::CalcMaterialFromSlot(int16 equipslot) { switch (equipslot) { - case SlotHead: - return MaterialHead; - case SlotChest: - return MaterialChest; - case SlotArms: - return MaterialArms; - case SlotWrist1: + case EQEmu::legacy::SlotHead: + return EQEmu::legacy::MaterialHead; + case EQEmu::legacy::SlotChest: + return EQEmu::legacy::MaterialChest; + case EQEmu::legacy::SlotArms: + return EQEmu::legacy::MaterialArms; + case EQEmu::legacy::SlotWrist1: //case SLOT_BRACER02: // non-live behavior - return MaterialWrist; - case SlotHands: - return MaterialHands; - case SlotLegs: - return MaterialLegs; - case SlotFeet: - return MaterialFeet; - case SlotPrimary: - return MaterialPrimary; - case SlotSecondary: - return MaterialSecondary; + return EQEmu::legacy::MaterialWrist; + case EQEmu::legacy::SlotHands: + return EQEmu::legacy::MaterialHands; + case EQEmu::legacy::SlotLegs: + return EQEmu::legacy::MaterialLegs; + case EQEmu::legacy::SlotFeet: + return EQEmu::legacy::MaterialFeet; + case EQEmu::legacy::SlotPrimary: + return EQEmu::legacy::MaterialPrimary; + case EQEmu::legacy::SlotSecondary: + return EQEmu::legacy::MaterialSecondary; default: - return MaterialInvalid; + return EQEmu::legacy::MaterialInvalid; } } @@ -921,11 +921,11 @@ bool Inventory::CanItemFitInContainer(const Item_Struct *ItemToTry, const Item_S bool Inventory::SupportsClickCasting(int16 slot_id) { // there are a few non-potion items that identify as ItemTypePotion..so, we still need to ubiquitously include the equipment range - if ((uint16)slot_id <= EQEmu::constants::GENERAL_END || slot_id == SlotPowerSource) + if ((uint16)slot_id <= EQEmu::legacy::GENERAL_END || slot_id == EQEmu::legacy::SlotPowerSource) { return true; } - else if (slot_id >= EQEmu::constants::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::constants::GENERAL_BAGS_END) + else if (slot_id >= EQEmu::legacy::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::legacy::GENERAL_BAGS_END) { if (EQEmu::limits::AllowClickCastFromBag(m_inventory_version)) return true; @@ -936,7 +936,7 @@ bool Inventory::SupportsClickCasting(int16 slot_id) bool Inventory::SupportsPotionBeltCasting(int16 slot_id) { - if ((uint16)slot_id <= EQEmu::constants::GENERAL_END || slot_id == SlotPowerSource || (slot_id >= EQEmu::constants::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::constants::GENERAL_BAGS_END)) + if ((uint16)slot_id <= EQEmu::legacy::GENERAL_END || slot_id == EQEmu::legacy::SlotPowerSource || (slot_id >= EQEmu::legacy::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::legacy::GENERAL_BAGS_END)) return true; return false; @@ -945,11 +945,11 @@ bool Inventory::SupportsPotionBeltCasting(int16 slot_id) // Test whether a given slot can support a container item bool Inventory::SupportsContainers(int16 slot_id) { - if ((slot_id == SlotCursor) || - (slot_id >= EQEmu::constants::GENERAL_BEGIN && slot_id <= EQEmu::constants::GENERAL_END) || - (slot_id >= EQEmu::constants::BANK_BEGIN && slot_id <= EQEmu::constants::BANK_END) || - (slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && slot_id <= EQEmu::constants::SHARED_BANK_END) || - (slot_id >= EQEmu::constants::TRADE_BEGIN && slot_id <= EQEmu::constants::TRADE_END) + if ((slot_id == EQEmu::legacy::SlotCursor) || + (slot_id >= EQEmu::legacy::GENERAL_BEGIN && slot_id <= EQEmu::legacy::GENERAL_END) || + (slot_id >= EQEmu::legacy::BANK_BEGIN && slot_id <= EQEmu::legacy::BANK_END) || + (slot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id <= EQEmu::legacy::SHARED_BANK_END) || + (slot_id >= EQEmu::legacy::TRADE_BEGIN && slot_id <= EQEmu::legacy::TRADE_END) ) { return true; } @@ -987,7 +987,7 @@ int Inventory::GetSlotByItemInst(ItemInst *inst) { } if (m_cursor.peek_front() == inst) { - return SlotCursor; + return EQEmu::legacy::SlotCursor; } return INVALID_INDEX; @@ -998,8 +998,8 @@ uint8 Inventory::FindBrightestLightType() uint8 brightest_light_type = 0; for (auto iter = m_worn.begin(); iter != m_worn.end(); ++iter) { - if ((iter->first < EQEmu::constants::EQUIPMENT_BEGIN || iter->first > EQEmu::constants::EQUIPMENT_END) && iter->first != SlotPowerSource) { continue; } - if (iter->first == SlotAmmo) { continue; } + if ((iter->first < EQEmu::legacy::EQUIPMENT_BEGIN || iter->first > EQEmu::legacy::EQUIPMENT_END) && iter->first != EQEmu::legacy::SlotPowerSource) { continue; } + if (iter->first == EQEmu::legacy::SlotAmmo) { continue; } auto inst = iter->second; if (inst == nullptr) { continue; } @@ -1012,7 +1012,7 @@ uint8 Inventory::FindBrightestLightType() uint8 general_light_type = 0; for (auto iter = m_inv.begin(); iter != m_inv.end(); ++iter) { - if (iter->first < EQEmu::constants::GENERAL_BEGIN || iter->first > EQEmu::constants::GENERAL_END) { continue; } + if (iter->first < EQEmu::legacy::GENERAL_BEGIN || iter->first > EQEmu::legacy::GENERAL_END) { continue; } auto inst = iter->second; if (inst == nullptr) { continue; } @@ -1143,33 +1143,33 @@ int16 Inventory::_PutItem(int16 slot_id, ItemInst* inst) int16 result = INVALID_INDEX; int16 parentSlot = INVALID_INDEX; - if (slot_id == SlotCursor) { + if (slot_id == EQEmu::legacy::SlotCursor) { // Replace current item on cursor, if exists m_cursor.pop(); // no memory delete, clients of this function know what they are doing m_cursor.push_front(inst); result = slot_id; } - else if ((slot_id >= EQEmu::constants::EQUIPMENT_BEGIN && slot_id <= EQEmu::constants::EQUIPMENT_END) || (slot_id == SlotPowerSource)) { + else if ((slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN && slot_id <= EQEmu::legacy::EQUIPMENT_END) || (slot_id == EQEmu::legacy::SlotPowerSource)) { m_worn[slot_id] = inst; result = slot_id; } - else if ((slot_id >= EQEmu::constants::GENERAL_BEGIN && slot_id <= EQEmu::constants::GENERAL_END)) { + else if ((slot_id >= EQEmu::legacy::GENERAL_BEGIN && slot_id <= EQEmu::legacy::GENERAL_END)) { m_inv[slot_id] = inst; result = slot_id; } - else if (slot_id >= EQEmu::constants::TRIBUTE_BEGIN && slot_id <= EQEmu::constants::TRIBUTE_END) { + else if (slot_id >= EQEmu::legacy::TRIBUTE_BEGIN && slot_id <= EQEmu::legacy::TRIBUTE_END) { m_worn[slot_id] = inst; result = slot_id; } - else if (slot_id >= EQEmu::constants::BANK_BEGIN && slot_id <= EQEmu::constants::BANK_END) { + else if (slot_id >= EQEmu::legacy::BANK_BEGIN && slot_id <= EQEmu::legacy::BANK_END) { m_bank[slot_id] = inst; result = slot_id; } - else if (slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && slot_id <= EQEmu::constants::SHARED_BANK_END) { + else if (slot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id <= EQEmu::legacy::SHARED_BANK_END) { m_shbank[slot_id] = inst; result = slot_id; } - else if (slot_id >= EQEmu::constants::TRADE_BEGIN && slot_id <= EQEmu::constants::TRADE_END) { + else if (slot_id >= EQEmu::legacy::TRADE_BEGIN && slot_id <= EQEmu::legacy::TRADE_END) { m_trade[slot_id] = inst; result = slot_id; } @@ -1207,7 +1207,7 @@ int16 Inventory::_HasItem(std::map& bucket, uint32 item_id, ui return iter->first; } - for (int index = AUG_INDEX_BEGIN; index < EQEmu::constants::ITEM_COMMON_SIZE; ++index) { + for (int index = AUG_INDEX_BEGIN; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) { if (inst->GetAugmentItemID(index) == item_id && quantity <= 1) return EQEmu::legacy::SLOT_AUGMENT; } @@ -1224,7 +1224,7 @@ int16 Inventory::_HasItem(std::map& bucket, uint32 item_id, ui return Inventory::CalcSlotId(iter->first, bag_iter->first); } - for (int index = AUG_INDEX_BEGIN; index < EQEmu::constants::ITEM_COMMON_SIZE; ++index) { + for (int index = AUG_INDEX_BEGIN; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) { if (bag_inst->GetAugmentItemID(index) == item_id && quantity <= 1) return EQEmu::legacy::SLOT_AUGMENT; } @@ -1252,10 +1252,10 @@ int16 Inventory::_HasItem(ItemInstQueue& iqueue, uint32 item_id, uint8 quantity) if (inst->GetID() == item_id) { quantity_found += (inst->GetCharges() <= 0) ? 1 : inst->GetCharges(); if (quantity_found >= quantity) - return SlotCursor; + return EQEmu::legacy::SlotCursor; } - for (int index = AUG_INDEX_BEGIN; index < EQEmu::constants::ITEM_COMMON_SIZE; ++index) { + for (int index = AUG_INDEX_BEGIN; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) { if (inst->GetAugmentItemID(index) == item_id && quantity <= 1) return EQEmu::legacy::SLOT_AUGMENT; } @@ -1269,10 +1269,10 @@ int16 Inventory::_HasItem(ItemInstQueue& iqueue, uint32 item_id, uint8 quantity) if (bag_inst->GetID() == item_id) { quantity_found += (bag_inst->GetCharges() <= 0) ? 1 : bag_inst->GetCharges(); if (quantity_found >= quantity) - return Inventory::CalcSlotId(SlotCursor, bag_iter->first); + return Inventory::CalcSlotId(EQEmu::legacy::SlotCursor, bag_iter->first); } - for (int index = AUG_INDEX_BEGIN; index < EQEmu::constants::ITEM_COMMON_SIZE; ++index) { + for (int index = AUG_INDEX_BEGIN; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) { if (bag_inst->GetAugmentItemID(index) == item_id && quantity <= 1) return EQEmu::legacy::SLOT_AUGMENT; } @@ -1329,7 +1329,7 @@ int16 Inventory::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, uint8 quantity) if (inst->IsType(ItemClassCommon) && inst->GetItem()->ItemType == use) { quantity_found += (inst->GetCharges() <= 0) ? 1 : inst->GetCharges(); if (quantity_found >= quantity) - return SlotCursor; + return EQEmu::legacy::SlotCursor; } if (!inst->IsType(ItemClassContainer)) { continue; } @@ -1341,7 +1341,7 @@ int16 Inventory::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, uint8 quantity) if (bag_inst->IsType(ItemClassCommon) && bag_inst->GetItem()->ItemType == use) { quantity_found += (bag_inst->GetCharges() <= 0) ? 1 : bag_inst->GetCharges(); if (quantity_found >= quantity) - return Inventory::CalcSlotId(SlotCursor, bag_iter->first); + return Inventory::CalcSlotId(EQEmu::legacy::SlotCursor, bag_iter->first); } } @@ -1361,7 +1361,7 @@ int16 Inventory::_HasItemByLoreGroup(std::map& bucket, uint32 if (inst->GetItem()->LoreGroup == loregroup) return iter->first; - for (int index = AUG_INDEX_BEGIN; index < EQEmu::constants::ITEM_COMMON_SIZE; ++index) { + for (int index = AUG_INDEX_BEGIN; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) { auto aug_inst = inst->GetAugment(index); if (aug_inst == nullptr) { continue; } @@ -1378,7 +1378,7 @@ int16 Inventory::_HasItemByLoreGroup(std::map& bucket, uint32 if (bag_inst->IsType(ItemClassCommon) && bag_inst->GetItem()->LoreGroup == loregroup) return Inventory::CalcSlotId(iter->first, bag_iter->first); - for (int index = AUG_INDEX_BEGIN; index < EQEmu::constants::ITEM_COMMON_SIZE; ++index) { + for (int index = AUG_INDEX_BEGIN; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) { auto aug_inst = bag_inst->GetAugment(index); if (aug_inst == nullptr) { continue; } @@ -1399,9 +1399,9 @@ int16 Inventory::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup) if (inst == nullptr) { continue; } if (inst->GetItem()->LoreGroup == loregroup) - return SlotCursor; + return EQEmu::legacy::SlotCursor; - for (int index = AUG_INDEX_BEGIN; index < EQEmu::constants::ITEM_COMMON_SIZE; ++index) { + for (int index = AUG_INDEX_BEGIN; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) { auto aug_inst = inst->GetAugment(index); if (aug_inst == nullptr) { continue; } @@ -1416,9 +1416,9 @@ int16 Inventory::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup) if (bag_inst == nullptr) { continue; } if (bag_inst->IsType(ItemClassCommon) && bag_inst->GetItem()->LoreGroup == loregroup) - return Inventory::CalcSlotId(SlotCursor, bag_iter->first); + return Inventory::CalcSlotId(EQEmu::legacy::SlotCursor, bag_iter->first); - for (int index = AUG_INDEX_BEGIN; index < EQEmu::constants::ITEM_COMMON_SIZE; ++index) { + for (int index = AUG_INDEX_BEGIN; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) { auto aug_inst = bag_inst->GetAugment(index); if (aug_inst == nullptr) { continue; } @@ -1640,8 +1640,8 @@ bool ItemInst::IsEquipable(int16 slot_id) const // another "shouldn't do" fix..will be fixed in future updates (requires code and database work) int16 use_slot = INVALID_INDEX; - if (slot_id == SlotPowerSource) { use_slot = SlotGeneral1; } - if ((uint16)slot_id <= EQEmu::constants::EQUIPMENT_END) { use_slot = slot_id; } + if (slot_id == EQEmu::legacy::SlotPowerSource) { use_slot = EQEmu::legacy::SlotGeneral1; } + if ((uint16)slot_id <= EQEmu::legacy::EQUIPMENT_END) { use_slot = slot_id; } if (use_slot != INVALID_INDEX) { if (m_item->Slots & (1 << use_slot)) @@ -1656,7 +1656,7 @@ bool ItemInst::IsAugmentable() const if (!m_item) return false; - for (int index = 0; index < EQEmu::constants::ITEM_COMMON_SIZE; ++index) { + for (int index = 0; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) { if (m_item->AugSlotType[index] != NO_ITEM) return true; } @@ -1670,8 +1670,8 @@ bool ItemInst::AvailableWearSlot(uint32 aug_wear_slots) const { if (!m_item || m_item->ItemClass != ItemClassCommon) return false; - int index = EQEmu::constants::EQUIPMENT_BEGIN; - for (; index <= SlotGeneral1; ++index) { // MainGeneral1 should be EQEmu::constants::EQUIPMENT_END + int index = EQEmu::legacy::EQUIPMENT_BEGIN; + for (; index <= EQEmu::legacy::SlotGeneral1; ++index) { // MainGeneral1 should be EQEmu::legacy::EQUIPMENT_END if (m_item->Slots & (1 << index)) { if (aug_wear_slots & (1 << index)) break; @@ -1687,13 +1687,13 @@ int8 ItemInst::AvailableAugmentSlot(int32 augtype) const return INVALID_INDEX; int index = AUG_INDEX_BEGIN; - for (; index < EQEmu::constants::ITEM_COMMON_SIZE; ++index) { + for (; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) { if (GetItem(index)) { continue; } if (augtype == -1 || (m_item->AugSlotType[index] && ((1 << (m_item->AugSlotType[index] - 1)) & augtype))) break; } - return (index < EQEmu::constants::ITEM_COMMON_SIZE) ? index : INVALID_INDEX; + return (index < EQEmu::legacy::ITEM_COMMON_SIZE) ? index : INVALID_INDEX; } bool ItemInst::IsAugmentSlotAvailable(int32 augtype, uint8 slot) const @@ -1882,7 +1882,7 @@ ItemInst* ItemInst::GetOrnamentationAug(int32 ornamentationAugtype) const if (!m_item || m_item->ItemClass != ItemClassCommon) { return nullptr; } if (ornamentationAugtype == 0) { return nullptr; } - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) { if (GetAugment(i) && m_item->AugSlotType[i] == ornamentationAugtype) { @@ -2049,7 +2049,7 @@ bool ItemInst::IsAugmented() if (!m_item || m_item->ItemClass != ItemClassCommon) return false; - for (int index = AUG_INDEX_BEGIN; index < EQEmu::constants::ITEM_COMMON_SIZE; ++index) { + for (int index = AUG_INDEX_BEGIN; index < EQEmu::legacy::ITEM_COMMON_SIZE; ++index) { if (GetAugmentItemID(index)) return true; } @@ -2177,8 +2177,8 @@ bool ItemInst::IsSlotAllowed(int16 slot_id) const { if (!m_item) { return false; } else if (Inventory::SupportsContainers(slot_id)) { return true; } else if (m_item->Slots & (1 << slot_id)) { return true; } - else if (slot_id == SlotPowerSource && (m_item->Slots & (1 << 22))) { return true; } // got lazy... - else if (slot_id != SlotPowerSource && slot_id > EQEmu::constants::EQUIPMENT_END) { return true; } + else if (slot_id == EQEmu::legacy::SlotPowerSource && (m_item->Slots & (1 << 22))) { return true; } // got lazy... + else if (slot_id != EQEmu::legacy::SlotPowerSource && slot_id > EQEmu::legacy::EQUIPMENT_END) { return true; } else { return false; } } @@ -2330,7 +2330,7 @@ int ItemInst::GetItemArmorClass(bool augments) const if (item) { ac = item->AC; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) ac += GetAugment(i)->GetItemArmorClass(); } @@ -2372,7 +2372,7 @@ int ItemInst::GetItemElementalDamage(int &magic, int &fire, int &cold, int &pois } if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) GetAugment(i)->GetItemElementalDamage(magic, fire, cold, poison, disease, chromatic, prismatic, physical, corruption); } @@ -2389,7 +2389,7 @@ int ItemInst::GetItemElementalFlag(bool augments) const return flag; if (augments) { - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) { + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) { if (GetAugment(i)) flag = GetAugment(i)->GetItemElementalFlag(); if (flag) @@ -2410,7 +2410,7 @@ int ItemInst::GetItemElementalDamage(bool augments) const return damage; if (augments) { - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) { + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) { if (GetAugment(i)) damage = GetAugment(i)->GetItemElementalDamage(); if (damage) @@ -2429,7 +2429,7 @@ int ItemInst::GetItemRecommendedLevel(bool augments) const level = item->RecLevel; if (augments) { - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) { + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) { int temp = 0; if (GetAugment(i)) { temp = GetAugment(i)->GetItemRecommendedLevel(); @@ -2451,7 +2451,7 @@ int ItemInst::GetItemRequiredLevel(bool augments) const level = item->ReqLevel; if (augments) { - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) { + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) { int temp = 0; if (GetAugment(i)) { temp = GetAugment(i)->GetItemRequiredLevel(); @@ -2473,7 +2473,7 @@ int ItemInst::GetItemWeaponDamage(bool augments) const damage = item->Damage; if (augments) { - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) damage += GetAugment(i)->GetItemWeaponDamage(); } @@ -2489,7 +2489,7 @@ int ItemInst::GetItemBackstabDamage(bool augments) const damage = item->BackstabDmg; if (augments) { - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) damage += GetAugment(i)->GetItemBackstabDamage(); } @@ -2507,7 +2507,7 @@ int ItemInst::GetItemBaneDamageBody(bool augments) const return body; if (augments) { - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) { body = GetAugment(i)->GetItemBaneDamageBody(); if (body) @@ -2528,7 +2528,7 @@ int ItemInst::GetItemBaneDamageRace(bool augments) const return race; if (augments) { - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) { race = GetAugment(i)->GetItemBaneDamageRace(); if (race) @@ -2548,7 +2548,7 @@ int ItemInst::GetItemBaneDamageBody(bodyType against, bool augments) const damage += item->BaneDmgAmt; if (augments) { - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) damage += GetAugment(i)->GetItemBaneDamageBody(against); } @@ -2565,7 +2565,7 @@ int ItemInst::GetItemBaneDamageRace(uint16 against, bool augments) const damage += item->BaneDmgRaceAmt; if (augments) { - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) damage += GetAugment(i)->GetItemBaneDamageRace(against); } @@ -2581,7 +2581,7 @@ int ItemInst::GetItemMagical(bool augments) const return 1; if (augments) { - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i) && GetAugment(i)->GetItemMagical()) return 1; } @@ -2596,7 +2596,7 @@ int ItemInst::GetItemHP(bool augments) const if (item) { hp = item->HP; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) hp += GetAugment(i)->GetItemHP(); } @@ -2610,7 +2610,7 @@ int ItemInst::GetItemMana(bool augments) const if (item) { mana = item->Mana; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) mana += GetAugment(i)->GetItemMana(); } @@ -2624,7 +2624,7 @@ int ItemInst::GetItemEndur(bool augments) const if (item) { endur = item->Endur; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) endur += GetAugment(i)->GetItemEndur(); } @@ -2638,7 +2638,7 @@ int ItemInst::GetItemAttack(bool augments) const if (item) { atk = item->Attack; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) atk += GetAugment(i)->GetItemAttack(); } @@ -2652,7 +2652,7 @@ int ItemInst::GetItemStr(bool augments) const if (item) { str = item->AStr; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) str += GetAugment(i)->GetItemStr(); } @@ -2666,7 +2666,7 @@ int ItemInst::GetItemSta(bool augments) const if (item) { sta = item->ASta; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) sta += GetAugment(i)->GetItemSta(); } @@ -2680,7 +2680,7 @@ int ItemInst::GetItemDex(bool augments) const if (item) { total = item->ADex; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemDex(); } @@ -2694,7 +2694,7 @@ int ItemInst::GetItemAgi(bool augments) const if (item) { total = item->AAgi; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemAgi(); } @@ -2708,7 +2708,7 @@ int ItemInst::GetItemInt(bool augments) const if (item) { total = item->AInt; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemInt(); } @@ -2722,7 +2722,7 @@ int ItemInst::GetItemWis(bool augments) const if (item) { total = item->AWis; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemWis(); } @@ -2736,7 +2736,7 @@ int ItemInst::GetItemCha(bool augments) const if (item) { total = item->ACha; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemCha(); } @@ -2750,7 +2750,7 @@ int ItemInst::GetItemMR(bool augments) const if (item) { total = item->MR; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemMR(); } @@ -2764,7 +2764,7 @@ int ItemInst::GetItemFR(bool augments) const if (item) { total = item->FR; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemFR(); } @@ -2778,7 +2778,7 @@ int ItemInst::GetItemCR(bool augments) const if (item) { total = item->CR; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemCR(); } @@ -2792,7 +2792,7 @@ int ItemInst::GetItemPR(bool augments) const if (item) { total = item->PR; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemPR(); } @@ -2806,7 +2806,7 @@ int ItemInst::GetItemDR(bool augments) const if (item) { total = item->DR; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemDR(); } @@ -2820,7 +2820,7 @@ int ItemInst::GetItemCorrup(bool augments) const if (item) { total = item->SVCorruption; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemCorrup(); } @@ -2834,7 +2834,7 @@ int ItemInst::GetItemHeroicStr(bool augments) const if (item) { total = item->HeroicStr; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemHeroicStr(); } @@ -2848,7 +2848,7 @@ int ItemInst::GetItemHeroicSta(bool augments) const if (item) { total = item->HeroicSta; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemHeroicSta(); } @@ -2862,7 +2862,7 @@ int ItemInst::GetItemHeroicDex(bool augments) const if (item) { total = item->HeroicDex; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemHeroicDex(); } @@ -2876,7 +2876,7 @@ int ItemInst::GetItemHeroicAgi(bool augments) const if (item) { total = item->HeroicAgi; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemHeroicAgi(); } @@ -2890,7 +2890,7 @@ int ItemInst::GetItemHeroicInt(bool augments) const if (item) { total = item->HeroicInt; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemHeroicInt(); } @@ -2904,7 +2904,7 @@ int ItemInst::GetItemHeroicWis(bool augments) const if (item) { total = item->HeroicWis; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemHeroicWis(); } @@ -2918,7 +2918,7 @@ int ItemInst::GetItemHeroicCha(bool augments) const if (item) { total = item->HeroicCha; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemHeroicCha(); } @@ -2932,7 +2932,7 @@ int ItemInst::GetItemHeroicMR(bool augments) const if (item) { total = item->HeroicMR; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemHeroicMR(); } @@ -2946,7 +2946,7 @@ int ItemInst::GetItemHeroicFR(bool augments) const if (item) { total = item->HeroicFR; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemHeroicFR(); } @@ -2960,7 +2960,7 @@ int ItemInst::GetItemHeroicCR(bool augments) const if (item) { total = item->HeroicCR; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemHeroicCR(); } @@ -2974,7 +2974,7 @@ int ItemInst::GetItemHeroicPR(bool augments) const if (item) { total = item->HeroicPR; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemHeroicPR(); } @@ -2988,7 +2988,7 @@ int ItemInst::GetItemHeroicDR(bool augments) const if (item) { total = item->HeroicDR; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemHeroicDR(); } @@ -3002,7 +3002,7 @@ int ItemInst::GetItemHeroicCorrup(bool augments) const if (item) { total = item->HeroicSVCorrup; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) total += GetAugment(i)->GetItemHeroicCorrup(); } @@ -3016,7 +3016,7 @@ int ItemInst::GetItemHaste(bool augments) const if (item) { total = item->Haste; if (augments) - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) if (GetAugment(i)) { int temp = GetAugment(i)->GetItemHaste(); if (temp > total) diff --git a/common/item_struct.h b/common/item_struct.h index 42625b5bc..226458d70 100644 --- a/common/item_struct.h +++ b/common/item_struct.h @@ -183,9 +183,9 @@ struct Item_Struct { int32 FactionAmt4; // Faction Amt 4 char CharmFile[32]; // ? uint32 AugType; - uint8 AugSlotType[EQEmu::constants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Type - uint8 AugSlotVisible[EQEmu::constants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Visible - uint8 AugSlotUnk2[EQEmu::constants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Unknown Most likely Powersource related + uint8 AugSlotType[EQEmu::legacy::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Type + uint8 AugSlotVisible[EQEmu::legacy::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Visible + uint8 AugSlotUnk2[EQEmu::legacy::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Unknown Most likely Powersource related uint32 LDoNTheme; uint32 LDoNPrice; uint32 LDoNSold; diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 7d615d48c..2fb93343a 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -2342,7 +2342,7 @@ namespace RoF outapp->WriteUInt32(consts::BANDOLIERS_SIZE); // Copy bandoliers where server and client indexes converge - for (uint32 r = 0; r < EQEmu::constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) { + for (uint32 r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) { outapp->WriteString(emu->bandoliers[r].Name); for (uint32 j = 0; j < consts::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true outapp->WriteString(emu->bandoliers[r].Items[j].Name); @@ -2357,7 +2357,7 @@ namespace RoF } } // Nullify bandoliers where server and client indexes diverge, with a client bias - for (uint32 r = EQEmu::constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { + for (uint32 r = EQEmu::legacy::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { outapp->WriteString(""); for (uint32 j = 0; j < consts::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true outapp->WriteString(""); @@ -2369,7 +2369,7 @@ namespace RoF outapp->WriteUInt32(consts::POTION_BELT_ITEM_COUNT); // Copy potion belt where server and client indexes converge - for (uint32 r = 0; r < EQEmu::constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (uint32 r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) { outapp->WriteString(emu->potionbelt.Items[r].Name); outapp->WriteUInt32(emu->potionbelt.Items[r].ID); if (emu->potionbelt.Items[r].Icon) { @@ -2381,7 +2381,7 @@ namespace RoF } } // Nullify potion belt where server and client indexes diverge, with a client bias - for (uint32 r = EQEmu::constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (uint32 r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) { outapp->WriteString(""); outapp->WriteUInt32(0); outapp->WriteSInt32(-1); @@ -2502,9 +2502,9 @@ namespace RoF outapp->WriteUInt8(0); // Unknown outapp->WriteUInt8(0); // Unknown - outapp->WriteUInt32(EQEmu::constants::TRIBUTE_SIZE); + outapp->WriteUInt32(EQEmu::legacy::TRIBUTE_SIZE); - for (uint32 r = 0; r < EQEmu::constants::TRIBUTE_SIZE; r++) + for (uint32 r = 0; r < EQEmu::legacy::TRIBUTE_SIZE; r++) { outapp->WriteUInt32(emu->tributes[r].tribute); outapp->WriteUInt32(emu->tributes[r].tier); @@ -3037,7 +3037,7 @@ namespace RoF eq_cse->Gender = emu_cse->Gender; eq_cse->Face = emu_cse->Face; - for (int equip_index = 0; equip_index < MaterialCount; equip_index++) { + for (int equip_index = 0; equip_index < EQEmu::legacy::MaterialCount; equip_index++) { eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material; eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1; eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteMaterial; @@ -4101,13 +4101,13 @@ namespace RoF VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialPrimary].Material); + VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[EQEmu::legacy::MaterialPrimary].Material); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialSecondary].Material); + VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[EQEmu::legacy::MaterialSecondary].Material); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); @@ -4810,7 +4810,7 @@ namespace RoF IN(item_id); int r; - for (r = 0; r < EQEmu::constants::ITEM_COMMON_SIZE; r++) { + for (r = 0; r < EQEmu::legacy::ITEM_COMMON_SIZE; r++) { IN(augments[r]); } // Max Augs is now 6, but no code to support that many yet @@ -5678,7 +5678,7 @@ namespace RoF uint32 SubLengths[10]; - for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; ++x) { + for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::ITEM_CONTAINER_SIZE; ++x) { SubSerializations[x] = nullptr; @@ -5690,15 +5690,15 @@ namespace RoF iqbs.subitem_count++; - if (slot_id_in >= EQEmu::constants::GENERAL_BEGIN && slot_id_in <= EQEmu::constants::GENERAL_END) // (< 30) - no cursor? + if (slot_id_in >= EQEmu::legacy::GENERAL_BEGIN && slot_id_in <= EQEmu::legacy::GENERAL_END) // (< 30) - no cursor? //SubSlotNumber = (((slot_id_in + 3) * 10) + x + 1); - SubSlotNumber = (((slot_id_in + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + x + 1); - else if (slot_id_in >= EQEmu::constants::BANK_BEGIN && slot_id_in <= EQEmu::constants::BANK_END) + SubSlotNumber = (((slot_id_in + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + x + 1); + else if (slot_id_in >= EQEmu::legacy::BANK_BEGIN && slot_id_in <= EQEmu::legacy::BANK_END) //SubSlotNumber = (((slot_id_in - 2000) * 10) + 2030 + x + 1); - SubSlotNumber = (((slot_id_in - EQEmu::constants::BANK_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE) + EQEmu::constants::BANK_BAGS_BEGIN + x); - else if (slot_id_in >= EQEmu::constants::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::constants::SHARED_BANK_END) + SubSlotNumber = (((slot_id_in - EQEmu::legacy::BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + EQEmu::legacy::BANK_BAGS_BEGIN + x); + else if (slot_id_in >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::legacy::SHARED_BANK_END) //SubSlotNumber = (((slot_id_in - 2500) * 10) + 2530 + x + 1); - SubSlotNumber = (((slot_id_in - EQEmu::constants::SHARED_BANK_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE) + EQEmu::constants::SHARED_BANK_BAGS_BEGIN + x); + SubSlotNumber = (((slot_id_in - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + x); else SubSlotNumber = slot_id_in; // ??????? @@ -5713,7 +5713,7 @@ namespace RoF ss.write((const char*)&iqbs, sizeof(RoF::structs::ItemQuaternaryBodyStruct)); - for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; ++x) { + for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::ITEM_CONTAINER_SIZE; ++x) { if (SubSerializations[x]) { @@ -5745,17 +5745,17 @@ namespace RoF uint32 TempSlot = 0; - if (serverSlot < 56 || serverSlot == SlotPowerSource) { // Main Inventory and Cursor + if (serverSlot < 56 || serverSlot == EQEmu::legacy::SlotPowerSource) { // Main Inventory and Cursor RoFSlot.Type = inventory::TypePossessions; RoFSlot.Slot = serverSlot; - if (serverSlot == SlotPowerSource) + if (serverSlot == EQEmu::legacy::SlotPowerSource) RoFSlot.Slot = inventory::SlotPowerSource; - else if (serverSlot >= SlotCursor) // Cursor and Extended Corpse Inventory + else if (serverSlot >= EQEmu::legacy::SlotCursor) // Cursor and Extended Corpse Inventory RoFSlot.Slot += 3; - else if (serverSlot >= SlotAmmo) // (> 20) + else if (serverSlot >= EQEmu::legacy::SlotAmmo) // (> 20) RoFSlot.Slot += 1; } @@ -5764,51 +5764,51 @@ namespace RoF RoFSlot.MainSlot = ServerSlot - 31; }*/ - else if (serverSlot >= EQEmu::constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::constants::CURSOR_BAG_END) { // (> 250 && < 341) + else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END) { // (> 250 && < 341) RoFSlot.Type = inventory::TypePossessions; TempSlot = serverSlot - 1; - RoFSlot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 2; - RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::constants::ITEM_CONTAINER_SIZE); + RoFSlot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 2; + RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::legacy::ITEM_CONTAINER_SIZE); if (RoFSlot.Slot >= inventory::SlotGeneral9) // (> 30) RoFSlot.Slot = inventory::SlotCursor; } - else if (serverSlot >= EQEmu::constants::TRIBUTE_BEGIN && serverSlot <= EQEmu::constants::TRIBUTE_END) { // Tribute + else if (serverSlot >= EQEmu::legacy::TRIBUTE_BEGIN && serverSlot <= EQEmu::legacy::TRIBUTE_END) { // Tribute RoFSlot.Type = inventory::TypeTribute; - RoFSlot.Slot = serverSlot - EQEmu::constants::TRIBUTE_BEGIN; + RoFSlot.Slot = serverSlot - EQEmu::legacy::TRIBUTE_BEGIN; } - else if (serverSlot >= EQEmu::constants::BANK_BEGIN && serverSlot <= EQEmu::constants::BANK_BAGS_END) { + else if (serverSlot >= EQEmu::legacy::BANK_BEGIN && serverSlot <= EQEmu::legacy::BANK_BAGS_END) { RoFSlot.Type = inventory::TypeBank; - TempSlot = serverSlot - EQEmu::constants::BANK_BEGIN; + TempSlot = serverSlot - EQEmu::legacy::BANK_BEGIN; RoFSlot.Slot = TempSlot; if (TempSlot > 30) { // (> 30) - RoFSlot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 3; - RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE); + RoFSlot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 3; + RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE); } } - else if (serverSlot >= EQEmu::constants::SHARED_BANK_BEGIN && serverSlot <= EQEmu::constants::SHARED_BANK_BAGS_END) { + else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END) { RoFSlot.Type = inventory::TypeSharedBank; - TempSlot = serverSlot - EQEmu::constants::SHARED_BANK_BEGIN; + TempSlot = serverSlot - EQEmu::legacy::SHARED_BANK_BEGIN; RoFSlot.Slot = TempSlot; if (TempSlot > 30) { // (> 30) - RoFSlot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 3; - RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE); + RoFSlot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 3; + RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE); } } - else if (serverSlot >= EQEmu::constants::TRADE_BEGIN && serverSlot <= EQEmu::constants::TRADE_BAGS_END) { + else if (serverSlot >= EQEmu::legacy::TRADE_BEGIN && serverSlot <= EQEmu::legacy::TRADE_BAGS_END) { RoFSlot.Type = inventory::TypeTrade; - TempSlot = serverSlot - EQEmu::constants::TRADE_BEGIN; + TempSlot = serverSlot - EQEmu::legacy::TRADE_BEGIN; RoFSlot.Slot = TempSlot; if (TempSlot > 30) { - RoFSlot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 3; - RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE); + RoFSlot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 3; + RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE); } /* @@ -5825,9 +5825,9 @@ namespace RoF */ } - else if (serverSlot >= EQEmu::constants::WORLD_BEGIN && serverSlot <= EQEmu::constants::WORLD_END) { + else if (serverSlot >= EQEmu::legacy::WORLD_BEGIN && serverSlot <= EQEmu::legacy::WORLD_END) { RoFSlot.Type = inventory::TypeWorld; - TempSlot = serverSlot - EQEmu::constants::WORLD_BEGIN; + TempSlot = serverSlot - EQEmu::legacy::WORLD_BEGIN; RoFSlot.Slot = TempSlot; } @@ -5846,16 +5846,16 @@ namespace RoF uint32 TempSlot = 0; - if (serverSlot < 56 || serverSlot == SlotPowerSource) { // (< 52) + if (serverSlot < 56 || serverSlot == EQEmu::legacy::SlotPowerSource) { // (< 52) RoFSlot.Slot = serverSlot; - if (serverSlot == SlotPowerSource) + if (serverSlot == EQEmu::legacy::SlotPowerSource) RoFSlot.Slot = inventory::SlotPowerSource; - else if (serverSlot >= SlotCursor) // Cursor and Extended Corpse Inventory + else if (serverSlot >= EQEmu::legacy::SlotCursor) // Cursor and Extended Corpse Inventory RoFSlot.Slot += 3; - else if (serverSlot >= SlotAmmo) // Ammo and Personl Inventory + else if (serverSlot >= EQEmu::legacy::SlotAmmo) // Ammo and Personl Inventory RoFSlot.Slot += 1; /*else if (ServerSlot >= MainCursor) { // Cursor @@ -5866,10 +5866,10 @@ namespace RoF }*/ } - else if (serverSlot >= EQEmu::constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::constants::CURSOR_BAG_END) { + else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END) { TempSlot = serverSlot - 1; - RoFSlot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 2; - RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::constants::ITEM_CONTAINER_SIZE); + RoFSlot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 2; + RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::legacy::ITEM_CONTAINER_SIZE); } Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoFSlot.Slot, RoFSlot.SubIndex, RoFSlot.AugIndex, RoFSlot.Unknown01); @@ -5889,7 +5889,7 @@ namespace RoF if (rofSlot.Type == inventory::TypePossessions && rofSlot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 51) if (rofSlot.Slot == inventory::SlotPowerSource) - TempSlot = SlotPowerSource; + TempSlot = EQEmu::legacy::SlotPowerSource; else if (rofSlot.Slot >= inventory::SlotCursor) // Cursor and Extended Corpse Inventory TempSlot = rofSlot.Slot - 3; @@ -5912,16 +5912,16 @@ namespace RoF TempSlot = rofSlot.Slot; if (rofSlot.SubIndex >= SUB_INDEX_BEGIN) // Bag Slots - TempSlot = ((TempSlot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1; + TempSlot = ((TempSlot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1; ServerSlot = TempSlot; } else if (rofSlot.Type == inventory::TypeBank) { - TempSlot = EQEmu::constants::BANK_BEGIN; + TempSlot = EQEmu::legacy::BANK_BEGIN; if (rofSlot.SubIndex >= SUB_INDEX_BEGIN) - TempSlot += ((rofSlot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1; + TempSlot += ((rofSlot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1; else TempSlot += rofSlot.Slot; @@ -5930,10 +5930,10 @@ namespace RoF } else if (rofSlot.Type == inventory::TypeSharedBank) { - TempSlot = EQEmu::constants::SHARED_BANK_BEGIN; + TempSlot = EQEmu::legacy::SHARED_BANK_BEGIN; if (rofSlot.SubIndex >= SUB_INDEX_BEGIN) - TempSlot += ((rofSlot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1; + TempSlot += ((rofSlot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1; else TempSlot += rofSlot.Slot; @@ -5942,12 +5942,12 @@ namespace RoF } else if (rofSlot.Type == inventory::TypeTrade) { - TempSlot = EQEmu::constants::TRADE_BEGIN; + TempSlot = EQEmu::legacy::TRADE_BEGIN; if (rofSlot.SubIndex >= SUB_INDEX_BEGIN) - TempSlot += ((rofSlot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1; + TempSlot += ((rofSlot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1; // OLD CODE: - //TempSlot += 100 + (RoFSlot.MainSlot * EQEmu::constants::ITEM_CONTAINER_SIZE) + RoFSlot.SubSlot; + //TempSlot += 100 + (RoFSlot.MainSlot * EQEmu::legacy::ITEM_CONTAINER_SIZE) + RoFSlot.SubSlot; else TempSlot += rofSlot.Slot; @@ -5956,7 +5956,7 @@ namespace RoF } else if (rofSlot.Type == inventory::TypeWorld) { - TempSlot = EQEmu::constants::WORLD_BEGIN; + TempSlot = EQEmu::legacy::WORLD_BEGIN; if (rofSlot.Slot >= SUB_INDEX_BEGIN) TempSlot += rofSlot.Slot; @@ -5989,7 +5989,7 @@ namespace RoF if (rofSlot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 33) if (rofSlot.Slot == inventory::SlotPowerSource) - TempSlot = SlotPowerSource; + TempSlot = EQEmu::legacy::SlotPowerSource; else if (rofSlot.Slot >= inventory::SlotCursor) // Cursor and Extended Corpse Inventory TempSlot = rofSlot.Slot - 3; @@ -6007,7 +6007,7 @@ namespace RoF TempSlot = rofSlot.Slot; if (rofSlot.SubIndex >= SUB_INDEX_BEGIN) // Bag Slots - TempSlot = ((TempSlot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1; + TempSlot = ((TempSlot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + rofSlot.SubIndex + 1; ServerSlot = TempSlot; } @@ -6024,7 +6024,7 @@ namespace RoF static inline void ServerToRoFTextLink(std::string& rofTextLink, const std::string& serverTextLink) { - if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) { + if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) { rofTextLink = serverTextLink; return; } @@ -6033,7 +6033,7 @@ namespace RoF for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) { if (segment_iter & 1) { - if (segments[segment_iter].length() <= EQEmu::constants::TEXT_LINK_BODY_LENGTH) { + if (segments[segment_iter].length() <= EQEmu::legacy::TEXT_LINK_BODY_LENGTH) { rofTextLink.append(segments[segment_iter]); // TODO: log size mismatch error continue; @@ -6063,7 +6063,7 @@ namespace RoF static inline void RoFToServerTextLink(std::string& serverTextLink, const std::string& rofTextLink) { - if ((EQEmu::constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (rofTextLink.find('\x12') == std::string::npos)) { + if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (rofTextLink.find('\x12') == std::string::npos)) { serverTextLink = rofTextLink; return; } diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 4977ad984..005b1d298 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -2421,7 +2421,7 @@ namespace RoF2 outapp->WriteUInt32(consts::BANDOLIERS_SIZE); // Copy bandoliers where server and client indexes converge - for (uint32 r = 0; r < EQEmu::constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) { + for (uint32 r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) { outapp->WriteString(emu->bandoliers[r].Name); for (uint32 j = 0; j < consts::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true outapp->WriteString(emu->bandoliers[r].Items[j].Name); @@ -2436,7 +2436,7 @@ namespace RoF2 } } // Nullify bandoliers where server and client indexes diverge, with a client bias - for (uint32 r = EQEmu::constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { + for (uint32 r = EQEmu::legacy::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { outapp->WriteString(""); for (uint32 j = 0; j < consts::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true outapp->WriteString(""); @@ -2448,7 +2448,7 @@ namespace RoF2 outapp->WriteUInt32(consts::POTION_BELT_ITEM_COUNT); // Copy potion belt where server and client indexes converge - for (uint32 r = 0; r < EQEmu::constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (uint32 r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) { outapp->WriteString(emu->potionbelt.Items[r].Name); outapp->WriteUInt32(emu->potionbelt.Items[r].ID); if (emu->potionbelt.Items[r].Icon) { @@ -2460,7 +2460,7 @@ namespace RoF2 } } // Nullify potion belt where server and client indexes diverge, with a client bias - for (uint32 r = EQEmu::constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (uint32 r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) { outapp->WriteString(""); outapp->WriteUInt32(0); outapp->WriteSInt32(-1); @@ -2577,9 +2577,9 @@ namespace RoF2 outapp->WriteUInt8(0); // Unknown outapp->WriteUInt8(0); // Unknown - outapp->WriteUInt32(EQEmu::constants::TRIBUTE_SIZE); + outapp->WriteUInt32(EQEmu::legacy::TRIBUTE_SIZE); - for (uint32 r = 0; r < EQEmu::constants::TRIBUTE_SIZE; r++) + for (uint32 r = 0; r < EQEmu::legacy::TRIBUTE_SIZE; r++) { outapp->WriteUInt32(emu->tributes[r].tribute); outapp->WriteUInt32(emu->tributes[r].tier); @@ -3126,7 +3126,7 @@ namespace RoF2 eq_cse->Gender = emu_cse->Gender; eq_cse->Face = emu_cse->Face; - for (int equip_index = 0; equip_index < MaterialCount; equip_index++) { + for (int equip_index = 0; equip_index < EQEmu::legacy::MaterialCount; equip_index++) { eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material; eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1; eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteMaterial; @@ -4320,13 +4320,13 @@ namespace RoF2 VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialPrimary].Material); + VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[EQEmu::legacy::MaterialPrimary].Material); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialSecondary].Material); + VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[EQEmu::legacy::MaterialSecondary].Material); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); @@ -5028,7 +5028,7 @@ namespace RoF2 IN(item_id); int r; - for (r = 0; r < EQEmu::constants::ITEM_COMMON_SIZE; r++) { + for (r = 0; r < EQEmu::legacy::ITEM_COMMON_SIZE; r++) { IN(augments[r]); } IN(link_hash); @@ -5961,7 +5961,7 @@ namespace RoF2 uint32 SubLengths[10]; - for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; ++x) { + for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::ITEM_CONTAINER_SIZE; ++x) { SubSerializations[x] = nullptr; @@ -5973,15 +5973,15 @@ namespace RoF2 iqbs.subitem_count++; - if (slot_id_in >= EQEmu::constants::GENERAL_BEGIN && slot_id_in <= EQEmu::constants::GENERAL_END) // (< 30) - no cursor? + if (slot_id_in >= EQEmu::legacy::GENERAL_BEGIN && slot_id_in <= EQEmu::legacy::GENERAL_END) // (< 30) - no cursor? //SubSlotNumber = (((slot_id_in + 3) * 10) + x + 1); - SubSlotNumber = (((slot_id_in + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + x + 1); - else if (slot_id_in >= EQEmu::constants::BANK_BEGIN && slot_id_in <= EQEmu::constants::BANK_END) + SubSlotNumber = (((slot_id_in + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + x + 1); + else if (slot_id_in >= EQEmu::legacy::BANK_BEGIN && slot_id_in <= EQEmu::legacy::BANK_END) //SubSlotNumber = (((slot_id_in - 2000) * 10) + 2030 + x + 1); - SubSlotNumber = (((slot_id_in - EQEmu::constants::BANK_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE) + EQEmu::constants::BANK_BAGS_BEGIN + x); - else if (slot_id_in >= EQEmu::constants::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::constants::SHARED_BANK_END) + SubSlotNumber = (((slot_id_in - EQEmu::legacy::BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + EQEmu::legacy::BANK_BAGS_BEGIN + x); + else if (slot_id_in >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::legacy::SHARED_BANK_END) //SubSlotNumber = (((slot_id_in - 2500) * 10) + 2530 + x + 1); - SubSlotNumber = (((slot_id_in - EQEmu::constants::SHARED_BANK_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE) + EQEmu::constants::SHARED_BANK_BAGS_BEGIN + x); + SubSlotNumber = (((slot_id_in - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + x); else SubSlotNumber = slot_id_in; // ??????? @@ -5996,7 +5996,7 @@ namespace RoF2 ss.write((const char*)&iqbs, sizeof(RoF2::structs::ItemQuaternaryBodyStruct)); - for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; ++x) { + for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::ITEM_CONTAINER_SIZE; ++x) { if (SubSerializations[x]) { @@ -6028,11 +6028,11 @@ namespace RoF2 uint32 TempSlot = 0; - if (serverSlot < 56 || serverSlot == SlotPowerSource) { // Main Inventory and Cursor + if (serverSlot < 56 || serverSlot == EQEmu::legacy::SlotPowerSource) { // Main Inventory and Cursor if (PacketType == ItemPacketLoot) { RoF2Slot.Type = inventory::TypeCorpse; - RoF2Slot.Slot = serverSlot - EQEmu::constants::CORPSE_BEGIN; + RoF2Slot.Slot = serverSlot - EQEmu::legacy::CORPSE_BEGIN; } else { @@ -6040,13 +6040,13 @@ namespace RoF2 RoF2Slot.Slot = serverSlot; } - if (serverSlot == SlotPowerSource) + if (serverSlot == EQEmu::legacy::SlotPowerSource) RoF2Slot.Slot = inventory::SlotPowerSource; - else if (serverSlot >= SlotCursor && PacketType != ItemPacketLoot) // Cursor and Extended Corpse Inventory + else if (serverSlot >= EQEmu::legacy::SlotCursor && PacketType != ItemPacketLoot) // Cursor and Extended Corpse Inventory RoF2Slot.Slot += 3; - else if (serverSlot >= SlotAmmo) // (> 20) + else if (serverSlot >= EQEmu::legacy::SlotAmmo) // (> 20) RoF2Slot.Slot += 1; } @@ -6055,51 +6055,51 @@ namespace RoF2 RoF2Slot.MainSlot = ServerSlot - 31; }*/ - else if (serverSlot >= EQEmu::constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::constants::CURSOR_BAG_END) { // (> 250 && < 341) + else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END) { // (> 250 && < 341) RoF2Slot.Type = inventory::TypePossessions; TempSlot = serverSlot - 1; - RoF2Slot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 2; - RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::constants::ITEM_CONTAINER_SIZE); + RoF2Slot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 2; + RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::legacy::ITEM_CONTAINER_SIZE); if (RoF2Slot.Slot >= inventory::SlotGeneral9) // (> 30) RoF2Slot.Slot = inventory::SlotCursor; } - else if (serverSlot >= EQEmu::constants::TRIBUTE_BEGIN && serverSlot <= EQEmu::constants::TRIBUTE_END) { // Tribute + else if (serverSlot >= EQEmu::legacy::TRIBUTE_BEGIN && serverSlot <= EQEmu::legacy::TRIBUTE_END) { // Tribute RoF2Slot.Type = inventory::TypeTribute; - RoF2Slot.Slot = serverSlot - EQEmu::constants::TRIBUTE_BEGIN; + RoF2Slot.Slot = serverSlot - EQEmu::legacy::TRIBUTE_BEGIN; } - else if (serverSlot >= EQEmu::constants::BANK_BEGIN && serverSlot <= EQEmu::constants::BANK_BAGS_END) { + else if (serverSlot >= EQEmu::legacy::BANK_BEGIN && serverSlot <= EQEmu::legacy::BANK_BAGS_END) { RoF2Slot.Type = inventory::TypeBank; - TempSlot = serverSlot - EQEmu::constants::BANK_BEGIN; + TempSlot = serverSlot - EQEmu::legacy::BANK_BEGIN; RoF2Slot.Slot = TempSlot; if (TempSlot > 30) { // (> 30) - RoF2Slot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 3; - RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE); + RoF2Slot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 3; + RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE); } } - else if (serverSlot >= EQEmu::constants::SHARED_BANK_BEGIN && serverSlot <= EQEmu::constants::SHARED_BANK_BAGS_END) { + else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END) { RoF2Slot.Type = inventory::TypeSharedBank; - TempSlot = serverSlot - EQEmu::constants::SHARED_BANK_BEGIN; + TempSlot = serverSlot - EQEmu::legacy::SHARED_BANK_BEGIN; RoF2Slot.Slot = TempSlot; if (TempSlot > 30) { // (> 30) - RoF2Slot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 3; - RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE); + RoF2Slot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 3; + RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE); } } - else if (serverSlot >= EQEmu::constants::TRADE_BEGIN && serverSlot <= EQEmu::constants::TRADE_BAGS_END) { + else if (serverSlot >= EQEmu::legacy::TRADE_BEGIN && serverSlot <= EQEmu::legacy::TRADE_BAGS_END) { RoF2Slot.Type = inventory::TypeTrade; - TempSlot = serverSlot - EQEmu::constants::TRADE_BEGIN; + TempSlot = serverSlot - EQEmu::legacy::TRADE_BEGIN; RoF2Slot.Slot = TempSlot; if (TempSlot > 30) { - RoF2Slot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 3; - RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE); + RoF2Slot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 3; + RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE); } /* @@ -6116,9 +6116,9 @@ namespace RoF2 */ } - else if (serverSlot >= EQEmu::constants::WORLD_BEGIN && serverSlot <= EQEmu::constants::WORLD_END) { + else if (serverSlot >= EQEmu::legacy::WORLD_BEGIN && serverSlot <= EQEmu::legacy::WORLD_END) { RoF2Slot.Type = inventory::TypeWorld; - TempSlot = serverSlot - EQEmu::constants::WORLD_BEGIN; + TempSlot = serverSlot - EQEmu::legacy::WORLD_BEGIN; RoF2Slot.Slot = TempSlot; } @@ -6137,16 +6137,16 @@ namespace RoF2 uint32 TempSlot = 0; - if (serverSlot < 56 || serverSlot == SlotPowerSource) { // (< 52) + if (serverSlot < 56 || serverSlot == EQEmu::legacy::SlotPowerSource) { // (< 52) RoF2Slot.Slot = serverSlot; - if (serverSlot == SlotPowerSource) + if (serverSlot == EQEmu::legacy::SlotPowerSource) RoF2Slot.Slot = inventory::SlotPowerSource; - else if (serverSlot >= SlotCursor) // Cursor and Extended Corpse Inventory + else if (serverSlot >= EQEmu::legacy::SlotCursor) // Cursor and Extended Corpse Inventory RoF2Slot.Slot += 3; - else if (serverSlot >= SlotAmmo) // Ammo and Personl Inventory + else if (serverSlot >= EQEmu::legacy::SlotAmmo) // Ammo and Personl Inventory RoF2Slot.Slot += 1; /*else if (ServerSlot >= MainCursor) { // Cursor @@ -6157,10 +6157,10 @@ namespace RoF2 }*/ } - else if (serverSlot >= EQEmu::constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::constants::CURSOR_BAG_END) { + else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END) { TempSlot = serverSlot - 1; - RoF2Slot.Slot = int(TempSlot / EQEmu::constants::ITEM_CONTAINER_SIZE) - 2; - RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::constants::ITEM_CONTAINER_SIZE); + RoF2Slot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 2; + RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::legacy::ITEM_CONTAINER_SIZE); } Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoF2Slot.Slot, RoF2Slot.SubIndex, RoF2Slot.AugIndex, RoF2Slot.Unknown01); @@ -6170,7 +6170,7 @@ namespace RoF2 static inline uint32 ServerToRoF2CorpseSlot(uint32 serverCorpseSlot) { - return (serverCorpseSlot - EQEmu::constants::CORPSE_BEGIN + 1); + return (serverCorpseSlot - EQEmu::legacy::CORPSE_BEGIN + 1); } static inline uint32 RoF2ToServerSlot(structs::InventorySlot_Struct rof2Slot, ItemPacketType PacketType) @@ -6180,7 +6180,7 @@ namespace RoF2 if (rof2Slot.Type == inventory::TypePossessions && rof2Slot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 51) if (rof2Slot.Slot == inventory::SlotPowerSource) - TempSlot = SlotPowerSource; + TempSlot = EQEmu::legacy::SlotPowerSource; else if (rof2Slot.Slot >= inventory::SlotCursor) // Cursor and Extended Corpse Inventory TempSlot = rof2Slot.Slot - 3; @@ -6203,16 +6203,16 @@ namespace RoF2 TempSlot = rof2Slot.Slot; if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN) // Bag Slots - TempSlot = ((TempSlot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1; + TempSlot = ((TempSlot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1; ServerSlot = TempSlot; } else if (rof2Slot.Type == inventory::TypeBank) { - TempSlot = EQEmu::constants::BANK_BEGIN; + TempSlot = EQEmu::legacy::BANK_BEGIN; if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN) - TempSlot += ((rof2Slot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1; + TempSlot += ((rof2Slot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1; else TempSlot += rof2Slot.Slot; @@ -6221,10 +6221,10 @@ namespace RoF2 } else if (rof2Slot.Type == inventory::TypeSharedBank) { - TempSlot = EQEmu::constants::SHARED_BANK_BEGIN; + TempSlot = EQEmu::legacy::SHARED_BANK_BEGIN; if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN) - TempSlot += ((rof2Slot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1; + TempSlot += ((rof2Slot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1; else TempSlot += rof2Slot.Slot; @@ -6233,10 +6233,10 @@ namespace RoF2 } else if (rof2Slot.Type == inventory::TypeTrade) { - TempSlot = EQEmu::constants::TRADE_BEGIN; + TempSlot = EQEmu::legacy::TRADE_BEGIN; if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN) - TempSlot += ((rof2Slot.Slot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1; + TempSlot += ((rof2Slot.Slot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1; // OLD CODE: //TempSlot += 100 + (RoF2Slot.MainSlot * EmuConstants::ITEM_CONTAINER_SIZE) + RoF2Slot.SubSlot; @@ -6247,7 +6247,7 @@ namespace RoF2 } else if (rof2Slot.Type == inventory::TypeWorld) { - TempSlot = EQEmu::constants::WORLD_BEGIN; + TempSlot = EQEmu::legacy::WORLD_BEGIN; if (rof2Slot.Slot >= SUB_INDEX_BEGIN) TempSlot += rof2Slot.Slot; @@ -6269,7 +6269,7 @@ namespace RoF2 } else if (rof2Slot.Type == inventory::TypeCorpse) { - ServerSlot = rof2Slot.Slot + EQEmu::constants::CORPSE_BEGIN; + ServerSlot = rof2Slot.Slot + EQEmu::legacy::CORPSE_BEGIN; } Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rof2Slot.Type, rof2Slot.Unknown02, rof2Slot.Slot, rof2Slot.SubIndex, rof2Slot.AugIndex, rof2Slot.Unknown01, ServerSlot); @@ -6284,7 +6284,7 @@ namespace RoF2 if (rof2Slot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 33) if (rof2Slot.Slot == inventory::SlotPowerSource) - TempSlot = SlotPowerSource; + TempSlot = EQEmu::legacy::SlotPowerSource; else if (rof2Slot.Slot >= inventory::SlotCursor) // Cursor and Extended Corpse Inventory TempSlot = rof2Slot.Slot - 3; @@ -6302,7 +6302,7 @@ namespace RoF2 TempSlot = rof2Slot.Slot; if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN) // Bag Slots - TempSlot = ((TempSlot + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1; + TempSlot = ((TempSlot + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + rof2Slot.SubIndex + 1; ServerSlot = TempSlot; } @@ -6314,12 +6314,12 @@ namespace RoF2 static inline uint32 RoF2ToServerCorpseSlot(uint32 rof2CorpseSlot) { - return (rof2CorpseSlot + EQEmu::constants::CORPSE_BEGIN - 1); + return (rof2CorpseSlot + EQEmu::legacy::CORPSE_BEGIN - 1); } static inline void ServerToRoF2TextLink(std::string& rof2TextLink, const std::string& serverTextLink) { - if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) { + if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) { rof2TextLink = serverTextLink; return; } @@ -6328,7 +6328,7 @@ namespace RoF2 for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) { if (segment_iter & 1) { - if (segments[segment_iter].length() <= EQEmu::constants::TEXT_LINK_BODY_LENGTH) { + if (segments[segment_iter].length() <= EQEmu::legacy::TEXT_LINK_BODY_LENGTH) { rof2TextLink.append(segments[segment_iter]); // TODO: log size mismatch error continue; @@ -6351,7 +6351,7 @@ namespace RoF2 static inline void RoF2ToServerTextLink(std::string& serverTextLink, const std::string& rof2TextLink) { - if ((EQEmu::constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (rof2TextLink.find('\x12') == std::string::npos)) { + if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (rof2TextLink.find('\x12') == std::string::npos)) { serverTextLink = rof2TextLink; return; } diff --git a/common/patches/rof2_structs.h b/common/patches/rof2_structs.h index 18ab3c478..0e457a0d1 100644 --- a/common/patches/rof2_structs.h +++ b/common/patches/rof2_structs.h @@ -1084,11 +1084,11 @@ union /*00184*/ EquipStruct equipment[22]; // Total Slots }; /*00624*/ uint32 equip2_count; // Seen 9 -/*00628*/ EquipStruct equipment2[MaterialCount]; // Appears to be Visible slots, but all 0s +/*00628*/ EquipStruct equipment2[EQEmu::legacy::MaterialCount]; // Appears to be Visible slots, but all 0s /*00808*/ uint32 tint_count; // Seen 9 -/*00812*/ Color_Struct item_tint[MaterialCount]; // RR GG BB 00 +/*00812*/ Color_Struct item_tint[EQEmu::legacy::MaterialCount]; // RR GG BB 00 /*00848*/ uint32 tint_count2; // Seen 9 -/*00852*/ Color_Struct item_tint2[MaterialCount]; // RR GG BB 00 +/*00852*/ Color_Struct item_tint2[EQEmu::legacy::MaterialCount]; // RR GG BB 00 /*00888*/ uint8 haircolor; // Player hair color /*00889*/ uint8 beardcolor; // Player beard color /*00890*/ uint32 unknown_rof5; // diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 7b75e5d5d..48b7248ed 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -1614,7 +1614,7 @@ namespace SoD // OUT(unknown06160[4]); // Copy bandoliers where server and client indexes converge - for (r = 0; r < EQEmu::constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) { + for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) { OUT_str(bandoliers[r].Name); for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true OUT(bandoliers[r].Items[k].ID); @@ -1623,7 +1623,7 @@ namespace SoD } } // Nullify bandoliers where server and client indexes diverge, with a client bias - for (r = EQEmu::constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { + for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { eq->bandoliers[r].Name[0] = '\0'; for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true eq->bandoliers[r].Items[k].ID = 0; @@ -1635,13 +1635,13 @@ namespace SoD // OUT(unknown07444[5120]); // Copy potion belt where server and client indexes converge - for (r = 0; r < EQEmu::constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) { OUT(potionbelt.Items[r].ID); OUT(potionbelt.Items[r].Icon); OUT_str(potionbelt.Items[r].Name); } // Nullify potion belt where server and client indexes diverge, with a client bias - for (r = EQEmu::constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) { eq->potionbelt.Items[r].ID = 0; eq->potionbelt.Items[r].Icon = 0; eq->potionbelt.Items[r].Name[0] = '\0'; @@ -1981,7 +1981,7 @@ namespace SoD eq_cse->HairColor = emu_cse->HairColor; eq_cse->Face = emu_cse->Face; - for (int equip_index = 0; equip_index < MaterialCount; equip_index++) { + for (int equip_index = 0; equip_index < EQEmu::legacy::MaterialCount; equip_index++) { eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material; eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1; eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteMaterial; @@ -2779,11 +2779,11 @@ namespace SoD VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialPrimary].Material); + VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[EQEmu::legacy::MaterialPrimary].Material); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialSecondary].Material); + VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[EQEmu::legacy::MaterialSecondary].Material); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); } @@ -3934,7 +3934,7 @@ namespace SoD uint32 SubLengths[10]; - for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; ++x) { + for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::ITEM_CONTAINER_SIZE; ++x) { SubSerializations[x] = nullptr; @@ -3946,15 +3946,15 @@ namespace SoD iqbs.subitem_count++; - if (slot_id_in >= EQEmu::constants::GENERAL_BEGIN && slot_id_in <= EQEmu::constants::GENERAL_END) // (< 30) - no cursor? + if (slot_id_in >= EQEmu::legacy::GENERAL_BEGIN && slot_id_in <= EQEmu::legacy::GENERAL_END) // (< 30) - no cursor? //SubSlotNumber = (((slot_id_in + 3) * 10) + x + 1); - SubSlotNumber = (((slot_id_in + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + x + 1); - else if (slot_id_in >= EQEmu::constants::BANK_BEGIN && slot_id_in <= EQEmu::constants::BANK_END) + SubSlotNumber = (((slot_id_in + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + x + 1); + else if (slot_id_in >= EQEmu::legacy::BANK_BEGIN && slot_id_in <= EQEmu::legacy::BANK_END) //SubSlotNumber = (((slot_id_in - 2000) * 10) + 2030 + x + 1); - SubSlotNumber = (((slot_id_in - EQEmu::constants::BANK_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE) + EQEmu::constants::BANK_BAGS_BEGIN + x); - else if (slot_id_in >= EQEmu::constants::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::constants::SHARED_BANK_END) + SubSlotNumber = (((slot_id_in - EQEmu::legacy::BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + EQEmu::legacy::BANK_BAGS_BEGIN + x); + else if (slot_id_in >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::legacy::SHARED_BANK_END) //SubSlotNumber = (((slot_id_in - 2500) * 10) + 2530 + x + 1); - SubSlotNumber = (((slot_id_in - EQEmu::constants::SHARED_BANK_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE) + EQEmu::constants::SHARED_BANK_BAGS_BEGIN + x); + SubSlotNumber = (((slot_id_in - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + x); else SubSlotNumber = slot_id_in; // ??????? @@ -3993,15 +3993,15 @@ namespace SoD { uint32 SoDSlot = 0; - if (serverSlot >= SlotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots + if (serverSlot >= EQEmu::legacy::SlotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots SoDSlot = serverSlot + 1; - else if (serverSlot >= EQEmu::constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::constants::CURSOR_BAG_END) + else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END) SoDSlot = serverSlot + 11; - else if (serverSlot >= EQEmu::constants::BANK_BAGS_BEGIN && serverSlot <= EQEmu::constants::BANK_BAGS_END) + else if (serverSlot >= EQEmu::legacy::BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::BANK_BAGS_END) SoDSlot = serverSlot + 1; - else if (serverSlot >= EQEmu::constants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::constants::SHARED_BANK_BAGS_END) + else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END) SoDSlot = serverSlot + 1; - else if (serverSlot == SlotPowerSource) + else if (serverSlot == EQEmu::legacy::SlotPowerSource) SoDSlot = inventory::SlotPowerSource; else SoDSlot = serverSlot; @@ -4027,7 +4027,7 @@ namespace SoD else if (sodSlot >= consts::SHARED_BANK_BAGS_BEGIN && sodSlot <= consts::SHARED_BANK_BAGS_END) ServerSlot = sodSlot - 1; else if (sodSlot == inventory::SlotPowerSource) - ServerSlot = SlotPowerSource; + ServerSlot = EQEmu::legacy::SlotPowerSource; else ServerSlot = sodSlot; return ServerSlot; @@ -4041,7 +4041,7 @@ namespace SoD static inline void ServerToSoDTextLink(std::string& sodTextLink, const std::string& serverTextLink) { - if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) { + if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) { sodTextLink = serverTextLink; return; } @@ -4050,7 +4050,7 @@ namespace SoD for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) { if (segment_iter & 1) { - if (segments[segment_iter].length() <= EQEmu::constants::TEXT_LINK_BODY_LENGTH) { + if (segments[segment_iter].length() <= EQEmu::legacy::TEXT_LINK_BODY_LENGTH) { sodTextLink.append(segments[segment_iter]); // TODO: log size mismatch error continue; @@ -4081,7 +4081,7 @@ namespace SoD static inline void SoDToServerTextLink(std::string& serverTextLink, const std::string& sodTextLink) { - if ((EQEmu::constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (sodTextLink.find('\x12') == std::string::npos)) { + if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (sodTextLink.find('\x12') == std::string::npos)) { serverTextLink = sodTextLink; return; } diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 5a49f96a9..ef0220f57 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -1271,7 +1271,7 @@ namespace SoF // OUT(unknown06160[4]); // Copy bandoliers where server and client indexes converge - for (r = 0; r < EQEmu::constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) { + for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) { OUT_str(bandoliers[r].Name); for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true OUT(bandoliers[r].Items[k].ID); @@ -1280,7 +1280,7 @@ namespace SoF } } // Nullify bandoliers where server and client indexes diverge, with a client bias - for (r = EQEmu::constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { + for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { eq->bandoliers[r].Name[0] = '\0'; for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true eq->bandoliers[r].Items[k].ID = 0; @@ -1292,13 +1292,13 @@ namespace SoF // OUT(unknown07444[5120]); // Copy potion belt where server and client indexes converge - for (r = 0; r < EQEmu::constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) { OUT(potionbelt.Items[r].ID); OUT(potionbelt.Items[r].Icon); OUT_str(potionbelt.Items[r].Name); } // Nullify potion belt where server and client indexes diverge, with a client bias - for (r = EQEmu::constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) { eq->potionbelt.Items[r].ID = 0; eq->potionbelt.Items[r].Icon = 0; eq->potionbelt.Items[r].Name[0] = '\0'; @@ -1638,7 +1638,7 @@ namespace SoF eq_cse->HairColor = emu_cse->HairColor; eq_cse->Face = emu_cse->Face; - for (int equip_index = 0; equip_index < MaterialCount; equip_index++) { + for (int equip_index = 0; equip_index < EQEmu::legacy::MaterialCount; equip_index++) { eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material; eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1; eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteMaterial; @@ -3256,7 +3256,7 @@ namespace SoF uint32 SubLengths[10]; - for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; ++x) { + for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::ITEM_CONTAINER_SIZE; ++x) { SubSerializations[x] = nullptr; const ItemInst* subitem = ((const ItemInst*)inst)->GetItem(x); @@ -3267,15 +3267,15 @@ namespace SoF iqbs.subitem_count++; - if (slot_id_in >= EQEmu::constants::GENERAL_BEGIN && slot_id_in <= EQEmu::constants::GENERAL_END) // (< 30) - no cursor? + if (slot_id_in >= EQEmu::legacy::GENERAL_BEGIN && slot_id_in <= EQEmu::legacy::GENERAL_END) // (< 30) - no cursor? //SubSlotNumber = (((slot_id_in + 3) * 10) + x + 1); - SubSlotNumber = (((slot_id_in + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + x + 1); - else if (slot_id_in >= EQEmu::constants::BANK_BEGIN && slot_id_in <= EQEmu::constants::BANK_END) + SubSlotNumber = (((slot_id_in + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + x + 1); + else if (slot_id_in >= EQEmu::legacy::BANK_BEGIN && slot_id_in <= EQEmu::legacy::BANK_END) //SubSlotNumber = (((slot_id_in - 2000) * 10) + 2030 + x + 1); - SubSlotNumber = (((slot_id_in - EQEmu::constants::BANK_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE) + EQEmu::constants::BANK_BAGS_BEGIN + x); - else if (slot_id_in >= EQEmu::constants::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::constants::SHARED_BANK_END) + SubSlotNumber = (((slot_id_in - EQEmu::legacy::BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + EQEmu::legacy::BANK_BAGS_BEGIN + x); + else if (slot_id_in >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::legacy::SHARED_BANK_END) //SubSlotNumber = (((slot_id_in - 2500) * 10) + 2530 + x + 1); - SubSlotNumber = (((slot_id_in - EQEmu::constants::SHARED_BANK_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE) + EQEmu::constants::SHARED_BANK_BAGS_BEGIN + x); + SubSlotNumber = (((slot_id_in - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + x); else SubSlotNumber = slot_id_in; // ??????? @@ -3312,15 +3312,15 @@ namespace SoF { uint32 SoFSlot = 0; - if (serverSlot >= SlotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots + if (serverSlot >= EQEmu::legacy::SlotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots SoFSlot = serverSlot + 1; - else if (serverSlot >= EQEmu::constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::constants::CURSOR_BAG_END) + else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END) SoFSlot = serverSlot + 11; - else if (serverSlot >= EQEmu::constants::BANK_BAGS_BEGIN && serverSlot <= EQEmu::constants::BANK_BAGS_END) + else if (serverSlot >= EQEmu::legacy::BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::BANK_BAGS_END) SoFSlot = serverSlot + 1; - else if (serverSlot >= EQEmu::constants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::constants::SHARED_BANK_BAGS_END) + else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END) SoFSlot = serverSlot + 1; - else if (serverSlot == SlotPowerSource) + else if (serverSlot == EQEmu::legacy::SlotPowerSource) SoFSlot = inventory::SlotPowerSource; else SoFSlot = serverSlot; @@ -3347,7 +3347,7 @@ namespace SoF else if (sofSlot >= consts::SHARED_BANK_BAGS_BEGIN && sofSlot <= consts::SHARED_BANK_BAGS_END) ServerSlot = sofSlot - 1; else if (sofSlot == inventory::SlotPowerSource) - ServerSlot = SlotPowerSource; + ServerSlot = EQEmu::legacy::SlotPowerSource; else ServerSlot = sofSlot; @@ -3362,7 +3362,7 @@ namespace SoF static inline void ServerToSoFTextLink(std::string& sofTextLink, const std::string& serverTextLink) { - if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) { + if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) { sofTextLink = serverTextLink; return; } @@ -3371,7 +3371,7 @@ namespace SoF for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) { if (segment_iter & 1) { - if (segments[segment_iter].length() <= EQEmu::constants::TEXT_LINK_BODY_LENGTH) { + if (segments[segment_iter].length() <= EQEmu::legacy::TEXT_LINK_BODY_LENGTH) { sofTextLink.append(segments[segment_iter]); // TODO: log size mismatch error continue; @@ -3402,7 +3402,7 @@ namespace SoF static inline void SoFToServerTextLink(std::string& serverTextLink, const std::string& sofTextLink) { - if ((EQEmu::constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (sofTextLink.find('\x12') == std::string::npos)) { + if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (sofTextLink.find('\x12') == std::string::npos)) { serverTextLink = sofTextLink; return; } diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index 5afbcb0d6..cb291150c 100644 --- a/common/patches/titanium.cpp +++ b/common/patches/titanium.cpp @@ -943,7 +943,7 @@ namespace Titanium // OUT(unknown06160[4]); // Copy bandoliers where server and client indexes converge - for (r = 0; r < EQEmu::constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) { + for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) { OUT_str(bandoliers[r].Name); for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true OUT(bandoliers[r].Items[k].ID); @@ -952,7 +952,7 @@ namespace Titanium } } // Nullify bandoliers where server and client indexes diverge, with a client bias - for (r = EQEmu::constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { + for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { eq->bandoliers[r].Name[0] = '\0'; for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true eq->bandoliers[r].Items[k].ID = 0; @@ -964,13 +964,13 @@ namespace Titanium // OUT(unknown07444[5120]); // Copy potion belt where server and client indexes converge - for (r = 0; r < EQEmu::constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) { OUT(potionbelt.Items[r].ID); OUT(potionbelt.Items[r].Icon); OUT_str(potionbelt.Items[r].Name); } // Nullify potion belt where server and client indexes diverge, with a client bias - for (r = EQEmu::constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) { eq->potionbelt.Items[r].ID = 0; eq->potionbelt.Items[r].Icon = 0; eq->potionbelt.Items[r].Name[0] = '\0'; @@ -1199,14 +1199,14 @@ namespace Titanium if (eq->Race[char_index] > 473) eq->Race[char_index] = 1; - for (int index = 0; index < MaterialCount; ++index) { + for (int index = 0; index < EQEmu::legacy::MaterialCount; ++index) { eq->CS_Colors[char_index][index].Color = emu_cse->Equip[index].Color.Color; } eq->BeardColor[char_index] = emu_cse->BeardColor; eq->HairStyle[char_index] = emu_cse->HairStyle; - for (int index = 0; index < MaterialCount; ++index) { + for (int index = 0; index < EQEmu::legacy::MaterialCount; ++index) { eq->Equip[char_index][index] = emu_cse->Equip[index].Material; } @@ -1236,14 +1236,14 @@ namespace Titanium for (; char_index < 10; ++char_index) { eq->Race[char_index] = 0; - for (int index = 0; index < MaterialCount; ++index) { + for (int index = 0; index < EQEmu::legacy::MaterialCount; ++index) { eq->CS_Colors[char_index][index].Color = 0; } eq->BeardColor[char_index] = 0; eq->HairStyle[char_index] = 0; - for (int index = 0; index < MaterialCount; ++index) { + for (int index = 0; index < EQEmu::legacy::MaterialCount; ++index) { eq->Equip[char_index][index] = 0; } @@ -2198,7 +2198,7 @@ namespace Titanium static inline void ServerToTitaniumTextLink(std::string& titaniumTextLink, const std::string& serverTextLink) { - if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) { + if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) { titaniumTextLink = serverTextLink; return; } @@ -2207,7 +2207,7 @@ namespace Titanium for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) { if (segment_iter & 1) { - if (segments[segment_iter].length() <= EQEmu::constants::TEXT_LINK_BODY_LENGTH) { + if (segments[segment_iter].length() <= EQEmu::legacy::TEXT_LINK_BODY_LENGTH) { titaniumTextLink.append(segments[segment_iter]); // TODO: log size mismatch error continue; @@ -2238,7 +2238,7 @@ namespace Titanium static inline void TitaniumToServerTextLink(std::string& serverTextLink, const std::string& titaniumTextLink) { - if ((EQEmu::constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (titaniumTextLink.find('\x12') == std::string::npos)) { + if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (titaniumTextLink.find('\x12') == std::string::npos)) { serverTextLink = titaniumTextLink; return; } diff --git a/common/patches/uf.cpp b/common/patches/uf.cpp index ff51b2e7d..28ff1d541 100644 --- a/common/patches/uf.cpp +++ b/common/patches/uf.cpp @@ -1878,7 +1878,7 @@ namespace UF // OUT(unknown06160[4]); // Copy bandoliers where server and client indexes converge - for (r = 0; r < EQEmu::constants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) { + for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) { OUT_str(bandoliers[r].Name); for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true OUT(bandoliers[r].Items[k].ID); @@ -1887,7 +1887,7 @@ namespace UF } } // Nullify bandoliers where server and client indexes diverge, with a client bias - for (r = EQEmu::constants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { + for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { eq->bandoliers[r].Name[0] = '\0'; for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true eq->bandoliers[r].Items[k].ID = 0; @@ -1899,13 +1899,13 @@ namespace UF // OUT(unknown07444[5120]); // Copy potion belt where server and client indexes converge - for (r = 0; r < EQEmu::constants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) { OUT(potionbelt.Items[r].ID); OUT(potionbelt.Items[r].Icon); OUT_str(potionbelt.Items[r].Name); } // Nullify potion belt where server and client indexes diverge, with a client bias - for (r = EQEmu::constants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) { eq->potionbelt.Items[r].ID = 0; eq->potionbelt.Items[r].Icon = 0; eq->potionbelt.Items[r].Name[0] = '\0'; @@ -2274,7 +2274,7 @@ namespace UF eq_cse->HairColor = emu_cse->HairColor; eq_cse->Face = emu_cse->Face; - for (int equip_index = 0; equip_index < MaterialCount; equip_index++) { + for (int equip_index = 0; equip_index < EQEmu::legacy::MaterialCount; equip_index++) { eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material; eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1; eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteMaterial; @@ -3053,19 +3053,19 @@ namespace UF VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); - if (emu->equipment[MaterialPrimary].Material > 99999) { + if (emu->equipment[EQEmu::legacy::MaterialPrimary].Material > 99999) { VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 63); } else { - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialPrimary].Material); + VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[EQEmu::legacy::MaterialPrimary].Material); } VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); - if (emu->equipment[MaterialSecondary].Material > 99999) { + if (emu->equipment[EQEmu::legacy::MaterialSecondary].Material > 99999) { VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 63); } else { - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialSecondary].Material); + VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[EQEmu::legacy::MaterialSecondary].Material); } VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); @@ -4263,7 +4263,7 @@ namespace UF uint32 SubLengths[10]; - for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; ++x) { + for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::ITEM_CONTAINER_SIZE; ++x) { SubSerializations[x] = nullptr; @@ -4275,15 +4275,15 @@ namespace UF iqbs.subitem_count++; - if (slot_id_in >= EQEmu::constants::GENERAL_BEGIN && slot_id_in <= EQEmu::constants::GENERAL_END) // (< 30) - no cursor? + if (slot_id_in >= EQEmu::legacy::GENERAL_BEGIN && slot_id_in <= EQEmu::legacy::GENERAL_END) // (< 30) - no cursor? //SubSlotNumber = (((slot_id_in + 3) * 10) + x + 1); - SubSlotNumber = (((slot_id_in + 3) * EQEmu::constants::ITEM_CONTAINER_SIZE) + x + 1); - else if (slot_id_in >= EQEmu::constants::BANK_BEGIN && slot_id_in <= EQEmu::constants::BANK_END) + SubSlotNumber = (((slot_id_in + 3) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + x + 1); + else if (slot_id_in >= EQEmu::legacy::BANK_BEGIN && slot_id_in <= EQEmu::legacy::BANK_END) //SubSlotNumber = (((slot_id_in - 2000) * 10) + 2030 + x + 1); - SubSlotNumber = (((slot_id_in - EQEmu::constants::BANK_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE) + EQEmu::constants::BANK_BAGS_BEGIN + x); - else if (slot_id_in >= EQEmu::constants::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::constants::SHARED_BANK_END) + SubSlotNumber = (((slot_id_in - EQEmu::legacy::BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + EQEmu::legacy::BANK_BAGS_BEGIN + x); + else if (slot_id_in >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id_in <= EQEmu::legacy::SHARED_BANK_END) //SubSlotNumber = (((slot_id_in - 2500) * 10) + 2530 + x + 1); - SubSlotNumber = (((slot_id_in - EQEmu::constants::SHARED_BANK_BEGIN) * EQEmu::constants::ITEM_CONTAINER_SIZE) + EQEmu::constants::SHARED_BANK_BAGS_BEGIN + x); + SubSlotNumber = (((slot_id_in - EQEmu::legacy::SHARED_BANK_BEGIN) * EQEmu::legacy::ITEM_CONTAINER_SIZE) + EQEmu::legacy::SHARED_BANK_BAGS_BEGIN + x); else SubSlotNumber = slot_id_in; // ??????? @@ -4322,15 +4322,15 @@ namespace UF { uint32 UnderfootSlot = 0; - if (serverSlot >= SlotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots + if (serverSlot >= EQEmu::legacy::SlotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots UnderfootSlot = serverSlot + 1; - else if (serverSlot >= EQEmu::constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::constants::CURSOR_BAG_END) + else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END) UnderfootSlot = serverSlot + 11; - else if (serverSlot >= EQEmu::constants::BANK_BAGS_BEGIN && serverSlot <= EQEmu::constants::BANK_BAGS_END) + else if (serverSlot >= EQEmu::legacy::BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::BANK_BAGS_END) UnderfootSlot = serverSlot + 1; - else if (serverSlot >= EQEmu::constants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::constants::SHARED_BANK_BAGS_END) + else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END) UnderfootSlot = serverSlot + 1; - else if (serverSlot == SlotPowerSource) + else if (serverSlot == EQEmu::legacy::SlotPowerSource) UnderfootSlot = inventory::SlotPowerSource; else UnderfootSlot = serverSlot; @@ -4357,7 +4357,7 @@ namespace UF else if (ufSlot >= consts::SHARED_BANK_BAGS_BEGIN && ufSlot <= consts::SHARED_BANK_BAGS_END) ServerSlot = ufSlot - 1; else if (ufSlot == inventory::SlotPowerSource) - ServerSlot = SlotPowerSource; + ServerSlot = EQEmu::legacy::SlotPowerSource; else ServerSlot = ufSlot; @@ -4372,7 +4372,7 @@ namespace UF static inline void ServerToUFTextLink(std::string& ufTextLink, const std::string& serverTextLink) { - if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::constants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) { + if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) { ufTextLink = serverTextLink; return; } @@ -4381,7 +4381,7 @@ namespace UF for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) { if (segment_iter & 1) { - if (segments[segment_iter].length() <= EQEmu::constants::TEXT_LINK_BODY_LENGTH) { + if (segments[segment_iter].length() <= EQEmu::legacy::TEXT_LINK_BODY_LENGTH) { ufTextLink.append(segments[segment_iter]); // TODO: log size mismatch error continue; @@ -4412,7 +4412,7 @@ namespace UF static inline void UFToServerTextLink(std::string& serverTextLink, const std::string& ufTextLink) { - if ((EQEmu::constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (ufTextLink.find('\x12') == std::string::npos)) { + if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (ufTextLink.find('\x12') == std::string::npos)) { serverTextLink = ufTextLink; return; } diff --git a/common/say_link.cpp b/common/say_link.cpp index 0f9fefaa5..1cfe2635a 100644 --- a/common/say_link.cpp +++ b/common/say_link.cpp @@ -39,7 +39,7 @@ std::string EQEmu::saylink::SayLinkEngine::GenerateLink() generate_body(); generate_text(); - if ((m_LinkBody.length() == EQEmu::constants::TEXT_LINK_BODY_LENGTH) && (m_LinkText.length() > 0)) { + if ((m_LinkBody.length() == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) && (m_LinkText.length() > 0)) { m_Link.push_back(0x12); m_Link.append(m_LinkBody); m_Link.append(m_LinkText); @@ -231,7 +231,7 @@ void EQEmu::saylink::SayLinkEngine::generate_text() bool EQEmu::saylink::DegenerateLinkBody(SayLinkBody_Struct& say_link_body_struct, const std::string& say_link_body) { memset(&say_link_body_struct, 0, sizeof(say_link_body_struct)); - if (say_link_body.length() != EQEmu::constants::TEXT_LINK_BODY_LENGTH) + if (say_link_body.length() != EQEmu::legacy::TEXT_LINK_BODY_LENGTH) return false; say_link_body_struct.unknown_1 = (uint8)strtol(say_link_body.substr(0, 1).c_str(), nullptr, 16); @@ -270,7 +270,7 @@ bool EQEmu::saylink::GenerateLinkBody(std::string& say_link_body, const SayLinkB (0xFFFFFFFF & say_link_body_struct.hash) ); - if (say_link_body.length() != EQEmu::constants::TEXT_LINK_BODY_LENGTH) + if (say_link_body.length() != EQEmu::legacy::TEXT_LINK_BODY_LENGTH) return false; return true; diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 16f8096b8..ddf7b383f 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -104,8 +104,8 @@ bool SharedDatabase::SaveCursor(uint32 char_id, std::list::const_iter std::string query = StringFormat("DELETE FROM inventory WHERE charid = %i " "AND ((slotid >= 8000 AND slotid <= 8999) " "OR slotid = %i OR (slotid >= %i AND slotid <= %i) )", - char_id, SlotCursor, - EQEmu::constants::CURSOR_BAG_BEGIN, EQEmu::constants::CURSOR_BAG_END); + char_id, EQEmu::legacy::SlotCursor, + EQEmu::legacy::CURSOR_BAG_BEGIN, EQEmu::legacy::CURSOR_BAG_END); auto results = QueryDatabase(query); if (!results.Success()) { std::cout << "Clearing cursor failed: " << results.ErrorMessage() << std::endl; @@ -116,7 +116,7 @@ bool SharedDatabase::SaveCursor(uint32 char_id, std::list::const_iter for(auto it = start; it != end; ++it, i++) { if (i > 8999) { break; } // shouldn't be anything in the queue that indexes this high ItemInst *inst = *it; - int16 use_slot = (i == 8000) ? SlotCursor : i; + int16 use_slot = (i == 8000) ? EQEmu::legacy::SlotCursor : i; if (!SaveInventory(char_id, inst, use_slot)) { return false; } @@ -161,10 +161,10 @@ bool SharedDatabase::VerifyInventory(uint32 account_id, int16 slot_id, const Ite bool SharedDatabase::SaveInventory(uint32 char_id, const ItemInst* inst, int16 slot_id) { //never save tribute slots: - if (slot_id >= EQEmu::constants::TRIBUTE_BEGIN && slot_id <= EQEmu::constants::TRIBUTE_END) + if (slot_id >= EQEmu::legacy::TRIBUTE_BEGIN && slot_id <= EQEmu::legacy::TRIBUTE_END) return true; - if (slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && slot_id <= EQEmu::constants::SHARED_BANK_BAGS_END) { + if (slot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && slot_id <= EQEmu::legacy::SHARED_BANK_BAGS_END) { // Shared bank inventory if (!inst) { return DeleteSharedBankSlot(char_id, slot_id); @@ -191,9 +191,9 @@ bool SharedDatabase::SaveInventory(uint32 char_id, const ItemInst* inst, int16 s bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, int16 slot_id) { // need to check 'inst' argument for valid pointer - uint32 augslot[EQEmu::constants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; + uint32 augslot[EQEmu::legacy::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; if (inst->IsType(ItemClassCommon)) { - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) { + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) { ItemInst *auginst = inst->GetItem(i); augslot[i] = (auginst && auginst->GetItem()) ? auginst->GetItem()->ID : NO_ITEM; } @@ -223,7 +223,7 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i if (inst->IsType(ItemClassContainer) && Inventory::SupportsContainers(slot_id)) // Limiting to bag slot count will get rid of 'hidden' duplicated items and 'Invalid Slot ID' // messages through attrition (and the modded code in SaveInventory) - for (uint8 idx = SUB_INDEX_BEGIN; idx < inst->GetItem()->BagSlots && idx < EQEmu::constants::ITEM_CONTAINER_SIZE; idx++) { + for (uint8 idx = SUB_INDEX_BEGIN; idx < inst->GetItem()->BagSlots && idx < EQEmu::legacy::ITEM_CONTAINER_SIZE; idx++) { const ItemInst* baginst = inst->GetItem(idx); SaveInventory(char_id, baginst, Inventory::CalcSlotId(slot_id, idx)); } @@ -238,9 +238,9 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst, int16 slot_id) { // need to check 'inst' argument for valid pointer - uint32 augslot[EQEmu::constants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; + uint32 augslot[EQEmu::legacy::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; if (inst->IsType(ItemClassCommon)) { - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) { + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) { ItemInst *auginst = inst->GetItem(i); augslot[i] = (auginst && auginst->GetItem()) ? auginst->GetItem()->ID : NO_ITEM; } @@ -269,7 +269,7 @@ bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst, if (inst->IsType(ItemClassContainer) && Inventory::SupportsContainers(slot_id)) { // Limiting to bag slot count will get rid of 'hidden' duplicated items and 'Invalid Slot ID' // messages through attrition (and the modded code in SaveInventory) - for (uint8 idx = SUB_INDEX_BEGIN; idx < inst->GetItem()->BagSlots && idx < EQEmu::constants::ITEM_CONTAINER_SIZE; idx++) { + for (uint8 idx = SUB_INDEX_BEGIN; idx < inst->GetItem()->BagSlots && idx < EQEmu::legacy::ITEM_CONTAINER_SIZE; idx++) { const ItemInst* baginst = inst->GetItem(idx); SaveInventory(char_id, baginst, Inventory::CalcSlotId(slot_id, idx)); } @@ -427,7 +427,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory *inv, bool is_charid) uint32 item_id = (uint32)atoi(row[1]); int8 charges = (int8)atoi(row[2]); - uint32 aug[EQEmu::constants::ITEM_COMMON_SIZE]; + uint32 aug[EQEmu::legacy::ITEM_COMMON_SIZE]; aug[0] = (uint32)atoi(row[3]); aug[1] = (uint32)atoi(row[4]); aug[2] = (uint32)atoi(row[5]); @@ -448,7 +448,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory *inv, bool is_charid) ItemInst *inst = CreateBaseItem(item, charges); if (inst && item->ItemClass == ItemClassCommon) { - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) { + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) { if (aug[i]) inst->PutAugment(this, i, aug[i]); } @@ -522,7 +522,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory *inv) uint16 charges = atoi(row[2]); uint32 color = atoul(row[3]); - uint32 aug[EQEmu::constants::ITEM_COMMON_SIZE]; + uint32 aug[EQEmu::legacy::ITEM_COMMON_SIZE]; aug[0] = (uint32)atoul(row[4]); aug[1] = (uint32)atoul(row[5]); @@ -584,8 +584,8 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory *inv) inst->SetOrnamentHeroModel(ornament_hero_model); if (instnodrop || - (((slot_id >= EQEmu::constants::EQUIPMENT_BEGIN && slot_id <= EQEmu::constants::EQUIPMENT_END) || - slot_id == SlotPowerSource) && + (((slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN && slot_id <= EQEmu::legacy::EQUIPMENT_END) || + slot_id == EQEmu::legacy::SlotPowerSource) && inst->GetItem()->Attuneable)) inst->SetAttuned(true); @@ -608,7 +608,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory *inv) } if (item->ItemClass == ItemClassCommon) { - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) { + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) { if (aug[i]) inst->PutAugment(this, i, aug[i]); } @@ -665,7 +665,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, Inventory *inv) int8 charges = atoi(row[2]); uint32 color = atoul(row[3]); - uint32 aug[EQEmu::constants::ITEM_COMMON_SIZE]; + uint32 aug[EQEmu::legacy::ITEM_COMMON_SIZE]; aug[0] = (uint32)atoi(row[4]); aug[1] = (uint32)atoi(row[5]); aug[2] = (uint32)atoi(row[6]); @@ -726,7 +726,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, Inventory *inv) inst->SetCharges(charges); if (item->ItemClass == ItemClassCommon) { - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) { + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) { if (aug[i]) inst->PutAugment(this, i, aug[i]); } diff --git a/world/worlddb.cpp b/world/worlddb.cpp index aed60e245..346f3a2e6 100644 --- a/world/worlddb.cpp +++ b/world/worlddb.cpp @@ -117,7 +117,7 @@ void WorldDatabase::GetCharSelectInfo(uint32 accountID, EQApplicationPacket **ou cse->Gender = (uint8)atoi(row[2]); cse->Face = (uint8)atoi(row[15]); - for (uint32 matslot = 0; matslot < MaterialCount; matslot++) { // Processed below + for (uint32 matslot = 0; matslot < EQEmu::legacy::MaterialCount; matslot++) { // Processed below cse->Equip[matslot].Material = 0; cse->Equip[matslot].Unknown1 = 0; cse->Equip[matslot].EliteMaterial = 0; @@ -223,7 +223,7 @@ void WorldDatabase::GetCharSelectInfo(uint32 accountID, EQApplicationPacket **ou const ItemInst* inst = nullptr; int16 invslot = 0; - for (uint32 matslot = 0; matslot < MaterialCount; matslot++) { + for (uint32 matslot = 0; matslot < EQEmu::legacy::MaterialCount; matslot++) { invslot = Inventory::CalcSlotFromMaterial(matslot); if (invslot == INVALID_INDEX) { continue; } inst = inv.GetItem(invslot); @@ -244,7 +244,7 @@ void WorldDatabase::GetCharSelectInfo(uint32 accountID, EQApplicationPacket **ou cse->Equip[matslot].Material = idfile; } } - if (matslot == MaterialPrimary) { + if (matslot == EQEmu::legacy::MaterialPrimary) { cse->PrimaryIDFile = idfile; } else { diff --git a/zone/aa.cpp b/zone/aa.cpp index 26c168276..210e88cd2 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -418,7 +418,7 @@ void Mob::WakeTheDead(uint16 spell_id, Mob *target, uint32 duration) //gear stuff, need to make sure there's //no situation where this stuff can be duped - for (int x = EQEmu::constants::EQUIPMENT_BEGIN; x <= EQEmu::constants::EQUIPMENT_END; x++) // (< 21) added MainAmmo + for (int x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::EQUIPMENT_END; x++) // (< 21) added MainAmmo { uint32 sitem = 0; sitem = CorpseToUse->GetWornItem(x); diff --git a/zone/attack.cpp b/zone/attack.cpp index 7df1c1ed5..d605a0da6 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -166,7 +166,7 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w } // If we're attacking with the secondary hand, play the dual wield anim - if (Hand == SlotSecondary) // DW anim + if (Hand == EQEmu::legacy::SlotSecondary) // DW anim type = animDualWield; DoAnim(type); @@ -415,7 +415,7 @@ bool Mob::AvoidDamage(Mob *other, int32 &damage, int hand) // riposte -- it may seem crazy, but if the attacker has SPA 173 on them, they are immune to Ripo bool ImmuneRipo = attacker->aabonuses.RiposteChance || attacker->spellbonuses.RiposteChance || attacker->itembonuses.RiposteChance; // Need to check if we have something in MainHand to actually attack with (or fists) - if (hand != SlotRange && CanThisClassRiposte() && InFront && !ImmuneRipo) { + if (hand != EQEmu::legacy::SlotRange && CanThisClassRiposte() && InFront && !ImmuneRipo) { if (IsClient()) CastToClient()->CheckIncreaseSkill(SkillRiposte, other, -10); // check auto discs ... I guess aa/items too :P @@ -432,7 +432,7 @@ bool Mob::AvoidDamage(Mob *other, int32 &damage, int hand) chance -= chance * counter; } // AA Slippery Attacks - if (hand == SlotSecondary) { + if (hand == EQEmu::legacy::SlotSecondary) { int slip = aabonuses.OffhandRiposteFail + itembonuses.OffhandRiposteFail + spellbonuses.OffhandRiposteFail; chance += chance * slip / 100; } @@ -477,7 +477,7 @@ bool Mob::AvoidDamage(Mob *other, int32 &damage, int hand) } // parry - if (CanThisClassParry() && InFront && hand != SlotRange) { + if (CanThisClassParry() && InFront && hand != EQEmu::legacy::SlotRange) { if (IsClient()) CastToClient()->CheckIncreaseSkill(SkillParry, other, -10); // check auto discs ... I guess aa/items too :P @@ -964,7 +964,7 @@ int Mob::GetWeaponDamage(Mob *against, const ItemInst *weapon_item, uint32 *hate } else { bool MagicGloves = false; if (IsClient()) { - const ItemInst *gloves = CastToClient()->GetInv().GetItem(SlotHands); + const ItemInst *gloves = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotHands); if (gloves) MagicGloves = gloves->GetItemMagical(true); } @@ -1073,12 +1073,12 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b return false; // Rogean: How can you attack while feigned? Moved up from Aggro Code. ItemInst* weapon; - if (Hand == SlotSecondary){ // Kaiyodo - Pick weapon from the attacking hand - weapon = GetInv().GetItem(SlotSecondary); + if (Hand == EQEmu::legacy::SlotSecondary){ // Kaiyodo - Pick weapon from the attacking hand + weapon = GetInv().GetItem(EQEmu::legacy::SlotSecondary); OffHandAtk(true); } else{ - weapon = GetInv().GetItem(SlotPrimary); + weapon = GetInv().GetItem(EQEmu::legacy::SlotPrimary); OffHandAtk(false); } @@ -1146,7 +1146,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b int ucDamageBonus = 0; - if( Hand == SlotPrimary && GetLevel() >= 28 && IsWarriorClass() ) + if (Hand == EQEmu::legacy::SlotPrimary && GetLevel() >= 28 && IsWarriorClass()) { // 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. @@ -1159,7 +1159,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b } #endif //Live AA - Sinister Strikes *Adds weapon damage bonus to offhand weapon. - if (Hand == SlotSecondary) { + if (Hand == EQEmu::legacy::SlotSecondary) { if (aabonuses.SecondaryDmgInc || itembonuses.SecondaryDmgInc || spellbonuses.SecondaryDmgInc){ ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const Item_Struct*) nullptr, true ); @@ -1621,28 +1621,28 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool FaceTarget(GetTarget()); SkillUseTypes skillinuse = SkillHandtoHand; - if (Hand == SlotPrimary) { + if (Hand == EQEmu::legacy::SlotPrimary) { skillinuse = static_cast(GetPrimSkill()); OffHandAtk(false); } - if (Hand == SlotSecondary) { + if (Hand == EQEmu::legacy::SlotSecondary) { skillinuse = static_cast(GetSecSkill()); OffHandAtk(true); } //figure out what weapon they are using, if any const Item_Struct* weapon = nullptr; - if (Hand == SlotPrimary && equipment[SlotPrimary] > 0) - weapon = database.GetItem(equipment[SlotPrimary]); - else if (equipment[SlotSecondary]) - weapon = database.GetItem(equipment[SlotSecondary]); + if (Hand == EQEmu::legacy::SlotPrimary && equipment[EQEmu::legacy::SlotPrimary] > 0) + weapon = database.GetItem(equipment[EQEmu::legacy::SlotPrimary]); + else if (equipment[EQEmu::legacy::SlotSecondary]) + weapon = database.GetItem(equipment[EQEmu::legacy::SlotSecondary]); //We dont factor much from the weapon into the attack. //Just the skill type so it doesn't look silly using punching animations and stuff while wielding weapons if(weapon) { Log.Out(Logs::Detail, Logs::Combat, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID); - if(Hand == SlotSecondary && weapon->ItemType == ItemTypeShield){ + if (Hand == EQEmu::legacy::SlotSecondary && weapon->ItemType == ItemTypeShield){ Log.Out(Logs::Detail, Logs::Combat, "Attack with shield canceled."); return false; } @@ -3532,7 +3532,7 @@ void Mob::TryDefensiveProc(Mob *on, uint16 hand) { float ProcChance, ProcBonus; on->GetDefensiveProcChances(ProcBonus, ProcChance, hand , this); - if(hand != SlotPrimary) + if (hand != EQEmu::legacy::SlotPrimary) ProcChance /= 2; int level_penalty = 0; @@ -3605,7 +3605,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on ProcBonus += static_cast(itembonuses.ProcChance) / 10.0f; // Combat Effects float ProcChance = GetProcChances(ProcBonus, hand); - if (hand != SlotPrimary) //Is Archery intened to proc at 50% rate? + if (hand != EQEmu::legacy::SlotPrimary) //Is Archery intened to proc at 50% rate? ProcChance /= 2; // Try innate proc on weapon @@ -3642,7 +3642,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on proced = false; if (!proced && inst) { - for (int r = 0; r < EQEmu::constants::ITEM_COMMON_SIZE; r++) { + for (int r = 0; r < EQEmu::legacy::ITEM_COMMON_SIZE; r++) { const ItemInst *aug_i = inst->GetAugment(r); if (!aug_i) // no aug, try next slot! continue; @@ -3683,11 +3683,11 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, float ProcChance = 0.0f; ProcChance = GetProcChances(ProcBonus, hand); - if (hand != SlotPrimary) //Is Archery intened to proc at 50% rate? + if (hand != EQEmu::legacy::SlotPrimary) //Is Archery intened to proc at 50% rate? ProcChance /= 2; bool rangedattk = false; - if (weapon && hand == SlotRange) { + if (weapon && hand == EQEmu::legacy::SlotRange) { if (weapon->ItemType == ItemTypeArrow || weapon->ItemType == ItemTypeLargeThrowing || weapon->ItemType == ItemTypeSmallThrowing || @@ -3695,11 +3695,11 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, rangedattk = true; } - if (!weapon && hand == SlotRange && GetSpecialAbility(SPECATK_RANGED_ATK)) + if (!weapon && hand == EQEmu::legacy::SlotRange && GetSpecialAbility(SPECATK_RANGED_ATK)) rangedattk = true; for (uint32 i = 0; i < MAX_PROCS; i++) { - if (IsPet() && hand != SlotPrimary) //Pets can only proc spell procs from their primay hand (ie; beastlord pets) + if (IsPet() && hand != EQEmu::legacy::SlotPrimary) //Pets can only proc spell procs from their primay hand (ie; beastlord pets) continue; // If pets ever can proc from off hand, this will need to change // Not ranged @@ -3762,7 +3762,7 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, } } - if (HasSkillProcs() && hand != SlotRange){ //We check ranged skill procs within the attack functions. + if (HasSkillProcs() && hand != EQEmu::legacy::SlotRange){ //We check ranged skill procs within the attack functions. uint16 skillinuse = 28; if (weapon) skillinuse = GetSkillByItemType(weapon->ItemType); @@ -4010,7 +4010,7 @@ void Mob::DoRiposte(Mob *defender) if (!defender) return; - defender->Attack(this, SlotPrimary, true); + defender->Attack(this, EQEmu::legacy::SlotPrimary, true); if (HasDied()) return; @@ -4021,7 +4021,7 @@ void Mob::DoRiposte(Mob *defender) if (DoubleRipChance && zone->random.Roll(DoubleRipChance)) { Log.Out(Logs::Detail, Logs::Combat, "Preforming a double riposted from SE_DoubleRiposte (%d percent chance)", DoubleRipChance); - defender->Attack(this, SlotPrimary, true); + defender->Attack(this, EQEmu::legacy::SlotPrimary, true); if (HasDied()) return; } @@ -4034,7 +4034,7 @@ void Mob::DoRiposte(Mob *defender) Log.Out(Logs::Detail, Logs::Combat, "Preforming a double riposted from SE_GiveDoubleRiposte base1 == 0 (%d percent chance)", DoubleRipChance); - defender->Attack(this, SlotPrimary, true); + defender->Attack(this, EQEmu::legacy::SlotPrimary, true); if (HasDied()) return; } @@ -4312,7 +4312,7 @@ float Mob::GetSkillProcChances(uint16 ReuseTime, uint16 hand) { if (!ReuseTime && hand) { weapon_speed = GetWeaponSpeedbyHand(hand); ProcChance = static_cast(weapon_speed) * (RuleR(Combat, AvgProcsPerMinute) / 60000.0f); - if (hand != SlotPrimary) + if (hand != EQEmu::legacy::SlotPrimary) ProcChance /= 2; } @@ -4515,13 +4515,13 @@ void Client::SetAttackTimer() Timer *TimerToUse = nullptr; - for (int i = SlotRange; i <= SlotSecondary; i++) { + for (int i = EQEmu::legacy::SlotRange; i <= EQEmu::legacy::SlotSecondary; i++) { //pick a timer - if (i == SlotPrimary) + if (i == EQEmu::legacy::SlotPrimary) TimerToUse = &attack_timer; - else if (i == SlotRange) + else if (i == EQEmu::legacy::SlotRange) TimerToUse = &ranged_timer; - else if (i == SlotSecondary) + else if (i == EQEmu::legacy::SlotSecondary) TimerToUse = &attack_dw_timer; else //invalid slot (hands will always hit this) continue; @@ -4534,7 +4534,7 @@ void Client::SetAttackTimer() ItemToUse = ci->GetItem(); //special offhand stuff - if (i == SlotSecondary) { + if (i == EQEmu::legacy::SlotSecondary) { //if we cant dual wield, skip it if (!CanThisClassDualWield() || HasTwoHanderEquipped()) { attack_dw_timer.Disable(); @@ -4608,19 +4608,19 @@ void NPC::SetAttackTimer() else speed = static_cast(((attack_delay / haste_mod) + ((hhe / 100.0f) * attack_delay)) * 100); - for (int i = SlotRange; i <= SlotSecondary; i++) { + for (int i = EQEmu::legacy::SlotRange; i <= EQEmu::legacy::SlotSecondary; i++) { //pick a timer - if (i == SlotPrimary) + if (i == EQEmu::legacy::SlotPrimary) TimerToUse = &attack_timer; - else if (i == SlotRange) + else if (i == EQEmu::legacy::SlotRange) TimerToUse = &ranged_timer; - else if (i == SlotSecondary) + else if (i == EQEmu::legacy::SlotSecondary) TimerToUse = &attack_dw_timer; else //invalid slot (hands will always hit this) continue; //special offhand stuff - if (i == SlotSecondary) { + if (i == EQEmu::legacy::SlotSecondary) { // SPECATK_QUAD is uncheesable if(!CanThisClassDualWield() || (HasTwoHanderEquipped() && !GetSpecialAbility(SPECATK_QUAD))) { attack_dw_timer.Disable(); @@ -4642,7 +4642,7 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell) bool candouble = CanThisClassDoubleAttack(); // extra off hand non-sense, can only double with skill of 150 or above // or you have any amount of GiveDoubleAttack - if (candouble && hand == SlotSecondary) + if (candouble && hand == EQEmu::legacy::SlotSecondary) candouble = GetSkill(SkillDoubleAttack) > 149 || (aabonuses.GiveDoubleAttack + spellbonuses.GiveDoubleAttack + itembonuses.GiveDoubleAttack) > 0; if (candouble) { @@ -4650,7 +4650,7 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell) if (CheckDoubleAttack()) { Attack(target, hand, false, false, IsFromSpell); // you can only triple from the main hand - if (hand == SlotPrimary && CanThisClassTripleAttack()) { + if (hand == EQEmu::legacy::SlotPrimary && CanThisClassTripleAttack()) { CheckIncreaseSkill(SkillTripleAttack, target, -10); if (CheckTripleAttack()) Attack(target, hand, false, false, IsFromSpell); @@ -4658,7 +4658,7 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell) } } - if (hand == SlotPrimary) { + if (hand == EQEmu::legacy::SlotPrimary) { // According to http://www.monkly-business.net/forums/showpost.php?p=312095&postcount=168 a dev told them flurry isn't dependant on triple attack // the parses kind of back that up and all of my parses seemed to be 4 or 5 attacks in the round which would work out to be // doubles or triples with 2 from flurries or triple with 1 or 2 flurries ... Going with the "dev quote" I guess like we've always had it @@ -4711,9 +4711,9 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts, int spec if (RuleB(Combat, UseLiveCombatRounds)) { // A "quad" on live really is just a successful dual wield where both double attack // The mobs that could triple lost the ability to when the triple attack skill was added in - Attack(target, SlotPrimary, false, false, false, opts, special); + Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special); if (CanThisClassDoubleAttack() && CheckDoubleAttack()){ - Attack(target, SlotPrimary, false, false, false, opts, special); + Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special); if ((IsPet() || IsTempPet()) && IsPetOwnerClient()){ int chance = spellbonuses.PC_Pet_Flurry + itembonuses.PC_Pet_Flurry + aabonuses.PC_Pet_Flurry; @@ -4727,14 +4727,14 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts, int spec if (IsNPC()) { int16 n_atk = CastToNPC()->GetNumberOfAttacks(); if (n_atk <= 1) { - Attack(target, SlotPrimary, false, false, false, opts, special); + Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special); } else { for (int i = 0; i < n_atk; ++i) { - Attack(target, SlotPrimary, false, false, false, opts, special); + Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special); } } } else { - Attack(target, SlotPrimary, false, false, false, opts, special); + Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special); } // we use this random value in three comparisons with different @@ -4745,15 +4745,15 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts, int spec // check double attack, this is NOT the same rules that clients use... && RandRoll < (GetLevel() + NPCDualAttackModifier)) { - Attack(target, SlotPrimary, false, false, false, opts, special); + Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special); // lets see if we can do a triple attack with the main hand // pets are excluded from triple and quads... if ((GetSpecialAbility(SPECATK_TRIPLE) || GetSpecialAbility(SPECATK_QUAD)) && !IsPet() && RandRoll < (GetLevel() + NPCTripleAttackModifier)) { - Attack(target, SlotPrimary, false, false, false, opts, special); + Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special); // now lets check the quad attack if (GetSpecialAbility(SPECATK_QUAD) && RandRoll < (GetLevel() + NPCQuadAttackModifier)) { - Attack(target, SlotPrimary, false, false, false, opts, special); + Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts, special); } } } @@ -4767,11 +4767,11 @@ void Mob::DoOffHandAttackRounds(Mob *target, ExtraAttackOptions *opts, int speci // For now, SPECATK_QUAD means innate DW when Combat:UseLiveCombatRounds is true if ((GetSpecialAbility(SPECATK_INNATE_DW) || (RuleB(Combat, UseLiveCombatRounds) && GetSpecialAbility(SPECATK_QUAD))) || - GetEquipment(MaterialSecondary) != 0) { + GetEquipment(EQEmu::legacy::MaterialSecondary) != 0) { if (CheckDualWield()) { - Attack(target, SlotSecondary, false, false, false, opts, special); + Attack(target, EQEmu::legacy::SlotSecondary, false, false, false, opts, special); if (CanThisClassDoubleAttack() && GetLevel() > 35 && CheckDoubleAttack()){ - Attack(target, SlotSecondary, false, false, false, opts, special); + Attack(target, EQEmu::legacy::SlotSecondary, false, false, false, opts, special); if ((IsPet() || IsTempPet()) && IsPetOwnerClient()){ int chance = spellbonuses.PC_Pet_Flurry + itembonuses.PC_Pet_Flurry + aabonuses.PC_Pet_Flurry; diff --git a/zone/beacon.h b/zone/beacon.h index ed59ee7c9..bc09dae4b 100644 --- a/zone/beacon.h +++ b/zone/beacon.h @@ -36,7 +36,7 @@ public: //abstract virtual function implementations requird by base abstract class virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill) { return true; } virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0) { return; } - virtual bool Attack(Mob* other, int Hand = SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false, + virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0) { return false; } virtual bool HasRaid() { return false; } virtual bool HasGroup() { return false; } diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index 3239b514e..899cee359 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -145,34 +145,35 @@ void Client::CalcItemBonuses(StatBonuses* newbon) { unsigned int i; // Update: MainAmmo should only calc skill mods (TODO: Check for other cases) - for (i = SlotCharm; i <= SlotAmmo; i++) { + for (i = EQEmu::legacy::SlotCharm; i <= EQEmu::legacy::SlotAmmo; i++) { const ItemInst* inst = m_inv[i]; if(inst == 0) continue; - AddItemBonuses(inst, newbon, false, false, 0, (i == SlotAmmo)); + 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 Item_Struct *item = inst->GetItem(); - if (i == SlotSecondary && (item && item->ItemType == ItemTypeShield)) + if (i == EQEmu::legacy::SlotSecondary && (item && item->ItemType == ItemTypeShield)) SetShieldEquiped(true); - else if (i == SlotPrimary && (item && item->ItemType == ItemType2HBlunt)) { + else if (i == EQEmu::legacy::SlotPrimary && (item && item->ItemType == ItemType2HBlunt)) { SetTwoHandBluntEquiped(true); SetTwoHanderEquipped(true); - } else if (i == SlotPrimary && (item && (item->ItemType == ItemType2HSlash || item->ItemType == ItemType2HPiercing))) + } + else if (i == EQEmu::legacy::SlotPrimary && (item && (item->ItemType == ItemType2HSlash || item->ItemType == ItemType2HPiercing))) SetTwoHanderEquipped(true); } //Power Source Slot if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) { - const ItemInst* inst = m_inv[SlotPowerSource]; + const ItemInst* inst = m_inv[EQEmu::legacy::SlotPowerSource]; if(inst) AddItemBonuses(inst, newbon); } //tribute items - for (i = 0; i < EQEmu::constants::TRIBUTE_SIZE; i++) { - const ItemInst* inst = m_inv[EQEmu::constants::TRIBUTE_BEGIN + i]; + for (i = 0; i < EQEmu::legacy::TRIBUTE_SIZE; i++) { + const ItemInst* inst = m_inv[EQEmu::legacy::TRIBUTE_BEGIN + i]; if(inst == 0) continue; AddItemBonuses(inst, newbon, false, true); @@ -180,7 +181,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) != ET_WornEffect){ - for (i = SlotCharm; i < SlotAmmo; i++) { + for (i = EQEmu::legacy::SlotCharm; i < EQEmu::legacy::SlotAmmo; i++) { const ItemInst* inst = m_inv[i]; if(inst == 0) continue; @@ -526,7 +527,7 @@ void Client::AddItemBonuses(const ItemInst *inst, StatBonuses *newbon, bool isAu } if (!isAug) { - for (int i = 0; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) + for (int i = 0; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) AddItemBonuses(inst->GetAugment(i), newbon, true, false, rec_level, ammo_slot_item); } } @@ -564,7 +565,7 @@ void Client::AdditiveWornBonuses(const ItemInst *inst, StatBonuses* newbon, bool if (!isAug) { int i; - for (i = 0; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) { + for (i = 0; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) { AdditiveWornBonuses(inst->GetAugment(i),newbon,true); } } @@ -575,7 +576,7 @@ void Client::CalcEdibleBonuses(StatBonuses* newbon) { bool food = false; bool drink = false; - for (i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_BAGS_BEGIN; i++) + for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_BAGS_BEGIN; i++) { if (food && drink) break; @@ -591,7 +592,7 @@ void Client::CalcEdibleBonuses(StatBonuses* newbon) { AddItemBonuses(inst, newbon); } } - for (i = EQEmu::constants::GENERAL_BAGS_BEGIN; i <= EQEmu::constants::GENERAL_BAGS_END; i++) + for (i = EQEmu::legacy::GENERAL_BAGS_BEGIN; i <= EQEmu::legacy::GENERAL_BAGS_END; i++) { if (food && drink) break; @@ -3200,7 +3201,7 @@ void NPC::CalcItemBonuses(StatBonuses *newbon) { if(newbon){ - for (int i = 0; i < EQEmu::constants::EQUIPMENT_SIZE; i++){ + for (int i = 0; i < EQEmu::legacy::EQUIPMENT_SIZE; i++){ const Item_Struct *cur = database.GetItem(equipment[i]); if(cur){ //basic stats @@ -3278,24 +3279,24 @@ void Client::CalcItemScale() { bool changed = false; // MainAmmo excluded in helper function below - if (CalcItemScale(EQEmu::constants::EQUIPMENT_BEGIN, EQEmu::constants::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21) + if (CalcItemScale(EQEmu::legacy::EQUIPMENT_BEGIN, EQEmu::legacy::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21) changed = true; - if (CalcItemScale(EQEmu::constants::GENERAL_BEGIN, EQEmu::constants::GENERAL_END)) // original coding excluded MainCursor (< 30) + if (CalcItemScale(EQEmu::legacy::GENERAL_BEGIN, EQEmu::legacy::GENERAL_END)) // original coding excluded MainCursor (< 30) changed = true; // I excluded cursor bag slots here because cursor was excluded above..if this is incorrect, change 'slot_y' here to CURSOR_BAG_END // and 'slot_y' above to CURSOR from GENERAL_END above - or however it is supposed to be... - if (CalcItemScale(EQEmu::constants::GENERAL_BAGS_BEGIN, EQEmu::constants::GENERAL_BAGS_END)) // (< 341) + if (CalcItemScale(EQEmu::legacy::GENERAL_BAGS_BEGIN, EQEmu::legacy::GENERAL_BAGS_END)) // (< 341) changed = true; - if (CalcItemScale(EQEmu::constants::TRIBUTE_BEGIN, EQEmu::constants::TRIBUTE_END)) // (< 405) + if (CalcItemScale(EQEmu::legacy::TRIBUTE_BEGIN, EQEmu::legacy::TRIBUTE_END)) // (< 405) changed = true; //Power Source Slot if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) { - if(CalcItemScale(SlotPowerSource, SlotPowerSource)) + if (CalcItemScale(EQEmu::legacy::SlotPowerSource, EQEmu::legacy::SlotPowerSource)) changed = true; } @@ -3310,7 +3311,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) { bool changed = false; uint32 i; for (i = slot_x; i <= slot_y; i++) { - if (i == SlotAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot + 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); @@ -3320,7 +3321,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::constants::GENERAL_BAGS_BEGIN && i <= EQEmu::constants::GENERAL_BAGS_END) { + if (i >= EQEmu::legacy::GENERAL_BAGS_BEGIN && i <= EQEmu::legacy::GENERAL_BAGS_END) { ItemInst* parent_item = m_inv.GetItem(Inventory::CalcSlotId(i)); if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel continue; @@ -3340,7 +3341,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) { } //iterate all augments - 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) @@ -3372,24 +3373,24 @@ void Client::DoItemEnterZone() { bool changed = false; // MainAmmo excluded in helper function below - if (DoItemEnterZone(EQEmu::constants::EQUIPMENT_BEGIN, EQEmu::constants::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21) + if (DoItemEnterZone(EQEmu::legacy::EQUIPMENT_BEGIN, EQEmu::legacy::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21) changed = true; - if (DoItemEnterZone(EQEmu::constants::GENERAL_BEGIN, EQEmu::constants::GENERAL_END)) // original coding excluded MainCursor (< 30) + if (DoItemEnterZone(EQEmu::legacy::GENERAL_BEGIN, EQEmu::legacy::GENERAL_END)) // original coding excluded MainCursor (< 30) changed = true; // I excluded cursor bag slots here because cursor was excluded above..if this is incorrect, change 'slot_y' here to CURSOR_BAG_END // and 'slot_y' above to CURSOR from GENERAL_END above - or however it is supposed to be... - if (DoItemEnterZone(EQEmu::constants::GENERAL_BAGS_BEGIN, EQEmu::constants::GENERAL_BAGS_END)) // (< 341) + if (DoItemEnterZone(EQEmu::legacy::GENERAL_BAGS_BEGIN, EQEmu::legacy::GENERAL_BAGS_END)) // (< 341) changed = true; - if (DoItemEnterZone(EQEmu::constants::TRIBUTE_BEGIN, EQEmu::constants::TRIBUTE_END)) // (< 405) + if (DoItemEnterZone(EQEmu::legacy::TRIBUTE_BEGIN, EQEmu::legacy::TRIBUTE_END)) // (< 405) changed = true; //Power Source Slot if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) { - if(DoItemEnterZone(SlotPowerSource, SlotPowerSource)) + if (DoItemEnterZone(EQEmu::legacy::SlotPowerSource, EQEmu::legacy::SlotPowerSource)) changed = true; } @@ -3403,7 +3404,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) { // behavior change: 'slot_y' is now [RANGE]_END and not [RANGE]_END + 1 bool changed = false; for(uint32 i = slot_x; i <= slot_y; i++) { - if (i == SlotAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot + 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); @@ -3413,7 +3414,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::constants::GENERAL_BAGS_BEGIN && i <= EQEmu::constants::GENERAL_BAGS_END) { + if (i >= EQEmu::legacy::GENERAL_BAGS_BEGIN && i <= EQEmu::legacy::GENERAL_BAGS_END) { ItemInst* parent_item = m_inv.GetItem(Inventory::CalcSlotId(i)); if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel continue; @@ -3425,7 +3426,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) { uint16 oldexp = inst->GetExp(); parse->EventItem(EVENT_ITEM_ENTER_ZONE, this, inst, nullptr, "", 0); - if(i <= SlotAmmo || i == SlotPowerSource) { + if (i <= EQEmu::legacy::SlotAmmo || i == EQEmu::legacy::SlotPowerSource) { parse->EventItem(EVENT_EQUIP_ITEM, this, inst, nullptr, "", i); } @@ -3435,7 +3436,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) { update_slot = true; } } else { - if(i <= SlotAmmo || i == SlotPowerSource) { + if (i <= EQEmu::legacy::SlotAmmo || i == EQEmu::legacy::SlotPowerSource) { parse->EventItem(EVENT_EQUIP_ITEM, this, inst, nullptr, "", i); } @@ -3443,7 +3444,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) { } //iterate all augments - 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) diff --git a/zone/bot.cpp b/zone/bot.cpp index 7494dd185..862054037 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -229,8 +229,8 @@ void Bot::SetBotSpellID(uint32 newSpellID) { } uint32 Bot::GetBotArcheryRange() { - const ItemInst *range_inst = GetBotItem(SlotRange); - const ItemInst *ammo_inst = GetBotItem(SlotAmmo); + const ItemInst *range_inst = GetBotItem(EQEmu::legacy::SlotRange); + const ItemInst *ammo_inst = GetBotItem(EQEmu::legacy::SlotAmmo); if (!range_inst || !ammo_inst) return 0; @@ -246,15 +246,15 @@ uint32 Bot::GetBotArcheryRange() { void Bot::ChangeBotArcherWeapons(bool isArcher) { if((GetClass()==WARRIOR) || (GetClass()==PALADIN) || (GetClass()==RANGER) || (GetClass()==SHADOWKNIGHT) || (GetClass()==ROGUE)) { if(!isArcher) { - BotAddEquipItem(SlotPrimary, GetBotItemBySlot(SlotPrimary)); - BotAddEquipItem(SlotSecondary, GetBotItemBySlot(SlotSecondary)); + BotAddEquipItem(EQEmu::legacy::SlotPrimary, GetBotItemBySlot(EQEmu::legacy::SlotPrimary)); + BotAddEquipItem(EQEmu::legacy::SlotSecondary, GetBotItemBySlot(EQEmu::legacy::SlotSecondary)); SetAttackTimer(); BotGroupSay(this, "My blade is ready"); } else { - BotRemoveEquipItem(SlotPrimary); - BotRemoveEquipItem(SlotSecondary); - BotAddEquipItem(SlotAmmo, GetBotItemBySlot(SlotAmmo)); - BotAddEquipItem(SlotSecondary, GetBotItemBySlot(SlotRange)); + BotRemoveEquipItem(EQEmu::legacy::SlotPrimary); + BotRemoveEquipItem(EQEmu::legacy::SlotSecondary); + BotAddEquipItem(EQEmu::legacy::SlotAmmo, GetBotItemBySlot(EQEmu::legacy::SlotAmmo)); + BotAddEquipItem(EQEmu::legacy::SlotSecondary, GetBotItemBySlot(EQEmu::legacy::SlotRange)); SetAttackTimer(); BotGroupSay(this, "My bow is true and ready"); } @@ -1175,11 +1175,11 @@ void Bot::GenerateArmorClass() { uint16 Bot::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) { case ItemType1HSlash: { skill = Skill1HSlashing; @@ -1722,8 +1722,8 @@ bool Bot::LoadPet() if (!botdb.LoadPetBuffs(GetBotID(), pet_buffs)) bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::LoadPetBuffs(), GetCleanName()); - uint32 pet_items[EQEmu::constants::EQUIPMENT_SIZE]; - memset(pet_items, 0, (sizeof(uint32) * EQEmu::constants::EQUIPMENT_SIZE)); + uint32 pet_items[EQEmu::legacy::EQUIPMENT_SIZE]; + memset(pet_items, 0, (sizeof(uint32) * EQEmu::legacy::EQUIPMENT_SIZE)); if (!botdb.LoadPetItems(GetBotID(), pet_items)) bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::LoadPetItems(), GetCleanName()); @@ -1750,11 +1750,11 @@ bool Bot::SavePet() char* pet_name = new char[64]; SpellBuff_Struct pet_buffs[BUFF_COUNT]; - uint32 pet_items[EQEmu::constants::EQUIPMENT_SIZE]; + uint32 pet_items[EQEmu::legacy::EQUIPMENT_SIZE]; memset(pet_name, 0, 64); memset(pet_buffs, 0, (sizeof(SpellBuff_Struct) * BUFF_COUNT)); - memset(pet_items, 0, (sizeof(uint32) * EQEmu::constants::EQUIPMENT_SIZE)); + memset(pet_items, 0, (sizeof(uint32) * EQEmu::legacy::EQUIPMENT_SIZE)); pet_inst->GetPetState(pet_buffs, pet_items, pet_name); @@ -1906,12 +1906,12 @@ void Bot::BotRangedAttack(Mob* other) { return; } - ItemInst* rangedItem = GetBotItem(SlotRange); + ItemInst* rangedItem = GetBotItem(EQEmu::legacy::SlotRange); const Item_Struct* RangeWeapon = 0; if(rangedItem) RangeWeapon = rangedItem->GetItem(); - ItemInst* ammoItem = GetBotItem(SlotAmmo); + ItemInst* ammoItem = GetBotItem(EQEmu::legacy::SlotAmmo); const Item_Struct* Ammo = 0; if(ammoItem) Ammo = ammoItem->GetItem(); @@ -2008,7 +2008,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes int damage = 0; uint32 hate = 0; - int Hand = SlotPrimary; + int Hand = EQEmu::legacy::SlotPrimary; if (hate == 0 && weapon_damage > 1) hate = weapon_damage; @@ -2037,7 +2037,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes else damage = zone->random.Int(min_hit, max_hit); - if (other->AvoidDamage(this, damage, CanRiposte ? SlotRange : SlotPrimary)) { // MainRange excludes ripo, primary doesn't have any extra behavior + if (other->AvoidDamage(this, damage, CanRiposte ? EQEmu::legacy::SlotRange : EQEmu::legacy::SlotPrimary)) { // MainRange excludes ripo, primary doesn't have any extra behavior if (damage == -3) { DoRiposte(other); if (HasDied()) @@ -2062,7 +2062,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes damage = -5; if(skillinuse == SkillBash){ - const ItemInst* inst = GetBotItem(SlotSecondary); + const ItemInst* inst = GetBotItem(EQEmu::legacy::SlotSecondary); const Item_Struct* botweapon = 0; if(inst) botweapon = inst->GetItem(); @@ -2109,19 +2109,19 @@ void Bot::ApplySpecialAttackMod(SkillUseTypes skill, int32 &dmg, int32 &mindmg) case SkillFlyingKick: case SkillRoundKick: case SkillKick: - item_slot = SlotFeet; + item_slot = EQEmu::legacy::SlotFeet; break; case SkillBash: - item_slot = SlotSecondary; + item_slot = EQEmu::legacy::SlotSecondary; break; case SkillDragonPunch: case SkillEagleStrike: case SkillTigerClaw: - item_slot = SlotHands; + item_slot = EQEmu::legacy::SlotHands; break; } - if (item_slot >= EQEmu::constants::EQUIPMENT_BEGIN){ + if (item_slot >= EQEmu::legacy::EQUIPMENT_BEGIN){ const ItemInst* inst = GetBotItem(item_slot); const Item_Struct* botweapon = 0; if(inst) @@ -2455,23 +2455,23 @@ void Bot::AI_Process() { // First, special attack per class (kick, backstab etc..) DoClassAttacks(GetTarget()); if(attack_timer.Check()) { - Attack(GetTarget(), SlotPrimary); - TriggerDefensiveProcs(GetTarget(), SlotPrimary, false); - ItemInst *wpn = GetBotItem(SlotPrimary); - TryWeaponProc(wpn, GetTarget(), SlotPrimary); + Attack(GetTarget(), EQEmu::legacy::SlotPrimary); + TriggerDefensiveProcs(GetTarget(), EQEmu::legacy::SlotPrimary, false); + ItemInst *wpn = GetBotItem(EQEmu::legacy::SlotPrimary); + TryWeaponProc(wpn, GetTarget(), EQEmu::legacy::SlotPrimary); bool tripleSuccess = false; if(BotOwner && GetTarget() && CanThisClassDoubleAttack()) { if(BotOwner && CheckBotDoubleAttack()) - Attack(GetTarget(), SlotPrimary, true); + Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true); if(BotOwner && GetTarget() && GetSpecialAbility(SPECATK_TRIPLE) && CheckBotDoubleAttack(true)) { tripleSuccess = true; - Attack(GetTarget(), SlotPrimary, true); + Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true); } //quad attack, does this belong here?? if(BotOwner && GetTarget() && GetSpecialAbility(SPECATK_QUAD) && CheckBotDoubleAttack(true)) - Attack(GetTarget(), SlotPrimary, true); + Attack(GetTarget(), EQEmu::legacy::SlotPrimary, true); } //Live AA - Flurry, Rapid Strikes ect (Flurry does not require Triple Attack). @@ -2479,18 +2479,18 @@ void Bot::AI_Process() { if (GetTarget() && flurrychance) { if(zone->random.Int(0, 100) < 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); } } int32 ExtraAttackChanceBonus = (spellbonuses.ExtraAttackChance + itembonuses.ExtraAttackChance + aabonuses.ExtraAttackChance); if (GetTarget() && ExtraAttackChanceBonus) { - ItemInst *wpn = GetBotItem(SlotPrimary); + ItemInst *wpn = GetBotItem(EQEmu::legacy::SlotPrimary); if(wpn) { if(wpn->GetItem()->ItemType == ItemType2HSlash || wpn->GetItem()->ItemType == ItemType2HBlunt || wpn->GetItem()->ItemType == ItemType2HPiercing) { if(zone->random.Int(0, 100) < ExtraAttackChanceBonus) - Attack(GetTarget(), SlotPrimary, false); + Attack(GetTarget(), EQEmu::legacy::SlotPrimary, false); } } } @@ -2510,7 +2510,7 @@ void Bot::AI_Process() { //now off hand if(GetTarget() && attack_dw_timer.Check() && CanThisClassDualWield()) { - const ItemInst* instweapon = GetBotItem(SlotSecondary); + const ItemInst* instweapon = GetBotItem(EQEmu::legacy::SlotSecondary); const Item_Struct* weapon = 0; //can only dual wield without a weapon if you're a monk if(instweapon || (botClass == MONK)) { @@ -2532,12 +2532,12 @@ void Bot::AI_Process() { DualWieldProbability += (DualWieldProbability * float(DWBonus) / 100.0f); float random = zone->random.Real(0, 1); if (random < DualWieldProbability){ // Max 78% of DW - Attack(GetTarget(), SlotSecondary); // Single attack with offhand - ItemInst *wpn = GetBotItem(SlotSecondary); - TryWeaponProc(wpn, GetTarget(), SlotSecondary); + Attack(GetTarget(), EQEmu::legacy::SlotSecondary); // Single attack with offhand + ItemInst *wpn = GetBotItem(EQEmu::legacy::SlotSecondary); + TryWeaponProc(wpn, GetTarget(), EQEmu::legacy::SlotSecondary); if( CanThisClassDoubleAttack() && CheckBotDoubleAttack()) { if(GetTarget() && GetTarget()->GetHP() > -10) - Attack(GetTarget(), SlotSecondary); // Single attack with offhand + Attack(GetTarget(), EQEmu::legacy::SlotSecondary); // Single attack with offhand } } } @@ -2708,12 +2708,12 @@ void Bot::PetAIProcess() { if(!botPet->BehindMob(botPet->GetTarget(), botPet->GetX(), botPet->GetY()) && botPet->GetTarget()->IsEnraged()) return; - if(botPet->Attack(GetTarget(), SlotPrimary)) // try the main hand + if (botPet->Attack(GetTarget(), EQEmu::legacy::SlotPrimary)) // try the main hand if (botPet->GetTarget()) { // We're a pet so we re able to dual attack int32 RandRoll = zone->random.Int(0, 99); if (botPet->CanThisClassDoubleAttack() && (RandRoll < (botPet->GetLevel() + NPCDualAttackModifier))) { - if(botPet->Attack(botPet->GetTarget(), SlotPrimary)) {} + if (botPet->Attack(botPet->GetTarget(), EQEmu::legacy::SlotPrimary)) {} } } @@ -2751,11 +2751,11 @@ void Bot::PetAIProcess() { float DualWieldProbability = ((botPet->GetSkill(SkillDualWield) + botPet->GetLevel()) / 400.0f); DualWieldProbability -= zone->random.Real(0, 1); if(DualWieldProbability < 0) { - botPet->Attack(botPet->GetTarget(), SlotSecondary); + botPet->Attack(botPet->GetTarget(), EQEmu::legacy::SlotSecondary); if (botPet->CanThisClassDoubleAttack()) { int32 RandRoll = zone->random.Int(0, 99); if (RandRoll < (botPet->GetLevel() + 20)) - botPet->Attack(botPet->GetTarget(), SlotSecondary); + botPet->Attack(botPet->GetTarget(), EQEmu::legacy::SlotSecondary); } } } @@ -2878,7 +2878,7 @@ void Bot::Spawn(Client* botCharacterOwner) { // I re-enabled this until I can sort it out uint32 itemID = 0; uint8 materialFromSlot = 0xFF; - for (int i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::EQUIPMENT_END; ++i) { + for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) { itemID = GetBotItemBySlot(i); if(itemID != 0) { materialFromSlot = Inventory::CalcMaterialFromSlot(i); @@ -2962,7 +2962,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) { const ItemInst* inst = 0; uint32 spawnedbotid = 0; spawnedbotid = this->GetBotID(); - for (int i = 0; i < MaterialPrimary; i++) { + for (int i = 0; i < EQEmu::legacy::MaterialPrimary; i++) { inst = GetBotItem(i); if (inst) { item = inst->GetItem(); @@ -2981,25 +2981,25 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) { } } - inst = GetBotItem(SlotPrimary); + inst = GetBotItem(EQEmu::legacy::SlotPrimary); if(inst) { item = inst->GetItem(); if(item) { if(strlen(item->IDFile) > 2) - ns->spawn.equipment[MaterialPrimary].Material = atoi(&item->IDFile[2]); + ns->spawn.equipment[EQEmu::legacy::MaterialPrimary].Material = atoi(&item->IDFile[2]); - ns->spawn.colors[MaterialPrimary].Color = GetEquipmentColor(MaterialPrimary); + ns->spawn.colors[EQEmu::legacy::MaterialPrimary].Color = GetEquipmentColor(EQEmu::legacy::MaterialPrimary); } } - inst = GetBotItem(SlotSecondary); + inst = GetBotItem(EQEmu::legacy::SlotSecondary); if(inst) { item = inst->GetItem(); if(item) { if(strlen(item->IDFile) > 2) - ns->spawn.equipment[MaterialSecondary].Material = atoi(&item->IDFile[2]); + ns->spawn.equipment[EQEmu::legacy::MaterialSecondary].Material = atoi(&item->IDFile[2]); - ns->spawn.colors[MaterialSecondary].Color = GetEquipmentColor(MaterialSecondary); + ns->spawn.colors[EQEmu::legacy::MaterialSecondary].Color = GetEquipmentColor(EQEmu::legacy::MaterialSecondary); } } } @@ -3243,7 +3243,7 @@ void Bot::BotAddEquipItem(int slot, uint32 id) { if(slot > 0 && id > 0) { uint8 materialFromSlot = Inventory::CalcMaterialFromSlot(slot); - if(materialFromSlot != MaterialInvalid) { + if (materialFromSlot != EQEmu::legacy::MaterialInvalid) { equipment[slot] = id; // npc has more than just material slots. Valid material should mean valid inventory index SendWearChange(materialFromSlot); } @@ -3259,11 +3259,11 @@ void Bot::BotRemoveEquipItem(int slot) { if(slot > 0) { uint8 materialFromSlot = Inventory::CalcMaterialFromSlot(slot); - if(materialFromSlot != MaterialInvalid) { + if (materialFromSlot != EQEmu::legacy::MaterialInvalid) { equipment[slot] = 0; // npc has more than just material slots. Valid material should mean valid inventory index SendWearChange(materialFromSlot); - if(materialFromSlot == MaterialChest) - SendWearChange(MaterialArms); + if (materialFromSlot == EQEmu::legacy::MaterialChest) + SendWearChange(EQEmu::legacy::MaterialArms); } UpdateEquipmentLight(); @@ -3361,12 +3361,12 @@ void Bot::FinishTrade(Client* client, BotTradeType tradeType) { if(tradeType == BotTradeClientNormal) { // Items being traded are found in the normal trade window used to trade between a Client and a Client or NPC // Items in this mode are found in slot ids 3000 thru 3003 - thought bots used the full 8-slot window..? - PerformTradeWithClient(EQEmu::constants::TRADE_BEGIN, EQEmu::constants::TRADE_END, client); // {3000..3007} + PerformTradeWithClient(EQEmu::legacy::TRADE_BEGIN, EQEmu::legacy::TRADE_END, client); // {3000..3007} } else if(tradeType == BotTradeClientNoDropNoTrade) { // Items being traded are found on the Client's cursor slot, slot id 30. This item can be either a single item or it can be a bag. // If it is a bag, then we have to search for items in slots 331 thru 340 - PerformTradeWithClient(SlotCursor, SlotCursor, client); + PerformTradeWithClient(EQEmu::legacy::SlotCursor, EQEmu::legacy::SlotCursor, client); // TODO: Add logic here to test if the item in SLOT_CURSOR is a container type, if it is then we need to call the following: // PerformTradeWithClient(331, 340, client); @@ -3378,7 +3378,7 @@ void Bot::FinishTrade(Client* client, BotTradeType tradeType) { void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* client) { if(client) { // TODO: Figure out what the actual max slot id is - const int MAX_SLOT_ID = EQEmu::constants::TRADE_BAGS_END; // was the old incorrect 3179.. + const int MAX_SLOT_ID = EQEmu::legacy::TRADE_BAGS_END; // was the old incorrect 3179.. uint32 items[MAX_SLOT_ID] = {0}; uint8 charges[MAX_SLOT_ID] = {0}; bool botCanWear[MAX_SLOT_ID] = {0}; @@ -3395,7 +3395,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli charges[i] = inst->GetCharges(); } - if (i == SlotCursor) + if (i == EQEmu::legacy::SlotCursor) UpdateClient = true; //EQoffline: will give the items to the bots and change the bot stats @@ -3403,7 +3403,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli std::string TempErrorMessage; const Item_Struct* mWeaponItem = inst->GetItem(); bool failedLoreCheck = false; - for (int m = AUG_INDEX_BEGIN; m < EQEmu::constants::ITEM_COMMON_SIZE; ++m) { + for (int m = AUG_INDEX_BEGIN; m < EQEmu::legacy::ITEM_COMMON_SIZE; ++m) { ItemInst *itm = inst->GetAugment(m); if(itm) { @@ -3423,29 +3423,29 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli botCanWear[i] = BotCanWear; ItemInst* swap_item = nullptr; - const char* equipped[EQEmu::constants::EQUIPMENT_SIZE + 1] = { "Charm", "Left Ear", "Head", "Face", "Right Ear", "Neck", "Shoulders", "Arms", "Back", + const char* equipped[EQEmu::legacy::EQUIPMENT_SIZE + 1] = { "Charm", "Left Ear", "Head", "Face", "Right Ear", "Neck", "Shoulders", "Arms", "Back", "Left Wrist", "Right Wrist", "Range", "Hands", "Primary Hand", "Secondary Hand", "Left Finger", "Right Finger", "Chest", "Legs", "Feet", "Waist", "Ammo", "Powersource" }; bool success = false; int how_many_slots = 0; - for (int j = EQEmu::constants::EQUIPMENT_BEGIN; j <= (EQEmu::constants::EQUIPMENT_END + 1); ++j) { + for (int j = EQEmu::legacy::EQUIPMENT_BEGIN; j <= (EQEmu::legacy::EQUIPMENT_END + 1); ++j) { if((mWeaponItem->Slots & (1 << j))) { if (j == 22) j = 9999; how_many_slots++; if(!GetBotItem(j)) { - if(j == SlotPrimary) { + if (j == EQEmu::legacy::SlotPrimary) { if((mWeaponItem->ItemType == ItemType2HSlash) || (mWeaponItem->ItemType == ItemType2HBlunt) || (mWeaponItem->ItemType == ItemType2HPiercing)) { - if(GetBotItem(SlotSecondary)) { + if (GetBotItem(EQEmu::legacy::SlotSecondary)) { if(mWeaponItem && (mWeaponItem->ItemType == ItemType2HSlash) || (mWeaponItem->ItemType == ItemType2HBlunt) || (mWeaponItem->ItemType == ItemType2HPiercing)) { - if(client->CheckLoreConflict(GetBotItem(SlotSecondary)->GetItem())) { + if (client->CheckLoreConflict(GetBotItem(EQEmu::legacy::SlotSecondary)->GetItem())) { failedLoreCheck = true; } } else { - ItemInst* remove_item = GetBotItem(SlotSecondary); - BotTradeSwapItem(client, SlotSecondary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false); + ItemInst* remove_item = GetBotItem(EQEmu::legacy::SlotSecondary); + BotTradeSwapItem(client, EQEmu::legacy::SlotSecondary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false); } } } @@ -3455,7 +3455,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli } break; } - else if(j == SlotSecondary) { + else if (j == EQEmu::legacy::SlotSecondary) { if(inst->IsWeapon()) { if(CanThisClassDualWield()) { BotTradeAddItem(mWeaponItem->ID, inst, inst->GetCharges(), mWeaponItem->Slots, j, &TempErrorMessage); @@ -3471,10 +3471,10 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli success = true; } if(success) { - if(GetBotItem(SlotPrimary)) { - ItemInst* remove_item = GetBotItem(SlotPrimary); + if (GetBotItem(EQEmu::legacy::SlotPrimary)) { + ItemInst* remove_item = GetBotItem(EQEmu::legacy::SlotPrimary); if((remove_item->GetItem()->ItemType == ItemType2HSlash) || (remove_item->GetItem()->ItemType == ItemType2HBlunt) || (remove_item->GetItem()->ItemType == ItemType2HPiercing)) { - BotTradeSwapItem(client, SlotPrimary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false); + BotTradeSwapItem(client, EQEmu::legacy::SlotPrimary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false); } } break; @@ -3489,14 +3489,14 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli } } if(!success) { - for (int j = EQEmu::constants::EQUIPMENT_BEGIN; j <= (EQEmu::constants::EQUIPMENT_END + 1); ++j) { + for (int j = EQEmu::legacy::EQUIPMENT_BEGIN; j <= (EQEmu::legacy::EQUIPMENT_END + 1); ++j) { if((mWeaponItem->Slots & (1 << j))) { if (j == 22) j = 9999; swap_item = GetBotItem(j); failedLoreCheck = false; - for (int k = AUG_INDEX_BEGIN; k < EQEmu::constants::ITEM_COMMON_SIZE; ++k) { + for (int k = AUG_INDEX_BEGIN; k < EQEmu::legacy::ITEM_COMMON_SIZE; ++k) { ItemInst *itm = swap_item->GetAugment(k); if(itm) { @@ -3509,28 +3509,28 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli failedLoreCheck = true; } if(!failedLoreCheck) { - if(j == SlotPrimary) { + if (j == EQEmu::legacy::SlotPrimary) { if((mWeaponItem->ItemType == ItemType2HSlash) || (mWeaponItem->ItemType == ItemType2HBlunt) || (mWeaponItem->ItemType == ItemType2HPiercing)) { - if(GetBotItem(SlotSecondary)) { - if(client->CheckLoreConflict(GetBotItem(SlotSecondary)->GetItem())) { + if (GetBotItem(EQEmu::legacy::SlotSecondary)) { + if (client->CheckLoreConflict(GetBotItem(EQEmu::legacy::SlotSecondary)->GetItem())) { failedLoreCheck = true; } else { - ItemInst* remove_item = GetBotItem(SlotSecondary); - BotTradeSwapItem(client, SlotSecondary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false); + ItemInst* remove_item = GetBotItem(EQEmu::legacy::SlotSecondary); + BotTradeSwapItem(client, EQEmu::legacy::SlotSecondary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false); } } } if(!failedLoreCheck) { - BotTradeSwapItem(client, SlotPrimary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage); + BotTradeSwapItem(client, EQEmu::legacy::SlotPrimary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage); success = true; } break; } - else if(j == SlotSecondary) { + else if (j == EQEmu::legacy::SlotSecondary) { if(inst->IsWeapon()) { if(CanThisClassDualWield()) { - BotTradeSwapItem(client, SlotSecondary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage); + BotTradeSwapItem(client, EQEmu::legacy::SlotSecondary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage); success = true; } else { @@ -3539,13 +3539,13 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli } } else { - BotTradeSwapItem(client, SlotSecondary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage); + BotTradeSwapItem(client, EQEmu::legacy::SlotSecondary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage); success = true; } - if(success && GetBotItem(SlotPrimary)) { - ItemInst* remove_item = GetBotItem(SlotPrimary); + if (success && GetBotItem(EQEmu::legacy::SlotPrimary)) { + ItemInst* remove_item = GetBotItem(EQEmu::legacy::SlotPrimary); if((remove_item->GetItem()->ItemType == ItemType2HSlash) || (remove_item->GetItem()->ItemType == ItemType2HBlunt) || (remove_item->GetItem()->ItemType == ItemType2HPiercing)) { - BotTradeSwapItem(client, SlotPrimary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false); + BotTradeSwapItem(client, EQEmu::legacy::SlotPrimary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false); } } break; @@ -3745,13 +3745,13 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b FaceTarget(GetTarget()); ItemInst* weapon = nullptr; - if(Hand == SlotPrimary) { - weapon = GetBotItem(SlotPrimary); + if (Hand == EQEmu::legacy::SlotPrimary) { + weapon = GetBotItem(EQEmu::legacy::SlotPrimary); OffHandAtk(false); } - if(Hand == SlotSecondary) { - weapon = GetBotItem(SlotSecondary); + if (Hand == EQEmu::legacy::SlotSecondary) { + weapon = GetBotItem(EQEmu::legacy::SlotSecondary); OffHandAtk(true); } @@ -3816,7 +3816,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b // This is not recommended for normal usage, as the damage bonus represents a non-trivial component of the DPS output // of weapons wielded by higher-level melee characters (especially for two-handed weapons). int ucDamageBonus = 0; - if(Hand == SlotPrimary && GetLevel() >= 28 && IsWarriorClass()) { + if (Hand == EQEmu::legacy::SlotPrimary && GetLevel() >= 28 && IsWarriorClass()) { // 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. ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const Item_Struct*) nullptr); @@ -3826,7 +3826,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b } #endif //Live AA - Sinister Strikes *Adds weapon damage bonus to offhand weapon. - if (Hand == SlotSecondary) { + if (Hand == EQEmu::legacy::SlotSecondary) { if (aabonuses.SecondaryDmgInc || itembonuses.SecondaryDmgInc || spellbonuses.SecondaryDmgInc){ ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const Item_Struct*) nullptr); min_hit += (int) ucDamageBonus; @@ -4294,7 +4294,7 @@ int32 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) { int32 focus_max = 0; int32 focus_max_real = 0; //item focus - for (int x = EQEmu::constants::EQUIPMENT_BEGIN; x <= EQEmu::constants::EQUIPMENT_END; x++) { + for (int x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::EQUIPMENT_END; x++) { TempItem = nullptr; ItemInst* ins = GetBotItem(x); if (!ins) @@ -4319,7 +4319,7 @@ int32 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) { } } - for (int y = AUG_INDEX_BEGIN; y < EQEmu::constants::ITEM_COMMON_SIZE; ++y) { + for (int y = AUG_INDEX_BEGIN; y < EQEmu::legacy::ITEM_COMMON_SIZE; ++y) { ItemInst *aug = nullptr; aug = ins->GetAugment(y); if(aug) { @@ -4755,15 +4755,15 @@ float Bot::GetProcChances(float ProcBonus, uint16 hand) { float ProcChance = 0.0f; uint32 weapon_speed = 0; switch (hand) { - case SlotPrimary: - weapon_speed = attack_timer.GetDuration(); - break; - case SlotSecondary: - weapon_speed = attack_dw_timer.GetDuration(); - break; - case SlotRange: - weapon_speed = ranged_timer.GetDuration(); - break; + case EQEmu::legacy::SlotPrimary: + weapon_speed = attack_timer.GetDuration(); + break; + case EQEmu::legacy::SlotSecondary: + weapon_speed = attack_dw_timer.GetDuration(); + break; + case EQEmu::legacy::SlotRange: + weapon_speed = ranged_timer.GetDuration(); + break; } if (weapon_speed < RuleI(Combat, MinHastedDelay)) @@ -4787,7 +4787,7 @@ int Bot::GetHandToHandDamage(void) { // everyone uses this in the revamp! int skill = GetSkill(SkillHandtoHand); int epic = 0; - if (CastToNPC()->GetEquipment(MaterialHands) == 10652 && GetLevel() > 46) + if (CastToNPC()->GetEquipment(EQEmu::legacy::MaterialHands) == 10652 && GetLevel() > 46) epic = 280; if (epic > skill) skill = epic; @@ -4809,7 +4809,7 @@ int Bot::GetHandToHandDamage(void) { 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, // 31-40 10, 11, 11, 11, 11, 11, 11, 12, 12}; // 41-49 if (GetClass() == MONK) { - if (CastToNPC()->GetEquipment(MaterialHands) == 10652 && GetLevel() > 50) + if (CastToNPC()->GetEquipment(EQEmu::legacy::MaterialHands) == 10652 && GetLevel() > 50) return 9; if (level > 62) return 15; @@ -4848,11 +4848,11 @@ void Bot::DoRiposte(Mob* defender) { if (!defender) return; - defender->Attack(this, SlotPrimary, true); + defender->Attack(this, EQEmu::legacy::SlotPrimary, true); int32 DoubleRipChance = (defender->GetAABonuses().GiveDoubleRiposte[0] + defender->GetSpellBonuses().GiveDoubleRiposte[0] + defender->GetItemBonuses().GiveDoubleRiposte[0]); if(DoubleRipChance && (DoubleRipChance >= zone->random.Int(0, 100))) { Log.Out(Logs::Detail, Logs::Combat, "Preforming a double riposte (%d percent chance)", DoubleRipChance); - defender->Attack(this, SlotPrimary, true); + defender->Attack(this, EQEmu::legacy::SlotPrimary, true); } DoubleRipChance = defender->GetAABonuses().GiveDoubleRiposte[1]; @@ -4870,7 +4870,7 @@ void Bot::DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage, hate = hate_override; if(skill == SkillBash) { - const ItemInst* inst = GetBotItem(SlotSecondary); + const ItemInst* inst = GetBotItem(EQEmu::legacy::SlotSecondary); const Item_Struct* botweapon = 0; if(inst) botweapon = inst->GetItem(); @@ -4884,14 +4884,14 @@ void Bot::DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage, } min_damage += (min_damage * GetMeleeMinDamageMod_SE(skill) / 100); - int hand = SlotPrimary; + int hand = EQEmu::legacy::SlotPrimary; if (skill == SkillThrowing || skill == SkillArchery) - hand = SlotRange; + hand = EQEmu::legacy::SlotRange; if (who->AvoidDamage(this, max_damage, hand)) { if (max_damage == -3) DoRiposte(who); } else { - if (HitChance || who->CheckHitChance(this, skill, SlotPrimary)) { + if (HitChance || who->CheckHitChance(this, skill, EQEmu::legacy::SlotPrimary)) { who->MeleeMitigation(this, max_damage, min_damage); ApplyMeleeDamageBonus(skill, max_damage); max_damage += who->GetFcDamageAmtIncoming(this, 0, true, skill); @@ -4935,7 +4935,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) { bool bIsBehind = false; bool bCanFrontalBS = false; - const ItemInst* inst = GetBotItem(SlotPrimary); + const ItemInst* inst = GetBotItem(EQEmu::legacy::SlotPrimary); const Item_Struct* botpiercer = nullptr; if(inst) botpiercer = inst->GetItem(); @@ -4985,7 +4985,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) { } } else - Attack(other, SlotPrimary); + Attack(other, EQEmu::legacy::SlotPrimary); } void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) { @@ -4995,11 +4995,11 @@ void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) { int32 hate = 0; int32 primaryweapondamage = 0; int32 backstab_dmg = 0; - ItemInst* botweaponInst = GetBotItem(SlotPrimary); + ItemInst* botweaponInst = GetBotItem(EQEmu::legacy::SlotPrimary); if(botweaponInst) { primaryweapondamage = GetWeaponDamage(other, botweaponInst); backstab_dmg = botweaponInst->GetItem()->BackstabDmg; - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) { + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) { ItemInst *aug = botweaponInst->GetAugment(i); if(aug) backstab_dmg += aug->GetItem()->BackstabDmg; @@ -5043,7 +5043,7 @@ void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) { } void Bot::RogueAssassinate(Mob* other) { - ItemInst* botweaponInst = GetBotItem(SlotPrimary); + ItemInst* botweaponInst = GetBotItem(EQEmu::legacy::SlotPrimary); if(botweaponInst) { if(GetWeaponDamage(other, botweaponInst)) other->Damage(this, 32000, SPELL_UNKNOWN, SkillBackstab); @@ -5109,7 +5109,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) { case WARRIOR: if(level >= RuleI(Combat, NPCBashKickLevel)){ bool canBash = false; - if((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) || (m_inv.GetItem(SlotSecondary) && m_inv.GetItem(SlotSecondary)->GetItem()->ItemType == ItemTypeShield) || (m_inv.GetItem(SlotPrimary) && (m_inv.GetItem(SlotPrimary)->GetItem()->ItemType == ItemType2HSlash || m_inv.GetItem(SlotPrimary)->GetItem()->ItemType == ItemType2HBlunt || m_inv.GetItem(SlotPrimary)->GetItem()->ItemType == ItemType2HPiercing) && GetAA(aa2HandBash) >= 1)) + if ((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) || (m_inv.GetItem(EQEmu::legacy::SlotSecondary) && m_inv.GetItem(EQEmu::legacy::SlotSecondary)->GetItem()->ItemType == ItemTypeShield) || (m_inv.GetItem(EQEmu::legacy::SlotPrimary) && (m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType == ItemType2HSlash || m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType == ItemType2HBlunt || m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType == ItemType2HPiercing) && GetAA(aa2HandBash) >= 1)) canBash = true; if(!canBash || zone->random.Int(0, 100) > 25) @@ -5128,7 +5128,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) { case SHADOWKNIGHT: case PALADIN: if(level >= RuleI(Combat, NPCBashKickLevel)){ - if((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) || (m_inv.GetItem(SlotSecondary) && m_inv.GetItem(SlotSecondary)->GetItem()->ItemType == ItemTypeShield) || (m_inv.GetItem(SlotPrimary) && (m_inv.GetItem(SlotPrimary)->GetItem()->ItemType == ItemType2HSlash || m_inv.GetItem(SlotPrimary)->GetItem()->ItemType == ItemType2HBlunt || m_inv.GetItem(SlotPrimary)->GetItem()->ItemType == ItemType2HPiercing) && GetAA(aa2HandBash) >= 1)) + if ((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) || (m_inv.GetItem(EQEmu::legacy::SlotSecondary) && m_inv.GetItem(EQEmu::legacy::SlotSecondary)->GetItem()->ItemType == ItemTypeShield) || (m_inv.GetItem(EQEmu::legacy::SlotPrimary) && (m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType == ItemType2HSlash || m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType == ItemType2HBlunt || m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType == ItemType2HPiercing) && GetAA(aa2HandBash) >= 1)) skill_to_use = SkillBash; } break; @@ -5157,7 +5157,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) { if(skill_to_use == SkillBash) { if (target != this) { DoAnim(animTailRake); - if(GetWeaponDamage(target, GetBotItem(SlotSecondary)) <= 0 && GetWeaponDamage(target, GetBotItem(SlotShoulders)) <= 0) + if (GetWeaponDamage(target, GetBotItem(EQEmu::legacy::SlotSecondary)) <= 0 && GetWeaponDamage(target, GetBotItem(EQEmu::legacy::SlotShoulders)) <= 0) dmg = -5; else { if(!target->CheckHitChance(this, SkillBash, 0)) @@ -5207,7 +5207,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) { if(skill_to_use == SkillKick) { if(target != this) { DoAnim(animKick); - if(GetWeaponDamage(target, GetBotItem(SlotFeet)) <= 0) + if (GetWeaponDamage(target, GetBotItem(EQEmu::legacy::SlotFeet)) <= 0) dmg = -5; else { if(!target->CheckHitChance(this, SkillKick, 0)) @@ -5374,7 +5374,7 @@ void Bot::EquipBot(std::string* errorMessage) { GetBotItems(m_inv, errorMessage); const ItemInst* inst = 0; const Item_Struct* item = 0; - for (int i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::EQUIPMENT_END; ++i) { + for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) { inst = GetBotItem(i); if(inst) { item = inst->GetItem(); @@ -5501,12 +5501,12 @@ void Bot::SetAttackTimer() { attack_timer.SetAtTrigger(4000, true); Timer* TimerToUse = nullptr; const Item_Struct* PrimaryWeapon = nullptr; - for (int i = SlotRange; i <= SlotSecondary; i++) { - if (i == SlotPrimary) + for (int i = EQEmu::legacy::SlotRange; i <= EQEmu::legacy::SlotSecondary; i++) { + if (i == EQEmu::legacy::SlotPrimary) TimerToUse = &attack_timer; - else if (i == SlotRange) + else if (i == EQEmu::legacy::SlotRange) TimerToUse = &ranged_timer; - else if (i == SlotSecondary) + else if (i == EQEmu::legacy::SlotSecondary) TimerToUse = &attack_dw_timer; else continue; @@ -5516,7 +5516,7 @@ void Bot::SetAttackTimer() { if (ci) ItemToUse = ci->GetItem(); - if (i == SlotSecondary) { + if (i == EQEmu::legacy::SlotSecondary) { if (PrimaryWeapon != nullptr) { if (PrimaryWeapon->ItemClass == ItemClassCommon && (PrimaryWeapon->ItemType == ItemType2HSlash || PrimaryWeapon->ItemType == ItemType2HBlunt || PrimaryWeapon->ItemType == ItemType2HPiercing)) { attack_dw_timer.Disable(); @@ -5547,7 +5547,7 @@ void Bot::SetAttackTimer() { speed = (RuleB(Spells, Jun182014HundredHandsRevamp) ? static_cast(((delay / haste_mod) + ((hhe / 1000.0f) * (delay / haste_mod))) * 100) : static_cast(((delay / haste_mod) + ((hhe / 100.0f) * delay)) * 100)); TimerToUse->SetAtTrigger(std::max(RuleI(Combat, MinHastedDelay), speed), true); - if(i == SlotPrimary) + if (i == EQEmu::legacy::SlotPrimary) PrimaryWeapon = ItemToUse; } } @@ -7192,7 +7192,7 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) { // Modded to display power source items (will only show up on SoF+ client inspect windows though.) // I don't think bots are currently coded to use them..but, you'll have to use '#bot inventory list' // to see them on a Titanium client when/if they are activated. - for (int16 L = EQEmu::constants::EQUIPMENT_BEGIN; L <= SlotWaist; L++) { + for (int16 L = EQEmu::legacy::EQUIPMENT_BEGIN; L <= EQEmu::legacy::SlotWaist; L++) { inst = inspectedBot->GetBotItem(L); if(inst) { @@ -7206,7 +7206,7 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) { } } - inst = inspectedBot->GetBotItem(SlotPowerSource); + inst = inspectedBot->GetBotItem(EQEmu::legacy::SlotPowerSource); if(inst) { item = inst->GetItem(); @@ -7218,7 +7218,7 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) { insr->itemicons[SoF::inventory::SlotPowerSource] = 0xFFFFFFFF; } - inst = inspectedBot->GetBotItem(SlotAmmo); + inst = inspectedBot->GetBotItem(EQEmu::legacy::SlotAmmo); if(inst) { item = inst->GetItem(); @@ -7240,7 +7240,7 @@ void Bot::CalcItemBonuses(StatBonuses* newbon) { const Item_Struct* itemtmp = 0; - for (int i = EQEmu::constants::EQUIPMENT_BEGIN; i <= (EQEmu::constants::EQUIPMENT_END + 1); ++i) { + for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= (EQEmu::legacy::EQUIPMENT_END + 1); ++i) { const ItemInst* item = GetBotItem((i == 22 ? 9999 : i)); if(item) { AddItemBonuses(item, newbon); @@ -7553,7 +7553,7 @@ void Bot::AddItemBonuses(const ItemInst *inst, StatBonuses* newbon, bool isAug, if (!isAug) { - for (int i = 0; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) + for (int i = 0; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) AddItemBonuses(inst->GetAugment(i),newbon,true, false, rec_level); } @@ -8042,12 +8042,12 @@ uint8 Bot::GetNumberNeedingHealedInGroup(uint8 hpr, bool includePets) { int Bot::GetRawACNoShield(int &shield_ac) { int ac = itembonuses.AC + spellbonuses.AC; shield_ac = 0; - ItemInst* inst = GetBotItem(SlotSecondary); + ItemInst* inst = GetBotItem(EQEmu::legacy::SlotSecondary); if(inst) { if(inst->GetItem()->ItemType == ItemTypeShield) { ac -= inst->GetItem()->AC; shield_ac = inst->GetItem()->AC; - for (uint8 i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) { + for (uint8 i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) { if(inst->GetAugment(i)) { ac -= inst->GetAugment(i)->GetItem()->AC; shield_ac += inst->GetAugment(i)->GetItem()->AC; @@ -8062,7 +8062,7 @@ uint32 Bot::CalcCurrentWeight() { const Item_Struct* TempItem = 0; ItemInst* inst; uint32 Total = 0; - for (int i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::EQUIPMENT_END; ++i) { + for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; ++i) { inst = GetBotItem(i); if(inst) { TempItem = inst->GetItem(); @@ -8421,7 +8421,7 @@ bool Bot::DyeArmor(int16 slot_id, uint32 rgb, bool all_flag, bool save_flag) if (slot_id != INVALID_INDEX) return false; - for (uint8 i = 0; i < MaterialPrimary; ++i) { + for (uint8 i = 0; i < EQEmu::legacy::MaterialPrimary; ++i) { uint8 inv_slot = Inventory::CalcSlotFromMaterial(i); ItemInst* inst = m_inv.GetItem(inv_slot); if (!inst) @@ -8433,7 +8433,7 @@ bool Bot::DyeArmor(int16 slot_id, uint32 rgb, bool all_flag, bool save_flag) } else { uint8 mat_slot = Inventory::CalcMaterialFromSlot(slot_id); - if (mat_slot == MaterialInvalid || mat_slot >= MaterialPrimary) + if (mat_slot == EQEmu::legacy::MaterialInvalid || mat_slot >= EQEmu::legacy::MaterialPrimary) return false; ItemInst* inst = m_inv.GetItem(slot_id); diff --git a/zone/bot.h b/zone/bot.h index a64b44a5e..9cb0b4766 100644 --- a/zone/bot.h +++ b/zone/bot.h @@ -77,9 +77,9 @@ static const std::string bot_stance_name[BOT_STANCE_COUNT] = { static const char* GetBotStanceName(int stance_id) { return bot_stance_name[VALIDBOTSTANCE(stance_id)].c_str(); } -#define VALIDBOTEQUIPSLOT(x) ((x >= EQEmu::constants::EQUIPMENT_BEGIN && x <= EQEmu::constants::EQUIPMENT_END) ? (x) : ((x == SlotPowerSource) ? (22) : (23))) +#define VALIDBOTEQUIPSLOT(x) ((x >= EQEmu::legacy::EQUIPMENT_BEGIN && x <= EQEmu::legacy::EQUIPMENT_END) ? (x) : ((x == EQEmu::legacy::SlotPowerSource) ? (22) : (23))) -static std::string bot_equip_slot_name[EQEmu::constants::EQUIPMENT_SIZE + 2] = +static std::string bot_equip_slot_name[EQEmu::legacy::EQUIPMENT_SIZE + 2] = { "Charm", // MainCharm "Left Ear", // MainEar1 @@ -207,7 +207,7 @@ public: //abstract virtual function implementations requird by base abstract class virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill); virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0); - virtual bool Attack(Mob* other, int Hand = SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false, + virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0); virtual bool HasRaid() { return (GetRaid() ? true : false); } virtual bool HasGroup() { return (GetGroup() ? true : false); } diff --git a/zone/bot_command.cpp b/zone/bot_command.cpp index 138a7aa02..2fa020635 100644 --- a/zone/bot_command.cpp +++ b/zone/bot_command.cpp @@ -2400,7 +2400,7 @@ namespace ActionableBots continue; mod_skill_value = base_skill_value; - for (int16 index = EQEmu::constants::EQUIPMENT_BEGIN; index <= EQEmu::constants::EQUIPMENT_END; ++index) { + for (int16 index = EQEmu::legacy::EQUIPMENT_BEGIN; index <= EQEmu::legacy::EQUIPMENT_END; ++index) { const ItemInst* indexed_item = bot_iter->GetBotItem(index); if (indexed_item && indexed_item->GetItem()->SkillModType == skill_type) mod_skill_value += (base_skill_value * (((float)indexed_item->GetItem()->SkillModValue) / 100.0f)); @@ -4357,7 +4357,7 @@ void bot_subcommand_bot_dye_armor(Client *c, const Seperator *sep) // TODO: Trouble-shoot model update issue const std::string msg_matslot = StringFormat("mat_slot: %c(All), %i(Head), %i(Chest), %i(Arms), %i(Wrists), %i(Hands), %i(Legs), %i(Feet)", - '*', MaterialHead, MaterialChest, MaterialArms, MaterialWrist, MaterialHands, MaterialLegs, MaterialFeet); + '*', EQEmu::legacy::MaterialHead, EQEmu::legacy::MaterialChest, EQEmu::legacy::MaterialArms, EQEmu::legacy::MaterialWrist, EQEmu::legacy::MaterialHands, EQEmu::legacy::MaterialLegs, EQEmu::legacy::MaterialFeet); if (helper_command_alias_fail(c, "bot_subcommand_bot_dye_armor", sep->arg[0], "botdyearmor")) return; @@ -4368,7 +4368,7 @@ void bot_subcommand_bot_dye_armor(Client *c, const Seperator *sep) } const int ab_mask = ActionableBots::ABM_NoFilter; - uint8 material_slot = MaterialInvalid; + uint8 material_slot = EQEmu::legacy::MaterialInvalid; int16 slot_id = INVALID_INDEX; bool dye_all = (sep->arg[1][0] == '*'); @@ -4376,7 +4376,7 @@ void bot_subcommand_bot_dye_armor(Client *c, const Seperator *sep) material_slot = atoi(sep->arg[1]); slot_id = Inventory::CalcSlotFromMaterial(material_slot); - if (!sep->IsNumber(1) || slot_id == INVALID_INDEX || material_slot > MaterialFeet) { + if (!sep->IsNumber(1) || slot_id == INVALID_INDEX || material_slot > EQEmu::legacy::MaterialFeet) { c->Message(m_fail, "Valid [mat_slot]s for this command are:"); c->Message(m_fail, msg_matslot.c_str()); return; @@ -7070,24 +7070,24 @@ void bot_subcommand_inventory_list(Client *c, const Seperator *sep) linker.SetLinkType(linker.SayLinkItemInst); uint32 inventory_count = 0; - for (int i = EQEmu::constants::EQUIPMENT_BEGIN; i <= (EQEmu::constants::EQUIPMENT_END + 1); ++i) { - if ((i == SlotSecondary) && is2Hweapon) + for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= (EQEmu::legacy::EQUIPMENT_END + 1); ++i) { + if ((i == EQEmu::legacy::SlotSecondary) && is2Hweapon) continue; - inst = my_bot->CastToBot()->GetBotItem(i == 22 ? SlotPowerSource : i); + inst = my_bot->CastToBot()->GetBotItem(i == 22 ? EQEmu::legacy::SlotPowerSource : i); if (!inst || !inst->GetItem()) { - c->Message(m_message, "I need something for my %s (slot %i)", GetBotEquipSlotName(i), (i == 22 ? SlotPowerSource : i)); + c->Message(m_message, "I need something for my %s (slot %i)", GetBotEquipSlotName(i), (i == 22 ? EQEmu::legacy::SlotPowerSource : i)); continue; } item = inst->GetItem(); - if ((i == SlotPrimary) && ((item->ItemType == ItemType2HSlash) || (item->ItemType == ItemType2HBlunt) || (item->ItemType == ItemType2HPiercing))) { + if ((i == EQEmu::legacy::SlotPrimary) && ((item->ItemType == ItemType2HSlash) || (item->ItemType == ItemType2HBlunt) || (item->ItemType == ItemType2HPiercing))) { is2Hweapon = true; } linker.SetItemInst(inst); item_link = linker.GenerateLink(); - c->Message(m_message, "Using %s in my %s (slot %i)", item_link.c_str(), GetBotEquipSlotName(i), (i == 22 ? SlotPowerSource : i)); + c->Message(m_message, "Using %s in my %s (slot %i)", item_link.c_str(), GetBotEquipSlotName(i), (i == 22 ? EQEmu::legacy::SlotPowerSource : i)); ++inventory_count; } @@ -7126,7 +7126,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep) } int slotId = atoi(sep->arg[1]); - if (!sep->IsNumber(1) || ((slotId > EQEmu::constants::EQUIPMENT_END || slotId < EQEmu::constants::EQUIPMENT_BEGIN) && slotId != SlotPowerSource)) { + if (!sep->IsNumber(1) || ((slotId > EQEmu::legacy::EQUIPMENT_END || slotId < EQEmu::legacy::EQUIPMENT_BEGIN) && slotId != EQEmu::legacy::SlotPowerSource)) { c->Message(m_fail, "Valid slots are 0-21 or 9999"); return; } @@ -7141,7 +7141,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep) return; } - for (int m = AUG_INDEX_BEGIN; m < EQEmu::constants::ITEM_COMMON_SIZE; ++m) { + for (int m = AUG_INDEX_BEGIN; m < EQEmu::legacy::ITEM_COMMON_SIZE; ++m) { if (!itminst) break; @@ -7158,7 +7158,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep) std::string error_message; if (itm) { c->PushItemOnCursor(*itminst, true); - if ((slotId == SlotRange) || (slotId == SlotAmmo) || (slotId == SlotPrimary) || (slotId == SlotSecondary)) + if ((slotId == EQEmu::legacy::SlotRange) || (slotId == EQEmu::legacy::SlotAmmo) || (slotId == EQEmu::legacy::SlotPrimary) || (slotId == EQEmu::legacy::SlotSecondary)) my_bot->SetBotArcher(false); my_bot->RemoveBotItemBySlot(slotId, &error_message); @@ -7172,31 +7172,31 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep) } switch (slotId) { - case SlotCharm: - case SlotEar1: - case SlotHead: - case SlotFace: - case SlotEar2: - case SlotNeck: - case SlotBack: - case SlotWrist1: - case SlotWrist2: - case SlotRange: - case SlotPrimary: - case SlotSecondary: - case SlotFinger1: - case SlotFinger2: - case SlotChest: - case SlotWaist: - case SlotPowerSource: - case SlotAmmo: + case EQEmu::legacy::SlotCharm: + case EQEmu::legacy::SlotEar1: + case EQEmu::legacy::SlotHead: + case EQEmu::legacy::SlotFace: + case EQEmu::legacy::SlotEar2: + case EQEmu::legacy::SlotNeck: + case EQEmu::legacy::SlotBack: + case EQEmu::legacy::SlotWrist1: + case EQEmu::legacy::SlotWrist2: + case EQEmu::legacy::SlotRange: + case EQEmu::legacy::SlotPrimary: + case EQEmu::legacy::SlotSecondary: + case EQEmu::legacy::SlotFinger1: + case EQEmu::legacy::SlotFinger2: + case EQEmu::legacy::SlotChest: + case EQEmu::legacy::SlotWaist: + case EQEmu::legacy::SlotPowerSource: + case EQEmu::legacy::SlotAmmo: c->Message(m_message, "My %s is %s unequipped", GetBotEquipSlotName(slotId), ((itm) ? ("now") : ("already"))); break; - case SlotShoulders: - case SlotArms: - case SlotHands: - case SlotLegs: - case SlotFeet: + case EQEmu::legacy::SlotShoulders: + case EQEmu::legacy::SlotArms: + case EQEmu::legacy::SlotHands: + case EQEmu::legacy::SlotLegs: + case EQEmu::legacy::SlotFeet: c->Message(m_message, "My %s are %s unequipped", GetBotEquipSlotName(slotId), ((itm) ? ("now") : ("already"))); break; default: @@ -7233,14 +7233,14 @@ void bot_subcommand_inventory_window(Client *c, const Seperator *sep) //Client::TextLink linker; //linker.SetLinkType(linker.linkItemInst); - for (int i = EQEmu::constants::EQUIPMENT_BEGIN; i <= (EQEmu::constants::EQUIPMENT_END + 1); ++i) { + for (int i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= (EQEmu::legacy::EQUIPMENT_END + 1); ++i) { const Item_Struct* item = nullptr; - const ItemInst* inst = my_bot->CastToBot()->GetBotItem(i == 22 ? SlotPowerSource : i); + const ItemInst* inst = my_bot->CastToBot()->GetBotItem(i == 22 ? EQEmu::legacy::SlotPowerSource : i); if (inst) item = inst->GetItem(); window_text.append(""); - window_text.append(GetBotEquipSlotName(i == 22 ? SlotPowerSource : i)); + window_text.append(GetBotEquipSlotName(i == 22 ? EQEmu::legacy::SlotPowerSource : i)); window_text.append(": "); if (item) { //window_text.append(""); diff --git a/zone/bot_database.cpp b/zone/bot_database.cpp index fc98fd768..3f8a60c0d 100644 --- a/zone/bot_database.cpp +++ b/zone/bot_database.cpp @@ -1058,7 +1058,7 @@ bool BotDatabase::LoadItems(const uint32 bot_id, Inventory& inventory_inst) for (auto row = results.begin(); row != results.end(); ++row) { int16 slot_id = atoi(row[0]); - if ((slot_id < EQEmu::constants::EQUIPMENT_BEGIN || slot_id > EQEmu::constants::EQUIPMENT_END) && slot_id != SlotPowerSource) + if ((slot_id < EQEmu::legacy::EQUIPMENT_BEGIN || slot_id > EQEmu::legacy::EQUIPMENT_END) && slot_id != EQEmu::legacy::SlotPowerSource) continue; uint32 item_id = atoi(row[1]); @@ -1091,7 +1091,7 @@ bool BotDatabase::LoadItems(const uint32 bot_id, Inventory& inventory_inst) if (item_inst->GetItem()->Attuneable) { if (atoi(row[4])) item_inst->SetAttuned(true); - else if (((slot_id >= EQEmu::constants::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::constants::EQUIPMENT_END) || slot_id == SlotPowerSource)) + else if (((slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::legacy::EQUIPMENT_END) || slot_id == EQEmu::legacy::SlotPowerSource)) item_inst->SetAttuned(true); } @@ -1159,7 +1159,7 @@ bool BotDatabase::LoadItemBySlot(Bot* bot_inst) bool BotDatabase::LoadItemBySlot(const uint32 bot_id, const uint32 slot_id, uint32& item_id) { - if (!bot_id || (slot_id > EQEmu::constants::EQUIPMENT_END && slot_id != SlotPowerSource)) + if (!bot_id || (slot_id > EQEmu::legacy::EQUIPMENT_END && slot_id != EQEmu::legacy::SlotPowerSource)) return false; query = StringFormat("SELECT `item_id` FROM `bot_inventories` WHERE `bot_id` = '%i' AND `slot_id` = '%i' LIMIT 1", bot_id, slot_id); @@ -1177,7 +1177,7 @@ bool BotDatabase::LoadItemBySlot(const uint32 bot_id, const uint32 slot_id, uint bool BotDatabase::SaveItemBySlot(Bot* bot_inst, const uint32 slot_id, const ItemInst* item_inst) { - if (!bot_inst || !bot_inst->GetBotID() || (slot_id > EQEmu::constants::EQUIPMENT_END && slot_id != SlotPowerSource)) + if (!bot_inst || !bot_inst->GetBotID() || (slot_id > EQEmu::legacy::EQUIPMENT_END && slot_id != EQEmu::legacy::SlotPowerSource)) return false; if (!DeleteItemBySlot(bot_inst->GetBotID(), slot_id)) @@ -1187,7 +1187,7 @@ bool BotDatabase::SaveItemBySlot(Bot* bot_inst, const uint32 slot_id, const Item return true; uint32 augment_id[] = { 0, 0, 0, 0, 0, 0 }; - for (int augment_iter = 0; augment_iter < EQEmu::constants::ITEM_COMMON_SIZE; ++augment_iter) + for (int augment_iter = 0; augment_iter < EQEmu::legacy::ITEM_COMMON_SIZE; ++augment_iter) augment_id[augment_iter] = item_inst->GetAugmentItemID(augment_iter); query = StringFormat( @@ -1255,7 +1255,7 @@ bool BotDatabase::SaveItemBySlot(Bot* bot_inst, const uint32 slot_id, const Item bool BotDatabase::DeleteItemBySlot(const uint32 bot_id, const uint32 slot_id) { - if (!bot_id || (slot_id > EQEmu::constants::EQUIPMENT_END && slot_id != SlotPowerSource)) + if (!bot_id || (slot_id > EQEmu::legacy::EQUIPMENT_END && slot_id != EQEmu::legacy::SlotPowerSource)) return false; query = StringFormat("DELETE FROM `bot_inventories` WHERE `bot_id` = '%u' AND `slot_id` = '%u'", bot_id, slot_id); @@ -1294,12 +1294,12 @@ bool BotDatabase::SaveEquipmentColor(const uint32 bot_id, const int16 slot_id, c return false; bool all_flag = (slot_id == -2); - if ((slot_id < EQEmu::constants::EQUIPMENT_BEGIN || slot_id > EQEmu::constants::EQUIPMENT_END) && slot_id != SlotPowerSource && !all_flag) + if ((slot_id < EQEmu::legacy::EQUIPMENT_BEGIN || slot_id > EQEmu::legacy::EQUIPMENT_END) && slot_id != EQEmu::legacy::SlotPowerSource && !all_flag) return false; std::string where_clause; if (all_flag) - where_clause = StringFormat(" AND `slot_id` IN ('%u', '%u', '%u', '%u', '%u', '%u', '%u')", SlotHead, SlotArms, SlotWrist1, SlotHands, SlotChest, SlotLegs, SlotFeet); + where_clause = StringFormat(" AND `slot_id` IN ('%u', '%u', '%u', '%u', '%u', '%u', '%u')", EQEmu::legacy::SlotHead, EQEmu::legacy::SlotArms, EQEmu::legacy::SlotWrist1, EQEmu::legacy::SlotHands, EQEmu::legacy::SlotChest, EQEmu::legacy::SlotLegs, EQEmu::legacy::SlotFeet); else where_clause = StringFormat(" AND `slot_id` = '%u'", slot_id); @@ -1571,7 +1571,7 @@ bool BotDatabase::LoadPetItems(const uint32 bot_id, uint32* pet_items) return true; int item_index = 0; - for (auto row = results.begin(); row != results.end() && item_index < EQEmu::constants::EQUIPMENT_SIZE; ++row) { + for (auto row = results.begin(); row != results.end() && item_index < EQEmu::legacy::EQUIPMENT_SIZE; ++row) { pet_items[item_index] = atoi(row[0]); ++item_index; } @@ -1595,7 +1595,7 @@ bool BotDatabase::SavePetItems(const uint32 bot_id, const uint32* pet_items, boo if (!saved_pet_index) return true; - for (int item_index = 0; item_index < EQEmu::constants::EQUIPMENT_SIZE; ++item_index) { + for (int item_index = 0; item_index < EQEmu::legacy::EQUIPMENT_SIZE; ++item_index) { if (!pet_items[item_index]) continue; @@ -1744,7 +1744,7 @@ bool BotDatabase::SaveAllArmorColorBySlot(const uint32 owner_id, const int16 slo " AND bi.`slot_id` = '%i'", owner_id, rgb_value, - SlotHead, SlotChest, SlotArms, SlotWrist1, SlotWrist2, SlotHands, SlotLegs, SlotFeet, + EQEmu::legacy::SlotHead, EQEmu::legacy::SlotChest, EQEmu::legacy::SlotArms, EQEmu::legacy::SlotWrist1, EQEmu::legacy::SlotWrist2, EQEmu::legacy::SlotHands, EQEmu::legacy::SlotLegs, EQEmu::legacy::SlotFeet, slot_id ); auto results = QueryDatabase(query); @@ -1768,7 +1768,7 @@ bool BotDatabase::SaveAllArmorColors(const uint32 owner_id, const uint32 rgb_val " AND bi.`slot_id` IN ('%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')", owner_id, rgb_value, - SlotHead, SlotChest, SlotArms, SlotWrist1, SlotWrist2, SlotHands, SlotLegs, SlotFeet + EQEmu::legacy::SlotHead, EQEmu::legacy::SlotChest, EQEmu::legacy::SlotArms, EQEmu::legacy::SlotWrist1, EQEmu::legacy::SlotWrist2, EQEmu::legacy::SlotHands, EQEmu::legacy::SlotLegs, EQEmu::legacy::SlotFeet ); auto results = QueryDatabase(query); if (!results.Success()) diff --git a/zone/client.cpp b/zone/client.cpp index aa82bf291..f2ca38474 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -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) { diff --git a/zone/client.h b/zone/client.h index 60582d9c4..a17e59f40 100644 --- a/zone/client.h +++ b/zone/client.h @@ -218,7 +218,7 @@ public: //abstract virtual function implementations required by base abstract class virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill); virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0); - virtual bool Attack(Mob* other, int Hand = SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false, + virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0); virtual bool HasRaid() { return (GetRaid() ? true : false); } virtual bool HasGroup() { return (GetGroup() ? true : false); } @@ -814,7 +814,7 @@ public: void QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call = false); void PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootItem_Struct** bag_item_data = 0); bool AutoPutLootInInventory(ItemInst& inst, bool try_worn = false, bool try_cursor = true, ServerLootItem_Struct** bag_item_data = 0); - bool SummonItem(uint32 item_id, int16 charges = -1, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, bool attuned = false, uint16 to_slot = SlotCursor, uint32 ornament_icon = 0, uint32 ornament_idfile = 0, uint32 ornament_hero_model = 0); + bool SummonItem(uint32 item_id, int16 charges = -1, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, bool attuned = false, uint16 to_slot = EQEmu::legacy::SlotCursor, uint32 ornament_icon = 0, uint32 ornament_idfile = 0, uint32 ornament_hero_model = 0); void SetStats(uint8 type,int16 set_val); void IncStats(uint8 type,int16 increase_val); void DropItem(int16 slot_id); diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index 9dda04389..6e22cc514 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -485,7 +485,7 @@ int32 Client::GetRawItemAC() { int32 Total = 0; // this skips MainAmmo..add an '=' conditional if that slot is required (original behavior) - for (int16 slot_id = EQEmu::constants::EQUIPMENT_BEGIN; slot_id < EQEmu::constants::EQUIPMENT_END; slot_id++) { + for (int16 slot_id = EQEmu::legacy::EQUIPMENT_BEGIN; slot_id < EQEmu::legacy::EQUIPMENT_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if (inst && inst->IsType(ItemClassCommon)) { Total += inst->GetItem()->AC; @@ -1067,9 +1067,9 @@ int32 Client::CalcAC() } // Shield AC bonus for HeroicSTR if (itembonuses.HeroicSTR) { - bool equiped = CastToClient()->m_inv.GetItem(SlotSecondary); + bool equiped = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary); if (equiped) { - uint8 shield = CastToClient()->m_inv.GetItem(SlotSecondary)->GetItem()->ItemType; + uint8 shield = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary)->GetItem()->ItemType; if (shield == ItemTypeShield) { displayed += itembonuses.HeroicSTR / 2; } @@ -1096,9 +1096,9 @@ int32 Client::GetACMit() } // Shield AC bonus for HeroicSTR if (itembonuses.HeroicSTR) { - bool equiped = CastToClient()->m_inv.GetItem(SlotSecondary); + bool equiped = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary); if (equiped) { - uint8 shield = CastToClient()->m_inv.GetItem(SlotSecondary)->GetItem()->ItemType; + uint8 shield = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary)->GetItem()->ItemType; if (shield == ItemTypeShield) { mitigation += itembonuses.HeroicSTR / 2; } @@ -1306,7 +1306,7 @@ uint32 Client::CalcCurrentWeight() ItemInst* ins; uint32 Total = 0; int x; - for (x = EQEmu::constants::EQUIPMENT_BEGIN; x <= SlotCursor; x++) { // include cursor or not? + for (x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::SlotCursor; x++) { // include cursor or not? TempItem = 0; ins = GetInv().GetItem(x); if (ins) { @@ -1316,7 +1316,7 @@ uint32 Client::CalcCurrentWeight() Total += TempItem->Weight; } } - for (x = EQEmu::constants::GENERAL_BAGS_BEGIN; x <= EQEmu::constants::GENERAL_BAGS_END; x++) { // include cursor bags or not? + for (x = EQEmu::legacy::GENERAL_BAGS_BEGIN; x <= EQEmu::legacy::GENERAL_BAGS_END; x++) { // include cursor bags or not? int TmpWeight = 0; TempItem = 0; ins = GetInv().GetItem(x); @@ -1329,9 +1329,9 @@ uint32 Client::CalcCurrentWeight() if (TmpWeight > 0) { // this code indicates that weight redux bags can only be in the first general inventory slot to be effective... // is this correct? or can we scan for the highest weight redux and use that? (need client verifications) - int bagslot = SlotGeneral1; + int bagslot = EQEmu::legacy::SlotGeneral1; int reduction = 0; - for (int m = EQEmu::constants::GENERAL_BAGS_BEGIN + 10; m <= EQEmu::constants::GENERAL_BAGS_END; m += 10) { // include cursor bags or not? + for (int m = EQEmu::legacy::GENERAL_BAGS_BEGIN + 10; m <= EQEmu::legacy::GENERAL_BAGS_END; m += 10) { // include cursor bags or not? if (x >= m) { bagslot += 1; } @@ -2205,12 +2205,12 @@ int Client::GetRawACNoShield(int &shield_ac) const { int ac = itembonuses.AC + spellbonuses.AC + aabonuses.AC; shield_ac = 0; - const ItemInst *inst = m_inv.GetItem(SlotSecondary); + const ItemInst *inst = m_inv.GetItem(EQEmu::legacy::SlotSecondary); if (inst) { if (inst->GetItem()->ItemType == ItemTypeShield) { ac -= inst->GetItem()->AC; shield_ac = inst->GetItem()->AC; - for (uint8 i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) { + for (uint8 i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) { if (inst->GetAugment(i)) { ac -= inst->GetAugment(i)->GetItem()->AC; shield_ac += inst->GetAugment(i)->GetItem()->AC; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index e8dbbc7e8..75ed6771e 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -1313,7 +1313,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) } /* Set item material tint */ - for (int i = EQEmu::constants::MATERIAL_BEGIN; i <= EQEmu::constants::MATERIAL_END; i++) + for (int i = EQEmu::legacy::MATERIAL_BEGIN; i <= EQEmu::legacy::MATERIAL_END; i++) { if (m_pp.item_tint[i].RGB.UseTint == 1 || m_pp.item_tint[i].RGB.UseTint == 255) { @@ -1689,7 +1689,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) if (iter == m_inv.cursor_cbegin()) continue; const ItemInst *inst = *iter; - SendItemPacket(SlotCursor, inst, ItemPacketSummonItem); + SendItemPacket(EQEmu::legacy::SlotCursor, inst, ItemPacketSummonItem); } } @@ -2027,7 +2027,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app) ItemInst *inst = database.CreateItem(item, charges); if (!AutoPutLootInInventory(*inst, true, true)) { - PutLootInInventory(SlotCursor, *inst); + PutLootInInventory(EQEmu::legacy::SlotCursor, *inst); } Save(1); } @@ -2550,7 +2550,7 @@ void Client::Handle_OP_AltCurrencyPurchase(const EQApplicationPacket *app) ItemInst *inst = database.CreateItem(item, charges); if (!AutoPutLootInInventory(*inst, true, true)) { - PutLootInInventory(SlotCursor, *inst); + PutLootInInventory(EQEmu::legacy::SlotCursor, *inst); } Save(1); @@ -2600,7 +2600,7 @@ void Client::Handle_OP_AltCurrencyReclaim(const EQApplicationPacket *app) SetAlternateCurrencyValue(reclaim->currency_id, 0); } else { - SummonItem(item_id, reclaim->count, 0, 0, 0, 0, 0, 0, false, SlotCursor); + SummonItem(item_id, reclaim->count, 0, 0, 0, 0, 0, 0, false, EQEmu::legacy::SlotCursor); AddAlternateCurrencyValue(reclaim->currency_id, -((int32)reclaim->count)); } /* QS: PlayerLogAlternateCurrencyTransactions :: Cursor to Item Storage */ @@ -2811,8 +2811,8 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) } uint32 ApplyPoisonSuccessResult = 0; ApplyPoison_Struct* ApplyPoisonData = (ApplyPoison_Struct*)app->pBuffer; - const ItemInst* PrimaryWeapon = GetInv().GetItem(SlotPrimary); - const ItemInst* SecondaryWeapon = GetInv().GetItem(SlotSecondary); + const ItemInst* PrimaryWeapon = GetInv().GetItem(EQEmu::legacy::SlotPrimary); + const ItemInst* SecondaryWeapon = GetInv().GetItem(EQEmu::legacy::SlotSecondary); const ItemInst* PoisonItemInstance = GetInv()[ApplyPoisonData->inventorySlot]; bool IsPoison = PoisonItemInstance && (PoisonItemInstance->GetItem()->ItemType == ItemTypePoison); @@ -2994,7 +2994,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) { case 0: // Adding an augment case 2: // Swapping augment - new_aug = user_inv.GetItem(SlotCursor); + new_aug = user_inv.GetItem(EQEmu::legacy::SlotCursor); if (!new_aug) // Shouldn't get the OP code without the augment on the user's cursor, but maybe it's h4x. { @@ -3052,7 +3052,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) if (itemOneToPush) { DeleteItemInInventory(item_slot, 0, true); - DeleteItemInInventory(SlotCursor, new_aug->IsStackable() ? 1 : 0, true); + DeleteItemInInventory(EQEmu::legacy::SlotCursor, new_aug->IsStackable() ? 1 : 0, true); if (solvent) { @@ -3063,7 +3063,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) if (itemTwoToPush) { // This is a swap. Return the old aug to the player's cursor. - if (!PutItemInInventory(SlotCursor, *itemTwoToPush, true)) + if (!PutItemInInventory(EQEmu::legacy::SlotCursor, *itemTwoToPush, true)) { Log.Out(Logs::General, Logs::Error, "Problem returning old augment to player's cursor after augmentation swap."); Message(15, "Error: Failed to retrieve old augment after augmentation swap!"); @@ -3076,7 +3076,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) CalcBonuses(); - if (mat != MaterialInvalid) + if (mat != EQEmu::legacy::MaterialInvalid) { SendWearChange(mat); // Visible item augged while equipped. Send WC in case ornamentation changed. } @@ -3141,13 +3141,13 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) CalcBonuses(); - if (mat != MaterialInvalid) + if (mat != EQEmu::legacy::MaterialInvalid) { SendWearChange(mat); // Visible item augged while equipped. Send WC in case ornamentation changed. } // Drop the removed augment on the player's cursor - if (!PutItemInInventory(SlotCursor, *itemTwoToPush, true)) + if (!PutItemInInventory(EQEmu::legacy::SlotCursor, *itemTwoToPush, true)) { Log.Out(Logs::General, Logs::Error, "Problem returning augment to player's cursor after safe removal."); Message(15, "Error: Failed to return augment after removal from item!"); @@ -3196,7 +3196,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) CalcBonuses(); - if (mat != MaterialInvalid) + if (mat != EQEmu::legacy::MaterialInvalid) { SendWearChange(mat); } @@ -4072,7 +4072,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app) } else { - Message(0, "Error: castspell->inventoryslot >= %i (0x%04x)", SlotCursor, castspell->inventoryslot); + Message(0, "Error: castspell->inventoryslot >= %i (0x%04x)", EQEmu::legacy::SlotCursor, castspell->inventoryslot); InterruptSpell(castspell->spell_id); } } @@ -4991,7 +4991,7 @@ void Client::Handle_OP_CrashDump(const EQApplicationPacket *app) void Client::Handle_OP_CreateObject(const EQApplicationPacket *app) { - DropItem(SlotCursor); + DropItem(EQEmu::legacy::SlotCursor); return; } @@ -6905,7 +6905,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) return; } - ItemInst *CursorItemInst = GetInv().GetItem(SlotCursor); + ItemInst *CursorItemInst = GetInv().GetItem(EQEmu::legacy::SlotCursor); bool Allowed = true; @@ -6953,7 +6953,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { GuildBankDepositAck(false, sentAction); - DeleteItemInInventory(SlotCursor, 0, false); + DeleteItemInInventory(EQEmu::legacy::SlotCursor, 0, false); } break; @@ -6974,7 +6974,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) case GuildBankWithdraw: { - if (GetInv()[SlotCursor]) + if (GetInv()[EQEmu::legacy::SlotCursor]) { Message_StringID(13, GUILD_BANK_EMPTY_HANDS); @@ -7020,7 +7020,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { PushItemOnCursor(*inst); - SendItemPacket(SlotCursor, inst, ItemPacketSummonItem); + SendItemPacket(EQEmu::legacy::SlotCursor, inst, ItemPacketSummonItem); GuildBanks->DeleteItem(GuildID(), gbwis->Area, gbwis->SlotID, gbwis->Quantity); } @@ -7994,7 +7994,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app) const Item_Struct* item = nullptr; int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType); - for (int16 L = EQEmu::constants::EQUIPMENT_BEGIN; L <= SlotWaist; L++) { + for (int16 L = EQEmu::legacy::EQUIPMENT_BEGIN; L <= EQEmu::legacy::SlotWaist; L++) { const ItemInst* inst = GetInv().GetItem(L); item = inst ? inst->GetItem() : nullptr; @@ -8014,7 +8014,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app) else { insr->itemicons[L] = 0xFFFFFFFF; } } - const ItemInst* inst = GetInv().GetItem(SlotAmmo); + const ItemInst* inst = GetInv().GetItem(EQEmu::legacy::SlotAmmo); item = inst ? inst->GetItem() : nullptr; if (item) { @@ -8474,7 +8474,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) ItemInst* clickaug = 0; Item_Struct* augitem = 0; - for (r = 0; r < EQEmu::constants::ITEM_COMMON_SIZE; r++) { + for (r = 0; r < EQEmu::legacy::ITEM_COMMON_SIZE; r++) { const ItemInst* aug_i = inst->GetAugment(r); if (!aug_i) continue; @@ -9675,7 +9675,7 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app) MoveItem_Struct* mi = (MoveItem_Struct*)app->pBuffer; if (spellend_timer.Enabled() && casting_spell_id && !IsBardSong(casting_spell_id)) { - if (mi->from_slot != mi->to_slot && (mi->from_slot <= EQEmu::constants::GENERAL_END || mi->from_slot > 39) && IsValidSlot(mi->from_slot) && IsValidSlot(mi->to_slot)) + if (mi->from_slot != mi->to_slot && (mi->from_slot <= EQEmu::legacy::GENERAL_END || mi->from_slot > 39) && IsValidSlot(mi->from_slot) && IsValidSlot(mi->to_slot)) { char *detect = nullptr; const ItemInst *itm_from = GetInv().GetItem(mi->from_slot); @@ -9696,8 +9696,8 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app) // Illegal bagslot usage checks. Currently, user only receives a message if this check is triggered. bool mi_hack = false; - if (mi->from_slot >= EQEmu::constants::GENERAL_BAGS_BEGIN && mi->from_slot <= EQEmu::constants::CURSOR_BAG_END) { - if (mi->from_slot >= EQEmu::constants::CURSOR_BAG_BEGIN) { mi_hack = true; } + if (mi->from_slot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && mi->from_slot <= EQEmu::legacy::CURSOR_BAG_END) { + if (mi->from_slot >= EQEmu::legacy::CURSOR_BAG_BEGIN) { mi_hack = true; } else { int16 from_parent = m_inv.CalcSlotId(mi->from_slot); if (!m_inv[from_parent]) { mi_hack = true; } @@ -9706,8 +9706,8 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app) } } - if (mi->to_slot >= EQEmu::constants::GENERAL_BAGS_BEGIN && mi->to_slot <= EQEmu::constants::CURSOR_BAG_END) { - if (mi->to_slot >= EQEmu::constants::CURSOR_BAG_BEGIN) { mi_hack = true; } + if (mi->to_slot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && mi->to_slot <= EQEmu::legacy::CURSOR_BAG_END) { + if (mi->to_slot >= EQEmu::legacy::CURSOR_BAG_BEGIN) { mi_hack = true; } else { int16 to_parent = m_inv.CalcSlotId(mi->to_slot); if (!m_inv[to_parent]) { mi_hack = true; } @@ -12023,7 +12023,7 @@ void Client::Handle_OP_Shielding(const EQApplicationPacket *app) Shielding_Struct* shield = (Shielding_Struct*)app->pBuffer; shield_target = entity_list.GetMob(shield->target_id); bool ack = false; - ItemInst* inst = GetInv().GetItem(SlotSecondary); + ItemInst* inst = GetInv().GetItem(EQEmu::legacy::SlotSecondary); if (!shield_target) return; if (inst) @@ -12240,8 +12240,8 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) // shouldn't we be reimbursing if these two fail? //make sure we are not completely full... - if (freeslotid == SlotCursor) { - if (m_inv.GetItem(SlotCursor) != nullptr) { + if (freeslotid == EQEmu::legacy::SlotCursor) { + if (m_inv.GetItem(EQEmu::legacy::SlotCursor) != nullptr) { Message(13, "You do not have room for any more items."); safe_delete(outapp); safe_delete(inst); diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 301474456..942139b26 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -296,7 +296,7 @@ bool Client::Process() { } if(AutoFireEnabled()){ - ItemInst *ranged = GetInv().GetItem(SlotRange); + ItemInst *ranged = GetInv().GetItem(EQEmu::legacy::SlotRange); if(ranged) { if(ranged->GetItem() && ranged->GetItem()->ItemType == ItemTypeBow){ @@ -391,10 +391,10 @@ bool Client::Process() { } else if (auto_attack_target->GetHP() > -10) // -10 so we can watch people bleed in PvP { - ItemInst *wpn = GetInv().GetItem(SlotPrimary); - TryWeaponProc(wpn, auto_attack_target, SlotPrimary); + ItemInst *wpn = GetInv().GetItem(EQEmu::legacy::SlotPrimary); + TryWeaponProc(wpn, auto_attack_target, EQEmu::legacy::SlotPrimary); - DoAttackRounds(auto_attack_target, SlotPrimary); + DoAttackRounds(auto_attack_target, EQEmu::legacy::SlotPrimary); if (CheckAATimer(aaTimerRampage)) entity_list.AEAttack(this, 30); } @@ -430,10 +430,10 @@ bool Client::Process() { else if(auto_attack_target->GetHP() > -10) { CheckIncreaseSkill(SkillDualWield, auto_attack_target, -10); if (CheckDualWield()) { - ItemInst *wpn = GetInv().GetItem(SlotSecondary); - TryWeaponProc(wpn, auto_attack_target, SlotSecondary); + ItemInst *wpn = GetInv().GetItem(EQEmu::legacy::SlotSecondary); + TryWeaponProc(wpn, auto_attack_target, EQEmu::legacy::SlotSecondary); - DoAttackRounds(auto_attack_target, SlotSecondary); + DoAttackRounds(auto_attack_target, EQEmu::legacy::SlotSecondary); } } } @@ -742,7 +742,7 @@ void Client::BulkSendInventoryItems() { // LINKDEAD TRADE ITEMS // Move trade slot items back into normal inventory..need them there now for the proceeding validity checks - for(slot_id = EQEmu::constants::TRADE_BEGIN; slot_id <= EQEmu::constants::TRADE_END; slot_id++) { + for (slot_id = EQEmu::legacy::TRADE_BEGIN; slot_id <= EQEmu::legacy::TRADE_END; slot_id++) { ItemInst* inst = m_inv.PopItem(slot_id); if(inst) { bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false; @@ -790,7 +790,7 @@ void Client::BulkSendInventoryItems() { std::map::iterator itr; //Inventory items - for(slot_id = SLOT_BEGIN; slot_id < EQEmu::constants::TYPE_POSSESSIONS_SIZE; slot_id++) { + for (slot_id = SLOT_BEGIN; slot_id < EQEmu::legacy::TYPE_POSSESSIONS_SIZE; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst) { std::string packet = inst->Serialize(slot_id); @@ -801,16 +801,16 @@ void Client::BulkSendInventoryItems() { // Power Source if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) { - const ItemInst* inst = m_inv[SlotPowerSource]; + const ItemInst* inst = m_inv[EQEmu::legacy::SlotPowerSource]; if(inst) { - std::string packet = inst->Serialize(SlotPowerSource); + std::string packet = inst->Serialize(EQEmu::legacy::SlotPowerSource); ser_items[i++] = packet; size += packet.length(); } } // Bank items - for(slot_id = EQEmu::constants::BANK_BEGIN; slot_id <= EQEmu::constants::BANK_END; slot_id++) { + for (slot_id = EQEmu::legacy::BANK_BEGIN; slot_id <= EQEmu::legacy::BANK_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst) { std::string packet = inst->Serialize(slot_id); @@ -820,7 +820,7 @@ void Client::BulkSendInventoryItems() { } // Shared Bank items - for(slot_id = EQEmu::constants::SHARED_BANK_BEGIN; slot_id <= EQEmu::constants::SHARED_BANK_END; slot_id++) { + for (slot_id = EQEmu::legacy::SHARED_BANK_BEGIN; slot_id <= EQEmu::legacy::SHARED_BANK_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst) { std::string packet = inst->Serialize(slot_id); @@ -1147,7 +1147,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app) switch(memspell->scribing) { case memSpellScribing: { // scribing spell to book - const ItemInst* inst = m_inv[SlotCursor]; + const ItemInst* inst = m_inv[EQEmu::legacy::SlotCursor]; if(inst && inst->IsType(ItemClassCommon)) { @@ -1161,7 +1161,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app) if(item && item->Scroll.Effect == (int32)(memspell->spell_id)) { ScribeSpell(memspell->spell_id, memspell->slot); - DeleteItemInInventory(SlotCursor, 1, true); + DeleteItemInInventory(EQEmu::legacy::SlotCursor, 1, true); } else Message(0,"Scribing spell: inst exists but item does not or spell ids do not match."); diff --git a/zone/command.cpp b/zone/command.cpp index 6270c0182..671a793cb 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -2413,14 +2413,14 @@ void command_texture(Client *c, const Seperator *sep) // Player Races Wear Armor, so Wearchange is sent instead int i; if (!c->GetTarget()) - for (i = EQEmu::constants::MATERIAL_BEGIN; i <= EQEmu::constants::MATERIAL_TINT_END; i++) + for (i = EQEmu::legacy::MATERIAL_BEGIN; i <= EQEmu::legacy::MATERIAL_TINT_END; i++) { c->SendTextureWC(i, texture); } else if ((c->GetTarget()->GetRace() > 0 && c->GetTarget()->GetRace() <= 12) || c->GetTarget()->GetRace() == 128 || c->GetTarget()->GetRace() == 130 || c->GetTarget()->GetRace() == 330 || c->GetTarget()->GetRace() == 522) { - for (i = EQEmu::constants::MATERIAL_BEGIN; i <= EQEmu::constants::MATERIAL_TINT_END; i++) + for (i = EQEmu::legacy::MATERIAL_BEGIN; i <= EQEmu::legacy::MATERIAL_TINT_END; i++) { c->GetTarget()->SendTextureWC(i, texture); } @@ -2551,7 +2551,7 @@ void command_peekinv(Client *c, const Seperator *sep) c->Message(0, "Displaying inventory for %s...", targetClient->GetName()); // worn - for (int16 indexMain = EQEmu::constants::EQUIPMENT_BEGIN; (scopeWhere & peekWorn) && (indexMain <= EQEmu::constants::EQUIPMENT_END); ++indexMain) { + for (int16 indexMain = EQEmu::legacy::EQUIPMENT_BEGIN; (scopeWhere & peekWorn) && (indexMain <= EQEmu::legacy::EQUIPMENT_END); ++indexMain) { inst_main = targetClient->GetInv().GetItem(indexMain); item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem(); linker.SetItemInst(inst_main); @@ -2563,18 +2563,18 @@ void command_peekinv(Client *c, const Seperator *sep) } if ((scopeWhere & peekWorn) && (targetClient->ClientVersion() >= EQEmu::versions::ClientVersion::SoF)) { - inst_main = targetClient->GetInv().GetItem(SlotPowerSource); + inst_main = targetClient->GetInv().GetItem(EQEmu::legacy::SlotPowerSource); item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem(); linker.SetItemInst(inst_main); item_link = linker.GenerateLink(); c->Message((item_data == nullptr), "WornSlot: %i, Item: %i (%s), Charges: %i", - SlotPowerSource, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges())); + EQEmu::legacy::SlotPowerSource, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges())); } // inv - for (int16 indexMain = EQEmu::constants::GENERAL_BEGIN; (scopeWhere & peekInv) && (indexMain <= EQEmu::constants::GENERAL_END); ++indexMain) { + for (int16 indexMain = EQEmu::legacy::GENERAL_BEGIN; (scopeWhere & peekInv) && (indexMain <= EQEmu::legacy::GENERAL_END); ++indexMain) { inst_main = targetClient->GetInv().GetItem(indexMain); item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem(); linker.SetItemInst(inst_main); @@ -2584,7 +2584,7 @@ void command_peekinv(Client *c, const Seperator *sep) c->Message((item_data == nullptr), "InvSlot: %i, Item: %i (%s), Charges: %i", indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges())); - for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::constants::ITEM_CONTAINER_SIZE); ++indexSub) { + for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) { inst_sub = inst_main->GetItem(indexSub); item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem(); linker.SetItemInst(inst_sub); @@ -2604,7 +2604,7 @@ void command_peekinv(Client *c, const Seperator *sep) item_link = linker.GenerateLink(); c->Message(1, "CursorSlot: %i, Item: %i (%s), Charges: %i", - SlotCursor, 0, item_link.c_str(), 0); + EQEmu::legacy::SlotCursor, 0, item_link.c_str(), 0); } else { int cursorDepth = 0; @@ -2616,9 +2616,9 @@ void command_peekinv(Client *c, const Seperator *sep) item_link = linker.GenerateLink(); c->Message((item_data == nullptr), "CursorSlot: %i, Depth: %i, Item: %i (%s), Charges: %i", - SlotCursor, cursorDepth, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges())); + EQEmu::legacy::SlotCursor, cursorDepth, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges())); - for (uint8 indexSub = SUB_INDEX_BEGIN; (cursorDepth == 0) && inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::constants::ITEM_CONTAINER_SIZE); ++indexSub) { + for (uint8 indexSub = SUB_INDEX_BEGIN; (cursorDepth == 0) && inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) { inst_sub = inst_main->GetItem(indexSub); item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem(); linker.SetItemInst(inst_sub); @@ -2626,14 +2626,14 @@ void command_peekinv(Client *c, const Seperator *sep) item_link = linker.GenerateLink(); c->Message((item_data == nullptr), " CursorBagSlot: %i (Slot #%i, Bag #%i), Item: %i (%s), Charges: %i", - Inventory::CalcSlotId(SlotCursor, indexSub), SlotCursor, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges())); + Inventory::CalcSlotId(EQEmu::legacy::SlotCursor, indexSub), EQEmu::legacy::SlotCursor, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges())); } } } } // trib - for (int16 indexMain = EQEmu::constants::TRIBUTE_BEGIN; (scopeWhere & peekTrib) && (indexMain <= EQEmu::constants::TRIBUTE_END); ++indexMain) { + for (int16 indexMain = EQEmu::legacy::TRIBUTE_BEGIN; (scopeWhere & peekTrib) && (indexMain <= EQEmu::legacy::TRIBUTE_END); ++indexMain) { inst_main = targetClient->GetInv().GetItem(indexMain); item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem(); linker.SetItemInst(inst_main); @@ -2645,7 +2645,7 @@ void command_peekinv(Client *c, const Seperator *sep) } // bank - for (int16 indexMain = EQEmu::constants::BANK_BEGIN; (scopeWhere & peekBank) && (indexMain <= EQEmu::constants::BANK_END); ++indexMain) { + for (int16 indexMain = EQEmu::legacy::BANK_BEGIN; (scopeWhere & peekBank) && (indexMain <= EQEmu::legacy::BANK_END); ++indexMain) { inst_main = targetClient->GetInv().GetItem(indexMain); item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem(); linker.SetItemInst(inst_main); @@ -2655,7 +2655,7 @@ void command_peekinv(Client *c, const Seperator *sep) c->Message((item_data == nullptr), "BankSlot: %i, Item: %i (%s), Charges: %i", indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges())); - for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::constants::ITEM_CONTAINER_SIZE); ++indexSub) { + for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) { inst_sub = inst_main->GetItem(indexSub); item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem(); linker.SetItemInst(inst_sub); @@ -2667,7 +2667,7 @@ void command_peekinv(Client *c, const Seperator *sep) } } - for (int16 indexMain = EQEmu::constants::SHARED_BANK_BEGIN; (scopeWhere & peekBank) && (indexMain <= EQEmu::constants::SHARED_BANK_END); ++indexMain) { + for (int16 indexMain = EQEmu::legacy::SHARED_BANK_BEGIN; (scopeWhere & peekBank) && (indexMain <= EQEmu::legacy::SHARED_BANK_END); ++indexMain) { inst_main = targetClient->GetInv().GetItem(indexMain); item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem(); linker.SetItemInst(inst_main); @@ -2677,7 +2677,7 @@ void command_peekinv(Client *c, const Seperator *sep) c->Message((item_data == nullptr), "SharedBankSlot: %i, Item: %i (%s), Charges: %i", indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges())); - for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::constants::ITEM_CONTAINER_SIZE); ++indexSub) { + for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) { inst_sub = inst_main->GetItem(indexSub); item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem(); linker.SetItemInst(inst_sub); @@ -2690,7 +2690,7 @@ void command_peekinv(Client *c, const Seperator *sep) } // trade - for (int16 indexMain = EQEmu::constants::TRADE_BEGIN; (scopeWhere & peekTrade) && (indexMain <= EQEmu::constants::TRADE_END); ++indexMain) { + for (int16 indexMain = EQEmu::legacy::TRADE_BEGIN; (scopeWhere & peekTrade) && (indexMain <= EQEmu::legacy::TRADE_END); ++indexMain) { inst_main = targetClient->GetInv().GetItem(indexMain); item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem(); linker.SetItemInst(inst_main); @@ -2700,7 +2700,7 @@ void command_peekinv(Client *c, const Seperator *sep) c->Message((item_data == nullptr), "TradeSlot: %i, Item: %i (%s), Charges: %i", indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges())); - for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::constants::ITEM_CONTAINER_SIZE); ++indexSub) { + for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) { inst_sub = inst_main->GetItem(indexSub); item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem(); linker.SetItemInst(inst_sub); @@ -2722,7 +2722,7 @@ void command_peekinv(Client *c, const Seperator *sep) else { c->Message(0, "[WorldObject DBID: %i (entityid: %i)]", objectTradeskill->GetDBID(), objectTradeskill->GetID()); - for (int16 indexMain = SLOT_BEGIN; indexMain < EQEmu::constants::TYPE_WORLD_SIZE; ++indexMain) { + for (int16 indexMain = SLOT_BEGIN; indexMain < EQEmu::legacy::TYPE_WORLD_SIZE; ++indexMain) { inst_main = objectTradeskill->GetItem(indexMain); item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem(); linker.SetItemInst(inst_main); @@ -2730,9 +2730,9 @@ void command_peekinv(Client *c, const Seperator *sep) item_link = linker.GenerateLink(); c->Message((item_data == nullptr), "WorldSlot: %i, Item: %i (%s), Charges: %i", - (EQEmu::constants::WORLD_BEGIN + indexMain), ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges())); + (EQEmu::legacy::WORLD_BEGIN + indexMain), ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges())); - for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::constants::ITEM_CONTAINER_SIZE); ++indexSub) { + for (uint8 indexSub = SUB_INDEX_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++indexSub) { inst_sub = inst_main->GetItem(indexSub); item_data = (inst_sub == nullptr) ? nullptr : inst_sub->GetItem(); linker.SetItemInst(inst_sub); @@ -3140,8 +3140,8 @@ void command_listpetition(Client *c, const Seperator *sep) void command_equipitem(Client *c, const Seperator *sep) { uint32 slot_id = atoi(sep->arg[1]); - if (sep->IsNumber(1) && ((slot_id >= EQEmu::constants::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::constants::EQUIPMENT_END) || (slot_id == SlotPowerSource))) { - const ItemInst* from_inst = c->GetInv().GetItem(SlotCursor); + if (sep->IsNumber(1) && ((slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::legacy::EQUIPMENT_END) || (slot_id == EQEmu::legacy::SlotPowerSource))) { + const ItemInst* from_inst = c->GetInv().GetItem(EQEmu::legacy::SlotCursor); const ItemInst* to_inst = c->GetInv().GetItem(slot_id); // added (desync issue when forcing stack to stack) bool partialmove = false; int16 movecount; @@ -3149,7 +3149,7 @@ void command_equipitem(Client *c, const Seperator *sep) if (from_inst && from_inst->IsType(ItemClassCommon)) { EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoveItem, sizeof(MoveItem_Struct)); MoveItem_Struct* mi = (MoveItem_Struct*)outapp->pBuffer; - mi->from_slot = SlotCursor; + mi->from_slot = EQEmu::legacy::SlotCursor; mi->to_slot = slot_id; // mi->number_in_stack = from_inst->GetCharges(); // replaced with con check for stacking @@ -4333,7 +4333,7 @@ void command_goto(Client *c, const Seperator *sep) void command_iteminfo(Client *c, const Seperator *sep) { - auto inst = c->GetInv()[SlotCursor]; + auto inst = c->GetInv()[EQEmu::legacy::SlotCursor]; if (!inst) { c->Message(13, "Error: You need an item on your cursor for this command"); } auto item = inst->GetItem(); if (!item) { @@ -5491,9 +5491,9 @@ void command_summonitem(Client *c, const Seperator *sep) std::string cmd_msg = sep->msg; size_t link_open = cmd_msg.find('\x12'); size_t link_close = cmd_msg.find_last_of('\x12'); - if (link_open != link_close && (cmd_msg.length() - link_open) > EQEmu::constants::TEXT_LINK_BODY_LENGTH) { + if (link_open != link_close && (cmd_msg.length() - link_open) > EQEmu::legacy::TEXT_LINK_BODY_LENGTH) { EQEmu::saylink::SayLinkBody_Struct link_body; - EQEmu::saylink::DegenerateLinkBody(link_body, cmd_msg.substr(link_open + 1, EQEmu::constants::TEXT_LINK_BODY_LENGTH)); + EQEmu::saylink::DegenerateLinkBody(link_body, cmd_msg.substr(link_open + 1, EQEmu::legacy::TEXT_LINK_BODY_LENGTH)); itemid = link_body.item_id; } else if (!sep->IsNumber(1)) { @@ -7114,7 +7114,7 @@ void command_path(Client *c, const Seperator *sep) } void Client::Undye() { - for (int cur_slot = EQEmu::constants::MATERIAL_BEGIN; cur_slot <= EQEmu::constants::MATERIAL_END; cur_slot++ ) { + for (int cur_slot = EQEmu::legacy::MATERIAL_BEGIN; cur_slot <= EQEmu::legacy::MATERIAL_END; cur_slot++) { uint8 slot2=SlotConvert(cur_slot); ItemInst* inst = m_inv.GetItem(slot2); diff --git a/zone/corpse.cpp b/zone/corpse.cpp index 2bb9883fa..90dad987d 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -328,12 +328,12 @@ Corpse::Corpse(Client* client, int32 in_rezexp) : Mob ( // to go into the regular slots on the player, out of bags std::list removed_list; - for(i = SLOT_BEGIN; i < EQEmu::constants::TYPE_POSSESSIONS_SIZE; ++i) { - if (i == SlotAmmo && client->ClientVersion() >= EQEmu::versions::ClientVersion::SoF) { - item = client->GetInv().GetItem(SlotPowerSource); + for (i = SLOT_BEGIN; i < EQEmu::legacy::TYPE_POSSESSIONS_SIZE; ++i) { + if (i == EQEmu::legacy::SlotAmmo && client->ClientVersion() >= EQEmu::versions::ClientVersion::SoF) { + item = client->GetInv().GetItem(EQEmu::legacy::SlotPowerSource); if (item != nullptr) { if (!client->IsBecomeNPC() || (client->IsBecomeNPC() && !item->GetItem()->NoRent)) - MoveItemToCorpse(client, item, SlotPowerSource, removed_list); + MoveItemToCorpse(client, item, EQEmu::legacy::SlotPowerSource, removed_list); } } @@ -410,9 +410,9 @@ void Corpse::MoveItemToCorpse(Client *client, ItemInst *inst, int16 equipSlot, s while (true) { if (!inst->IsType(ItemClassContainer)) { break; } - if (equipSlot < EQEmu::constants::GENERAL_BEGIN || equipSlot > SlotCursor) { break; } + if (equipSlot < EQEmu::legacy::GENERAL_BEGIN || equipSlot > EQEmu::legacy::SlotCursor) { break; } - for (auto sub_index = SUB_INDEX_BEGIN; sub_index < EQEmu::constants::ITEM_CONTAINER_SIZE; ++sub_index) { + for (auto sub_index = SUB_INDEX_BEGIN; sub_index < EQEmu::legacy::ITEM_CONTAINER_SIZE; ++sub_index) { int16 real_bag_slot = Inventory::CalcSlotId(equipSlot, sub_index); auto bag_inst = client->GetInv().GetItem(real_bag_slot); if (bag_inst == nullptr) { continue; } @@ -748,7 +748,7 @@ void Corpse::RemoveItem(ServerLootItem_Struct* item_data) itemlist.erase(iter); uint8 material = Inventory::CalcMaterialFromSlot(sitem->equip_slot); // autos to unsigned char - if (material != MaterialInvalid) + if (material != EQEmu::legacy::MaterialInvalid) SendWearChange(material); UpdateEquipmentLight(); @@ -985,7 +985,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a if(inst) { if (item->RecastDelay) inst->SetRecastTimestamp(timestamps.count(item->RecastType) ? timestamps.at(item->RecastType) : 0); - client->SendItemPacket(EQEmu::constants::CORPSE_BEGIN, inst, ItemPacketLoot); + client->SendItemPacket(EQEmu::legacy::CORPSE_BEGIN, inst, ItemPacketLoot); safe_delete(inst); } else { client->Message(13, "Could not find item number %i to send!!", GetPlayerKillItem()); } @@ -1000,7 +1000,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a cur = itemlist.begin(); end = itemlist.end(); - int corpselootlimit = EQEmu::limits::InventoryTypeSize(EQEmu::versions::ConvertClientVersionToInventoryVersion(client->ClientVersion()), TypeCorpse); + int corpselootlimit = EQEmu::limits::InventoryTypeSize(EQEmu::versions::ConvertClientVersionToInventoryVersion(client->ClientVersion()), EQEmu::legacy::TypeCorpse); for(; cur != end; ++cur) { ServerLootItem_Struct* item_data = *cur; @@ -1009,7 +1009,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a // Dont display the item if it's in a bag // Added cursor queue slots to corpse item visibility list. Nothing else should be making it to corpse. - if(!IsPlayerCorpse() || item_data->equip_slot <= SlotCursor || item_data->equip_slot == SlotPowerSource || Loot_Request_Type>=3 || + if (!IsPlayerCorpse() || item_data->equip_slot <= EQEmu::legacy::SlotCursor || item_data->equip_slot == EQEmu::legacy::SlotPowerSource || Loot_Request_Type >= 3 || (item_data->equip_slot >= 8000 && item_data->equip_slot <= 8999)) { if(i < corpselootlimit) { item = database.GetItem(item_data->item_id); @@ -1019,7 +1019,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a if (item->RecastDelay) inst->SetRecastTimestamp(timestamps.count(item->RecastType) ? timestamps.at(item->RecastType) : 0); // SlotGeneral1 is the corpse inventory start offset for Ti(EMu) - CORPSE_END = SlotGeneral1 + SlotCursor - client->SendItemPacket(i + EQEmu::constants::CORPSE_BEGIN, inst, ItemPacketLoot); + client->SendItemPacket(i + EQEmu::legacy::CORPSE_BEGIN, inst, ItemPacketLoot); safe_delete(inst); } @@ -1119,10 +1119,10 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) { item = database.GetItem(GetPlayerKillItem()); } else if (GetPlayerKillItem() == -1 || GetPlayerKillItem() == 1){ - item_data = GetItem(lootitem->slot_id - EQEmu::constants::CORPSE_BEGIN); //dont allow them to loot entire bags of items as pvp reward + item_data = GetItem(lootitem->slot_id - EQEmu::legacy::CORPSE_BEGIN); //dont allow them to loot entire bags of items as pvp reward } else{ - item_data = GetItem(lootitem->slot_id - EQEmu::constants::CORPSE_BEGIN, bag_item_data); + item_data = GetItem(lootitem->slot_id - EQEmu::legacy::CORPSE_BEGIN, bag_item_data); } if (GetPlayerKillItem()<=1 && item_data != 0) { @@ -1148,7 +1148,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) { } if (inst->IsAugmented()) { - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) { + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) { ItemInst *itm = inst->GetAugment(i); if (itm) { if (client->CheckLoreConflict(itm->GetItem())) { @@ -1190,10 +1190,10 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) { /* First add it to the looter - this will do the bag contents too */ if (lootitem->auto_loot) { if (!client->AutoPutLootInInventory(*inst, true, true, bag_item_data)) - client->PutLootInInventory(SlotCursor, *inst, bag_item_data); + client->PutLootInInventory(EQEmu::legacy::SlotCursor, *inst, bag_item_data); } else { - client->PutLootInInventory(SlotCursor, *inst, bag_item_data); + client->PutLootInInventory(EQEmu::legacy::SlotCursor, *inst, bag_item_data); } /* Update any tasks that have an activity to loot this item */ @@ -1210,7 +1210,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) { /* Remove Bag Contents */ if (item->ItemClass == ItemClassContainer && (GetPlayerKillItem() != -1 || GetPlayerKillItem() != 1)) { - for (int i = SUB_INDEX_BEGIN; i < EQEmu::constants::ITEM_CONTAINER_SIZE; i++) { + for (int i = SUB_INDEX_BEGIN; i < EQEmu::legacy::ITEM_CONTAINER_SIZE; i++) { if (bag_item_data[i]) { /* Delete needs to be before RemoveItem because its deletes the pointer for item_data/bag_item_data */ database.DeleteItemOffCharacterCorpse(this->corpse_db_id, bag_item_data[i]->equip_slot, bag_item_data[i]->item_id); @@ -1294,13 +1294,13 @@ void Corpse::QueryLoot(Client* to) { cur = itemlist.begin(); end = itemlist.end(); - int corpselootlimit = EQEmu::limits::InventoryTypeSize(EQEmu::versions::ConvertClientVersionToInventoryVersion(to->ClientVersion()), TypeCorpse); + int corpselootlimit = EQEmu::limits::InventoryTypeSize(EQEmu::versions::ConvertClientVersionToInventoryVersion(to->ClientVersion()), EQEmu::legacy::TypeCorpse); for(; cur != end; ++cur) { ServerLootItem_Struct* sitem = *cur; if (IsPlayerCorpse()) { - if (sitem->equip_slot >= EQEmu::constants::GENERAL_BAGS_BEGIN && sitem->equip_slot <= EQEmu::constants::CURSOR_BAG_END) + if (sitem->equip_slot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && sitem->equip_slot <= EQEmu::legacy::CURSOR_BAG_END) sitem->lootslot = 0xFFFF; else x < corpselootlimit ? sitem->lootslot = x : sitem->lootslot = 0xFFFF; @@ -1402,7 +1402,7 @@ void Corpse::Spawn() { uint32 Corpse::GetEquipment(uint8 material_slot) const { int16 invslot; - if(material_slot > EQEmu::constants::MATERIAL_END) { + if (material_slot > EQEmu::legacy::MATERIAL_END) { return NO_ITEM; } @@ -1416,7 +1416,7 @@ uint32 Corpse::GetEquipment(uint8 material_slot) const { uint32 Corpse::GetEquipmentColor(uint8 material_slot) const { const Item_Struct *item; - if(material_slot > EQEmu::constants::MATERIAL_END) { + if (material_slot > EQEmu::legacy::MATERIAL_END) { return 0; } @@ -1436,8 +1436,8 @@ void Corpse::UpdateEquipmentLight() m_Light.Level.Equipment = 0; for (auto iter = itemlist.begin(); iter != itemlist.end(); ++iter) { - if (((*iter)->equip_slot < EQEmu::constants::EQUIPMENT_BEGIN || (*iter)->equip_slot > EQEmu::constants::EQUIPMENT_END) && (*iter)->equip_slot != SlotPowerSource) { continue; } - if ((*iter)->equip_slot == SlotAmmo) { continue; } + if (((*iter)->equip_slot < EQEmu::legacy::EQUIPMENT_BEGIN || (*iter)->equip_slot > EQEmu::legacy::EQUIPMENT_END) && (*iter)->equip_slot != EQEmu::legacy::SlotPowerSource) { continue; } + if ((*iter)->equip_slot == EQEmu::legacy::SlotAmmo) { continue; } auto item = database.GetItem((*iter)->item_id); if (item == nullptr) { continue; } @@ -1448,7 +1448,7 @@ void Corpse::UpdateEquipmentLight() uint8 general_light_type = 0; for (auto iter = itemlist.begin(); iter != itemlist.end(); ++iter) { - if ((*iter)->equip_slot < EQEmu::constants::GENERAL_BEGIN || (*iter)->equip_slot > EQEmu::constants::GENERAL_END) { continue; } + if ((*iter)->equip_slot < EQEmu::legacy::GENERAL_BEGIN || (*iter)->equip_slot > EQEmu::legacy::GENERAL_END) { continue; } auto item = database.GetItem((*iter)->item_id); if (item == nullptr) { continue; } diff --git a/zone/corpse.h b/zone/corpse.h index 365084b43..d96a38bdd 100644 --- a/zone/corpse.h +++ b/zone/corpse.h @@ -49,7 +49,7 @@ class Corpse : public Mob { /* Corpse: General */ virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill) { return true; } virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0) { return; } - virtual bool Attack(Mob* other, int Hand = SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = true, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0) { return false; } + virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = true, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0) { return false; } virtual bool HasRaid() { return false; } virtual bool HasGroup() { return false; } virtual Raid* GetRaid() { return 0; } diff --git a/zone/doors.cpp b/zone/doors.cpp index a12c74fd0..0a5227988 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -187,7 +187,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) uint8 keepoffkeyring = GetNoKeyring(); uint32 haskey = 0; uint32 playerkey = 0; - const ItemInst *lockpicks = sender->GetInv().GetItem(SlotCursor); + const ItemInst *lockpicks = sender->GetInv().GetItem(EQEmu::legacy::SlotCursor); haskey = sender->GetInv().HasItem(keyneeded, 1); diff --git a/zone/encounter.h b/zone/encounter.h index aa22d3870..05c1b075b 100644 --- a/zone/encounter.h +++ b/zone/encounter.h @@ -36,7 +36,7 @@ public: //abstract virtual function implementations required by base abstract class virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill) { return true; } virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0) { return; } - virtual bool Attack(Mob* other, int Hand = SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false, + virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0) { return false; } diff --git a/zone/entity.h b/zone/entity.h index f373e4251..90a372af8 100644 --- a/zone/entity.h +++ b/zone/entity.h @@ -322,7 +322,7 @@ public: void QueueToGroupsForNPCHealthAA(Mob* sender, const EQApplicationPacket* app); void QueueManaged(Mob* sender, const EQApplicationPacket* app, bool ignore_sender=false, bool ackreq = true); - void AEAttack(Mob *attacker, float dist, int Hand = SlotPrimary, int count = 0, bool IsFromSpell = false); + void AEAttack(Mob *attacker, float dist, int Hand = EQEmu::legacy::SlotPrimary, int count = 0, bool IsFromSpell = false); void AETaunt(Client *caster, float range=0, int32 bonus_hate=0); void AESpell(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster = true, int16 resist_adjust = 0); void MassGroupBuff(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster = true); diff --git a/zone/forage.cpp b/zone/forage.cpp index 7241b312a..0a9f81e77 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -153,7 +153,7 @@ uint32 ZoneDatabase::GetZoneFishing(uint32 ZoneID, uint8 skill, uint32 &npc_id, //we need this function to immediately determine, after we receive OP_Fishing, if we can even try to fish, otherwise we have to wait a while to get the failure bool Client::CanFish() { //make sure we still have a fishing pole on: - const ItemInst* Pole = m_inv[SlotPrimary]; + const ItemInst* Pole = m_inv[EQEmu::legacy::SlotPrimary]; int32 bslot = m_inv.HasItemByUse(ItemTypeFishingBait, 1, invWhereWorn|invWherePersonal); const ItemInst* Bait = nullptr; if (bslot != INVALID_INDEX) @@ -258,7 +258,7 @@ void Client::GoFish() Bait = m_inv.GetItem(bslot); //if the bait isnt equipped, need to add its skill bonus - if (bslot >= EQEmu::constants::GENERAL_BEGIN && Bait != nullptr && Bait->GetItem()->SkillModType == SkillFishing) { + if (bslot >= EQEmu::legacy::GENERAL_BEGIN && Bait != nullptr && Bait->GetItem()->SkillModType == SkillFishing) { fishing_skill += Bait->GetItem()->SkillModValue; } @@ -317,12 +317,12 @@ void Client::GoFish() else { PushItemOnCursor(*inst); - SendItemPacket(SlotCursor, inst, ItemPacketSummonItem); + SendItemPacket(EQEmu::legacy::SlotCursor, inst, ItemPacketSummonItem); if(RuleB(TaskSystem, EnableTaskSystem)) UpdateTasksForItem(ActivityFish, food_id); safe_delete(inst); - inst = m_inv.GetItem(SlotCursor); + inst = m_inv.GetItem(EQEmu::legacy::SlotCursor); } if(inst) { @@ -354,7 +354,7 @@ void Client::GoFish() //and then swap out items in primary slot... too lazy to fix right now if (zone->random.Int(0, 49) == 1) { Message_StringID(MT_Skills, FISHING_POLE_BROKE); //Your fishing pole broke! - DeleteItemInInventory(SlotPrimary, 0, true); + DeleteItemInInventory(EQEmu::legacy::SlotPrimary, 0, true); } if(CheckIncreaseSkill(SkillFishing, nullptr, 5)) @@ -433,12 +433,12 @@ void Client::ForageItem(bool guarantee) { } else { PushItemOnCursor(*inst); - SendItemPacket(SlotCursor, inst, ItemPacketSummonItem); + SendItemPacket(EQEmu::legacy::SlotCursor, inst, ItemPacketSummonItem); if(RuleB(TaskSystem, EnableTaskSystem)) UpdateTasksForItem(ActivityForage, foragedfood); safe_delete(inst); - inst = m_inv.GetItem(SlotCursor); + inst = m_inv.GetItem(EQEmu::legacy::SlotCursor); } if(inst) { diff --git a/zone/inventory.cpp b/zone/inventory.cpp index ddba7d13f..9d7c72f14 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -35,7 +35,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) { int i; if(where_to_check & invWhereWorn) { - for (i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::EQUIPMENT_END; i++) { + for (i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::EQUIPMENT_END; i++) { if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) { cur = m_inv.GetItem(i); if(cur && cur->GetItem()->Stackable) { @@ -48,8 +48,8 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) { } } - if (GetItemIDAt(SlotPowerSource) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(SlotPowerSource) != INVALID_ID)) { - cur = m_inv.GetItem(SlotPowerSource); + if (GetItemIDAt(EQEmu::legacy::SlotPowerSource) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(EQEmu::legacy::SlotPowerSource) != INVALID_ID)) { + cur = m_inv.GetItem(EQEmu::legacy::SlotPowerSource); if(cur && cur->GetItem()->Stackable) { x += cur->GetCharges(); } else { @@ -57,25 +57,25 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) { } if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) - DeleteItemInInventory(SlotPowerSource, 0, true); + DeleteItemInInventory(EQEmu::legacy::SlotPowerSource, 0, true); else - DeleteItemInInventory(SlotPowerSource, 0, false); // Prevents Titanium crash + DeleteItemInInventory(EQEmu::legacy::SlotPowerSource, 0, false); // Prevents Titanium crash } } if(where_to_check & invWhereCursor) { - if (GetItemIDAt(SlotCursor) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(SlotCursor) != INVALID_ID)) { - cur = m_inv.GetItem(SlotCursor); + if (GetItemIDAt(EQEmu::legacy::SlotCursor) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(EQEmu::legacy::SlotCursor) != INVALID_ID)) { + cur = m_inv.GetItem(EQEmu::legacy::SlotCursor); if(cur && cur->GetItem()->Stackable) { x += cur->GetCharges(); } else { x++; } - DeleteItemInInventory(SlotCursor, 0, true); + DeleteItemInInventory(EQEmu::legacy::SlotCursor, 0, true); } - for (i = EQEmu::constants::CURSOR_BAG_BEGIN; i <= EQEmu::constants::CURSOR_BAG_END; i++) { + for (i = EQEmu::legacy::CURSOR_BAG_BEGIN; i <= EQEmu::legacy::CURSOR_BAG_END; i++) { if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) { cur = m_inv.GetItem(i); if(cur && cur->GetItem()->Stackable) { @@ -90,7 +90,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) { } if(where_to_check & invWherePersonal) { - for (i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++) { + for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++) { if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) { cur = m_inv.GetItem(i); if(cur && cur->GetItem()->Stackable) { @@ -103,7 +103,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) { } } - for (i = EQEmu::constants::GENERAL_BAGS_BEGIN; i <= EQEmu::constants::GENERAL_BAGS_END; i++) { + for (i = EQEmu::legacy::GENERAL_BAGS_BEGIN; i <= EQEmu::legacy::GENERAL_BAGS_END; i++) { if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) { cur = m_inv.GetItem(i); if(cur && cur->GetItem()->Stackable) { @@ -118,7 +118,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) { } if(where_to_check & invWhereBank) { - for (i = EQEmu::constants::BANK_BEGIN; i <= EQEmu::constants::BANK_END; i++) { + for (i = EQEmu::legacy::BANK_BEGIN; i <= EQEmu::legacy::BANK_END; i++) { if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) { cur = m_inv.GetItem(i); if(cur && cur->GetItem()->Stackable) { @@ -131,7 +131,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) { } } - for (i = EQEmu::constants::BANK_BAGS_BEGIN; i <= EQEmu::constants::BANK_BAGS_END; i++) { + for (i = EQEmu::legacy::BANK_BAGS_BEGIN; i <= EQEmu::legacy::BANK_BAGS_END; i++) { if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) { cur = m_inv.GetItem(i); if(cur && cur->GetItem()->Stackable) { @@ -146,7 +146,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) { } if(where_to_check & invWhereSharedBank) { - for (i = EQEmu::constants::SHARED_BANK_BEGIN; i <= EQEmu::constants::SHARED_BANK_END; i++) { + for (i = EQEmu::legacy::SHARED_BANK_BEGIN; i <= EQEmu::legacy::SHARED_BANK_END; i++) { if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) { cur = m_inv.GetItem(i); if(cur && cur->GetItem()->Stackable) { @@ -159,7 +159,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) { } } - for (i = EQEmu::constants::SHARED_BANK_BAGS_BEGIN; i <= EQEmu::constants::SHARED_BANK_BAGS_END; i++) { + for (i = EQEmu::legacy::SHARED_BANK_BAGS_BEGIN; i <= EQEmu::legacy::SHARED_BANK_BAGS_END; i++) { if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) { cur = m_inv.GetItem(i); if(cur && cur->GetItem()->Stackable) { @@ -236,7 +236,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, } */ - uint32 augments[EQEmu::constants::ITEM_COMMON_SIZE] = { aug1, aug2, aug3, aug4, aug5, aug6 }; + uint32 augments[EQEmu::legacy::ITEM_COMMON_SIZE] = { aug1, aug2, aug3, aug4, aug5, aug6 }; uint32 classes = item->Classes; uint32 races = item->Races; @@ -246,7 +246,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, bool enforcerestr = RuleB(Inventory, EnforceAugmentRestriction); bool enforceusable = RuleB(Inventory, EnforceAugmentUsability); - for (int iter = AUG_INDEX_BEGIN; iter < EQEmu::constants::ITEM_COMMON_SIZE; ++iter) { + for (int iter = AUG_INDEX_BEGIN; iter < EQEmu::legacy::ITEM_COMMON_SIZE; ++iter) { const Item_Struct* augtest = database.GetItem(augments[iter]); if(augtest == nullptr) { @@ -540,7 +540,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, } // add any validated augments - for (int iter = AUG_INDEX_BEGIN; iter < EQEmu::constants::ITEM_COMMON_SIZE; ++iter) { + for (int iter = AUG_INDEX_BEGIN; iter < EQEmu::legacy::ITEM_COMMON_SIZE; ++iter) { if(augments[iter]) inst->PutAugment(&database, iter, augments[iter]); } @@ -554,22 +554,22 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, inst->SetOrnamentHeroModel(ornament_hero_model); // check to see if item is usable in requested slot - if(enforceusable && (((to_slot >= SlotCharm) && (to_slot <= SlotAmmo)) || (to_slot == SlotPowerSource))) { - uint32 slottest = (to_slot == SlotPowerSource) ? 22 : to_slot; // can't change '22' just yet... + if (enforceusable && (((to_slot >= EQEmu::legacy::SlotCharm) && (to_slot <= EQEmu::legacy::SlotAmmo)) || (to_slot == EQEmu::legacy::SlotPowerSource))) { + uint32 slottest = (to_slot == EQEmu::legacy::SlotPowerSource) ? 22 : to_slot; // can't change '22' just yet... if(!(slots & ((uint32)1 << slottest))) { Message(0, "This item is not equipable at slot %u - moving to cursor.", to_slot); Log.Out(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to equip an item unusable in slot %u - moved to cursor.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, to_slot, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); - to_slot = SlotCursor; + to_slot = EQEmu::legacy::SlotCursor; } } // put item into inventory - if (to_slot == SlotCursor) { + if (to_slot == EQEmu::legacy::SlotCursor) { PushItemOnCursor(*inst); - SendItemPacket(SlotCursor, inst, ItemPacketSummonItem); + SendItemPacket(EQEmu::legacy::SlotCursor, inst, ItemPacketSummonItem); } else { PutItemInInventory(to_slot, *inst, true); @@ -617,7 +617,7 @@ void Client::DropItem(int16 slot_id) } // Save client inventory change to database - if (slot_id == SlotCursor) { + if (slot_id == EQEmu::legacy::SlotCursor) { SendCursorBuffer(); auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend(); database.SaveCursor(CharacterID(), s, e); @@ -706,11 +706,11 @@ void Client::SendCursorBuffer() GetName(), test_item->Name, test_item->ID); Message_StringID(MT_LootMessages, 290); parse->EventItem(EVENT_DESTROY_ITEM, this, test_inst, nullptr, "", 0); - DeleteItemInInventory(SlotCursor); + DeleteItemInInventory(EQEmu::legacy::SlotCursor); SendCursorBuffer(); } else { - SendItemPacket(SlotCursor, test_inst, ItemPacketSummonItem); + SendItemPacket(EQEmu::legacy::SlotCursor, test_inst, ItemPacketSummonItem); } } @@ -788,7 +788,7 @@ void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_upd bool isDeleted = m_inv.DeleteItem(slot_id, quantity); const ItemInst* inst = nullptr; - if (slot_id == SlotCursor) { + if (slot_id == EQEmu::legacy::SlotCursor) { auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend(); if(update_db) database.SaveCursor(character_id, s, e); @@ -840,7 +840,7 @@ bool Client::PushItemOnCursor(const ItemInst& inst, bool client_update) m_inv.PushCursor(inst); if (client_update) { - SendItemPacket(SlotCursor, &inst, ItemPacketSummonItem); + SendItemPacket(EQEmu::legacy::SlotCursor, &inst, ItemPacketSummonItem); } auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend(); @@ -854,7 +854,7 @@ bool Client::PushItemOnCursor(const ItemInst& inst, bool client_update) bool Client::PutItemInInventory(int16 slot_id, const ItemInst& inst, bool client_update) { Log.Out(Logs::Detail, Logs::Inventory, "Putting item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id); - if (slot_id == SlotCursor) { // don't trust macros before conditional statements... + if (slot_id == EQEmu::legacy::SlotCursor) { // don't trust macros before conditional statements... return PushItemOnCursor(inst, client_update); } else { @@ -863,11 +863,11 @@ bool Client::PutItemInInventory(int16 slot_id, const ItemInst& inst, bool client if (client_update) { - SendItemPacket(slot_id, &inst, ((slot_id == SlotCursor) ? ItemPacketSummonItem : ItemPacketTrade)); + SendItemPacket(slot_id, &inst, ((slot_id == EQEmu::legacy::SlotCursor) ? ItemPacketSummonItem : ItemPacketTrade)); //SendWearChange(Inventory::CalcMaterialFromSlot(slot_id)); } - if (slot_id == SlotCursor) { + if (slot_id == EQEmu::legacy::SlotCursor) { auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend(); return database.SaveCursor(this->CharacterID(), s, e); } @@ -885,7 +885,7 @@ void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootI bool cursor_empty = m_inv.CursorEmpty(); - if (slot_id == SlotCursor) { + if (slot_id == EQEmu::legacy::SlotCursor) { m_inv.PushCursor(inst); auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend(); database.SaveCursor(this->CharacterID(), s, e); @@ -896,7 +896,7 @@ void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootI } // Subordinate items in cursor buffer must be sent via ItemPacketSummonItem or we just overwrite the visible cursor and desync the client - if (slot_id == SlotCursor && !cursor_empty) { + if (slot_id == EQEmu::legacy::SlotCursor && !cursor_empty) { // RoF+ currently has a specialized cursor handler if (ClientVersion() < EQEmu::versions::ClientVersion::RoF) SendItemPacket(slot_id, &inst, ItemPacketSummonItem); @@ -906,7 +906,7 @@ void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootI } if (bag_item_data) { - for (int index = 0; index < EQEmu::constants::ITEM_CONTAINER_SIZE; ++index) { + for (int index = 0; index < EQEmu::legacy::ITEM_CONTAINER_SIZE; ++index) { if (bag_item_data[index] == nullptr) continue; @@ -924,12 +924,12 @@ void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootI // Dump bag contents to cursor in the event that owning bag is not the first cursor item // (This assumes that the data passed is correctly associated..no safety checks are implemented) - if (slot_id == SlotCursor && !cursor_empty) { + if (slot_id == EQEmu::legacy::SlotCursor && !cursor_empty) { Log.Out(Logs::Detail, Logs::Inventory, "Putting bag loot item %s (%d) into slot %d (non-empty cursor override)", - inst.GetItem()->Name, inst.GetItem()->ID, SlotCursor); + inst.GetItem()->Name, inst.GetItem()->ID, EQEmu::legacy::SlotCursor); - PutLootInInventory(SlotCursor, *bagitem); + PutLootInInventory(EQEmu::legacy::SlotCursor, *bagitem); } else { auto bag_slot = Inventory::CalcSlotId(slot_id, index); @@ -951,7 +951,7 @@ bool Client::TryStacking(ItemInst* item, uint8 type, bool try_worn, bool try_cur return false; int16 i; uint32 item_id = item->GetItem()->ID; - for (i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++) { + for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++) { ItemInst* tmp_inst = m_inv.GetItem(i); if(tmp_inst && tmp_inst->GetItem()->ID == item_id && tmp_inst->GetCharges() < tmp_inst->GetItem()->StackSize){ MoveItemCharges(*item, i, type); @@ -962,8 +962,8 @@ bool Client::TryStacking(ItemInst* item, uint8 type, bool try_worn, bool try_cur return true; } } - for (i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++) { - for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::constants::ITEM_CONTAINER_SIZE; j++) { + for (i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::GENERAL_END; i++) { + for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::legacy::ITEM_CONTAINER_SIZE; j++) { uint16 slotid = Inventory::CalcSlotId(i, j); ItemInst* tmp_inst = m_inv.GetItem(slotid); @@ -988,29 +988,29 @@ bool Client::AutoPutLootInInventory(ItemInst& inst, bool try_worn, bool try_curs // #1: Try to auto equip if (try_worn && inst.IsEquipable(GetBaseRace(), GetClass()) && inst.GetItem()->ReqLevel<=level && (!inst.GetItem()->Attuneable || inst.IsAttuned()) && inst.GetItem()->ItemType != ItemTypeAugmentation) { // too messy as-is... - for (int16 i = EQEmu::constants::EQUIPMENT_BEGIN; i < SlotPowerSource; i++) { // originally (i < 22) - if (i == EQEmu::constants::GENERAL_BEGIN) { + for (int16 i = EQEmu::legacy::EQUIPMENT_BEGIN; i < EQEmu::legacy::SlotPowerSource; i++) { // originally (i < 22) + if (i == EQEmu::legacy::GENERAL_BEGIN) { // added power source check for SoF+ clients if (this->ClientVersion() >= EQEmu::versions::ClientVersion::SoF) - i = SlotPowerSource; + i = EQEmu::legacy::SlotPowerSource; else break; } if (!m_inv[i]) { - if (i == SlotPrimary && inst.IsWeapon()) { // If item is primary slot weapon + if (i == EQEmu::legacy::SlotPrimary && inst.IsWeapon()) { // If item is primary slot weapon if ((inst.GetItem()->ItemType == ItemType2HSlash) || (inst.GetItem()->ItemType == ItemType2HBlunt) || (inst.GetItem()->ItemType == ItemType2HPiercing)) { // and uses 2hs \ 2hb \ 2hp - if (m_inv[SlotSecondary]) { // and if secondary slot is not empty + if (m_inv[EQEmu::legacy::SlotSecondary]) { // and if secondary slot is not empty continue; // Can't auto-equip } } } - if (i == SlotSecondary && m_inv[SlotPrimary]) { // check to see if primary slot is a two hander - uint8 use = m_inv[SlotPrimary]->GetItem()->ItemType; + if (i == EQEmu::legacy::SlotSecondary && m_inv[EQEmu::legacy::SlotPrimary]) { // check to see if primary slot is a two hander + uint8 use = m_inv[EQEmu::legacy::SlotPrimary]->GetItem()->ItemType; if (use == ItemType2HSlash || use == ItemType2HBlunt || use == ItemType2HPiercing) continue; } - if (i == SlotSecondary && inst.IsWeapon() && !CanThisClassDualWield()) { + if (i == EQEmu::legacy::SlotSecondary && inst.IsWeapon() && !CanThisClassDualWield()) { continue; } @@ -1018,7 +1018,7 @@ bool Client::AutoPutLootInInventory(ItemInst& inst, bool try_worn, bool try_curs //send worn to everyone... PutLootInInventory(i, inst); uint8 worn_slot_material = Inventory::CalcMaterialFromSlot(i); - if (worn_slot_material != MaterialInvalid) { + if (worn_slot_material != EQEmu::legacy::MaterialInvalid) { SendWearChange(worn_slot_material); } @@ -1061,7 +1061,7 @@ void Client::MoveItemCharges(ItemInst &from, int16 to_slot, uint8 type) tmp_inst->SetCharges(tmp_inst->GetCharges() + charges_to_move); from.SetCharges(from.GetCharges() - charges_to_move); SendLootItemInPacket(tmp_inst, to_slot); - if (to_slot == SlotCursor) { + if (to_slot == EQEmu::legacy::SlotCursor) { auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend(); database.SaveCursor(this->CharacterID(), s, e); } @@ -1318,16 +1318,16 @@ void Client::SendLootItemInPacket(const ItemInst* inst, int16 slot_id) bool Client::IsValidSlot(uint32 slot) { if ((slot == (uint32)INVALID_INDEX) || - (slot >= SLOT_BEGIN && slot < EQEmu::constants::TYPE_POSSESSIONS_SIZE) || - (slot >= EQEmu::constants::GENERAL_BAGS_BEGIN && slot <= EQEmu::constants::CURSOR_BAG_END) || - (slot >= EQEmu::constants::TRIBUTE_BEGIN && slot <= EQEmu::constants::TRIBUTE_END) || - (slot >= EQEmu::constants::BANK_BEGIN && slot <= EQEmu::constants::BANK_END) || - (slot >= EQEmu::constants::BANK_BAGS_BEGIN && slot <= EQEmu::constants::BANK_BAGS_END) || - (slot >= EQEmu::constants::SHARED_BANK_BEGIN && slot <= EQEmu::constants::SHARED_BANK_END) || - (slot >= EQEmu::constants::SHARED_BANK_BAGS_BEGIN && slot <= EQEmu::constants::SHARED_BANK_BAGS_END) || - (slot >= EQEmu::constants::TRADE_BEGIN && slot <= EQEmu::constants::TRADE_END) || - (slot >= EQEmu::constants::WORLD_BEGIN && slot <= EQEmu::constants::WORLD_END) || - (slot == SlotPowerSource) + (slot >= SLOT_BEGIN && slot < EQEmu::legacy::TYPE_POSSESSIONS_SIZE) || + (slot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && slot <= EQEmu::legacy::CURSOR_BAG_END) || + (slot >= EQEmu::legacy::TRIBUTE_BEGIN && slot <= EQEmu::legacy::TRIBUTE_END) || + (slot >= EQEmu::legacy::BANK_BEGIN && slot <= EQEmu::legacy::BANK_END) || + (slot >= EQEmu::legacy::BANK_BAGS_BEGIN && slot <= EQEmu::legacy::BANK_BAGS_END) || + (slot >= EQEmu::legacy::SHARED_BANK_BEGIN && slot <= EQEmu::legacy::SHARED_BANK_END) || + (slot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && slot <= EQEmu::legacy::SHARED_BANK_BAGS_END) || + (slot >= EQEmu::legacy::TRADE_BEGIN && slot <= EQEmu::legacy::TRADE_END) || + (slot >= EQEmu::legacy::WORLD_BEGIN && slot <= EQEmu::legacy::WORLD_END) || + (slot == EQEmu::legacy::SlotPowerSource) ) { return true; } @@ -1338,10 +1338,10 @@ bool Client::IsValidSlot(uint32 slot) { bool Client::IsBankSlot(uint32 slot) { - if ((slot >= EQEmu::constants::BANK_BEGIN && slot <= EQEmu::constants::BANK_END) || - (slot >= EQEmu::constants::BANK_BAGS_BEGIN && slot <= EQEmu::constants::BANK_BAGS_END) || - (slot >= EQEmu::constants::SHARED_BANK_BEGIN && slot <= EQEmu::constants::SHARED_BANK_END) || - (slot >= EQEmu::constants::SHARED_BANK_BAGS_BEGIN && slot <= EQEmu::constants::SHARED_BANK_BAGS_END)) + if ((slot >= EQEmu::legacy::BANK_BEGIN && slot <= EQEmu::legacy::BANK_END) || + (slot >= EQEmu::legacy::BANK_BAGS_BEGIN && slot <= EQEmu::legacy::BANK_BAGS_END) || + (slot >= EQEmu::legacy::SHARED_BANK_BEGIN && slot <= EQEmu::legacy::SHARED_BANK_END) || + (slot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && slot <= EQEmu::legacy::SHARED_BANK_BAGS_END)) { return true; } @@ -1377,8 +1377,8 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF) { return true; } // Can't do RoF+ - if (move_in->to_slot == SlotCursor) { - auto test_inst = m_inv.GetItem(SlotCursor); + if (move_in->to_slot == EQEmu::legacy::SlotCursor) { + auto test_inst = m_inv.GetItem(EQEmu::legacy::SlotCursor); if (test_inst == nullptr) { return true; } auto test_item = test_inst->GetItem(); if (test_item == nullptr) { return true; } @@ -1397,18 +1397,18 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { GetName(), test_item->Name, test_item->ID); Message_StringID(MT_LootMessages, 290); parse->EventItem(EVENT_DESTROY_ITEM, this, test_inst, nullptr, "", 0); - DeleteItemInInventory(SlotCursor, 0, true); + DeleteItemInInventory(EQEmu::legacy::SlotCursor, 0, true); } } return true; } if (move_in->to_slot == (uint32)INVALID_INDEX) { - if (move_in->from_slot == (uint32)SlotCursor) { + if (move_in->from_slot == (uint32)EQEmu::legacy::SlotCursor) { Log.Out(Logs::Detail, Logs::Inventory, "Client destroyed item from cursor slot %d", move_in->from_slot); if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit - ItemInst *inst = m_inv.GetItem(SlotCursor); + ItemInst *inst = m_inv.GetItem(EQEmu::legacy::SlotCursor); if(inst) { parse->EventItem(EVENT_DESTROY_ITEM, this, inst, nullptr, "", 0); } @@ -1425,9 +1425,9 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { return true; // Item deletion } } - if(auto_attack && (move_in->from_slot == SlotPrimary || move_in->from_slot == SlotSecondary || move_in->from_slot == SlotRange)) + if (auto_attack && (move_in->from_slot == EQEmu::legacy::SlotPrimary || move_in->from_slot == EQEmu::legacy::SlotSecondary || move_in->from_slot == EQEmu::legacy::SlotRange)) SetAttackTimer(); - else if(auto_attack && (move_in->to_slot == SlotPrimary || move_in->to_slot == SlotSecondary || move_in->to_slot == SlotRange)) + else if (auto_attack && (move_in->to_slot == EQEmu::legacy::SlotPrimary || move_in->to_slot == EQEmu::legacy::SlotSecondary || move_in->to_slot == EQEmu::legacy::SlotRange)) SetAttackTimer(); // Step 1: Variables int16 src_slot_id = (int16)move_in->from_slot; @@ -1475,13 +1475,13 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { uint32 dstbagid = 0; //if (src_slot_id >= 250 && src_slot_id < 330) { - if (src_slot_id >= EQEmu::constants::GENERAL_BAGS_BEGIN && src_slot_id <= EQEmu::constants::GENERAL_BAGS_END) { + if (src_slot_id >= EQEmu::legacy::GENERAL_BAGS_BEGIN && src_slot_id <= EQEmu::legacy::GENERAL_BAGS_END) { srcbag = m_inv.GetItem(((int)(src_slot_id / 10)) - 3); if (srcbag) srcbagid = srcbag->GetItem()->ID; } //if (dst_slot_id >= 250 && dst_slot_id < 330) { - if (dst_slot_id >= EQEmu::constants::GENERAL_BAGS_BEGIN && dst_slot_id <= EQEmu::constants::GENERAL_BAGS_END) { + if (dst_slot_id >= EQEmu::legacy::GENERAL_BAGS_BEGIN && dst_slot_id <= EQEmu::legacy::GENERAL_BAGS_END) { dstbag = m_inv.GetItem(((int)(dst_slot_id / 10)) - 3); if (dstbag) dstbagid = dstbag->GetItem()->ID; @@ -1494,7 +1494,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { // Step 2: Validate item in from_slot // After this, we can assume src_inst is a valid ptr - if (!src_inst && (src_slot_id < EQEmu::constants::WORLD_BEGIN || src_slot_id > EQEmu::constants::WORLD_END)) { + if (!src_inst && (src_slot_id < EQEmu::legacy::WORLD_BEGIN || src_slot_id > EQEmu::legacy::WORLD_END)) { if (dst_inst) { // If there is no source item, but there is a destination item, // move the slots around before deleting the invalid source slot item, @@ -1508,14 +1508,14 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { return false; } //verify shared bank transactions in the database - if(src_inst && src_slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::constants::SHARED_BANK_BAGS_END) { + if (src_inst && src_slot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::legacy::SHARED_BANK_BAGS_END) { if(!database.VerifyInventory(account_id, src_slot_id, src_inst)) { Log.Out(Logs::General, Logs::Error, "Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name); DeleteItemInInventory(dst_slot_id,0,true); return(false); } - if(src_slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::constants::SHARED_BANK_END && src_inst->IsType(ItemClassContainer)){ - for (uint8 idx = SUB_INDEX_BEGIN; idx < EQEmu::constants::ITEM_CONTAINER_SIZE; idx++) { + if (src_slot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::legacy::SHARED_BANK_END && src_inst->IsType(ItemClassContainer)){ + for (uint8 idx = SUB_INDEX_BEGIN; idx < EQEmu::legacy::ITEM_CONTAINER_SIZE; idx++) { const ItemInst* baginst = src_inst->GetItem(idx); if(baginst && !database.VerifyInventory(account_id, Inventory::CalcSlotId(src_slot_id, idx), baginst)){ DeleteItemInInventory(Inventory::CalcSlotId(src_slot_id, idx),0,false); @@ -1523,14 +1523,14 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { } } } - if(dst_inst && dst_slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::constants::SHARED_BANK_BAGS_END) { + if (dst_inst && dst_slot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::legacy::SHARED_BANK_BAGS_END) { if(!database.VerifyInventory(account_id, dst_slot_id, dst_inst)) { Log.Out(Logs::General, Logs::Error, "Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name); DeleteItemInInventory(src_slot_id,0,true); return(false); } - if(dst_slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::constants::SHARED_BANK_END && dst_inst->IsType(ItemClassContainer)){ - for (uint8 idx = SUB_INDEX_BEGIN; idx < EQEmu::constants::ITEM_CONTAINER_SIZE; idx++) { + if (dst_slot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::legacy::SHARED_BANK_END && dst_inst->IsType(ItemClassContainer)){ + for (uint8 idx = SUB_INDEX_BEGIN; idx < EQEmu::legacy::ITEM_CONTAINER_SIZE; idx++) { const ItemInst* baginst = dst_inst->GetItem(idx); if(baginst && !database.VerifyInventory(account_id, Inventory::CalcSlotId(dst_slot_id, idx), baginst)){ DeleteItemInInventory(Inventory::CalcSlotId(dst_slot_id, idx),0,false); @@ -1542,8 +1542,8 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { // Check for No Drop Hacks Mob* with = trade->With(); - if (((with && with->IsClient() && dst_slot_id >= EQEmu::constants::TRADE_BEGIN && dst_slot_id <= EQEmu::constants::TRADE_END) || - (dst_slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::constants::SHARED_BANK_BAGS_END)) + if (((with && with->IsClient() && dst_slot_id >= EQEmu::legacy::TRADE_BEGIN && dst_slot_id <= EQEmu::legacy::TRADE_END) || + (dst_slot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::legacy::SHARED_BANK_BAGS_END)) && GetInv().CheckNoDrop(src_slot_id) && RuleI(World, FVNoDropFlag) == 0 || RuleI(Character, MinStatusForNoDropExemptions) < Admin() && RuleI(World, FVNoDropFlag) == 2) { auto ndh_inst = m_inv[src_slot_id]; @@ -1573,7 +1573,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { // Step 3: Check for interaction with World Container (tradeskills) if(m_tradeskill_object != nullptr) { - if (src_slot_id >= EQEmu::constants::WORLD_BEGIN && src_slot_id <= EQEmu::constants::WORLD_END) { + if (src_slot_id >= EQEmu::legacy::WORLD_BEGIN && src_slot_id <= EQEmu::legacy::WORLD_END) { // Picking up item from world container ItemInst* inst = m_tradeskill_object->PopItem(Inventory::CalcBagIdx(src_slot_id)); if (inst) { @@ -1585,7 +1585,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { return true; } - else if (dst_slot_id >= EQEmu::constants::WORLD_BEGIN && dst_slot_id <= EQEmu::constants::WORLD_END) { + else if (dst_slot_id >= EQEmu::legacy::WORLD_BEGIN && dst_slot_id <= EQEmu::legacy::WORLD_END) { // Putting item into world container, which may swap (or pile onto) with existing item uint8 world_idx = Inventory::CalcBagIdx(dst_slot_id); ItemInst* world_inst = m_tradeskill_object->PopItem(world_idx); @@ -1637,7 +1637,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { } safe_delete(world_inst); - if (src_slot_id == SlotCursor) + if (src_slot_id == EQEmu::legacy::SlotCursor) { if (dstitemid == 0) { @@ -1658,15 +1658,15 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { } // Step 4: Check for entity trade - if (dst_slot_id >= EQEmu::constants::TRADE_BEGIN && dst_slot_id <= EQEmu::constants::TRADE_END) { - if (src_slot_id != SlotCursor) { + if (dst_slot_id >= EQEmu::legacy::TRADE_BEGIN && dst_slot_id <= EQEmu::legacy::TRADE_END) { + if (src_slot_id != EQEmu::legacy::SlotCursor) { Kick(); return false; } if (with) { Log.Out(Logs::Detail, Logs::Inventory, "Trade item move from slot %d to slot %d (trade with %s)", src_slot_id, dst_slot_id, with->GetName()); // Fill Trade list with items from cursor - if (!m_inv[SlotCursor]) { + if (!m_inv[EQEmu::legacy::SlotCursor]) { Message(13, "Error: Cursor item not located on server!"); return false; } @@ -1686,7 +1686,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit SummonItem(src_inst->GetID(), src_inst->GetCharges()); - DeleteItemInInventory(SlotCursor); + DeleteItemInInventory(EQEmu::legacy::SlotCursor); return true; } @@ -1751,12 +1751,12 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { } else { // Not dealing with charges - just do direct swap - if(src_inst && (dst_slot_id <= EQEmu::constants::EQUIPMENT_END || dst_slot_id == SlotPowerSource) && dst_slot_id >= EQEmu::constants::EQUIPMENT_BEGIN) { + if (src_inst && (dst_slot_id <= EQEmu::legacy::EQUIPMENT_END || dst_slot_id == EQEmu::legacy::SlotPowerSource) && dst_slot_id >= EQEmu::legacy::EQUIPMENT_BEGIN) { if (src_inst->GetItem()->Attuneable) { src_inst->SetAttuned(true); } if (src_inst->IsAugmented()) { - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) { + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) { if (src_inst->GetAugment(i)) { if (src_inst->GetAugment(i)->GetItem()->Attuneable) { src_inst->GetAugment(i)->SetAttuned(true); @@ -1769,7 +1769,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if(!m_inv.SwapItem(src_slot_id, dst_slot_id)) { return false; } Log.Out(Logs::Detail, Logs::Inventory, "Moving entire item from slot %d to slot %d", src_slot_id, dst_slot_id); - if(src_slot_id <= EQEmu::constants::EQUIPMENT_END || src_slot_id == SlotPowerSource) { + if (src_slot_id <= EQEmu::legacy::EQUIPMENT_END || src_slot_id == EQEmu::legacy::SlotPowerSource) { if(src_inst) { parse->EventItem(EVENT_UNEQUIP_ITEM, this, src_inst, nullptr, "", src_slot_id); } @@ -1779,7 +1779,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { } } - if(dst_slot_id <= EQEmu::constants::EQUIPMENT_END || dst_slot_id == SlotPowerSource) { + if (dst_slot_id <= EQEmu::legacy::EQUIPMENT_END || dst_slot_id == EQEmu::legacy::SlotPowerSource) { if(dst_inst) { parse->EventItem(EVENT_UNEQUIP_ITEM, this, dst_inst, nullptr, "", dst_slot_id); } @@ -1791,12 +1791,12 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { } int matslot = SlotConvert2(dst_slot_id); - if (dst_slot_id <= EQEmu::constants::EQUIPMENT_END && matslot != MaterialHead) { // think this is to allow the client to update with /showhelm + if (dst_slot_id <= EQEmu::legacy::EQUIPMENT_END && matslot != EQEmu::legacy::MaterialHead) { // think this is to allow the client to update with /showhelm SendWearChange(matslot); } // Step 7: Save change to the database - if (src_slot_id == SlotCursor) { + if (src_slot_id == EQEmu::legacy::SlotCursor) { // If not swapping another item to cursor and stacking items were depleted if (dstitemid == 0 || all_to_stack == true) { @@ -1809,7 +1809,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { database.SaveInventory(character_id, m_inv.GetItem(src_slot_id), src_slot_id); } - if (dst_slot_id == SlotCursor) { + if (dst_slot_id == EQEmu::legacy::SlotCursor) { auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend(); database.SaveCursor(character_id, s, e); } @@ -1833,7 +1833,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) { Log.Out(Logs::Detail, Logs::Inventory, "Inventory desyncronization. (charname: %s, source: %i, destination: %i)", GetName(), move_slots->from_slot, move_slots->to_slot); Message(15, "Inventory Desyncronization detected: Resending slot data..."); - if((move_slots->from_slot >= EQEmu::constants::EQUIPMENT_BEGIN && move_slots->from_slot <= EQEmu::constants::CURSOR_BAG_END) || move_slots->from_slot == SlotPowerSource) { + if ((move_slots->from_slot >= EQEmu::legacy::EQUIPMENT_BEGIN && move_slots->from_slot <= EQEmu::legacy::CURSOR_BAG_END) || move_slots->from_slot == EQEmu::legacy::SlotPowerSource) { int16 resync_slot = (Inventory::CalcSlotId(move_slots->from_slot) == INVALID_INDEX) ? move_slots->from_slot : Inventory::CalcSlotId(move_slots->from_slot); if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) { // This prevents the client from crashing when closing any 'phantom' bags @@ -1876,7 +1876,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) { else { Message(13, "Could not resyncronize source slot %i.", move_slots->from_slot); } } - if((move_slots->to_slot >= EQEmu::constants::EQUIPMENT_BEGIN && move_slots->to_slot <= EQEmu::constants::CURSOR_BAG_END) || move_slots->to_slot == SlotPowerSource) { + if ((move_slots->to_slot >= EQEmu::legacy::EQUIPMENT_BEGIN && move_slots->to_slot <= EQEmu::legacy::CURSOR_BAG_END) || move_slots->to_slot == EQEmu::legacy::SlotPowerSource) { int16 resync_slot = (Inventory::CalcSlotId(move_slots->to_slot) == INVALID_INDEX) ? move_slots->to_slot : Inventory::CalcSlotId(move_slots->to_slot); if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) { const Item_Struct* token_struct = database.GetItem(22292); // 'Copper Coin' @@ -2019,7 +2019,7 @@ void Client::QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call) { void Client::DyeArmor(DyeStruct* dye){ int16 slot=0; - for (int i = EQEmu::constants::MATERIAL_BEGIN; i <= EQEmu::constants::MATERIAL_TINT_END; i++) { + for (int i = EQEmu::legacy::MATERIAL_BEGIN; i <= EQEmu::legacy::MATERIAL_TINT_END; i++) { if ((m_pp.item_tint[i].Color & 0x00FFFFFF) != (dye->dye[i].Color & 0x00FFFFFF)) { slot = m_inv.HasItem(32557, 1, invWherePersonal); if (slot != INVALID_INDEX){ @@ -2058,7 +2058,7 @@ bool Client::DecreaseByItemType(uint32 type, uint8 amt) { const Item_Struct* TempItem = 0; ItemInst* ins; int x; - for(x=EQEmu::constants::POSSESSIONS_BEGIN; x <= EQEmu::constants::POSSESSIONS_END; x++) + for(x=EQEmu::legacy::POSSESSIONS_BEGIN; x <= EQEmu::legacy::POSSESSIONS_END; x++) { TempItem = 0; ins = GetInv().GetItem(x); @@ -2080,7 +2080,7 @@ bool Client::DecreaseByItemType(uint32 type, uint8 amt) { return true; } } - for(x=EQEmu::constants::GENERAL_BAGS_BEGIN; x <= EQEmu::constants::GENERAL_BAGS_END; x++) + for(x=EQEmu::legacy::GENERAL_BAGS_BEGIN; x <= EQEmu::legacy::GENERAL_BAGS_END; x++) { TempItem = 0; ins = GetInv().GetItem(x); @@ -2111,10 +2111,10 @@ bool Client::DecreaseByID(uint32 type, uint8 amt) { ItemInst* ins = nullptr; int x; int num = 0; - for(x = EQEmu::constants::EQUIPMENT_BEGIN; x <= EQEmu::constants::GENERAL_BAGS_END; x++) + for(x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::GENERAL_BAGS_END; x++) { - if (x == SlotCursor + 1) - x = EQEmu::constants::GENERAL_BAGS_BEGIN; + if (x == EQEmu::legacy::SlotCursor + 1) + x = EQEmu::legacy::GENERAL_BAGS_BEGIN; TempItem = nullptr; ins = GetInv().GetItem(x); if (ins) @@ -2128,10 +2128,10 @@ bool Client::DecreaseByID(uint32 type, uint8 amt) { } if (num < amt) return false; - for(x = EQEmu::constants::EQUIPMENT_BEGIN; x <= EQEmu::constants::GENERAL_BAGS_END; x++) // should this be CURSOR_BAG_END? + for(x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::GENERAL_BAGS_END; x++) // should this be CURSOR_BAG_END? { - if (x == SlotCursor + 1) - x = EQEmu::constants::GENERAL_BAGS_BEGIN; + if (x == EQEmu::legacy::SlotCursor + 1) + x = EQEmu::legacy::GENERAL_BAGS_BEGIN; TempItem = nullptr; ins = GetInv().GetItem(x); if (ins) @@ -2227,7 +2227,7 @@ static bool CopyBagContents(ItemInst* new_bag, const ItemInst* old_bag) void Client::DisenchantSummonedBags(bool client_update) { - for (auto slot_id = EQEmu::constants::GENERAL_BEGIN; slot_id <= EQEmu::constants::GENERAL_END; ++slot_id) { + for (auto slot_id = EQEmu::legacy::GENERAL_BEGIN; slot_id <= EQEmu::legacy::GENERAL_END; ++slot_id) { auto inst = m_inv[slot_id]; if (!inst) { continue; } if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; } @@ -2248,7 +2248,7 @@ void Client::DisenchantSummonedBags(bool client_update) safe_delete(new_inst); } - for (auto slot_id = EQEmu::constants::BANK_BEGIN; slot_id <= EQEmu::constants::BANK_END; ++slot_id) { + for (auto slot_id = EQEmu::legacy::BANK_BEGIN; slot_id <= EQEmu::legacy::BANK_END; ++slot_id) { auto inst = m_inv[slot_id]; if (!inst) { continue; } if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; } @@ -2269,7 +2269,7 @@ void Client::DisenchantSummonedBags(bool client_update) safe_delete(new_inst); } - for (auto slot_id = EQEmu::constants::SHARED_BANK_BEGIN; slot_id <= EQEmu::constants::SHARED_BANK_END; ++slot_id) { + for (auto slot_id = EQEmu::legacy::SHARED_BANK_BEGIN; slot_id <= EQEmu::legacy::SHARED_BANK_END; ++slot_id) { auto inst = m_inv[slot_id]; if (!inst) { continue; } if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; } @@ -2291,7 +2291,7 @@ void Client::DisenchantSummonedBags(bool client_update) } while (!m_inv.CursorEmpty()) { - auto inst = m_inv[SlotCursor]; + auto inst = m_inv[EQEmu::legacy::SlotCursor]; if (!inst) { break; } if (!IsSummonedBagID(inst->GetItem()->ID)) { break; } if (inst->GetItem()->ItemClass != ItemClassContainer) { break; } @@ -2305,14 +2305,14 @@ void Client::DisenchantSummonedBags(bool client_update) if (!new_inst) { break; } if (CopyBagContents(new_inst, inst)) { - Log.Out(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, SlotCursor); + Log.Out(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, EQEmu::legacy::SlotCursor); std::list local; local.push_front(new_inst); - m_inv.PopItem(SlotCursor); + m_inv.PopItem(EQEmu::legacy::SlotCursor); safe_delete(inst); while (!m_inv.CursorEmpty()) { - auto limbo_inst = m_inv.PopItem(SlotCursor); + auto limbo_inst = m_inv.PopItem(EQEmu::legacy::SlotCursor); if (limbo_inst == nullptr) { continue; } local.push_back(limbo_inst); } @@ -2338,7 +2338,7 @@ void Client::DisenchantSummonedBags(bool client_update) void Client::RemoveNoRent(bool client_update) { - for (auto slot_id = EQEmu::constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::constants::EQUIPMENT_END; ++slot_id) { + for (auto slot_id = EQEmu::legacy::EQUIPMENT_BEGIN; slot_id <= EQEmu::legacy::EQUIPMENT_END; ++slot_id) { auto inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); @@ -2346,7 +2346,7 @@ void Client::RemoveNoRent(bool client_update) } } - for (auto slot_id = EQEmu::constants::GENERAL_BEGIN; slot_id <= EQEmu::constants::GENERAL_END; ++slot_id) { + for (auto slot_id = EQEmu::legacy::GENERAL_BEGIN; slot_id <= EQEmu::legacy::GENERAL_END; ++slot_id) { auto inst = m_inv[slot_id]; if (inst && !inst->GetItem()->NoRent) { Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); @@ -2354,15 +2354,15 @@ void Client::RemoveNoRent(bool client_update) } } - if (m_inv[SlotPowerSource]) { - auto inst = m_inv[SlotPowerSource]; + if (m_inv[EQEmu::legacy::SlotPowerSource]) { + auto inst = m_inv[EQEmu::legacy::SlotPowerSource]; if (inst && !inst->GetItem()->NoRent) { - Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, SlotPowerSource); - DeleteItemInInventory(SlotPowerSource, 0, (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) ? client_update : false); // Ti slot non-existent + Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, EQEmu::legacy::SlotPowerSource); + DeleteItemInInventory(EQEmu::legacy::SlotPowerSource, 0, (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) ? client_update : false); // Ti slot non-existent } } - for (auto slot_id = EQEmu::constants::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::constants::CURSOR_BAG_END; ++slot_id) { + for (auto slot_id = EQEmu::legacy::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::legacy::CURSOR_BAG_END; ++slot_id) { auto inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); @@ -2370,7 +2370,7 @@ void Client::RemoveNoRent(bool client_update) } } - for (auto slot_id = EQEmu::constants::BANK_BEGIN; slot_id <= EQEmu::constants::BANK_END; ++slot_id) { + for (auto slot_id = EQEmu::legacy::BANK_BEGIN; slot_id <= EQEmu::legacy::BANK_END; ++slot_id) { auto inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); @@ -2378,7 +2378,7 @@ void Client::RemoveNoRent(bool client_update) } } - for (auto slot_id = EQEmu::constants::BANK_BAGS_BEGIN; slot_id <= EQEmu::constants::BANK_BAGS_END; ++slot_id) { + for (auto slot_id = EQEmu::legacy::BANK_BAGS_BEGIN; slot_id <= EQEmu::legacy::BANK_BAGS_END; ++slot_id) { auto inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); @@ -2386,7 +2386,7 @@ void Client::RemoveNoRent(bool client_update) } } - for (auto slot_id = EQEmu::constants::SHARED_BANK_BEGIN; slot_id <= EQEmu::constants::SHARED_BANK_END; ++slot_id) { + for (auto slot_id = EQEmu::legacy::SHARED_BANK_BEGIN; slot_id <= EQEmu::legacy::SHARED_BANK_END; ++slot_id) { auto inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); @@ -2394,7 +2394,7 @@ void Client::RemoveNoRent(bool client_update) } } - for (auto slot_id = EQEmu::constants::SHARED_BANK_BAGS_BEGIN; slot_id <= EQEmu::constants::SHARED_BANK_BAGS_END; ++slot_id) { + for (auto slot_id = EQEmu::legacy::SHARED_BANK_BAGS_BEGIN; slot_id <= EQEmu::legacy::SHARED_BANK_BAGS_END; ++slot_id) { auto inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); @@ -2406,7 +2406,7 @@ void Client::RemoveNoRent(bool client_update) std::list local; while (!m_inv.CursorEmpty()) { - auto inst = m_inv.PopItem(SlotCursor); + auto inst = m_inv.PopItem(EQEmu::legacy::SlotCursor); if (inst == nullptr) { continue; } local.push_back(inst); } @@ -2432,7 +2432,7 @@ void Client::RemoveNoRent(bool client_update) // Two new methods to alleviate perpetual login desyncs void Client::RemoveDuplicateLore(bool client_update) { - for (auto slot_id = EQEmu::constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::constants::EQUIPMENT_END; ++slot_id) { + for (auto slot_id = EQEmu::legacy::EQUIPMENT_BEGIN; slot_id <= EQEmu::legacy::EQUIPMENT_END; ++slot_id) { auto inst = m_inv.PopItem(slot_id); if (inst == nullptr) { continue; } if(CheckLoreConflict(inst->GetItem())) { @@ -2445,7 +2445,7 @@ void Client::RemoveDuplicateLore(bool client_update) safe_delete(inst); } - for (auto slot_id = EQEmu::constants::GENERAL_BEGIN; slot_id <= EQEmu::constants::GENERAL_END; ++slot_id) { + for (auto slot_id = EQEmu::legacy::GENERAL_BEGIN; slot_id <= EQEmu::legacy::GENERAL_END; ++slot_id) { auto inst = m_inv.PopItem(slot_id); if (inst == nullptr) { continue; } if (CheckLoreConflict(inst->GetItem())) { @@ -2458,21 +2458,21 @@ void Client::RemoveDuplicateLore(bool client_update) safe_delete(inst); } - if (m_inv[SlotPowerSource]) { - auto inst = m_inv.PopItem(SlotPowerSource); + if (m_inv[EQEmu::legacy::SlotPowerSource]) { + auto inst = m_inv.PopItem(EQEmu::legacy::SlotPowerSource); if (inst) { if (CheckLoreConflict(inst->GetItem())) { - Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, SlotPowerSource); - database.SaveInventory(character_id, nullptr, SlotPowerSource); + Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, EQEmu::legacy::SlotPowerSource); + database.SaveInventory(character_id, nullptr, EQEmu::legacy::SlotPowerSource); } else { - m_inv.PutItem(SlotPowerSource, *inst); + m_inv.PutItem(EQEmu::legacy::SlotPowerSource, *inst); } safe_delete(inst); } } - for (auto slot_id = EQEmu::constants::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::constants::CURSOR_BAG_END; ++slot_id) { + for (auto slot_id = EQEmu::legacy::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::legacy::CURSOR_BAG_END; ++slot_id) { auto inst = m_inv.PopItem(slot_id); if (inst == nullptr) { continue; } if(CheckLoreConflict(inst->GetItem())) { @@ -2485,7 +2485,7 @@ void Client::RemoveDuplicateLore(bool client_update) safe_delete(inst); } - for (auto slot_id = EQEmu::constants::BANK_BEGIN; slot_id <= EQEmu::constants::BANK_END; ++slot_id) { + for (auto slot_id = EQEmu::legacy::BANK_BEGIN; slot_id <= EQEmu::legacy::BANK_END; ++slot_id) { auto inst = m_inv.PopItem(slot_id); if (inst == nullptr) { continue; } if(CheckLoreConflict(inst->GetItem())) { @@ -2498,7 +2498,7 @@ void Client::RemoveDuplicateLore(bool client_update) safe_delete(inst); } - for (auto slot_id = EQEmu::constants::BANK_BAGS_BEGIN; slot_id <= EQEmu::constants::BANK_BAGS_END; ++slot_id) { + for (auto slot_id = EQEmu::legacy::BANK_BAGS_BEGIN; slot_id <= EQEmu::legacy::BANK_BAGS_END; ++slot_id) { auto inst = m_inv.PopItem(slot_id); if (inst == nullptr) { continue; } if(CheckLoreConflict(inst->GetItem())) { @@ -2518,7 +2518,7 @@ void Client::RemoveDuplicateLore(bool client_update) std::list local_2; while (!m_inv.CursorEmpty()) { - auto inst = m_inv.PopItem(SlotCursor); + auto inst = m_inv.PopItem(EQEmu::legacy::SlotCursor); if (inst == nullptr) { continue; } local_1.push_back(inst); } @@ -2559,7 +2559,7 @@ void Client::RemoveDuplicateLore(bool client_update) void Client::MoveSlotNotAllowed(bool client_update) { - for (auto slot_id = EQEmu::constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::constants::EQUIPMENT_END; ++slot_id) { + for (auto slot_id = EQEmu::legacy::EQUIPMENT_BEGIN; slot_id <= EQEmu::legacy::EQUIPMENT_END; ++slot_id) { if(m_inv[slot_id] && !m_inv[slot_id]->IsSlotAllowed(slot_id)) { auto inst = m_inv.PopItem(slot_id); bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false; @@ -2571,13 +2571,13 @@ void Client::MoveSlotNotAllowed(bool client_update) } } - if (m_inv[SlotPowerSource] && !m_inv[SlotPowerSource]->IsSlotAllowed(SlotPowerSource)) { - auto inst = m_inv.PopItem(SlotPowerSource); + if (m_inv[EQEmu::legacy::SlotPowerSource] && !m_inv[EQEmu::legacy::SlotPowerSource]->IsSlotAllowed(EQEmu::legacy::SlotPowerSource)) { + auto inst = m_inv.PopItem(EQEmu::legacy::SlotPowerSource); bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false; int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow); - Log.Out(Logs::Detail, Logs::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, SlotPowerSource, free_slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, EQEmu::legacy::SlotPowerSource, free_slot_id); PutItemInInventory(free_slot_id, *inst, (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) ? client_update : false); - database.SaveInventory(character_id, nullptr, SlotPowerSource); + database.SaveInventory(character_id, nullptr, EQEmu::legacy::SlotPowerSource); safe_delete(inst); } @@ -2591,7 +2591,7 @@ uint32 Client::GetEquipment(uint8 material_slot) const int16 invslot; const ItemInst *item; - if(material_slot > EQEmu::constants::MATERIAL_END) + if(material_slot > EQEmu::legacy::MATERIAL_END) { return 0; } @@ -2629,7 +2629,7 @@ int32 Client::GetEquipmentMaterial(uint8 material_slot) uint32 Client::GetEquipmentColor(uint8 material_slot) const { - if (material_slot > EQEmu::constants::MATERIAL_END) + if (material_slot > EQEmu::legacy::MATERIAL_END) return 0; const Item_Struct *item = database.GetItem(GetEquipment(material_slot)); @@ -2695,13 +2695,13 @@ static int16 BandolierSlotToWeaponSlot(int BandolierSlot) switch (BandolierSlot) { case bandolierPrimary: - return SlotPrimary; + return EQEmu::legacy::SlotPrimary; case bandolierSecondary: - return SlotSecondary; + return EQEmu::legacy::SlotSecondary; case bandolierRange: - return SlotRange; + return EQEmu::legacy::SlotRange; default: - return SlotAmmo; + return EQEmu::legacy::SlotAmmo; } } @@ -2774,13 +2774,13 @@ void Client::SetBandolier(const EQApplicationPacket *app) // removed 'invWhereCursor' argument from above and implemented slots 30, 331-340 checks here if (slot == INVALID_INDEX) { - if (m_inv.GetItem(SlotCursor)) { - if (m_inv.GetItem(SlotCursor)->GetItem()->ID == m_pp.bandoliers[bss->Number].Items[BandolierSlot].ID && - m_inv.GetItem(SlotCursor)->GetCharges() >= 1) { // '> 0' the same, but this matches Inventory::_HasItem conditional check - slot = SlotCursor; + if (m_inv.GetItem(EQEmu::legacy::SlotCursor)) { + if (m_inv.GetItem(EQEmu::legacy::SlotCursor)->GetItem()->ID == m_pp.bandoliers[bss->Number].Items[BandolierSlot].ID && + m_inv.GetItem(EQEmu::legacy::SlotCursor)->GetCharges() >= 1) { // '> 0' the same, but this matches Inventory::_HasItem conditional check + slot = EQEmu::legacy::SlotCursor; } - else if (m_inv.GetItem(SlotCursor)->GetItem()->ItemClass == 1) { - for(int16 CursorBagSlot = EQEmu::constants::CURSOR_BAG_BEGIN; CursorBagSlot <= EQEmu::constants::CURSOR_BAG_END; CursorBagSlot++) { + else if (m_inv.GetItem(EQEmu::legacy::SlotCursor)->GetItem()->ItemClass == 1) { + for(int16 CursorBagSlot = EQEmu::legacy::CURSOR_BAG_BEGIN; CursorBagSlot <= EQEmu::legacy::CURSOR_BAG_END; CursorBagSlot++) { if (m_inv.GetItem(CursorBagSlot)) { if (m_inv.GetItem(CursorBagSlot)->GetItem()->ID == m_pp.bandoliers[bss->Number].Items[BandolierSlot].ID && m_inv.GetItem(CursorBagSlot)->GetCharges() >= 1) { // ditto @@ -2926,7 +2926,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { // if(ItemToReturn->IsStackable()) { - for (int16 i = EQEmu::constants::GENERAL_BEGIN; i <= SlotCursor; i++) { // changed slot max to 30 from 29. client will stack into slot 30 (bags too) before moving. + for (int16 i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::SlotCursor; i++) { // changed slot max to 30 from 29. client will stack into slot 30 (bags too) before moving. ItemInst* InvItem = m_inv.GetItem(i); @@ -2985,7 +2985,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { // We have tried stacking items, now just try and find an empty slot. - for (int16 i = EQEmu::constants::GENERAL_BEGIN; i <= SlotCursor; i++) { // changed slot max to 30 from 29. client will move into slot 30 (bags too) before pushing onto cursor. + for (int16 i = EQEmu::legacy::GENERAL_BEGIN; i <= EQEmu::legacy::SlotCursor; i++) { // changed slot max to 30 from 29. client will move into slot 30 (bags too) before pushing onto cursor. ItemInst* InvItem = m_inv.GetItem(i); @@ -3046,27 +3046,27 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool std::map instmap; // build reference map - for (int16 index = SLOT_BEGIN; index < EQEmu::constants::TYPE_POSSESSIONS_SIZE; ++index) { + for (int16 index = SLOT_BEGIN; index < EQEmu::legacy::TYPE_POSSESSIONS_SIZE; ++index) { auto inst = m_inv[index]; if (inst == nullptr) { continue; } instmap[index] = inst; } - for (int16 index = EQEmu::constants::TRIBUTE_BEGIN; index <= EQEmu::constants::TRIBUTE_END; ++index) { + for (int16 index = EQEmu::legacy::TRIBUTE_BEGIN; index <= EQEmu::legacy::TRIBUTE_END; ++index) { auto inst = m_inv[index]; if (inst == nullptr) { continue; } instmap[index] = inst; } - for (int16 index = EQEmu::constants::BANK_BEGIN; index <= EQEmu::constants::BANK_END; ++index) { + for (int16 index = EQEmu::legacy::BANK_BEGIN; index <= EQEmu::legacy::BANK_END; ++index) { auto inst = m_inv[index]; if (inst == nullptr) { continue; } instmap[index] = inst; } - for (int16 index = EQEmu::constants::SHARED_BANK_BEGIN; index <= EQEmu::constants::SHARED_BANK_END; ++index) { + for (int16 index = EQEmu::legacy::SHARED_BANK_BEGIN; index <= EQEmu::legacy::SHARED_BANK_END; ++index) { auto inst = m_inv[index]; if (inst == nullptr) { continue; } instmap[index] = inst; } - for (int16 index = EQEmu::constants::TRADE_BEGIN; index <= EQEmu::constants::TRADE_END; ++index) { + for (int16 index = EQEmu::legacy::TRADE_BEGIN; index <= EQEmu::legacy::TRADE_END; ++index) { auto inst = m_inv[index]; if (inst == nullptr) { continue; } instmap[index] = inst; @@ -3074,10 +3074,10 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool auto tsobject = GetTradeskillObject(); if (tsobject != nullptr) { - for (int16 index = SLOT_BEGIN; index < EQEmu::constants::TYPE_WORLD_SIZE; ++index) { + for (int16 index = SLOT_BEGIN; index < EQEmu::legacy::TYPE_WORLD_SIZE; ++index) { auto inst = tsobject->GetItem(index); if (inst == nullptr) { continue; } - instmap[EQEmu::constants::WORLD_BEGIN + index] = inst; + instmap[EQEmu::legacy::WORLD_BEGIN + index] = inst; } } @@ -3090,8 +3090,8 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool instmap[8000 + limbo] = *cursor_itr; } - if (m_inv[SlotPowerSource]) - instmap[SlotPowerSource] = m_inv[SlotPowerSource]; + if (m_inv[EQEmu::legacy::SlotPowerSource]) + instmap[EQEmu::legacy::SlotPowerSource] = m_inv[EQEmu::legacy::SlotPowerSource]; // call InterrogateInventory_ for error check for (std::map::iterator instmap_itr = instmap.begin(); (instmap_itr != instmap.end()) && (!error); ++instmap_itr) { @@ -3149,7 +3149,7 @@ void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 hea } else { if (inst) { - for (int16 sub = SUB_INDEX_BEGIN; (sub < EQEmu::constants::ITEM_CONTAINER_SIZE) && (!error); ++sub) { // treat any ItemInst as having the max internal slots available + for (int16 sub = SUB_INDEX_BEGIN; (sub < EQEmu::legacy::ITEM_CONTAINER_SIZE) && (!error); ++sub) { // treat any ItemInst as having the max internal slots available if (inst->GetItem(sub)) InterrogateInventory_(true, requester, head, sub, inst->GetItem(sub), inst, log, silent, error, depth + 1); } @@ -3179,7 +3179,7 @@ void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 hea } if (inst) { - for (int16 sub = SUB_INDEX_BEGIN; (sub < EQEmu::constants::ITEM_CONTAINER_SIZE); ++sub) { + for (int16 sub = SUB_INDEX_BEGIN; (sub < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++sub) { if (inst->GetItem(sub)) InterrogateInventory_(false, requester, head, sub, inst->GetItem(sub), inst, log, silent, error, depth + 1); } @@ -3194,11 +3194,11 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst* // very basic error checking - can be elaborated upon if more in-depth testing is needed... if ( - (head >= EQEmu::constants::EQUIPMENT_BEGIN && head <= EQEmu::constants::EQUIPMENT_END) || - (head >= EQEmu::constants::TRIBUTE_BEGIN && head <= EQEmu::constants::TRIBUTE_END) || - (head >= EQEmu::constants::WORLD_BEGIN && head <= EQEmu::constants::WORLD_END) || + (head >= EQEmu::legacy::EQUIPMENT_BEGIN && head <= EQEmu::legacy::EQUIPMENT_END) || + (head >= EQEmu::legacy::TRIBUTE_BEGIN && head <= EQEmu::legacy::TRIBUTE_END) || + (head >= EQEmu::legacy::WORLD_BEGIN && head <= EQEmu::legacy::WORLD_END) || (head >= 8000 && head <= 8101) || - (head == SlotPowerSource)) { + (head == EQEmu::legacy::SlotPowerSource)) { switch (depth) { case 0: // requirement: inst is extant @@ -3210,7 +3210,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst* return true; if (!parent->IsType(ItemClassCommon)) return true; - if (index >= EQEmu::constants::ITEM_COMMON_SIZE) + if (index >= EQEmu::legacy::ITEM_COMMON_SIZE) return true; break; default: // requirement: none (something bad happened...) @@ -3218,11 +3218,11 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst* } } else if ( - (head >= EQEmu::constants::GENERAL_BEGIN && head <= EQEmu::constants::GENERAL_END) || - (head == SlotCursor) || - (head >= EQEmu::constants::BANK_BEGIN && head <= EQEmu::constants::BANK_END) || - (head >= EQEmu::constants::SHARED_BANK_BEGIN && head <= EQEmu::constants::SHARED_BANK_END) || - (head >= EQEmu::constants::TRADE_BEGIN && head <= EQEmu::constants::TRADE_END)) { + (head >= EQEmu::legacy::GENERAL_BEGIN && head <= EQEmu::legacy::GENERAL_END) || + (head == EQEmu::legacy::SlotCursor) || + (head >= EQEmu::legacy::BANK_BEGIN && head <= EQEmu::legacy::BANK_END) || + (head >= EQEmu::legacy::SHARED_BANK_BEGIN && head <= EQEmu::legacy::SHARED_BANK_END) || + (head >= EQEmu::legacy::TRADE_BEGIN && head <= EQEmu::legacy::TRADE_END)) { switch (depth) { case 0: // requirement: inst is extant @@ -3239,7 +3239,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst* if (parent->IsType(ItemClassCommon)) { if (!(inst->GetItem()->AugType > 0)) return true; - if (index >= EQEmu::constants::ITEM_COMMON_SIZE) + if (index >= EQEmu::legacy::ITEM_COMMON_SIZE) return true; } break; @@ -3253,7 +3253,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst* if (parent->IsType(ItemClassCommon)) { if (!(inst->GetItem()->AugType > 0)) return true; - if (index >= EQEmu::constants::ITEM_COMMON_SIZE) + if (index >= EQEmu::legacy::ITEM_COMMON_SIZE) return true; } break; diff --git a/zone/loottables.cpp b/zone/loottables.cpp index 4985f9d9f..86969ccca 100644 --- a/zone/loottables.cpp +++ b/zone/loottables.cpp @@ -272,7 +272,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge // it is an improvement. if (!item2->NoPet) { - for (int i = 0; !found && i < EQEmu::constants::EQUIPMENT_SIZE; i++) { + for (int i = 0; !found && i < EQEmu::legacy::EQUIPMENT_SIZE; i++) { uint32 slots = (1 << i); if (item2->Slots & slots) { if(equipment[i]) @@ -313,7 +313,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge // @merth: IDFile size has been increased, this needs to change uint16 emat; if(item2->Material <= 0 - || item2->Slots & (1 << SlotPrimary | 1 << SlotSecondary)) { + || item2->Slots & (1 << EQEmu::legacy::SlotPrimary | 1 << EQEmu::legacy::SlotSecondary)) { memset(newid, 0, sizeof(newid)); for(int i=0;i<7;i++){ if (!isalpha(item2->IDFile[i])){ @@ -327,17 +327,17 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge emat = item2->Material; } - if (foundslot == SlotPrimary) { + if (foundslot == EQEmu::legacy::SlotPrimary) { if (item2->Proc.Effect != 0) CastToMob()->AddProcToWeapon(item2->Proc.Effect, true); - eslot = MaterialPrimary; + eslot = EQEmu::legacy::MaterialPrimary; if (item2->Damage > 0) SendAddPlayerState(PlayerState::PrimaryWeaponEquipped); if (item2->ItemType == ItemType2HBlunt || item2->ItemType == ItemType2HSlash || item2->ItemType == ItemType2HPiercing) SetTwoHanderEquipped(true); } - else if (foundslot == SlotSecondary + else if (foundslot == EQEmu::legacy::SlotSecondary && (GetOwner() != nullptr || (CanThisClassDualWield() && zone->random.Roll(NPC_DW_CHANCE)) || (item2->Damage==0)) && (item2->ItemType == ItemType1HSlash || item2->ItemType == ItemType1HBlunt || item2->ItemType == ItemTypeShield || item2->ItemType == ItemType1HPiercing)) @@ -345,30 +345,30 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge if (item2->Proc.Effect!=0) CastToMob()->AddProcToWeapon(item2->Proc.Effect, true); - eslot = MaterialSecondary; + eslot = EQEmu::legacy::MaterialSecondary; if (item2->Damage > 0) SendAddPlayerState(PlayerState::SecondaryWeaponEquipped); } - else if (foundslot == SlotHead) { - eslot = MaterialHead; + else if (foundslot == EQEmu::legacy::SlotHead) { + eslot = EQEmu::legacy::MaterialHead; } - else if (foundslot == SlotChest) { - eslot = MaterialChest; + else if (foundslot == EQEmu::legacy::SlotChest) { + eslot = EQEmu::legacy::MaterialChest; } - else if (foundslot == SlotArms) { - eslot = MaterialArms; + else if (foundslot == EQEmu::legacy::SlotArms) { + eslot = EQEmu::legacy::MaterialArms; } - else if (foundslot == SlotWrist1 || foundslot == SlotWrist2) { - eslot = MaterialWrist; + else if (foundslot == EQEmu::legacy::SlotWrist1 || foundslot == EQEmu::legacy::SlotWrist2) { + eslot = EQEmu::legacy::MaterialWrist; } - else if (foundslot == SlotHands) { - eslot = MaterialHands; + else if (foundslot == EQEmu::legacy::SlotHands) { + eslot = EQEmu::legacy::MaterialHands; } - else if (foundslot == SlotLegs) { - eslot = MaterialLegs; + else if (foundslot == EQEmu::legacy::SlotLegs) { + eslot = EQEmu::legacy::MaterialLegs; } - else if (foundslot == SlotFeet) { - eslot = MaterialFeet; + else if (foundslot == EQEmu::legacy::SlotFeet) { + eslot = EQEmu::legacy::MaterialFeet; } /* diff --git a/zone/lua_general.cpp b/zone/lua_general.cpp index 5aec9c029..52eb2388f 100644 --- a/zone/lua_general.cpp +++ b/zone/lua_general.cpp @@ -1757,47 +1757,47 @@ luabind::scope lua_register_slot() { return luabind::class_("Slot") .enum_("constants") [ - luabind::value("Charm", static_cast(SlotCharm)), - luabind::value("Ear1", static_cast(SlotEar1)), - luabind::value("Head", static_cast(SlotHead)), - luabind::value("Face", static_cast(SlotFace)), - luabind::value("Ear2", static_cast(SlotEar2)), - luabind::value("Neck", static_cast(SlotNeck)), - luabind::value("Shoulder", static_cast(SlotShoulders)), // deprecated - luabind::value("Shoulders", static_cast(SlotShoulders)), - luabind::value("Arms", static_cast(SlotArms)), - luabind::value("Back", static_cast(SlotBack)), - luabind::value("Bracer1", static_cast(SlotWrist1)), // deprecated - luabind::value("Wrist1", static_cast(SlotWrist1)), - luabind::value("Bracer2", static_cast(SlotWrist2)), // deprecated - luabind::value("Wrist2", static_cast(SlotWrist2)), - luabind::value("Range", static_cast(SlotRange)), - luabind::value("Hands", static_cast(SlotHands)), - luabind::value("Primary", static_cast(SlotPrimary)), - luabind::value("Secondary", static_cast(SlotSecondary)), - luabind::value("Ring1", static_cast(SlotFinger1)), // deprecated - luabind::value("Finger1", static_cast(SlotFinger1)), - luabind::value("Ring2", static_cast(SlotFinger2)), // deprecated - luabind::value("Finger2", static_cast(SlotFinger2)), - luabind::value("Chest", static_cast(SlotChest)), - luabind::value("Legs", static_cast(SlotLegs)), - luabind::value("Feet", static_cast(SlotFeet)), - luabind::value("Waist", static_cast(SlotWaist)), - luabind::value("PowerSource", static_cast(SlotPowerSource)), - luabind::value("Ammo", static_cast(SlotAmmo)), - luabind::value("General1", static_cast(SlotGeneral1)), - luabind::value("General2", static_cast(SlotGeneral2)), - luabind::value("General3", static_cast(SlotGeneral3)), - luabind::value("General4", static_cast(SlotGeneral4)), - luabind::value("General5", static_cast(SlotGeneral5)), - luabind::value("General6", static_cast(SlotGeneral6)), - luabind::value("General7", static_cast(SlotGeneral7)), - luabind::value("General8", static_cast(SlotGeneral8)), - luabind::value("Cursor", static_cast(SlotCursor)), - luabind::value("PersonalBegin", static_cast(EQEmu::constants::GENERAL_BEGIN)), // deprecated - luabind::value("GeneralBegin", static_cast(EQEmu::constants::GENERAL_BEGIN)), - luabind::value("PersonalEnd", static_cast(EQEmu::constants::GENERAL_END)), // deprecated - luabind::value("GeneralEnd", static_cast(EQEmu::constants::GENERAL_END)), + luabind::value("Charm", static_cast(EQEmu::legacy::SlotCharm)), + luabind::value("Ear1", static_cast(EQEmu::legacy::SlotEar1)), + luabind::value("Head", static_cast(EQEmu::legacy::SlotHead)), + luabind::value("Face", static_cast(EQEmu::legacy::SlotFace)), + luabind::value("Ear2", static_cast(EQEmu::legacy::SlotEar2)), + luabind::value("Neck", static_cast(EQEmu::legacy::SlotNeck)), + luabind::value("Shoulder", static_cast(EQEmu::legacy::SlotShoulders)), // deprecated + luabind::value("Shoulders", static_cast(EQEmu::legacy::SlotShoulders)), + luabind::value("Arms", static_cast(EQEmu::legacy::SlotArms)), + luabind::value("Back", static_cast(EQEmu::legacy::SlotBack)), + luabind::value("Bracer1", static_cast(EQEmu::legacy::SlotWrist1)), // deprecated + luabind::value("Wrist1", static_cast(EQEmu::legacy::SlotWrist1)), + luabind::value("Bracer2", static_cast(EQEmu::legacy::SlotWrist2)), // deprecated + luabind::value("Wrist2", static_cast(EQEmu::legacy::SlotWrist2)), + luabind::value("Range", static_cast(EQEmu::legacy::SlotRange)), + luabind::value("Hands", static_cast(EQEmu::legacy::SlotHands)), + luabind::value("Primary", static_cast(EQEmu::legacy::SlotPrimary)), + luabind::value("Secondary", static_cast(EQEmu::legacy::SlotSecondary)), + luabind::value("Ring1", static_cast(EQEmu::legacy::SlotFinger1)), // deprecated + luabind::value("Finger1", static_cast(EQEmu::legacy::SlotFinger1)), + luabind::value("Ring2", static_cast(EQEmu::legacy::SlotFinger2)), // deprecated + luabind::value("Finger2", static_cast(EQEmu::legacy::SlotFinger2)), + luabind::value("Chest", static_cast(EQEmu::legacy::SlotChest)), + luabind::value("Legs", static_cast(EQEmu::legacy::SlotLegs)), + luabind::value("Feet", static_cast(EQEmu::legacy::SlotFeet)), + luabind::value("Waist", static_cast(EQEmu::legacy::SlotWaist)), + luabind::value("PowerSource", static_cast(EQEmu::legacy::SlotPowerSource)), + luabind::value("Ammo", static_cast(EQEmu::legacy::SlotAmmo)), + luabind::value("General1", static_cast(EQEmu::legacy::SlotGeneral1)), + luabind::value("General2", static_cast(EQEmu::legacy::SlotGeneral2)), + luabind::value("General3", static_cast(EQEmu::legacy::SlotGeneral3)), + luabind::value("General4", static_cast(EQEmu::legacy::SlotGeneral4)), + luabind::value("General5", static_cast(EQEmu::legacy::SlotGeneral5)), + luabind::value("General6", static_cast(EQEmu::legacy::SlotGeneral6)), + luabind::value("General7", static_cast(EQEmu::legacy::SlotGeneral7)), + luabind::value("General8", static_cast(EQEmu::legacy::SlotGeneral8)), + luabind::value("Cursor", static_cast(EQEmu::legacy::SlotCursor)), + luabind::value("PersonalBegin", static_cast(EQEmu::legacy::GENERAL_BEGIN)), // deprecated + luabind::value("GeneralBegin", static_cast(EQEmu::legacy::GENERAL_BEGIN)), + luabind::value("PersonalEnd", static_cast(EQEmu::legacy::GENERAL_END)), // deprecated + luabind::value("GeneralEnd", static_cast(EQEmu::legacy::GENERAL_END)), luabind::value("CursorEnd", 0xFFFE), // deprecated luabind::value("Tradeskill", static_cast(EQEmu::legacy::SLOT_TRADESKILL)), // deprecated luabind::value("Augment", static_cast(EQEmu::legacy::SLOT_AUGMENT)), // deprecated @@ -1809,19 +1809,19 @@ luabind::scope lua_register_material() { return luabind::class_("Material") .enum_("constants") [ - luabind::value("Head", static_cast(MaterialHead)), - luabind::value("Chest", static_cast(MaterialChest)), - luabind::value("Arms", static_cast(MaterialArms)), - luabind::value("Bracer", static_cast(MaterialWrist)), // deprecated - luabind::value("Wrist", static_cast(MaterialWrist)), - luabind::value("Hands", static_cast(MaterialHands)), - luabind::value("Legs", static_cast(MaterialLegs)), - luabind::value("Feet", static_cast(MaterialFeet)), - luabind::value("Primary", static_cast(MaterialPrimary)), - luabind::value("Secondary", static_cast(MaterialSecondary)), - luabind::value("Max", static_cast(MaterialCount)), // deprecated - luabind::value("Count", static_cast(MaterialCount)), - luabind::value("Invalid", static_cast(MaterialInvalid)) + luabind::value("Head", static_cast(EQEmu::legacy::MaterialHead)), + luabind::value("Chest", static_cast(EQEmu::legacy::MaterialChest)), + luabind::value("Arms", static_cast(EQEmu::legacy::MaterialArms)), + luabind::value("Bracer", static_cast(EQEmu::legacy::MaterialWrist)), // deprecated + luabind::value("Wrist", static_cast(EQEmu::legacy::MaterialWrist)), + luabind::value("Hands", static_cast(EQEmu::legacy::MaterialHands)), + luabind::value("Legs", static_cast(EQEmu::legacy::MaterialLegs)), + luabind::value("Feet", static_cast(EQEmu::legacy::MaterialFeet)), + luabind::value("Primary", static_cast(EQEmu::legacy::MaterialPrimary)), + luabind::value("Secondary", static_cast(EQEmu::legacy::MaterialSecondary)), + luabind::value("Max", static_cast(EQEmu::legacy::MaterialCount)), // deprecated + luabind::value("Count", static_cast(EQEmu::legacy::MaterialCount)), + luabind::value("Invalid", static_cast(EQEmu::legacy::MaterialInvalid)) ]; } diff --git a/zone/merc.cpp b/zone/merc.cpp index ef2a4e7e6..606ce8a35 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -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; } diff --git a/zone/merc.h b/zone/merc.h index 0efb3d568..b981e28b5 100644 --- a/zone/merc.h +++ b/zone/merc.h @@ -62,7 +62,7 @@ public: //abstract virtual function implementations requird by base abstract class virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill); virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0); - virtual bool Attack(Mob* other, int Hand = SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, + virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0); virtual bool HasRaid() { return false; } virtual bool HasGroup() { return (GetGroup() ? true : false); } @@ -288,7 +288,7 @@ protected: std::map timers; uint16 skills[HIGHEST_SKILL+1]; - uint32 equipment[EQEmu::constants::EQUIPMENT_SIZE]; //this is an array of item IDs + uint32 equipment[EQEmu::legacy::EQUIPMENT_SIZE]; //this is an array of item IDs uint16 d_melee_texture1; //this is an item Material value uint16 d_melee_texture2; //this is an item Material value (offhand) uint8 prim_melee_type; //Sets the Primary Weapon attack message and animation diff --git a/zone/mob.cpp b/zone/mob.cpp index e488a09cb..13a246ee4 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -73,7 +73,7 @@ Mob::Mob(const char* in_name, uint32 in_drakkin_heritage, uint32 in_drakkin_tattoo, uint32 in_drakkin_details, - uint32 in_armor_tint[MaterialCount], + uint32 in_armor_tint[EQEmu::legacy::MaterialCount], uint8 in_aa_title, uint8 in_see_invis, // see through invis/ivu @@ -280,7 +280,7 @@ Mob::Mob(const char* in_name, RangedProcs[j].level_override = -1; } - for (i = 0; i < MaterialCount; i++) + for (i = 0; i < EQEmu::legacy::MaterialCount; i++) { if (in_armor_tint) { @@ -2379,8 +2379,8 @@ bool Mob::CanThisClassDualWield(void) const { return(GetSkill(SkillDualWield) > 0); } else if(CastToClient()->HasSkill(SkillDualWield)) { - const ItemInst* pinst = CastToClient()->GetInv().GetItem(SlotPrimary); - const ItemInst* sinst = CastToClient()->GetInv().GetItem(SlotSecondary); + const ItemInst* pinst = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary); + const ItemInst* sinst = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotSecondary); // 2HS, 2HB, or 2HP if(pinst && pinst->IsWeapon()) { @@ -2865,7 +2865,7 @@ int32 Mob::GetEquipmentMaterial(uint8 material_slot) const if (item != 0) { // For primary and secondary we need the model, not the material - if (material_slot == MaterialPrimary || material_slot == MaterialSecondary) + if (material_slot == EQEmu::legacy::MaterialPrimary || material_slot == EQEmu::legacy::MaterialSecondary) { if (this->IsClient()) { @@ -2909,7 +2909,7 @@ int32 Mob::GetEquipmentMaterial(uint8 material_slot) const int32 Mob::GetHerosForgeModel(uint8 material_slot) const { uint32 HeroModel = 0; - if (material_slot >= 0 && material_slot < MaterialPrimary) + if (material_slot >= 0 && material_slot < EQEmu::legacy::MaterialPrimary) { uint32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType); const Item_Struct *item; diff --git a/zone/mob.h b/zone/mob.h index d5040e93e..c276f212b 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -108,7 +108,7 @@ public: uint32 in_drakkin_heritage, uint32 in_drakkin_tattoo, uint32 in_drakkin_details, - uint32 in_armor_tint[MaterialCount], + uint32 in_armor_tint[EQEmu::legacy::MaterialCount], uint8 in_aa_title, uint8 in_see_invis, // see through invis uint8 in_see_invis_undead, // see through invis vs. undead @@ -148,7 +148,7 @@ public: virtual void ThrowingAttack(Mob* other) { } uint16 GetThrownDamage(int16 wDmg, int32& TotalDmg, int& minDmg); // 13 = Primary (default), 14 = secondary - virtual bool Attack(Mob* other, int Hand = SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, + virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0) = 0; int MonkSpecialAttack(Mob* other, uint8 skill_used); virtual void TryBackstab(Mob *other,int ReuseTime = 10); @@ -379,7 +379,7 @@ public: inline uint8 GetDrakkinHeritage() const { return drakkin_heritage; } inline uint8 GetDrakkinTattoo() const { return drakkin_tattoo; } inline uint8 GetDrakkinDetails() const { return drakkin_details; } - inline uint32 GetArmorTint(uint8 i) const { return armor_tint[(i < MaterialCount) ? i : 0]; } + inline uint32 GetArmorTint(uint8 i) const { return armor_tint[(i < EQEmu::legacy::MaterialCount) ? i : 0]; } inline uint8 GetClass() const { return class_; } inline uint8 GetLevel() const { return level; } inline uint8 GetOrigLevel() const { return orig_level; } @@ -566,7 +566,7 @@ public: bool lookForAftArc = true); //Procs - void TriggerDefensiveProcs(Mob *on, uint16 hand = SlotPrimary, bool FromSkillProc=false, int damage = 0); + void TriggerDefensiveProcs(Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary, bool FromSkillProc = false, int damage = 0); bool AddRangedProc(uint16 spell_id, uint16 iChance = 3, uint16 base_spell_id = SPELL_UNKNOWN); bool RemoveRangedProc(uint16 spell_id, bool bAll = false); bool HasRangedProcs() const; @@ -1146,13 +1146,13 @@ protected: void TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success = false, uint16 hand = 0, bool IsDefensive = false); // hand = SlotCharm? bool PassLimitToSkill(uint16 spell_id, uint16 skill); bool PassLimitClass(uint32 Classes_, uint16 Class_); - void TryDefensiveProc(Mob *on, uint16 hand = SlotPrimary); - void TryWeaponProc(const ItemInst* inst, const Item_Struct* weapon, Mob *on, uint16 hand = SlotPrimary); - void TrySpellProc(const ItemInst* inst, const Item_Struct* weapon, Mob *on, uint16 hand = SlotPrimary); - void TryWeaponProc(const ItemInst* weapon, Mob *on, uint16 hand = SlotPrimary); + void TryDefensiveProc(Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary); + void TryWeaponProc(const ItemInst* inst, const Item_Struct* weapon, Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary); + void TrySpellProc(const ItemInst* inst, const Item_Struct* weapon, Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary); + void TryWeaponProc(const ItemInst* weapon, Mob *on, uint16 hand = EQEmu::legacy::SlotPrimary); void ExecWeaponProc(const ItemInst* weapon, uint16 spell_id, Mob *on, int level_override = -1); - virtual float GetProcChances(float ProcBonus, uint16 hand = SlotPrimary); - virtual float GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 hand = SlotPrimary, Mob *on = nullptr); + virtual float GetProcChances(float ProcBonus, uint16 hand = EQEmu::legacy::SlotPrimary); + virtual float GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 hand = EQEmu::legacy::SlotPrimary, Mob *on = nullptr); virtual float GetSpecialProcChances(uint16 hand); virtual float GetAssassinateProcChances(uint16 ReuseTime); virtual float GetSkillProcChances(uint16 ReuseTime, uint16 hand = 0); // hand = MainCharm? @@ -1243,7 +1243,7 @@ protected: uint32 drakkin_heritage; uint32 drakkin_tattoo; uint32 drakkin_details; - uint32 armor_tint[MaterialCount]; + uint32 armor_tint[EQEmu::legacy::MaterialCount]; uint8 aa_title; diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 5d0493c62..b640da2b0 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -847,7 +847,7 @@ void Client::AI_Process() if (GetTarget() && !IsStunned() && !IsMezzed() && !GetFeigned()) { if (attack_timer.Check()) { // Should charmed clients not be procing? - DoAttackRounds(GetTarget(), SlotPrimary); + DoAttackRounds(GetTarget(), EQEmu::legacy::SlotPrimary); } } @@ -855,7 +855,7 @@ void Client::AI_Process() if (attack_dw_timer.Check()) { if (CheckDualWield()) { // Should charmed clients not be procing? - DoAttackRounds(GetTarget(), SlotSecondary); + DoAttackRounds(GetTarget(), EQEmu::legacy::SlotSecondary); } } } @@ -1106,7 +1106,7 @@ void Mob::AI_Process() { //try main hand first if(attack_timer.Check()) { DoMainHandAttackRounds(target); - TriggerDefensiveProcs(target, SlotPrimary, false); + TriggerDefensiveProcs(target, EQEmu::legacy::SlotPrimary, false); bool specialed = false; // NPCs can only do one of these a round if (GetSpecialAbility(SPECATK_FLURRY)) { @@ -1952,7 +1952,7 @@ bool Mob::Flurry(ExtraAttackOptions *opts) int num_attacks = GetSpecialAbilityParam(SPECATK_FLURRY, 1); num_attacks = num_attacks > 0 ? num_attacks : RuleI(Combat, MaxFlurryHits); for (int i = 0; i < num_attacks; i++) - Attack(target, SlotPrimary, false, false, false, opts); + Attack(target, EQEmu::legacy::SlotPrimary, false, false, false, opts); } return true; } diff --git a/zone/npc.cpp b/zone/npc.cpp index ea123f32a..6d09aa96e 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -488,7 +488,7 @@ void NPC::CheckMinMaxLevel(Mob *them) if(themlevel < (*cur)->min_level || themlevel > (*cur)->max_level) { material = Inventory::CalcMaterialFromSlot((*cur)->equip_slot); - if (material != MaterialInvalid) + if (material != EQEmu::legacy::MaterialInvalid) SendWearChange(material); cur = itemlist.erase(cur); @@ -748,8 +748,8 @@ void NPC::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; } @@ -1372,7 +1372,7 @@ uint32 ZoneDatabase::NPCSpawnDB(uint8 command, const char* zone, uint32 zone_ver int32 NPC::GetEquipmentMaterial(uint8 material_slot) const { - if (material_slot >= MaterialCount) + if (material_slot >= EQEmu::legacy::MaterialCount) return 0; int16 invslot = Inventory::CalcSlotFromMaterial(material_slot); @@ -1383,23 +1383,23 @@ int32 NPC::GetEquipmentMaterial(uint8 material_slot) const { switch(material_slot) { - case MaterialHead: + case EQEmu::legacy::MaterialHead: return helmtexture; - case MaterialChest: + case EQEmu::legacy::MaterialChest: return texture; - case MaterialArms: + case EQEmu::legacy::MaterialArms: return armtexture; - case MaterialWrist: + case EQEmu::legacy::MaterialWrist: return bracertexture; - case MaterialHands: + case EQEmu::legacy::MaterialHands: return handtexture; - case MaterialLegs: + case EQEmu::legacy::MaterialLegs: return legtexture; - case MaterialFeet: + case EQEmu::legacy::MaterialFeet: return feettexture; - case MaterialPrimary: + case EQEmu::legacy::MaterialPrimary: return d_melee_texture1; - case MaterialSecondary: + case EQEmu::legacy::MaterialSecondary: return d_melee_texture2; default: //they have nothing in the slot, and its not a special slot... they get nothing. diff --git a/zone/npc.h b/zone/npc.h index c07ccc947..834211198 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -106,7 +106,7 @@ public: //abstract virtual function implementations requird by base abstract class virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill); virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0); - virtual bool Attack(Mob* other, int Hand = SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, + virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0); virtual bool HasRaid() { return false; } virtual bool HasGroup() { return false; } @@ -495,7 +495,7 @@ protected: uint16 skills[HIGHEST_SKILL+1]; - uint32 equipment[EQEmu::constants::EQUIPMENT_SIZE]; //this is an array of item IDs + uint32 equipment[EQEmu::legacy::EQUIPMENT_SIZE]; //this is an array of item IDs uint32 herosforgemodel; //this is the Hero Forge Armor Model (i.e 63 or 84 or 203) uint16 d_melee_texture1; //this is an item Material value diff --git a/zone/object.cpp b/zone/object.cpp index 5c154b782..122db47ed 100644 --- a/zone/object.cpp +++ b/zone/object.cpp @@ -324,7 +324,7 @@ void Object::Delete(bool reset_state) } const ItemInst* Object::GetItem(uint8 index) { - if (index < EQEmu::constants::TYPE_WORLD_SIZE) { + if (index < EQEmu::legacy::TYPE_WORLD_SIZE) { return m_inst->GetItem(index); } @@ -362,7 +362,7 @@ void Object::Close() { ItemInst* container = this->m_inst; if(container != nullptr) { - for (uint8 i = SUB_INDEX_BEGIN; i < EQEmu::constants::ITEM_CONTAINER_SIZE; i++) + for (uint8 i = SUB_INDEX_BEGIN; i < EQEmu::legacy::ITEM_CONTAINER_SIZE; i++) { ItemInst* inst = container->PopItem(i); if(inst != nullptr) @@ -503,11 +503,11 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object) // Transfer item to client - sender->PutItemInInventory(SlotCursor, *m_inst, false); - sender->SendItemPacket(SlotCursor, m_inst, ItemPacketTrade); + sender->PutItemInInventory(EQEmu::legacy::SlotCursor, *m_inst, false); + sender->SendItemPacket(EQEmu::legacy::SlotCursor, m_inst, ItemPacketTrade); if(cursordelete) // delete the item if it's a duplicate lore. We have to do this because the client expects the item packet - sender->DeleteItemInInventory(SlotCursor); + sender->DeleteItemInInventory(EQEmu::legacy::SlotCursor); if(!m_ground_spawn) safe_delete(m_inst); @@ -583,7 +583,7 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object) EQApplicationPacket* outapp=new EQApplicationPacket(OP_ClientReady,0); sender->QueuePacket(outapp); safe_delete(outapp); - for (uint8 i = SUB_INDEX_BEGIN; i < EQEmu::constants::ITEM_CONTAINER_SIZE; i++) { + for (uint8 i = SUB_INDEX_BEGIN; i < EQEmu::legacy::ITEM_CONTAINER_SIZE; i++) { const ItemInst* inst = m_inst->GetItem(i); if (inst) { //sender->GetInv().PutItem(i+4000,inst); diff --git a/zone/pets.cpp b/zone/pets.cpp index 14d02097a..63e1a832c 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -417,12 +417,12 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, // the base items for the pet. These are always loaded // so that a rank 1 suspend minion does not kill things // like the special back items some focused pets may receive. - uint32 petinv[EQEmu::constants::EQUIPMENT_SIZE]; + uint32 petinv[EQEmu::legacy::EQUIPMENT_SIZE]; memset(petinv, 0, sizeof(petinv)); const Item_Struct *item = 0; if (database.GetBasePetItems(record.equipmentset, petinv)) { - for (int i = 0; i < EQEmu::constants::EQUIPMENT_SIZE; i++) + for (int i = 0; i < EQEmu::legacy::EQUIPMENT_SIZE; i++) if (petinv[i]) { item = database.GetItem(petinv[i]); npc->AddLootDrop(item, &npc->itemlist, 0, 1, 127, true, true); @@ -572,7 +572,7 @@ void NPC::GetPetState(SpellBuff_Struct *pet_buffs, uint32 *items, char *name) { strn0cpy(name, GetName(), 64); //save their items, we only care about what they are actually wearing - memcpy(items, equipment, sizeof(uint32) * EQEmu::constants::EQUIPMENT_SIZE); + memcpy(items, equipment, sizeof(uint32) * EQEmu::legacy::EQUIPMENT_SIZE); //save their buffs. for (int i=0; i < GetPetMaxTotalSlots(); i++) { @@ -660,7 +660,7 @@ void NPC::SetPetState(SpellBuff_Struct *pet_buffs, uint32 *items) { } //restore their equipment... - for (i = 0; i < EQEmu::constants::EQUIPMENT_SIZE; i++) { + for (i = 0; i < EQEmu::legacy::EQUIPMENT_SIZE; i++) { if(items[i] == 0) continue; @@ -722,7 +722,7 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) { { slot = atoi(row[0]); - if (slot >= EQEmu::constants::EQUIPMENT_SIZE) + if (slot >= EQEmu::legacy::EQUIPMENT_SIZE) continue; if (items[slot] == 0) diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 4ab6f4eb1..806f995e7 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -2441,12 +2441,12 @@ int QuestManager::collectitems(uint32 item_id, bool remove) int quantity = 0; int slot_id; - for (slot_id = EQEmu::constants::GENERAL_BEGIN; slot_id <= EQEmu::constants::GENERAL_END; ++slot_id) + for (slot_id = EQEmu::legacy::GENERAL_BEGIN; slot_id <= EQEmu::legacy::GENERAL_END; ++slot_id) { quantity += collectitems_processSlot(slot_id, item_id, remove); } - for (slot_id = EQEmu::constants::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::constants::GENERAL_BAGS_END; ++slot_id) + for (slot_id = EQEmu::legacy::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::legacy::GENERAL_BAGS_END; ++slot_id) { quantity += collectitems_processSlot(slot_id, item_id, remove); } diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 929cee001..6f9e276a2 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -69,17 +69,17 @@ void Mob::ApplySpecialAttackMod(SkillUseTypes skill, int32 &dmg, int32 &mindmg) case SkillFlyingKick: case SkillRoundKick: case SkillKick: - item_slot = SlotFeet; + item_slot = EQEmu::legacy::SlotFeet; break; case SkillBash: - item_slot = SlotSecondary; + item_slot = EQEmu::legacy::SlotSecondary; break; case SkillDragonPunch: case SkillEagleStrike: case SkillTigerClaw: - item_slot = SlotHands; + item_slot = EQEmu::legacy::SlotHands; break; default: @@ -115,7 +115,7 @@ void Mob::DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage, if(skill == SkillBash){ if(IsClient()){ - ItemInst *item = CastToClient()->GetInv().GetItem(SlotSecondary); + ItemInst *item = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotSecondary); if(item) { if(item->GetItem()->ItemType == ItemTypeShield) @@ -133,14 +133,14 @@ void Mob::DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage, min_damage += min_damage * GetMeleeMinDamageMod_SE(skill) / 100; - int hand = SlotPrimary; // Avoid checks hand for throwing/archery exclusion, primary should work for most + int hand = EQEmu::legacy::SlotPrimary; // Avoid checks hand for throwing/archery exclusion, primary should work for most if (skill == SkillThrowing || skill == SkillArchery) - hand = SlotRange; + hand = EQEmu::legacy::SlotRange; if (who->AvoidDamage(this, max_damage, hand)) { if (max_damage == -3) DoRiposte(who); } else { - if (HitChance || who->CheckHitChance(this, skill, SlotPrimary)) { + if (HitChance || who->CheckHitChance(this, skill, EQEmu::legacy::SlotPrimary)) { who->MeleeMitigation(this, max_damage, min_damage); CommonOutgoingHitSuccess(who, max_damage, skill); } else { @@ -198,7 +198,7 @@ void Client::OPCombatAbility(const EQApplicationPacket *app) { //These two are not subject to the combat ability timer, as they //allready do their checking in conjunction with the attack timer //throwing weapons - if(ca_atk->m_atk == SlotRange) { + if (ca_atk->m_atk == EQEmu::legacy::SlotRange) { if (ca_atk->m_skill == SkillThrowing) { SetAttackTimer(); ThrowingAttack(GetTarget()); @@ -248,8 +248,8 @@ void Client::OPCombatAbility(const EQApplicationPacket *app) { DoAnim(animTailRake); int32 ht = 0; - if(GetWeaponDamage(GetTarget(), GetInv().GetItem(SlotSecondary)) <= 0 && - GetWeaponDamage(GetTarget(), GetInv().GetItem(SlotShoulders)) <= 0){ + if (GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::legacy::SlotSecondary)) <= 0 && + GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::legacy::SlotShoulders)) <= 0){ dmg = -5; } else{ @@ -325,7 +325,7 @@ void Client::OPCombatAbility(const EQApplicationPacket *app) { DoAnim(animKick); int32 ht = 0; - if(GetWeaponDamage(GetTarget(), GetInv().GetItem(SlotFeet)) <= 0){ + if (GetWeaponDamage(GetTarget(), GetInv().GetItem(EQEmu::legacy::SlotFeet)) <= 0){ dmg = -5; } else{ @@ -408,7 +408,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type) int32 min_dmg = 1; int reuse = 0; SkillUseTypes skill_type; //to avoid casting... even though it "would work" - uint8 itemslot = SlotFeet; + uint8 itemslot = EQEmu::legacy::SlotFeet; switch(unchecked_type){ case SkillFlyingKick:{ @@ -423,7 +423,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type) case SkillDragonPunch:{ skill_type = SkillDragonPunch; max_dmg = ((GetSTR()+GetSkill(skill_type)) * RuleI(Combat, DragonPunchBonus) / 100) + 26; - itemslot = SlotHands; + itemslot = EQEmu::legacy::SlotHands; ApplySpecialAttackMod(skill_type, max_dmg, min_dmg); DoAnim(animTailRake); reuse = TailRakeReuseTime; @@ -433,7 +433,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type) case SkillEagleStrike:{ skill_type = SkillEagleStrike; max_dmg = ((GetSTR()+GetSkill(skill_type)) * RuleI(Combat, EagleStrikeBonus) / 100) + 19; - itemslot = SlotHands; + itemslot = EQEmu::legacy::SlotHands; ApplySpecialAttackMod(skill_type, max_dmg, min_dmg); DoAnim(animEagleStrike); reuse = EagleStrikeReuseTime; @@ -443,7 +443,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type) case SkillTigerClaw:{ skill_type = SkillTigerClaw; max_dmg = ((GetSTR()+GetSkill(skill_type)) * RuleI(Combat, TigerClawBonus) / 100) + 12; - itemslot = SlotHands; + itemslot = EQEmu::legacy::SlotHands; ApplySpecialAttackMod(skill_type, max_dmg, min_dmg); DoAnim(animTigerClaw); reuse = TigerClawReuseTime; @@ -512,7 +512,7 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) { //make sure we have a proper weapon if we are a client. if(IsClient()) { - const ItemInst *wpn = CastToClient()->GetInv().GetItem(SlotPrimary); + const ItemInst *wpn = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary); if(!wpn || (wpn->GetItem()->ItemType != ItemType1HPiercing)){ Message_StringID(13, BACKSTAB_WEAPON); return; @@ -573,7 +573,7 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) { CastToClient()->CheckIncreaseSkill(SkillBackstab, other, 10); } else { //We do a single regular attack if we attack from the front without chaotic stab - Attack(other, SlotPrimary); + Attack(other, EQEmu::legacy::SlotPrimary); } } @@ -592,11 +592,11 @@ void Mob::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) if(IsClient()){ const ItemInst *wpn = nullptr; - wpn = CastToClient()->GetInv().GetItem(SlotPrimary); + wpn = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary); if(wpn) { primaryweapondamage = GetWeaponDamage(other, wpn); backstab_dmg = wpn->GetItem()->BackstabDmg; - for (int i = 0; i < EQEmu::constants::ITEM_COMMON_SIZE; ++i) + for (int i = 0; i < EQEmu::legacy::ITEM_COMMON_SIZE; ++i) { ItemInst *aug = wpn->GetAugment(i); if(aug) @@ -671,7 +671,7 @@ void Mob::RogueAssassinate(Mob* other) { //can you dodge, parry, etc.. an assassinate?? //if so, use DoSpecialAttackDamage(other, BACKSTAB, 32000); instead - if(GetWeaponDamage(other, IsClient()?CastToClient()->GetInv().GetItem(SlotPrimary):(const ItemInst*)nullptr) > 0){ + if (GetWeaponDamage(other, IsClient() ? CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary) : (const ItemInst*)nullptr) > 0){ other->Damage(this, 32000, SPELL_UNKNOWN, SkillBackstab); }else{ other->Damage(this, -5, SPELL_UNKNOWN, SkillBackstab); @@ -691,20 +691,20 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { //Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; } - const ItemInst* RangeWeapon = m_inv[SlotRange]; + const ItemInst* RangeWeapon = m_inv[EQEmu::legacy::SlotRange]; //locate ammo - int ammo_slot = SlotAmmo; - const ItemInst* Ammo = m_inv[SlotAmmo]; + int ammo_slot = EQEmu::legacy::SlotAmmo; + const ItemInst* Ammo = m_inv[EQEmu::legacy::SlotAmmo]; if (!RangeWeapon || !RangeWeapon->IsType(ItemClassCommon)) { - Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(SlotRange), SlotRange); - Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have no bow!", GetItemIDAt(SlotRange)); + Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(EQEmu::legacy::SlotRange), EQEmu::legacy::SlotRange); + Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have no bow!", GetItemIDAt(EQEmu::legacy::SlotRange)); return; } if (!Ammo || !Ammo->IsType(ItemClassCommon)) { - Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ammo item (%d) in slot %d", GetItemIDAt(SlotAmmo), SlotAmmo); - Message(0, "Error: Ammo: GetItem(%i)==0, you have no ammo!", GetItemIDAt(SlotAmmo)); + Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ammo item (%d) in slot %d", GetItemIDAt(EQEmu::legacy::SlotAmmo), EQEmu::legacy::SlotAmmo); + Message(0, "Error: Ammo: GetItem(%i)==0, you have no ammo!", GetItemIDAt(EQEmu::legacy::SlotAmmo)); return; } @@ -729,7 +729,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { //first look for quivers int r; bool found = false; - for(r = EQEmu::constants::GENERAL_BEGIN; r <= EQEmu::constants::GENERAL_END; r++) { + for (r = EQEmu::legacy::GENERAL_BEGIN; r <= EQEmu::legacy::GENERAL_END; r++) { const ItemInst *pi = m_inv[r]; if(pi == nullptr || !pi->IsType(ItemClassContainer)) continue; @@ -859,7 +859,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite if (IsClient()){ - _RangeWeapon = CastToClient()->m_inv[SlotRange]; + _RangeWeapon = CastToClient()->m_inv[EQEmu::legacy::SlotRange]; if (_RangeWeapon && _RangeWeapon->GetItem() && _RangeWeapon->GetItem()->ID == range_id) RangeWeapon = _RangeWeapon; @@ -875,7 +875,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite else if (AmmoItem) SendItemAnimation(other, AmmoItem, SkillArchery); - if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillArchery, SlotPrimary, chance_mod))) { + if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillArchery, EQEmu::legacy::SlotPrimary, chance_mod))) { Log.Out(Logs::Detail, Logs::Combat, "Ranged attack missed %s.", other->GetName()); if (LaunchProjectile){ @@ -973,7 +973,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite } if (!HeadShot) - other->AvoidDamage(this, TotalDmg, SlotRange); + other->AvoidDamage(this, TotalDmg, EQEmu::legacy::SlotRange); other->MeleeMitigation(this, TotalDmg, minDmg); if(TotalDmg > 0){ @@ -997,7 +997,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite if (ReuseTime) TrySkillProc(other, SkillArchery, ReuseTime); else - TrySkillProc(other, SkillArchery, 0, true, SlotRange); + TrySkillProc(other, SkillArchery, 0, true, EQEmu::legacy::SlotRange); } } @@ -1006,20 +1006,20 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite //Weapon Proc if(RangeWeapon && other && !other->HasDied()) - TryWeaponProc(RangeWeapon, other, SlotRange); + TryWeaponProc(RangeWeapon, other, EQEmu::legacy::SlotRange); //Ammo Proc if (ammo_lost) - TryWeaponProc(nullptr, ammo_lost, other, SlotRange); + TryWeaponProc(nullptr, ammo_lost, other, EQEmu::legacy::SlotRange); else if(Ammo && other && !other->HasDied()) - TryWeaponProc(Ammo, other, SlotRange); + TryWeaponProc(Ammo, other, EQEmu::legacy::SlotRange); //Skill Proc if (HasSkillProcs() && other && !other->HasDied()){ if (ReuseTime) TrySkillProc(other, SkillArchery, ReuseTime); else - TrySkillProc(other, SkillArchery, 0, false, SlotRange); + TrySkillProc(other, SkillArchery, 0, false, EQEmu::legacy::SlotRange); } } @@ -1285,7 +1285,7 @@ void NPC::DoRangedAttackDmg(Mob* other, bool Launch, int16 damage_mod, int16 cha if (!chance_mod) chance_mod = GetSpecialAbilityParam(SPECATK_RANGED_ATK, 2); - if (!other->CheckHitChance(this, skillInUse, SlotRange, chance_mod)) + if (!other->CheckHitChance(this, skillInUse, EQEmu::legacy::SlotRange, chance_mod)) { other->Damage(this, 0, SPELL_UNKNOWN, skillInUse); } @@ -1306,7 +1306,7 @@ void NPC::DoRangedAttackDmg(Mob* other, bool Launch, int16 damage_mod, int16 cha TotalDmg += TotalDmg * damage_mod / 100; - other->AvoidDamage(this, TotalDmg, SlotRange); + other->AvoidDamage(this, TotalDmg, EQEmu::legacy::SlotRange); other->MeleeMitigation(this, TotalDmg, MinDmg); if (TotalDmg > 0) @@ -1322,15 +1322,15 @@ void NPC::DoRangedAttackDmg(Mob* other, bool Launch, int16 damage_mod, int16 cha other->Damage(this, TotalDmg, SPELL_UNKNOWN, skillInUse); if (TotalDmg > 0 && HasSkillProcSuccess() && !other->HasDied()) - TrySkillProc(other, skillInUse, 0, true, SlotRange); + TrySkillProc(other, skillInUse, 0, true, EQEmu::legacy::SlotRange); } //try proc on hits and misses if(other && !other->HasDied()) - TrySpellProc(nullptr, (const Item_Struct*)nullptr, other, SlotRange); + TrySpellProc(nullptr, (const Item_Struct*)nullptr, other, EQEmu::legacy::SlotRange); if (HasSkillProcs() && other && !other->HasDied()) - TrySkillProc(other, skillInUse, 0, false, SlotRange); + TrySkillProc(other, skillInUse, 0, false, EQEmu::legacy::SlotRange); } uint16 Mob::GetThrownDamage(int16 wDmg, int32& TotalDmg, int& minDmg) { @@ -1372,19 +1372,19 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 return; } - int ammo_slot = SlotRange; - const ItemInst* RangeWeapon = m_inv[SlotRange]; + int ammo_slot = EQEmu::legacy::SlotRange; + const ItemInst* RangeWeapon = m_inv[EQEmu::legacy::SlotRange]; if (!RangeWeapon || !RangeWeapon->IsType(ItemClassCommon)) { - Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(SlotRange), SlotRange); - Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing to throw!", GetItemIDAt(SlotRange)); + Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(EQEmu::legacy::SlotRange), EQEmu::legacy::SlotRange); + Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing to throw!", GetItemIDAt(EQEmu::legacy::SlotRange)); return; } const Item_Struct* item = RangeWeapon->GetItem(); 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); - Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(SlotRange)); + Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(EQEmu::legacy::SlotRange)); return; } @@ -1392,11 +1392,11 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 if(RangeWeapon->GetCharges() == 1) { //first check ammo - const ItemInst* AmmoItem = m_inv[SlotAmmo]; + const ItemInst* AmmoItem = m_inv[EQEmu::legacy::SlotAmmo]; if(AmmoItem != nullptr && AmmoItem->GetID() == RangeWeapon->GetID()) { //more in the ammo slot, use it RangeWeapon = AmmoItem; - ammo_slot = SlotAmmo; + ammo_slot = EQEmu::legacy::SlotAmmo; Log.Out(Logs::Detail, Logs::Combat, "Using ammo from ammo slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); } else { //look through our inventory for more @@ -1493,7 +1493,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite else if (AmmoItem) SendItemAnimation(other, AmmoItem, SkillThrowing); - if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillThrowing, SlotPrimary, chance_mod))){ + if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillThrowing, EQEmu::legacy::SlotPrimary, chance_mod))){ Log.Out(Logs::Detail, Logs::Combat, "Ranged attack missed %s.", other->GetName()); if (LaunchProjectile){ TryProjectileAttack(other, AmmoItem, SkillThrowing, 0, RangeWeapon, nullptr, AmmoSlot, speed); @@ -1540,7 +1540,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite Log.Out(Logs::Detail, Logs::Combat, "Item DMG %d. Max Damage %d. Hit for damage %d", WDmg, MaxDmg, TotalDmg); if (!Assassinate_Dmg) - other->AvoidDamage(this, TotalDmg, SlotRange); + other->AvoidDamage(this, TotalDmg, EQEmu::legacy::SlotRange); other->MeleeMitigation(this, TotalDmg, minDmg); if(TotalDmg > 0) @@ -1559,7 +1559,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite if (ReuseTime) TrySkillProc(other, SkillThrowing, ReuseTime); else - TrySkillProc(other, SkillThrowing, 0, true, SlotRange); + TrySkillProc(other, SkillThrowing, 0, true, EQEmu::legacy::SlotRange); } } @@ -1568,15 +1568,15 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite //Throwing item Proc if (ammo_lost) - TryWeaponProc(nullptr, ammo_lost, other, SlotRange); + TryWeaponProc(nullptr, ammo_lost, other, EQEmu::legacy::SlotRange); else if(RangeWeapon && other && !other->HasDied()) - TryWeaponProc(RangeWeapon, other, SlotRange); + TryWeaponProc(RangeWeapon, other, EQEmu::legacy::SlotRange); if (HasSkillProcs() && other && !other->HasDied()){ if (ReuseTime) TrySkillProc(other, SkillThrowing, ReuseTime); else - TrySkillProc(other, SkillThrowing, 0, false, SlotRange); + TrySkillProc(other, SkillThrowing, 0, false, EQEmu::legacy::SlotRange); } } @@ -1976,7 +1976,7 @@ void Client::DoClassAttacks(Mob *ca_target, uint16 skill, bool IsRiposte) if (ca_target!=this) { DoAnim(animTailRake); - if(GetWeaponDamage(ca_target, GetInv().GetItem(SlotSecondary)) <= 0 && GetWeaponDamage(ca_target, GetInv().GetItem(SlotShoulders)) <= 0){ + if (GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::legacy::SlotSecondary)) <= 0 && GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::legacy::SlotShoulders)) <= 0){ dmg = -5; } else{ @@ -2040,7 +2040,7 @@ void Client::DoClassAttacks(Mob *ca_target, uint16 skill, bool IsRiposte) if(ca_target!=this){ DoAnim(animKick); - if(GetWeaponDamage(ca_target, GetInv().GetItem(SlotFeet)) <= 0){ + if (GetWeaponDamage(ca_target, GetInv().GetItem(EQEmu::legacy::SlotFeet)) <= 0){ dmg = -5; } else{ @@ -2252,7 +2252,7 @@ uint32 Mob::TryHeadShot(Mob* defender, SkillUseTypes skillInUse) { HeadShot_Level = itembonuses.HSLevel; if(HeadShot_Dmg && HeadShot_Level && (defender->GetLevel() <= HeadShot_Level)){ - float ProcChance = GetSpecialProcChances(SlotRange); + float ProcChance = GetSpecialProcChances(EQEmu::legacy::SlotRange); if(zone->random.Roll(ProcChance)) return HeadShot_Dmg; } @@ -2315,7 +2315,7 @@ uint32 Mob::TryAssassinate(Mob* defender, SkillUseTypes skillInUse, uint16 Reuse float ProcChance = 0.0f; if (skillInUse == SkillThrowing) - ProcChance = GetSpecialProcChances(SlotRange); + ProcChance = GetSpecialProcChances(EQEmu::legacy::SlotRange); else ProcChance = GetAssassinateProcChances(ReuseTime); @@ -2366,7 +2366,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes int damage = 0; uint32 hate = 0; - int Hand = SlotPrimary; + int Hand = EQEmu::legacy::SlotPrimary; if (hate == 0 && weapon_damage > 1) hate = weapon_damage; if(weapon_damage > 0){ @@ -2390,7 +2390,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes if(skillinuse == SkillBash){ if(IsClient()){ - ItemInst *item = CastToClient()->GetInv().GetItem(SlotSecondary); + ItemInst *item = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotSecondary); if(item){ if(item->GetItem()->ItemType == ItemTypeShield) { hate += item->GetItem()->AC; @@ -2412,7 +2412,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes else damage = zone->random.Int(min_hit, max_hit); - if (other->AvoidDamage(this, damage, CanRiposte ? SlotRange : SlotPrimary)) { // SlotRange excludes ripo, primary doesn't have any extra behavior + if (other->AvoidDamage(this, damage, CanRiposte ? EQEmu::legacy::SlotRange : EQEmu::legacy::SlotPrimary)) { // SlotRange excludes ripo, primary doesn't have any extra behavior if (damage == -3) { DoRiposte(other); if (HasDied()) diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index ee97a287f..ab20371fa 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -616,7 +616,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove snprintf(effect_desc, _EDLEN, "Flesh To Bone"); #endif if(IsClient()){ - ItemInst* transI = CastToClient()->GetInv().GetItem(SlotCursor); + ItemInst* transI = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotCursor); if(transI && transI->IsType(ItemClassCommon) && transI->IsStackable()){ uint32 fcharges = transI->GetCharges(); //Does it sound like meat... maybe should check if it looks like meat too... @@ -626,7 +626,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove strstr(transI->GetItem()->Name, "Flesh") || strstr(transI->GetItem()->Name, "parts") || strstr(transI->GetItem()->Name, "Parts")){ - CastToClient()->DeleteItemInInventory(SlotCursor, fcharges, true); + CastToClient()->DeleteItemInInventory(EQEmu::legacy::SlotCursor, fcharges, true); CastToClient()->SummonItem(13073, fcharges); } else{ @@ -1157,7 +1157,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if (SummonedItem) { c->PushItemOnCursor(*SummonedItem); - c->SendItemPacket(SlotCursor, SummonedItem, ItemPacketSummonItem); + c->SendItemPacket(EQEmu::legacy::SlotCursor, SummonedItem, ItemPacketSummonItem); safe_delete(SummonedItem); } SummonedItem = database.CreateItem(spell.base[i], charges); @@ -1429,7 +1429,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove } } - for (int x = EQEmu::constants::MATERIAL_BEGIN; x <= EQEmu::constants::MATERIAL_TINT_END; x++) + for (int x = EQEmu::legacy::MATERIAL_BEGIN; x <= EQEmu::legacy::MATERIAL_TINT_END; x++) SendWearChange(x); if (caster == this && @@ -1455,7 +1455,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove ); caster->SendAppearancePacket(AT_Size, static_cast(caster->GetTarget()->GetSize())); - for (int x = EQEmu::constants::MATERIAL_BEGIN; x <= EQEmu::constants::MATERIAL_TINT_END; x++) + for (int x = EQEmu::legacy::MATERIAL_BEGIN; x <= EQEmu::legacy::MATERIAL_TINT_END; x++) caster->SendWearChange(x); } } @@ -2216,7 +2216,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove snprintf(effect_desc, _EDLEN, "Rampage"); #endif if(caster) - entity_list.AEAttack(caster, 30, SlotPrimary, 0, true); // on live wars dont get a duration ramp, its a one shot deal + entity_list.AEAttack(caster, 30, EQEmu::legacy::SlotPrimary, 0, true); // on live wars dont get a duration ramp, its a one shot deal break; } @@ -3014,7 +3014,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if (SummonedItem) { Client *c=CastToClient(); c->PushItemOnCursor(*SummonedItem); - c->SendItemPacket(SlotCursor, SummonedItem, ItemPacketSummonItem); + c->SendItemPacket(EQEmu::legacy::SlotCursor, SummonedItem, ItemPacketSummonItem); safe_delete(SummonedItem); } @@ -3809,7 +3809,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) else{ SendAppearancePacket(AT_Size, 6); } - for (int x = EQEmu::constants::MATERIAL_BEGIN; x <= EQEmu::constants::MATERIAL_TINT_END; x++){ + for (int x = EQEmu::legacy::MATERIAL_BEGIN; x <= EQEmu::legacy::MATERIAL_TINT_END; x++){ SendWearChange(x); } break; @@ -5126,7 +5126,7 @@ uint16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) { const Item_Struct* TempItem = 0; - for (int x = EQEmu::constants::EQUIPMENT_BEGIN; x <= EQEmu::constants::EQUIPMENT_END; x++) + for (int x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::EQUIPMENT_END; x++) { if (SympatheticProcList.size() > MAX_SYMPATHETIC_PROCS) continue; @@ -5146,7 +5146,7 @@ uint16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) { } } - for (int y = AUG_INDEX_BEGIN; y < EQEmu::constants::ITEM_COMMON_SIZE; ++y) + for (int y = AUG_INDEX_BEGIN; y < EQEmu::legacy::ITEM_COMMON_SIZE; ++y) { if (SympatheticProcList.size() > MAX_SYMPATHETIC_PROCS) continue; @@ -5261,7 +5261,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id) int16 focus_max_real = 0; //item focus - for (int x = EQEmu::constants::EQUIPMENT_BEGIN; x <= EQEmu::constants::EQUIPMENT_END; x++) + for (int x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::EQUIPMENT_END; x++) { TempItem = nullptr; ItemInst* ins = GetInv().GetItem(x); @@ -5295,7 +5295,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id) } } - for (int y = AUG_INDEX_BEGIN; y < EQEmu::constants::ITEM_COMMON_SIZE; ++y) + for (int y = AUG_INDEX_BEGIN; y < EQEmu::legacy::ITEM_COMMON_SIZE; ++y) { ItemInst *aug = nullptr; aug = ins->GetAugment(y); @@ -5333,7 +5333,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id) } //Tribute Focus - for (int x = EQEmu::constants::TRIBUTE_BEGIN; x <= EQEmu::constants::TRIBUTE_END; ++x) + for (int x = EQEmu::legacy::TRIBUTE_BEGIN; x <= EQEmu::legacy::TRIBUTE_END; ++x) { TempItem = nullptr; ItemInst* ins = GetInv().GetItem(x); @@ -5533,7 +5533,7 @@ int16 NPC::GetFocusEffect(focusType type, uint16 spell_id) { int16 focus_max_real = 0; //item focus - for (int i = 0; i < EQEmu::constants::EQUIPMENT_SIZE; i++){ + for (int i = 0; i < EQEmu::legacy::EQUIPMENT_SIZE; i++){ const Item_Struct *cur = database.GetItem(equipment[i]); if(!cur) diff --git a/zone/spells.cpp b/zone/spells.cpp index ffc644ff0..f0bc6e85a 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -291,7 +291,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, return(false); } } - if( itm && (itm->GetItem()->Click.Type == ET_EquipClick) && !(item_slot <= SlotAmmo || item_slot == SlotPowerSource) ){ + if (itm && (itm->GetItem()->Click.Type == ET_EquipClick) && !(item_slot <= EQEmu::legacy::SlotAmmo || item_slot == EQEmu::legacy::SlotPowerSource)){ if (CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::SoF) { // They are attempting to cast a must equip clicky without having it equipped Log.Out(Logs::General, Logs::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) without equiping it!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); @@ -1206,7 +1206,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if (inst == nullptr) break; - for (int r = AUG_INDEX_BEGIN; r < EQEmu::constants::ITEM_COMMON_SIZE; r++) { + for (int r = AUG_INDEX_BEGIN; r < EQEmu::legacy::ITEM_COMMON_SIZE; r++) { const ItemInst* aug_i = inst->GetAugment(r); if (!aug_i) diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index 1048e7c34..ffdafaeb1 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -69,7 +69,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme // Verify that no more than two items are in container to guarantee no inadvertant wipes. uint8 itemsFound = 0; - for (uint8 i = SLOT_BEGIN; i < EQEmu::constants::TYPE_WORLD_SIZE; i++) + for (uint8 i = SLOT_BEGIN; i < EQEmu::legacy::TYPE_WORLD_SIZE; i++) { const ItemInst* inst = container->GetItem(i); if (inst) @@ -222,7 +222,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme else { // Delete items in our inventory container... - for (uint8 i = SLOT_BEGIN; i < EQEmu::constants::TYPE_WORLD_SIZE; i++) + for (uint8 i = SLOT_BEGIN; i < EQEmu::legacy::TYPE_WORLD_SIZE; i++) { const ItemInst* inst = container->GetItem(i); if (inst) @@ -297,7 +297,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob const Item_Struct* new_weapon = inst->GetItem(); user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true); 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(), SlotCursor, 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(), EQEmu::legacy::SlotCursor, container->GetItem()->Icon, atoi(container->GetItem()->IDFile + 2)); user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name); if (RuleB(Inventory, DeleteTransformationMold)) user->DeleteItemInInventory(in_combine->container_slot, 0, true); @@ -317,7 +317,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob const Item_Struct* new_weapon = inst->GetItem(); user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true); 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(), SlotCursor, 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(), EQEmu::legacy::SlotCursor, 0, 0); user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name); } else if (inst) { @@ -401,7 +401,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob safe_delete(outapp); database.DeleteWorldContainer(worldo->m_id, zone->GetZoneID()); } else{ - for (uint8 i = SLOT_BEGIN; i < EQEmu::constants::TYPE_WORLD_SIZE; i++) { + for (uint8 i = SLOT_BEGIN; i < EQEmu::legacy::TYPE_WORLD_SIZE; i++) { const ItemInst* inst = container->GetItem(i); if (inst) { user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot,i),0,true); @@ -1227,7 +1227,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 for (auto row = results.begin(); row != results.end(); ++row) { int ccnt = 0; - for (int x = SLOT_BEGIN; x < EQEmu::constants::TYPE_WORLD_SIZE; x++) { + for (int x = SLOT_BEGIN; x < EQEmu::legacy::TYPE_WORLD_SIZE; x++) { const ItemInst* inst = container->GetItem(x); if(!inst) continue; diff --git a/zone/trading.cpp b/zone/trading.cpp index d52a25543..ff9c60559 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -98,7 +98,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) { // Item always goes into trade bucket from cursor Client* client = owner->CastToClient(); - ItemInst* inst = client->GetInv().GetItem(SlotCursor); + ItemInst* inst = client->GetInv().GetItem(EQEmu::legacy::SlotCursor); if (!inst) { client->Message(13, "Error: Could not find item on your cursor!"); @@ -131,7 +131,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) { if (_stack_size > 0) inst->SetCharges(_stack_size); else - client->DeleteItemInInventory(SlotCursor); + client->DeleteItemInInventory(EQEmu::legacy::SlotCursor); SendItemData(inst2, trade_slot_id); } @@ -146,7 +146,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) { Log.Out(Logs::Detail, Logs::Trading, "%s added item '%s' to trade slot %i", owner->GetName(), inst->GetItem()->Name, trade_slot_id); client->PutItemInInventory(trade_slot_id, *inst); - client->DeleteItemInInventory(SlotCursor); + client->DeleteItemInInventory(EQEmu::legacy::SlotCursor); } } @@ -171,13 +171,13 @@ void Trade::SendItemData(const ItemInst* inst, int16 dest_slot_id) Client* with = mob->CastToClient(); Client* trader = owner->CastToClient(); if (with && with->IsClient()) { - with->SendItemPacket(dest_slot_id - EQEmu::constants::TRADE_BEGIN, inst, ItemPacketTradeView); + with->SendItemPacket(dest_slot_id - EQEmu::legacy::TRADE_BEGIN, inst, ItemPacketTradeView); if (inst->GetItem()->ItemClass == 1) { - for (uint16 i = SUB_INDEX_BEGIN; i < EQEmu::constants::ITEM_CONTAINER_SIZE; i++) { + for (uint16 i = SUB_INDEX_BEGIN; i < EQEmu::legacy::ITEM_CONTAINER_SIZE; i++) { uint16 bagslot_id = Inventory::CalcSlotId(dest_slot_id, i); const ItemInst* bagitem = trader->GetInv().GetItem(bagslot_id); if (bagitem) { - with->SendItemPacket(bagslot_id - EQEmu::constants::TRADE_BEGIN, bagitem, ItemPacketTradeView); + with->SendItemPacket(bagslot_id - EQEmu::legacy::TRADE_BEGIN, bagitem, ItemPacketTradeView); } } } @@ -199,7 +199,7 @@ void Trade::LogTrade() uint8 item_count = 0; if (zone->tradevar != 0) { - for (uint16 i = EQEmu::constants::TRADE_BEGIN; i <= EQEmu::constants::TRADE_END; i++) { + for (uint16 i = EQEmu::legacy::TRADE_BEGIN; i <= EQEmu::legacy::TRADE_END; i++) { if (trader->GetInv().GetItem(i)) item_count++; } @@ -251,7 +251,7 @@ void Trade::LogTrade() if (item_count > 0) { strcat(logtext, "items {"); - for (uint16 i = EQEmu::constants::TRADE_BEGIN; i <= EQEmu::constants::TRADE_END; i++) { + for (uint16 i = EQEmu::legacy::TRADE_BEGIN; i <= EQEmu::legacy::TRADE_END; i++) { const ItemInst* inst = trader->GetInv().GetItem(i); if (!comma) @@ -267,7 +267,7 @@ void Trade::LogTrade() strcat(logtext, item_num); if (inst->IsType(ItemClassContainer)) { - for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::constants::ITEM_CONTAINER_SIZE; j++) { + for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::legacy::ITEM_CONTAINER_SIZE; j++) { inst = trader->GetInv().GetItem(i, j); if (inst) { strcat(logtext, ","); @@ -303,7 +303,7 @@ void Trade::DumpTrade() return; Client* trader = owner->CastToClient(); - for (uint16 i = EQEmu::constants::TRADE_BEGIN; i <= EQEmu::constants::TRADE_END; i++) { + for (uint16 i = EQEmu::legacy::TRADE_BEGIN; i <= EQEmu::legacy::TRADE_END; i++) { const ItemInst* inst = trader->GetInv().GetItem(i); if (inst) { @@ -312,7 +312,7 @@ void Trade::DumpTrade() i, ((inst->IsType(ItemClassContainer)) ? "True" : "False")); if (inst->IsType(ItemClassContainer)) { - for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::constants::ITEM_CONTAINER_SIZE; j++) { + for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::legacy::ITEM_CONTAINER_SIZE; j++) { inst = trader->GetInv().GetItem(i, j); if (inst) { Log.Out(Logs::Detail, Logs::Trading, "\tBagItem %i (Charges=%i, Slot=%i)", @@ -332,7 +332,7 @@ void Client::ResetTrade() { AddMoneyToPP(trade->cp, trade->sp, trade->gp, trade->pp, true); // step 1: process bags - for (int16 trade_slot = EQEmu::constants::TRADE_BEGIN; trade_slot <= EQEmu::constants::TRADE_END; ++trade_slot) { + for (int16 trade_slot = EQEmu::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::TRADE_END; ++trade_slot) { const ItemInst* inst = m_inv[trade_slot]; if (inst && inst->IsType(ItemClassContainer)) { @@ -351,7 +351,7 @@ void Client::ResetTrade() { } // step 2a: process stackables - for (int16 trade_slot = EQEmu::constants::TRADE_BEGIN; trade_slot <= EQEmu::constants::TRADE_END; ++trade_slot) { + for (int16 trade_slot = EQEmu::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::TRADE_END; ++trade_slot) { ItemInst* inst = GetInv().GetItem(trade_slot); if (inst && inst->IsStackable()) { @@ -359,7 +359,7 @@ void Client::ResetTrade() { // there's no built-in safety check against an infinite loop..but, it should break on one of the conditional checks int16 free_slot = m_inv.FindFreeSlotForTradeItem(inst); - if ((free_slot == SlotCursor) || (free_slot == INVALID_INDEX)) + if ((free_slot == EQEmu::legacy::SlotCursor) || (free_slot == INVALID_INDEX)) break; ItemInst* partial_inst = GetInv().GetItem(free_slot); @@ -398,11 +398,11 @@ void Client::ResetTrade() { // step 2b: adjust trade stack bias // (if any partial stacks exist before the final stack, FindFreeSlotForTradeItem() will return that slot in step 3 and an overwrite will occur) - for (int16 trade_slot = EQEmu::constants::TRADE_END; trade_slot >= EQEmu::constants::TRADE_BEGIN; --trade_slot) { + for (int16 trade_slot = EQEmu::legacy::TRADE_END; trade_slot >= EQEmu::legacy::TRADE_BEGIN; --trade_slot) { ItemInst* inst = GetInv().GetItem(trade_slot); if (inst && inst->IsStackable()) { - for (int16 bias_slot = EQEmu::constants::TRADE_BEGIN; bias_slot <= EQEmu::constants::TRADE_END; ++bias_slot) { + for (int16 bias_slot = EQEmu::legacy::TRADE_BEGIN; bias_slot <= EQEmu::legacy::TRADE_END; ++bias_slot) { if (bias_slot >= trade_slot) break; @@ -432,7 +432,7 @@ void Client::ResetTrade() { } // step 3: process everything else - for (int16 trade_slot = EQEmu::constants::TRADE_BEGIN; trade_slot <= EQEmu::constants::TRADE_END; ++trade_slot) { + for (int16 trade_slot = EQEmu::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::TRADE_END; ++trade_slot) { const ItemInst* inst = m_inv[trade_slot]; if (inst) { @@ -487,7 +487,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st } // step 1: process bags - for (int16 trade_slot = EQEmu::constants::TRADE_BEGIN; trade_slot <= EQEmu::constants::TRADE_END; ++trade_slot) { + for (int16 trade_slot = EQEmu::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::TRADE_END; ++trade_slot) { const ItemInst* inst = m_inv[trade_slot]; if (inst && inst->IsType(ItemClassContainer)) { @@ -523,7 +523,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st qs_audit->char1_count += detail->charges; //for (uint8 sub_slot = SUB_BEGIN; ((sub_slot < inst->GetItem()->BagSlots) && (sub_slot < EmuConstants::ITEM_CONTAINER_SIZE)); ++sub_slot) { - for (uint8 sub_slot = SUB_INDEX_BEGIN; (sub_slot < EQEmu::constants::ITEM_CONTAINER_SIZE); ++sub_slot) { // this is to catch ALL items + for (uint8 sub_slot = SUB_INDEX_BEGIN; (sub_slot < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++sub_slot) { // this is to catch ALL items const ItemInst* bag_inst = inst->GetItem(sub_slot); if (bag_inst) { @@ -571,7 +571,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st } // step 2a: process stackables - for (int16 trade_slot = EQEmu::constants::TRADE_BEGIN; trade_slot <= EQEmu::constants::TRADE_END; ++trade_slot) { + for (int16 trade_slot = EQEmu::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::TRADE_END; ++trade_slot) { ItemInst* inst = GetInv().GetItem(trade_slot); if (inst && inst->IsStackable()) { @@ -579,7 +579,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st // there's no built-in safety check against an infinite loop..but, it should break on one of the conditional checks int16 partial_slot = other->GetInv().FindFreeSlotForTradeItem(inst); - if ((partial_slot == SlotCursor) || (partial_slot == INVALID_INDEX)) + if ((partial_slot == EQEmu::legacy::SlotCursor) || (partial_slot == INVALID_INDEX)) break; ItemInst* partial_inst = other->GetInv().GetItem(partial_slot); @@ -653,11 +653,11 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st // step 2b: adjust trade stack bias // (if any partial stacks exist before the final stack, FindFreeSlotForTradeItem() will return that slot in step 3 and an overwrite will occur) - for (int16 trade_slot = EQEmu::constants::TRADE_END; trade_slot >= EQEmu::constants::TRADE_BEGIN; --trade_slot) { + for (int16 trade_slot = EQEmu::legacy::TRADE_END; trade_slot >= EQEmu::legacy::TRADE_BEGIN; --trade_slot) { ItemInst* inst = GetInv().GetItem(trade_slot); if (inst && inst->IsStackable()) { - for (int16 bias_slot = EQEmu::constants::TRADE_BEGIN; bias_slot <= EQEmu::constants::TRADE_END; ++bias_slot) { + for (int16 bias_slot = EQEmu::legacy::TRADE_BEGIN; bias_slot <= EQEmu::legacy::TRADE_END; ++bias_slot) { if (bias_slot >= trade_slot) break; @@ -706,7 +706,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st } // step 3: process everything else - for (int16 trade_slot = EQEmu::constants::TRADE_BEGIN; trade_slot <= EQEmu::constants::TRADE_END; ++trade_slot) { + for (int16 trade_slot = EQEmu::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::TRADE_END; ++trade_slot) { const ItemInst* inst = m_inv[trade_slot]; if (inst) { @@ -743,7 +743,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st // 'step 3' should never really see containers..but, just in case... //for (uint8 sub_slot = SUB_BEGIN; ((sub_slot < inst->GetItem()->BagSlots) && (sub_slot < EmuConstants::ITEM_CONTAINER_SIZE)); ++sub_slot) { - for (uint8 sub_slot = SUB_INDEX_BEGIN; (sub_slot < EQEmu::constants::ITEM_CONTAINER_SIZE); ++sub_slot) { // this is to catch ALL items + for (uint8 sub_slot = SUB_INDEX_BEGIN; (sub_slot < EQEmu::legacy::ITEM_CONTAINER_SIZE); ++sub_slot) { // this is to catch ALL items const ItemInst* bag_inst = inst->GetItem(sub_slot); if (bag_inst) { @@ -820,7 +820,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st } if(qs_log) { // This can be incorporated below when revisions are made - for (int16 trade_slot = EQEmu::constants::TRADE_BEGIN; trade_slot <= EQEmu::constants::TRADE_NPC_END; ++trade_slot) { + for (int16 trade_slot = EQEmu::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::TRADE_NPC_END; ++trade_slot) { const ItemInst* trade_inst = m_inv[trade_slot]; if(trade_inst) { @@ -875,7 +875,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st std::vector item_list; std::list items; - for (int i = EQEmu::constants::TRADE_BEGIN; i <= EQEmu::constants::TRADE_NPC_END; ++i) { + for (int i = EQEmu::legacy::TRADE_BEGIN; i <= EQEmu::legacy::TRADE_NPC_END; ++i) { ItemInst *inst = m_inv.GetItem(i); if(inst) { items.push_back(inst); @@ -948,8 +948,8 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st } ItemInst *insts[4] = { 0 }; - for (int i = EQEmu::constants::TRADE_BEGIN; i <= EQEmu::constants::TRADE_NPC_END; ++i) { - insts[i - EQEmu::constants::TRADE_BEGIN] = m_inv.PopItem(i); + for (int i = EQEmu::legacy::TRADE_BEGIN; i <= EQEmu::legacy::TRADE_NPC_END; ++i) { + insts[i - EQEmu::legacy::TRADE_BEGIN] = m_inv.PopItem(i); database.SaveInventory(CharacterID(), nullptr, i); } @@ -968,7 +968,7 @@ bool Client::CheckTradeLoreConflict(Client* other) if (!other) return true; // Move each trade slot into free inventory slot - for (int16 i = EQEmu::constants::TRADE_BEGIN; i <= EQEmu::constants::TRADE_END; i++){ + for (int16 i = EQEmu::legacy::TRADE_BEGIN; i <= EQEmu::legacy::TRADE_END; i++){ const ItemInst* inst = m_inv[i]; if (inst && inst->GetItem()) { @@ -977,7 +977,7 @@ bool Client::CheckTradeLoreConflict(Client* other) } } - for (int16 i = EQEmu::constants::TRADE_BAGS_BEGIN; i <= EQEmu::constants::TRADE_BAGS_END; i++){ + for (int16 i = EQEmu::legacy::TRADE_BAGS_BEGIN; i <= EQEmu::legacy::TRADE_BAGS_END; i++){ const ItemInst* inst = m_inv[i]; if (inst && inst->GetItem()) { @@ -1232,10 +1232,10 @@ uint32 Client::FindTraderItemSerialNumber(int32 ItemID) { ItemInst* item = nullptr; uint16 SlotID = 0; - 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++){ item = this->GetInv().GetItem(i); if (item && item->GetItem()->ID == 17899){ //Traders Satchel - for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; x++) { + for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::ITEM_CONTAINER_SIZE; x++) { // we already have the parent bag and a contents iterator..why not just iterate the bag!?? SlotID = Inventory::CalcSlotId(i, x); item = this->GetInv().GetItem(SlotID); @@ -1255,10 +1255,10 @@ ItemInst* Client::FindTraderItemBySerialNumber(int32 SerialNumber){ ItemInst* item = nullptr; uint16 SlotID = 0; - 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++){ item = this->GetInv().GetItem(i); if(item && item->GetItem()->ID == 17899){ //Traders Satchel - for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; x++) { + for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::ITEM_CONTAINER_SIZE; x++) { // we already have the parent bag and a contents iterator..why not just iterate the bag!?? SlotID = Inventory::CalcSlotId(i, x); item = this->GetInv().GetItem(SlotID); @@ -1286,10 +1286,10 @@ GetItems_Struct* Client::GetTraderItems(){ uint8 ndx = 0; - 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++) { item = this->GetInv().GetItem(i); if(item && item->GetItem()->ID == 17899){ //Traders Satchel - for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; x++) { + for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::ITEM_CONTAINER_SIZE; x++) { SlotID = Inventory::CalcSlotId(i, x); item = this->GetInv().GetItem(SlotID); @@ -1310,10 +1310,10 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){ const ItemInst* item= nullptr; uint16 SlotID = 0; - 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++) { item = this->GetInv().GetItem(i); if(item && item->GetItem()->ID == 17899){ //Traders Satchel - for (int x = SUB_INDEX_BEGIN; x < EQEmu::constants::ITEM_CONTAINER_SIZE; x++){ + for (int x = SUB_INDEX_BEGIN; x < EQEmu::legacy::ITEM_CONTAINER_SIZE; x++){ SlotID = Inventory::CalcSlotId(i, x); item = this->GetInv().GetItem(SlotID); diff --git a/zone/tribute.cpp b/zone/tribute.cpp index 077e97bee..737b04151 100644 --- a/zone/tribute.cpp +++ b/zone/tribute.cpp @@ -66,7 +66,7 @@ void Client::ToggleTribute(bool enabled) { int r; uint32 cost = 0; uint32 level = GetLevel(); - for (r = 0; r < EQEmu::constants::TRIBUTE_SIZE; r++) { + for (r = 0; r < EQEmu::legacy::TRIBUTE_SIZE; r++) { uint32 tid = m_pp.tributes[r].tribute; if(tid == TRIBUTE_NONE) continue; @@ -119,7 +119,7 @@ void Client::DoTributeUpdate() { tis->tribute_master_id = tribute_master_id; //Dont know what this is for int r; - for (r = 0; r < EQEmu::constants::TRIBUTE_SIZE; r++) { + for (r = 0; r < EQEmu::legacy::TRIBUTE_SIZE; r++) { if(m_pp.tributes[r].tribute != TRIBUTE_NONE) { tis->tributes[r] = m_pp.tributes[r].tribute; tis->tiers[r] = m_pp.tributes[r].tier; @@ -134,24 +134,24 @@ void Client::DoTributeUpdate() { if(m_pp.tribute_active) { //send and equip tribute items... - for (r = 0; r < EQEmu::constants::TRIBUTE_SIZE; r++) { + for (r = 0; r < EQEmu::legacy::TRIBUTE_SIZE; r++) { uint32 tid = m_pp.tributes[r].tribute; if(tid == TRIBUTE_NONE) { - if (m_inv[EQEmu::constants::TRIBUTE_BEGIN + r]) - DeleteItemInInventory(EQEmu::constants::TRIBUTE_BEGIN + r, 0, false); + if (m_inv[EQEmu::legacy::TRIBUTE_BEGIN + r]) + DeleteItemInInventory(EQEmu::legacy::TRIBUTE_BEGIN + r, 0, false); continue; } if(tribute_list.count(tid) != 1) { - if (m_inv[EQEmu::constants::TRIBUTE_BEGIN + r]) - DeleteItemInInventory(EQEmu::constants::TRIBUTE_BEGIN + r, 0, false); + if (m_inv[EQEmu::legacy::TRIBUTE_BEGIN + r]) + DeleteItemInInventory(EQEmu::legacy::TRIBUTE_BEGIN + r, 0, false); continue; } //sanity check if(m_pp.tributes[r].tier >= MAX_TRIBUTE_TIERS) { - if (m_inv[EQEmu::constants::TRIBUTE_BEGIN + r]) - DeleteItemInInventory(EQEmu::constants::TRIBUTE_BEGIN + r, 0, false); + if (m_inv[EQEmu::legacy::TRIBUTE_BEGIN + r]) + DeleteItemInInventory(EQEmu::legacy::TRIBUTE_BEGIN + r, 0, false); m_pp.tributes[r].tier = 0; continue; } @@ -165,15 +165,15 @@ void Client::DoTributeUpdate() { if(inst == nullptr) continue; - PutItemInInventory(EQEmu::constants::TRIBUTE_BEGIN + r, *inst, false); - SendItemPacket(EQEmu::constants::TRIBUTE_BEGIN + r, inst, ItemPacketTributeItem); + PutItemInInventory(EQEmu::legacy::TRIBUTE_BEGIN + r, *inst, false); + SendItemPacket(EQEmu::legacy::TRIBUTE_BEGIN + r, inst, ItemPacketTributeItem); safe_delete(inst); } } else { //unequip tribute items... - for (r = 0; r < EQEmu::constants::TRIBUTE_SIZE; r++) { - if (m_inv[EQEmu::constants::TRIBUTE_BEGIN + r]) - DeleteItemInInventory(EQEmu::constants::TRIBUTE_BEGIN + r, 0, false); + for (r = 0; r < EQEmu::legacy::TRIBUTE_SIZE; r++) { + if (m_inv[EQEmu::legacy::TRIBUTE_BEGIN + r]) + DeleteItemInInventory(EQEmu::legacy::TRIBUTE_BEGIN + r, 0, false); } } CalcBonuses(); @@ -192,7 +192,7 @@ void Client::SendTributeTimer() { void Client::ChangeTributeSettings(TributeInfo_Struct *t) { int r; - for (r = 0; r < EQEmu::constants::TRIBUTE_SIZE; r++) { + for (r = 0; r < EQEmu::legacy::TRIBUTE_SIZE; r++) { m_pp.tributes[r].tribute = TRIBUTE_NONE; diff --git a/zone/tune.cpp b/zone/tune.cpp index 30692b5bb..bcaa69d4a 100644 --- a/zone/tune.cpp +++ b/zone/tune.cpp @@ -582,13 +582,13 @@ int32 Client::Tune_GetMeleeMitDmg(Mob* GM, Mob *attacker, int32 damage, int32 mi int32 Client::GetMeleeDamage(Mob* other, bool GetMinDamage) { - int Hand = SlotPrimary; + int Hand = EQEmu::legacy::SlotPrimary; if (!other) return 0; ItemInst* weapon; - weapon = GetInv().GetItem(SlotPrimary); + weapon = GetInv().GetItem(EQEmu::legacy::SlotPrimary); if(weapon != nullptr) { if (!weapon->IsWeapon()) { @@ -628,7 +628,7 @@ int32 Client::GetMeleeDamage(Mob* other, bool GetMinDamage) int ucDamageBonus = 0; - if( Hand == SlotPrimary && GetLevel() >= 28 && IsWarriorClass() ) + if (Hand == EQEmu::legacy::SlotPrimary && GetLevel() >= 28 && IsWarriorClass()) { ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const Item_Struct*) nullptr ); @@ -662,24 +662,24 @@ void Mob::Tune_FindAccuaryByHitChance(Mob* defender, Mob *attacker, float hit_ch if (attacker->IsClient()) {//Will check first equiped weapon for skill. Ie. remove wepaons to assess bow. ItemInst* weapon; - weapon = attacker->CastToClient()->GetInv().GetItem(SlotPrimary); + weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary); if(weapon && weapon->IsWeapon()){ - attacker->CastToClient()->AttackAnimation(skillinuse, SlotPrimary, weapon); + attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotPrimary, weapon); } else { - weapon = attacker->CastToClient()->GetInv().GetItem(SlotSecondary); + weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotSecondary); if (weapon && weapon->IsWeapon()) - attacker->CastToClient()->AttackAnimation(skillinuse, SlotSecondary, weapon); + attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotSecondary, weapon); else { - weapon = attacker->CastToClient()->GetInv().GetItem(SlotRange); + weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotRange); if (weapon && weapon->IsWeapon()) - attacker->CastToClient()->AttackAnimation(skillinuse, SlotRange, weapon); + attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotRange, weapon); } } } - tmp_hit_chance = Tune_CheckHitChance(defender,attacker, skillinuse, SlotPrimary,0,0,0, avoid_override); + tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, 0, 0, avoid_override); Message(0, "#Tune - Begin Parse [Interval %i Max Loop Iterations %i]", interval, max_loop); @@ -691,7 +691,7 @@ void Mob::Tune_FindAccuaryByHitChance(Mob* defender, Mob *attacker, float hit_ch for (int j=0; j < max_loop; j++) { - tmp_hit_chance =Tune_CheckHitChance(defender,attacker, skillinuse, SlotPrimary,0,false,0, avoid_override, add_acc); + tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, false, 0, avoid_override, add_acc); if (Msg >= 3) Message(15, "#Tune - Processing... [%i] [ACCURACY %i] Hit Chance %.2f ",j,add_acc,tmp_hit_chance); @@ -706,7 +706,7 @@ void Mob::Tune_FindAccuaryByHitChance(Mob* defender, Mob *attacker, float hit_ch if (end){ - Tune_CheckHitChance(defender,attacker, skillinuse, SlotPrimary,0,Msg,0,avoid_override);//Display Stat Report + Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, Msg, 0, avoid_override);//Display Stat Report Message(0, " "); @@ -742,24 +742,24 @@ void Mob::Tune_FindAvoidanceByHitChance(Mob* defender, Mob *attacker, float hit_ if (attacker->IsClient()) {//Will check first equiped weapon for skill. Ie. remove wepaons to assess bow. ItemInst* weapon; - weapon = attacker->CastToClient()->GetInv().GetItem(SlotPrimary); + weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary); if(weapon && weapon->IsWeapon()){ - attacker->CastToClient()->AttackAnimation(skillinuse, SlotPrimary, weapon); + attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotPrimary, weapon); } else { - weapon = attacker->CastToClient()->GetInv().GetItem(SlotSecondary); + weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotSecondary); if (weapon && weapon->IsWeapon()) - attacker->CastToClient()->AttackAnimation(skillinuse, SlotSecondary, weapon); + attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotSecondary, weapon); else { - weapon = attacker->CastToClient()->GetInv().GetItem(SlotRange); + weapon = attacker->CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotRange); if (weapon && weapon->IsWeapon()) - attacker->CastToClient()->AttackAnimation(skillinuse, SlotRange, weapon); + attacker->CastToClient()->AttackAnimation(skillinuse, EQEmu::legacy::SlotRange, weapon); } } } - tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, SlotPrimary,0,0,acc_override, 0); + tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, 0, acc_override, 0); Message(0, "#Tune - Begin Parse [Interval %i Max Loop Iterations %i]", interval, max_loop); Message(0, "#Tune - Processing... Find Avoidance for hit chance on defender of (%.0f) pct from attacker. [Current Hit Chance %.2f]", hit_chance, tmp_hit_chance); @@ -769,7 +769,7 @@ void Mob::Tune_FindAvoidanceByHitChance(Mob* defender, Mob *attacker, float hit_ for (int j=0; j < max_loop; j++) { - tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, SlotPrimary, 0,0, acc_override, 0,0,add_avoid); + tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, 0, acc_override, 0, 0, add_avoid); if (Msg >= 3) Message(0, "#Tune - Processing... [%i] [AVOIDANCE %i] Hit Chance %.2f ",j,add_avoid,tmp_hit_chance); @@ -784,7 +784,7 @@ void Mob::Tune_FindAvoidanceByHitChance(Mob* defender, Mob *attacker, float hit_ if (end){ - Tune_CheckHitChance(defender,attacker, skillinuse, SlotPrimary,0,Msg,acc_override, 0);//Display Stat Report + Tune_CheckHitChance(defender, attacker, skillinuse, EQEmu::legacy::SlotPrimary, 0, Msg, acc_override, 0);//Display Stat Report Message(0, " "); diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 08d31578c..5b66b691d 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -487,7 +487,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container) uint8 index = (uint8)atoi(row[0]); uint32 item_id = (uint32)atoi(row[1]); int8 charges = (int8)atoi(row[2]); - uint32 aug[EQEmu::constants::ITEM_COMMON_SIZE]; + uint32 aug[EQEmu::legacy::ITEM_COMMON_SIZE]; aug[0] = (uint32)atoi(row[3]); aug[1] = (uint32)atoi(row[4]); aug[2] = (uint32)atoi(row[5]); @@ -497,7 +497,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container) ItemInst* inst = database.CreateItem(item_id, charges); if (inst && inst->GetItem()->ItemClass == ItemClassCommon) { - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) if (aug[i]) inst->PutAugment(&database, i, aug[i]); // Put item inside world container @@ -520,17 +520,17 @@ void ZoneDatabase::SaveWorldContainer(uint32 zone_id, uint32 parent_id, const It DeleteWorldContainer(parent_id,zone_id); // Save all 10 items, if they exist - for (uint8 index = SUB_INDEX_BEGIN; index < EQEmu::constants::ITEM_CONTAINER_SIZE; index++) { + for (uint8 index = SUB_INDEX_BEGIN; index < EQEmu::legacy::ITEM_CONTAINER_SIZE; index++) { ItemInst* inst = container->GetItem(index); if (!inst) continue; uint32 item_id = inst->GetItem()->ID; - uint32 augslot[EQEmu::constants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; + uint32 augslot[EQEmu::legacy::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; if (inst->IsType(ItemClassCommon)) { - for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) { + for (int i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) { ItemInst *auginst=inst->GetAugment(i); augslot[i]=(auginst && auginst->GetItem()) ? auginst->GetItem()->ID : 0; } @@ -1181,11 +1181,11 @@ bool ZoneDatabase::LoadCharacterMaterialColor(uint32 character_id, PlayerProfile bool ZoneDatabase::LoadCharacterBandolier(uint32 character_id, PlayerProfile_Struct* pp) { std::string query = StringFormat("SELECT `bandolier_id`, `bandolier_slot`, `item_id`, `icon`, `bandolier_name` FROM `character_bandolier` WHERE `id` = %u LIMIT %u", - character_id, EQEmu::constants::BANDOLIERS_SIZE); + character_id, EQEmu::legacy::BANDOLIERS_SIZE); auto results = database.QueryDatabase(query); int i = 0; int r = 0; int si = 0; - for (i = 0; i < EQEmu::constants::BANDOLIERS_SIZE; i++) { + for (i = 0; i < EQEmu::legacy::BANDOLIERS_SIZE; i++) { pp->bandoliers[i].Name[0] = '\0'; - for (int si = 0; si < EQEmu::constants::BANDOLIER_ITEM_COUNT; si++) { + for (int si = 0; si < EQEmu::legacy::BANDOLIER_ITEM_COUNT; si++) { pp->bandoliers[i].Items[si].ID = 0; pp->bandoliers[i].Items[si].Icon = 0; pp->bandoliers[i].Items[si].Name[0] = '\0'; @@ -1219,7 +1219,7 @@ bool ZoneDatabase::LoadCharacterTribute(uint32 character_id, PlayerProfile_Struc std::string query = StringFormat("SELECT `tier`, `tribute` FROM `character_tribute` WHERE `id` = %u", character_id); auto results = database.QueryDatabase(query); int i = 0; - for (i = 0; i < EQEmu::constants::TRIBUTE_SIZE; i++){ + for (i = 0; i < EQEmu::legacy::TRIBUTE_SIZE; i++){ pp->tributes[i].tribute = 0xFFFFFFFF; pp->tributes[i].tier = 0; } @@ -1238,10 +1238,10 @@ bool ZoneDatabase::LoadCharacterPotions(uint32 character_id, PlayerProfile_Struc { std::string query = StringFormat("SELECT `potion_id`, `item_id`, `icon` FROM `character_potionbelt` WHERE `id` = %u LIMIT %u", - character_id, EQEmu::constants::POTION_BELT_ITEM_COUNT); + character_id, EQEmu::legacy::POTION_BELT_ITEM_COUNT); auto results = database.QueryDatabase(query); int i = 0; - for (i = 0; i < EQEmu::constants::POTION_BELT_ITEM_COUNT; i++) { + for (i = 0; i < EQEmu::legacy::POTION_BELT_ITEM_COUNT; i++) { pp->potionbelt.Items[i].Icon = 0; pp->potionbelt.Items[i].ID = 0; pp->potionbelt.Items[i].Name[0] = '\0'; @@ -1339,7 +1339,7 @@ bool ZoneDatabase::SaveCharacterTribute(uint32 character_id, PlayerProfile_Struc std::string query = StringFormat("DELETE FROM `character_tribute` WHERE `id` = %u", character_id); QueryDatabase(query); /* Save Tributes only if we have values... */ - for (int i = 0; i < EQEmu::constants::TRIBUTE_SIZE; i++){ + for (int i = 0; i < EQEmu::legacy::TRIBUTE_SIZE; i++){ if (pp->tributes[i].tribute > 0 && pp->tributes[i].tribute != TRIBUTE_NONE){ std::string query = StringFormat("REPLACE INTO `character_tribute` (id, tier, tribute) VALUES (%u, %u, %u)", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); QueryDatabase(query); @@ -2092,7 +2092,7 @@ const NPCType* ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load else { auto armorTint_row = armortint_results.begin(); - for (int index = EQEmu::constants::MATERIAL_BEGIN; index <= EQEmu::constants::MATERIAL_END; index++) { + for (int index = EQEmu::legacy::MATERIAL_BEGIN; index <= EQEmu::legacy::MATERIAL_END; index++) { temp_npctype_data->armor_tint[index] = atoi(armorTint_row[index * 3]) << 16; temp_npctype_data->armor_tint[index] |= atoi(armorTint_row[index * 3 + 1]) << 8; temp_npctype_data->armor_tint[index] |= atoi(armorTint_row[index * 3 + 2]); @@ -2102,7 +2102,7 @@ const NPCType* ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load } // Try loading npc_types tint fields if armor tint is 0 or query failed to get results if (armor_tint_id == 0) { - for (int index = MaterialChest; index < MaterialCount; index++) { + for (int index = EQEmu::legacy::MaterialChest; index < EQEmu::legacy::MaterialCount; index++) { temp_npctype_data->armor_tint[index] = temp_npctype_data->armor_tint[0]; } } @@ -2307,7 +2307,7 @@ const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 client tmpNPCType->armor_tint[0] |= (tmpNPCType->armor_tint[0]) ? (0xFF << 24) : 0; if (armor_tint_id == 0) - for (int index = MaterialChest; index <= EQEmu::constants::MATERIAL_END; index++) + for (int index = EQEmu::legacy::MaterialChest; index <= EQEmu::legacy::MATERIAL_END; index++) tmpNPCType->armor_tint[index] = tmpNPCType->armor_tint[0]; else if (tmpNPCType->armor_tint[0] == 0) { std::string armorTint_query = StringFormat("SELECT red1h, grn1h, blu1h, " @@ -2327,7 +2327,7 @@ const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 client else { auto armorTint_row = results.begin(); - for (int index = EQEmu::constants::MATERIAL_BEGIN; index <= EQEmu::constants::MATERIAL_END; index++) { + for (int index = EQEmu::legacy::MATERIAL_BEGIN; index <= EQEmu::legacy::MATERIAL_END; index++) { tmpNPCType->armor_tint[index] = atoi(armorTint_row[index * 3]) << 16; tmpNPCType->armor_tint[index] |= atoi(armorTint_row[index * 3 + 1]) << 8; tmpNPCType->armor_tint[index] |= atoi(armorTint_row[index * 3 + 2]); @@ -2684,7 +2684,7 @@ void ZoneDatabase::LoadMercEquipment(Merc *merc) { int itemCount = 0; for(auto row = results.begin(); row != results.end(); ++row) { - if (itemCount == EQEmu::constants::EQUIPMENT_SIZE) + if (itemCount == EQEmu::legacy::EQUIPMENT_SIZE) break; if(atoi(row[0]) == 0) @@ -3199,7 +3199,7 @@ void ZoneDatabase::SavePetInfo(Client *client) query.clear(); // pet inventory! - for (int index = EQEmu::constants::EQUIPMENT_BEGIN; index <= EQEmu::constants::EQUIPMENT_END; index++) { + for (int index = EQEmu::legacy::EQUIPMENT_BEGIN; index <= EQEmu::legacy::EQUIPMENT_END; index++) { if (!petinfo->Items[index]) continue; @@ -3331,7 +3331,7 @@ void ZoneDatabase::LoadPetInfo(Client *client) continue; int slot = atoi(row[1]); - if (slot < EQEmu::constants::EQUIPMENT_BEGIN || slot > EQEmu::constants::EQUIPMENT_END) + if (slot < EQEmu::legacy::EQUIPMENT_BEGIN || slot > EQEmu::legacy::EQUIPMENT_END) continue; pi->Items[slot] = atoul(row[2]); diff --git a/zone/zonedb.h b/zone/zonedb.h index 3706131a9..a4fc5af7b 100644 --- a/zone/zonedb.h +++ b/zone/zonedb.h @@ -126,7 +126,7 @@ struct PetInfo { uint32 Mana; float size; SpellBuff_Struct Buffs[BUFF_COUNT]; - uint32 Items[EQEmu::constants::EQUIPMENT_SIZE]; + uint32 Items[EQEmu::legacy::EQUIPMENT_SIZE]; char Name[64]; }; diff --git a/zone/zonedump.h b/zone/zonedump.h index cc8fe2010..dcba99408 100644 --- a/zone/zonedump.h +++ b/zone/zonedump.h @@ -86,7 +86,7 @@ struct NPCType uint32 drakkin_heritage; uint32 drakkin_tattoo; uint32 drakkin_details; - uint32 armor_tint[MaterialCount]; + uint32 armor_tint[EQEmu::legacy::MaterialCount]; uint32 min_dmg; uint32 max_dmg; int16 attack_count;