From e75a53b775429a481504e711d9b5b1b13d08ba24 Mon Sep 17 00:00:00 2001 From: Uleat Date: Thu, 7 Apr 2016 17:21:55 -0400 Subject: [PATCH] Rework of eq_dictionary --- changelog.txt | 3 + common/database.cpp | 14 +- common/database_conversions.cpp | 12 +- common/eq_constants.h | 138 ++++--- common/eq_dictionary.cpp | 621 ++++++++++++++-------------- common/eq_dictionary.h | 247 +++++------ common/eq_packet_structs.h | 26 +- common/extprofile.h | 2 +- common/item.cpp | 358 ++++++++-------- common/item_struct.h | 6 +- common/patches/rof.cpp | 318 +++++++------- common/patches/rof2.cpp | 328 +++++++-------- common/patches/rof2_constants.h | 212 +++++----- common/patches/rof2_structs.h | 90 ++-- common/patches/rof_constants.h | 210 +++++----- common/patches/rof_structs.h | 88 ++-- common/patches/sod.cpp | 48 +-- common/patches/sod_constants.h | 207 +++++----- common/patches/sof.cpp | 48 +-- common/patches/sof_constants.h | 207 +++++----- common/patches/titanium.cpp | 22 +- common/patches/titanium_constants.h | 205 +++++---- common/patches/uf.cpp | 48 +-- common/patches/uf_constants.h | 207 +++++----- common/shareddb.cpp | 38 +- world/client.cpp | 10 +- world/worlddb.cpp | 10 +- zone/aa.cpp | 2 +- zone/attack.cpp | 104 ++--- zone/beacon.h | 2 +- zone/bonuses.cpp | 64 +-- zone/bot.cpp | 252 +++++------ zone/bot.h | 6 +- zone/bot_command.cpp | 68 +-- zone/bot_database.cpp | 24 +- zone/client.cpp | 112 ++--- zone/client.h | 4 +- zone/client_mods.cpp | 24 +- zone/client_packet.cpp | 68 +-- zone/client_process.cpp | 38 +- zone/command.cpp | 56 +-- zone/corpse.cpp | 50 +-- zone/corpse.h | 2 +- zone/doors.cpp | 2 +- zone/encounter.h | 2 +- zone/entity.h | 2 +- zone/forage.cpp | 14 +- zone/inventory.cpp | 362 ++++++++-------- zone/loottables.cpp | 22 +- zone/lua_general.cpp | 88 ++-- zone/merc.cpp | 32 +- zone/merc.h | 4 +- zone/mob.cpp | 8 +- zone/mob.h | 24 +- zone/mob_ai.cpp | 8 +- zone/npc.cpp | 8 +- zone/npc.h | 4 +- zone/object.cpp | 12 +- zone/pets.cpp | 10 +- zone/questmgr.cpp | 4 +- zone/special_attacks.cpp | 124 +++--- zone/spell_effects.cpp | 28 +- zone/spells.cpp | 4 +- zone/tradeskills.cpp | 12 +- zone/trading.cpp | 78 ++-- zone/tribute.cpp | 30 +- zone/tune.cpp | 42 +- zone/zonedb.cpp | 38 +- zone/zonedb.h | 2 +- zone/zonedump.h | 2 +- 70 files changed, 2786 insertions(+), 2779 deletions(-) diff --git a/changelog.txt b/changelog.txt index 913204cab..25729bce1 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 04/07/2016 == +Uleat: Rework of eq_dictionary to facilitate inventory work + == 04/05/2016 == Uleat: Moved database query code out of bot.cpp and into the new BotDatabase class diff --git a/common/database.cpp b/common/database.cpp index cdafaa165..36b8237e5 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -705,7 +705,7 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven /* Insert starting inventory... */ std::string invquery; - for (int16 i=EmuConstants::EQUIPMENT_BEGIN; i<=EmuConstants::BANK_BAGS_END;) { + for (int16 i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::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)", @@ -714,16 +714,16 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven auto results = QueryDatabase(invquery); } - if (i == MainCursor) { - i = EmuConstants::GENERAL_BAGS_BEGIN; + if (i == SlotCursor) { + i = EQEmu::Constants::GENERAL_BAGS_BEGIN; continue; } - else if (i == EmuConstants::CURSOR_BAG_END) { - i = EmuConstants::BANK_BEGIN; + else if (i == EQEmu::Constants::CURSOR_BAG_END) { + i = EQEmu::Constants::BANK_BEGIN; continue; } - else if (i == EmuConstants::BANK_END) { - i = EmuConstants::BANK_BAGS_BEGIN; + else if (i == EQEmu::Constants::BANK_END) { + i = EQEmu::Constants::BANK_BAGS_BEGIN; continue; } i++; diff --git a/common/database_conversions.cpp b/common/database_conversions.cpp index c7428c07e..4364ae27a 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[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[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[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[EmuConstants::TRIBUTE_SIZE]; + /*7224*/ Convert::Tribute_Struct tributes[EQEmu::Constants::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 < 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 < EmuConstants::TRIBUTE_SIZE; i++){ + for (i = 0; i < EQEmu::Constants::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/eq_constants.h b/common/eq_constants.h index 222d5802f..d41af6e94 100644 --- a/common/eq_constants.h +++ b/common/eq_constants.h @@ -851,7 +851,7 @@ static const uint8 SkillDamageTypes[HIGHEST_SKILL + 1] = // change to _SkillServ ** Material use slots ** */ -enum MaterialUseSlots : uint8 +enum MaterialSlots : uint8 { MaterialHead = 0, MaterialChest, @@ -862,8 +862,8 @@ enum MaterialUseSlots : uint8 MaterialFeet, MaterialPrimary, MaterialSecondary, - _MaterialCount, - _MaterialInvalid = 255 + MaterialCount, + MaterialInvalid = 255 }; /* @@ -900,71 +900,73 @@ enum MaterialUseSlots : uint8 ** */ -enum InventoryMapTypes : int16 { - MapPossessions = 0, - MapBank, - MapSharedBank, - MapTrade, - MapWorld, - MapLimbo, // 5 - MapTribute, - MapTrophyTribute, - MapGuildTribute, - MapMerchant, - MapDeleted, // 10 - MapCorpse, - MapBazaar, - MapInspect, - MapRealEstate, - MapViewMODPC, // 15 - MapViewMODBank, - MapViewMODSharedBank, - MapViewMODLimbo, - MapAltStorage, - MapArchived, // 20 - MapMail, - MapGuildTrophyTribute, - MapKrono, - MapOther, - _MapCount +enum InventoryTypes : int16 +{ + TypePossessions = 0, + TypeBank, + TypeSharedBank, + TypeTrade, + TypeWorld, + TypeLimbo, // 5 + TypeTribute, + TypeTrophyTribute, + TypeGuildTribute, + TypeMerchant, + TypeDeleted, // 10 + TypeCorpse, + TypeBazaar, + TypeInspect, + TypeRealEstate, + TypeViewMODPC, // 15 + TypeViewMODBank, + TypeViewMODSharedBank, + TypeViewMODLimbo, + TypeAltStorage, + TypeArchived, // 20 + TypeMail, + TypeGuildTrophyTribute, + TypeKrono, + TypeOther, + TypeCount }; -enum InventoryMainTypes : int16 { - MainCharm = 0, - MainEar1, - MainHead, - MainFace, - MainEar2, - MainNeck, // 5 - MainShoulders, - MainArms, - MainBack, - MainWrist1, - MainWrist2, // 10 - MainRange, - MainHands, - MainPrimary, - MainSecondary, - MainFinger1, // 15 - MainFinger2, - MainChest, - MainLegs, - MainFeet, - MainWaist, // 20 - MainPowerSource = 9999, // temp - MainAmmo = 21, // temp - MainGeneral1, - MainGeneral2, - MainGeneral3, - MainGeneral4, // 25 - MainGeneral5, - MainGeneral6, - MainGeneral7, - MainGeneral8, - //MainGeneral9, - //MainGeneral10, - MainCursor, // 30 - _MainCount +enum PossessionsSlots : int16 +{ + SlotCharm = 0, + SlotEar1, + SlotHead, + SlotFace, + SlotEar2, + SlotNeck, // 5 + SlotShoulders, + SlotArms, + SlotBack, + SlotWrist1, + SlotWrist2, // 10 + SlotRange, + SlotHands, + SlotPrimary, + SlotSecondary, + SlotFinger1, // 15 + SlotFinger2, + SlotChest, + SlotLegs, + SlotFeet, + SlotWaist, // 20 + SlotPowerSource = 9999, // temp + SlotAmmo = 21, // temp + SlotGeneral1, + SlotGeneral2, + SlotGeneral3, + SlotGeneral4, // 25 + SlotGeneral5, + SlotGeneral6, + SlotGeneral7, + SlotGeneral8, + //SlotGeneral9, + //SlotGeneral10, + SlotCursor, // 30 + SlotCount }; #define INVALID_INDEX -1 @@ -973,8 +975,8 @@ enum InventoryMainTypes : int16 { // yes..these are redundant... but, they help to identify and define what is actually being performed // plus, since they're pre-op's, they don't affect the actual binary size -#define MAP_BEGIN 0 -#define MAIN_BEGIN 0 +#define TYPE_BEGIN 0 +#define SLOT_BEGIN 0 #define SUB_BEGIN 0 #define AUG_BEGIN 0 diff --git a/common/eq_dictionary.cpp b/common/eq_dictionary.cpp index 9bc602aa1..b4388b537 100644 --- a/common/eq_dictionary.cpp +++ b/common/eq_dictionary.cpp @@ -1,7 +1,7 @@ /* EQEMu: Everquest Server Emulator -Copyright (C) 2001-2015 EQEMu Development Team (http://eqemulator.net) +Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,69 +23,68 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "string_util.h" // -// class EmuConstants +// class EQEmu::Constants // -uint16 EmuConstants::InventoryMapSize(int16 indexMap) +uint16 EQEmu::Constants::InventoryTypeSize(int16 type_index) { - switch (indexMap) - { - case MapPossessions: - return MAP_POSSESSIONS_SIZE; - case MapBank: - return MAP_BANK_SIZE; - case MapSharedBank: - return MAP_SHARED_BANK_SIZE; - case MapTrade: - return MAP_TRADE_SIZE; - case MapWorld: - return MAP_WORLD_SIZE; - case MapLimbo: - return MAP_LIMBO_SIZE; - case MapTribute: - return MAP_TRIBUTE_SIZE; - case MapTrophyTribute: - return MAP_TROPHY_TRIBUTE_SIZE; - case MapGuildTribute: - return MAP_GUILD_TRIBUTE_SIZE; - case MapMerchant: - return MAP_MERCHANT_SIZE; - case MapDeleted: - return MAP_DELETED_SIZE; - case MapCorpse: - return MAP_CORPSE_SIZE; - case MapBazaar: - return MAP_BAZAAR_SIZE; - case MapInspect: - return MAP_INSPECT_SIZE; - case MapRealEstate: - return MAP_REAL_ESTATE_SIZE; - case MapViewMODPC: - return MAP_VIEW_MOD_PC_SIZE; - case MapViewMODBank: - return MAP_VIEW_MOD_BANK_SIZE; - case MapViewMODSharedBank: - return MAP_VIEW_MOD_SHARED_BANK_SIZE; - case MapViewMODLimbo: - return MAP_VIEW_MOD_LIMBO_SIZE; - case MapAltStorage: - return MAP_ALT_STORAGE_SIZE; - case MapArchived: - return MAP_ARCHIVED_SIZE; - case MapMail: - return MAP_MAIL_SIZE; - case MapGuildTrophyTribute: - return MAP_GUILD_TROPHY_TRIBUTE_SIZE; - case MapKrono: - return MAP_KRONO_SIZE; - case MapOther: - return MAP_OTHER_SIZE; + 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; default: return NOT_USED; } } /* -std::string EmuConstants::InventoryLocationName(Location_Struct location) +const char* EQEmu::Constants::InventoryLocationName(Location_Struct location) { // not ready for implementation... std::string ret_str; @@ -94,182 +93,180 @@ std::string EmuConstants::InventoryLocationName(Location_Struct location) } */ -std::string EmuConstants::InventoryMapName(int16 indexMap) +const char* EQEmu::Constants::InventoryTypeName(int16 type_index) { - switch (indexMap) - { + switch (type_index) { case INVALID_INDEX: - return "Invalid Map"; - case MapPossessions: + return "Invalid Type"; + case TypePossessions: return "Possessions"; - case MapBank: + case TypeBank: return "Bank"; - case MapSharedBank: + case TypeSharedBank: return "SharedBank"; - case MapTrade: + case TypeTrade: return "Trade"; - case MapWorld: + case TypeWorld: return "World"; - case MapLimbo: + case TypeLimbo: return "Limbo"; - case MapTribute: + case TypeTribute: return "Tribute"; - case MapTrophyTribute: + case TypeTrophyTribute: return "TrophyTribute"; - case MapGuildTribute: + case TypeGuildTribute: return "GuildTribute"; - case MapMerchant: + case TypeMerchant: return "Merchant"; - case MapDeleted: + case TypeDeleted: return "Deleted"; - case MapCorpse: + case TypeCorpse: return "Corpse"; - case MapBazaar: + case TypeBazaar: return "Bazaar"; - case MapInspect: + case TypeInspect: return "Inspect"; - case MapRealEstate: + case TypeRealEstate: return "RealEstate"; - case MapViewMODPC: + case TypeViewMODPC: return "ViewMODPC"; - case MapViewMODBank: + case TypeViewMODBank: return "ViewMODBank"; - case MapViewMODSharedBank: + case TypeViewMODSharedBank: return "ViewMODSharedBank"; - case MapViewMODLimbo: + case TypeViewMODLimbo: return "ViewMODLimbo"; - case MapAltStorage: + case TypeAltStorage: return "AltStorage"; - case MapArchived: + case TypeArchived: return "Archived"; - case MapMail: + case TypeMail: return "Mail"; - case MapGuildTrophyTribute: + case TypeGuildTrophyTribute: return "GuildTrophyTribute"; - case MapKrono: + case TypeKrono: return "Krono"; - case MapOther: + case TypeOther: return "Other"; default: - return "Unknown Map"; + return "Unknown Type"; } } -std::string EmuConstants::InventoryMainName(int16 indexMain) +const char* EQEmu::Constants::InventorySlotName(int16 slot_index) { - switch (indexMain) - { + switch (slot_index) { case INVALID_INDEX: - return "Invalid Main"; - case MainCharm: + return "Invalid Slot"; + case SlotCharm: return "Charm"; - case MainEar1: + case SlotEar1: return "Ear1"; - case MainHead: + case SlotHead: return "Head"; - case MainFace: + case SlotFace: return "Face"; - case MainEar2: + case SlotEar2: return "Ear2"; - case MainNeck: + case SlotNeck: return "Neck"; - case MainShoulders: + case SlotShoulders: return "Shoulders"; - case MainArms: + case SlotArms: return "Arms"; - case MainBack: + case SlotBack: return "Back"; - case MainWrist1: + case SlotWrist1: return "Wrist1"; - case MainWrist2: + case SlotWrist2: return "Wrist2"; - case MainRange: + case SlotRange: return "Range"; - case MainHands: + case SlotHands: return "Hands"; - case MainPrimary: + case SlotPrimary: return "Primary"; - case MainSecondary: + case SlotSecondary: return "Secondary"; - case MainFinger1: + case SlotFinger1: return "Finger1"; - case MainFinger2: + case SlotFinger2: return "Finger2"; - case MainChest: + case SlotChest: return "Chest"; - case MainLegs: + case SlotLegs: return "Legs"; - case MainFeet: + case SlotFeet: return "Feet"; - case MainWaist: + case SlotWaist: return "Waist"; - case MainPowerSource: + case SlotPowerSource: return "PowerSource"; - case MainAmmo: + case SlotAmmo: return "Ammo"; - case MainGeneral1: + case SlotGeneral1: return "General1"; - case MainGeneral2: + case SlotGeneral2: return "General2"; - case MainGeneral3: + case SlotGeneral3: return "General3"; - case MainGeneral4: + case SlotGeneral4: return "General4"; - case MainGeneral5: + case SlotGeneral5: return "General5"; - case MainGeneral6: + case SlotGeneral6: return "General6"; - case MainGeneral7: + case SlotGeneral7: return "General7"; - case MainGeneral8: + case SlotGeneral8: return "General8"; /* - case MainGeneral9: + case SlotGeneral9: return "General9"; - case MainGeneral10: + case SlotGeneral10: return "General10"; */ - case MainCursor: + case SlotCursor: return "Cursor"; default: - return "Unknown Main"; + return "Unknown Slot"; } } -std::string EmuConstants::InventorySubName(int16 indexSub) +const char* EQEmu::Constants::InventorySubName(int16 sub_index) { - if (indexSub == INVALID_INDEX) + if (sub_index == INVALID_INDEX) return "Invalid Sub"; - if ((uint16)indexSub >= ITEM_CONTAINER_SIZE) + if ((uint16)sub_index >= ITEM_CONTAINER_SIZE) return "Unknown Sub"; - std::string ret_str; - ret_str = StringFormat("Container%i", (indexSub + 1)); // zero-based index..but, count starts at one + static std::string ret_str; + ret_str = StringFormat("Container%i", (sub_index + 1)); // zero-based index..but, count starts at one - return ret_str; + return ret_str.c_str(); } -std::string EmuConstants::InventoryAugName(int16 indexAug) +const char* EQEmu::Constants::InventoryAugName(int16 aug_index) { - if (indexAug == INVALID_INDEX) + if (aug_index == INVALID_INDEX) return "Invalid Aug"; - if ((uint16)indexAug >= ITEM_COMMON_SIZE) + if ((uint16)aug_index >= ITEM_COMMON_SIZE) return "Unknown Aug"; - std::string ret_str; - ret_str = StringFormat("Augment%i", (indexAug + 1)); // zero-based index..but, count starts at one + static std::string ret_str; + ret_str = StringFormat("Augment%i", (aug_index + 1)); // zero-based index..but, count starts at one - return ret_str; + return ret_str.c_str(); } // -// class EQLimits +// class EQEmu::Limits // // client validation -bool EQLimits::IsValidPCClientVersion(ClientVersion clientVersion) +bool EQEmu::Limits::IsValidPCClientVersion(ClientVersion clientVersion) { if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_PC_CLIENT) return true; @@ -277,7 +274,7 @@ bool EQLimits::IsValidPCClientVersion(ClientVersion clientVersion) return false; } -ClientVersion EQLimits::ValidatePCClientVersion(ClientVersion clientVersion) +ClientVersion EQEmu::Limits::ValidatePCClientVersion(ClientVersion clientVersion) { if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_PC_CLIENT) return clientVersion; @@ -286,7 +283,7 @@ ClientVersion EQLimits::ValidatePCClientVersion(ClientVersion clientVersion) } // npc validation -bool EQLimits::IsValidNPCClientVersion(ClientVersion clientVersion) +bool EQEmu::Limits::IsValidNPCClientVersion(ClientVersion clientVersion) { if (clientVersion > LAST_PC_CLIENT && clientVersion <= LAST_NPC_CLIENT) return true; @@ -294,7 +291,7 @@ bool EQLimits::IsValidNPCClientVersion(ClientVersion clientVersion) return false; } -ClientVersion EQLimits::ValidateNPCClientVersion(ClientVersion clientVersion) +ClientVersion EQEmu::Limits::ValidateNPCClientVersion(ClientVersion clientVersion) { if (clientVersion > LAST_PC_CLIENT && clientVersion <= LAST_NPC_CLIENT) return clientVersion; @@ -303,7 +300,7 @@ ClientVersion EQLimits::ValidateNPCClientVersion(ClientVersion clientVersion) } // mob validation -bool EQLimits::IsValidMobClientVersion(ClientVersion clientVersion) +bool EQEmu::Limits::IsValidMobClientVersion(ClientVersion clientVersion) { if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_NPC_CLIENT) return true; @@ -311,7 +308,7 @@ bool EQLimits::IsValidMobClientVersion(ClientVersion clientVersion) return false; } -ClientVersion EQLimits::ValidateMobClientVersion(ClientVersion clientVersion) +ClientVersion EQEmu::Limits::ValidateMobClientVersion(ClientVersion clientVersion) { if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_NPC_CLIENT) return clientVersion; @@ -320,7 +317,7 @@ ClientVersion EQLimits::ValidateMobClientVersion(ClientVersion clientVersion) } // database -size_t EQLimits::CharacterCreationLimit(ClientVersion clientVersion) +size_t EQEmu::Limits::CharacterCreationLimit(ClientVersion clientVersion) { static const size_t local[CLIENT_VERSION_COUNT] = { /*Unknown*/ NOT_USED, @@ -342,7 +339,7 @@ size_t EQLimits::CharacterCreationLimit(ClientVersion clientVersion) } // inventory -uint16 EQLimits::InventoryMapSize(int16 indexMap, ClientVersion clientVersion) +uint16 EQEmu::Limits::InventoryMapSize(int16 indexMap, ClientVersion clientVersion) { // not all maps will have an instantiated container..some are references for queue generators (i.e., bazaar, mail, etc...) // a zero '0' indicates a needed value..otherwise, change to '_NOTUSED' for a null value so indices requiring research can be identified @@ -351,383 +348,383 @@ uint16 EQLimits::InventoryMapSize(int16 indexMap, ClientVersion clientVersion) // make sure that you transcribe the actual value from 'defaults' to here before updating or client crashes will ensue..and/or... // insert older clients inside of the progression of client order // - // MAP_POSSESSIONS_SIZE does not reflect all actual _constants size due to bitmask-use compatibility + // TYPE_POSSESSIONS_SIZE does not reflect all actual _constants size due to bitmask-use compatibility // - // when setting NPC-based values, try to adhere to an EmuConstants:: or NOT_USED value to avoid unnecessary issues + // when setting NPC-based values, try to adhere to an Constants:: or NOT_USED value to avoid unnecessary issues - static const uint16 local[_MapCount][CLIENT_VERSION_COUNT] = { - // server and database are sync'd to current MapPossessions's client as set in 'using namespace RoF::slots;' and - // 'EmuConstants::MAP_POSSESSIONS_SIZE' - use/update EquipmentBitmask(), GeneralBitmask() and CursorBitmask() - // for partial range validation checks and 'EmuConstants::MAP_POSSESSIONS_SIZE' for full range iterations - { // local[MainPossessions] + static const uint16 local[TypeCount][CLIENT_VERSION_COUNT] = { + // 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*/ EmuConstants::MAP_POSSESSIONS_SIZE, -/*Titanium*/ EmuConstants::MAP_POSSESSIONS_SIZE, -/*SoF*/ EmuConstants::MAP_POSSESSIONS_SIZE, -/*SoD*/ EmuConstants::MAP_POSSESSIONS_SIZE, -/*Underfoot*/ EmuConstants::MAP_POSSESSIONS_SIZE, -/*RoF*/ EmuConstants::MAP_POSSESSIONS_SIZE, -/*RoF2*/ EmuConstants::MAP_POSSESSIONS_SIZE, +/*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, -/*NPC*/ EmuConstants::MAP_POSSESSIONS_SIZE, -/*Merc*/ EmuConstants::MAP_POSSESSIONS_SIZE, -/*Bot*/ EmuConstants::MAP_POSSESSIONS_SIZE, -/*Pet*/ EmuConstants::MAP_POSSESSIONS_SIZE +/*NPC*/ Constants::TYPE_POSSESSIONS_SIZE, +/*Merc*/ Constants::TYPE_POSSESSIONS_SIZE, +/*Bot*/ Constants::TYPE_POSSESSIONS_SIZE, +/*Pet*/ Constants::TYPE_POSSESSIONS_SIZE }, - { // local[MapBank] + { // local[TypeBank] /*Unknown*/ NOT_USED, /*62*/ NOT_USED, -/*Titanium*/ Titanium::consts::MAP_BANK_SIZE, -/*SoF*/ EmuConstants::MAP_BANK_SIZE, -/*SoD*/ EmuConstants::MAP_BANK_SIZE, -/*Underfoot*/ EmuConstants::MAP_BANK_SIZE, -/*RoF*/ EmuConstants::MAP_BANK_SIZE, -/*RoF2*/ EmuConstants::MAP_BANK_SIZE, +/*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, /*NPC*/ NOT_USED, /*Merc*/ NOT_USED, /*Bot*/ NOT_USED, /*Pet*/ NOT_USED }, - { // local[MapSharedBank] + { // local[TypeSharedBank] /*Unknown*/ NOT_USED, -/*62*/ EmuConstants::MAP_SHARED_BANK_SIZE, -/*Titanium*/ EmuConstants::MAP_SHARED_BANK_SIZE, -/*SoF*/ EmuConstants::MAP_SHARED_BANK_SIZE, -/*SoD*/ EmuConstants::MAP_SHARED_BANK_SIZE, -/*Underfoot*/ EmuConstants::MAP_SHARED_BANK_SIZE, -/*RoF*/ EmuConstants::MAP_SHARED_BANK_SIZE, -/*RoF2*/ EmuConstants::MAP_SHARED_BANK_SIZE, +/*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, /*NPC*/ NOT_USED, /*Merc*/ NOT_USED, /*Bot*/ NOT_USED, /*Pet*/ NOT_USED }, - { // local[MapTrade] + { // local[TypeTrade] /*Unknown*/ NOT_USED, -/*62*/ EmuConstants::MAP_TRADE_SIZE, -/*Titanium*/ EmuConstants::MAP_TRADE_SIZE, -/*SoF*/ EmuConstants::MAP_TRADE_SIZE, -/*SoD*/ EmuConstants::MAP_TRADE_SIZE, -/*Underfoot*/ EmuConstants::MAP_TRADE_SIZE, -/*RoF*/ EmuConstants::MAP_TRADE_SIZE, -/*RoF2*/ EmuConstants::MAP_TRADE_SIZE, +/*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, /*NPC*/ 4, /*Merc*/ 4, -/*Bot*/ EmuConstants::MAP_TRADE_SIZE, // client thinks this is another client +/*Bot*/ Constants::TYPE_TRADE_SIZE, // client thinks this is another client /*Pet*/ 4 }, - { // local[MapWorld] + { // local[TypeWorld] /*Unknown*/ NOT_USED, -/*62*/ EmuConstants::MAP_WORLD_SIZE, -/*Titanium*/ EmuConstants::MAP_WORLD_SIZE, -/*SoF*/ EmuConstants::MAP_WORLD_SIZE, -/*SoD*/ EmuConstants::MAP_WORLD_SIZE, -/*Underfoot*/ EmuConstants::MAP_WORLD_SIZE, -/*RoF*/ EmuConstants::MAP_WORLD_SIZE, -/*RoF2*/ EmuConstants::MAP_WORLD_SIZE, +/*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, /*NPC*/ NOT_USED, /*Merc*/ NOT_USED, /*Bot*/ NOT_USED, /*Pet*/ NOT_USED }, - { // local[MapLimbo] + { // local[TypeLimbo] /*Unknown*/ NOT_USED, -/*62*/ EmuConstants::MAP_LIMBO_SIZE, -/*Titanium*/ EmuConstants::MAP_LIMBO_SIZE, -/*SoF*/ EmuConstants::MAP_LIMBO_SIZE, -/*SoD*/ EmuConstants::MAP_LIMBO_SIZE, -/*Underfoot*/ EmuConstants::MAP_LIMBO_SIZE, -/*RoF*/ EmuConstants::MAP_LIMBO_SIZE, -/*RoF2*/ EmuConstants::MAP_LIMBO_SIZE, +/*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, /*NPC*/ NOT_USED, /*Merc*/ NOT_USED, /*Bot*/ NOT_USED, /*Pet*/ NOT_USED }, - { // local[MapTribute] + { // local[TypeTribute] /*Unknown*/ NOT_USED, -/*62*/ EmuConstants::MAP_TRIBUTE_SIZE, -/*Titanium*/ EmuConstants::MAP_TRIBUTE_SIZE, -/*SoF*/ EmuConstants::MAP_TRIBUTE_SIZE, -/*SoD*/ EmuConstants::MAP_TRIBUTE_SIZE, -/*Underfoot*/ EmuConstants::MAP_TRIBUTE_SIZE, -/*RoF*/ EmuConstants::MAP_TRIBUTE_SIZE, -/*RoF2*/ EmuConstants::MAP_TRIBUTE_SIZE, +/*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, /*NPC*/ 0, /*Merc*/ 0, /*Bot*/ 0, /*Pet*/ 0 }, - { // local[MapTrophyTribute] + { // local[TypeTrophyTribute] /*Unknown*/ NOT_USED, /*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ EmuConstants::MAP_TROPHY_TRIBUTE_SIZE, -/*RoF2*/ EmuConstants::MAP_TROPHY_TRIBUTE_SIZE, +/*RoF*/ Constants::TYPE_TROPHY_TRIBUTE_SIZE, +/*RoF2*/ Constants::TYPE_TROPHY_TRIBUTE_SIZE, /*NPC*/ 0, /*Merc*/ 0, /*Bot*/ 0, /*Pet*/ 0 }, - { // local[MapGuildTribute] + { // local[TypeGuildTribute] /*Unknown*/ NOT_USED, /*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ EmuConstants::MAP_GUILD_TRIBUTE_SIZE, -/*RoF2*/ EmuConstants::MAP_GUILD_TRIBUTE_SIZE, +/*RoF*/ Constants::TYPE_GUILD_TRIBUTE_SIZE, +/*RoF2*/ Constants::TYPE_GUILD_TRIBUTE_SIZE, /*NPC*/ 0, /*Merc*/ 0, /*Bot*/ 0, /*Pet*/ 0 }, - { // local[MapMerchant] + { // local[TypeMerchant] /*Unknown*/ NOT_USED, /*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ EmuConstants::MAP_MERCHANT_SIZE, -/*RoF2*/ EmuConstants::MAP_MERCHANT_SIZE, +/*RoF*/ Constants::TYPE_MERCHANT_SIZE, +/*RoF2*/ Constants::TYPE_MERCHANT_SIZE, /*NPC*/ 0, /*Merc*/ 0, /*Bot*/ 0, /*Pet*/ 0 }, - { // local[MapDeleted] + { // local[TypeDeleted] /*Unknown*/ NOT_USED, /*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ EmuConstants::MAP_DELETED_SIZE, -/*RoF2*/ EmuConstants::MAP_DELETED_SIZE, +/*RoF*/ Constants::TYPE_DELETED_SIZE, +/*RoF2*/ Constants::TYPE_DELETED_SIZE, /*NPC*/ 0, /*Merc*/ 0, /*Bot*/ 0, /*Pet*/ 0 }, - { // local[MapCorpse] + { // local[TypeCorpse] /*Unknown*/ NOT_USED, /*62*/ NOT_USED, -/*Titanium*/ Titanium::consts::MAP_CORPSE_SIZE, -/*SoF*/ SoF::consts::MAP_CORPSE_SIZE, -/*SoD*/ SoD::consts::MAP_CORPSE_SIZE, -/*Underfoot*/ UF::consts::MAP_CORPSE_SIZE, -/*RoF*/ RoF::consts::MAP_CORPSE_SIZE, -/*RoF2*/ RoF2::consts::MAP_CORPSE_SIZE, +/*Titanium*/ Titanium::consts::TYPE_CORPSE_SIZE, +/*SoF*/ SoF::consts::TYPE_CORPSE_SIZE, +/*SoD*/ SoD::consts::TYPE_CORPSE_SIZE, +/*Underfoot*/ UF::consts::TYPE_CORPSE_SIZE, +/*RoF*/ RoF::consts::TYPE_CORPSE_SIZE, +/*RoF2*/ RoF2::consts::TYPE_CORPSE_SIZE, /*NPC*/ 0, /*Merc*/ 0, /*Bot*/ 0, /*Pet*/ 0 }, - { // local[MapBazaar] + { // local[TypeBazaar] /*Unknown*/ NOT_USED, -/*62*/ EmuConstants::MAP_BAZAAR_SIZE, -/*Titanium*/ EmuConstants::MAP_BAZAAR_SIZE, -/*SoF*/ EmuConstants::MAP_BAZAAR_SIZE, -/*SoD*/ EmuConstants::MAP_BAZAAR_SIZE, -/*Underfoot*/ EmuConstants::MAP_BAZAAR_SIZE, -/*RoF*/ EmuConstants::MAP_BAZAAR_SIZE, -/*RoF2*/ EmuConstants::MAP_BAZAAR_SIZE, +/*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, -/*NPC*/ 0, // this may need to be 'EmuConstants::MAP_BAZAAR_SIZE' if offline client traders respawn as an npc +/*NPC*/ 0, // this may need to be 'Constants::TYPE_BAZAAR_SIZE' if offline client traders respawn as an npc /*Merc*/ 0, /*Bot*/ 0, /*Pet*/ 0 }, - { // local[MapInspect] + { // local[TypeInspect] /*Unknown*/ NOT_USED, /*62*/ NOT_USED, -/*Titanium*/ Titanium::consts::MAP_INSPECT_SIZE, -/*SoF*/ SoF::consts::MAP_INSPECT_SIZE, -/*SoD*/ SoD::consts::MAP_INSPECT_SIZE, -/*Underfoot*/ UF::consts::MAP_INSPECT_SIZE, -/*RoF*/ RoF::consts::MAP_INSPECT_SIZE, -/*RoF2*/ RoF2::consts::MAP_INSPECT_SIZE, +/*Titanium*/ Titanium::consts::TYPE_INSPECT_SIZE, +/*SoF*/ SoF::consts::TYPE_INSPECT_SIZE, +/*SoD*/ SoD::consts::TYPE_INSPECT_SIZE, +/*Underfoot*/ UF::consts::TYPE_INSPECT_SIZE, +/*RoF*/ RoF::consts::TYPE_INSPECT_SIZE, +/*RoF2*/ RoF2::consts::TYPE_INSPECT_SIZE, /*NPC*/ NOT_USED, /*Merc*/ NOT_USED, /*Bot*/ NOT_USED, /*Pet*/ NOT_USED }, - { // local[MapRealEstate] + { // local[TypeRealEstate] /*Unknown*/ NOT_USED, /*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ EmuConstants::MAP_REAL_ESTATE_SIZE, -/*RoF2*/ EmuConstants::MAP_REAL_ESTATE_SIZE, +/*RoF*/ Constants::TYPE_REAL_ESTATE_SIZE, +/*RoF2*/ Constants::TYPE_REAL_ESTATE_SIZE, /*NPC*/ 0, /*Merc*/ 0, /*Bot*/ 0, /*Pet*/ 0 }, - { // local[MapViewMODPC] + { // local[TypeViewMODPC] /*Unknown*/ NOT_USED, /*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ EmuConstants::MAP_VIEW_MOD_PC_SIZE, -/*RoF2*/ EmuConstants::MAP_VIEW_MOD_PC_SIZE, +/*RoF*/ Constants::TYPE_VIEW_MOD_PC_SIZE, +/*RoF2*/ Constants::TYPE_VIEW_MOD_PC_SIZE, /*NPC*/ 0, /*Merc*/ 0, /*Bot*/ 0, /*Pet*/ 0 }, - { // local[MapViewMODBank] + { // local[TypeViewMODBank] /*Unknown*/ NOT_USED, /*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ EmuConstants::MAP_VIEW_MOD_BANK_SIZE, -/*RoF2*/ EmuConstants::MAP_VIEW_MOD_BANK_SIZE, +/*RoF*/ Constants::TYPE_VIEW_MOD_BANK_SIZE, +/*RoF2*/ Constants::TYPE_VIEW_MOD_BANK_SIZE, /*NPC*/ 0, /*Merc*/ 0, /*Bot*/ 0, /*Pet*/ 0 }, - { // local[MapViewMODSharedBank] + { // local[TypeViewMODSharedBank] /*Unknown*/ NOT_USED, /*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ EmuConstants::MAP_VIEW_MOD_SHARED_BANK_SIZE, -/*RoF2*/ EmuConstants::MAP_VIEW_MOD_SHARED_BANK_SIZE, +/*RoF*/ Constants::TYPE_VIEW_MOD_SHARED_BANK_SIZE, +/*RoF2*/ Constants::TYPE_VIEW_MOD_SHARED_BANK_SIZE, /*NPC*/ 0, /*Merc*/ 0, /*Bot*/ 0, /*Pet*/ 0 }, - { // local[MapViewMODLimbo] + { // local[TypeViewMODLimbo] /*Unknown*/ NOT_USED, /*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ EmuConstants::MAP_VIEW_MOD_LIMBO_SIZE, -/*RoF2*/ EmuConstants::MAP_VIEW_MOD_LIMBO_SIZE, +/*RoF*/ Constants::TYPE_VIEW_MOD_LIMBO_SIZE, +/*RoF2*/ Constants::TYPE_VIEW_MOD_LIMBO_SIZE, /*NPC*/ 0, /*Merc*/ 0, /*Bot*/ 0, /*Pet*/ 0 }, - { // local[MapAltStorage] + { // local[TypeAltStorage] /*Unknown*/ NOT_USED, /*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ EmuConstants::MAP_ALT_STORAGE_SIZE, -/*RoF2*/ EmuConstants::MAP_ALT_STORAGE_SIZE, +/*RoF*/ Constants::TYPE_ALT_STORAGE_SIZE, +/*RoF2*/ Constants::TYPE_ALT_STORAGE_SIZE, /*NPC*/ 0, /*Merc*/ 0, /*Bot*/ 0, /*Pet*/ 0 }, - { // local[MapArchived] + { // local[TypeArchived] /*Unknown*/ NOT_USED, /*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ EmuConstants::MAP_ARCHIVED_SIZE, -/*RoF2*/ EmuConstants::MAP_ARCHIVED_SIZE, +/*RoF*/ Constants::TYPE_ARCHIVED_SIZE, +/*RoF2*/ Constants::TYPE_ARCHIVED_SIZE, /*NPC*/ 0, /*Merc*/ 0, /*Bot*/ 0, /*Pet*/ 0 }, - { // local[MapMail] + { // local[TypeMail] /*Unknown*/ NOT_USED, /*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ EmuConstants::MAP_MAIL_SIZE, -/*RoF2*/ EmuConstants::MAP_MAIL_SIZE, +/*RoF*/ Constants::TYPE_MAIL_SIZE, +/*RoF2*/ Constants::TYPE_MAIL_SIZE, /*NPC*/ 0, /*Merc*/ 0, /*Bot*/ 0, /*Pet*/ 0 }, - { // local[MapGuildTrophyTribute] + { // local[TypeGuildTrophyTribute] /*Unknown*/ NOT_USED, /*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ EmuConstants::MAP_GUILD_TROPHY_TRIBUTE_SIZE, -/*RoF2*/ EmuConstants::MAP_GUILD_TROPHY_TRIBUTE_SIZE, +/*RoF*/ Constants::TYPE_GUILD_TROPHY_TRIBUTE_SIZE, +/*RoF2*/ Constants::TYPE_GUILD_TROPHY_TRIBUTE_SIZE, /*NPC*/ 0, /*Merc*/ 0, /*Bot*/ 0, /*Pet*/ 0 }, - { // local[MapKrono] + { // local[TypeKrono] /*Unknown*/ NOT_USED, /*62*/ NOT_USED, /*Titanium*/ NOT_USED, /*SoF*/ NOT_USED, /*SoD*/ NOT_USED, /*Underfoot*/ NOT_USED, -/*RoF*/ EmuConstants::MAP_KRONO_SIZE, -/*RoF2*/ EmuConstants::MAP_KRONO_SIZE, +/*RoF*/ Constants::TYPE_KRONO_SIZE, +/*RoF2*/ Constants::TYPE_KRONO_SIZE, /*NPC*/ 0, /*Merc*/ 0, /*Bot*/ 0, /*Pet*/ 0 }, - { // local[MapOther] + { // local[TypeOther] /*Unknown*/ NOT_USED, /*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, /*Underfoot*/ 0, -/*RoF*/ EmuConstants::MAP_OTHER_SIZE, -/*RoF2*/ EmuConstants::MAP_OTHER_SIZE, +/*RoF*/ Constants::TYPE_OTHER_SIZE, +/*RoF2*/ Constants::TYPE_OTHER_SIZE, /*NPC*/ 0, /*Merc*/ 0, @@ -736,13 +733,13 @@ uint16 EQLimits::InventoryMapSize(int16 indexMap, ClientVersion clientVersion) } }; - if ((uint16)indexMap < _MapCount) + if ((uint16)indexMap < TypeCount) return local[indexMap][static_cast(ValidateMobClientVersion(clientVersion))]; return NOT_USED; } -uint64 EQLimits::PossessionsBitmask(ClientVersion clientVersion) +uint64 EQEmu::Limits::PossessionsBitmask(ClientVersion clientVersion) { // these are for the new inventory system (RoF)..not the current (Ti) one... // 0x0000000000200000 is SlotPowerSource (SoF+) @@ -769,7 +766,7 @@ uint64 EQLimits::PossessionsBitmask(ClientVersion clientVersion) //return local[static_cast(ValidateMobClientVersion(clientVersion))]; } -uint64 EQLimits::EquipmentBitmask(ClientVersion clientVersion) +uint64 EQEmu::Limits::EquipmentBitmask(ClientVersion clientVersion) { static const uint64 local[CLIENT_VERSION_COUNT] = { /*Unknown*/ NOT_USED, @@ -791,7 +788,7 @@ uint64 EQLimits::EquipmentBitmask(ClientVersion clientVersion) //return local[static_cast(ValidateMobClientVersion(clientVersion))]; } -uint64 EQLimits::GeneralBitmask(ClientVersion clientVersion) +uint64 EQEmu::Limits::GeneralBitmask(ClientVersion clientVersion) { static const uint64 local[CLIENT_VERSION_COUNT] = { /*Unknown*/ NOT_USED, @@ -813,7 +810,7 @@ uint64 EQLimits::GeneralBitmask(ClientVersion clientVersion) //return local[static_cast(ValidateMobClientVersion(clientVersion))]; } -uint64 EQLimits::CursorBitmask(ClientVersion clientVersion) +uint64 EQEmu::Limits::CursorBitmask(ClientVersion clientVersion) { static const uint64 local[CLIENT_VERSION_COUNT] = { /*Unknown*/ NOT_USED, @@ -835,7 +832,7 @@ uint64 EQLimits::CursorBitmask(ClientVersion clientVersion) //return local[static_cast(ValidateMobClientVersion(clientVersion))]; } -bool EQLimits::AllowsEmptyBagInBag(ClientVersion clientVersion) +bool EQEmu::Limits::AllowsEmptyBagInBag(ClientVersion clientVersion) { static const bool local[CLIENT_VERSION_COUNT] = { /*Unknown*/ false, @@ -857,7 +854,7 @@ bool EQLimits::AllowsEmptyBagInBag(ClientVersion clientVersion) //return local[static_cast(ValidateMobClientVersion(clientVersion))]; } -bool EQLimits::AllowsClickCastFromBag(ClientVersion clientVersion) +bool EQEmu::Limits::AllowsClickCastFromBag(ClientVersion clientVersion) { static const bool local[CLIENT_VERSION_COUNT] = { /*Unknown*/ false, @@ -879,49 +876,49 @@ bool EQLimits::AllowsClickCastFromBag(ClientVersion clientVersion) } // items -uint16 EQLimits::ItemCommonSize(ClientVersion clientVersion) +uint16 EQEmu::Limits::ItemCommonSize(ClientVersion clientVersion) { static const uint16 local[CLIENT_VERSION_COUNT] = { /*Unknown*/ NOT_USED, -/*62*/ EmuConstants::ITEM_COMMON_SIZE, -/*Titanium*/ EmuConstants::ITEM_COMMON_SIZE, -/*SoF*/ EmuConstants::ITEM_COMMON_SIZE, -/*SoD*/ EmuConstants::ITEM_COMMON_SIZE, -/*Underfoot*/ EmuConstants::ITEM_COMMON_SIZE, -/*RoF*/ EmuConstants::ITEM_COMMON_SIZE, -/*RoF2*/ EmuConstants::ITEM_COMMON_SIZE, +/*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, -/*NPC*/ EmuConstants::ITEM_COMMON_SIZE, -/*Merc*/ EmuConstants::ITEM_COMMON_SIZE, -/*Bot*/ EmuConstants::ITEM_COMMON_SIZE, -/*Pet*/ EmuConstants::ITEM_COMMON_SIZE +/*NPC*/ Constants::ITEM_COMMON_SIZE, +/*Merc*/ Constants::ITEM_COMMON_SIZE, +/*Bot*/ Constants::ITEM_COMMON_SIZE, +/*Pet*/ Constants::ITEM_COMMON_SIZE }; return local[static_cast(ValidateMobClientVersion(clientVersion))]; } -uint16 EQLimits::ItemContainerSize(ClientVersion clientVersion) +uint16 EQEmu::Limits::ItemContainerSize(ClientVersion clientVersion) { static const uint16 local[CLIENT_VERSION_COUNT] = { /*Unknown*/ NOT_USED, -/*62*/ EmuConstants::ITEM_CONTAINER_SIZE, -/*Titanium*/ EmuConstants::ITEM_CONTAINER_SIZE, -/*SoF*/ EmuConstants::ITEM_CONTAINER_SIZE, -/*SoD*/ EmuConstants::ITEM_CONTAINER_SIZE, -/*Underfoot*/ EmuConstants::ITEM_CONTAINER_SIZE, -/*RoF*/ EmuConstants::ITEM_CONTAINER_SIZE, -/*RoF2*/ EmuConstants::ITEM_CONTAINER_SIZE, +/*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, -/*NPC*/ EmuConstants::ITEM_CONTAINER_SIZE, -/*Merc*/ EmuConstants::ITEM_CONTAINER_SIZE, -/*Bot*/ EmuConstants::ITEM_CONTAINER_SIZE, -/*Pet*/ EmuConstants::ITEM_CONTAINER_SIZE +/*NPC*/ Constants::ITEM_CONTAINER_SIZE, +/*Merc*/ Constants::ITEM_CONTAINER_SIZE, +/*Bot*/ Constants::ITEM_CONTAINER_SIZE, +/*Pet*/ Constants::ITEM_CONTAINER_SIZE }; return local[static_cast(ValidateMobClientVersion(clientVersion))]; } -bool EQLimits::CoinHasWeight(ClientVersion clientVersion) +bool EQEmu::Limits::CoinHasWeight(ClientVersion clientVersion) { static const bool local[CLIENT_VERSION_COUNT] = { /*Unknown*/ true, diff --git a/common/eq_dictionary.h b/common/eq_dictionary.h index 7828dd5cc..f67f2b65f 100644 --- a/common/eq_dictionary.h +++ b/common/eq_dictionary.h @@ -1,7 +1,7 @@ /* EQEMu: Everquest Server Emulator -Copyright (C) 2001-2015 EQEMu Development Team (http://eqemulator.net) +Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -42,156 +42,157 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //using namespace RoF2::maps; // server inventory maps enumeration (code and database sync'd to reference) //using namespace RoF::slots; // server possessions slots enumeration (code and database sync'd to reference) -class EmuConstants -{ + +namespace EQEmu { // an immutable value is required to initialize arrays, etc... use this class as a repository for those -public: - // database - static const ClientVersion CHARACTER_CREATION_CLIENT = ClientVersion::RoF2; // adjust according to starting item placement and target client + class Constants { + public: + // database + static const ClientVersion CHARACTER_CREATION_CLIENT = ClientVersion::RoF2; // adjust according to starting item placement and target client - static const size_t CHARACTER_CREATION_LIMIT = RoF2::consts::CHARACTER_CREATION_LIMIT; + static const size_t CHARACTER_CREATION_LIMIT = RoF2::consts::CHARACTER_CREATION_LIMIT; - // inventory - static uint16 InventoryMapSize(int16 indexMap); - //static std::string InventoryLocationName(Location_Struct location); - static std::string InventoryMapName(int16 indexMap); - static std::string InventoryMainName(int16 indexMain); - static std::string InventorySubName(int16 indexSub); - static std::string InventoryAugName(int16 indexAug); + // inventory + static uint16 InventoryTypeSize(int16 type_index); + //static const char* InventoryLocationName(Location_Struct location); + static const char* InventoryTypeName(int16 type_index); + static const char* InventorySlotName(int16 slot_index); + static const char* InventorySubName(int16 sub_index); + static 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 MAP_POSSESSIONS_SIZE = _MainCount; - static const uint16 MAP_BANK_SIZE = 24; - static const uint16 MAP_SHARED_BANK_SIZE = 2; - static const uint16 MAP_TRADE_SIZE = 8; - static const uint16 MAP_WORLD_SIZE = 10; - static const uint16 MAP_LIMBO_SIZE = 36; - static const uint16 MAP_TRIBUTE_SIZE = 5; // (need client values) - static const uint16 MAP_TROPHY_TRIBUTE_SIZE = 0; - static const uint16 MAP_GUILD_TRIBUTE_SIZE = 0; - static const uint16 MAP_MERCHANT_SIZE = 0; - static const uint16 MAP_DELETED_SIZE = 0; - static const uint16 MAP_CORPSE_SIZE = _MainCount; // no bitmask use..limits to size of client corpse window (see EQLimits::InventoryMapSize(MapCorpse, = EmuConstants::TRADE_BEGIN && slot_id <= EmuConstants::TRADE_END) { + else if (slot_id >= EQEmu::Constants::TRADE_BEGIN && slot_id <= EQEmu::Constants::TRADE_END) { result = _GetItem(m_trade, slot_id); } - else if (slot_id >= EmuConstants::SHARED_BANK_BEGIN && slot_id <= EmuConstants::SHARED_BANK_END) { + else if (slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && slot_id <= EQEmu::Constants::SHARED_BANK_END) { // Shared Bank slots result = _GetItem(m_shbank, slot_id); } - else if (slot_id >= EmuConstants::BANK_BEGIN && slot_id <= EmuConstants::BANK_END) { + else if (slot_id >= EQEmu::Constants::BANK_BEGIN && slot_id <= EQEmu::Constants::BANK_END) { // Bank slots result = _GetItem(m_bank, slot_id); } - else if ((slot_id >= EmuConstants::GENERAL_BEGIN && slot_id <= EmuConstants::GENERAL_END)) { + else if ((slot_id >= EQEmu::Constants::GENERAL_BEGIN && slot_id <= EQEmu::Constants::GENERAL_END)) { // Personal inventory slots result = _GetItem(m_inv, slot_id); } - else if ((slot_id >= EmuConstants::EQUIPMENT_BEGIN && slot_id <= EmuConstants::EQUIPMENT_END) || - (slot_id >= EmuConstants::TRIBUTE_BEGIN && slot_id <= EmuConstants::TRIBUTE_END) || (slot_id == MainPowerSource)) { + 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)) { // Equippable slots (on body) result = _GetItem(m_worn, slot_id); } // Inner bag slots - else if (slot_id >= EmuConstants::TRADE_BAGS_BEGIN && slot_id <= EmuConstants::TRADE_BAGS_END) { + else if (slot_id >= EQEmu::Constants::TRADE_BAGS_BEGIN && slot_id <= EQEmu::Constants::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 >= EmuConstants::SHARED_BANK_BAGS_BEGIN && slot_id <= EmuConstants::SHARED_BANK_BAGS_END) { + else if (slot_id >= EQEmu::Constants::SHARED_BANK_BAGS_BEGIN && slot_id <= EQEmu::Constants::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 >= EmuConstants::BANK_BAGS_BEGIN && slot_id <= EmuConstants::BANK_BAGS_END) { + else if (slot_id >= EQEmu::Constants::BANK_BAGS_BEGIN && slot_id <= EQEmu::Constants::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 >= EmuConstants::CURSOR_BAG_BEGIN && slot_id <= EmuConstants::CURSOR_BAG_END) { + else if (slot_id >= EQEmu::Constants::CURSOR_BAG_BEGIN && slot_id <= EQEmu::Constants::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 >= EmuConstants::GENERAL_BAGS_BEGIN && slot_id <= EmuConstants::GENERAL_BAGS_END) { + else if (slot_id >= EQEmu::Constants::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::Constants::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 MainCursor; + return 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_BEGIN; i < EmuConstants::ITEM_CONTAINER_SIZE; i++) { + for (uint8 i = SUB_BEGIN; i < EQEmu::Constants::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 == MainCursor) { + if (slot_id == SlotCursor) { p = m_cursor.pop(); } - else if ((slot_id >= EmuConstants::EQUIPMENT_BEGIN && slot_id <= EmuConstants::EQUIPMENT_END) || (slot_id == MainPowerSource)) { + else if ((slot_id >= EQEmu::Constants::EQUIPMENT_BEGIN && slot_id <= EQEmu::Constants::EQUIPMENT_END) || (slot_id == SlotPowerSource)) { p = m_worn[slot_id]; m_worn.erase(slot_id); } - else if ((slot_id >= EmuConstants::GENERAL_BEGIN && slot_id <= EmuConstants::GENERAL_END)) { + else if ((slot_id >= EQEmu::Constants::GENERAL_BEGIN && slot_id <= EQEmu::Constants::GENERAL_END)) { p = m_inv[slot_id]; m_inv.erase(slot_id); } - else if (slot_id >= EmuConstants::TRIBUTE_BEGIN && slot_id <= EmuConstants::TRIBUTE_END) { + else if (slot_id >= EQEmu::Constants::TRIBUTE_BEGIN && slot_id <= EQEmu::Constants::TRIBUTE_END) { p = m_worn[slot_id]; m_worn.erase(slot_id); } - else if (slot_id >= EmuConstants::BANK_BEGIN && slot_id <= EmuConstants::BANK_END) { + else if (slot_id >= EQEmu::Constants::BANK_BEGIN && slot_id <= EQEmu::Constants::BANK_END) { p = m_bank[slot_id]; m_bank.erase(slot_id); } - else if (slot_id >= EmuConstants::SHARED_BANK_BEGIN && slot_id <= EmuConstants::SHARED_BANK_END) { + else if (slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && slot_id <= EQEmu::Constants::SHARED_BANK_END) { p = m_shbank[slot_id]; m_shbank.erase(slot_id); } - else if (slot_id >= EmuConstants::TRADE_BEGIN && slot_id <= EmuConstants::TRADE_END) { + else if (slot_id >= EQEmu::Constants::TRADE_BEGIN && slot_id <= EQEmu::Constants::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 = EmuConstants::GENERAL_BEGIN; i <= EmuConstants::GENERAL_END; i++) { + for (int16 i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++) { ItemInst* InvItem = GetItem(i); @@ -409,7 +409,7 @@ bool Inventory::HasSpaceForItem(const Item_Struct *ItemToTry, int16 Quantity) { } } - for (int16 i = EmuConstants::GENERAL_BEGIN; i <= EmuConstants::GENERAL_END; i++) { + for (int16 i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::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 = EmuConstants::GENERAL_BEGIN; i <= EmuConstants::GENERAL_END; i++) { + for (int16 i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++) { if (!GetItem(i)) // Found available slot in personal inventory return i; } if (!for_bag) { - for (int16 i = EmuConstants::GENERAL_BEGIN; i <= EmuConstants::GENERAL_END; i++) { + for (int16 i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::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 MainCursor; + return 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 = EmuConstants::GENERAL_BEGIN; free_slot <= EmuConstants::GENERAL_END; ++free_slot) { + for (int16 free_slot = EQEmu::Constants::GENERAL_BEGIN; free_slot <= EQEmu::Constants::GENERAL_END; ++free_slot) { if (!m_inv[free_slot]) return free_slot; } - return MainCursor; // return cursor since bags do not stack and will not fit inside other bags..yet...) + return 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 = EmuConstants::GENERAL_BEGIN; free_slot <= EmuConstants::GENERAL_END; ++free_slot) { + for (int16 free_slot = EQEmu::Constants::GENERAL_BEGIN; free_slot <= EQEmu::Constants::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 = EmuConstants::GENERAL_BEGIN; free_slot <= EmuConstants::GENERAL_END; ++free_slot) { + for (int16 free_slot = EQEmu::Constants::GENERAL_BEGIN; free_slot <= EQEmu::Constants::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_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EmuConstants::ITEM_CONTAINER_SIZE); ++free_bag_slot) { + for (uint8 free_bag_slot = SUB_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::Constants::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 = EmuConstants::GENERAL_BEGIN; free_slot <= EmuConstants::GENERAL_END; ++free_slot) { + for (int16 free_slot = EQEmu::Constants::GENERAL_BEGIN; free_slot <= EQEmu::Constants::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_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EmuConstants::ITEM_CONTAINER_SIZE); ++free_bag_slot) { + for (uint8 free_bag_slot = SUB_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::Constants::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 = EmuConstants::GENERAL_BEGIN; free_slot <= EmuConstants::GENERAL_END; ++free_slot) { + for (int16 free_slot = EQEmu::Constants::GENERAL_BEGIN; free_slot <= EQEmu::Constants::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_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EmuConstants::ITEM_CONTAINER_SIZE); ++free_bag_slot) { + for (uint8 free_bag_slot = SUB_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::Constants::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 = EmuConstants::GENERAL_BEGIN; free_slot <= EmuConstants::GENERAL_END; ++free_slot) { + for (int16 free_slot = EQEmu::Constants::GENERAL_BEGIN; free_slot <= EQEmu::Constants::GENERAL_END; ++free_slot) { const ItemInst* main_inst = m_inv[free_slot]; if (!main_inst) return free_slot; } - for (int16 free_slot = EmuConstants::GENERAL_BEGIN; free_slot <= EmuConstants::GENERAL_END; ++free_slot) { + for (int16 free_slot = EQEmu::Constants::GENERAL_BEGIN; free_slot <= EQEmu::Constants::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_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EmuConstants::ITEM_CONTAINER_SIZE); ++free_bag_slot) { + for (uint8 free_bag_slot = SUB_BEGIN; (free_bag_slot < main_inst->GetItem()->BagSlots) && (free_bag_slot < EQEmu::Constants::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 MainCursor; + return 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 >= EmuConstants::GENERAL_BAGS_BEGIN && slot_id <= EmuConstants::GENERAL_BAGS_END) { - parent_slot_id = EmuConstants::GENERAL_BEGIN + (slot_id - EmuConstants::GENERAL_BAGS_BEGIN) / EmuConstants::ITEM_CONTAINER_SIZE; + 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; } - else if (slot_id >= EmuConstants::CURSOR_BAG_BEGIN && slot_id <= EmuConstants::CURSOR_BAG_END) { - parent_slot_id = MainCursor; + else if (slot_id >= EQEmu::Constants::CURSOR_BAG_BEGIN && slot_id <= EQEmu::Constants::CURSOR_BAG_END) { + parent_slot_id = SlotCursor; } - else if (slot_id >= EmuConstants::BANK_BAGS_BEGIN && slot_id <= EmuConstants::BANK_BAGS_END) { - parent_slot_id = EmuConstants::BANK_BEGIN + (slot_id - EmuConstants::BANK_BAGS_BEGIN) / EmuConstants::ITEM_CONTAINER_SIZE; + 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 >= EmuConstants::SHARED_BANK_BAGS_BEGIN && slot_id <= EmuConstants::SHARED_BANK_BAGS_END) { - parent_slot_id = EmuConstants::SHARED_BANK_BEGIN + (slot_id - EmuConstants::SHARED_BANK_BAGS_BEGIN) / EmuConstants::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 >= EmuConstants::TRADE_BAGS_BEGIN && slot_id <= EmuConstants::TRADE_BAGS_END) { - parent_slot_id = EmuConstants::TRADE_BEGIN + (slot_id - EmuConstants::TRADE_BAGS_BEGIN) / EmuConstants::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; } return parent_slot_id; @@ -798,20 +798,20 @@ int16 Inventory::CalcSlotId(int16 bagslot_id, uint8 bagidx) { int16 slot_id = INVALID_INDEX; - if (bagslot_id == MainCursor || bagslot_id == 8000) { - slot_id = EmuConstants::CURSOR_BAG_BEGIN + bagidx; + if (bagslot_id == SlotCursor || bagslot_id == 8000) { + slot_id = EQEmu::Constants::CURSOR_BAG_BEGIN + bagidx; } - else if (bagslot_id >= EmuConstants::GENERAL_BEGIN && bagslot_id <= EmuConstants::GENERAL_END) { - slot_id = EmuConstants::GENERAL_BAGS_BEGIN + (bagslot_id - EmuConstants::GENERAL_BEGIN) * EmuConstants::ITEM_CONTAINER_SIZE + 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 >= EmuConstants::BANK_BEGIN && bagslot_id <= EmuConstants::BANK_END) { - slot_id = EmuConstants::BANK_BAGS_BEGIN + (bagslot_id - EmuConstants::BANK_BEGIN) * EmuConstants::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 >= EmuConstants::SHARED_BANK_BEGIN && bagslot_id <= EmuConstants::SHARED_BANK_END) { - slot_id = EmuConstants::SHARED_BANK_BAGS_BEGIN + (bagslot_id - EmuConstants::SHARED_BANK_BEGIN) * EmuConstants::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 >= EmuConstants::TRADE_BEGIN && bagslot_id <= EmuConstants::TRADE_END) { - slot_id = EmuConstants::TRADE_BAGS_BEGIN + (bagslot_id - EmuConstants::TRADE_BEGIN) * EmuConstants::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; } 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 >= EmuConstants::GENERAL_BAGS_BEGIN && slot_id <= EmuConstants::GENERAL_BAGS_END) { - index = (slot_id - EmuConstants::GENERAL_BAGS_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; } - else if (slot_id >= EmuConstants::CURSOR_BAG_BEGIN && slot_id <= EmuConstants::CURSOR_BAG_END) { - index = (slot_id - EmuConstants::CURSOR_BAG_BEGIN); // % EmuConstants::ITEM_CONTAINER_SIZE; - not needed since range is 10 slots + 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 >= EmuConstants::BANK_BAGS_BEGIN && slot_id <= EmuConstants::BANK_BAGS_END) { - index = (slot_id - EmuConstants::BANK_BAGS_BEGIN) % EmuConstants::ITEM_CONTAINER_SIZE; + 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 >= EmuConstants::SHARED_BANK_BAGS_BEGIN && slot_id <= EmuConstants::SHARED_BANK_BAGS_END) { - index = (slot_id - EmuConstants::SHARED_BANK_BAGS_BEGIN) % EmuConstants::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 >= EmuConstants::TRADE_BAGS_BEGIN && slot_id <= EmuConstants::TRADE_BAGS_END) { - index = (slot_id - EmuConstants::TRADE_BAGS_BEGIN) % EmuConstants::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 >= EmuConstants::WORLD_BEGIN && slot_id <= EmuConstants::WORLD_END) { - index = (slot_id - EmuConstants::WORLD_BEGIN); // % EmuConstants::ITEM_CONTAINER_SIZE; - not needed since range is 10 slots + 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 } return index; @@ -851,23 +851,23 @@ int16 Inventory::CalcSlotFromMaterial(uint8 material) switch (material) { case MaterialHead: - return MainHead; + return SlotHead; case MaterialChest: - return MainChest; + return SlotChest; case MaterialArms: - return MainArms; + return SlotArms; case MaterialWrist: - return MainWrist1; // there's 2 bracers, only one bracer material + return SlotWrist1; // there's 2 bracers, only one bracer material case MaterialHands: - return MainHands; + return SlotHands; case MaterialLegs: - return MainLegs; + return SlotLegs; case MaterialFeet: - return MainFeet; + return SlotFeet; case MaterialPrimary: - return MainPrimary; + return SlotPrimary; case MaterialSecondary: - return MainSecondary; + return SlotSecondary; default: return INVALID_INDEX; } @@ -877,27 +877,27 @@ uint8 Inventory::CalcMaterialFromSlot(int16 equipslot) { switch (equipslot) { - case MainHead: + case SlotHead: return MaterialHead; - case MainChest: + case SlotChest: return MaterialChest; - case MainArms: + case SlotArms: return MaterialArms; - case MainWrist1: + case SlotWrist1: //case SLOT_BRACER02: // non-live behavior return MaterialWrist; - case MainHands: + case SlotHands: return MaterialHands; - case MainLegs: + case SlotLegs: return MaterialLegs; - case MainFeet: + case SlotFeet: return MaterialFeet; - case MainPrimary: + case SlotPrimary: return MaterialPrimary; - case MainSecondary: + case SlotSecondary: return MaterialSecondary; default: - return _MaterialInvalid; + return MaterialInvalid; } } @@ -921,13 +921,13 @@ 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 <= EmuConstants::GENERAL_END || slot_id == MainPowerSource) + if ((uint16)slot_id <= EQEmu::Constants::GENERAL_END || slot_id == SlotPowerSource) { return true; } - else if (slot_id >= EmuConstants::GENERAL_BAGS_BEGIN && slot_id <= EmuConstants::GENERAL_BAGS_END) + else if (slot_id >= EQEmu::Constants::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::Constants::GENERAL_BAGS_END) { - if (EQLimits::AllowsClickCastFromBag(m_version)) + if (EQEmu::Limits::AllowsClickCastFromBag(m_version)) return true; } @@ -936,7 +936,7 @@ bool Inventory::SupportsClickCasting(int16 slot_id) bool Inventory::SupportsPotionBeltCasting(int16 slot_id) { - if ((uint16)slot_id <= EmuConstants::GENERAL_END || slot_id == MainPowerSource || (slot_id >= EmuConstants::GENERAL_BAGS_BEGIN && slot_id <= EmuConstants::GENERAL_BAGS_END)) + 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)) 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 == MainCursor) || - (slot_id >= EmuConstants::GENERAL_BEGIN && slot_id <= EmuConstants::GENERAL_END) || - (slot_id >= EmuConstants::BANK_BEGIN && slot_id <= EmuConstants::BANK_END) || - (slot_id >= EmuConstants::SHARED_BANK_BEGIN && slot_id <= EmuConstants::SHARED_BANK_END) || - (slot_id >= EmuConstants::TRADE_BEGIN && slot_id <= EmuConstants::TRADE_END) + 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) ) { return true; } @@ -987,7 +987,7 @@ int Inventory::GetSlotByItemInst(ItemInst *inst) { } if (m_cursor.peek_front() == inst) { - return MainCursor; + return 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 < EmuConstants::EQUIPMENT_BEGIN || iter->first > EmuConstants::EQUIPMENT_END) && iter->first != MainPowerSource) { continue; } - if (iter->first == MainAmmo) { continue; } + if ((iter->first < EQEmu::Constants::EQUIPMENT_BEGIN || iter->first > EQEmu::Constants::EQUIPMENT_END) && iter->first != SlotPowerSource) { continue; } + if (iter->first == 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 < EmuConstants::GENERAL_BEGIN || iter->first > EmuConstants::GENERAL_END) { continue; } + if (iter->first < EQEmu::Constants::GENERAL_BEGIN || iter->first > EQEmu::Constants::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 == MainCursor) { + if (slot_id == 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 >= EmuConstants::EQUIPMENT_BEGIN && slot_id <= EmuConstants::EQUIPMENT_END) || (slot_id == MainPowerSource)) { + else if ((slot_id >= EQEmu::Constants::EQUIPMENT_BEGIN && slot_id <= EQEmu::Constants::EQUIPMENT_END) || (slot_id == SlotPowerSource)) { m_worn[slot_id] = inst; result = slot_id; } - else if ((slot_id >= EmuConstants::GENERAL_BEGIN && slot_id <= EmuConstants::GENERAL_END)) { + else if ((slot_id >= EQEmu::Constants::GENERAL_BEGIN && slot_id <= EQEmu::Constants::GENERAL_END)) { m_inv[slot_id] = inst; result = slot_id; } - else if (slot_id >= EmuConstants::TRIBUTE_BEGIN && slot_id <= EmuConstants::TRIBUTE_END) { + else if (slot_id >= EQEmu::Constants::TRIBUTE_BEGIN && slot_id <= EQEmu::Constants::TRIBUTE_END) { m_worn[slot_id] = inst; result = slot_id; } - else if (slot_id >= EmuConstants::BANK_BEGIN && slot_id <= EmuConstants::BANK_END) { + else if (slot_id >= EQEmu::Constants::BANK_BEGIN && slot_id <= EQEmu::Constants::BANK_END) { m_bank[slot_id] = inst; result = slot_id; } - else if (slot_id >= EmuConstants::SHARED_BANK_BEGIN && slot_id <= EmuConstants::SHARED_BANK_END) { + else if (slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && slot_id <= EQEmu::Constants::SHARED_BANK_END) { m_shbank[slot_id] = inst; result = slot_id; } - else if (slot_id >= EmuConstants::TRADE_BEGIN && slot_id <= EmuConstants::TRADE_END) { + else if (slot_id >= EQEmu::Constants::TRADE_BEGIN && slot_id <= EQEmu::Constants::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_BEGIN; index < EmuConstants::ITEM_COMMON_SIZE; ++index) { + for (int index = AUG_BEGIN; index < EQEmu::Constants::ITEM_COMMON_SIZE; ++index) { if (inst->GetAugmentItemID(index) == item_id && quantity <= 1) return 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_BEGIN; index < EmuConstants::ITEM_COMMON_SIZE; ++index) { + for (int index = AUG_BEGIN; index < EQEmu::Constants::ITEM_COMMON_SIZE; ++index) { if (bag_inst->GetAugmentItemID(index) == item_id && quantity <= 1) return 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 MainCursor; + return SlotCursor; } - for (int index = AUG_BEGIN; index < EmuConstants::ITEM_COMMON_SIZE; ++index) { + for (int index = AUG_BEGIN; index < EQEmu::Constants::ITEM_COMMON_SIZE; ++index) { if (inst->GetAugmentItemID(index) == item_id && quantity <= 1) return 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(MainCursor, bag_iter->first); + return Inventory::CalcSlotId(SlotCursor, bag_iter->first); } - for (int index = AUG_BEGIN; index < EmuConstants::ITEM_COMMON_SIZE; ++index) { + for (int index = AUG_BEGIN; index < EQEmu::Constants::ITEM_COMMON_SIZE; ++index) { if (bag_inst->GetAugmentItemID(index) == item_id && quantity <= 1) return 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 MainCursor; + return 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(MainCursor, bag_iter->first); + return Inventory::CalcSlotId(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_BEGIN; index < EmuConstants::ITEM_COMMON_SIZE; ++index) { + for (int index = AUG_BEGIN; index < EQEmu::Constants::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_BEGIN; index < EmuConstants::ITEM_COMMON_SIZE; ++index) { + for (int index = AUG_BEGIN; index < EQEmu::Constants::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 MainCursor; + return SlotCursor; - for (int index = AUG_BEGIN; index < EmuConstants::ITEM_COMMON_SIZE; ++index) { + for (int index = AUG_BEGIN; index < EQEmu::Constants::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(MainCursor, bag_iter->first); + return Inventory::CalcSlotId(SlotCursor, bag_iter->first); - for (int index = AUG_BEGIN; index < EmuConstants::ITEM_COMMON_SIZE; ++index) { + for (int index = AUG_BEGIN; index < EQEmu::Constants::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 == MainPowerSource) { use_slot = MainGeneral1; } - if ((uint16)slot_id <= EmuConstants::EQUIPMENT_END) { use_slot = slot_id; } + if (slot_id == SlotPowerSource) { use_slot = SlotGeneral1; } + if ((uint16)slot_id <= EQEmu::Constants::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 < EmuConstants::ITEM_COMMON_SIZE; ++index) { + for (int index = 0; index < EQEmu::Constants::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 = EmuConstants::EQUIPMENT_BEGIN; - for (; index <= MainGeneral1; ++index) { // MainGeneral1 should be EmuConstants::EQUIPMENT_END + int index = EQEmu::Constants::EQUIPMENT_BEGIN; + for (; index <= SlotGeneral1; ++index) { // MainGeneral1 should be EQEmu::Constants::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_BEGIN; - for (; index < EmuConstants::ITEM_COMMON_SIZE; ++index) { + for (; index < EQEmu::Constants::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 < EmuConstants::ITEM_COMMON_SIZE) ? index : INVALID_INDEX; + return (index < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; index < EmuConstants::ITEM_COMMON_SIZE; ++index) { + for (int index = AUG_BEGIN; index < EQEmu::Constants::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 == MainPowerSource && (m_item->Slots & (1 << 22))) { return true; } // got lazy... - else if (slot_id != MainPowerSource && slot_id > EmuConstants::EQUIPMENT_END) { 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 { return false; } } @@ -2330,7 +2330,7 @@ int ItemInst::GetItemArmorClass(bool augments) const if (item) { ac = item->AC; if (augments) - for (int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) { + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) { + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) { + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) { + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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 0d7505a2c..0cae9806d 100644 --- a/common/item_struct.h +++ b/common/item_struct.h @@ -184,9 +184,9 @@ struct Item_Struct { int32 FactionAmt4; // Faction Amt 4 char CharmFile[32]; // ? uint32 AugType; - uint8 AugSlotType[EmuConstants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Type - uint8 AugSlotVisible[EmuConstants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Visible - uint8 AugSlotUnk2[EmuConstants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Unknown Most likely Powersource related + 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 uint32 LDoNTheme; uint32 LDoNPrice; uint32 LDoNSold; diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index b5349b617..d07281414 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -27,13 +27,13 @@ namespace RoF char* SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth); // server to client inventory location converters - static inline structs::ItemSlotStruct ServerToRoFSlot(uint32 serverSlot); - static inline structs::MainInvItemSlotStruct ServerToRoFMainInvSlot(uint32 serverSlot); + static inline structs::InventorySlot_Struct ServerToRoFSlot(uint32 serverSlot); + static inline structs::TypelessInventorySlot_Struct ServerToRoFTypelessSlot(uint32 serverSlot); static inline uint32 ServerToRoFCorpseSlot(uint32 serverCorpseSlot); // client to server inventory location converters - static inline uint32 RoFToServerSlot(structs::ItemSlotStruct rofSlot); - static inline uint32 RoFToServerMainInvSlot(structs::MainInvItemSlotStruct rofSlot); + static inline uint32 RoFToServerSlot(structs::InventorySlot_Struct rofSlot); + static inline uint32 RoFToServerTypelessSlot(structs::TypelessInventorySlot_Struct rofSlot); static inline uint32 RoFToServerCorpseSlot(uint32 rofCorpseSlot); // server to client text link converter @@ -162,7 +162,7 @@ namespace RoF eq->unknown000 = 1; OUT(npcid); - eq->slot = ServerToRoFMainInvSlot(emu->slot); + eq->inventory_slot = ServerToRoFTypelessSlot(emu->slot); OUT(charges); OUT(sell_price); @@ -214,7 +214,7 @@ namespace RoF SETUP_DIRECT_ENCODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct); OUT(merchant_entity_id); - eq->slot_id = ServerToRoFMainInvSlot(emu->slot_id); + eq->inventory_slot = ServerToRoFTypelessSlot(emu->slot_id); OUT(charges); OUT(cost); @@ -238,7 +238,7 @@ namespace RoF ENCODE_LENGTH_EXACT(ApplyPoison_Struct); SETUP_DIRECT_ENCODE(ApplyPoison_Struct, structs::ApplyPoison_Struct); - eq->inventorySlot = ServerToRoFMainInvSlot(emu->inventorySlot); + eq->inventory_slot = ServerToRoFTypelessSlot(emu->inventorySlot); OUT(success); FINISH_ENCODE(); @@ -481,7 +481,7 @@ namespace RoF OUT(slot); OUT(spell_id); - eq->inventoryslot = ServerToRoFSlot(emu->inventoryslot); + eq->inventory_slot = ServerToRoFSlot(emu->inventoryslot); //OUT(inventoryslot); OUT(target_id); @@ -1536,7 +1536,7 @@ namespace RoF ENCODE_LENGTH_EXACT(ItemVerifyReply_Struct); SETUP_DIRECT_ENCODE(ItemVerifyReply_Struct, structs::ItemVerifyReply_Struct); - eq->slot = ServerToRoFSlot(emu->slot); + eq->inventory_slot = ServerToRoFSlot(emu->slot); OUT(spell); OUT(target); @@ -2342,7 +2342,7 @@ namespace RoF outapp->WriteUInt32(consts::BANDOLIERS_SIZE); // Copy bandoliers where server and client indexes converge - for (uint32 r = 0; r < EmuConstants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) { + for (uint32 r = 0; r < EQEmu::Constants::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 = EmuConstants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { + for (uint32 r = EQEmu::Constants::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 < EmuConstants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (uint32 r = 0; r < EQEmu::Constants::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 = EmuConstants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (uint32 r = EQEmu::Constants::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(EmuConstants::TRIBUTE_SIZE); + outapp->WriteUInt32(EQEmu::Constants::TRIBUTE_SIZE); - for (uint32 r = 0; r < EmuConstants::TRIBUTE_SIZE; r++) + for (uint32 r = 0; r < EQEmu::Constants::TRIBUTE_SIZE; r++) { outapp->WriteUInt32(emu->tributes[r].tribute); outapp->WriteUInt32(emu->tributes[r].tier); @@ -2820,12 +2820,12 @@ namespace RoF OUT(object_type); OUT(some_id); eq->container_slot = ServerToRoFSlot(emu->unknown1); - structs::ItemSlotStruct RoFSlot; - RoFSlot.SlotType = 8; // Observed + structs::InventorySlot_Struct RoFSlot; + RoFSlot.Type = 8; // Observed RoFSlot.Unknown02 = 0; - RoFSlot.MainSlot = 0xffff; - RoFSlot.SubSlot = 0xffff; - RoFSlot.AugSlot = 0xffff; + RoFSlot.Slot = 0xffff; + RoFSlot.Sub = 0xffff; + RoFSlot.Aug = 0xffff; RoFSlot.Unknown01 = 0; eq->unknown_slot = RoFSlot; OUT(recipe_id); @@ -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 < 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; @@ -3154,7 +3154,7 @@ namespace RoF SETUP_DIRECT_ENCODE(Merchant_Purchase_Struct, structs::Merchant_Purchase_Struct); OUT(npcid); - eq->itemslot = ServerToRoFMainInvSlot(emu->itemslot); + eq->inventory_slot = ServerToRoFTypelessSlot(emu->itemslot); //OUT(itemslot); OUT(quantity); OUT(price); @@ -3679,7 +3679,7 @@ namespace RoF ENCODE_LENGTH_EXACT(TributeItem_Struct); SETUP_DIRECT_ENCODE(TributeItem_Struct, structs::TributeItem_Struct); - eq->slot = ServerToRoFSlot(emu->slot); + eq->inventory_slot = ServerToRoFSlot(emu->slot); OUT(quantity); OUT(tribute_master_id); OUT(tribute_points); @@ -4164,7 +4164,7 @@ namespace RoF SETUP_DIRECT_DECODE(Adventure_Sell_Struct, structs::Adventure_Sell_Struct); IN(npcid); - emu->slot = RoFToServerMainInvSlot(eq->slot); + emu->slot = RoFToServerTypelessSlot(eq->inventory_slot); IN(charges); IN(sell_price); @@ -4177,7 +4177,7 @@ namespace RoF SETUP_DIRECT_DECODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct); IN(merchant_entity_id); - emu->slot_id = RoFToServerMainInvSlot(eq->slot_id); + emu->slot_id = RoFToServerTypelessSlot(eq->inventory_slot); IN(charges); IN(cost); @@ -4190,7 +4190,7 @@ namespace RoF SETUP_DIRECT_DECODE(AltCurrencySelectItem_Struct, structs::AltCurrencySelectItem_Struct); IN(merchant_entity_id); - emu->slot_id = RoFToServerMainInvSlot(eq->slot_id); + emu->slot_id = RoFToServerTypelessSlot(eq->inventory_slot); FINISH_DIRECT_DECODE(); } @@ -4212,7 +4212,7 @@ namespace RoF DECODE_LENGTH_EXACT(structs::ApplyPoison_Struct); SETUP_DIRECT_DECODE(ApplyPoison_Struct, structs::ApplyPoison_Struct); - emu->inventorySlot = RoFToServerMainInvSlot(eq->inventorySlot); + emu->inventorySlot = RoFToServerTypelessSlot(eq->inventory_slot); IN(success); FINISH_DIRECT_DECODE(); @@ -4321,7 +4321,7 @@ namespace RoF IN(slot); IN(spell_id); - emu->inventoryslot = RoFToServerSlot(eq->inventoryslot); + emu->inventoryslot = RoFToServerSlot(eq->inventory_slot); //IN(inventoryslot); IN(target_id); @@ -4449,7 +4449,7 @@ namespace RoF DECODE_LENGTH_EXACT(structs::Consume_Struct); SETUP_DIRECT_DECODE(Consume_Struct, structs::Consume_Struct); - emu->slot = RoFToServerSlot(eq->slot); + emu->slot = RoFToServerSlot(eq->inventory_slot); IN(auto_consumed); IN(type); @@ -4810,7 +4810,7 @@ namespace RoF IN(item_id); int r; - for (r = 0; r < EmuConstants::ITEM_COMMON_SIZE; r++) { + for (r = 0; r < EQEmu::Constants::ITEM_COMMON_SIZE; r++) { IN(augments[r]); } // Max Augs is now 6, but no code to support that many yet @@ -4825,7 +4825,7 @@ namespace RoF DECODE_LENGTH_EXACT(structs::ItemVerifyRequest_Struct); SETUP_DIRECT_DECODE(ItemVerifyRequest_Struct, structs::ItemVerifyRequest_Struct); - emu->slot = RoFToServerSlot(eq->slot); + emu->slot = RoFToServerSlot(eq->inventory_slot); IN(target); FINISH_DIRECT_DECODE(); @@ -4866,7 +4866,7 @@ namespace RoF SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot); - Log.Out(Logs::General, Logs::Netcode, "[RoF] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); + Log.Out(Logs::General, Logs::Netcode, "[RoF] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.Type, eq->to_slot.Type, eq->from_slot.Slot, eq->to_slot.Slot, eq->from_slot.Sub, eq->to_slot.Sub, eq->from_slot.Aug, eq->to_slot.Aug, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); emu->from_slot = RoFToServerSlot(eq->from_slot); emu->to_slot = RoFToServerSlot(eq->to_slot); IN(number_in_stack); @@ -5015,7 +5015,7 @@ namespace RoF SETUP_DIRECT_DECODE(Merchant_Purchase_Struct, structs::Merchant_Purchase_Struct); IN(npcid); - emu->itemslot = RoFToServerMainInvSlot(eq->itemslot); + emu->itemslot = RoFToServerTypelessSlot(eq->inventory_slot); //IN(itemslot); IN(quantity); IN(price); @@ -5114,7 +5114,7 @@ namespace RoF DECODE_LENGTH_EXACT(structs::TributeItem_Struct); SETUP_DIRECT_DECODE(TributeItem_Struct, structs::TributeItem_Struct); - emu->slot = RoFToServerSlot(eq->slot); + emu->slot = RoFToServerSlot(eq->inventory_slot); IN(quantity); IN(tribute_master_id); IN(tribute_points); @@ -5214,12 +5214,12 @@ namespace RoF hdr.stacksize = stackable ? charges : 1; hdr.unknown004 = 0; - structs::ItemSlotStruct slot_id = ServerToRoFSlot(slot_id_in); + structs::InventorySlot_Struct slot_id = ServerToRoFSlot(slot_id_in); - hdr.slot_type = (merchant_slot == 0) ? slot_id.SlotType : 9; // 9 is merchant 20 is reclaim items? - hdr.main_slot = (merchant_slot == 0) ? slot_id.MainSlot : merchant_slot; - hdr.sub_slot = (merchant_slot == 0) ? slot_id.SubSlot : 0xffff; - hdr.unknown013 = (merchant_slot == 0) ? slot_id.AugSlot : 0xffff; + hdr.slot_type = (merchant_slot == 0) ? slot_id.Type : 9; // 9 is merchant 20 is reclaim items? + hdr.main_slot = (merchant_slot == 0) ? slot_id.Slot : merchant_slot; + hdr.sub_slot = (merchant_slot == 0) ? slot_id.Sub : 0xffff; + hdr.unknown013 = (merchant_slot == 0) ? slot_id.Aug : 0xffff; hdr.price = inst->GetPrice(); hdr.merchant_slot = (merchant_slot == 0) ? 1 : inst->GetMerchantCount(); //hdr.merchant_slot = (merchant_slot == 0) ? 1 : 0xffffffff; @@ -5678,7 +5678,7 @@ namespace RoF uint32 SubLengths[10]; - for (int x = SUB_BEGIN; x < EmuConstants::ITEM_CONTAINER_SIZE; ++x) { + for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) { SubSerializations[x] = nullptr; @@ -5690,15 +5690,15 @@ namespace RoF iqbs.subitem_count++; - if (slot_id_in >= EmuConstants::GENERAL_BEGIN && slot_id_in <= EmuConstants::GENERAL_END) // (< 30) - no cursor? + if (slot_id_in >= EQEmu::Constants::GENERAL_BEGIN && slot_id_in <= EQEmu::Constants::GENERAL_END) // (< 30) - no cursor? //SubSlotNumber = (((slot_id_in + 3) * 10) + x + 1); - SubSlotNumber = (((slot_id_in + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + x + 1); - else if (slot_id_in >= EmuConstants::BANK_BEGIN && slot_id_in <= EmuConstants::BANK_END) + 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 - 2000) * 10) + 2030 + x + 1); - SubSlotNumber = (((slot_id_in - EmuConstants::BANK_BEGIN) * EmuConstants::ITEM_CONTAINER_SIZE) + EmuConstants::BANK_BAGS_BEGIN + x); - else if (slot_id_in >= EmuConstants::SHARED_BANK_BEGIN && slot_id_in <= EmuConstants::SHARED_BANK_END) + 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 - 2500) * 10) + 2530 + x + 1); - SubSlotNumber = (((slot_id_in - EmuConstants::SHARED_BANK_BEGIN) * EmuConstants::ITEM_CONTAINER_SIZE) + EmuConstants::SHARED_BANK_BAGS_BEGIN + x); + SubSlotNumber = (((slot_id_in - EQEmu::Constants::SHARED_BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::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_BEGIN; x < EmuConstants::ITEM_CONTAINER_SIZE; ++x) { + for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) { if (SubSerializations[x]) { @@ -5733,30 +5733,30 @@ namespace RoF return item_serial; } - static inline structs::ItemSlotStruct ServerToRoFSlot(uint32 serverSlot) + static inline structs::InventorySlot_Struct ServerToRoFSlot(uint32 serverSlot) { - structs::ItemSlotStruct RoFSlot; - RoFSlot.SlotType = INVALID_INDEX; + structs::InventorySlot_Struct RoFSlot; + RoFSlot.Type = INVALID_INDEX; RoFSlot.Unknown02 = NOT_USED; - RoFSlot.MainSlot = INVALID_INDEX; - RoFSlot.SubSlot = INVALID_INDEX; - RoFSlot.AugSlot = INVALID_INDEX; + RoFSlot.Slot = INVALID_INDEX; + RoFSlot.Sub = INVALID_INDEX; + RoFSlot.Aug = INVALID_INDEX; RoFSlot.Unknown01 = NOT_USED; uint32 TempSlot = 0; - if (serverSlot < 56 || serverSlot == MainPowerSource) { // Main Inventory and Cursor - RoFSlot.SlotType = maps::MapPossessions; - RoFSlot.MainSlot = serverSlot; + if (serverSlot < 56 || serverSlot == SlotPowerSource) { // Main Inventory and Cursor + RoFSlot.Type = inventory::TypePossessions; + RoFSlot.Slot = serverSlot; - if (serverSlot == MainPowerSource) - RoFSlot.MainSlot = slots::MainPowerSource; + if (serverSlot == SlotPowerSource) + RoFSlot.Slot = inventory::SlotPowerSource; - else if (serverSlot >= MainCursor) // Cursor and Extended Corpse Inventory - RoFSlot.MainSlot += 3; + else if (serverSlot >= SlotCursor) // Cursor and Extended Corpse Inventory + RoFSlot.Slot += 3; - else if (serverSlot >= MainAmmo) // (> 20) - RoFSlot.MainSlot += 1; + else if (serverSlot >= SlotAmmo) // (> 20) + RoFSlot.Slot += 1; } /*else if (ServerSlot < 51) { // Cursor Buffer @@ -5764,51 +5764,51 @@ namespace RoF RoFSlot.MainSlot = ServerSlot - 31; }*/ - else if (serverSlot >= EmuConstants::GENERAL_BAGS_BEGIN && serverSlot <= EmuConstants::CURSOR_BAG_END) { // (> 250 && < 341) - RoFSlot.SlotType = maps::MapPossessions; + else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END) { // (> 250 && < 341) + RoFSlot.Type = inventory::TypePossessions; TempSlot = serverSlot - 1; - RoFSlot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 2; - RoFSlot.SubSlot = TempSlot - ((RoFSlot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE); + RoFSlot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 2; + RoFSlot.Sub = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::Constants::ITEM_CONTAINER_SIZE); - if (RoFSlot.MainSlot >= slots::MainGeneral9) // (> 30) - RoFSlot.MainSlot = slots::MainCursor; + if (RoFSlot.Slot >= inventory::SlotGeneral9) // (> 30) + RoFSlot.Slot = inventory::SlotCursor; } - else if (serverSlot >= EmuConstants::TRIBUTE_BEGIN && serverSlot <= EmuConstants::TRIBUTE_END) { // Tribute - RoFSlot.SlotType = maps::MapTribute; - RoFSlot.MainSlot = serverSlot - EmuConstants::TRIBUTE_BEGIN; + else if (serverSlot >= EQEmu::Constants::TRIBUTE_BEGIN && serverSlot <= EQEmu::Constants::TRIBUTE_END) { // Tribute + RoFSlot.Type = inventory::TypeTribute; + RoFSlot.Slot = serverSlot - EQEmu::Constants::TRIBUTE_BEGIN; } - else if (serverSlot >= EmuConstants::BANK_BEGIN && serverSlot <= EmuConstants::BANK_BAGS_END) { - RoFSlot.SlotType = maps::MapBank; - TempSlot = serverSlot - EmuConstants::BANK_BEGIN; - RoFSlot.MainSlot = TempSlot; + else if (serverSlot >= EQEmu::Constants::BANK_BEGIN && serverSlot <= EQEmu::Constants::BANK_BAGS_END) { + RoFSlot.Type = inventory::TypeBank; + TempSlot = serverSlot - EQEmu::Constants::BANK_BEGIN; + RoFSlot.Slot = TempSlot; if (TempSlot > 30) { // (> 30) - RoFSlot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 3; - RoFSlot.SubSlot = TempSlot - ((RoFSlot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE); + RoFSlot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3; + RoFSlot.Sub = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE); } } - else if (serverSlot >= EmuConstants::SHARED_BANK_BEGIN && serverSlot <= EmuConstants::SHARED_BANK_BAGS_END) { - RoFSlot.SlotType = maps::MapSharedBank; - TempSlot = serverSlot - EmuConstants::SHARED_BANK_BEGIN; - RoFSlot.MainSlot = TempSlot; + else if (serverSlot >= EQEmu::Constants::SHARED_BANK_BEGIN && serverSlot <= EQEmu::Constants::SHARED_BANK_BAGS_END) { + RoFSlot.Type = inventory::TypeSharedBank; + TempSlot = serverSlot - EQEmu::Constants::SHARED_BANK_BEGIN; + RoFSlot.Slot = TempSlot; if (TempSlot > 30) { // (> 30) - RoFSlot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 3; - RoFSlot.SubSlot = TempSlot - ((RoFSlot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE); + RoFSlot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3; + RoFSlot.Sub = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE); } } - else if (serverSlot >= EmuConstants::TRADE_BEGIN && serverSlot <= EmuConstants::TRADE_BAGS_END) { - RoFSlot.SlotType = maps::MapTrade; - TempSlot = serverSlot - EmuConstants::TRADE_BEGIN; - RoFSlot.MainSlot = TempSlot; + else if (serverSlot >= EQEmu::Constants::TRADE_BEGIN && serverSlot <= EQEmu::Constants::TRADE_BAGS_END) { + RoFSlot.Type = inventory::TypeTrade; + TempSlot = serverSlot - EQEmu::Constants::TRADE_BEGIN; + RoFSlot.Slot = TempSlot; if (TempSlot > 30) { - RoFSlot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 3; - RoFSlot.SubSlot = TempSlot - ((RoFSlot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE); + RoFSlot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3; + RoFSlot.Sub = TempSlot - ((RoFSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE); } /* @@ -5825,38 +5825,38 @@ namespace RoF */ } - else if (serverSlot >= EmuConstants::WORLD_BEGIN && serverSlot <= EmuConstants::WORLD_END) { - RoFSlot.SlotType = maps::MapWorld; - TempSlot = serverSlot - EmuConstants::WORLD_BEGIN; - RoFSlot.MainSlot = TempSlot; + else if (serverSlot >= EQEmu::Constants::WORLD_BEGIN && serverSlot <= EQEmu::Constants::WORLD_END) { + RoFSlot.Type = inventory::TypeWorld; + TempSlot = serverSlot - EQEmu::Constants::WORLD_BEGIN; + RoFSlot.Slot = TempSlot; } - Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoFSlot.Type, RoFSlot.Unknown02, RoFSlot.Slot, RoFSlot.Sub, RoFSlot.Aug, RoFSlot.Unknown01); return RoFSlot; } - static inline structs::MainInvItemSlotStruct ServerToRoFMainInvSlot(uint32 serverSlot) + static inline structs::TypelessInventorySlot_Struct ServerToRoFTypelessSlot(uint32 serverSlot) { - structs::MainInvItemSlotStruct RoFSlot; - RoFSlot.MainSlot = INVALID_INDEX; - RoFSlot.SubSlot = INVALID_INDEX; - RoFSlot.AugSlot = INVALID_INDEX; + structs::TypelessInventorySlot_Struct RoFSlot; + RoFSlot.Slot = INVALID_INDEX; + RoFSlot.Sub = INVALID_INDEX; + RoFSlot.Aug = INVALID_INDEX; RoFSlot.Unknown01 = NOT_USED; uint32 TempSlot = 0; - if (serverSlot < 56 || serverSlot == MainPowerSource) { // (< 52) - RoFSlot.MainSlot = serverSlot; + if (serverSlot < 56 || serverSlot == SlotPowerSource) { // (< 52) + RoFSlot.Slot = serverSlot; - if (serverSlot == MainPowerSource) - RoFSlot.MainSlot = slots::MainPowerSource; + if (serverSlot == SlotPowerSource) + RoFSlot.Slot = inventory::SlotPowerSource; - else if (serverSlot >= MainCursor) // Cursor and Extended Corpse Inventory - RoFSlot.MainSlot += 3; + else if (serverSlot >= SlotCursor) // Cursor and Extended Corpse Inventory + RoFSlot.Slot += 3; - else if (serverSlot >= MainAmmo) // Ammo and Personl Inventory - RoFSlot.MainSlot += 1; + else if (serverSlot >= SlotAmmo) // Ammo and Personl Inventory + RoFSlot.Slot += 1; /*else if (ServerSlot >= MainCursor) { // Cursor RoFSlot.MainSlot = slots::MainCursor; @@ -5866,13 +5866,13 @@ namespace RoF }*/ } - else if (serverSlot >= EmuConstants::GENERAL_BAGS_BEGIN && serverSlot <= EmuConstants::CURSOR_BAG_END) { + else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END) { TempSlot = serverSlot - 1; - RoFSlot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 2; - RoFSlot.SubSlot = TempSlot - ((RoFSlot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE); + RoFSlot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 2; + RoFSlot.Sub = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::Constants::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.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); + 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.Sub, RoFSlot.Aug, RoFSlot.Unknown01); return RoFSlot; } @@ -5882,17 +5882,17 @@ namespace RoF return (serverCorpseSlot + 1); } - static inline uint32 RoFToServerSlot(structs::ItemSlotStruct rofSlot) + static inline uint32 RoFToServerSlot(structs::InventorySlot_Struct rofSlot) { uint32 ServerSlot = INVALID_INDEX; uint32 TempSlot = 0; - if (rofSlot.SlotType == maps::MapPossessions && rofSlot.MainSlot < 57) { // Worn/Personal Inventory and Cursor (< 51) - if (rofSlot.MainSlot == slots::MainPowerSource) - TempSlot = MainPowerSource; + if (rofSlot.Type == inventory::TypePossessions && rofSlot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 51) + if (rofSlot.Slot == inventory::SlotPowerSource) + TempSlot = SlotPowerSource; - else if (rofSlot.MainSlot >= slots::MainCursor) // Cursor and Extended Corpse Inventory - TempSlot = rofSlot.MainSlot - 3; + else if (rofSlot.Slot >= inventory::SlotCursor) // Cursor and Extended Corpse Inventory + TempSlot = rofSlot.Slot - 3; /*else if (RoFSlot.MainSlot == slots::MainGeneral9 || RoFSlot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF inventory/corpse slots // Need to figure out what to do when we get these @@ -5905,61 +5905,61 @@ namespace RoF // For now, it's probably best to leave as-is and let this work itself out in the inventory rework. }*/ - else if (rofSlot.MainSlot >= slots::MainAmmo) // Ammo and Main Inventory - TempSlot = rofSlot.MainSlot - 1; + else if (rofSlot.Slot >= inventory::SlotAmmo) // Ammo and Main Inventory + TempSlot = rofSlot.Slot - 1; else // Worn Slots - TempSlot = rofSlot.MainSlot; + TempSlot = rofSlot.Slot; - if (rofSlot.SubSlot >= SUB_BEGIN) // Bag Slots - TempSlot = ((TempSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rofSlot.SubSlot + 1; + if (rofSlot.Sub >= SUB_BEGIN) // Bag Slots + TempSlot = ((TempSlot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rofSlot.Sub + 1; ServerSlot = TempSlot; } - else if (rofSlot.SlotType == maps::MapBank) { - TempSlot = EmuConstants::BANK_BEGIN; + else if (rofSlot.Type == inventory::TypeBank) { + TempSlot = EQEmu::Constants::BANK_BEGIN; - if (rofSlot.SubSlot >= SUB_BEGIN) - TempSlot += ((rofSlot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rofSlot.SubSlot + 1; + if (rofSlot.Sub >= SUB_BEGIN) + TempSlot += ((rofSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rofSlot.Sub + 1; else - TempSlot += rofSlot.MainSlot; + TempSlot += rofSlot.Slot; ServerSlot = TempSlot; } - else if (rofSlot.SlotType == maps::MapSharedBank) { - TempSlot = EmuConstants::SHARED_BANK_BEGIN; + else if (rofSlot.Type == inventory::TypeSharedBank) { + TempSlot = EQEmu::Constants::SHARED_BANK_BEGIN; - if (rofSlot.SubSlot >= SUB_BEGIN) - TempSlot += ((rofSlot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rofSlot.SubSlot + 1; + if (rofSlot.Sub >= SUB_BEGIN) + TempSlot += ((rofSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rofSlot.Sub + 1; else - TempSlot += rofSlot.MainSlot; + TempSlot += rofSlot.Slot; ServerSlot = TempSlot; } - else if (rofSlot.SlotType == maps::MapTrade) { - TempSlot = EmuConstants::TRADE_BEGIN; + else if (rofSlot.Type == inventory::TypeTrade) { + TempSlot = EQEmu::Constants::TRADE_BEGIN; - if (rofSlot.SubSlot >= SUB_BEGIN) - TempSlot += ((rofSlot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rofSlot.SubSlot + 1; + if (rofSlot.Sub >= SUB_BEGIN) + TempSlot += ((rofSlot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rofSlot.Sub + 1; // OLD CODE: - //TempSlot += 100 + (RoFSlot.MainSlot * EmuConstants::ITEM_CONTAINER_SIZE) + RoFSlot.SubSlot; + //TempSlot += 100 + (RoFSlot.MainSlot * EQEmu::Constants::ITEM_CONTAINER_SIZE) + RoFSlot.SubSlot; else - TempSlot += rofSlot.MainSlot; + TempSlot += rofSlot.Slot; ServerSlot = TempSlot; } - else if (rofSlot.SlotType == maps::MapWorld) { - TempSlot = EmuConstants::WORLD_BEGIN; + else if (rofSlot.Type == inventory::TypeWorld) { + TempSlot = EQEmu::Constants::WORLD_BEGIN; - if (rofSlot.MainSlot >= SUB_BEGIN) - TempSlot += rofSlot.MainSlot; + if (rofSlot.Slot >= SUB_BEGIN) + TempSlot += rofSlot.Slot; ServerSlot = TempSlot; } @@ -5973,26 +5973,26 @@ namespace RoF ServerSlot = TempSlot; }*/ - else if (rofSlot.SlotType == maps::MapGuildTribute) { + else if (rofSlot.Type == inventory::TypeGuildTribute) { ServerSlot = INVALID_INDEX; } - Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rofSlot.SlotType, rofSlot.Unknown02, rofSlot.MainSlot, rofSlot.SubSlot, rofSlot.AugSlot, rofSlot.Unknown01, ServerSlot); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rofSlot.Type, rofSlot.Unknown02, rofSlot.Slot, rofSlot.Sub, rofSlot.Aug, rofSlot.Unknown01, ServerSlot); return ServerSlot; } - static inline uint32 RoFToServerMainInvSlot(structs::MainInvItemSlotStruct rofSlot) + static inline uint32 RoFToServerTypelessSlot(structs::TypelessInventorySlot_Struct rofSlot) { uint32 ServerSlot = INVALID_INDEX; uint32 TempSlot = 0; - if (rofSlot.MainSlot < 57) { // Worn/Personal Inventory and Cursor (< 33) - if (rofSlot.MainSlot == slots::MainPowerSource) - TempSlot = MainPowerSource; + if (rofSlot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 33) + if (rofSlot.Slot == inventory::SlotPowerSource) + TempSlot = SlotPowerSource; - else if (rofSlot.MainSlot >= slots::MainCursor) // Cursor and Extended Corpse Inventory - TempSlot = rofSlot.MainSlot - 3; + else if (rofSlot.Slot >= inventory::SlotCursor) // Cursor and Extended Corpse Inventory + TempSlot = rofSlot.Slot - 3; /*else if (RoFSlot.MainSlot == slots::MainGeneral9 || RoFSlot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF inventory slots // Need to figure out what to do when we get these @@ -6000,19 +6000,19 @@ namespace RoF // Same as above }*/ - else if (rofSlot.MainSlot >= slots::MainAmmo) // Main Inventory and Ammo Slots - TempSlot = rofSlot.MainSlot - 1; + else if (rofSlot.Slot >= inventory::SlotAmmo) // Main Inventory and Ammo Slots + TempSlot = rofSlot.Slot - 1; else - TempSlot = rofSlot.MainSlot; + TempSlot = rofSlot.Slot; - if (rofSlot.SubSlot >= SUB_BEGIN) // Bag Slots - TempSlot = ((TempSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rofSlot.SubSlot + 1; + if (rofSlot.Sub >= SUB_BEGIN) // Bag Slots + TempSlot = ((TempSlot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rofSlot.Sub + 1; ServerSlot = TempSlot; } - Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rofSlot.MainSlot, rofSlot.SubSlot, rofSlot.AugSlot, rofSlot.Unknown01, ServerSlot); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rofSlot.Slot, rofSlot.Sub, rofSlot.Aug, rofSlot.Unknown01, ServerSlot); return ServerSlot; } @@ -6024,7 +6024,7 @@ namespace RoF static inline void ServerToRoFTextLink(std::string& rofTextLink, const std::string& serverTextLink) { - if ((consts::TEXT_LINK_BODY_LENGTH == EmuConstants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) { + if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::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() <= EmuConstants::TEXT_LINK_BODY_LENGTH) { + if (segments[segment_iter].length() <= EQEmu::Constants::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 ((EmuConstants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (rofTextLink.find('\x12') == std::string::npos)) { + if ((EQEmu::Constants::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 1724b8167..776554cd3 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -27,13 +27,13 @@ namespace RoF2 char* SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth, ItemPacketType packet_type); // server to client inventory location converters - static inline structs::ItemSlotStruct ServerToRoF2Slot(uint32 serverSlot, ItemPacketType PacketType = ItemPacketInvalid); - static inline structs::MainInvItemSlotStruct ServerToRoF2MainInvSlot(uint32 serverSlot); + static inline structs::InventorySlot_Struct ServerToRoF2Slot(uint32 serverSlot, ItemPacketType PacketType = ItemPacketInvalid); + static inline structs::TypelessInventorySlot_Struct ServerToRoF2TypelessSlot(uint32 serverSlot); static inline uint32 ServerToRoF2CorpseSlot(uint32 serverCorpseSlot); // client to server inventory location converters - static inline uint32 RoF2ToServerSlot(structs::ItemSlotStruct rof2Slot, ItemPacketType PacketType = ItemPacketInvalid); - static inline uint32 RoF2ToServerMainInvSlot(structs::MainInvItemSlotStruct rof2Slot); + static inline uint32 RoF2ToServerSlot(structs::InventorySlot_Struct rof2Slot, ItemPacketType PacketType = ItemPacketInvalid); + static inline uint32 RoF2ToServerTypelessSlot(structs::TypelessInventorySlot_Struct rof2Slot); static inline uint32 RoF2ToServerCorpseSlot(uint32 rof2CorpseSlot); // server to client text link converter @@ -228,7 +228,7 @@ namespace RoF2 eq->unknown000 = 1; OUT(npcid); - eq->slot = ServerToRoF2MainInvSlot(emu->slot); + eq->inventory_slot = ServerToRoF2TypelessSlot(emu->slot); OUT(charges); OUT(sell_price); @@ -280,7 +280,7 @@ namespace RoF2 SETUP_DIRECT_ENCODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct); OUT(merchant_entity_id); - eq->slot_id = ServerToRoF2MainInvSlot(emu->slot_id); + eq->inventory_slot = ServerToRoF2TypelessSlot(emu->slot_id); OUT(charges); OUT(cost); @@ -304,7 +304,7 @@ namespace RoF2 ENCODE_LENGTH_EXACT(ApplyPoison_Struct); SETUP_DIRECT_ENCODE(ApplyPoison_Struct, structs::ApplyPoison_Struct); - eq->inventorySlot = ServerToRoF2MainInvSlot(emu->inventorySlot); + eq->inventorySlot = ServerToRoF2TypelessSlot(emu->inventorySlot); OUT(success); FINISH_ENCODE(); @@ -552,7 +552,7 @@ namespace RoF2 OUT(slot); OUT(spell_id); - eq->inventoryslot = ServerToRoF2Slot(emu->inventoryslot); + eq->inventory_slot = ServerToRoF2Slot(emu->inventoryslot); //OUT(inventoryslot); OUT(target_id); @@ -1607,7 +1607,7 @@ namespace RoF2 ENCODE_LENGTH_EXACT(ItemVerifyReply_Struct); SETUP_DIRECT_ENCODE(ItemVerifyReply_Struct, structs::ItemVerifyReply_Struct); - eq->slot = ServerToRoF2Slot(emu->slot); + eq->inventory_slot = ServerToRoF2Slot(emu->slot); OUT(spell); OUT(target); @@ -2421,7 +2421,7 @@ namespace RoF2 outapp->WriteUInt32(consts::BANDOLIERS_SIZE); // Copy bandoliers where server and client indexes converge - for (uint32 r = 0; r < EmuConstants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) { + for (uint32 r = 0; r < EQEmu::Constants::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 = EmuConstants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { + for (uint32 r = EQEmu::Constants::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 < EmuConstants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (uint32 r = 0; r < EQEmu::Constants::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 = EmuConstants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (uint32 r = EQEmu::Constants::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(EmuConstants::TRIBUTE_SIZE); + outapp->WriteUInt32(EQEmu::Constants::TRIBUTE_SIZE); - for (uint32 r = 0; r < EmuConstants::TRIBUTE_SIZE; r++) + for (uint32 r = 0; r < EQEmu::Constants::TRIBUTE_SIZE; r++) { outapp->WriteUInt32(emu->tributes[r].tribute); outapp->WriteUInt32(emu->tributes[r].tier); @@ -2910,12 +2910,12 @@ namespace RoF2 OUT(object_type); OUT(some_id); eq->container_slot = ServerToRoF2Slot(emu->unknown1); - structs::ItemSlotStruct RoF2Slot; - RoF2Slot.SlotType = 8; // Observed + structs::InventorySlot_Struct RoF2Slot; + RoF2Slot.Type = 8; // Observed RoF2Slot.Unknown02 = 0; - RoF2Slot.MainSlot = 0xffff; - RoF2Slot.SubSlot = 0xffff; - RoF2Slot.AugSlot = 0xffff; + RoF2Slot.Slot = 0xffff; + RoF2Slot.Sub = 0xffff; + RoF2Slot.Aug = 0xffff; RoF2Slot.Unknown01 = 0; eq->unknown_slot = RoF2Slot; OUT(recipe_id); @@ -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 < 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; @@ -3225,7 +3225,7 @@ namespace RoF2 SETUP_DIRECT_ENCODE(Merchant_Purchase_Struct, structs::Merchant_Purchase_Struct); OUT(npcid); - eq->itemslot = ServerToRoF2MainInvSlot(emu->itemslot); + eq->inventory_slot = ServerToRoF2TypelessSlot(emu->itemslot); //OUT(itemslot); OUT(quantity); OUT(price); @@ -3825,7 +3825,7 @@ namespace RoF2 ENCODE_LENGTH_EXACT(TributeItem_Struct); SETUP_DIRECT_ENCODE(TributeItem_Struct, structs::TributeItem_Struct); - eq->slot = ServerToRoF2Slot(emu->slot); + eq->inventory_slot = ServerToRoF2Slot(emu->slot); OUT(quantity); OUT(tribute_master_id); OUT(tribute_points); @@ -4384,7 +4384,7 @@ namespace RoF2 SETUP_DIRECT_DECODE(Adventure_Sell_Struct, structs::Adventure_Sell_Struct); IN(npcid); - emu->slot = RoF2ToServerMainInvSlot(eq->slot); + emu->slot = RoF2ToServerTypelessSlot(eq->inventory_slot); IN(charges); IN(sell_price); @@ -4397,7 +4397,7 @@ namespace RoF2 SETUP_DIRECT_DECODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct); IN(merchant_entity_id); - emu->slot_id = RoF2ToServerMainInvSlot(eq->slot_id); + emu->slot_id = RoF2ToServerTypelessSlot(eq->inventory_slot); IN(charges); IN(cost); @@ -4410,7 +4410,7 @@ namespace RoF2 SETUP_DIRECT_DECODE(AltCurrencySelectItem_Struct, structs::AltCurrencySelectItem_Struct); IN(merchant_entity_id); - emu->slot_id = RoF2ToServerMainInvSlot(eq->slot_id); + emu->slot_id = RoF2ToServerTypelessSlot(eq->inventory_slot); FINISH_DIRECT_DECODE(); } @@ -4432,7 +4432,7 @@ namespace RoF2 DECODE_LENGTH_EXACT(structs::ApplyPoison_Struct); SETUP_DIRECT_DECODE(ApplyPoison_Struct, structs::ApplyPoison_Struct); - emu->inventorySlot = RoF2ToServerMainInvSlot(eq->inventorySlot); + emu->inventorySlot = RoF2ToServerTypelessSlot(eq->inventorySlot); IN(success); FINISH_DIRECT_DECODE(); @@ -4540,7 +4540,7 @@ namespace RoF2 IN(slot); IN(spell_id); - emu->inventoryslot = RoF2ToServerSlot(eq->inventoryslot); + emu->inventoryslot = RoF2ToServerSlot(eq->inventory_slot); //IN(inventoryslot); IN(target_id); IN(y_pos); @@ -4667,7 +4667,7 @@ namespace RoF2 DECODE_LENGTH_EXACT(structs::Consume_Struct); SETUP_DIRECT_DECODE(Consume_Struct, structs::Consume_Struct); - emu->slot = RoF2ToServerSlot(eq->slot); + emu->slot = RoF2ToServerSlot(eq->inventory_slot); IN(auto_consumed); IN(type); @@ -5028,7 +5028,7 @@ namespace RoF2 IN(item_id); int r; - for (r = 0; r < EmuConstants::ITEM_COMMON_SIZE; r++) { + for (r = 0; r < EQEmu::Constants::ITEM_COMMON_SIZE; r++) { IN(augments[r]); } IN(link_hash); @@ -5042,7 +5042,7 @@ namespace RoF2 DECODE_LENGTH_EXACT(structs::ItemVerifyRequest_Struct); SETUP_DIRECT_DECODE(ItemVerifyRequest_Struct, structs::ItemVerifyRequest_Struct); - emu->slot = RoF2ToServerSlot(eq->slot); + emu->slot = RoF2ToServerSlot(eq->inventory_slot); IN(target); FINISH_DIRECT_DECODE(); @@ -5082,7 +5082,7 @@ namespace RoF2 DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - Log.Out(Logs::General, Logs::Netcode, "[RoF2] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); + Log.Out(Logs::General, Logs::Netcode, "[RoF2] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.Type, eq->to_slot.Type, eq->from_slot.Slot, eq->to_slot.Slot, eq->from_slot.Sub, eq->to_slot.Sub, eq->from_slot.Aug, eq->to_slot.Aug, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); emu->from_slot = RoF2ToServerSlot(eq->from_slot); emu->to_slot = RoF2ToServerSlot(eq->to_slot); IN(number_in_stack); @@ -5231,7 +5231,7 @@ namespace RoF2 SETUP_DIRECT_DECODE(Merchant_Purchase_Struct, structs::Merchant_Purchase_Struct); IN(npcid); - emu->itemslot = RoF2ToServerMainInvSlot(eq->itemslot); + emu->itemslot = RoF2ToServerTypelessSlot(eq->inventory_slot); //IN(itemslot); IN(quantity); IN(price); @@ -5385,7 +5385,7 @@ namespace RoF2 DECODE_LENGTH_EXACT(structs::TributeItem_Struct); SETUP_DIRECT_DECODE(TributeItem_Struct, structs::TributeItem_Struct); - emu->slot = RoF2ToServerSlot(eq->slot); + emu->slot = RoF2ToServerSlot(eq->inventory_slot); IN(quantity); IN(tribute_master_id); IN(tribute_points); @@ -5485,12 +5485,12 @@ namespace RoF2 hdr.stacksize = stackable ? charges : 1; hdr.unknown004 = 0; - structs::ItemSlotStruct slot_id = ServerToRoF2Slot(slot_id_in, packet_type); + structs::InventorySlot_Struct slot_id = ServerToRoF2Slot(slot_id_in, packet_type); - hdr.slot_type = (merchant_slot == 0) ? slot_id.SlotType : 9; // 9 is merchant 20 is reclaim items? - hdr.main_slot = (merchant_slot == 0) ? slot_id.MainSlot : merchant_slot; - hdr.sub_slot = (merchant_slot == 0) ? slot_id.SubSlot : 0xffff; - hdr.aug_slot = (merchant_slot == 0) ? slot_id.AugSlot : 0xffff; + hdr.slot_type = (merchant_slot == 0) ? slot_id.Type : 9; // 9 is merchant 20 is reclaim items? + hdr.main_slot = (merchant_slot == 0) ? slot_id.Slot : merchant_slot; + hdr.sub_slot = (merchant_slot == 0) ? slot_id.Sub : 0xffff; + hdr.aug_slot = (merchant_slot == 0) ? slot_id.Aug : 0xffff; hdr.price = inst->GetPrice(); hdr.merchant_slot = (merchant_slot == 0) ? 1 : inst->GetMerchantCount(); hdr.scaled_value = inst->IsScaling() ? inst->GetExp() / 100 : 0; @@ -5961,7 +5961,7 @@ namespace RoF2 uint32 SubLengths[10]; - for (int x = SUB_BEGIN; x < EmuConstants::ITEM_CONTAINER_SIZE; ++x) { + for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) { SubSerializations[x] = nullptr; @@ -5973,15 +5973,15 @@ namespace RoF2 iqbs.subitem_count++; - if (slot_id_in >= EmuConstants::GENERAL_BEGIN && slot_id_in <= EmuConstants::GENERAL_END) // (< 30) - no cursor? + if (slot_id_in >= EQEmu::Constants::GENERAL_BEGIN && slot_id_in <= EQEmu::Constants::GENERAL_END) // (< 30) - no cursor? //SubSlotNumber = (((slot_id_in + 3) * 10) + x + 1); - SubSlotNumber = (((slot_id_in + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + x + 1); - else if (slot_id_in >= EmuConstants::BANK_BEGIN && slot_id_in <= EmuConstants::BANK_END) + 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 - 2000) * 10) + 2030 + x + 1); - SubSlotNumber = (((slot_id_in - EmuConstants::BANK_BEGIN) * EmuConstants::ITEM_CONTAINER_SIZE) + EmuConstants::BANK_BAGS_BEGIN + x); - else if (slot_id_in >= EmuConstants::SHARED_BANK_BEGIN && slot_id_in <= EmuConstants::SHARED_BANK_END) + 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 - 2500) * 10) + 2530 + x + 1); - SubSlotNumber = (((slot_id_in - EmuConstants::SHARED_BANK_BEGIN) * EmuConstants::ITEM_CONTAINER_SIZE) + EmuConstants::SHARED_BANK_BAGS_BEGIN + x); + SubSlotNumber = (((slot_id_in - EQEmu::Constants::SHARED_BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::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_BEGIN; x < EmuConstants::ITEM_CONTAINER_SIZE; ++x) { + for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) { if (SubSerializations[x]) { @@ -6016,38 +6016,38 @@ namespace RoF2 return item_serial; } - static inline structs::ItemSlotStruct ServerToRoF2Slot(uint32 serverSlot, ItemPacketType PacketType) + static inline structs::InventorySlot_Struct ServerToRoF2Slot(uint32 serverSlot, ItemPacketType PacketType) { - structs::ItemSlotStruct RoF2Slot; - RoF2Slot.SlotType = INVALID_INDEX; + structs::InventorySlot_Struct RoF2Slot; + RoF2Slot.Type = INVALID_INDEX; RoF2Slot.Unknown02 = NOT_USED; - RoF2Slot.MainSlot = INVALID_INDEX; - RoF2Slot.SubSlot = INVALID_INDEX; - RoF2Slot.AugSlot = INVALID_INDEX; + RoF2Slot.Slot = INVALID_INDEX; + RoF2Slot.Sub = INVALID_INDEX; + RoF2Slot.Aug = INVALID_INDEX; RoF2Slot.Unknown01 = NOT_USED; uint32 TempSlot = 0; - if (serverSlot < 56 || serverSlot == MainPowerSource) { // Main Inventory and Cursor + if (serverSlot < 56 || serverSlot == SlotPowerSource) { // Main Inventory and Cursor if (PacketType == ItemPacketLoot) { - RoF2Slot.SlotType = maps::MapCorpse; - RoF2Slot.MainSlot = serverSlot - EmuConstants::CORPSE_BEGIN; + RoF2Slot.Type = inventory::TypeCorpse; + RoF2Slot.Slot = serverSlot - EQEmu::Constants::CORPSE_BEGIN; } else { - RoF2Slot.SlotType = maps::MapPossessions; - RoF2Slot.MainSlot = serverSlot; + RoF2Slot.Type = inventory::TypePossessions; + RoF2Slot.Slot = serverSlot; } - if (serverSlot == MainPowerSource) - RoF2Slot.MainSlot = slots::MainPowerSource; + if (serverSlot == SlotPowerSource) + RoF2Slot.Slot = inventory::SlotPowerSource; - else if (serverSlot >= MainCursor && PacketType != ItemPacketLoot) // Cursor and Extended Corpse Inventory - RoF2Slot.MainSlot += 3; + else if (serverSlot >= SlotCursor && PacketType != ItemPacketLoot) // Cursor and Extended Corpse Inventory + RoF2Slot.Slot += 3; - else if (serverSlot >= MainAmmo) // (> 20) - RoF2Slot.MainSlot += 1; + else if (serverSlot >= SlotAmmo) // (> 20) + RoF2Slot.Slot += 1; } /*else if (ServerSlot < 51) { // Cursor Buffer @@ -6055,51 +6055,51 @@ namespace RoF2 RoF2Slot.MainSlot = ServerSlot - 31; }*/ - else if (serverSlot >= EmuConstants::GENERAL_BAGS_BEGIN && serverSlot <= EmuConstants::CURSOR_BAG_END) { // (> 250 && < 341) - RoF2Slot.SlotType = maps::MapPossessions; + else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END) { // (> 250 && < 341) + RoF2Slot.Type = inventory::TypePossessions; TempSlot = serverSlot - 1; - RoF2Slot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 2; - RoF2Slot.SubSlot = TempSlot - ((RoF2Slot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE); + RoF2Slot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 2; + RoF2Slot.Sub = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::Constants::ITEM_CONTAINER_SIZE); - if (RoF2Slot.MainSlot >= slots::MainGeneral9) // (> 30) - RoF2Slot.MainSlot = slots::MainCursor; + if (RoF2Slot.Slot >= inventory::SlotGeneral9) // (> 30) + RoF2Slot.Slot = inventory::SlotCursor; } - else if (serverSlot >= EmuConstants::TRIBUTE_BEGIN && serverSlot <= EmuConstants::TRIBUTE_END) { // Tribute - RoF2Slot.SlotType = maps::MapTribute; - RoF2Slot.MainSlot = serverSlot - EmuConstants::TRIBUTE_BEGIN; + else if (serverSlot >= EQEmu::Constants::TRIBUTE_BEGIN && serverSlot <= EQEmu::Constants::TRIBUTE_END) { // Tribute + RoF2Slot.Type = inventory::TypeTribute; + RoF2Slot.Slot = serverSlot - EQEmu::Constants::TRIBUTE_BEGIN; } - else if (serverSlot >= EmuConstants::BANK_BEGIN && serverSlot <= EmuConstants::BANK_BAGS_END) { - RoF2Slot.SlotType = maps::MapBank; - TempSlot = serverSlot - EmuConstants::BANK_BEGIN; - RoF2Slot.MainSlot = TempSlot; + else if (serverSlot >= EQEmu::Constants::BANK_BEGIN && serverSlot <= EQEmu::Constants::BANK_BAGS_END) { + RoF2Slot.Type = inventory::TypeBank; + TempSlot = serverSlot - EQEmu::Constants::BANK_BEGIN; + RoF2Slot.Slot = TempSlot; if (TempSlot > 30) { // (> 30) - RoF2Slot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 3; - RoF2Slot.SubSlot = TempSlot - ((RoF2Slot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE); + RoF2Slot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3; + RoF2Slot.Sub = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE); } } - else if (serverSlot >= EmuConstants::SHARED_BANK_BEGIN && serverSlot <= EmuConstants::SHARED_BANK_BAGS_END) { - RoF2Slot.SlotType = maps::MapSharedBank; - TempSlot = serverSlot - EmuConstants::SHARED_BANK_BEGIN; - RoF2Slot.MainSlot = TempSlot; + else if (serverSlot >= EQEmu::Constants::SHARED_BANK_BEGIN && serverSlot <= EQEmu::Constants::SHARED_BANK_BAGS_END) { + RoF2Slot.Type = inventory::TypeSharedBank; + TempSlot = serverSlot - EQEmu::Constants::SHARED_BANK_BEGIN; + RoF2Slot.Slot = TempSlot; if (TempSlot > 30) { // (> 30) - RoF2Slot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 3; - RoF2Slot.SubSlot = TempSlot - ((RoF2Slot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE); + RoF2Slot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3; + RoF2Slot.Sub = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE); } } - else if (serverSlot >= EmuConstants::TRADE_BEGIN && serverSlot <= EmuConstants::TRADE_BAGS_END) { - RoF2Slot.SlotType = maps::MapTrade; - TempSlot = serverSlot - EmuConstants::TRADE_BEGIN; - RoF2Slot.MainSlot = TempSlot; + else if (serverSlot >= EQEmu::Constants::TRADE_BEGIN && serverSlot <= EQEmu::Constants::TRADE_BAGS_END) { + RoF2Slot.Type = inventory::TypeTrade; + TempSlot = serverSlot - EQEmu::Constants::TRADE_BEGIN; + RoF2Slot.Slot = TempSlot; if (TempSlot > 30) { - RoF2Slot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 3; - RoF2Slot.SubSlot = TempSlot - ((RoF2Slot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE); + RoF2Slot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 3; + RoF2Slot.Sub = TempSlot - ((RoF2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE); } /* @@ -6116,38 +6116,38 @@ namespace RoF2 */ } - else if (serverSlot >= EmuConstants::WORLD_BEGIN && serverSlot <= EmuConstants::WORLD_END) { - RoF2Slot.SlotType = maps::MapWorld; - TempSlot = serverSlot - EmuConstants::WORLD_BEGIN; - RoF2Slot.MainSlot = TempSlot; + else if (serverSlot >= EQEmu::Constants::WORLD_BEGIN && serverSlot <= EQEmu::Constants::WORLD_END) { + RoF2Slot.Type = inventory::TypeWorld; + TempSlot = serverSlot - EQEmu::Constants::WORLD_BEGIN; + RoF2Slot.Slot = TempSlot; } - Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoF2Slot.Type, RoF2Slot.Unknown02, RoF2Slot.Slot, RoF2Slot.Sub, RoF2Slot.Aug, RoF2Slot.Unknown01); return RoF2Slot; } - static inline structs::MainInvItemSlotStruct ServerToRoF2MainInvSlot(uint32 serverSlot) + static inline structs::TypelessInventorySlot_Struct ServerToRoF2TypelessSlot(uint32 serverSlot) { - structs::MainInvItemSlotStruct RoF2Slot; - RoF2Slot.MainSlot = INVALID_INDEX; - RoF2Slot.SubSlot = INVALID_INDEX; - RoF2Slot.AugSlot = INVALID_INDEX; + structs::TypelessInventorySlot_Struct RoF2Slot; + RoF2Slot.Slot = INVALID_INDEX; + RoF2Slot.Sub = INVALID_INDEX; + RoF2Slot.Aug = INVALID_INDEX; RoF2Slot.Unknown01 = NOT_USED; uint32 TempSlot = 0; - if (serverSlot < 56 || serverSlot == MainPowerSource) { // (< 52) - RoF2Slot.MainSlot = serverSlot; + if (serverSlot < 56 || serverSlot == SlotPowerSource) { // (< 52) + RoF2Slot.Slot = serverSlot; - if (serverSlot == MainPowerSource) - RoF2Slot.MainSlot = slots::MainPowerSource; + if (serverSlot == SlotPowerSource) + RoF2Slot.Slot = inventory::SlotPowerSource; - else if (serverSlot >= MainCursor) // Cursor and Extended Corpse Inventory - RoF2Slot.MainSlot += 3; + else if (serverSlot >= SlotCursor) // Cursor and Extended Corpse Inventory + RoF2Slot.Slot += 3; - else if (serverSlot >= MainAmmo) // Ammo and Personl Inventory - RoF2Slot.MainSlot += 1; + else if (serverSlot >= SlotAmmo) // Ammo and Personl Inventory + RoF2Slot.Slot += 1; /*else if (ServerSlot >= MainCursor) { // Cursor RoF2Slot.MainSlot = slots::MainCursor; @@ -6157,33 +6157,33 @@ namespace RoF2 }*/ } - else if (serverSlot >= EmuConstants::GENERAL_BAGS_BEGIN && serverSlot <= EmuConstants::CURSOR_BAG_END) { + else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END) { TempSlot = serverSlot - 1; - RoF2Slot.MainSlot = int(TempSlot / EmuConstants::ITEM_CONTAINER_SIZE) - 2; - RoF2Slot.SubSlot = TempSlot - ((RoF2Slot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE); + RoF2Slot.Slot = int(TempSlot / EQEmu::Constants::ITEM_CONTAINER_SIZE) - 2; + RoF2Slot.Sub = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::Constants::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.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); + 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.Sub, RoF2Slot.Aug, RoF2Slot.Unknown01); return RoF2Slot; } static inline uint32 ServerToRoF2CorpseSlot(uint32 serverCorpseSlot) { - return (serverCorpseSlot - EmuConstants::CORPSE_BEGIN + 1); + return (serverCorpseSlot - EQEmu::Constants::CORPSE_BEGIN + 1); } - static inline uint32 RoF2ToServerSlot(structs::ItemSlotStruct rof2Slot, ItemPacketType PacketType) + static inline uint32 RoF2ToServerSlot(structs::InventorySlot_Struct rof2Slot, ItemPacketType PacketType) { uint32 ServerSlot = INVALID_INDEX; uint32 TempSlot = 0; - if (rof2Slot.SlotType == maps::MapPossessions && rof2Slot.MainSlot < 57) { // Worn/Personal Inventory and Cursor (< 51) - if (rof2Slot.MainSlot == slots::MainPowerSource) - TempSlot = MainPowerSource; + if (rof2Slot.Type == inventory::TypePossessions && rof2Slot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 51) + if (rof2Slot.Slot == inventory::SlotPowerSource) + TempSlot = SlotPowerSource; - else if (rof2Slot.MainSlot >= slots::MainCursor) // Cursor and Extended Corpse Inventory - TempSlot = rof2Slot.MainSlot - 3; + else if (rof2Slot.Slot >= inventory::SlotCursor) // Cursor and Extended Corpse Inventory + TempSlot = rof2Slot.Slot - 3; /*else if (RoF2Slot.MainSlot == slots::MainGeneral9 || RoF2Slot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF2 inventory/corpse slots // Need to figure out what to do when we get these @@ -6196,61 +6196,61 @@ namespace RoF2 // For now, it's probably best to leave as-is and let this work itself out in the inventory rework. }*/ - else if (rof2Slot.MainSlot >= slots::MainAmmo) // Ammo and Main Inventory - TempSlot = rof2Slot.MainSlot - 1; + else if (rof2Slot.Slot >= inventory::SlotAmmo) // Ammo and Main Inventory + TempSlot = rof2Slot.Slot - 1; else // Worn Slots - TempSlot = rof2Slot.MainSlot; + TempSlot = rof2Slot.Slot; - if (rof2Slot.SubSlot >= SUB_BEGIN) // Bag Slots - TempSlot = ((TempSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rof2Slot.SubSlot + 1; + if (rof2Slot.Sub >= SUB_BEGIN) // Bag Slots + TempSlot = ((TempSlot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rof2Slot.Sub + 1; ServerSlot = TempSlot; } - else if (rof2Slot.SlotType == maps::MapBank) { - TempSlot = EmuConstants::BANK_BEGIN; + else if (rof2Slot.Type == inventory::TypeBank) { + TempSlot = EQEmu::Constants::BANK_BEGIN; - if (rof2Slot.SubSlot >= SUB_BEGIN) - TempSlot += ((rof2Slot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rof2Slot.SubSlot + 1; + if (rof2Slot.Sub >= SUB_BEGIN) + TempSlot += ((rof2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rof2Slot.Sub + 1; else - TempSlot += rof2Slot.MainSlot; + TempSlot += rof2Slot.Slot; ServerSlot = TempSlot; } - else if (rof2Slot.SlotType == maps::MapSharedBank) { - TempSlot = EmuConstants::SHARED_BANK_BEGIN; + else if (rof2Slot.Type == inventory::TypeSharedBank) { + TempSlot = EQEmu::Constants::SHARED_BANK_BEGIN; - if (rof2Slot.SubSlot >= SUB_BEGIN) - TempSlot += ((rof2Slot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rof2Slot.SubSlot + 1; + if (rof2Slot.Sub >= SUB_BEGIN) + TempSlot += ((rof2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rof2Slot.Sub + 1; else - TempSlot += rof2Slot.MainSlot; + TempSlot += rof2Slot.Slot; ServerSlot = TempSlot; } - else if (rof2Slot.SlotType == maps::MapTrade) { - TempSlot = EmuConstants::TRADE_BEGIN; + else if (rof2Slot.Type == inventory::TypeTrade) { + TempSlot = EQEmu::Constants::TRADE_BEGIN; - if (rof2Slot.SubSlot >= SUB_BEGIN) - TempSlot += ((rof2Slot.MainSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rof2Slot.SubSlot + 1; + if (rof2Slot.Sub >= SUB_BEGIN) + TempSlot += ((rof2Slot.Slot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rof2Slot.Sub + 1; // OLD CODE: //TempSlot += 100 + (RoF2Slot.MainSlot * EmuConstants::ITEM_CONTAINER_SIZE) + RoF2Slot.SubSlot; else - TempSlot += rof2Slot.MainSlot; + TempSlot += rof2Slot.Slot; ServerSlot = TempSlot; } - else if (rof2Slot.SlotType == maps::MapWorld) { - TempSlot = EmuConstants::WORLD_BEGIN; + else if (rof2Slot.Type == inventory::TypeWorld) { + TempSlot = EQEmu::Constants::WORLD_BEGIN; - if (rof2Slot.MainSlot >= SUB_BEGIN) - TempSlot += rof2Slot.MainSlot; + if (rof2Slot.Slot >= SUB_BEGIN) + TempSlot += rof2Slot.Slot; ServerSlot = TempSlot; } @@ -6264,30 +6264,30 @@ namespace RoF2 ServerSlot = TempSlot; }*/ - else if (rof2Slot.SlotType == maps::MapGuildTribute) { + else if (rof2Slot.Type == inventory::TypeGuildTribute) { ServerSlot = INVALID_INDEX; } - else if (rof2Slot.SlotType == maps::MapCorpse) { - ServerSlot = rof2Slot.MainSlot + EmuConstants::CORPSE_BEGIN; + else if (rof2Slot.Type == inventory::TypeCorpse) { + ServerSlot = rof2Slot.Slot + EQEmu::Constants::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.SlotType, rof2Slot.Unknown02, rof2Slot.MainSlot, rof2Slot.SubSlot, rof2Slot.AugSlot, rof2Slot.Unknown01, ServerSlot); + 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.Sub, rof2Slot.Aug, rof2Slot.Unknown01, ServerSlot); return ServerSlot; } - static inline uint32 RoF2ToServerMainInvSlot(structs::MainInvItemSlotStruct rof2Slot) + static inline uint32 RoF2ToServerTypelessSlot(structs::TypelessInventorySlot_Struct rof2Slot) { uint32 ServerSlot = INVALID_INDEX; uint32 TempSlot = 0; - if (rof2Slot.MainSlot < 57) { // Worn/Personal Inventory and Cursor (< 33) - if (rof2Slot.MainSlot == slots::MainPowerSource) - TempSlot = MainPowerSource; + if (rof2Slot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 33) + if (rof2Slot.Slot == inventory::SlotPowerSource) + TempSlot = SlotPowerSource; - else if (rof2Slot.MainSlot >= slots::MainCursor) // Cursor and Extended Corpse Inventory - TempSlot = rof2Slot.MainSlot - 3; + else if (rof2Slot.Slot >= inventory::SlotCursor) // Cursor and Extended Corpse Inventory + TempSlot = rof2Slot.Slot - 3; /*else if (RoF2Slot.MainSlot == slots::MainGeneral9 || RoF2Slot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF2 inventory slots // Need to figure out what to do when we get these @@ -6295,31 +6295,31 @@ namespace RoF2 // Same as above }*/ - else if (rof2Slot.MainSlot >= slots::MainAmmo) // Main Inventory and Ammo Slots - TempSlot = rof2Slot.MainSlot - 1; + else if (rof2Slot.Slot >= inventory::SlotAmmo) // Main Inventory and Ammo Slots + TempSlot = rof2Slot.Slot - 1; else - TempSlot = rof2Slot.MainSlot; + TempSlot = rof2Slot.Slot; - if (rof2Slot.SubSlot >= SUB_BEGIN) // Bag Slots - TempSlot = ((TempSlot + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + rof2Slot.SubSlot + 1; + if (rof2Slot.Sub >= SUB_BEGIN) // Bag Slots + TempSlot = ((TempSlot + 3) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + rof2Slot.Sub + 1; ServerSlot = TempSlot; } - Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rof2Slot.MainSlot, rof2Slot.SubSlot, rof2Slot.AugSlot, rof2Slot.Unknown01, ServerSlot); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rof2Slot.Slot, rof2Slot.Sub, rof2Slot.Aug, rof2Slot.Unknown01, ServerSlot); return ServerSlot; } static inline uint32 RoF2ToServerCorpseSlot(uint32 rof2CorpseSlot) { - return (rof2CorpseSlot + EmuConstants::CORPSE_BEGIN - 1); + return (rof2CorpseSlot + EQEmu::Constants::CORPSE_BEGIN - 1); } static inline void ServerToRoF2TextLink(std::string& rof2TextLink, const std::string& serverTextLink) { - if ((consts::TEXT_LINK_BODY_LENGTH == EmuConstants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) { + if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::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() <= EmuConstants::TEXT_LINK_BODY_LENGTH) { + if (segments[segment_iter].length() <= EQEmu::Constants::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 ((EmuConstants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (rof2TextLink.find('\x12') == std::string::npos)) { + if ((EQEmu::Constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (rof2TextLink.find('\x12') == std::string::npos)) { serverTextLink = rof2TextLink; return; } diff --git a/common/patches/rof2_constants.h b/common/patches/rof2_constants.h index 0732044ca..e2886406b 100644 --- a/common/patches/rof2_constants.h +++ b/common/patches/rof2_constants.h @@ -1,7 +1,7 @@ /* EQEMu: Everquest Server Emulator -Copyright (C) 2001-2014 EQEMu Development Team (http://eqemulator.net) +Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,126 +25,124 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "../types.h" namespace RoF2 { - namespace maps { + namespace inventory { typedef enum : int16 { - MapPossessions = 0, - MapBank, - MapSharedBank, - MapTrade, - MapWorld, - MapLimbo, - MapTribute, - MapTrophyTribute, - MapGuildTribute, - MapMerchant, - MapDeleted, - MapCorpse, - MapBazaar, - MapInspect, - MapRealEstate, - MapViewMODPC, - MapViewMODBank, - MapViewMODSharedBank, - MapViewMODLimbo, - MapAltStorage, - MapArchived, - MapMail, - MapGuildTrophyTribute, - MapKrono, - MapOther, - _MapCount - } InventoryMaps; - } + TypePossessions = 0, + TypeBank, + TypeSharedBank, + TypeTrade, + TypeWorld, + TypeLimbo, + TypeTribute, + TypeTrophyTribute, + TypeGuildTribute, + TypeMerchant, + TypeDeleted, + TypeCorpse, + TypeBazaar, + TypeInspect, + TypeRealEstate, + TypeViewMODPC, + TypeViewMODBank, + TypeViewMODSharedBank, + TypeViewMODLimbo, + TypeAltStorage, + TypeArchived, + TypeMail, + TypeGuildTrophyTribute, + TypeKrono, + TypeOther, + TypeCount + } InventoryTypes; - namespace slots { typedef enum : int16 { - MainCharm = 0, - MainEar1, - MainHead, - MainFace, - MainEar2, - MainNeck, - MainShoulders, - MainArms, - MainBack, - MainWrist1, - MainWrist2, - MainRange, - MainHands, - MainPrimary, - MainSecondary, - MainFinger1, - MainFinger2, - MainChest, - MainLegs, - MainFeet, - MainWaist, - MainPowerSource, - MainAmmo, - MainGeneral1, - MainGeneral2, - MainGeneral3, - MainGeneral4, - MainGeneral5, - MainGeneral6, - MainGeneral7, - MainGeneral8, - MainGeneral9, - MainGeneral10, - MainCursor, - _MainCount, - _MainEquipmentBegin = MainCharm, - _MainEquipmentEnd = MainAmmo, - _MainEquipmentCount = (_MainEquipmentEnd - _MainEquipmentBegin + 1), - _MainGeneralBegin = MainGeneral1, - _MainGeneralEnd = MainGeneral10, - _MainGeneralCount = (_MainGeneralEnd - _MainGeneralBegin + 1) - } EquipmentSlots; + SlotCharm = 0, + SlotEar1, + SlotHead, + SlotFace, + SlotEar2, + SlotNeck, + SlotShoulders, + SlotArms, + SlotBack, + SlotWrist1, + SlotWrist2, + SlotRange, + SlotHands, + SlotPrimary, + SlotSecondary, + SlotFinger1, + SlotFinger2, + SlotChest, + SlotLegs, + SlotFeet, + SlotWaist, + SlotPowerSource, + SlotAmmo, + SlotGeneral1, + SlotGeneral2, + SlotGeneral3, + SlotGeneral4, + SlotGeneral5, + SlotGeneral6, + SlotGeneral7, + SlotGeneral8, + SlotGeneral9, + SlotGeneral10, + SlotCursor, + SlotCount, + SlotEquipmentBegin = SlotCharm, + SlotEquipmentEnd = SlotAmmo, + SlotEquipmentCount = (SlotEquipmentEnd - SlotEquipmentBegin + 1), + SlotGeneralBegin = SlotGeneral1, + SlotGeneralEnd = SlotGeneral10, + SlotGeneralCount = (SlotGeneralEnd - SlotGeneralBegin + 1) + } PossessionsSlots; } namespace consts { static const size_t CHARACTER_CREATION_LIMIT = 12; - static const uint16 MAP_POSSESSIONS_SIZE = slots::_MainCount; - static const uint16 MAP_BANK_SIZE = 24; - static const uint16 MAP_SHARED_BANK_SIZE = 2; - static const uint16 MAP_TRADE_SIZE = 8; - static const uint16 MAP_WORLD_SIZE = 10; - static const uint16 MAP_LIMBO_SIZE = 36; - static const uint16 MAP_TRIBUTE_SIZE = 0; //? - static const uint16 MAP_TROPHY_TRIBUTE_SIZE = 0; - static const uint16 MAP_GUILD_TRIBUTE_SIZE = 0; - static const uint16 MAP_MERCHANT_SIZE = 0; - static const uint16 MAP_DELETED_SIZE = 0; - static const uint16 MAP_CORPSE_SIZE = slots::_MainCount; - static const uint16 MAP_BAZAAR_SIZE = 200; - static const uint16 MAP_INSPECT_SIZE = slots::_MainEquipmentCount; - static const uint16 MAP_REAL_ESTATE_SIZE = 0; - static const uint16 MAP_VIEW_MOD_PC_SIZE = MAP_POSSESSIONS_SIZE; - static const uint16 MAP_VIEW_MOD_BANK_SIZE = MAP_BANK_SIZE; - static const uint16 MAP_VIEW_MOD_SHARED_BANK_SIZE = MAP_SHARED_BANK_SIZE; - static const uint16 MAP_VIEW_MOD_LIMBO_SIZE = MAP_LIMBO_SIZE; - static const uint16 MAP_ALT_STORAGE_SIZE = 0; - static const uint16 MAP_ARCHIVED_SIZE = 0; - static const uint16 MAP_MAIL_SIZE = 0; - static const uint16 MAP_GUILD_TROPHY_TRIBUTE_SIZE = 0; - static const uint16 MAP_KRONO_SIZE = NOT_USED; - static const uint16 MAP_OTHER_SIZE = 0; + static const uint16 TYPE_POSSESSIONS_SIZE = inventory::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 = 0; //? + 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 = inventory::SlotCount; + static const uint16 TYPE_BAZAAR_SIZE = 200; + static const uint16 TYPE_INSPECT_SIZE = inventory::SlotEquipmentCount; + static const uint16 TYPE_REAL_ESTATE_SIZE = 0; + static const uint16 TYPE_VIEW_MOD_PC_SIZE = TYPE_POSSESSIONS_SIZE; + static const uint16 TYPE_VIEW_MOD_BANK_SIZE = TYPE_BANK_SIZE; + static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = TYPE_SHARED_BANK_SIZE; + static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = TYPE_LIMBO_SIZE; + static const uint16 TYPE_ALT_STORAGE_SIZE = 0; + static const uint16 TYPE_ARCHIVED_SIZE = 0; + static const uint16 TYPE_MAIL_SIZE = 0; + static const uint16 TYPE_GUILD_TROPHY_TRIBUTE_SIZE = 0; + static const uint16 TYPE_KRONO_SIZE = NOT_USED; + static const uint16 TYPE_OTHER_SIZE = 0; // most of these definitions will go away with the structure-based system..this maintains compatibility for now // (bag slots and main slots beyond Possessions are assigned for compatibility with current server coding) - static const int16 EQUIPMENT_BEGIN = slots::MainCharm; - static const int16 EQUIPMENT_END = slots::MainAmmo; - static const uint16 EQUIPMENT_SIZE = slots::_MainEquipmentCount; + static const int16 EQUIPMENT_BEGIN = inventory::SlotCharm; + static const int16 EQUIPMENT_END = inventory::SlotAmmo; + static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount; - static const int16 GENERAL_BEGIN = slots::MainGeneral1; - static const int16 GENERAL_END = slots::MainGeneral10; - static const uint16 GENERAL_SIZE = slots::_MainGeneralCount; + static const int16 GENERAL_BEGIN = inventory::SlotGeneral1; + static const int16 GENERAL_END = inventory::SlotGeneral10; + static const uint16 GENERAL_SIZE = inventory::SlotGeneralCount; static const int16 GENERAL_BAGS_BEGIN = 251; static const int16 GENERAL_BAGS_END_OFFSET = 99; static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET; - static const int16 CURSOR = slots::MainCursor; + static const int16 CURSOR = inventory::SlotCursor; static const int16 CURSOR_BAG_BEGIN = 351; static const int16 CURSOR_BAG_END_OFFSET = 9; static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET; @@ -174,8 +172,8 @@ namespace RoF2 { static const int16 TRIBUTE_BEGIN = 400; static const int16 TRIBUTE_END = 404; - static const int16 CORPSE_BEGIN = slots::MainGeneral1; - static const int16 CORPSE_END = slots::MainGeneral1 + slots::MainCursor; + static const int16 CORPSE_BEGIN = inventory::SlotGeneral1; + static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor; static const uint16 ITEM_COMMON_SIZE = 6; static const uint16 ITEM_CONTAINER_SIZE = 255; // 255; (server max will be 255..unsure what actual client is - test) diff --git a/common/patches/rof2_structs.h b/common/patches/rof2_structs.h index 20d3b47f2..f7963ae54 100644 --- a/common/patches/rof2_structs.h +++ b/common/patches/rof2_structs.h @@ -29,22 +29,24 @@ struct WorldObjectsSent_Struct { }; // New for RoF2 - Size: 12 -struct ItemSlotStruct { -/*000*/ int16 SlotType; // Worn and Normal inventory = 0, Bank = 1, Shared Bank = 2, Delete Item = -1 +struct InventorySlot_Struct +{ +/*000*/ int16 Type; // Worn and Normal inventory = 0, Bank = 1, Shared Bank = 2, Delete Item = -1 /*002*/ int16 Unknown02; -/*004*/ int16 MainSlot; -/*006*/ int16 SubSlot; -/*008*/ int16 AugSlot; // Guessing - Seen 0xffff +/*004*/ int16 Slot; +/*006*/ int16 Sub; +/*008*/ int16 Aug; // Guessing - Seen 0xffff /*010*/ int16 Unknown01; // Normally 0 - Seen 13262 when deleting an item, but didn't match item ID /*012*/ }; // New for RoF2 - Used for Merchant_Purchase_Struct // Can't sellfrom other than main inventory so Slot Type is not needed. -struct MainInvItemSlotStruct { -/*000*/ int16 MainSlot; -/*002*/ int16 SubSlot; -/*004*/ int16 AugSlot; +struct TypelessInventorySlot_Struct +{ +/*000*/ int16 Slot; +/*002*/ int16 Sub; +/*004*/ int16 Aug; /*006*/ int16 Unknown01; /*008*/ }; @@ -656,7 +658,7 @@ struct CastSpell_Struct { /*00*/ uint32 slot; /*04*/ uint32 spell_id; -/*08*/ ItemSlotStruct inventoryslot; // slot for clicky item, Seen unknown of 131 = normal cast +/*08*/ InventorySlot_Struct inventory_slot; // slot for clicky item, Seen unknown of 131 = normal cast /*20*/ uint32 target_id; /*24*/ uint32 cs_unknown[2]; /*32*/ float y_pos; @@ -1082,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[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[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[MaterialCount]; // RR GG BB 00 /*00888*/ uint8 haircolor; // Player hair color /*00889*/ uint8 beardcolor; // Player beard color /*00890*/ uint32 unknown_rof5; // @@ -1747,7 +1749,7 @@ struct BulkItemPacket_Struct struct Consume_Struct { -/*000*/ ItemSlotStruct slot; +/*000*/ InventorySlot_Struct inventory_slot; /*012*/ uint32 auto_consumed; // 0xffffffff when auto eating e7030000 when right click /*016*/ uint32 type; // 0x01=Food 0x02=Water /*020*/ uint32 c_unknown1; // Seen 2 @@ -1779,16 +1781,18 @@ struct ItemProperties_Struct { /*008*/ }; -struct DeleteItem_Struct { -/*0000*/ ItemSlotStruct from_slot; -/*0012*/ ItemSlotStruct to_slot; +struct DeleteItem_Struct +{ +/*0000*/ InventorySlot_Struct from_slot; +/*0012*/ InventorySlot_Struct to_slot; /*0024*/ uint32 number_in_stack; /*0028*/ }; -struct MoveItem_Struct { -/*0000*/ ItemSlotStruct from_slot; -/*0012*/ ItemSlotStruct to_slot; +struct MoveItem_Struct +{ +/*0000*/ InventorySlot_Struct from_slot; +/*0012*/ InventorySlot_Struct to_slot; /*0024*/ uint32 number_in_stack; /*0028*/ }; @@ -2222,7 +2226,7 @@ struct Merchant_Sell_Struct { struct Merchant_Purchase_Struct { /*000*/ uint32 npcid; // Merchant NPC's entity id -/*004*/ MainInvItemSlotStruct itemslot; +/*004*/ TypelessInventorySlot_Struct inventory_slot; /*012*/ uint32 quantity; /*016*/ uint32 price; /*020*/ @@ -2280,9 +2284,10 @@ struct AltCurrencyUpdate_Struct { //Client -> Server //When an item is selected while the alt currency merchant window is open -struct AltCurrencySelectItem_Struct { +struct AltCurrencySelectItem_Struct +{ /*000*/ uint32 merchant_entity_id; -/*004*/ MainInvItemSlotStruct slot_id; +/*004*/ TypelessInventorySlot_Struct inventory_slot; /*004*/ //uint32 slot_id; /*008*/ uint32 unknown008; /*012*/ uint32 unknown012; @@ -2338,9 +2343,10 @@ struct AltCurrencyReclaim_Struct { /*012*/ uint32 reclaim_flag; //1 = this is reclaim }; -struct AltCurrencySellItem_Struct { +struct AltCurrencySellItem_Struct +{ /*000*/ uint32 merchant_entity_id; -/*004*/ MainInvItemSlotStruct slot_id; +/*004*/ TypelessInventorySlot_Struct inventory_slot; /*004*/ //uint32 slot_id; /*016*/ uint32 charges; /*020*/ uint32 cost; @@ -2356,7 +2362,7 @@ struct Adventure_Purchase_Struct { struct Adventure_Sell_Struct { /*000*/ uint32 unknown000; //0x01 - Stack Size/Charges? /*004*/ uint32 npcid; -/*008*/ MainInvItemSlotStruct slot; +/*008*/ TypelessInventorySlot_Struct inventory_slot; /*016*/ uint32 charges; /*020*/ uint32 sell_price; /*024*/ @@ -2702,9 +2708,9 @@ struct Stun_Struct { // 8 bytes total struct AugmentItem_Struct { /*00*/ uint32 dest_inst_id; // The unique serial number for the item instance that is being augmented /*04*/ uint32 container_index; // Seen 0 -/*08*/ ItemSlotStruct container_slot; // Slot of the item being augmented +/*08*/ InventorySlot_Struct container_slot; // Slot of the item being augmented /*20*/ uint32 augment_index; // Seen 0 -/*24*/ ItemSlotStruct augment_slot; // Slot of the distiller to use (if one applies) +/*24*/ InventorySlot_Struct augment_slot; // Slot of the distiller to use (if one applies) /*36*/ int32 augment_action; // Guessed - 0 = augment, 1 = remove with distiller, 3 = delete aug /*36*/ //int32 augment_slot; /*40*/ @@ -3691,7 +3697,7 @@ struct TributeInfo_Struct { struct TributeItem_Struct { -/*00*/ ItemSlotStruct slot; +/*00*/ InventorySlot_Struct inventory_slot; /*12*/ uint32 quantity; /*16*/ uint32 tribute_master_id; /*20*/ int32 tribute_points; @@ -3728,9 +3734,10 @@ struct Split_Struct ** Used In: OP_TradeSkillCombine ** Last Updated: 01-05-2013 */ -struct NewCombine_Struct { -/*00*/ ItemSlotStruct container_slot; -/*12*/ ItemSlotStruct guildtribute_slot; // Slot type is 8? (MapGuildTribute = 8) +struct NewCombine_Struct +{ +/*00*/ InventorySlot_Struct container_slot; +/*12*/ InventorySlot_Struct guildtribute_slot; // Slot type is 8? (MapGuildTribute = 8) /*24*/ }; @@ -3769,8 +3776,8 @@ struct RecipeReply_Struct { struct RecipeAutoCombine_Struct { /*00*/ uint32 object_type; /*04*/ uint32 some_id; -/*08*/ ItemSlotStruct container_slot; //echoed in reply - Was uint32 unknown1 -/*20*/ ItemSlotStruct unknown_slot; //echoed in reply +/*08*/ InventorySlot_Struct container_slot; //echoed in reply - Was uint32 unknown1 +/*20*/ InventorySlot_Struct unknown_slot; //echoed in reply /*32*/ uint32 recipe_id; /*36*/ uint32 reply_code; /*40*/ @@ -4488,19 +4495,22 @@ struct ExpansionInfo_Struct { /*064*/ uint32 Expansions; }; -struct ApplyPoison_Struct { - MainInvItemSlotStruct inventorySlot; +struct ApplyPoison_Struct +{ + TypelessInventorySlot_Struct inventorySlot; uint32 success; }; -struct ItemVerifyRequest_Struct { -/*000*/ ItemSlotStruct slot; +struct ItemVerifyRequest_Struct +{ +/*000*/ InventorySlot_Struct inventory_slot; /*012*/ uint32 target; // Target Entity ID /*016*/ }; -struct ItemVerifyReply_Struct { -/*000*/ ItemSlotStruct slot; +struct ItemVerifyReply_Struct +{ +/*000*/ InventorySlot_Struct inventory_slot; /*012*/ uint32 spell; // Spell ID to cast if different than item effect /*016*/ uint32 target; // Target Entity ID /*020*/ diff --git a/common/patches/rof_constants.h b/common/patches/rof_constants.h index b348f5fd5..c75602da4 100644 --- a/common/patches/rof_constants.h +++ b/common/patches/rof_constants.h @@ -1,7 +1,7 @@ /* EQEMu: Everquest Server Emulator -Copyright (C) 2001-2014 EQEMu Development Team (http://eqemulator.net) +Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,125 +25,123 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "../types.h" namespace RoF { - namespace maps { + namespace inventory { typedef enum : int16 { - MapPossessions = 0, - MapBank, - MapSharedBank, - MapTrade, - MapWorld, - MapLimbo, - MapTribute, - MapTrophyTribute, - MapGuildTribute, - MapMerchant, - MapDeleted, - MapCorpse, - MapBazaar, - MapInspect, - MapRealEstate, - MapViewMODPC, - MapViewMODBank, - MapViewMODSharedBank, - MapViewMODLimbo, - MapAltStorage, - MapArchived, - MapMail, - MapGuildTrophyTribute, - MapOther, - _MapCount - } InventoryMaps; - } + TypePossessions = 0, + TypeBank, + TypeSharedBank, + TypeTrade, + TypeWorld, + TypeLimbo, + TypeTribute, + TypeTrophyTribute, + TypeGuildTribute, + TypeMerchant, + TypeDeleted, + TypeCorpse, + TypeBazaar, + TypeInspect, + TypeRealEstate, + TypeViewMODPC, + TypeViewMODBank, + TypeViewMODSharedBank, + TypeViewMODLimbo, + TypeAltStorage, + TypeArchived, + TypeMail, + TypeGuildTrophyTribute, + TypeOther, + TypeCount + } InventoryTypes; - namespace slots { typedef enum : int16 { - MainCharm = 0, - MainEar1, - MainHead, - MainFace, - MainEar2, - MainNeck, - MainShoulders, - MainArms, - MainBack, - MainWrist1, - MainWrist2, - MainRange, - MainHands, - MainPrimary, - MainSecondary, - MainFinger1, - MainFinger2, - MainChest, - MainLegs, - MainFeet, - MainWaist, - MainPowerSource, - MainAmmo, - MainGeneral1, - MainGeneral2, - MainGeneral3, - MainGeneral4, - MainGeneral5, - MainGeneral6, - MainGeneral7, - MainGeneral8, - MainGeneral9, - MainGeneral10, - MainCursor, - _MainCount, - _MainEquipmentBegin = MainCharm, - _MainEquipmentEnd = MainAmmo, - _MainEquipmentCount = (_MainEquipmentEnd - _MainEquipmentBegin + 1), - _MainGeneralBegin = MainGeneral1, - _MainGeneralEnd = MainGeneral10, - _MainGeneralCount = (_MainGeneralEnd - _MainGeneralBegin + 1) - } EquipmentSlots; + SlotCharm = 0, + SlotEar1, + SlotHead, + SlotFace, + SlotEar2, + SlotNeck, + SlotShoulders, + SlotArms, + SlotBack, + SlotWrist1, + SlotWrist2, + SlotRange, + SlotHands, + SlotPrimary, + SlotSecondary, + SlotFinger1, + SlotFinger2, + SlotChest, + SlotLegs, + SlotFeet, + SlotWaist, + SlotPowerSource, + SlotAmmo, + SlotGeneral1, + SlotGeneral2, + SlotGeneral3, + SlotGeneral4, + SlotGeneral5, + SlotGeneral6, + SlotGeneral7, + SlotGeneral8, + SlotGeneral9, + SlotGeneral10, + SlotCursor, + SlotCount, + SlotEquipmentBegin = SlotCharm, + SlotEquipmentEnd = SlotAmmo, + SlotEquipmentCount = (SlotEquipmentEnd - SlotEquipmentBegin + 1), + SlotGeneralBegin = SlotGeneral1, + SlotGeneralEnd = SlotGeneral10, + SlotGeneralCount = (SlotGeneralEnd - SlotGeneralBegin + 1) + } PossessionsSlots; } namespace consts { static const size_t CHARACTER_CREATION_LIMIT = 12; - static const uint16 MAP_POSSESSIONS_SIZE = slots::_MainCount; - static const uint16 MAP_BANK_SIZE = 24; - static const uint16 MAP_SHARED_BANK_SIZE = 2; - static const uint16 MAP_TRADE_SIZE = 8; - static const uint16 MAP_WORLD_SIZE = 10; - static const uint16 MAP_LIMBO_SIZE = 36; - static const uint16 MAP_TRIBUTE_SIZE = 0; //? - static const uint16 MAP_TROPHY_TRIBUTE_SIZE = 0; - static const uint16 MAP_GUILD_TRIBUTE_SIZE = 0; - static const uint16 MAP_MERCHANT_SIZE = 0; - static const uint16 MAP_DELETED_SIZE = 0; - static const uint16 MAP_CORPSE_SIZE = slots::_MainCount; - static const uint16 MAP_BAZAAR_SIZE = 200; - static const uint16 MAP_INSPECT_SIZE = slots::_MainEquipmentCount; - static const uint16 MAP_REAL_ESTATE_SIZE = 0; - static const uint16 MAP_VIEW_MOD_PC_SIZE = MAP_POSSESSIONS_SIZE; - static const uint16 MAP_VIEW_MOD_BANK_SIZE = MAP_BANK_SIZE; - static const uint16 MAP_VIEW_MOD_SHARED_BANK_SIZE = MAP_SHARED_BANK_SIZE; - static const uint16 MAP_VIEW_MOD_LIMBO_SIZE = MAP_LIMBO_SIZE; - static const uint16 MAP_ALT_STORAGE_SIZE = 0; - static const uint16 MAP_ARCHIVED_SIZE = 0; - static const uint16 MAP_MAIL_SIZE = 0; - static const uint16 MAP_GUILD_TROPHY_TRIBUTE_SIZE = 0; - static const uint16 MAP_KRONO_SIZE = NOT_USED; - static const uint16 MAP_OTHER_SIZE = 0; + static const uint16 TYPE_POSSESSIONS_SIZE = inventory::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 = 0; //? + 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 = inventory::SlotCount; + static const uint16 TYPE_BAZAAR_SIZE = 200; + static const uint16 TYPE_INSPECT_SIZE = inventory::SlotEquipmentCount; + static const uint16 TYPE_REAL_ESTATE_SIZE = 0; + static const uint16 TYPE_VIEW_MOD_PC_SIZE = TYPE_POSSESSIONS_SIZE; + static const uint16 TYPE_VIEW_MOD_BANK_SIZE = TYPE_BANK_SIZE; + static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = TYPE_SHARED_BANK_SIZE; + static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = TYPE_LIMBO_SIZE; + static const uint16 TYPE_ALT_STORAGE_SIZE = 0; + static const uint16 TYPE_ARCHIVED_SIZE = 0; + static const uint16 TYPE_MAIL_SIZE = 0; + static const uint16 TYPE_GUILD_TROPHY_TRIBUTE_SIZE = 0; + static const uint16 TYPE_KRONO_SIZE = NOT_USED; + static const uint16 TYPE_OTHER_SIZE = 0; // most of these definitions will go away with the structure-based system..this maintains compatibility for now // (bag slots and main slots beyond Possessions are assigned for compatibility with current server coding) - static const int16 EQUIPMENT_BEGIN = slots::MainCharm; - static const int16 EQUIPMENT_END = slots::MainAmmo; - static const uint16 EQUIPMENT_SIZE = slots::_MainEquipmentCount; + static const int16 EQUIPMENT_BEGIN = inventory::SlotCharm; + static const int16 EQUIPMENT_END = inventory::SlotAmmo; + static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount; - static const int16 GENERAL_BEGIN = slots::MainGeneral1; - static const int16 GENERAL_END = slots::MainGeneral10; - static const uint16 GENERAL_SIZE = slots::_MainGeneralCount; + static const int16 GENERAL_BEGIN = inventory::SlotGeneral1; + static const int16 GENERAL_END = inventory::SlotGeneral10; + static const uint16 GENERAL_SIZE = inventory::SlotGeneralCount; static const int16 GENERAL_BAGS_BEGIN = 251; static const int16 GENERAL_BAGS_END_OFFSET = 99; static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET; - static const int16 CURSOR = slots::MainCursor; + static const int16 CURSOR = inventory::SlotCursor; static const int16 CURSOR_BAG_BEGIN = 351; static const int16 CURSOR_BAG_END_OFFSET = 9; static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET; @@ -173,8 +171,8 @@ namespace RoF { static const int16 TRIBUTE_BEGIN = 400; static const int16 TRIBUTE_END = 404; - static const int16 CORPSE_BEGIN = slots::MainGeneral1; - static const int16 CORPSE_END = slots::MainGeneral1 + slots::MainCursor; + static const int16 CORPSE_BEGIN = inventory::SlotGeneral1; + static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor; static const uint16 ITEM_COMMON_SIZE = 6; static const uint16 ITEM_CONTAINER_SIZE = 255; // 255; (server max will be 255..unsure what actual client is - test) diff --git a/common/patches/rof_structs.h b/common/patches/rof_structs.h index 86f8b0872..d4f7ce368 100644 --- a/common/patches/rof_structs.h +++ b/common/patches/rof_structs.h @@ -29,22 +29,24 @@ struct WorldObjectsSent_Struct { }; // New for RoF - Size: 12 -struct ItemSlotStruct { -/*000*/ int16 SlotType; // Worn and Normal inventory = 0, Bank = 1, Shared Bank = 2, Delete Item = -1 +struct InventorySlot_Struct +{ +/*000*/ int16 Type; // Worn and Normal inventory = 0, Bank = 1, Shared Bank = 2, Delete Item = -1 /*002*/ int16 Unknown02; -/*004*/ int16 MainSlot; -/*006*/ int16 SubSlot; -/*008*/ int16 AugSlot; // Guessing - Seen 0xffff +/*004*/ int16 Slot; +/*006*/ int16 Sub; +/*008*/ int16 Aug; // Guessing - Seen 0xffff /*010*/ int16 Unknown01; // Normally 0 - Seen 13262 when deleting an item, but didn't match item ID /*012*/ }; // New for RoF - Used for Merchant_Purchase_Struct // Can't sellfrom other than main inventory so Slot Type is not needed. -struct MainInvItemSlotStruct { -/*000*/ int16 MainSlot; -/*002*/ int16 SubSlot; -/*004*/ int16 AugSlot; +struct TypelessInventorySlot_Struct +{ +/*000*/ int16 Slot; +/*002*/ int16 Sub; +/*004*/ int16 Aug; /*006*/ int16 Unknown01; /*008*/ }; @@ -645,7 +647,7 @@ struct CastSpell_Struct { /*00*/ uint32 slot; /*04*/ uint32 spell_id; -/*08*/ ItemSlotStruct inventoryslot; // slot for clicky item, Seen unknown of 131 = normal cast +/*08*/ InventorySlot_Struct inventory_slot; // slot for clicky item, Seen unknown of 131 = normal cast /*20*/ uint32 target_id; /*24*/ uint32 cs_unknown[2]; /*32*/ float y_pos; @@ -1777,7 +1779,7 @@ struct BulkItemPacket_Struct struct Consume_Struct { -/*000*/ ItemSlotStruct slot; +/*000*/ InventorySlot_Struct inventory_slot; /*012*/ uint32 auto_consumed; // 0xffffffff when auto eating e7030000 when right click /*016*/ uint32 type; // 0x01=Food 0x02=Water /*020*/ uint32 c_unknown1; // Seen 2 @@ -1809,17 +1811,19 @@ struct ItemProperties_Struct { /*008*/ }; -struct DeleteItem_Struct { -/*0000*/ ItemSlotStruct from_slot; -/*0012*/ ItemSlotStruct to_slot; -/*0024*/ uint32 number_in_stack; +struct DeleteItem_Struct +{ +/*0000*/ InventorySlot_Struct from_slot; +/*0012*/ InventorySlot_Struct to_slot; +/*0024*/ uint32 number_in_stack; /*0028*/ }; -struct MoveItem_Struct { -/*0000*/ ItemSlotStruct from_slot; -/*0012*/ ItemSlotStruct to_slot; -/*0024*/ uint32 number_in_stack; +struct MoveItem_Struct +{ +/*0000*/ InventorySlot_Struct from_slot; +/*0012*/ InventorySlot_Struct to_slot; +/*0024*/ uint32 number_in_stack; /*0028*/ }; @@ -2252,7 +2256,7 @@ struct Merchant_Sell_Struct { struct Merchant_Purchase_Struct { /*000*/ uint32 npcid; // Merchant NPC's entity id -/*004*/ MainInvItemSlotStruct itemslot; +/*004*/ TypelessInventorySlot_Struct inventory_slot; /*012*/ uint32 quantity; /*016*/ uint32 price; /*020*/ @@ -2310,9 +2314,10 @@ struct AltCurrencyUpdate_Struct { //Client -> Server //When an item is selected while the alt currency merchant window is open -struct AltCurrencySelectItem_Struct { +struct AltCurrencySelectItem_Struct +{ /*000*/ uint32 merchant_entity_id; -/*004*/ MainInvItemSlotStruct slot_id; +/*004*/ TypelessInventorySlot_Struct inventory_slot; /*008*/ uint32 unknown008; /*012*/ uint32 unknown012; /*016*/ uint32 unknown016; @@ -2369,7 +2374,7 @@ struct AltCurrencyReclaim_Struct { struct AltCurrencySellItem_Struct { /*000*/ uint32 merchant_entity_id; -/*004*/ MainInvItemSlotStruct slot_id; +/*004*/ TypelessInventorySlot_Struct inventory_slot; /*008*/ uint32 charges; /*012*/ uint32 cost; }; @@ -2384,7 +2389,7 @@ struct Adventure_Purchase_Struct { struct Adventure_Sell_Struct { /*000*/ uint32 unknown000; //0x01 - Stack Size/Charges? /*004*/ uint32 npcid; -/*008*/ MainInvItemSlotStruct slot; +/*008*/ TypelessInventorySlot_Struct inventory_slot; /*016*/ uint32 charges; /*020*/ uint32 sell_price; /*024*/ @@ -2730,9 +2735,9 @@ struct Stun_Struct { // 8 bytes total struct AugmentItem_Struct { /*00*/ uint32 dest_inst_id; // The unique serial number for the item instance that is being augmented /*04*/ uint32 container_index; // Seen 0 -/*08*/ ItemSlotStruct container_slot; // Slot of the item being augmented +/*08*/ InventorySlot_Struct container_slot; // Slot of the item being augmented /*20*/ uint32 augment_index; // Seen 0 -/*24*/ ItemSlotStruct augment_slot; // Slot of the distiller to use (if one applies) +/*24*/ InventorySlot_Struct augment_slot; // Slot of the distiller to use (if one applies) /*36*/ int32 augment_action; // Guessed - 0 = augment, 1 = remove with distiller, 3 = delete aug /*36*/ //int32 augment_slot; /*40*/ @@ -3692,7 +3697,7 @@ struct TributeInfo_Struct { struct TributeItem_Struct { -/*00*/ ItemSlotStruct slot; +/*00*/ InventorySlot_Struct inventory_slot; /*12*/ uint32 quantity; /*16*/ uint32 tribute_master_id; /*20*/ int32 tribute_points; @@ -3729,9 +3734,10 @@ struct Split_Struct ** Used In: OP_TradeSkillCombine ** Last Updated: 01-05-2013 */ -struct NewCombine_Struct { -/*00*/ ItemSlotStruct container_slot; -/*12*/ ItemSlotStruct guildtribute_slot; // Slot type is 8? (MapGuildTribute = 8) +struct NewCombine_Struct +{ +/*00*/ InventorySlot_Struct container_slot; +/*12*/ InventorySlot_Struct guildtribute_slot; // Slot type is 8? (MapGuildTribute = 8) /*24*/ }; @@ -3767,11 +3773,12 @@ struct RecipeReply_Struct { }; //received and sent back as an ACK with different reply_code -struct RecipeAutoCombine_Struct { +struct RecipeAutoCombine_Struct +{ /*00*/ uint32 object_type; /*04*/ uint32 some_id; -/*08*/ ItemSlotStruct container_slot; //echoed in reply - Was uint32 unknown1 -/*20*/ ItemSlotStruct unknown_slot; //echoed in reply +/*08*/ InventorySlot_Struct container_slot; //echoed in reply - Was uint32 unknown1 +/*20*/ InventorySlot_Struct unknown_slot; //echoed in reply /*32*/ uint32 recipe_id; /*36*/ uint32 reply_code; /*40*/ @@ -4486,19 +4493,22 @@ struct ExpansionInfo_Struct { /*064*/ uint32 Expansions; }; -struct ApplyPoison_Struct { - MainInvItemSlotStruct inventorySlot; +struct ApplyPoison_Struct +{ + TypelessInventorySlot_Struct inventory_slot; uint32 success; }; -struct ItemVerifyRequest_Struct { -/*000*/ ItemSlotStruct slot; +struct ItemVerifyRequest_Struct +{ +/*000*/ InventorySlot_Struct inventory_slot; /*012*/ uint32 target; // Target Entity ID /*016*/ }; -struct ItemVerifyReply_Struct { -/*000*/ ItemSlotStruct slot; +struct ItemVerifyReply_Struct +{ +/*000*/ InventorySlot_Struct inventory_slot; /*012*/ uint32 spell; // Spell ID to cast if different than item effect /*016*/ uint32 target; // Target Entity ID /*020*/ diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 424ad5a22..1d812927c 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 < EmuConstants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) { + for (r = 0; r < EQEmu::Constants::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 = EmuConstants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { + for (r = EQEmu::Constants::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 < EmuConstants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (r = 0; r < EQEmu::Constants::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 = EmuConstants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (r = EQEmu::Constants::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 < 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; @@ -3934,7 +3934,7 @@ namespace SoD uint32 SubLengths[10]; - for (int x = SUB_BEGIN; x < EmuConstants::ITEM_CONTAINER_SIZE; ++x) { + for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) { SubSerializations[x] = nullptr; @@ -3946,15 +3946,15 @@ namespace SoD iqbs.subitem_count++; - if (slot_id_in >= EmuConstants::GENERAL_BEGIN && slot_id_in <= EmuConstants::GENERAL_END) // (< 30) - no cursor? + if (slot_id_in >= EQEmu::Constants::GENERAL_BEGIN && slot_id_in <= EQEmu::Constants::GENERAL_END) // (< 30) - no cursor? //SubSlotNumber = (((slot_id_in + 3) * 10) + x + 1); - SubSlotNumber = (((slot_id_in + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + x + 1); - else if (slot_id_in >= EmuConstants::BANK_BEGIN && slot_id_in <= EmuConstants::BANK_END) + 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 - 2000) * 10) + 2030 + x + 1); - SubSlotNumber = (((slot_id_in - EmuConstants::BANK_BEGIN) * EmuConstants::ITEM_CONTAINER_SIZE) + EmuConstants::BANK_BAGS_BEGIN + x); - else if (slot_id_in >= EmuConstants::SHARED_BANK_BEGIN && slot_id_in <= EmuConstants::SHARED_BANK_END) + 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 - 2500) * 10) + 2530 + x + 1); - SubSlotNumber = (((slot_id_in - EmuConstants::SHARED_BANK_BEGIN) * EmuConstants::ITEM_CONTAINER_SIZE) + EmuConstants::SHARED_BANK_BAGS_BEGIN + x); + SubSlotNumber = (((slot_id_in - EQEmu::Constants::SHARED_BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::SHARED_BANK_BAGS_BEGIN + x); else SubSlotNumber = slot_id_in; // ??????? @@ -3993,16 +3993,16 @@ namespace SoD { uint32 SoDSlot = 0; - if (serverSlot >= MainAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots + if (serverSlot >= SlotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots SoDSlot = serverSlot + 1; - else if (serverSlot >= EmuConstants::GENERAL_BAGS_BEGIN && serverSlot <= EmuConstants::CURSOR_BAG_END) + else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END) SoDSlot = serverSlot + 11; - else if (serverSlot >= EmuConstants::BANK_BAGS_BEGIN && serverSlot <= EmuConstants::BANK_BAGS_END) + else if (serverSlot >= EQEmu::Constants::BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::BANK_BAGS_END) SoDSlot = serverSlot + 1; - else if (serverSlot >= EmuConstants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EmuConstants::SHARED_BANK_BAGS_END) + else if (serverSlot >= EQEmu::Constants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::SHARED_BANK_BAGS_END) SoDSlot = serverSlot + 1; - else if (serverSlot == MainPowerSource) - SoDSlot = slots::MainPowerSource; + else if (serverSlot == SlotPowerSource) + SoDSlot = inventory::SlotPowerSource; else SoDSlot = serverSlot; return SoDSlot; @@ -4018,7 +4018,7 @@ namespace SoD { uint32 ServerSlot = 0; - if (sodSlot >= slots::MainAmmo && sodSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots + if (sodSlot >= inventory::SlotAmmo && sodSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots ServerSlot = sodSlot - 1; else if (sodSlot >= consts::GENERAL_BAGS_BEGIN && sodSlot <= consts::CURSOR_BAG_END) ServerSlot = sodSlot - 11; @@ -4026,8 +4026,8 @@ namespace SoD ServerSlot = sodSlot - 1; else if (sodSlot >= consts::SHARED_BANK_BAGS_BEGIN && sodSlot <= consts::SHARED_BANK_BAGS_END) ServerSlot = sodSlot - 1; - else if (sodSlot == slots::MainPowerSource) - ServerSlot = MainPowerSource; + else if (sodSlot == inventory::SlotPowerSource) + ServerSlot = 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 == EmuConstants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) { + if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::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() <= EmuConstants::TEXT_LINK_BODY_LENGTH) { + if (segments[segment_iter].length() <= EQEmu::Constants::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 ((EmuConstants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (sodTextLink.find('\x12') == std::string::npos)) { + if ((EQEmu::Constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (sodTextLink.find('\x12') == std::string::npos)) { serverTextLink = sodTextLink; return; } diff --git a/common/patches/sod_constants.h b/common/patches/sod_constants.h index ebd1d7d48..418525032 100644 --- a/common/patches/sod_constants.h +++ b/common/patches/sod_constants.h @@ -1,7 +1,7 @@ /* EQEMu: Everquest Server Emulator -Copyright (C) 2001-2014 EQEMu Development Team (http://eqemulator.net) +Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,122 +25,119 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "../types.h" namespace SoD { - namespace maps { + namespace inventory { typedef enum : int16 { - // this needs work to match actual client equivilents - MapPossessions = 0, - MapBank, - MapSharedBank, - MapTrade, - MapWorld, - MapLimbo, - MapTribute, - MapTrophyTribute, - MapGuildTribute, - MapMerchant, - MapDeleted, - MapCorpse, - MapBazaar, - MapInspect, - MapRealEstate, - MapViewMODPC, - MapViewMODBank, - MapViewMODSharedBank, - MapViewMODLimbo, - MapAltStorage, - MapArchived, - MapMail, - MapGuildTrophyTribute, - MapOther, - _MapCount - } InventoryMaps; - } + TypePossessions = 0, + TypeBank, + TypeSharedBank, + TypeTrade, + TypeWorld, + TypeLimbo, + TypeTribute, + TypeTrophyTribute, + TypeGuildTribute, + TypeMerchant, + TypeDeleted, + TypeCorpse, + TypeBazaar, + TypeInspect, + TypeRealEstate, + TypeViewMODPC, + TypeViewMODBank, + TypeViewMODSharedBank, + TypeViewMODLimbo, + TypeAltStorage, + TypeArchived, + TypeMail, + TypeGuildTrophyTribute, + TypeOther, + TypeCount + } InventoryTypes; - namespace slots { typedef enum : int16 { - MainCharm = 0, - MainEar1, - MainHead, - MainFace, - MainEar2, - MainNeck, - MainShoulders, - MainArms, - MainBack, - MainWrist1, - MainWrist2, - MainRange, - MainHands, - MainPrimary, - MainSecondary, - MainFinger1, - MainFinger2, - MainChest, - MainLegs, - MainFeet, - MainWaist, - MainPowerSource, - MainAmmo, - MainGeneral1, - MainGeneral2, - MainGeneral3, - MainGeneral4, - MainGeneral5, - MainGeneral6, - MainGeneral7, - MainGeneral8, - MainCursor, - _MainCount, - _MainEquipmentBegin = MainCharm, - _MainEquipmentEnd = MainAmmo, - _MainEquipmentCount = (_MainEquipmentEnd - _MainEquipmentBegin + 1), - _MainGeneralBegin = MainGeneral1, - _MainGeneralEnd = MainGeneral8, - _MainGeneralCount = (_MainGeneralEnd - _MainGeneralBegin + 1) - } EquipmentSlots; + SlotCharm = 0, + SlotEar1, + SlotHead, + SlotFace, + SlotEar2, + SlotNeck, + SlotShoulders, + SlotArms, + SlotBack, + SlotWrist1, + SlotWrist2, + SlotRange, + SlotHands, + SlotPrimary, + SlotSecondary, + SlotFinger1, + SlotFinger2, + SlotChest, + SlotLegs, + SlotFeet, + SlotWaist, + SlotPowerSource, + SlotAmmo, + SlotGeneral1, + SlotGeneral2, + SlotGeneral3, + SlotGeneral4, + SlotGeneral5, + SlotGeneral6, + SlotGeneral7, + SlotGeneral8, + SlotCursor, + SlotCount, + SlotEquipmentBegin = SlotCharm, + SlotEquipmentEnd = SlotAmmo, + SlotEquipmentCount = (SlotEquipmentEnd - SlotEquipmentBegin + 1), + SlotGeneralBegin = SlotGeneral1, + SlotGeneralEnd = SlotGeneral8, + SlotGeneralCount = (SlotGeneralEnd - SlotGeneralBegin + 1) + } PossessionsSlots; } namespace consts { static const size_t CHARACTER_CREATION_LIMIT = 12; - static const uint16 MAP_POSSESSIONS_SIZE = slots::_MainCount; - static const uint16 MAP_BANK_SIZE = 24; - static const uint16 MAP_SHARED_BANK_SIZE = 2; - static const uint16 MAP_TRADE_SIZE = 8; - static const uint16 MAP_WORLD_SIZE = 10; - static const uint16 MAP_LIMBO_SIZE = 36; - static const uint16 MAP_TRIBUTE_SIZE = 0; //? - static const uint16 MAP_TROPHY_TRIBUTE_SIZE = 0; - static const uint16 MAP_GUILD_TRIBUTE_SIZE = 0; - static const uint16 MAP_MERCHANT_SIZE = 0; - static const uint16 MAP_DELETED_SIZE = 0; - static const uint16 MAP_CORPSE_SIZE = slots::_MainCount; - static const uint16 MAP_BAZAAR_SIZE = 80; - static const uint16 MAP_INSPECT_SIZE = slots::_MainEquipmentCount; - static const uint16 MAP_REAL_ESTATE_SIZE = 0; - static const uint16 MAP_VIEW_MOD_PC_SIZE = MAP_POSSESSIONS_SIZE; - static const uint16 MAP_VIEW_MOD_BANK_SIZE = MAP_BANK_SIZE; - static const uint16 MAP_VIEW_MOD_SHARED_BANK_SIZE = MAP_SHARED_BANK_SIZE; - static const uint16 MAP_VIEW_MOD_LIMBO_SIZE = MAP_LIMBO_SIZE; - static const uint16 MAP_ALT_STORAGE_SIZE = 0; - static const uint16 MAP_ARCHIVED_SIZE = 0; - static const uint16 MAP_MAIL_SIZE = 0; - static const uint16 MAP_GUILD_TROPHY_TRIBUTE_SIZE = 0; - static const uint16 MAP_KRONO_SIZE = NOT_USED; - static const uint16 MAP_OTHER_SIZE = 0; + static const uint16 TYPE_POSSESSIONS_SIZE = inventory::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 = 0; //? + 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 = inventory::SlotCount; + static const uint16 TYPE_BAZAAR_SIZE = 80; + static const uint16 TYPE_INSPECT_SIZE = inventory::SlotEquipmentCount; + static const uint16 TYPE_REAL_ESTATE_SIZE = 0; + static const uint16 TYPE_VIEW_MOD_PC_SIZE = TYPE_POSSESSIONS_SIZE; + static const uint16 TYPE_VIEW_MOD_BANK_SIZE = TYPE_BANK_SIZE; + static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = TYPE_SHARED_BANK_SIZE; + static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = TYPE_LIMBO_SIZE; + static const uint16 TYPE_ALT_STORAGE_SIZE = 0; + static const uint16 TYPE_ARCHIVED_SIZE = 0; + static const uint16 TYPE_MAIL_SIZE = 0; + static const uint16 TYPE_GUILD_TROPHY_TRIBUTE_SIZE = 0; + static const uint16 TYPE_KRONO_SIZE = NOT_USED; + static const uint16 TYPE_OTHER_SIZE = 0; - static const int16 EQUIPMENT_BEGIN = slots::MainCharm; - static const int16 EQUIPMENT_END = slots::MainAmmo; - static const uint16 EQUIPMENT_SIZE = slots::_MainEquipmentCount; + static const int16 EQUIPMENT_BEGIN = inventory::SlotCharm; + static const int16 EQUIPMENT_END = inventory::SlotAmmo; + static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount; - static const int16 GENERAL_BEGIN = slots::MainGeneral1; - static const int16 GENERAL_END = slots::MainGeneral8; - static const uint16 GENERAL_SIZE = slots::_MainGeneralCount; + static const int16 GENERAL_BEGIN = inventory::SlotGeneral1; + static const int16 GENERAL_END = inventory::SlotGeneral8; + static const uint16 GENERAL_SIZE = inventory::SlotGeneralCount; static const int16 GENERAL_BAGS_BEGIN = 262; static const int16 GENERAL_BAGS_END_OFFSET = 79; static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET; - static const int16 CURSOR = slots::MainCursor; + static const int16 CURSOR = inventory::SlotCursor; static const int16 CURSOR_BAG_BEGIN = 342; static const int16 CURSOR_BAG_END_OFFSET = 9; static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET; @@ -170,8 +167,8 @@ namespace SoD { static const int16 TRIBUTE_BEGIN = 400; static const int16 TRIBUTE_END = 404; - static const int16 CORPSE_BEGIN = slots::MainGeneral1; - static const int16 CORPSE_END = slots::MainGeneral1 + slots::MainCursor; + static const int16 CORPSE_BEGIN = inventory::SlotGeneral1; + static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor; static const uint16 ITEM_COMMON_SIZE = 5; static const uint16 ITEM_CONTAINER_SIZE = 10; diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 11e365a71..2056b0798 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 < EmuConstants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) { + for (r = 0; r < EQEmu::Constants::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 = EmuConstants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { + for (r = EQEmu::Constants::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 < EmuConstants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (r = 0; r < EQEmu::Constants::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 = EmuConstants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (r = EQEmu::Constants::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 < 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_BEGIN; x < EmuConstants::ITEM_CONTAINER_SIZE; ++x) { + for (int x = SUB_BEGIN; x < EQEmu::Constants::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 >= EmuConstants::GENERAL_BEGIN && slot_id_in <= EmuConstants::GENERAL_END) // (< 30) - no cursor? + if (slot_id_in >= EQEmu::Constants::GENERAL_BEGIN && slot_id_in <= EQEmu::Constants::GENERAL_END) // (< 30) - no cursor? //SubSlotNumber = (((slot_id_in + 3) * 10) + x + 1); - SubSlotNumber = (((slot_id_in + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + x + 1); - else if (slot_id_in >= EmuConstants::BANK_BEGIN && slot_id_in <= EmuConstants::BANK_END) + 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 - 2000) * 10) + 2030 + x + 1); - SubSlotNumber = (((slot_id_in - EmuConstants::BANK_BEGIN) * EmuConstants::ITEM_CONTAINER_SIZE) + EmuConstants::BANK_BAGS_BEGIN + x); - else if (slot_id_in >= EmuConstants::SHARED_BANK_BEGIN && slot_id_in <= EmuConstants::SHARED_BANK_END) + 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 - 2500) * 10) + 2530 + x + 1); - SubSlotNumber = (((slot_id_in - EmuConstants::SHARED_BANK_BEGIN) * EmuConstants::ITEM_CONTAINER_SIZE) + EmuConstants::SHARED_BANK_BAGS_BEGIN + x); + SubSlotNumber = (((slot_id_in - EQEmu::Constants::SHARED_BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::SHARED_BANK_BAGS_BEGIN + x); else SubSlotNumber = slot_id_in; // ??????? @@ -3312,16 +3312,16 @@ namespace SoF { uint32 SoFSlot = 0; - if (serverSlot >= MainAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots + if (serverSlot >= SlotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots SoFSlot = serverSlot + 1; - else if (serverSlot >= EmuConstants::GENERAL_BAGS_BEGIN && serverSlot <= EmuConstants::CURSOR_BAG_END) + else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END) SoFSlot = serverSlot + 11; - else if (serverSlot >= EmuConstants::BANK_BAGS_BEGIN && serverSlot <= EmuConstants::BANK_BAGS_END) + else if (serverSlot >= EQEmu::Constants::BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::BANK_BAGS_END) SoFSlot = serverSlot + 1; - else if (serverSlot >= EmuConstants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EmuConstants::SHARED_BANK_BAGS_END) + else if (serverSlot >= EQEmu::Constants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::SHARED_BANK_BAGS_END) SoFSlot = serverSlot + 1; - else if (serverSlot == MainPowerSource) - SoFSlot = slots::MainPowerSource; + else if (serverSlot == SlotPowerSource) + SoFSlot = inventory::SlotPowerSource; else SoFSlot = serverSlot; @@ -3338,7 +3338,7 @@ namespace SoF { uint32 ServerSlot = 0; - if (sofSlot >= slots::MainAmmo && sofSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots + if (sofSlot >= inventory::SlotAmmo && sofSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots ServerSlot = sofSlot - 1; else if (sofSlot >= consts::GENERAL_BAGS_BEGIN && sofSlot <= consts::CURSOR_BAG_END) ServerSlot = sofSlot - 11; @@ -3346,8 +3346,8 @@ namespace SoF ServerSlot = sofSlot - 1; else if (sofSlot >= consts::SHARED_BANK_BAGS_BEGIN && sofSlot <= consts::SHARED_BANK_BAGS_END) ServerSlot = sofSlot - 1; - else if (sofSlot == slots::MainPowerSource) - ServerSlot = MainPowerSource; + else if (sofSlot == inventory::SlotPowerSource) + ServerSlot = 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 == EmuConstants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) { + if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::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() <= EmuConstants::TEXT_LINK_BODY_LENGTH) { + if (segments[segment_iter].length() <= EQEmu::Constants::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 ((EmuConstants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (sofTextLink.find('\x12') == std::string::npos)) { + if ((EQEmu::Constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (sofTextLink.find('\x12') == std::string::npos)) { serverTextLink = sofTextLink; return; } diff --git a/common/patches/sof_constants.h b/common/patches/sof_constants.h index 4ffcdd525..f556ac9d4 100644 --- a/common/patches/sof_constants.h +++ b/common/patches/sof_constants.h @@ -1,7 +1,7 @@ /* EQEMu: Everquest Server Emulator -Copyright (C) 2001-2014 EQEMu Development Team (http://eqemulator.net) +Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,122 +25,119 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "../types.h" namespace SoF { - namespace maps { + namespace inventory { typedef enum : int16 { - // this needs work to match actual client equivilents - MapPossessions = 0, - MapBank, - MapSharedBank, - MapTrade, - MapWorld, - MapLimbo, - MapTribute, - MapTrophyTribute, - MapGuildTribute, - MapMerchant, - MapDeleted, - MapCorpse, - MapBazaar, - MapInspect, - MapRealEstate, - MapViewMODPC, - MapViewMODBank, - MapViewMODSharedBank, - MapViewMODLimbo, - MapAltStorage, - MapArchived, - MapMail, - MapGuildTrophyTribute, - MapOther, - _MapCount - } InventoryMaps; - } + TypePossessions = 0, + TypeBank, + TypeSharedBank, + TypeTrade, + TypeWorld, + TypeLimbo, + TypeTribute, + TypeTrophyTribute, + TypeGuildTribute, + TypeMerchant, + TypeDeleted, + TypeCorpse, + TypeBazaar, + TypeInspect, + TypeRealEstate, + TypeViewMODPC, + TypeViewMODBank, + TypeViewMODSharedBank, + TypeViewMODLimbo, + TypeAltStorage, + TypeArchived, + TypeMail, + TypeGuildTrophyTribute, + TypeOther, + TypeCount + } InventoryTypes; - namespace slots { typedef enum : int16 { - MainCharm = 0, - MainEar1, - MainHead, - MainFace, - MainEar2, - MainNeck, - MainShoulders, - MainArms, - MainBack, - MainWrist1, - MainWrist2, - MainRange, - MainHands, - MainPrimary, - MainSecondary, - MainFinger1, - MainFinger2, - MainChest, - MainLegs, - MainFeet, - MainWaist, - MainPowerSource, - MainAmmo, - MainGeneral1, - MainGeneral2, - MainGeneral3, - MainGeneral4, - MainGeneral5, - MainGeneral6, - MainGeneral7, - MainGeneral8, - MainCursor, - _MainCount, - _MainEquipmentBegin = MainCharm, - _MainEquipmentEnd = MainAmmo, - _MainEquipmentCount = (_MainEquipmentEnd - _MainEquipmentBegin + 1), - _MainGeneralBegin = MainGeneral1, - _MainGeneralEnd = MainGeneral8, - _MainGeneralCount = (_MainGeneralEnd - _MainGeneralBegin + 1) - } EquipmentSlots; + SlotCharm = 0, + SlotEar1, + SlotHead, + SlotFace, + SlotEar2, + SlotNeck, + SlotShoulders, + SlotArms, + SlotBack, + SlotWrist1, + SlotWrist2, + SlotRange, + SlotHands, + SlotPrimary, + SlotSecondary, + SlotFinger1, + SlotFinger2, + SlotChest, + SlotLegs, + SlotFeet, + SlotWaist, + SlotPowerSource, + SlotAmmo, + SlotGeneral1, + SlotGeneral2, + SlotGeneral3, + SlotGeneral4, + SlotGeneral5, + SlotGeneral6, + SlotGeneral7, + SlotGeneral8, + SlotCursor, + SlotCount, + SlotEquipmentBegin = SlotCharm, + SlotEquipmentEnd = SlotAmmo, + SlotEquipmentCount = (SlotEquipmentEnd - SlotEquipmentBegin + 1), + SlotGeneralBegin = SlotGeneral1, + SlotGeneralEnd = SlotGeneral8, + SlotGeneralCount = (SlotGeneralEnd - SlotGeneralBegin + 1) + } PossessionsSlots; } namespace consts { static const size_t CHARACTER_CREATION_LIMIT = 12; - static const uint16 MAP_POSSESSIONS_SIZE = slots::_MainCount; - static const uint16 MAP_BANK_SIZE = 24; - static const uint16 MAP_SHARED_BANK_SIZE = 2; - static const uint16 MAP_TRADE_SIZE = 8; - static const uint16 MAP_WORLD_SIZE = 10; - static const uint16 MAP_LIMBO_SIZE = 36; - static const uint16 MAP_TRIBUTE_SIZE = 0; //? - static const uint16 MAP_TROPHY_TRIBUTE_SIZE = 0; - static const uint16 MAP_GUILD_TRIBUTE_SIZE = 0; - static const uint16 MAP_MERCHANT_SIZE = 0; - static const uint16 MAP_DELETED_SIZE = 0; - static const uint16 MAP_CORPSE_SIZE = slots::_MainCount; - static const uint16 MAP_BAZAAR_SIZE = 80; - static const uint16 MAP_INSPECT_SIZE = slots::_MainEquipmentCount; - static const uint16 MAP_REAL_ESTATE_SIZE = 0; - static const uint16 MAP_VIEW_MOD_PC_SIZE = MAP_POSSESSIONS_SIZE; - static const uint16 MAP_VIEW_MOD_BANK_SIZE = MAP_BANK_SIZE; - static const uint16 MAP_VIEW_MOD_SHARED_BANK_SIZE = MAP_SHARED_BANK_SIZE; - static const uint16 MAP_VIEW_MOD_LIMBO_SIZE = MAP_LIMBO_SIZE; - static const uint16 MAP_ALT_STORAGE_SIZE = 0; - static const uint16 MAP_ARCHIVED_SIZE = 0; - static const uint16 MAP_MAIL_SIZE = 0; - static const uint16 MAP_GUILD_TROPHY_TRIBUTE_SIZE = 0; - static const uint16 MAP_KRONO_SIZE = NOT_USED; - static const uint16 MAP_OTHER_SIZE = 0; + static const uint16 TYPE_POSSESSIONS_SIZE = inventory::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 = 0; //? + 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 = inventory::SlotCount; + static const uint16 TYPE_BAZAAR_SIZE = 80; + static const uint16 TYPE_INSPECT_SIZE = inventory::SlotEquipmentCount; + static const uint16 TYPE_REAL_ESTATE_SIZE = 0; + static const uint16 TYPE_VIEW_MOD_PC_SIZE = TYPE_POSSESSIONS_SIZE; + static const uint16 TYPE_VIEW_MOD_BANK_SIZE = TYPE_BANK_SIZE; + static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = TYPE_SHARED_BANK_SIZE; + static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = TYPE_LIMBO_SIZE; + static const uint16 TYPE_ALT_STORAGE_SIZE = 0; + static const uint16 TYPE_ARCHIVED_SIZE = 0; + static const uint16 TYPE_MAIL_SIZE = 0; + static const uint16 TYPE_GUILD_TROPHY_TRIBUTE_SIZE = 0; + static const uint16 TYPE_KRONO_SIZE = NOT_USED; + static const uint16 TYPE_OTHER_SIZE = 0; - static const int16 EQUIPMENT_BEGIN = slots::MainCharm; - static const int16 EQUIPMENT_END = slots::MainAmmo; - static const uint16 EQUIPMENT_SIZE = slots::_MainEquipmentCount; + static const int16 EQUIPMENT_BEGIN = inventory::SlotCharm; + static const int16 EQUIPMENT_END = inventory::SlotAmmo; + static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount; - static const int16 GENERAL_BEGIN = slots::MainGeneral1; - static const int16 GENERAL_END = slots::MainGeneral8; - static const uint16 GENERAL_SIZE = slots::_MainGeneralCount; + static const int16 GENERAL_BEGIN = inventory::SlotGeneral1; + static const int16 GENERAL_END = inventory::SlotGeneral8; + static const uint16 GENERAL_SIZE = inventory::SlotGeneralCount; static const int16 GENERAL_BAGS_BEGIN = 262; static const int16 GENERAL_BAGS_END_OFFSET = 79; static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET; - static const int16 CURSOR = slots::MainCursor; + static const int16 CURSOR = inventory::SlotCursor; static const int16 CURSOR_BAG_BEGIN = 342; static const int16 CURSOR_BAG_END_OFFSET = 9; static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET; @@ -170,8 +167,8 @@ namespace SoF { static const int16 TRIBUTE_BEGIN = 400; static const int16 TRIBUTE_END = 404; - static const int16 CORPSE_BEGIN = slots::MainGeneral1; - static const int16 CORPSE_END = slots::MainGeneral1 + slots::MainCursor; + static const int16 CORPSE_BEGIN = inventory::SlotGeneral1; + static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor; static const uint16 ITEM_COMMON_SIZE = 5; static const uint16 ITEM_CONTAINER_SIZE = 10; diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index d3873dd97..248ab1c85 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 < EmuConstants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) { + for (r = 0; r < EQEmu::Constants::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 = EmuConstants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { + for (r = EQEmu::Constants::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 < EmuConstants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (r = 0; r < EQEmu::Constants::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 = EmuConstants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (r = EQEmu::Constants::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 < 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 < 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 < 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 < 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 == EmuConstants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) { + if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::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() <= EmuConstants::TEXT_LINK_BODY_LENGTH) { + if (segments[segment_iter].length() <= EQEmu::Constants::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 ((EmuConstants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (titaniumTextLink.find('\x12') == std::string::npos)) { + if ((EQEmu::Constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (titaniumTextLink.find('\x12') == std::string::npos)) { serverTextLink = titaniumTextLink; return; } diff --git a/common/patches/titanium_constants.h b/common/patches/titanium_constants.h index 4915c829c..b0a7353fa 100644 --- a/common/patches/titanium_constants.h +++ b/common/patches/titanium_constants.h @@ -1,7 +1,7 @@ /* EQEMu: Everquest Server Emulator -Copyright (C) 2001-2014 EQEMu Development Team (http://eqemulator.net) +Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,121 +25,118 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "../types.h" namespace Titanium { - namespace maps { + namespace inventory { typedef enum : int16 { - // this needs work to match actual client equivilents - MapPossessions = 0, - MapBank, - MapSharedBank, - MapTrade, - MapWorld, - MapLimbo, - MapTribute, - MapTrophyTribute, - MapGuildTribute, - MapMerchant, - MapDeleted, - MapCorpse, - MapBazaar, - MapInspect, - MapRealEstate, - MapViewMODPC, - MapViewMODBank, - MapViewMODSharedBank, - MapViewMODLimbo, - MapAltStorage, - MapArchived, - MapMail, - MapGuildTrophyTribute, - MapOther, - _MapCount - } InventoryMaps; - } + TypePossessions = 0, + TypeBank, + TypeSharedBank, + TypeTrade, + TypeWorld, + TypeLimbo, + TypeTribute, + TypeTrophyTribute, + TypeGuildTribute, + TypeMerchant, + TypeDeleted, + TypeCorpse, + TypeBazaar, + TypeInspect, + TypeRealEstate, + TypeViewMODPC, + TypeViewMODBank, + TypeViewMODSharedBank, + TypeViewMODLimbo, + TypeAltStorage, + TypeArchived, + TypeMail, + TypeGuildTrophyTribute, + TypeOther, + TypeCount + } InventoryTypes; - namespace slots { typedef enum : int16 { - MainCharm = 0, - MainEar1, - MainHead, - MainFace, - MainEar2, - MainNeck, - MainShoulders, - MainArms, - MainBack, - MainWrist1, - MainWrist2, - MainRange, - MainHands, - MainPrimary, - MainSecondary, - MainFinger1, - MainFinger2, - MainChest, - MainLegs, - MainFeet, - MainWaist, - MainAmmo, - MainGeneral1, - MainGeneral2, - MainGeneral3, - MainGeneral4, - MainGeneral5, - MainGeneral6, - MainGeneral7, - MainGeneral8, - MainCursor, - _MainCount, - _MainEquipmentBegin = MainCharm, - _MainEquipmentEnd = MainAmmo, - _MainEquipmentCount = (_MainEquipmentEnd - _MainEquipmentBegin + 1), - _MainGeneralBegin = MainGeneral1, - _MainGeneralEnd = MainGeneral8, - _MainGeneralCount = (_MainGeneralEnd - _MainGeneralBegin + 1) - } EquipmentSlots; + SlotCharm = 0, + SlotEar1, + SlotHead, + SlotFace, + SlotEar2, + SlotNeck, + SlotShoulders, + SlotArms, + SlotBack, + SlotWrist1, + SlotWrist2, + SlotRange, + SlotHands, + SlotPrimary, + SlotSecondary, + SlotFinger1, + SlotFinger2, + SlotChest, + SlotLegs, + SlotFeet, + SlotWaist, + SlotAmmo, + SlotGeneral1, + SlotGeneral2, + SlotGeneral3, + SlotGeneral4, + SlotGeneral5, + SlotGeneral6, + SlotGeneral7, + SlotGeneral8, + SlotCursor, + SlotCount, + SlotEquipmentBegin = SlotCharm, + SlotEquipmentEnd = SlotAmmo, + SlotEquipmentCount = (SlotEquipmentEnd - SlotEquipmentBegin + 1), + SlotGeneralBegin = SlotGeneral1, + SlotGeneralEnd = SlotGeneral8, + SlotGeneralCount = (SlotGeneralEnd - SlotGeneralBegin + 1) + } PossessionsSlots; } namespace consts { static const size_t CHARACTER_CREATION_LIMIT = 8; // Hard-coded in client - DO NOT ALTER - static const uint16 MAP_POSSESSIONS_SIZE = slots::_MainCount; - static const uint16 MAP_BANK_SIZE = 16; - static const uint16 MAP_SHARED_BANK_SIZE = 2; - static const uint16 MAP_TRADE_SIZE = 8; - static const uint16 MAP_WORLD_SIZE = 10; - static const uint16 MAP_LIMBO_SIZE = 36; - static const uint16 MAP_TRIBUTE_SIZE = 0; //? - static const uint16 MAP_TROPHY_TRIBUTE_SIZE = 0; - static const uint16 MAP_GUILD_TRIBUTE_SIZE = 0; - static const uint16 MAP_MERCHANT_SIZE = 0; - static const uint16 MAP_DELETED_SIZE = 0; - static const uint16 MAP_CORPSE_SIZE = slots::_MainCount; - static const uint16 MAP_BAZAAR_SIZE = 80; - static const uint16 MAP_INSPECT_SIZE = slots::_MainEquipmentCount; - static const uint16 MAP_REAL_ESTATE_SIZE = 0; - static const uint16 MAP_VIEW_MOD_PC_SIZE = MAP_POSSESSIONS_SIZE; - static const uint16 MAP_VIEW_MOD_BANK_SIZE = MAP_BANK_SIZE; - static const uint16 MAP_VIEW_MOD_SHARED_BANK_SIZE = MAP_SHARED_BANK_SIZE; - static const uint16 MAP_VIEW_MOD_LIMBO_SIZE = MAP_LIMBO_SIZE; - static const uint16 MAP_ALT_STORAGE_SIZE = 0; - static const uint16 MAP_ARCHIVED_SIZE = 0; - static const uint16 MAP_MAIL_SIZE = 0; - static const uint16 MAP_GUILD_TROPHY_TRIBUTE_SIZE = 0; - static const uint16 MAP_KRONO_SIZE = NOT_USED; - static const uint16 MAP_OTHER_SIZE = 0; + static const uint16 TYPE_POSSESSIONS_SIZE = inventory::SlotCount; + static const uint16 TYPE_BANK_SIZE = 16; + 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 = 0; //? + 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 = inventory::SlotCount; + static const uint16 TYPE_BAZAAR_SIZE = 80; + static const uint16 TYPE_INSPECT_SIZE = inventory::SlotEquipmentCount; + static const uint16 TYPE_REAL_ESTATE_SIZE = 0; + static const uint16 TYPE_VIEW_MOD_PC_SIZE = TYPE_POSSESSIONS_SIZE; + static const uint16 TYPE_VIEW_MOD_BANK_SIZE = TYPE_BANK_SIZE; + static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = TYPE_SHARED_BANK_SIZE; + static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = TYPE_LIMBO_SIZE; + static const uint16 TYPE_ALT_STORAGE_SIZE = 0; + static const uint16 TYPE_ARCHIVED_SIZE = 0; + static const uint16 TYPE_MAIL_SIZE = 0; + static const uint16 TYPE_GUILD_TROPHY_TRIBUTE_SIZE = 0; + static const uint16 TYPE_KRONO_SIZE = NOT_USED; + static const uint16 TYPE_OTHER_SIZE = 0; - static const int16 EQUIPMENT_BEGIN = slots::MainCharm; - static const int16 EQUIPMENT_END = slots::MainAmmo; - static const uint16 EQUIPMENT_SIZE = slots::_MainEquipmentCount; + static const int16 EQUIPMENT_BEGIN = inventory::SlotCharm; + static const int16 EQUIPMENT_END = inventory::SlotAmmo; + static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount; - static const int16 GENERAL_BEGIN = slots::MainGeneral1; - static const int16 GENERAL_END = slots::MainGeneral8; - static const uint16 GENERAL_SIZE = slots::_MainGeneralCount; + static const int16 GENERAL_BEGIN = inventory::SlotGeneral1; + static const int16 GENERAL_END = inventory::SlotGeneral8; + static const uint16 GENERAL_SIZE = inventory::SlotGeneralCount; static const int16 GENERAL_BAGS_BEGIN = 251; static const int16 GENERAL_BAGS_END_OFFSET = 79; static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET; - static const int16 CURSOR = slots::MainCursor; + static const int16 CURSOR = inventory::SlotCursor; static const int16 CURSOR_BAG_BEGIN = 331; static const int16 CURSOR_BAG_END_OFFSET = 9; static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET; @@ -169,8 +166,8 @@ namespace Titanium { static const int16 TRIBUTE_BEGIN = 400; static const int16 TRIBUTE_END = 404; - static const int16 CORPSE_BEGIN = slots::MainGeneral1; - static const int16 CORPSE_END = slots::MainGeneral1 + slots::MainCursor; + static const int16 CORPSE_BEGIN = inventory::SlotGeneral1; + static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor; static const uint16 ITEM_COMMON_SIZE = 5; static const uint16 ITEM_CONTAINER_SIZE = 10; diff --git a/common/patches/uf.cpp b/common/patches/uf.cpp index bc7d2906c..b7d88394c 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 < EmuConstants::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) { + for (r = 0; r < EQEmu::Constants::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 = EmuConstants::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) { + for (r = EQEmu::Constants::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 < EmuConstants::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (r = 0; r < EQEmu::Constants::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 = EmuConstants::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) { + for (r = EQEmu::Constants::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 < 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; @@ -4263,7 +4263,7 @@ namespace UF uint32 SubLengths[10]; - for (int x = SUB_BEGIN; x < EmuConstants::ITEM_CONTAINER_SIZE; ++x) { + for (int x = SUB_BEGIN; x < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++x) { SubSerializations[x] = nullptr; @@ -4275,15 +4275,15 @@ namespace UF iqbs.subitem_count++; - if (slot_id_in >= EmuConstants::GENERAL_BEGIN && slot_id_in <= EmuConstants::GENERAL_END) // (< 30) - no cursor? + if (slot_id_in >= EQEmu::Constants::GENERAL_BEGIN && slot_id_in <= EQEmu::Constants::GENERAL_END) // (< 30) - no cursor? //SubSlotNumber = (((slot_id_in + 3) * 10) + x + 1); - SubSlotNumber = (((slot_id_in + 3) * EmuConstants::ITEM_CONTAINER_SIZE) + x + 1); - else if (slot_id_in >= EmuConstants::BANK_BEGIN && slot_id_in <= EmuConstants::BANK_END) + 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 - 2000) * 10) + 2030 + x + 1); - SubSlotNumber = (((slot_id_in - EmuConstants::BANK_BEGIN) * EmuConstants::ITEM_CONTAINER_SIZE) + EmuConstants::BANK_BAGS_BEGIN + x); - else if (slot_id_in >= EmuConstants::SHARED_BANK_BEGIN && slot_id_in <= EmuConstants::SHARED_BANK_END) + 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 - 2500) * 10) + 2530 + x + 1); - SubSlotNumber = (((slot_id_in - EmuConstants::SHARED_BANK_BEGIN) * EmuConstants::ITEM_CONTAINER_SIZE) + EmuConstants::SHARED_BANK_BAGS_BEGIN + x); + SubSlotNumber = (((slot_id_in - EQEmu::Constants::SHARED_BANK_BEGIN) * EQEmu::Constants::ITEM_CONTAINER_SIZE) + EQEmu::Constants::SHARED_BANK_BAGS_BEGIN + x); else SubSlotNumber = slot_id_in; // ??????? @@ -4322,16 +4322,16 @@ namespace UF { uint32 UnderfootSlot = 0; - if (serverSlot >= MainAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots + if (serverSlot >= SlotAmmo && serverSlot <= 53) // Cursor/Ammo/Power Source and Normal Inventory Slots UnderfootSlot = serverSlot + 1; - else if (serverSlot >= EmuConstants::GENERAL_BAGS_BEGIN && serverSlot <= EmuConstants::CURSOR_BAG_END) + else if (serverSlot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::Constants::CURSOR_BAG_END) UnderfootSlot = serverSlot + 11; - else if (serverSlot >= EmuConstants::BANK_BAGS_BEGIN && serverSlot <= EmuConstants::BANK_BAGS_END) + else if (serverSlot >= EQEmu::Constants::BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::BANK_BAGS_END) UnderfootSlot = serverSlot + 1; - else if (serverSlot >= EmuConstants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EmuConstants::SHARED_BANK_BAGS_END) + else if (serverSlot >= EQEmu::Constants::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::Constants::SHARED_BANK_BAGS_END) UnderfootSlot = serverSlot + 1; - else if (serverSlot == MainPowerSource) - UnderfootSlot = slots::MainPowerSource; + else if (serverSlot == SlotPowerSource) + UnderfootSlot = inventory::SlotPowerSource; else UnderfootSlot = serverSlot; @@ -4348,7 +4348,7 @@ namespace UF { uint32 ServerSlot = 0; - if (ufSlot >= slots::MainAmmo && ufSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots + if (ufSlot >= inventory::SlotAmmo && ufSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots ServerSlot = ufSlot - 1; else if (ufSlot >= consts::GENERAL_BAGS_BEGIN && ufSlot <= consts::CURSOR_BAG_END) ServerSlot = ufSlot - 11; @@ -4356,8 +4356,8 @@ namespace UF ServerSlot = ufSlot - 1; else if (ufSlot >= consts::SHARED_BANK_BAGS_BEGIN && ufSlot <= consts::SHARED_BANK_BAGS_END) ServerSlot = ufSlot - 1; - else if (ufSlot == slots::MainPowerSource) - ServerSlot = MainPowerSource; + else if (ufSlot == inventory::SlotPowerSource) + ServerSlot = 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 == EmuConstants::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) { + if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::Constants::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() <= EmuConstants::TEXT_LINK_BODY_LENGTH) { + if (segments[segment_iter].length() <= EQEmu::Constants::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 ((EmuConstants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (ufTextLink.find('\x12') == std::string::npos)) { + if ((EQEmu::Constants::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (ufTextLink.find('\x12') == std::string::npos)) { serverTextLink = ufTextLink; return; } diff --git a/common/patches/uf_constants.h b/common/patches/uf_constants.h index b8096fd58..d254e66f6 100644 --- a/common/patches/uf_constants.h +++ b/common/patches/uf_constants.h @@ -1,7 +1,7 @@ /* EQEMu: Everquest Server Emulator -Copyright (C) 2001-2014 EQEMu Development Team (http://eqemulator.net) +Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,122 +25,119 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "../types.h" namespace UF { - namespace maps { + namespace inventory { typedef enum : int16 { - // this needs work to match actual client equivilents - MapPossessions = 0, - MapBank, - MapSharedBank, - MapTrade, - MapWorld, - MapLimbo, - MapTribute, - MapTrophyTribute, - MapGuildTribute, - MapMerchant, - MapDeleted, - MapCorpse, - MapBazaar, - MapInspect, - MapRealEstate, - MapViewMODPC, - MapViewMODBank, - MapViewMODSharedBank, - MapViewMODLimbo, - MapAltStorage, - MapArchived, - MapMail, - MapGuildTrophyTribute, - MapOther, - _MapCount - } InventoryMaps; - } + TypePossessions = 0, + TypeBank, + TypeSharedBank, + TypeTrade, + TypeWorld, + TypeLimbo, + TypeTribute, + TypeTrophyTribute, + TypeGuildTribute, + TypeMerchant, + TypeDeleted, + TypeCorpse, + TypeBazaar, + TypeInspect, + TypeRealEstate, + TypeViewMODPC, + TypeViewMODBank, + TypeViewMODSharedBank, + TypeViewMODLimbo, + TypeAltStorage, + TypeArchived, + TypeMail, + TypeGuildTrophyTribute, + TypeOther, + TypeCount + } InventoryTypes; - namespace slots { typedef enum : int16 { - MainCharm = 0, - MainEar1, - MainHead, - MainFace, - MainEar2, - MainNeck, - MainShoulders, - MainArms, - MainBack, - MainWrist1, - MainWrist2, - MainRange, - MainHands, - MainPrimary, - MainSecondary, - MainFinger1, - MainFinger2, - MainChest, - MainLegs, - MainFeet, - MainWaist, - MainPowerSource, - MainAmmo, - MainGeneral1, - MainGeneral2, - MainGeneral3, - MainGeneral4, - MainGeneral5, - MainGeneral6, - MainGeneral7, - MainGeneral8, - MainCursor, - _MainCount, - _MainEquipmentBegin = MainCharm, - _MainEquipmentEnd = MainAmmo, - _MainEquipmentCount = (_MainEquipmentEnd - _MainEquipmentBegin + 1), - _MainGeneralBegin = MainGeneral1, - _MainGeneralEnd = MainGeneral8, - _MainGeneralCount = (_MainGeneralEnd - _MainGeneralBegin + 1) - } EquipmentSlots; + SlotCharm = 0, + SlotEar1, + SlotHead, + SlotFace, + SlotEar2, + SlotNeck, + SlotShoulders, + SlotArms, + SlotBack, + SlotWrist1, + SlotWrist2, + SlotRange, + SlotHands, + SlotPrimary, + SlotSecondary, + SlotFinger1, + SlotFinger2, + SlotChest, + SlotLegs, + SlotFeet, + SlotWaist, + SlotPowerSource, + SlotAmmo, + SlotGeneral1, + SlotGeneral2, + SlotGeneral3, + SlotGeneral4, + SlotGeneral5, + SlotGeneral6, + SlotGeneral7, + SlotGeneral8, + SlotCursor, + SlotCount, + SlotEquipmentBegin = SlotCharm, + SlotEquipmentEnd = SlotAmmo, + SlotEquipmentCount = (SlotEquipmentEnd - SlotEquipmentBegin + 1), + SlotGeneralBegin = SlotGeneral1, + SlotGeneralEnd = SlotGeneral8, + SlotGeneralCount = (SlotGeneralEnd - SlotGeneralBegin + 1) + } PossessionsSlots; } namespace consts { static const size_t CHARACTER_CREATION_LIMIT = 12; - static const uint16 MAP_POSSESSIONS_SIZE = slots::_MainCount; - static const uint16 MAP_BANK_SIZE = 24; - static const uint16 MAP_SHARED_BANK_SIZE = 2; - static const uint16 MAP_TRADE_SIZE = 8; - static const uint16 MAP_WORLD_SIZE = 10; - static const uint16 MAP_LIMBO_SIZE = 36; - static const uint16 MAP_TRIBUTE_SIZE = 0; //? - static const uint16 MAP_TROPHY_TRIBUTE_SIZE = 0; - static const uint16 MAP_GUILD_TRIBUTE_SIZE = 0; - static const uint16 MAP_MERCHANT_SIZE = 0; - static const uint16 MAP_DELETED_SIZE = 0; - static const uint16 MAP_CORPSE_SIZE = slots::_MainCount; - static const uint16 MAP_BAZAAR_SIZE = 80; - static const uint16 MAP_INSPECT_SIZE = slots::_MainEquipmentCount; - static const uint16 MAP_REAL_ESTATE_SIZE = 0; - static const uint16 MAP_VIEW_MOD_PC_SIZE = MAP_POSSESSIONS_SIZE; - static const uint16 MAP_VIEW_MOD_BANK_SIZE = MAP_BANK_SIZE; - static const uint16 MAP_VIEW_MOD_SHARED_BANK_SIZE = MAP_SHARED_BANK_SIZE; - static const uint16 MAP_VIEW_MOD_LIMBO_SIZE = MAP_LIMBO_SIZE; - static const uint16 MAP_ALT_STORAGE_SIZE = 0; - static const uint16 MAP_ARCHIVED_SIZE = 0; - static const uint16 MAP_MAIL_SIZE = 0; - static const uint16 MAP_GUILD_TROPHY_TRIBUTE_SIZE = 0; - static const uint16 MAP_KRONO_SIZE = NOT_USED; - static const uint16 MAP_OTHER_SIZE = 0; + static const uint16 TYPE_POSSESSIONS_SIZE = inventory::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 = 0; //? + 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 = inventory::SlotCount; + static const uint16 TYPE_BAZAAR_SIZE = 80; + static const uint16 TYPE_INSPECT_SIZE = inventory::SlotEquipmentCount; + static const uint16 TYPE_REAL_ESTATE_SIZE = 0; + static const uint16 TYPE_VIEW_MOD_PC_SIZE = TYPE_POSSESSIONS_SIZE; + static const uint16 TYPE_VIEW_MOD_BANK_SIZE = TYPE_BANK_SIZE; + static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = TYPE_SHARED_BANK_SIZE; + static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = TYPE_LIMBO_SIZE; + static const uint16 TYPE_ALT_STORAGE_SIZE = 0; + static const uint16 TYPE_ARCHIVED_SIZE = 0; + static const uint16 TYPE_MAIL_SIZE = 0; + static const uint16 TYPE_GUILD_TROPHY_TRIBUTE_SIZE = 0; + static const uint16 TYPE_KRONO_SIZE = NOT_USED; + static const uint16 TYPE_OTHER_SIZE = 0; - static const int16 EQUIPMENT_BEGIN = slots::MainCharm; - static const int16 EQUIPMENT_END = slots::MainAmmo; - static const uint16 EQUIPMENT_SIZE = slots::_MainEquipmentCount; + static const int16 EQUIPMENT_BEGIN = inventory::SlotCharm; + static const int16 EQUIPMENT_END = inventory::SlotAmmo; + static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount; - static const int16 GENERAL_BEGIN = slots::MainGeneral1; - static const int16 GENERAL_END = slots::MainGeneral8; - static const uint16 GENERAL_SIZE = slots::_MainGeneralCount; + static const int16 GENERAL_BEGIN = inventory::SlotGeneral1; + static const int16 GENERAL_END = inventory::SlotGeneral8; + static const uint16 GENERAL_SIZE = inventory::SlotGeneralCount; static const int16 GENERAL_BAGS_BEGIN = 262; static const int16 GENERAL_BAGS_END_OFFSET = 79; static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET; - static const int16 CURSOR = slots::MainCursor; + static const int16 CURSOR = inventory::SlotCursor; static const int16 CURSOR_BAG_BEGIN = 342; static const int16 CURSOR_BAG_END_OFFSET = 9; static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET; @@ -170,8 +167,8 @@ namespace UF { static const int16 TRIBUTE_BEGIN = 400; static const int16 TRIBUTE_END = 404; - static const int16 CORPSE_BEGIN = slots::MainGeneral1; - static const int16 CORPSE_END = slots::MainGeneral1 + slots::MainCursor; + static const int16 CORPSE_BEGIN = inventory::SlotGeneral1; + static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor; static const uint16 ITEM_COMMON_SIZE = 5; static const uint16 ITEM_CONTAINER_SIZE = 10; diff --git a/common/shareddb.cpp b/common/shareddb.cpp index efe7358db..e9536d9a3 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, MainCursor, - EmuConstants::CURSOR_BAG_BEGIN, EmuConstants::CURSOR_BAG_END); + char_id, SlotCursor, + EQEmu::Constants::CURSOR_BAG_BEGIN, EQEmu::Constants::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) ? MainCursor : i; + int16 use_slot = (i == 8000) ? 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 >= EmuConstants::TRIBUTE_BEGIN && slot_id <= EmuConstants::TRIBUTE_END) + if (slot_id >= EQEmu::Constants::TRIBUTE_BEGIN && slot_id <= EQEmu::Constants::TRIBUTE_END) return true; - if (slot_id >= EmuConstants::SHARED_BANK_BEGIN && slot_id <= EmuConstants::SHARED_BANK_BAGS_END) { + if (slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && slot_id <= EQEmu::Constants::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[EmuConstants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; + uint32 augslot[EQEmu::Constants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; if (inst->IsType(ItemClassCommon)) { - for (int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) { + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; idx < inst->GetItem()->BagSlots && idx < EmuConstants::ITEM_CONTAINER_SIZE; idx++) { + for (uint8 idx = SUB_BEGIN; idx < inst->GetItem()->BagSlots && idx < EQEmu::Constants::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[EmuConstants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; + uint32 augslot[EQEmu::Constants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; if (inst->IsType(ItemClassCommon)) { - for (int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) { + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; idx < inst->GetItem()->BagSlots && idx < EmuConstants::ITEM_CONTAINER_SIZE; idx++) { + for (uint8 idx = SUB_BEGIN; idx < inst->GetItem()->BagSlots && idx < EQEmu::Constants::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[EmuConstants::ITEM_COMMON_SIZE]; + uint32 aug[EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) { + for (int i = AUG_BEGIN; i < EQEmu::Constants::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[EmuConstants::ITEM_COMMON_SIZE]; + uint32 aug[EQEmu::Constants::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 >= EmuConstants::EQUIPMENT_BEGIN && slot_id <= EmuConstants::EQUIPMENT_END) || - slot_id == MainPowerSource) && + (((slot_id >= EQEmu::Constants::EQUIPMENT_BEGIN && slot_id <= EQEmu::Constants::EQUIPMENT_END) || + slot_id == 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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) { + for (int i = AUG_BEGIN; i < EQEmu::Constants::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[EmuConstants::ITEM_COMMON_SIZE]; + uint32 aug[EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) { + for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) { if (aug[i]) inst->PutAugment(this, i, aug[i]); } diff --git a/world/client.cpp b/world/client.cpp index d0ecac3c2..836b4c45b 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -211,9 +211,9 @@ void Client::SendMaxCharCreate() { auto outapp = new EQApplicationPacket(OP_SendMaxCharacters, sizeof(MaxCharacters_Struct)); MaxCharacters_Struct* mc = (MaxCharacters_Struct*)outapp->pBuffer; - mc->max_chars = EQLimits::CharacterCreationLimit(m_ClientVersion); - if (mc->max_chars > EmuConstants::CHARACTER_CREATION_LIMIT) - mc->max_chars = EmuConstants::CHARACTER_CREATION_LIMIT; + mc->max_chars = EQEmu::Limits::CharacterCreationLimit(m_ClientVersion); + if (mc->max_chars > EQEmu::Constants::CHARACTER_CREATION_LIMIT) + mc->max_chars = EQEmu::Constants::CHARACTER_CREATION_LIMIT; QueuePacket(outapp); safe_delete(outapp); @@ -746,8 +746,8 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { // This can probably be moved outside and have another method return requested info (don't forget to remove the #include "../common/shareddb.h" above) // (This is a literal translation of the original process..I don't see why it can't be changed to a single-target query over account iteration) if (!pZoning) { - size_t character_limit = EQLimits::CharacterCreationLimit(eqs->GetClientVersion()); - if (character_limit > EmuConstants::CHARACTER_CREATION_LIMIT) { character_limit = EmuConstants::CHARACTER_CREATION_LIMIT; } + size_t character_limit = EQEmu::Limits::CharacterCreationLimit(eqs->GetClientVersion()); + if (character_limit > EQEmu::Constants::CHARACTER_CREATION_LIMIT) { character_limit = EQEmu::Constants::CHARACTER_CREATION_LIMIT; } if (eqs->GetClientVersion() == ClientVersion::Titanium) { character_limit = 8; } std::string tgh_query = StringFormat( diff --git a/world/worlddb.cpp b/world/worlddb.cpp index 357ab3c33..cd73d9c7c 100644 --- a/world/worlddb.cpp +++ b/world/worlddb.cpp @@ -37,11 +37,11 @@ void WorldDatabase::GetCharSelectInfo(uint32 accountID, EQApplicationPacket **ou { /* Set Character Creation Limit */ ClientVersion client_version = ClientVersionFromBit(clientVersionBit); - size_t character_limit = EQLimits::CharacterCreationLimit(client_version); + size_t character_limit = EQEmu::Limits::CharacterCreationLimit(client_version); // Validate against absolute server max - if (character_limit > EmuConstants::CHARACTER_CREATION_LIMIT) - character_limit = EmuConstants::CHARACTER_CREATION_LIMIT; + if (character_limit > EQEmu::Constants::CHARACTER_CREATION_LIMIT) + character_limit = EQEmu::Constants::CHARACTER_CREATION_LIMIT; // Force Titanium clients to use '8' if (client_version == ClientVersion::Titanium) @@ -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 < 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 < MaterialCount; matslot++) { invslot = Inventory::CalcSlotFromMaterial(matslot); if (invslot == INVALID_INDEX) { continue; } inst = inv.GetItem(invslot); diff --git a/zone/aa.cpp b/zone/aa.cpp index 403f9755d..229683550 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -419,7 +419,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 = EmuConstants::EQUIPMENT_BEGIN; x <= EmuConstants::EQUIPMENT_END; x++) // (< 21) added MainAmmo + for (int x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= EQEmu::Constants::EQUIPMENT_END; x++) // (< 21) added MainAmmo { uint32 sitem = 0; sitem = CorpseToUse->GetWornItem(x); diff --git a/zone/attack.cpp b/zone/attack.cpp index 786eb128a..d831631c6 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 == MainSecondary) // DW anim + if (Hand == 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 != MainRange && CanThisClassRiposte() && InFront && !ImmuneRipo) { + if (hand != 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 == MainSecondary) { + if (hand == 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 != MainRange) { + if (CanThisClassParry() && InFront && hand != 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(MainHands); + const ItemInst *gloves = CastToClient()->GetInv().GetItem(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 == MainSecondary){ // Kaiyodo - Pick weapon from the attacking hand - weapon = GetInv().GetItem(MainSecondary); + if (Hand == SlotSecondary){ // Kaiyodo - Pick weapon from the attacking hand + weapon = GetInv().GetItem(SlotSecondary); OffHandAtk(true); } else{ - weapon = GetInv().GetItem(MainPrimary); + weapon = GetInv().GetItem(SlotPrimary); OffHandAtk(false); } @@ -1146,7 +1146,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b int ucDamageBonus = 0; - if( Hand == MainPrimary && GetLevel() >= 28 && IsWarriorClass() ) + if( Hand == 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 == MainSecondary) { + if (Hand == 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 == MainPrimary) { + if (Hand == SlotPrimary) { skillinuse = static_cast(GetPrimSkill()); OffHandAtk(false); } - if (Hand == MainSecondary) { + if (Hand == SlotSecondary) { skillinuse = static_cast(GetSecSkill()); OffHandAtk(true); } //figure out what weapon they are using, if any const Item_Struct* weapon = nullptr; - if (Hand == MainPrimary && equipment[MainPrimary] > 0) - weapon = database.GetItem(equipment[MainPrimary]); - else if (equipment[MainSecondary]) - weapon = database.GetItem(equipment[MainSecondary]); + if (Hand == SlotPrimary && equipment[SlotPrimary] > 0) + weapon = database.GetItem(equipment[SlotPrimary]); + else if (equipment[SlotSecondary]) + weapon = database.GetItem(equipment[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 == MainSecondary && weapon->ItemType == ItemTypeShield){ + if(Hand == 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 != MainPrimary) + if(hand != 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 != MainPrimary) //Is Archery intened to proc at 50% rate? + if (hand != 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 < EmuConstants::ITEM_COMMON_SIZE; r++) { + for (int r = 0; r < EQEmu::Constants::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 != MainPrimary) //Is Archery intened to proc at 50% rate? + if (hand != SlotPrimary) //Is Archery intened to proc at 50% rate? ProcChance /= 2; bool rangedattk = false; - if (weapon && hand == MainRange) { + if (weapon && hand == 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 == MainRange && GetSpecialAbility(SPECATK_RANGED_ATK)) + if (!weapon && hand == SlotRange && GetSpecialAbility(SPECATK_RANGED_ATK)) rangedattk = true; for (uint32 i = 0; i < MAX_PROCS; i++) { - if (IsPet() && hand != MainPrimary) //Pets can only proc spell procs from their primay hand (ie; beastlord pets) + if (IsPet() && hand != 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 != MainRange){ //We check ranged skill procs within the attack functions. + if (HasSkillProcs() && hand != 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, MainPrimary, true); + defender->Attack(this, 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, MainPrimary, true); + defender->Attack(this, 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, MainPrimary, true); + defender->Attack(this, 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 != MainPrimary) + if (hand != SlotPrimary) ProcChance /= 2; } @@ -4515,13 +4515,13 @@ void Client::SetAttackTimer() Timer *TimerToUse = nullptr; - for (int i = MainRange; i <= MainSecondary; i++) { + for (int i = SlotRange; i <= SlotSecondary; i++) { //pick a timer - if (i == MainPrimary) + if (i == SlotPrimary) TimerToUse = &attack_timer; - else if (i == MainRange) + else if (i == SlotRange) TimerToUse = &ranged_timer; - else if (i == MainSecondary) + else if (i == 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 == MainSecondary) { + if (i == 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 = MainRange; i <= MainSecondary; i++) { + for (int i = SlotRange; i <= SlotSecondary; i++) { //pick a timer - if (i == MainPrimary) + if (i == SlotPrimary) TimerToUse = &attack_timer; - else if (i == MainRange) + else if (i == SlotRange) TimerToUse = &ranged_timer; - else if (i == MainSecondary) + else if (i == SlotSecondary) TimerToUse = &attack_dw_timer; else //invalid slot (hands will always hit this) continue; //special offhand stuff - if (i == MainSecondary) { + if (i == 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 == MainSecondary) + if (candouble && hand == 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 == MainPrimary && CanThisClassTripleAttack()) { + if (hand == 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 == MainPrimary) { + if (hand == 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, MainPrimary, false, false, false, opts, special); + Attack(target, SlotPrimary, false, false, false, opts, special); if (CanThisClassDoubleAttack() && CheckDoubleAttack()){ - Attack(target, MainPrimary, false, false, false, opts, special); + Attack(target, 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, MainPrimary, false, false, false, opts, special); + Attack(target, SlotPrimary, false, false, false, opts, special); } else { for (int i = 0; i < n_atk; ++i) { - Attack(target, MainPrimary, false, false, false, opts, special); + Attack(target, SlotPrimary, false, false, false, opts, special); } } } else { - Attack(target, MainPrimary, false, false, false, opts, special); + Attack(target, 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, MainPrimary, false, false, false, opts, special); + Attack(target, 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, MainPrimary, false, false, false, opts, special); + Attack(target, SlotPrimary, false, false, false, opts, special); // now lets check the quad attack if (GetSpecialAbility(SPECATK_QUAD) && RandRoll < (GetLevel() + NPCQuadAttackModifier)) { - Attack(target, MainPrimary, false, false, false, opts, special); + Attack(target, SlotPrimary, false, false, false, opts, special); } } } @@ -4769,9 +4769,9 @@ void Mob::DoOffHandAttackRounds(Mob *target, ExtraAttackOptions *opts, int speci (RuleB(Combat, UseLiveCombatRounds) && GetSpecialAbility(SPECATK_QUAD))) || GetEquipment(MaterialSecondary) != 0) { if (CheckDualWield()) { - Attack(target, MainSecondary, false, false, false, opts, special); + Attack(target, SlotSecondary, false, false, false, opts, special); if (CanThisClassDoubleAttack() && GetLevel() > 35 && CheckDoubleAttack()){ - Attack(target, MainSecondary, false, false, false, opts, special); + Attack(target, 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 a35f6a1ed..ed59ee7c9 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 = MainPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false, + virtual bool Attack(Mob* other, int Hand = 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 f57e92247..57fc3da48 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -145,34 +145,34 @@ void Client::CalcItemBonuses(StatBonuses* newbon) { unsigned int i; // Update: MainAmmo should only calc skill mods (TODO: Check for other cases) - for (i = MainCharm; i <= MainAmmo; i++) { + for (i = SlotCharm; i <= SlotAmmo; i++) { const ItemInst* inst = m_inv[i]; if(inst == 0) continue; - AddItemBonuses(inst, newbon, false, false, 0, (i == MainAmmo)); + AddItemBonuses(inst, newbon, false, false, 0, (i == 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 == MainSecondary && (item && item->ItemType == ItemTypeShield)) + if (i == SlotSecondary && (item && item->ItemType == ItemTypeShield)) SetShieldEquiped(true); - else if (i == MainPrimary && (item && item->ItemType == ItemType2HBlunt)) { + else if (i == SlotPrimary && (item && item->ItemType == ItemType2HBlunt)) { SetTwoHandBluntEquiped(true); SetTwoHanderEquipped(true); - } else if (i == MainPrimary && (item && (item->ItemType == ItemType2HSlash || item->ItemType == ItemType2HPiercing))) + } else if (i == SlotPrimary && (item && (item->ItemType == ItemType2HSlash || item->ItemType == ItemType2HPiercing))) SetTwoHanderEquipped(true); } //Power Source Slot if (GetClientVersion() >= ClientVersion::SoF) { - const ItemInst* inst = m_inv[MainPowerSource]; + const ItemInst* inst = m_inv[SlotPowerSource]; if(inst) AddItemBonuses(inst, newbon); } //tribute items - for (i = 0; i < EmuConstants::TRIBUTE_SIZE; i++) { - const ItemInst* inst = m_inv[EmuConstants::TRIBUTE_BEGIN + i]; + for (i = 0; i < EQEmu::Constants::TRIBUTE_SIZE; i++) { + const ItemInst* inst = m_inv[EQEmu::Constants::TRIBUTE_BEGIN + i]; if(inst == 0) continue; AddItemBonuses(inst, newbon, false, true); @@ -180,7 +180,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 = MainCharm; i < MainAmmo; i++) { + for (i = SlotCharm; i < SlotAmmo; i++) { const ItemInst* inst = m_inv[i]; if(inst == 0) continue; @@ -526,7 +526,7 @@ void Client::AddItemBonuses(const ItemInst *inst, StatBonuses *newbon, bool isAu } if (!isAug) { - for (int i = 0; i < EmuConstants::ITEM_COMMON_SIZE; i++) + for (int i = 0; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) AddItemBonuses(inst->GetAugment(i), newbon, true, false, rec_level, ammo_slot_item); } } @@ -564,7 +564,7 @@ void Client::AdditiveWornBonuses(const ItemInst *inst, StatBonuses* newbon, bool if (!isAug) { int i; - for (i = 0; i < EmuConstants::ITEM_COMMON_SIZE; i++) { + for (i = 0; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) { AdditiveWornBonuses(inst->GetAugment(i),newbon,true); } } @@ -575,7 +575,7 @@ void Client::CalcEdibleBonuses(StatBonuses* newbon) { bool food = false; bool drink = false; - for (i = EmuConstants::GENERAL_BEGIN; i <= EmuConstants::GENERAL_BAGS_BEGIN; i++) + for (i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_BAGS_BEGIN; i++) { if (food && drink) break; @@ -591,7 +591,7 @@ void Client::CalcEdibleBonuses(StatBonuses* newbon) { AddItemBonuses(inst, newbon); } } - for (i = EmuConstants::GENERAL_BAGS_BEGIN; i <= EmuConstants::GENERAL_BAGS_END; i++) + for (i = EQEmu::Constants::GENERAL_BAGS_BEGIN; i <= EQEmu::Constants::GENERAL_BAGS_END; i++) { if (food && drink) break; @@ -3200,7 +3200,7 @@ void NPC::CalcItemBonuses(StatBonuses *newbon) { if(newbon){ - for(int i = 0; i < EmuConstants::EQUIPMENT_SIZE; i++){ + for (int i = 0; i < EQEmu::Constants::EQUIPMENT_SIZE; i++){ const Item_Struct *cur = database.GetItem(equipment[i]); if(cur){ //basic stats @@ -3278,24 +3278,24 @@ void Client::CalcItemScale() { bool changed = false; // MainAmmo excluded in helper function below - if(CalcItemScale(EmuConstants::EQUIPMENT_BEGIN, EmuConstants::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21) + if (CalcItemScale(EQEmu::Constants::EQUIPMENT_BEGIN, EQEmu::Constants::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21) changed = true; - if(CalcItemScale(EmuConstants::GENERAL_BEGIN, EmuConstants::GENERAL_END)) // original coding excluded MainCursor (< 30) + if (CalcItemScale(EQEmu::Constants::GENERAL_BEGIN, EQEmu::Constants::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(EmuConstants::GENERAL_BAGS_BEGIN, EmuConstants::GENERAL_BAGS_END)) // (< 341) + if (CalcItemScale(EQEmu::Constants::GENERAL_BAGS_BEGIN, EQEmu::Constants::GENERAL_BAGS_END)) // (< 341) changed = true; - if(CalcItemScale(EmuConstants::TRIBUTE_BEGIN, EmuConstants::TRIBUTE_END)) // (< 405) + if (CalcItemScale(EQEmu::Constants::TRIBUTE_BEGIN, EQEmu::Constants::TRIBUTE_END)) // (< 405) changed = true; //Power Source Slot if (GetClientVersion() >= ClientVersion::SoF) { - if(CalcItemScale(MainPowerSource, MainPowerSource)) + if(CalcItemScale(SlotPowerSource, SlotPowerSource)) changed = true; } @@ -3310,7 +3310,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 == MainAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot + if (i == 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 +3320,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) { // TEST CODE: test for bazaar trader crashing with charm items if (Trader) - if (i >= EmuConstants::GENERAL_BAGS_BEGIN && i <= EmuConstants::GENERAL_BAGS_END) { + if (i >= EQEmu::Constants::GENERAL_BAGS_BEGIN && i <= EQEmu::Constants::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 +3340,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) { } //iterate all augments - for (int x = AUG_BEGIN; x < EmuConstants::ITEM_COMMON_SIZE; ++x) + for (int x = AUG_BEGIN; x < EQEmu::Constants::ITEM_COMMON_SIZE; ++x) { ItemInst * a_inst = inst->GetAugment(x); if(!a_inst) @@ -3372,24 +3372,24 @@ void Client::DoItemEnterZone() { bool changed = false; // MainAmmo excluded in helper function below - if(DoItemEnterZone(EmuConstants::EQUIPMENT_BEGIN, EmuConstants::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21) + if (DoItemEnterZone(EQEmu::Constants::EQUIPMENT_BEGIN, EQEmu::Constants::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21) changed = true; - if(DoItemEnterZone(EmuConstants::GENERAL_BEGIN, EmuConstants::GENERAL_END)) // original coding excluded MainCursor (< 30) + if (DoItemEnterZone(EQEmu::Constants::GENERAL_BEGIN, EQEmu::Constants::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(EmuConstants::GENERAL_BAGS_BEGIN, EmuConstants::GENERAL_BAGS_END)) // (< 341) + if (DoItemEnterZone(EQEmu::Constants::GENERAL_BAGS_BEGIN, EQEmu::Constants::GENERAL_BAGS_END)) // (< 341) changed = true; - if(DoItemEnterZone(EmuConstants::TRIBUTE_BEGIN, EmuConstants::TRIBUTE_END)) // (< 405) + if (DoItemEnterZone(EQEmu::Constants::TRIBUTE_BEGIN, EQEmu::Constants::TRIBUTE_END)) // (< 405) changed = true; //Power Source Slot if (GetClientVersion() >= ClientVersion::SoF) { - if(DoItemEnterZone(MainPowerSource, MainPowerSource)) + if(DoItemEnterZone(SlotPowerSource, SlotPowerSource)) changed = true; } @@ -3403,7 +3403,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 == MainAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot + if (i == 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 +3413,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) { // TEST CODE: test for bazaar trader crashing with charm items if (Trader) - if (i >= EmuConstants::GENERAL_BAGS_BEGIN && i <= EmuConstants::GENERAL_BAGS_END) { + if (i >= EQEmu::Constants::GENERAL_BAGS_BEGIN && i <= EQEmu::Constants::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 +3425,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 <= MainAmmo || i == MainPowerSource) { + if(i <= SlotAmmo || i == SlotPowerSource) { parse->EventItem(EVENT_EQUIP_ITEM, this, inst, nullptr, "", i); } @@ -3435,7 +3435,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) { update_slot = true; } } else { - if(i <= MainAmmo || i == MainPowerSource) { + if(i <= SlotAmmo || i == SlotPowerSource) { parse->EventItem(EVENT_EQUIP_ITEM, this, inst, nullptr, "", i); } @@ -3443,7 +3443,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) { } //iterate all augments - for (int x = AUG_BEGIN; x < EmuConstants::ITEM_COMMON_SIZE; ++x) + for (int x = AUG_BEGIN; x < EQEmu::Constants::ITEM_COMMON_SIZE; ++x) { ItemInst *a_inst = inst->GetAugment(x); if(!a_inst) diff --git a/zone/bot.cpp b/zone/bot.cpp index 2409b84b4..2c22a12a6 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(MainRange); - const ItemInst *ammo_inst = GetBotItem(MainAmmo); + const ItemInst *range_inst = GetBotItem(SlotRange); + const ItemInst *ammo_inst = GetBotItem(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(MainPrimary, GetBotItemBySlot(MainPrimary)); - BotAddEquipItem(MainSecondary, GetBotItemBySlot(MainSecondary)); + BotAddEquipItem(SlotPrimary, GetBotItemBySlot(SlotPrimary)); + BotAddEquipItem(SlotSecondary, GetBotItemBySlot(SlotSecondary)); SetAttackTimer(); BotGroupSay(this, "My blade is ready"); } else { - BotRemoveEquipItem(MainPrimary); - BotRemoveEquipItem(MainSecondary); - BotAddEquipItem(MainAmmo, GetBotItemBySlot(MainAmmo)); - BotAddEquipItem(MainSecondary, GetBotItemBySlot(MainRange)); + BotRemoveEquipItem(SlotPrimary); + BotRemoveEquipItem(SlotSecondary); + BotAddEquipItem(SlotAmmo, GetBotItemBySlot(SlotAmmo)); + BotAddEquipItem(SlotSecondary, GetBotItemBySlot(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(MainPrimary); + bool equiped = m_inv.GetItem(SlotPrimary); if(!equiped) skill = SkillHandtoHand; else { - uint8 type = m_inv.GetItem(MainPrimary)->GetItem()->ItemType; //is this the best way to do this? + uint8 type = m_inv.GetItem(SlotPrimary)->GetItem()->ItemType; //is this the best way to do this? switch(type) { case ItemType1HSlash: { skill = Skill1HSlashing; @@ -1703,8 +1703,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[EmuConstants::EQUIPMENT_SIZE]; - memset(pet_items, 0, (sizeof(uint32) * EmuConstants::EQUIPMENT_SIZE)); + uint32 pet_items[EQEmu::Constants::EQUIPMENT_SIZE]; + memset(pet_items, 0, (sizeof(uint32) * EQEmu::Constants::EQUIPMENT_SIZE)); if (!botdb.LoadPetItems(GetBotID(), pet_items)) bot_owner->Message(13, "%s for %s's pet", BotDatabase::fail::LoadPetItems(), GetCleanName()); @@ -1731,11 +1731,11 @@ bool Bot::SavePet() char* pet_name = new char[64]; SpellBuff_Struct pet_buffs[BUFF_COUNT]; - uint32 pet_items[EmuConstants::EQUIPMENT_SIZE]; + uint32 pet_items[EQEmu::Constants::EQUIPMENT_SIZE]; memset(pet_name, 0, 64); memset(pet_buffs, 0, (sizeof(SpellBuff_Struct) * BUFF_COUNT)); - memset(pet_items, 0, (sizeof(uint32) * EmuConstants::EQUIPMENT_SIZE)); + memset(pet_items, 0, (sizeof(uint32) * EQEmu::Constants::EQUIPMENT_SIZE)); pet_inst->GetPetState(pet_buffs, pet_items, pet_name); @@ -1887,12 +1887,12 @@ void Bot::BotRangedAttack(Mob* other) { return; } - ItemInst* rangedItem = GetBotItem(MainRange); + ItemInst* rangedItem = GetBotItem(SlotRange); const Item_Struct* RangeWeapon = 0; if(rangedItem) RangeWeapon = rangedItem->GetItem(); - ItemInst* ammoItem = GetBotItem(MainAmmo); + ItemInst* ammoItem = GetBotItem(SlotAmmo); const Item_Struct* Ammo = 0; if(ammoItem) Ammo = ammoItem->GetItem(); @@ -1989,7 +1989,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes int damage = 0; uint32 hate = 0; - int Hand = MainPrimary; + int Hand = SlotPrimary; if (hate == 0 && weapon_damage > 1) hate = weapon_damage; @@ -2018,7 +2018,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 ? MainRange : MainPrimary)) { // MainRange excludes ripo, primary doesn't have any extra behavior + if (other->AvoidDamage(this, damage, CanRiposte ? SlotRange : SlotPrimary)) { // MainRange excludes ripo, primary doesn't have any extra behavior if (damage == -3) { DoRiposte(other); if (HasDied()) @@ -2043,7 +2043,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes damage = -5; if(skillinuse == SkillBash){ - const ItemInst* inst = GetBotItem(MainSecondary); + const ItemInst* inst = GetBotItem(SlotSecondary); const Item_Struct* botweapon = 0; if(inst) botweapon = inst->GetItem(); @@ -2090,19 +2090,19 @@ void Bot::ApplySpecialAttackMod(SkillUseTypes skill, int32 &dmg, int32 &mindmg) case SkillFlyingKick: case SkillRoundKick: case SkillKick: - item_slot = MainFeet; + item_slot = SlotFeet; break; case SkillBash: - item_slot = MainSecondary; + item_slot = SlotSecondary; break; case SkillDragonPunch: case SkillEagleStrike: case SkillTigerClaw: - item_slot = MainHands; + item_slot = SlotHands; break; } - if (item_slot >= EmuConstants::EQUIPMENT_BEGIN){ + if (item_slot >= EQEmu::Constants::EQUIPMENT_BEGIN){ const ItemInst* inst = GetBotItem(item_slot); const Item_Struct* botweapon = 0; if(inst) @@ -2430,23 +2430,23 @@ void Bot::AI_Process() { // First, special attack per class (kick, backstab etc..) DoClassAttacks(GetTarget()); if(attack_timer.Check()) { - Attack(GetTarget(), MainPrimary); - TriggerDefensiveProcs(GetTarget(), MainPrimary, false); - ItemInst *wpn = GetBotItem(MainPrimary); - TryWeaponProc(wpn, GetTarget(), MainPrimary); + Attack(GetTarget(), SlotPrimary); + TriggerDefensiveProcs(GetTarget(), SlotPrimary, false); + ItemInst *wpn = GetBotItem(SlotPrimary); + TryWeaponProc(wpn, GetTarget(), SlotPrimary); bool tripleSuccess = false; if(BotOwner && GetTarget() && CanThisClassDoubleAttack()) { if(BotOwner && CheckBotDoubleAttack()) - Attack(GetTarget(), MainPrimary, true); + Attack(GetTarget(), SlotPrimary, true); if(BotOwner && GetTarget() && GetSpecialAbility(SPECATK_TRIPLE) && CheckBotDoubleAttack(true)) { tripleSuccess = true; - Attack(GetTarget(), MainPrimary, true); + Attack(GetTarget(), SlotPrimary, true); } //quad attack, does this belong here?? if(BotOwner && GetTarget() && GetSpecialAbility(SPECATK_QUAD) && CheckBotDoubleAttack(true)) - Attack(GetTarget(), MainPrimary, true); + Attack(GetTarget(), SlotPrimary, true); } //Live AA - Flurry, Rapid Strikes ect (Flurry does not require Triple Attack). @@ -2454,18 +2454,18 @@ void Bot::AI_Process() { if (GetTarget() && flurrychance) { if(zone->random.Int(0, 100) < flurrychance) { Message_StringID(MT_NPCFlurry, YOU_FLURRY); - Attack(GetTarget(), MainPrimary, false); - Attack(GetTarget(), MainPrimary, false); + Attack(GetTarget(), SlotPrimary, false); + Attack(GetTarget(), SlotPrimary, false); } } int32 ExtraAttackChanceBonus = (spellbonuses.ExtraAttackChance + itembonuses.ExtraAttackChance + aabonuses.ExtraAttackChance); if (GetTarget() && ExtraAttackChanceBonus) { - ItemInst *wpn = GetBotItem(MainPrimary); + ItemInst *wpn = GetBotItem(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(), MainPrimary, false); + Attack(GetTarget(), SlotPrimary, false); } } } @@ -2485,7 +2485,7 @@ void Bot::AI_Process() { //now off hand if(GetTarget() && attack_dw_timer.Check() && CanThisClassDualWield()) { - const ItemInst* instweapon = GetBotItem(MainSecondary); + const ItemInst* instweapon = GetBotItem(SlotSecondary); const Item_Struct* weapon = 0; //can only dual wield without a weapon if you're a monk if(instweapon || (botClass == MONK)) { @@ -2507,12 +2507,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(), MainSecondary); // Single attack with offhand - ItemInst *wpn = GetBotItem(MainSecondary); - TryWeaponProc(wpn, GetTarget(), MainSecondary); + Attack(GetTarget(), SlotSecondary); // Single attack with offhand + ItemInst *wpn = GetBotItem(SlotSecondary); + TryWeaponProc(wpn, GetTarget(), SlotSecondary); if( CanThisClassDoubleAttack() && CheckBotDoubleAttack()) { if(GetTarget() && GetTarget()->GetHP() > -10) - Attack(GetTarget(), MainSecondary); // Single attack with offhand + Attack(GetTarget(), SlotSecondary); // Single attack with offhand } } } @@ -2683,12 +2683,12 @@ void Bot::PetAIProcess() { if(!botPet->BehindMob(botPet->GetTarget(), botPet->GetX(), botPet->GetY()) && botPet->GetTarget()->IsEnraged()) return; - if(botPet->Attack(GetTarget(), MainPrimary)) // try the main hand + if(botPet->Attack(GetTarget(), 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(), MainPrimary)) {} + if(botPet->Attack(botPet->GetTarget(), SlotPrimary)) {} } } @@ -2726,11 +2726,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(), MainSecondary); + botPet->Attack(botPet->GetTarget(), SlotSecondary); if (botPet->CanThisClassDoubleAttack()) { int32 RandRoll = zone->random.Int(0, 99); if (RandRoll < (botPet->GetLevel() + 20)) - botPet->Attack(botPet->GetTarget(), MainSecondary); + botPet->Attack(botPet->GetTarget(), SlotSecondary); } } } @@ -2853,7 +2853,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 = EmuConstants::EQUIPMENT_BEGIN; i <= EmuConstants::EQUIPMENT_END; ++i) { + for (int i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; ++i) { itemID = GetBotItemBySlot(i); if(itemID != 0) { materialFromSlot = Inventory::CalcMaterialFromSlot(i); @@ -2956,7 +2956,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) { } } - inst = GetBotItem(MainPrimary); + inst = GetBotItem(SlotPrimary); if(inst) { item = inst->GetItem(); if(item) { @@ -2967,7 +2967,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) { } } - inst = GetBotItem(MainSecondary); + inst = GetBotItem(SlotSecondary); if(inst) { item = inst->GetItem(); if(item) { @@ -3218,7 +3218,7 @@ void Bot::BotAddEquipItem(int slot, uint32 id) { if(slot > 0 && id > 0) { uint8 materialFromSlot = Inventory::CalcMaterialFromSlot(slot); - if(materialFromSlot != _MaterialInvalid) { + if(materialFromSlot != MaterialInvalid) { equipment[slot] = id; // npc has more than just material slots. Valid material should mean valid inventory index SendWearChange(materialFromSlot); } @@ -3234,7 +3234,7 @@ void Bot::BotRemoveEquipItem(int slot) { if(slot > 0) { uint8 materialFromSlot = Inventory::CalcMaterialFromSlot(slot); - if(materialFromSlot != _MaterialInvalid) { + if(materialFromSlot != MaterialInvalid) { equipment[slot] = 0; // npc has more than just material slots. Valid material should mean valid inventory index SendWearChange(materialFromSlot); if(materialFromSlot == MaterialChest) @@ -3336,12 +3336,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(EmuConstants::TRADE_BEGIN, EmuConstants::TRADE_END, client); // {3000..3007} + PerformTradeWithClient(EQEmu::Constants::TRADE_BEGIN, EQEmu::Constants::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(MainCursor, MainCursor, client); + PerformTradeWithClient(SlotCursor, 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); @@ -3353,7 +3353,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 = EmuConstants::TRADE_BAGS_END; // was the old incorrect 3179.. + const int MAX_SLOT_ID = EQEmu::Constants::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}; @@ -3370,7 +3370,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli charges[i] = inst->GetCharges(); } - if (i == MainCursor) + if (i == SlotCursor) UpdateClient = true; //EQoffline: will give the items to the bots and change the bot stats @@ -3378,7 +3378,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_BEGIN; m GetAugment(m); if(itm) { @@ -3398,29 +3398,29 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli botCanWear[i] = BotCanWear; ItemInst* swap_item = nullptr; - const char* equipped[EmuConstants::EQUIPMENT_SIZE + 1] = {"Charm", "Left Ear", "Head", "Face", "Right Ear", "Neck", "Shoulders", "Arms", "Back", + const char* equipped[EQEmu::Constants::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 = EmuConstants::EQUIPMENT_BEGIN; j <= (EmuConstants::EQUIPMENT_END + 1); ++j) { + for (int j = EQEmu::Constants::EQUIPMENT_BEGIN; j <= (EQEmu::Constants::EQUIPMENT_END + 1); ++j) { if((mWeaponItem->Slots & (1 << j))) { if (j == 22) j = 9999; how_many_slots++; if(!GetBotItem(j)) { - if(j == MainPrimary) { + if(j == SlotPrimary) { if((mWeaponItem->ItemType == ItemType2HSlash) || (mWeaponItem->ItemType == ItemType2HBlunt) || (mWeaponItem->ItemType == ItemType2HPiercing)) { - if(GetBotItem(MainSecondary)) { + if(GetBotItem(SlotSecondary)) { if(mWeaponItem && (mWeaponItem->ItemType == ItemType2HSlash) || (mWeaponItem->ItemType == ItemType2HBlunt) || (mWeaponItem->ItemType == ItemType2HPiercing)) { - if(client->CheckLoreConflict(GetBotItem(MainSecondary)->GetItem())) { + if(client->CheckLoreConflict(GetBotItem(SlotSecondary)->GetItem())) { failedLoreCheck = true; } } else { - ItemInst* remove_item = GetBotItem(MainSecondary); - BotTradeSwapItem(client, MainSecondary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false); + ItemInst* remove_item = GetBotItem(SlotSecondary); + BotTradeSwapItem(client, SlotSecondary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false); } } } @@ -3430,7 +3430,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli } break; } - else if(j == MainSecondary) { + else if(j == SlotSecondary) { if(inst->IsWeapon()) { if(CanThisClassDualWield()) { BotTradeAddItem(mWeaponItem->ID, inst, inst->GetCharges(), mWeaponItem->Slots, j, &TempErrorMessage); @@ -3446,10 +3446,10 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli success = true; } if(success) { - if(GetBotItem(MainPrimary)) { - ItemInst* remove_item = GetBotItem(MainPrimary); + if(GetBotItem(SlotPrimary)) { + ItemInst* remove_item = GetBotItem(SlotPrimary); if((remove_item->GetItem()->ItemType == ItemType2HSlash) || (remove_item->GetItem()->ItemType == ItemType2HBlunt) || (remove_item->GetItem()->ItemType == ItemType2HPiercing)) { - BotTradeSwapItem(client, MainPrimary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false); + BotTradeSwapItem(client, SlotPrimary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false); } } break; @@ -3464,14 +3464,14 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli } } if(!success) { - for(int j = EmuConstants::EQUIPMENT_BEGIN; j <= (EmuConstants::EQUIPMENT_END + 1); ++j) { + for (int j = EQEmu::Constants::EQUIPMENT_BEGIN; j <= (EQEmu::Constants::EQUIPMENT_END + 1); ++j) { if((mWeaponItem->Slots & (1 << j))) { if (j == 22) j = 9999; swap_item = GetBotItem(j); failedLoreCheck = false; - for (int k = AUG_BEGIN; k < EmuConstants::ITEM_COMMON_SIZE; ++k) { + for (int k = AUG_BEGIN; k < EQEmu::Constants::ITEM_COMMON_SIZE; ++k) { ItemInst *itm = swap_item->GetAugment(k); if(itm) { @@ -3484,28 +3484,28 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli failedLoreCheck = true; } if(!failedLoreCheck) { - if(j == MainPrimary) { + if(j == SlotPrimary) { if((mWeaponItem->ItemType == ItemType2HSlash) || (mWeaponItem->ItemType == ItemType2HBlunt) || (mWeaponItem->ItemType == ItemType2HPiercing)) { - if(GetBotItem(MainSecondary)) { - if(client->CheckLoreConflict(GetBotItem(MainSecondary)->GetItem())) { + if(GetBotItem(SlotSecondary)) { + if(client->CheckLoreConflict(GetBotItem(SlotSecondary)->GetItem())) { failedLoreCheck = true; } else { - ItemInst* remove_item = GetBotItem(MainSecondary); - BotTradeSwapItem(client, MainSecondary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false); + ItemInst* remove_item = GetBotItem(SlotSecondary); + BotTradeSwapItem(client, SlotSecondary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false); } } } if(!failedLoreCheck) { - BotTradeSwapItem(client, MainPrimary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage); + BotTradeSwapItem(client, SlotPrimary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage); success = true; } break; } - else if(j == MainSecondary) { + else if(j == SlotSecondary) { if(inst->IsWeapon()) { if(CanThisClassDualWield()) { - BotTradeSwapItem(client, MainSecondary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage); + BotTradeSwapItem(client, SlotSecondary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage); success = true; } else { @@ -3514,13 +3514,13 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli } } else { - BotTradeSwapItem(client, MainSecondary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage); + BotTradeSwapItem(client, SlotSecondary, inst, swap_item, mWeaponItem->Slots, &TempErrorMessage); success = true; } - if(success && GetBotItem(MainPrimary)) { - ItemInst* remove_item = GetBotItem(MainPrimary); + if(success && GetBotItem(SlotPrimary)) { + ItemInst* remove_item = GetBotItem(SlotPrimary); if((remove_item->GetItem()->ItemType == ItemType2HSlash) || (remove_item->GetItem()->ItemType == ItemType2HBlunt) || (remove_item->GetItem()->ItemType == ItemType2HPiercing)) { - BotTradeSwapItem(client, MainPrimary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false); + BotTradeSwapItem(client, SlotPrimary, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false); } } break; @@ -3720,13 +3720,13 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b FaceTarget(GetTarget()); ItemInst* weapon = nullptr; - if(Hand == MainPrimary) { - weapon = GetBotItem(MainPrimary); + if(Hand == SlotPrimary) { + weapon = GetBotItem(SlotPrimary); OffHandAtk(false); } - if(Hand == MainSecondary) { - weapon = GetBotItem(MainSecondary); + if(Hand == SlotSecondary) { + weapon = GetBotItem(SlotSecondary); OffHandAtk(true); } @@ -3791,7 +3791,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 == MainPrimary && GetLevel() >= 28 && IsWarriorClass()) { + if(Hand == 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); @@ -3801,7 +3801,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==MainSecondary) { + if (Hand == SlotSecondary) { if (aabonuses.SecondaryDmgInc || itembonuses.SecondaryDmgInc || spellbonuses.SecondaryDmgInc){ ucDamageBonus = GetWeaponDamageBonus(weapon ? weapon->GetItem() : (const Item_Struct*) nullptr); min_hit += (int) ucDamageBonus; @@ -4269,7 +4269,7 @@ int32 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) { int32 focus_max = 0; int32 focus_max_real = 0; //item focus - for(int x = EmuConstants::EQUIPMENT_BEGIN; x <= EmuConstants::EQUIPMENT_END; x++) { + for (int x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= EQEmu::Constants::EQUIPMENT_END; x++) { TempItem = nullptr; ItemInst* ins = GetBotItem(x); if (!ins) @@ -4294,7 +4294,7 @@ int32 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) { } } - for (int y = AUG_BEGIN; y < EmuConstants::ITEM_COMMON_SIZE; ++y) { + for (int y = AUG_BEGIN; y < EQEmu::Constants::ITEM_COMMON_SIZE; ++y) { ItemInst *aug = nullptr; aug = ins->GetAugment(y); if(aug) { @@ -4730,13 +4730,13 @@ float Bot::GetProcChances(float ProcBonus, uint16 hand) { float ProcChance = 0.0f; uint32 weapon_speed = 0; switch (hand) { - case MainPrimary: + case SlotPrimary: weapon_speed = attack_timer.GetDuration(); break; - case MainSecondary: + case SlotSecondary: weapon_speed = attack_dw_timer.GetDuration(); break; - case MainRange: + case SlotRange: weapon_speed = ranged_timer.GetDuration(); break; } @@ -4823,11 +4823,11 @@ void Bot::DoRiposte(Mob* defender) { if (!defender) return; - defender->Attack(this, MainPrimary, true); + defender->Attack(this, 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, MainPrimary, true); + defender->Attack(this, SlotPrimary, true); } DoubleRipChance = defender->GetAABonuses().GiveDoubleRiposte[1]; @@ -4845,7 +4845,7 @@ void Bot::DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage, hate = hate_override; if(skill == SkillBash) { - const ItemInst* inst = GetBotItem(MainSecondary); + const ItemInst* inst = GetBotItem(SlotSecondary); const Item_Struct* botweapon = 0; if(inst) botweapon = inst->GetItem(); @@ -4859,14 +4859,14 @@ void Bot::DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage, } min_damage += (min_damage * GetMeleeMinDamageMod_SE(skill) / 100); - int hand = MainPrimary; + int hand = SlotPrimary; if (skill == SkillThrowing || skill == SkillArchery) - hand = MainRange; + hand = SlotRange; if (who->AvoidDamage(this, max_damage, hand)) { if (max_damage == -3) DoRiposte(who); } else { - if (HitChance || who->CheckHitChance(this, skill, MainPrimary)) { + if (HitChance || who->CheckHitChance(this, skill, SlotPrimary)) { who->MeleeMitigation(this, max_damage, min_damage); ApplyMeleeDamageBonus(skill, max_damage); max_damage += who->GetFcDamageAmtIncoming(this, 0, true, skill); @@ -4910,7 +4910,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) { bool bIsBehind = false; bool bCanFrontalBS = false; - const ItemInst* inst = GetBotItem(MainPrimary); + const ItemInst* inst = GetBotItem(SlotPrimary); const Item_Struct* botpiercer = nullptr; if(inst) botpiercer = inst->GetItem(); @@ -4960,7 +4960,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) { } } else - Attack(other, MainPrimary); + Attack(other, SlotPrimary); } void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) { @@ -4970,11 +4970,11 @@ void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) { int32 hate = 0; int32 primaryweapondamage = 0; int32 backstab_dmg = 0; - ItemInst* botweaponInst = GetBotItem(MainPrimary); + ItemInst* botweaponInst = GetBotItem(SlotPrimary); if(botweaponInst) { primaryweapondamage = GetWeaponDamage(other, botweaponInst); backstab_dmg = botweaponInst->GetItem()->BackstabDmg; - for (int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; ++i) { + for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; ++i) { ItemInst *aug = botweaponInst->GetAugment(i); if(aug) backstab_dmg += aug->GetItem()->BackstabDmg; @@ -5018,7 +5018,7 @@ void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) { } void Bot::RogueAssassinate(Mob* other) { - ItemInst* botweaponInst = GetBotItem(MainPrimary); + ItemInst* botweaponInst = GetBotItem(SlotPrimary); if(botweaponInst) { if(GetWeaponDamage(other, botweaponInst)) other->Damage(this, 32000, SPELL_UNKNOWN, SkillBackstab); @@ -5084,7 +5084,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(MainSecondary) && m_inv.GetItem(MainSecondary)->GetItem()->ItemType == ItemTypeShield) || (m_inv.GetItem(MainPrimary) && (m_inv.GetItem(MainPrimary)->GetItem()->ItemType == ItemType2HSlash || m_inv.GetItem(MainPrimary)->GetItem()->ItemType == ItemType2HBlunt || m_inv.GetItem(MainPrimary)->GetItem()->ItemType == ItemType2HPiercing) && GetAA(aa2HandBash) >= 1)) + 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)) canBash = true; if(!canBash || zone->random.Int(0, 100) > 25) @@ -5103,7 +5103,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(MainSecondary) && m_inv.GetItem(MainSecondary)->GetItem()->ItemType == ItemTypeShield) || (m_inv.GetItem(MainPrimary) && (m_inv.GetItem(MainPrimary)->GetItem()->ItemType == ItemType2HSlash || m_inv.GetItem(MainPrimary)->GetItem()->ItemType == ItemType2HBlunt || m_inv.GetItem(MainPrimary)->GetItem()->ItemType == ItemType2HPiercing) && GetAA(aa2HandBash) >= 1)) + 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)) skill_to_use = SkillBash; } break; @@ -5132,7 +5132,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) { if(skill_to_use == SkillBash) { if (target != this) { DoAnim(animTailRake); - if(GetWeaponDamage(target, GetBotItem(MainSecondary)) <= 0 && GetWeaponDamage(target, GetBotItem(MainShoulders)) <= 0) + if(GetWeaponDamage(target, GetBotItem(SlotSecondary)) <= 0 && GetWeaponDamage(target, GetBotItem(SlotShoulders)) <= 0) dmg = -5; else { if(!target->CheckHitChance(this, SkillBash, 0)) @@ -5182,7 +5182,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) { if(skill_to_use == SkillKick) { if(target != this) { DoAnim(animKick); - if(GetWeaponDamage(target, GetBotItem(MainFeet)) <= 0) + if(GetWeaponDamage(target, GetBotItem(SlotFeet)) <= 0) dmg = -5; else { if(!target->CheckHitChance(this, SkillKick, 0)) @@ -5349,7 +5349,7 @@ void Bot::EquipBot(std::string* errorMessage) { GetBotItems(m_inv, errorMessage); const ItemInst* inst = 0; const Item_Struct* item = 0; - for(int i = EmuConstants::EQUIPMENT_BEGIN; i <= EmuConstants::EQUIPMENT_END; ++i) { + for (int i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; ++i) { inst = GetBotItem(i); if(inst) { item = inst->GetItem(); @@ -5476,12 +5476,12 @@ void Bot::SetAttackTimer() { attack_timer.SetAtTrigger(4000, true); Timer* TimerToUse = nullptr; const Item_Struct* PrimaryWeapon = nullptr; - for (int i = MainRange; i <= MainSecondary; i++) { - if (i == MainPrimary) + for (int i = SlotRange; i <= SlotSecondary; i++) { + if (i == SlotPrimary) TimerToUse = &attack_timer; - else if (i == MainRange) + else if (i == SlotRange) TimerToUse = &ranged_timer; - else if (i == MainSecondary) + else if (i == SlotSecondary) TimerToUse = &attack_dw_timer; else continue; @@ -5491,7 +5491,7 @@ void Bot::SetAttackTimer() { if (ci) ItemToUse = ci->GetItem(); - if (i == MainSecondary) { + if (i == SlotSecondary) { if (PrimaryWeapon != nullptr) { if (PrimaryWeapon->ItemClass == ItemClassCommon && (PrimaryWeapon->ItemType == ItemType2HSlash || PrimaryWeapon->ItemType == ItemType2HBlunt || PrimaryWeapon->ItemType == ItemType2HPiercing)) { attack_dw_timer.Disable(); @@ -5522,7 +5522,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 == MainPrimary) + if(i == SlotPrimary) PrimaryWeapon = ItemToUse; } } @@ -7166,7 +7166,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 = EmuConstants::EQUIPMENT_BEGIN; L <= MainWaist; L++) { + for (int16 L = EQEmu::Constants::EQUIPMENT_BEGIN; L <= SlotWaist; L++) { inst = inspectedBot->GetBotItem(L); if(inst) { @@ -7180,28 +7180,28 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) { } } - inst = inspectedBot->GetBotItem(MainPowerSource); + inst = inspectedBot->GetBotItem(SlotPowerSource); if(inst) { item = inst->GetItem(); if(item) { - strcpy(insr->itemnames[SoF::slots::MainPowerSource], item->Name); - insr->itemicons[SoF::slots::MainPowerSource] = item->Icon; + strcpy(insr->itemnames[SoF::inventory::SlotPowerSource], item->Name); + insr->itemicons[SoF::inventory::SlotPowerSource] = item->Icon; } else - insr->itemicons[SoF::slots::MainPowerSource] = 0xFFFFFFFF; + insr->itemicons[SoF::inventory::SlotPowerSource] = 0xFFFFFFFF; } - inst = inspectedBot->GetBotItem(MainAmmo); + inst = inspectedBot->GetBotItem(SlotAmmo); if(inst) { item = inst->GetItem(); if(item) { - strcpy(insr->itemnames[SoF::slots::MainAmmo], item->Name); - insr->itemicons[SoF::slots::MainAmmo] = item->Icon; + strcpy(insr->itemnames[SoF::inventory::SlotAmmo], item->Name); + insr->itemicons[SoF::inventory::SlotAmmo] = item->Icon; } else - insr->itemicons[SoF::slots::MainAmmo] = 0xFFFFFFFF; + insr->itemicons[SoF::inventory::SlotAmmo] = 0xFFFFFFFF; } strcpy(insr->text, inspectedBot->GetInspectMessage().text); @@ -7214,7 +7214,7 @@ void Bot::CalcItemBonuses(StatBonuses* newbon) { const Item_Struct* itemtmp = 0; - for (int i = EmuConstants::EQUIPMENT_BEGIN; i <= (EmuConstants::EQUIPMENT_END + 1); ++i) { + for (int i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= (EQEmu::Constants::EQUIPMENT_END + 1); ++i) { const ItemInst* item = GetBotItem((i == 22 ? 9999 : i)); if(item) { AddItemBonuses(item, newbon); @@ -7527,7 +7527,7 @@ void Bot::AddItemBonuses(const ItemInst *inst, StatBonuses* newbon, bool isAug, if (!isAug) { - for (int i = 0; i < EmuConstants::ITEM_COMMON_SIZE; i++) + for (int i = 0; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) AddItemBonuses(inst->GetAugment(i),newbon,true, false, rec_level); } @@ -8015,12 +8015,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(MainSecondary); + ItemInst* inst = GetBotItem(SlotSecondary); if(inst) { if(inst->GetItem()->ItemType == ItemTypeShield) { ac -= inst->GetItem()->AC; shield_ac = inst->GetItem()->AC; - for (uint8 i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) { + for (uint8 i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) { if(inst->GetAugment(i)) { ac -= inst->GetAugment(i)->GetItem()->AC; shield_ac += inst->GetAugment(i)->GetItem()->AC; @@ -8035,7 +8035,7 @@ uint32 Bot::CalcCurrentWeight() { const Item_Struct* TempItem = 0; ItemInst* inst; uint32 Total = 0; - for(int i = EmuConstants::EQUIPMENT_BEGIN; i <= EmuConstants::EQUIPMENT_END; ++i) { + for (int i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; ++i) { inst = GetBotItem(i); if(inst) { TempItem = inst->GetItem(); @@ -8404,7 +8404,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 == MaterialInvalid || mat_slot >= MaterialPrimary) return false; ItemInst* inst = m_inv.GetItem(slot_id); diff --git a/zone/bot.h b/zone/bot.h index 49d82f72a..0b39ee079 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 >= EmuConstants::EQUIPMENT_BEGIN && x <= EmuConstants::EQUIPMENT_END) ? (x) : ((x == MainPowerSource) ? (22) : (23))) +#define VALIDBOTEQUIPSLOT(x) ((x >= EQEmu::Constants::EQUIPMENT_BEGIN && x <= EQEmu::Constants::EQUIPMENT_END) ? (x) : ((x == SlotPowerSource) ? (22) : (23))) -static std::string bot_equip_slot_name[EmuConstants::EQUIPMENT_SIZE + 2] = +static std::string bot_equip_slot_name[EQEmu::Constants::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 = MainPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false, + virtual bool Attack(Mob* other, int Hand = 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 204afeffc..c69cfda44 100644 --- a/zone/bot_command.cpp +++ b/zone/bot_command.cpp @@ -2395,7 +2395,7 @@ namespace ActionableBots continue; mod_skill_value = base_skill_value; - for (int16 index = EmuConstants::EQUIPMENT_BEGIN; index <= EmuConstants::EQUIPMENT_END; ++index) { + for (int16 index = EQEmu::Constants::EQUIPMENT_BEGIN; index <= EQEmu::Constants::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) } const int ab_mask = ActionableBots::ABM_NoFilter; - uint8 material_slot = _MaterialInvalid; + uint8 material_slot = MaterialInvalid; int16 slot_id = INVALID_INDEX; bool dye_all = (sep->arg[1][0] == '*'); @@ -6823,24 +6823,24 @@ void bot_subcommand_inventory_list(Client *c, const Seperator *sep) linker.SetLinkType(linker.linkItemInst); uint32 inventory_count = 0; - for (int i = EmuConstants::EQUIPMENT_BEGIN; i <= (EmuConstants::EQUIPMENT_END + 1); ++i) { - if ((i == MainSecondary) && is2Hweapon) + for (int i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= (EQEmu::Constants::EQUIPMENT_END + 1); ++i) { + if ((i == SlotSecondary) && is2Hweapon) continue; - inst = my_bot->CastToBot()->GetBotItem(i == 22 ? 9999 : i); + inst = my_bot->CastToBot()->GetBotItem(i == 22 ? SlotPowerSource : i); if (!inst || !inst->GetItem()) { - c->Message(m_message, "I need something for my %s (slot %i)", GetBotEquipSlotName(i), (i == 22 ? 9999 : i)); + c->Message(m_message, "I need something for my %s (slot %i)", GetBotEquipSlotName(i), (i == 22 ? SlotPowerSource : i)); continue; } item = inst->GetItem(); - if ((i == MainPrimary) && ((item->ItemType == ItemType2HSlash) || (item->ItemType == ItemType2HBlunt) || (item->ItemType == ItemType2HPiercing))) { + if ((i == 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 ? 9999 : i)); + c->Message(m_message, "Using %s in my %s (slot %i)", item_link.c_str(), GetBotEquipSlotName(i), (i == 22 ? SlotPowerSource : i)); ++inventory_count; } @@ -6879,7 +6879,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep) } int slotId = atoi(sep->arg[1]); - if (!sep->IsNumber(1) || ((slotId > EmuConstants::EQUIPMENT_END || slotId < EmuConstants::EQUIPMENT_BEGIN) && slotId != 9999)) { + if (!sep->IsNumber(1) || ((slotId > EQEmu::Constants::EQUIPMENT_END || slotId < EQEmu::Constants::EQUIPMENT_BEGIN) && slotId != SlotPowerSource)) { c->Message(m_fail, "Valid slots are 0-21 or 9999"); return; } @@ -6894,7 +6894,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep) return; } - for (int m = AUG_BEGIN; m < EmuConstants::ITEM_COMMON_SIZE; ++m) { + for (int m = AUG_BEGIN; m < EQEmu::Constants::ITEM_COMMON_SIZE; ++m) { if (!itminst) break; @@ -6911,7 +6911,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep) std::string error_message; if (itm) { c->PushItemOnCursor(*itminst, true); - if ((slotId == MainRange) || (slotId == MainAmmo) || (slotId == MainPrimary) || (slotId == MainSecondary)) + if ((slotId == SlotRange) || (slotId == SlotAmmo) || (slotId == SlotPrimary) || (slotId == SlotSecondary)) my_bot->SetBotArcher(false); my_bot->RemoveBotItemBySlot(slotId, &error_message); @@ -6925,31 +6925,31 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep) } switch (slotId) { - case MainCharm: - case MainEar1: - case MainHead: - case MainFace: - case MainEar2: - case MainNeck: - case MainBack: - case MainWrist1: - case MainWrist2: - case MainRange: - case MainPrimary: - case MainSecondary: - case MainFinger1: - case MainFinger2: - case MainChest: - case MainWaist: - case MainPowerSource: - case MainAmmo: + 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: c->Message(m_message, "My %s is %s unequipped", GetBotEquipSlotName(slotId), ((itm) ? ("now") : ("already"))); break; - case MainShoulders: - case MainArms: - case MainHands: - case MainLegs: - case MainFeet: + case SlotShoulders: + case SlotArms: + case SlotHands: + case SlotLegs: + case SlotFeet: c->Message(m_message, "My %s are %s unequipped", GetBotEquipSlotName(slotId), ((itm) ? ("now") : ("already"))); break; default: diff --git a/zone/bot_database.cpp b/zone/bot_database.cpp index 54a701612..922259cab 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 < EmuConstants::EQUIPMENT_BEGIN || slot_id > EmuConstants::EQUIPMENT_END) && slot_id != MainPowerSource) + if ((slot_id < EQEmu::Constants::EQUIPMENT_BEGIN || slot_id > EQEmu::Constants::EQUIPMENT_END) && slot_id != 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 >= EmuConstants::EQUIPMENT_BEGIN) && (slot_id <= EmuConstants::EQUIPMENT_END) || slot_id == 9999)) + else if (((slot_id >= EQEmu::Constants::EQUIPMENT_BEGIN) && (slot_id <= EQEmu::Constants::EQUIPMENT_END) || slot_id == 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 > EmuConstants::EQUIPMENT_END && slot_id != MainPowerSource)) + if (!bot_id || (slot_id > EQEmu::Constants::EQUIPMENT_END && slot_id != 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 > EmuConstants::EQUIPMENT_END && slot_id != MainPowerSource)) + if (!bot_inst || !bot_inst->GetBotID() || (slot_id > EQEmu::Constants::EQUIPMENT_END && slot_id != 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 < EmuConstants::ITEM_COMMON_SIZE; ++augment_iter) + for (int augment_iter = 0; augment_iter < EQEmu::Constants::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 > EmuConstants::EQUIPMENT_END && slot_id != MainPowerSource)) + if (!bot_id || (slot_id > EQEmu::Constants::EQUIPMENT_END && slot_id != 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 < EmuConstants::EQUIPMENT_BEGIN || slot_id > EmuConstants::EQUIPMENT_END) && slot_id != MainPowerSource && !all_flag) + if ((slot_id < EQEmu::Constants::EQUIPMENT_BEGIN || slot_id > EQEmu::Constants::EQUIPMENT_END) && slot_id != 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')", MainHead, MainArms, MainWrist1, MainHands, MainChest, MainLegs, MainFeet); + where_clause = StringFormat(" AND `slot_id` IN ('%u', '%u', '%u', '%u', '%u', '%u', '%u')", SlotHead, SlotArms, SlotWrist1, SlotHands, SlotChest, SlotLegs, 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 < EmuConstants::EQUIPMENT_SIZE; ++row) { + for (auto row = results.begin(); row != results.end() && item_index < EQEmu::Constants::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 < EmuConstants::EQUIPMENT_SIZE; ++item_index) { + for (int item_index = 0; item_index < EQEmu::Constants::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, - MainHead, MainChest, MainArms, MainWrist1, MainWrist2, MainHands, MainLegs, MainFeet, + SlotHead, SlotChest, SlotArms, SlotWrist1, SlotWrist2, SlotHands, SlotLegs, 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, - MainHead, MainChest, MainArms, MainWrist1, MainWrist2, MainHands, MainLegs, MainFeet + SlotHead, SlotChest, SlotArms, SlotWrist1, SlotWrist2, SlotHands, SlotLegs, SlotFeet ); auto results = QueryDatabase(query); if (!results.Success()) diff --git a/zone/client.cpp b/zone/client.cpp index 837306d99..d7e0f4a3b 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -2731,7 +2731,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 != MaterialInvalid) { m_pp.item_material[matslot] = GetEquipmentMaterial(matslot); } @@ -3073,7 +3073,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 != MaterialInvalid) { m_pp.item_tint[matslot].Color = color.Color; database.SaveCharacterMaterialColor(this->CharacterID(), in_slot, color.Color); @@ -3148,58 +3148,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...) + uint8 slot2 = 0; // why are we returning MainCharm instead of INVALID_INDEX? (must be a pre-charm segment...) if(bracer) - return MainWrist2; + return SlotWrist2; switch(slot){ case MaterialHead: - slot2=MainHead; + slot2 = SlotHead; break; case MaterialChest: - slot2=MainChest; + slot2 = SlotChest; break; case MaterialArms: - slot2=MainArms; + slot2 = SlotArms; break; case MaterialWrist: - slot2=MainWrist1; + slot2 = SlotWrist1; break; case MaterialHands: - slot2=MainHands; + slot2 = SlotHands; break; case MaterialLegs: - slot2=MainLegs; + slot2 = SlotLegs; break; case MaterialFeet: - slot2=MainFeet; + slot2 = SlotFeet; break; } return slot2; } uint8 Client::SlotConvert2(uint8 slot){ - uint8 slot2=0; // same as above... + uint8 slot2 = 0; // same as above... switch(slot){ - case MainHead: - slot2=MaterialHead; + case SlotHead: + slot2 = MaterialHead; break; - case MainChest: - slot2=MaterialChest; + case SlotChest: + slot2 = MaterialChest; break; - case MainArms: - slot2=MaterialArms; + case SlotArms: + slot2 = MaterialArms; break; - case MainWrist1: - slot2=MaterialWrist; + case SlotWrist1: + slot2 = MaterialWrist; break; - case MainHands: - slot2=MaterialHands; + case SlotHands: + slot2 = MaterialHands; break; - case MainLegs: - slot2=MaterialLegs; + case SlotLegs: + slot2 = MaterialLegs; break; - case MainFeet: - slot2=MaterialFeet; + case SlotFeet: + slot2 = MaterialFeet; break; } return slot2; @@ -4203,14 +4203,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(MainPrimary); + bool equiped = m_inv.GetItem(SlotPrimary); if (!equiped) skill = SkillHandtoHand; else { - uint8 type = m_inv.GetItem(MainPrimary)->GetItem()->ItemType; //is this the best way to do this? + uint8 type = m_inv.GetItem(SlotPrimary)->GetItem()->ItemType; //is this the best way to do this? switch (type) { @@ -5391,7 +5391,7 @@ bool Client::TryReward(uint32 claim_id) // save uint32 free_slot = 0xFFFFFFFF; - for (int i = EmuConstants::GENERAL_BEGIN; i <= EmuConstants::GENERAL_END; ++i) { + for (int i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; ++i) { ItemInst *item = GetInv().GetItem(i); if (!item) { free_slot = i; @@ -5737,30 +5737,30 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) { } } - inst = requestee->GetInv().GetItem(MainPowerSource); + inst = requestee->GetInv().GetItem(SlotPowerSource); if(inst) { item = inst->GetItem(); if(item) { // we shouldn't do this..but, that's the way it's coded atm... // (this type of action should be handled exclusively in the client translator) - strcpy(insr->itemnames[SoF::slots::MainPowerSource], item->Name); - insr->itemicons[SoF::slots::MainPowerSource] = item->Icon; + strcpy(insr->itemnames[SoF::inventory::SlotPowerSource], item->Name); + insr->itemicons[SoF::inventory::SlotPowerSource] = item->Icon; } else - insr->itemicons[SoF::slots::MainPowerSource] = 0xFFFFFFFF; + insr->itemicons[SoF::inventory::SlotPowerSource] = 0xFFFFFFFF; } - inst = requestee->GetInv().GetItem(MainAmmo); + inst = requestee->GetInv().GetItem(SlotAmmo); if(inst) { item = inst->GetItem(); if(item) { - strcpy(insr->itemnames[SoF::slots::MainAmmo], item->Name); - insr->itemicons[SoF::slots::MainAmmo] = item->Icon; + strcpy(insr->itemnames[SoF::inventory::SlotAmmo], item->Name); + insr->itemicons[SoF::inventory::SlotAmmo] = item->Icon; } else - insr->itemicons[SoF::slots::MainAmmo] = 0xFFFFFFFF; + insr->itemicons[SoF::inventory::SlotAmmo] = 0xFFFFFFFF; } strcpy(insr->text, requestee->GetInspectMessage().text); @@ -6306,7 +6306,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid made_npc->drakkin_details = GetDrakkinDetails(); made_npc->d_melee_texture1 = GetEquipmentMaterial(MaterialPrimary); made_npc->d_melee_texture2 = GetEquipmentMaterial(MaterialSecondary); - for (int i = EmuConstants::MATERIAL_BEGIN; i <= EmuConstants::MATERIAL_END; i++) { + for (int i = EQEmu::Constants::MATERIAL_BEGIN; i <= EQEmu::Constants::MATERIAL_END; i++) { made_npc->armor_tint[i] = GetEquipmentColor(i); } made_npc->loottable_id = 0; @@ -7582,7 +7582,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 += EmuConstants::TEXT_LINK_BODY_LENGTH; } + if (!(delimiter_count & 1)) { i += EQEmu::Constants::TEXT_LINK_BODY_LENGTH; } ++delimiter_count; continue; } @@ -8007,17 +8007,17 @@ void Client::TickItemCheck() if(zone->tick_items.empty()) { return; } //Scan equip slots for items - for(i = EmuConstants::EQUIPMENT_BEGIN; i <= EmuConstants::EQUIPMENT_END; i++) + for (i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; i++) { TryItemTick(i); } //Scan main inventory + cursor - for(i = EmuConstants::GENERAL_BEGIN; i <= MainCursor; i++) + for (i = EQEmu::Constants::GENERAL_BEGIN; i <= SlotCursor; i++) { TryItemTick(i); } //Scan bags - for(i = EmuConstants::GENERAL_BAGS_BEGIN; i <= EmuConstants::CURSOR_BAG_END; i++) + for (i = EQEmu::Constants::GENERAL_BAGS_BEGIN; i <= EQEmu::Constants::CURSOR_BAG_END; i++) { TryItemTick(i); } @@ -8033,7 +8033,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 <= EmuConstants::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::Constants::EQUIPMENT_END)) { ItemInst* e_inst = (ItemInst*)inst; parse->EventItem(EVENT_ITEM_TICK, this, e_inst, nullptr, "", slot); @@ -8041,9 +8041,9 @@ void Client::TryItemTick(int slot) } //Only look at augs in main inventory - if(slot > EmuConstants::EQUIPMENT_END) { return; } + if (slot > EQEmu::Constants::EQUIPMENT_END) { return; } - for (int x = AUG_BEGIN; x < EmuConstants::ITEM_COMMON_SIZE; ++x) + for (int x = AUG_BEGIN; x < EQEmu::Constants::ITEM_COMMON_SIZE; ++x) { ItemInst * a_inst = inst->GetAugment(x); if(!a_inst) { continue; } @@ -8064,17 +8064,17 @@ void Client::TryItemTick(int slot) void Client::ItemTimerCheck() { int i; - for(i = EmuConstants::EQUIPMENT_BEGIN; i <= EmuConstants::EQUIPMENT_END; i++) + for (i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; i++) { TryItemTimer(i); } - for(i = EmuConstants::GENERAL_BEGIN; i <= MainCursor; i++) + for (i = EQEmu::Constants::GENERAL_BEGIN; i <= SlotCursor; i++) { TryItemTimer(i); } - for(i = EmuConstants::GENERAL_BAGS_BEGIN; i <= EmuConstants::CURSOR_BAG_END; i++) + for (i = EQEmu::Constants::GENERAL_BAGS_BEGIN; i <= EQEmu::Constants::CURSOR_BAG_END; i++) { TryItemTimer(i); } @@ -8096,11 +8096,11 @@ void Client::TryItemTimer(int slot) ++it_iter; } - if(slot > EmuConstants::EQUIPMENT_END) { + if (slot > EQEmu::Constants::EQUIPMENT_END) { return; } - for (int x = AUG_BEGIN; x < EmuConstants::ITEM_COMMON_SIZE; ++x) + for (int x = AUG_BEGIN; x < EQEmu::Constants::ITEM_COMMON_SIZE; ++x) { ItemInst * a_inst = inst->GetAugment(x); if(!a_inst) { @@ -8388,12 +8388,12 @@ void Client::ShowNumHits() int Client::GetQuiverHaste(int delay) { const ItemInst *pi = nullptr; - for (int r = EmuConstants::GENERAL_BEGIN; r <= EmuConstants::GENERAL_END; r++) { + for (int r = EQEmu::Constants::GENERAL_BEGIN; r <= EQEmu::Constants::GENERAL_END; r++) { pi = GetInv().GetItem(r); if (pi && pi->IsType(ItemClassContainer) && pi->GetItem()->BagType == BagTypeQuiver && pi->GetItem()->BagWR > 0) break; - if (r == EmuConstants::GENERAL_END) + if (r == EQEmu::Constants::GENERAL_END) // we will get here if we don't find a valid quiver return 0; } @@ -8427,7 +8427,7 @@ std::string Client::TextLink::GenerateLink() generate_body(); generate_text(); - if ((m_LinkBody.length() == EmuConstants::TEXT_LINK_BODY_LENGTH) && (m_LinkText.length() > 0)) { + if ((m_LinkBody.length() == EQEmu::Constants::TEXT_LINK_BODY_LENGTH) && (m_LinkText.length() > 0)) { m_Link.push_back(0x12); m_Link.append(m_LinkBody); m_Link.append(m_LinkText); @@ -8619,7 +8619,7 @@ void Client::TextLink::generate_text() bool Client::TextLink::DegenerateLinkBody(TextLinkBody_Struct& textLinkBodyStruct, const std::string& textLinkBody) { memset(&textLinkBodyStruct, 0, sizeof(TextLinkBody_Struct)); - if (textLinkBody.length() != EmuConstants::TEXT_LINK_BODY_LENGTH) { return false; } + if (textLinkBody.length() != EQEmu::Constants::TEXT_LINK_BODY_LENGTH) { return false; } textLinkBodyStruct.unknown_1 = (uint8)strtol(textLinkBody.substr(0, 1).c_str(), nullptr, 16); textLinkBodyStruct.item_id = (uint32)strtol(textLinkBody.substr(1, 5).c_str(), nullptr, 16); @@ -8657,7 +8657,7 @@ bool Client::TextLink::GenerateLinkBody(std::string& textLinkBody, const TextLin (0xFFFFFFFF & textLinkBodyStruct.hash) ); - if (textLinkBody.length() != EmuConstants::TEXT_LINK_BODY_LENGTH) { return false; } + if (textLinkBody.length() != EQEmu::Constants::TEXT_LINK_BODY_LENGTH) { return false; } return true; } @@ -8680,7 +8680,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, MainPowerSource); + SummonItem(itemid, 0, 0, 0, 0, 0, 0, false, SlotPowerSource); if (faction) { diff --git a/zone/client.h b/zone/client.h index f36422d3a..544007e9b 100644 --- a/zone/client.h +++ b/zone/client.h @@ -217,7 +217,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 = MainPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false, + virtual bool Attack(Mob* other, int Hand = 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); } @@ -813,7 +813,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 = MainCursor, 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 = 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 adf477538..76caa9942 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 = EmuConstants::EQUIPMENT_BEGIN; slot_id < EmuConstants::EQUIPMENT_END; slot_id++) { + for (int16 slot_id = EQEmu::Constants::EQUIPMENT_BEGIN; slot_id < EQEmu::Constants::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(MainSecondary); + bool equiped = CastToClient()->m_inv.GetItem(SlotSecondary); if (equiped) { - uint8 shield = CastToClient()->m_inv.GetItem(MainSecondary)->GetItem()->ItemType; + uint8 shield = CastToClient()->m_inv.GetItem(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(MainSecondary); + bool equiped = CastToClient()->m_inv.GetItem(SlotSecondary); if (equiped) { - uint8 shield = CastToClient()->m_inv.GetItem(MainSecondary)->GetItem()->ItemType; + uint8 shield = CastToClient()->m_inv.GetItem(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 = EmuConstants::EQUIPMENT_BEGIN; x <= MainCursor; x++) { // include cursor or not? + for (x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= 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 = EmuConstants::GENERAL_BAGS_BEGIN; x <= EmuConstants::GENERAL_BAGS_END; x++) { // include cursor bags or not? + for (x = EQEmu::Constants::GENERAL_BAGS_BEGIN; x <= EQEmu::Constants::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 = MainGeneral1; + int bagslot = SlotGeneral1; int reduction = 0; - for (int m = EmuConstants::GENERAL_BAGS_BEGIN + 10; m <= EmuConstants::GENERAL_BAGS_END; m += 10) { // include cursor bags or not? + for (int m = EQEmu::Constants::GENERAL_BAGS_BEGIN + 10; m <= EQEmu::Constants::GENERAL_BAGS_END; m += 10) { // include cursor bags or not? if (x >= m) { bagslot += 1; } @@ -1355,7 +1355,7 @@ uint32 Client::CalcCurrentWeight() This is the ONLY instance I have seen where the client is hard coded to particular Item IDs to set a certain property for an item. It is very odd. */ // SoD+ client has no weight for coin - if (EQLimits::CoinHasWeight(GetClientVersion())) { + if (EQEmu::Limits::CoinHasWeight(GetClientVersion())) { Total += (m_pp.platinum + m_pp.gold + m_pp.silver + m_pp.copper) / 4; } float Packrat = (float)spellbonuses.Packrat + (float)aabonuses.Packrat + (float)itembonuses.Packrat; @@ -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(MainSecondary); + const ItemInst *inst = m_inv.GetItem(SlotSecondary); if (inst) { if (inst->GetItem()->ItemType == ItemTypeShield) { ac -= inst->GetItem()->AC; shield_ac = inst->GetItem()->AC; - for (uint8 i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) { + for (uint8 i = AUG_BEGIN; i < EQEmu::Constants::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 fb7216b86..2c432b432 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -1314,7 +1314,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) } /* Set item material tint */ - for (int i = EmuConstants::MATERIAL_BEGIN; i <= EmuConstants::MATERIAL_END; i++) + for (int i = EQEmu::Constants::MATERIAL_BEGIN; i <= EQEmu::Constants::MATERIAL_END; i++) { if (m_pp.item_tint[i].RGB.UseTint == 1 || m_pp.item_tint[i].RGB.UseTint == 255) { @@ -1690,7 +1690,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) if (iter == m_inv.cursor_cbegin()) continue; const ItemInst *inst = *iter; - SendItemPacket(MainCursor, inst, ItemPacketSummonItem); + SendItemPacket(SlotCursor, inst, ItemPacketSummonItem); } } @@ -2028,7 +2028,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app) ItemInst *inst = database.CreateItem(item, charges); if (!AutoPutLootInInventory(*inst, true, true)) { - PutLootInInventory(MainCursor, *inst); + PutLootInInventory(SlotCursor, *inst); } Save(1); } @@ -2551,7 +2551,7 @@ void Client::Handle_OP_AltCurrencyPurchase(const EQApplicationPacket *app) ItemInst *inst = database.CreateItem(item, charges); if (!AutoPutLootInInventory(*inst, true, true)) { - PutLootInInventory(MainCursor, *inst); + PutLootInInventory(SlotCursor, *inst); } Save(1); @@ -2601,7 +2601,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, MainCursor); + SummonItem(item_id, reclaim->count, 0, 0, 0, 0, 0, 0, false, SlotCursor); AddAlternateCurrencyValue(reclaim->currency_id, -((int32)reclaim->count)); } /* QS: PlayerLogAlternateCurrencyTransactions :: Cursor to Item Storage */ @@ -2812,8 +2812,8 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) } uint32 ApplyPoisonSuccessResult = 0; ApplyPoison_Struct* ApplyPoisonData = (ApplyPoison_Struct*)app->pBuffer; - const ItemInst* PrimaryWeapon = GetInv().GetItem(MainPrimary); - const ItemInst* SecondaryWeapon = GetInv().GetItem(MainSecondary); + const ItemInst* PrimaryWeapon = GetInv().GetItem(SlotPrimary); + const ItemInst* SecondaryWeapon = GetInv().GetItem(SlotSecondary); const ItemInst* PoisonItemInstance = GetInv()[ApplyPoisonData->inventorySlot]; bool IsPoison = PoisonItemInstance && (PoisonItemInstance->GetItem()->ItemType == ItemTypePoison); @@ -2995,7 +2995,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) { case 0: // Adding an augment case 2: // Swapping augment - new_aug = user_inv.GetItem(MainCursor); + new_aug = user_inv.GetItem(SlotCursor); if (!new_aug) // Shouldn't get the OP code without the augment on the user's cursor, but maybe it's h4x. { @@ -3053,7 +3053,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) if (itemOneToPush) { DeleteItemInInventory(item_slot, 0, true); - DeleteItemInInventory(MainCursor, new_aug->IsStackable() ? 1 : 0, true); + DeleteItemInInventory(SlotCursor, new_aug->IsStackable() ? 1 : 0, true); if (solvent) { @@ -3064,7 +3064,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(MainCursor, *itemTwoToPush, true)) + if (!PutItemInInventory(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!"); @@ -3077,7 +3077,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) CalcBonuses(); - if (mat != _MaterialInvalid) + if (mat != MaterialInvalid) { SendWearChange(mat); // Visible item augged while equipped. Send WC in case ornamentation changed. } @@ -3142,13 +3142,13 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) CalcBonuses(); - if (mat != _MaterialInvalid) + if (mat != 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(MainCursor, *itemTwoToPush, true)) + if (!PutItemInInventory(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!"); @@ -3197,7 +3197,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) CalcBonuses(); - if (mat != _MaterialInvalid) + if (mat != MaterialInvalid) { SendWearChange(mat); } @@ -4073,7 +4073,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app) } else { - Message(0, "Error: castspell->inventoryslot >= %i (0x%04x)", MainCursor, castspell->inventoryslot); + Message(0, "Error: castspell->inventoryslot >= %i (0x%04x)", SlotCursor, castspell->inventoryslot); InterruptSpell(castspell->spell_id); } } @@ -4992,7 +4992,7 @@ void Client::Handle_OP_CrashDump(const EQApplicationPacket *app) void Client::Handle_OP_CreateObject(const EQApplicationPacket *app) { - DropItem(MainCursor); + DropItem(SlotCursor); return; } @@ -6906,7 +6906,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) return; } - ItemInst *CursorItemInst = GetInv().GetItem(MainCursor); + ItemInst *CursorItemInst = GetInv().GetItem(SlotCursor); bool Allowed = true; @@ -6954,7 +6954,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { GuildBankDepositAck(false, sentAction); - DeleteItemInInventory(MainCursor, 0, false); + DeleteItemInInventory(SlotCursor, 0, false); } break; @@ -6975,7 +6975,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) case GuildBankWithdraw: { - if (GetInv()[MainCursor]) + if (GetInv()[SlotCursor]) { Message_StringID(13, GUILD_BANK_EMPTY_HANDS); @@ -7021,7 +7021,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { PushItemOnCursor(*inst); - SendItemPacket(MainCursor, inst, ItemPacketSummonItem); + SendItemPacket(SlotCursor, inst, ItemPacketSummonItem); GuildBanks->DeleteItem(GuildID(), gbwis->Area, gbwis->SlotID, gbwis->Quantity); } @@ -7995,7 +7995,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app) const Item_Struct* item = nullptr; int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType); - for (int16 L = EmuConstants::EQUIPMENT_BEGIN; L <= MainWaist; L++) { + for (int16 L = EQEmu::Constants::EQUIPMENT_BEGIN; L <= SlotWaist; L++) { const ItemInst* inst = GetInv().GetItem(L); item = inst ? inst->GetItem() : nullptr; @@ -8015,15 +8015,15 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app) else { insr->itemicons[L] = 0xFFFFFFFF; } } - const ItemInst* inst = GetInv().GetItem(MainAmmo); + const ItemInst* inst = GetInv().GetItem(SlotAmmo); item = inst ? inst->GetItem() : nullptr; if (item) { // another one..I did these, didn't I!!? - strcpy(insr->itemnames[SoF::slots::MainAmmo], item->Name); - insr->itemicons[SoF::slots::MainAmmo] = item->Icon; + strcpy(insr->itemnames[SoF::inventory::SlotAmmo], item->Name); + insr->itemicons[SoF::inventory::SlotAmmo] = item->Icon; } - else { insr->itemicons[SoF::slots::MainAmmo] = 0xFFFFFFFF; } + else { insr->itemicons[SoF::inventory::SlotAmmo] = 0xFFFFFFFF; } InspectMessage_Struct* newmessage = (InspectMessage_Struct*)insr->text; InspectMessage_Struct& playermessage = this->GetInspectMessage(); @@ -8475,7 +8475,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) ItemInst* clickaug = 0; Item_Struct* augitem = 0; - for (r = 0; r < EmuConstants::ITEM_COMMON_SIZE; r++) { + for (r = 0; r < EQEmu::Constants::ITEM_COMMON_SIZE; r++) { const ItemInst* aug_i = inst->GetAugment(r); if (!aug_i) continue; @@ -9676,7 +9676,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 <= EmuConstants::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::Constants::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); @@ -9697,8 +9697,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 >= EmuConstants::GENERAL_BAGS_BEGIN && mi->from_slot <= EmuConstants::CURSOR_BAG_END) { - if (mi->from_slot >= EmuConstants::CURSOR_BAG_BEGIN) { mi_hack = true; } + 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; } else { int16 from_parent = m_inv.CalcSlotId(mi->from_slot); if (!m_inv[from_parent]) { mi_hack = true; } @@ -9707,8 +9707,8 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app) } } - if (mi->to_slot >= EmuConstants::GENERAL_BAGS_BEGIN && mi->to_slot <= EmuConstants::CURSOR_BAG_END) { - if (mi->to_slot >= EmuConstants::CURSOR_BAG_BEGIN) { mi_hack = true; } + 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; } else { int16 to_parent = m_inv.CalcSlotId(mi->to_slot); if (!m_inv[to_parent]) { mi_hack = true; } @@ -12024,7 +12024,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(MainSecondary); + ItemInst* inst = GetInv().GetItem(SlotSecondary); if (!shield_target) return; if (inst) @@ -12241,8 +12241,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 == MainCursor) { - if (m_inv.GetItem(MainCursor) != nullptr) { + if (freeslotid == SlotCursor) { + if (m_inv.GetItem(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 3154a9ca9..69de6ef85 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -296,7 +296,7 @@ bool Client::Process() { } if(AutoFireEnabled()){ - ItemInst *ranged = GetInv().GetItem(MainRange); + ItemInst *ranged = GetInv().GetItem(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(MainPrimary); - TryWeaponProc(wpn, auto_attack_target, MainPrimary); + ItemInst *wpn = GetInv().GetItem(SlotPrimary); + TryWeaponProc(wpn, auto_attack_target, SlotPrimary); - DoAttackRounds(auto_attack_target, MainPrimary); + DoAttackRounds(auto_attack_target, 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(MainSecondary); - TryWeaponProc(wpn, auto_attack_target, MainSecondary); + ItemInst *wpn = GetInv().GetItem(SlotSecondary); + TryWeaponProc(wpn, auto_attack_target, SlotSecondary); - DoAttackRounds(auto_attack_target, MainSecondary); + DoAttackRounds(auto_attack_target, 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 = EmuConstants::TRADE_BEGIN; slot_id <= EmuConstants::TRADE_END; slot_id++) { + for(slot_id = EQEmu::Constants::TRADE_BEGIN; slot_id <= EQEmu::Constants::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 = MAIN_BEGIN; slot_id < EmuConstants::MAP_POSSESSIONS_SIZE; slot_id++) { + for(slot_id = SLOT_BEGIN; slot_id < EQEmu::Constants::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(GetClientVersion() >= ClientVersion::SoF) { - const ItemInst* inst = m_inv[MainPowerSource]; + const ItemInst* inst = m_inv[SlotPowerSource]; if(inst) { - std::string packet = inst->Serialize(MainPowerSource); + std::string packet = inst->Serialize(SlotPowerSource); ser_items[i++] = packet; size += packet.length(); } } // Bank items - for(slot_id = EmuConstants::BANK_BEGIN; slot_id <= EmuConstants::BANK_END; slot_id++) { + for(slot_id = EQEmu::Constants::BANK_BEGIN; slot_id <= EQEmu::Constants::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 = EmuConstants::SHARED_BANK_BEGIN; slot_id <= EmuConstants::SHARED_BANK_END; slot_id++) { + for(slot_id = EQEmu::Constants::SHARED_BANK_BEGIN; slot_id <= EQEmu::Constants::SHARED_BANK_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst) { std::string packet = inst->Serialize(slot_id); @@ -851,14 +851,14 @@ void Client::BulkSendInventoryItems() if(deletenorent){//client was offline for more than 30 minutes, delete no rent items RemoveNoRent(); } - for (slot_id=EmuConstants::POSSESSIONS_BEGIN; slot_id<=EmuConstants::POSSESSIONS_END; slot_id++) { + for (slot_id=EQEmu::Constants::POSSESSIONS_BEGIN; slot_id<=EQEmu::Constants::POSSESSIONS_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if (inst){ SendItemPacket(slot_id, inst, ItemPacketCharInventory); } } // Bank items - for (slot_id=EmuConstants::BANK_BEGIN; slot_id<=EmuConstants::BANK_END; slot_id++) { // 2015... + for (slot_id=EQEmu::Constants::BANK_BEGIN; slot_id<=EQEmu::Constants::BANK_END; slot_id++) { // 2015... const ItemInst* inst = m_inv[slot_id]; if (inst){ SendItemPacket(slot_id, inst, ItemPacketCharInventory); @@ -866,7 +866,7 @@ void Client::BulkSendInventoryItems() } // Shared Bank items - for (slot_id=EmuConstants::SHARED_BANK_BEGIN; slot_id<=EmuConstants::SHARED_BANK_END; slot_id++) { + for (slot_id=EQEmu::Constants::SHARED_BANK_BEGIN; slot_id<=EQEmu::Constants::SHARED_BANK_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if (inst){ SendItemPacket(slot_id, inst, ItemPacketCharInventory); @@ -876,7 +876,7 @@ void Client::BulkSendInventoryItems() // LINKDEAD TRADE ITEMS // If player went LD during a trade, they have items in the trade inventory // slots. These items are now being put into their inventory (then queue up on cursor) - for (int16 trade_slot_id=EmuConstants::TRADE_BEGIN; trade_slot_id<=EmuConstants::TRADE_END; trade_slot_id++) { + for (int16 trade_slot_id=EQEmu::Constants::TRADE_BEGIN; trade_slot_id<=EQEmu::Constants::TRADE_END; trade_slot_id++) { const ItemInst* inst = m_inv[slot_id]; if (inst) { int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size); @@ -1147,7 +1147,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app) switch(memspell->scribing) { case memSpellScribing: { // scribing spell to book - const ItemInst* inst = m_inv[MainCursor]; + const ItemInst* inst = m_inv[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(MainCursor, 1, true); + DeleteItemInInventory(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 dbbed07db..b3f00eed3 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 = EmuConstants::MATERIAL_BEGIN; i <= EmuConstants::MATERIAL_TINT_END; i++) + for (i = EQEmu::Constants::MATERIAL_BEGIN; i <= EQEmu::Constants::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 = EmuConstants::MATERIAL_BEGIN; i <= EmuConstants::MATERIAL_TINT_END; i++) + for (i = EQEmu::Constants::MATERIAL_BEGIN; i <= EQEmu::Constants::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 = EmuConstants::EQUIPMENT_BEGIN; (scopeWhere & peekWorn) && (indexMain <= EmuConstants::EQUIPMENT_END); ++indexMain) { + for (int16 indexMain = EQEmu::Constants::EQUIPMENT_BEGIN; (scopeWhere & peekWorn) && (indexMain <= EQEmu::Constants::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->GetClientVersion() >= ClientVersion::SoF)) { - inst_main = targetClient->GetInv().GetItem(MainPowerSource); + inst_main = targetClient->GetInv().GetItem(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", - MainPowerSource, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges())); + SlotPowerSource, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges())); } // inv - for (int16 indexMain = EmuConstants::GENERAL_BEGIN; (scopeWhere & peekInv) && (indexMain <= EmuConstants::GENERAL_END); ++indexMain) { + for (int16 indexMain = EQEmu::Constants::GENERAL_BEGIN; (scopeWhere & peekInv) && (indexMain <= EQEmu::Constants::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_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EmuConstants::ITEM_CONTAINER_SIZE); ++indexSub) { + for (uint8 indexSub = SUB_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::Constants::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", - MainCursor, 0, item_link.c_str(), 0); + 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", - MainCursor, cursorDepth, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges())); + SlotCursor, cursorDepth, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges())); - for (uint8 indexSub = SUB_BEGIN; (cursorDepth == 0) && inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EmuConstants::ITEM_CONTAINER_SIZE); ++indexSub) { + for (uint8 indexSub = SUB_BEGIN; (cursorDepth == 0) && inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::Constants::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(MainCursor, indexSub), MainCursor, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges())); + Inventory::CalcSlotId(SlotCursor, indexSub), SlotCursor, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges())); } } } } // trib - for (int16 indexMain = EmuConstants::TRIBUTE_BEGIN; (scopeWhere & peekTrib) && (indexMain <= EmuConstants::TRIBUTE_END); ++indexMain) { + for (int16 indexMain = EQEmu::Constants::TRIBUTE_BEGIN; (scopeWhere & peekTrib) && (indexMain <= EQEmu::Constants::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 = EmuConstants::BANK_BEGIN; (scopeWhere & peekBank) && (indexMain <= EmuConstants::BANK_END); ++indexMain) { + for (int16 indexMain = EQEmu::Constants::BANK_BEGIN; (scopeWhere & peekBank) && (indexMain <= EQEmu::Constants::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_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EmuConstants::ITEM_CONTAINER_SIZE); ++indexSub) { + for (uint8 indexSub = SUB_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::Constants::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 = EmuConstants::SHARED_BANK_BEGIN; (scopeWhere & peekBank) && (indexMain <= EmuConstants::SHARED_BANK_END); ++indexMain) { + for (int16 indexMain = EQEmu::Constants::SHARED_BANK_BEGIN; (scopeWhere & peekBank) && (indexMain <= EQEmu::Constants::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_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EmuConstants::ITEM_CONTAINER_SIZE); ++indexSub) { + for (uint8 indexSub = SUB_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::Constants::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 = EmuConstants::TRADE_BEGIN; (scopeWhere & peekTrade) && (indexMain <= EmuConstants::TRADE_END); ++indexMain) { + for (int16 indexMain = EQEmu::Constants::TRADE_BEGIN; (scopeWhere & peekTrade) && (indexMain <= EQEmu::Constants::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_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EmuConstants::ITEM_CONTAINER_SIZE); ++indexSub) { + for (uint8 indexSub = SUB_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::Constants::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 = MAIN_BEGIN; indexMain < EmuConstants::MAP_WORLD_SIZE; ++indexMain) { + for (int16 indexMain = SLOT_BEGIN; indexMain < EQEmu::Constants::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", - (EmuConstants::WORLD_BEGIN + indexMain), ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges())); + (EQEmu::Constants::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_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EmuConstants::ITEM_CONTAINER_SIZE); ++indexSub) { + for (uint8 indexSub = SUB_BEGIN; inst_main && inst_main->IsType(ItemClassContainer) && (indexSub < EQEmu::Constants::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 >= EmuConstants::EQUIPMENT_BEGIN) && (slot_id <= EmuConstants::EQUIPMENT_END) || (slot_id == MainPowerSource))) { - const ItemInst* from_inst = c->GetInv().GetItem(MainCursor); + 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); 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 = MainCursor; + mi->from_slot = 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()[MainCursor]; + auto inst = c->GetInv()[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) > EmuConstants::TEXT_LINK_BODY_LENGTH) { + if (link_open != link_close && (cmd_msg.length() - link_open) > EQEmu::Constants::TEXT_LINK_BODY_LENGTH) { TextLinkBody_Struct link_body; - Client::TextLink::DegenerateLinkBody(link_body, cmd_msg.substr(link_open + 1, EmuConstants::TEXT_LINK_BODY_LENGTH)); + Client::TextLink::DegenerateLinkBody(link_body, cmd_msg.substr(link_open + 1, EQEmu::Constants::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 = EmuConstants::MATERIAL_BEGIN; cur_slot <= EmuConstants::MATERIAL_END; cur_slot++ ) { + for (int cur_slot = EQEmu::Constants::MATERIAL_BEGIN; cur_slot <= EQEmu::Constants::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 b0e9bef0d..45d4eeb53 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 = MAIN_BEGIN; i < EmuConstants::MAP_POSSESSIONS_SIZE; ++i) { - if(i == MainAmmo && client->GetClientVersion() >= ClientVersion::SoF) { - item = client->GetInv().GetItem(MainPowerSource); + for(i = SLOT_BEGIN; i < EQEmu::Constants::TYPE_POSSESSIONS_SIZE; ++i) { + if(i == SlotAmmo && client->GetClientVersion() >= ClientVersion::SoF) { + item = client->GetInv().GetItem(SlotPowerSource); if (item != nullptr) { if (!client->IsBecomeNPC() || (client->IsBecomeNPC() && !item->GetItem()->NoRent)) - MoveItemToCorpse(client, item, MainPowerSource, removed_list); + MoveItemToCorpse(client, item, 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 < EmuConstants::GENERAL_BEGIN || equipSlot > MainCursor) { break; } + if (equipSlot < EQEmu::Constants::GENERAL_BEGIN || equipSlot > SlotCursor) { break; } - for (auto sub_index = SUB_BEGIN; sub_index < EmuConstants::ITEM_CONTAINER_SIZE; ++sub_index) { + for (auto sub_index = SUB_BEGIN; sub_index < EQEmu::Constants::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 != 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(EmuConstants::CORPSE_BEGIN, inst, ItemPacketLoot); + client->SendItemPacket(EQEmu::Constants::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 = EQLimits::InventoryMapSize(MapCorpse, client->GetClientVersion()); + int corpselootlimit = EQEmu::Limits::InventoryMapSize(TypeCorpse, client->GetClientVersion()); 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 <= MainCursor || item_data->equip_slot == MainPowerSource || Loot_Request_Type>=3 || + if(!IsPlayerCorpse() || item_data->equip_slot <= SlotCursor || item_data->equip_slot == 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); @@ -1018,8 +1018,8 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a if(inst) { if (item->RecastDelay) inst->SetRecastTimestamp(timestamps.count(item->RecastType) ? timestamps.at(item->RecastType) : 0); - // MainGeneral1 is the corpse inventory start offset for Ti(EMu) - CORPSE_END = MainGeneral1 + MainCursor - client->SendItemPacket(i + EmuConstants::CORPSE_BEGIN, inst, ItemPacketLoot); + // SlotGeneral1 is the corpse inventory start offset for Ti(EMu) - CORPSE_END = SlotGeneral1 + SlotCursor + client->SendItemPacket(i + EQEmu::Constants::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 - EmuConstants::CORPSE_BEGIN); //dont allow them to loot entire bags of items as pvp reward + item_data = GetItem(lootitem->slot_id - EQEmu::Constants::CORPSE_BEGIN); //dont allow them to loot entire bags of items as pvp reward } else{ - item_data = GetItem(lootitem->slot_id - EmuConstants::CORPSE_BEGIN, bag_item_data); + item_data = GetItem(lootitem->slot_id - EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) { + for (int i = AUG_BEGIN; i < EQEmu::Constants::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(MainCursor, *inst, bag_item_data); + client->PutLootInInventory(SlotCursor, *inst, bag_item_data); } else { - client->PutLootInInventory(MainCursor, *inst, bag_item_data); + client->PutLootInInventory(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_BEGIN; i < EmuConstants::ITEM_CONTAINER_SIZE; i++) { + for (int i = SUB_BEGIN; i < EQEmu::Constants::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 = EQLimits::InventoryMapSize(MapCorpse, to->GetClientVersion()); + int corpselootlimit = EQEmu::Limits::InventoryMapSize(TypeCorpse, to->GetClientVersion()); for(; cur != end; ++cur) { ServerLootItem_Struct* sitem = *cur; if (IsPlayerCorpse()) { - if (sitem->equip_slot >= EmuConstants::GENERAL_BAGS_BEGIN && sitem->equip_slot <= EmuConstants::CURSOR_BAG_END) + if (sitem->equip_slot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && sitem->equip_slot <= EQEmu::Constants::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 > EmuConstants::MATERIAL_END) { + if(material_slot > EQEmu::Constants::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 > EmuConstants::MATERIAL_END) { + if(material_slot > EQEmu::Constants::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 < EmuConstants::EQUIPMENT_BEGIN || (*iter)->equip_slot > EmuConstants::EQUIPMENT_END) && (*iter)->equip_slot != MainPowerSource) { continue; } - if ((*iter)->equip_slot == MainAmmo) { continue; } + 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; } 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 < EmuConstants::GENERAL_BEGIN || (*iter)->equip_slot > EmuConstants::GENERAL_END) { continue; } + if ((*iter)->equip_slot < EQEmu::Constants::GENERAL_BEGIN || (*iter)->equip_slot > EQEmu::Constants::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 a9916f4fd..365084b43 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 = MainPrimary, bool FromRiposte = false, bool IsStrikethrough = true, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0) { return false; } + 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 HasRaid() { return false; } virtual bool HasGroup() { return false; } virtual Raid* GetRaid() { return 0; } diff --git a/zone/doors.cpp b/zone/doors.cpp index d5ad8064d..a12c74fd0 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(MainCursor); + const ItemInst *lockpicks = sender->GetInv().GetItem(SlotCursor); haskey = sender->GetInv().HasItem(keyneeded, 1); diff --git a/zone/encounter.h b/zone/encounter.h index e341fc7ae..aa22d3870 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 = MainPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false, + virtual bool Attack(Mob* other, int Hand = 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 986a60d99..f373e4251 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 = MainPrimary, int count = 0, bool IsFromSpell = false); + void AEAttack(Mob *attacker, float dist, int Hand = 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 89d4e254f..8d8762fb7 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[MainPrimary]; + const ItemInst* Pole = m_inv[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 >= EmuConstants::GENERAL_BEGIN && Bait != nullptr && Bait->GetItem()->SkillModType == SkillFishing) { + if (bslot >= EQEmu::Constants::GENERAL_BEGIN && Bait != nullptr && Bait->GetItem()->SkillModType == SkillFishing) { fishing_skill += Bait->GetItem()->SkillModValue; } @@ -317,12 +317,12 @@ void Client::GoFish() else { PushItemOnCursor(*inst); - SendItemPacket(MainCursor, inst, ItemPacketSummonItem); + SendItemPacket(SlotCursor, inst, ItemPacketSummonItem); if(RuleB(TaskSystem, EnableTaskSystem)) UpdateTasksForItem(ActivityFish, food_id); safe_delete(inst); - inst = m_inv.GetItem(MainCursor); + inst = m_inv.GetItem(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(MainPrimary, 0, true); + DeleteItemInInventory(SlotPrimary, 0, true); } if(CheckIncreaseSkill(SkillFishing, nullptr, 5)) @@ -433,12 +433,12 @@ void Client::ForageItem(bool guarantee) { } else { PushItemOnCursor(*inst); - SendItemPacket(MainCursor, inst, ItemPacketSummonItem); + SendItemPacket(SlotCursor, inst, ItemPacketSummonItem); if(RuleB(TaskSystem, EnableTaskSystem)) UpdateTasksForItem(ActivityForage, foragedfood); safe_delete(inst); - inst = m_inv.GetItem(MainCursor); + inst = m_inv.GetItem(SlotCursor); } if(inst) { diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 9f7f061a0..ae1bbb63b 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 = EmuConstants::EQUIPMENT_BEGIN; i <= EmuConstants::EQUIPMENT_END; i++) { + for (i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::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(MainPowerSource) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(MainPowerSource) != INVALID_ID)) { - cur = m_inv.GetItem(MainPowerSource); + if (GetItemIDAt(SlotPowerSource) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(SlotPowerSource) != INVALID_ID)) { + cur = m_inv.GetItem(SlotPowerSource); if(cur && cur->GetItem()->Stackable) { x += cur->GetCharges(); } else { @@ -57,25 +57,25 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) { } if (GetClientVersion() >= ClientVersion::SoF) - DeleteItemInInventory(MainPowerSource, 0, true); + DeleteItemInInventory(SlotPowerSource, 0, true); else - DeleteItemInInventory(MainPowerSource, 0, false); // Prevents Titanium crash + DeleteItemInInventory(SlotPowerSource, 0, false); // Prevents Titanium crash } } if(where_to_check & invWhereCursor) { - if (GetItemIDAt(MainCursor) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(MainCursor) != INVALID_ID)) { - cur = m_inv.GetItem(MainCursor); + if (GetItemIDAt(SlotCursor) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(SlotCursor) != INVALID_ID)) { + cur = m_inv.GetItem(SlotCursor); if(cur && cur->GetItem()->Stackable) { x += cur->GetCharges(); } else { x++; } - DeleteItemInInventory(MainCursor, 0, true); + DeleteItemInInventory(SlotCursor, 0, true); } - for (i = EmuConstants::CURSOR_BAG_BEGIN; i <= EmuConstants::CURSOR_BAG_END; i++) { + for (i = EQEmu::Constants::CURSOR_BAG_BEGIN; i <= EQEmu::Constants::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 = EmuConstants::GENERAL_BEGIN; i <= EmuConstants::GENERAL_END; i++) { + for (i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::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 = EmuConstants::GENERAL_BAGS_BEGIN; i <= EmuConstants::GENERAL_BAGS_END; i++) { + for (i = EQEmu::Constants::GENERAL_BAGS_BEGIN; i <= EQEmu::Constants::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 = EmuConstants::BANK_BEGIN; i <= EmuConstants::BANK_END; i++) { + for (i = EQEmu::Constants::BANK_BEGIN; i <= EQEmu::Constants::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 = EmuConstants::BANK_BAGS_BEGIN; i <= EmuConstants::BANK_BAGS_END; i++) { + for (i = EQEmu::Constants::BANK_BAGS_BEGIN; i <= EQEmu::Constants::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 = EmuConstants::SHARED_BANK_BEGIN; i <= EmuConstants::SHARED_BANK_END; i++) { + for (i = EQEmu::Constants::SHARED_BANK_BEGIN; i <= EQEmu::Constants::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 = EmuConstants::SHARED_BANK_BAGS_BEGIN; i <= EmuConstants::SHARED_BANK_BAGS_END; i++) { + for (i = EQEmu::Constants::SHARED_BANK_BAGS_BEGIN; i <= EQEmu::Constants::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[EmuConstants::ITEM_COMMON_SIZE] = { aug1, aug2, aug3, aug4, aug5, aug6 }; + uint32 augments[EQEmu::Constants::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_BEGIN; iter < EmuConstants::ITEM_COMMON_SIZE; ++iter) { + for (int iter = AUG_BEGIN; iter < EQEmu::Constants::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_BEGIN; iter < EmuConstants::ITEM_COMMON_SIZE; ++iter) { + for (int iter = AUG_BEGIN; iter < EQEmu::Constants::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 >= MainCharm) && (to_slot <= MainAmmo)) || (to_slot == MainPowerSource))) { - uint32 slottest = (to_slot == MainPowerSource) ? 22 : to_slot; // can't change '22' just yet... + 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(!(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 = MainCursor; + to_slot = SlotCursor; } } // put item into inventory - if (to_slot == MainCursor) { + if (to_slot == SlotCursor) { PushItemOnCursor(*inst); - SendItemPacket(MainCursor, inst, ItemPacketSummonItem); + SendItemPacket(SlotCursor, inst, ItemPacketSummonItem); } else { PutItemInInventory(to_slot, *inst, true); @@ -583,7 +583,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, DiscoverItem(item_id); /* // Augments should have been discovered prior to being placed on an item. - for (int iter = AUG_BEGIN; iter < EmuConstants::ITEM_COMMON_SIZE; ++iter) { + for (int iter = AUG_BEGIN; iter < EQEmu::Constants::ITEM_COMMON_SIZE; ++iter) { if(augments[iter] && !IsDiscovered(augments[iter])) DiscoverItem(augments[iter]); } @@ -617,7 +617,7 @@ void Client::DropItem(int16 slot_id) } // Save client inventory change to database - if (slot_id == MainCursor) { + if (slot_id == 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(MainCursor); + DeleteItemInInventory(SlotCursor); SendCursorBuffer(); } else { - SendItemPacket(MainCursor, test_inst, ItemPacketSummonItem); + SendItemPacket(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 == MainCursor) { + if (slot_id == 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(MainCursor, &inst, ItemPacketSummonItem); + SendItemPacket(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 == MainCursor) { // don't trust macros before conditional statements... + if (slot_id == 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 == MainCursor) ? ItemPacketSummonItem : ItemPacketTrade)); + SendItemPacket(slot_id, &inst, ((slot_id == SlotCursor) ? ItemPacketSummonItem : ItemPacketTrade)); //SendWearChange(Inventory::CalcMaterialFromSlot(slot_id)); } - if (slot_id == MainCursor) { + if (slot_id == 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 == MainCursor) { + if (slot_id == 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 == MainCursor && !cursor_empty) { + if (slot_id == SlotCursor && !cursor_empty) { // RoF+ currently has a specialized cursor handler if (GetClientVersion() < 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 < EmuConstants::ITEM_CONTAINER_SIZE; ++index) { + for (int index = 0; index < EQEmu::Constants::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 == MainCursor && !cursor_empty) { + if (slot_id == 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, MainCursor); + inst.GetItem()->Name, inst.GetItem()->ID, SlotCursor); - PutLootInInventory(MainCursor, *bagitem); + PutLootInInventory(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 = EmuConstants::GENERAL_BEGIN; i <= EmuConstants::GENERAL_END; i++) { + for (i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::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 = EmuConstants::GENERAL_BEGIN; i <= EmuConstants::GENERAL_END; i++) { - for (uint8 j = SUB_BEGIN; j < EmuConstants::ITEM_CONTAINER_SIZE; j++) { + for (i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++) { + for (uint8 j = SUB_BEGIN; j < EQEmu::Constants::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 = EmuConstants::EQUIPMENT_BEGIN; i < MainPowerSource; i++) { // originally (i < 22) - if (i == EmuConstants::GENERAL_BEGIN) { + for (int16 i = EQEmu::Constants::EQUIPMENT_BEGIN; i < SlotPowerSource; i++) { // originally (i < 22) + if (i == EQEmu::Constants::GENERAL_BEGIN) { // added power source check for SoF+ clients if (this->GetClientVersion() >= ClientVersion::SoF) - i = MainPowerSource; + i = SlotPowerSource; else break; } if (!m_inv[i]) { - if (i == MainPrimary && inst.IsWeapon()) { // If item is primary slot weapon + if (i == 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[MainSecondary]) { // and if secondary slot is not empty + if (m_inv[SlotSecondary]) { // and if secondary slot is not empty continue; // Can't auto-equip } } } - if (i == MainSecondary && m_inv[MainPrimary]) { // check to see if primary slot is a two hander - uint8 use = m_inv[MainPrimary]->GetItem()->ItemType; + if (i == SlotSecondary && m_inv[SlotPrimary]) { // check to see if primary slot is a two hander + uint8 use = m_inv[SlotPrimary]->GetItem()->ItemType; if (use == ItemType2HSlash || use == ItemType2HBlunt || use == ItemType2HPiercing) continue; } - if (i == MainSecondary && inst.IsWeapon() && !CanThisClassDualWield()) { + if (i == 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 != 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 == MainCursor) { + if (to_slot == 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 >= MAIN_BEGIN && slot < EmuConstants::MAP_POSSESSIONS_SIZE) || - (slot >= EmuConstants::GENERAL_BAGS_BEGIN && slot <= EmuConstants::CURSOR_BAG_END) || - (slot >= EmuConstants::TRIBUTE_BEGIN && slot <= EmuConstants::TRIBUTE_END) || - (slot >= EmuConstants::BANK_BEGIN && slot <= EmuConstants::BANK_END) || - (slot >= EmuConstants::BANK_BAGS_BEGIN && slot <= EmuConstants::BANK_BAGS_END) || - (slot >= EmuConstants::SHARED_BANK_BEGIN && slot <= EmuConstants::SHARED_BANK_END) || - (slot >= EmuConstants::SHARED_BANK_BAGS_BEGIN && slot <= EmuConstants::SHARED_BANK_BAGS_END) || - (slot >= EmuConstants::TRADE_BEGIN && slot <= EmuConstants::TRADE_END) || - (slot >= EmuConstants::WORLD_BEGIN && slot <= EmuConstants::WORLD_END) || - (slot == MainPowerSource) + (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) ) { return true; } @@ -1338,10 +1338,10 @@ bool Client::IsValidSlot(uint32 slot) { bool Client::IsBankSlot(uint32 slot) { - if ((slot >= EmuConstants::BANK_BEGIN && slot <= EmuConstants::BANK_END) || - (slot >= EmuConstants::BANK_BAGS_BEGIN && slot <= EmuConstants::BANK_BAGS_END) || - (slot >= EmuConstants::SHARED_BANK_BEGIN && slot <= EmuConstants::SHARED_BANK_END) || - (slot >= EmuConstants::SHARED_BANK_BAGS_BEGIN && slot <= EmuConstants::SHARED_BANK_BAGS_END)) + 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)) { return true; } @@ -1377,8 +1377,8 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit if (GetClientVersion() >= ClientVersion::RoF) { return true; } // Can't do RoF+ - if (move_in->to_slot == MainCursor) { - auto test_inst = m_inv.GetItem(MainCursor); + if (move_in->to_slot == SlotCursor) { + auto test_inst = m_inv.GetItem(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(MainCursor, 0, true); + DeleteItemInInventory(SlotCursor, 0, true); } } return true; } if (move_in->to_slot == (uint32)INVALID_INDEX) { - if (move_in->from_slot == (uint32)MainCursor) { + if (move_in->from_slot == (uint32)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(MainCursor); + ItemInst *inst = m_inv.GetItem(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 == MainPrimary || move_in->from_slot == MainSecondary || move_in->from_slot == MainRange)) + if(auto_attack && (move_in->from_slot == SlotPrimary || move_in->from_slot == SlotSecondary || move_in->from_slot == SlotRange)) SetAttackTimer(); - else if(auto_attack && (move_in->to_slot == MainPrimary || move_in->to_slot == MainSecondary || move_in->to_slot == MainRange)) + else if(auto_attack && (move_in->to_slot == SlotPrimary || move_in->to_slot == SlotSecondary || move_in->to_slot == 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 >= EmuConstants::GENERAL_BAGS_BEGIN && src_slot_id <= EmuConstants::GENERAL_BAGS_END) { + if (src_slot_id >= EQEmu::Constants::GENERAL_BAGS_BEGIN && src_slot_id <= EQEmu::Constants::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 >= EmuConstants::GENERAL_BAGS_BEGIN && dst_slot_id <= EmuConstants::GENERAL_BAGS_END) { + if (dst_slot_id >= EQEmu::Constants::GENERAL_BAGS_BEGIN && dst_slot_id <= EQEmu::Constants::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 < EmuConstants::WORLD_BEGIN || src_slot_id > EmuConstants::WORLD_END)) { + if (!src_inst && (src_slot_id < EQEmu::Constants::WORLD_BEGIN || src_slot_id > EQEmu::Constants::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 >= EmuConstants::SHARED_BANK_BEGIN && src_slot_id <= EmuConstants::SHARED_BANK_BAGS_END) { + if(src_inst && src_slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::Constants::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 >= EmuConstants::SHARED_BANK_BEGIN && src_slot_id <= EmuConstants::SHARED_BANK_END && src_inst->IsType(ItemClassContainer)){ - for (uint8 idx = SUB_BEGIN; idx < EmuConstants::ITEM_CONTAINER_SIZE; idx++) { + 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_BEGIN; idx < EQEmu::Constants::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 >= EmuConstants::SHARED_BANK_BEGIN && dst_slot_id <= EmuConstants::SHARED_BANK_BAGS_END) { + if(dst_inst && dst_slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::Constants::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 >= EmuConstants::SHARED_BANK_BEGIN && dst_slot_id <= EmuConstants::SHARED_BANK_END && dst_inst->IsType(ItemClassContainer)){ - for (uint8 idx = SUB_BEGIN; idx < EmuConstants::ITEM_CONTAINER_SIZE; idx++) { + 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_BEGIN; idx < EQEmu::Constants::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 >= EmuConstants::TRADE_BEGIN && dst_slot_id <= EmuConstants::TRADE_END) || - (dst_slot_id >= EmuConstants::SHARED_BANK_BEGIN && dst_slot_id <= EmuConstants::SHARED_BANK_BAGS_END)) + 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)) && 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 >= EmuConstants::WORLD_BEGIN && src_slot_id <= EmuConstants::WORLD_END) { + if (src_slot_id >= EQEmu::Constants::WORLD_BEGIN && src_slot_id <= EQEmu::Constants::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 >= EmuConstants::WORLD_BEGIN && dst_slot_id <= EmuConstants::WORLD_END) { + else if (dst_slot_id >= EQEmu::Constants::WORLD_BEGIN && dst_slot_id <= EQEmu::Constants::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 == MainCursor) + if (src_slot_id == 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 >= EmuConstants::TRADE_BEGIN && dst_slot_id <= EmuConstants::TRADE_END) { - if (src_slot_id != MainCursor) { + if (dst_slot_id >= EQEmu::Constants::TRADE_BEGIN && dst_slot_id <= EQEmu::Constants::TRADE_END) { + if (src_slot_id != 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[MainCursor]) { + if (!m_inv[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(MainCursor); + DeleteItemInInventory(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 <= EmuConstants::EQUIPMENT_END || dst_slot_id == MainPowerSource) && dst_slot_id >= EmuConstants::EQUIPMENT_BEGIN) { + if(src_inst && (dst_slot_id <= EQEmu::Constants::EQUIPMENT_END || dst_slot_id == SlotPowerSource) && dst_slot_id >= EQEmu::Constants::EQUIPMENT_BEGIN) { if (src_inst->GetItem()->Attuneable) { src_inst->SetAttuned(true); } if (src_inst->IsAugmented()) { - for (int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) { + for (int i = AUG_BEGIN; i < EQEmu::Constants::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 <= EmuConstants::EQUIPMENT_END || src_slot_id == MainPowerSource) { + if(src_slot_id <= EQEmu::Constants::EQUIPMENT_END || src_slot_id == 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 <= EmuConstants::EQUIPMENT_END || dst_slot_id == MainPowerSource) { + if(dst_slot_id <= EQEmu::Constants::EQUIPMENT_END || dst_slot_id == 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 <= EmuConstants::EQUIPMENT_END && matslot != MaterialHead) { // think this is to allow the client to update with /showhelm + if (dst_slot_id <= EQEmu::Constants::EQUIPMENT_END && matslot != 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 == MainCursor) { + if (src_slot_id == 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 == MainCursor) { + if (dst_slot_id == 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 >= EmuConstants::EQUIPMENT_BEGIN && move_slots->from_slot <= EmuConstants::CURSOR_BAG_END) || move_slots->from_slot == MainPowerSource) { + if((move_slots->from_slot >= EQEmu::Constants::EQUIPMENT_BEGIN && move_slots->from_slot <= EQEmu::Constants::CURSOR_BAG_END) || move_slots->from_slot == 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 >= EmuConstants::EQUIPMENT_BEGIN && move_slots->to_slot <= EmuConstants::CURSOR_BAG_END) || move_slots->to_slot == MainPowerSource) { + if((move_slots->to_slot >= EQEmu::Constants::EQUIPMENT_BEGIN && move_slots->to_slot <= EQEmu::Constants::CURSOR_BAG_END) || move_slots->to_slot == 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 = EmuConstants::MATERIAL_BEGIN; i <= EmuConstants::MATERIAL_TINT_END; i++) { + for (int i = EQEmu::Constants::MATERIAL_BEGIN; i <= EQEmu::Constants::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=EmuConstants::POSSESSIONS_BEGIN; x <= EmuConstants::POSSESSIONS_END; x++) + for(x=EQEmu::Constants::POSSESSIONS_BEGIN; x <= EQEmu::Constants::POSSESSIONS_END; x++) { TempItem = 0; ins = GetInv().GetItem(x); @@ -2080,7 +2080,7 @@ bool Client::DecreaseByItemType(uint32 type, uint8 amt) { return true; } } - for(x=EmuConstants::GENERAL_BAGS_BEGIN; x <= EmuConstants::GENERAL_BAGS_END; x++) + for(x=EQEmu::Constants::GENERAL_BAGS_BEGIN; x <= EQEmu::Constants::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 = EmuConstants::EQUIPMENT_BEGIN; x <= EmuConstants::GENERAL_BAGS_END; x++) + for(x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= EQEmu::Constants::GENERAL_BAGS_END; x++) { - if (x == MainCursor + 1) - x = EmuConstants::GENERAL_BAGS_BEGIN; + if (x == SlotCursor + 1) + x = EQEmu::Constants::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 = EmuConstants::EQUIPMENT_BEGIN; x <= EmuConstants::GENERAL_BAGS_END; x++) // should this be CURSOR_BAG_END? + for(x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= EQEmu::Constants::GENERAL_BAGS_END; x++) // should this be CURSOR_BAG_END? { - if (x == MainCursor + 1) - x = EmuConstants::GENERAL_BAGS_BEGIN; + if (x == SlotCursor + 1) + x = EQEmu::Constants::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 = EmuConstants::GENERAL_BEGIN; slot_id <= EmuConstants::GENERAL_END; ++slot_id) { + for (auto slot_id = EQEmu::Constants::GENERAL_BEGIN; slot_id <= EQEmu::Constants::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 = EmuConstants::BANK_BEGIN; slot_id <= EmuConstants::BANK_END; ++slot_id) { + for (auto slot_id = EQEmu::Constants::BANK_BEGIN; slot_id <= EQEmu::Constants::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 = EmuConstants::SHARED_BANK_BEGIN; slot_id <= EmuConstants::SHARED_BANK_END; ++slot_id) { + for (auto slot_id = EQEmu::Constants::SHARED_BANK_BEGIN; slot_id <= EQEmu::Constants::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[MainCursor]; + auto inst = m_inv[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, MainCursor); + Log.Out(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, SlotCursor); std::list local; local.push_front(new_inst); - m_inv.PopItem(MainCursor); + m_inv.PopItem(SlotCursor); safe_delete(inst); while (!m_inv.CursorEmpty()) { - auto limbo_inst = m_inv.PopItem(MainCursor); + auto limbo_inst = m_inv.PopItem(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 = EmuConstants::EQUIPMENT_BEGIN; slot_id <= EmuConstants::EQUIPMENT_END; ++slot_id) { + for (auto slot_id = EQEmu::Constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::Constants::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 = EmuConstants::GENERAL_BEGIN; slot_id <= EmuConstants::GENERAL_END; ++slot_id) { + for (auto slot_id = EQEmu::Constants::GENERAL_BEGIN; slot_id <= EQEmu::Constants::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[MainPowerSource]) { - auto inst = m_inv[MainPowerSource]; + if (m_inv[SlotPowerSource]) { + auto inst = m_inv[SlotPowerSource]; if (inst && !inst->GetItem()->NoRent) { - Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, MainPowerSource); - DeleteItemInInventory(MainPowerSource, 0, (GetClientVersion() >= 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, SlotPowerSource); + DeleteItemInInventory(SlotPowerSource, 0, (GetClientVersion() >= ClientVersion::SoF) ? client_update : false); // Ti slot non-existent } } - for (auto slot_id = EmuConstants::GENERAL_BAGS_BEGIN; slot_id <= EmuConstants::CURSOR_BAG_END; ++slot_id) { + for (auto slot_id = EQEmu::Constants::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::Constants::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 = EmuConstants::BANK_BEGIN; slot_id <= EmuConstants::BANK_END; ++slot_id) { + for (auto slot_id = EQEmu::Constants::BANK_BEGIN; slot_id <= EQEmu::Constants::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 = EmuConstants::BANK_BAGS_BEGIN; slot_id <= EmuConstants::BANK_BAGS_END; ++slot_id) { + for (auto slot_id = EQEmu::Constants::BANK_BAGS_BEGIN; slot_id <= EQEmu::Constants::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 = EmuConstants::SHARED_BANK_BEGIN; slot_id <= EmuConstants::SHARED_BANK_END; ++slot_id) { + for (auto slot_id = EQEmu::Constants::SHARED_BANK_BEGIN; slot_id <= EQEmu::Constants::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 = EmuConstants::SHARED_BANK_BAGS_BEGIN; slot_id <= EmuConstants::SHARED_BANK_BAGS_END; ++slot_id) { + for (auto slot_id = EQEmu::Constants::SHARED_BANK_BAGS_BEGIN; slot_id <= EQEmu::Constants::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(MainCursor); + auto inst = m_inv.PopItem(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 = EmuConstants::EQUIPMENT_BEGIN; slot_id <= EmuConstants::EQUIPMENT_END; ++slot_id) { + for (auto slot_id = EQEmu::Constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::Constants::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 = EmuConstants::GENERAL_BEGIN; slot_id <= EmuConstants::GENERAL_END; ++slot_id) { + for (auto slot_id = EQEmu::Constants::GENERAL_BEGIN; slot_id <= EQEmu::Constants::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[MainPowerSource]) { - auto inst = m_inv.PopItem(MainPowerSource); + if (m_inv[SlotPowerSource]) { + auto inst = m_inv.PopItem(SlotPowerSource); if (inst) { if (CheckLoreConflict(inst->GetItem())) { - Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, MainPowerSource); - database.SaveInventory(character_id, nullptr, MainPowerSource); + Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, SlotPowerSource); + database.SaveInventory(character_id, nullptr, SlotPowerSource); } else { - m_inv.PutItem(MainPowerSource, *inst); + m_inv.PutItem(SlotPowerSource, *inst); } safe_delete(inst); } } - for (auto slot_id = EmuConstants::GENERAL_BAGS_BEGIN; slot_id <= EmuConstants::CURSOR_BAG_END; ++slot_id) { + for (auto slot_id = EQEmu::Constants::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::Constants::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 = EmuConstants::BANK_BEGIN; slot_id <= EmuConstants::BANK_END; ++slot_id) { + for (auto slot_id = EQEmu::Constants::BANK_BEGIN; slot_id <= EQEmu::Constants::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 = EmuConstants::BANK_BAGS_BEGIN; slot_id <= EmuConstants::BANK_BAGS_END; ++slot_id) { + for (auto slot_id = EQEmu::Constants::BANK_BAGS_BEGIN; slot_id <= EQEmu::Constants::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(MainCursor); + auto inst = m_inv.PopItem(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 = EmuConstants::EQUIPMENT_BEGIN; slot_id <= EmuConstants::EQUIPMENT_END; ++slot_id) { + for (auto slot_id = EQEmu::Constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::Constants::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[MainPowerSource] && !m_inv[MainPowerSource]->IsSlotAllowed(MainPowerSource)) { - auto inst = m_inv.PopItem(MainPowerSource); + if (m_inv[SlotPowerSource] && !m_inv[SlotPowerSource]->IsSlotAllowed(SlotPowerSource)) { + auto inst = m_inv.PopItem(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, MainPowerSource, free_slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, SlotPowerSource, free_slot_id); PutItemInInventory(free_slot_id, *inst, (GetClientVersion() >= ClientVersion::SoF) ? client_update : false); - database.SaveInventory(character_id, nullptr, MainPowerSource); + database.SaveInventory(character_id, nullptr, SlotPowerSource); safe_delete(inst); } @@ -2591,7 +2591,7 @@ uint32 Client::GetEquipment(uint8 material_slot) const int16 invslot; const ItemInst *item; - if(material_slot > EmuConstants::MATERIAL_END) + if(material_slot > EQEmu::Constants::MATERIAL_END) { return 0; } @@ -2629,7 +2629,7 @@ int32 Client::GetEquipmentMaterial(uint8 material_slot) uint32 Client::GetEquipmentColor(uint8 material_slot) const { - if (material_slot > EmuConstants::MATERIAL_END) + if (material_slot > EQEmu::Constants::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 MainPrimary; + return SlotPrimary; case bandolierSecondary: - return MainSecondary; + return SlotSecondary; case bandolierRange: - return MainRange; + return SlotRange; default: - return MainAmmo; + return 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(MainCursor)) { - if (m_inv.GetItem(MainCursor)->GetItem()->ID == m_pp.bandoliers[bss->Number].Items[BandolierSlot].ID && - m_inv.GetItem(MainCursor)->GetCharges() >= 1) { // '> 0' the same, but this matches Inventory::_HasItem conditional check - slot = MainCursor; + 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; } - else if (m_inv.GetItem(MainCursor)->GetItem()->ItemClass == 1) { - for(int16 CursorBagSlot = EmuConstants::CURSOR_BAG_BEGIN; CursorBagSlot <= EmuConstants::CURSOR_BAG_END; CursorBagSlot++) { + else if (m_inv.GetItem(SlotCursor)->GetItem()->ItemClass == 1) { + for(int16 CursorBagSlot = EQEmu::Constants::CURSOR_BAG_BEGIN; CursorBagSlot <= EQEmu::Constants::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 = EmuConstants::GENERAL_BEGIN; i <= MainCursor; i++) { // changed slot max to 30 from 29. client will stack into slot 30 (bags too) before moving. + 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. 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 = EmuConstants::GENERAL_BEGIN; i <= MainCursor; i++) { // changed slot max to 30 from 29. client will move into slot 30 (bags too) before pushing onto cursor. + 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. 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 = MAIN_BEGIN; index < EmuConstants::MAP_POSSESSIONS_SIZE; ++index) { + for (int16 index = SLOT_BEGIN; index < EQEmu::Constants::TYPE_POSSESSIONS_SIZE; ++index) { auto inst = m_inv[index]; if (inst == nullptr) { continue; } instmap[index] = inst; } - for (int16 index = EmuConstants::TRIBUTE_BEGIN; index <= EmuConstants::TRIBUTE_END; ++index) { + for (int16 index = EQEmu::Constants::TRIBUTE_BEGIN; index <= EQEmu::Constants::TRIBUTE_END; ++index) { auto inst = m_inv[index]; if (inst == nullptr) { continue; } instmap[index] = inst; } - for (int16 index = EmuConstants::BANK_BEGIN; index <= EmuConstants::BANK_END; ++index) { + for (int16 index = EQEmu::Constants::BANK_BEGIN; index <= EQEmu::Constants::BANK_END; ++index) { auto inst = m_inv[index]; if (inst == nullptr) { continue; } instmap[index] = inst; } - for (int16 index = EmuConstants::SHARED_BANK_BEGIN; index <= EmuConstants::SHARED_BANK_END; ++index) { + for (int16 index = EQEmu::Constants::SHARED_BANK_BEGIN; index <= EQEmu::Constants::SHARED_BANK_END; ++index) { auto inst = m_inv[index]; if (inst == nullptr) { continue; } instmap[index] = inst; } - for (int16 index = EmuConstants::TRADE_BEGIN; index <= EmuConstants::TRADE_END; ++index) { + for (int16 index = EQEmu::Constants::TRADE_BEGIN; index <= EQEmu::Constants::TRADE_END; ++index) { auto inst = m_inv[index]; if (inst == nullptr) { continue; } instmap[index] = inst; @@ -3074,24 +3074,24 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool auto tsobject = GetTradeskillObject(); if (tsobject != nullptr) { - for (int16 index = MAIN_BEGIN; index < EmuConstants::MAP_WORLD_SIZE; ++index) { + for (int16 index = SLOT_BEGIN; index < EQEmu::Constants::TYPE_WORLD_SIZE; ++index) { auto inst = tsobject->GetItem(index); if (inst == nullptr) { continue; } - instmap[EmuConstants::WORLD_BEGIN + index] = inst; + instmap[EQEmu::Constants::WORLD_BEGIN + index] = inst; } } int limbo = 0; for (auto cursor_itr = m_inv.cursor_cbegin(); cursor_itr != m_inv.cursor_cend(); ++cursor_itr, ++limbo) { - // m_inv.cursor_begin() is referenced as MainCursor in MapPossessions above + // m_inv.cursor_begin() is referenced as SlotCursor in MapPossessions above if (cursor_itr == m_inv.cursor_cbegin()) continue; instmap[8000 + limbo] = *cursor_itr; } - if (m_inv[MainPowerSource]) - instmap[MainPowerSource] = m_inv[MainPowerSource]; + if (m_inv[SlotPowerSource]) + instmap[SlotPowerSource] = m_inv[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_BEGIN; (sub < EmuConstants::ITEM_CONTAINER_SIZE) && (!error); ++sub) { // treat any ItemInst as having the max internal slots available + for (int16 sub = SUB_BEGIN; (sub < EQEmu::Constants::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_BEGIN; (sub < EmuConstants::ITEM_CONTAINER_SIZE); ++sub) { + for (int16 sub = SUB_BEGIN; (sub < EQEmu::Constants::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 >= EmuConstants::EQUIPMENT_BEGIN && head <= EmuConstants::EQUIPMENT_END) || - (head >= EmuConstants::TRIBUTE_BEGIN && head <= EmuConstants::TRIBUTE_END) || - (head >= EmuConstants::WORLD_BEGIN && head <= EmuConstants::WORLD_END) || + (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 >= 8000 && head <= 8101) || - (head == MainPowerSource)) { + (head == 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 >= EmuConstants::ITEM_COMMON_SIZE) + if (index >= EQEmu::Constants::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 >= EmuConstants::GENERAL_BEGIN && head <= EmuConstants::GENERAL_END) || - (head == MainCursor) || - (head >= EmuConstants::BANK_BEGIN && head <= EmuConstants::BANK_END) || - (head >= EmuConstants::SHARED_BANK_BEGIN && head <= EmuConstants::SHARED_BANK_END) || - (head >= EmuConstants::TRADE_BEGIN && head <= EmuConstants::TRADE_END)) { + (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)) { 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 >= EmuConstants::ITEM_COMMON_SIZE) + if (index >= EQEmu::Constants::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 >= EmuConstants::ITEM_COMMON_SIZE) + if (index >= EQEmu::Constants::ITEM_COMMON_SIZE) return true; } break; diff --git a/zone/loottables.cpp b/zone/loottables.cpp index 12766b57f..708d3cd82 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 && iSlots & 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 << MainPrimary | 1 << MainSecondary)) { + || item2->Slots & (1 << SlotPrimary | 1 << SlotSecondary)) { memset(newid, 0, sizeof(newid)); for(int i=0;i<7;i++){ if (!isalpha(item2->IDFile[i])){ @@ -327,7 +327,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge emat = item2->Material; } - if (foundslot == MainPrimary) { + if (foundslot == SlotPrimary) { if (item2->Proc.Effect != 0) CastToMob()->AddProcToWeapon(item2->Proc.Effect, true); @@ -337,7 +337,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge if (item2->ItemType == ItemType2HBlunt || item2->ItemType == ItemType2HSlash || item2->ItemType == ItemType2HPiercing) SetTwoHanderEquipped(true); } - else if (foundslot == MainSecondary + else if (foundslot == 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)) @@ -349,25 +349,25 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge if (item2->Damage > 0) SendAddPlayerState(PlayerState::SecondaryWeaponEquipped); } - else if (foundslot == MainHead) { + else if (foundslot == SlotHead) { eslot = MaterialHead; } - else if (foundslot == MainChest) { + else if (foundslot == SlotChest) { eslot = MaterialChest; } - else if (foundslot == MainArms) { + else if (foundslot == SlotArms) { eslot = MaterialArms; } - else if (foundslot == MainWrist1 || foundslot == MainWrist2) { + else if (foundslot == SlotWrist1 || foundslot == SlotWrist2) { eslot = MaterialWrist; } - else if (foundslot == MainHands) { + else if (foundslot == SlotHands) { eslot = MaterialHands; } - else if (foundslot == MainLegs) { + else if (foundslot == SlotLegs) { eslot = MaterialLegs; } - else if (foundslot == MainFeet) { + else if (foundslot == SlotFeet) { eslot = MaterialFeet; } diff --git a/zone/lua_general.cpp b/zone/lua_general.cpp index a42efd592..4e8f1e8d0 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(MainCharm)), - luabind::value("Ear1", static_cast(MainEar1)), - luabind::value("Head", static_cast(MainHead)), - luabind::value("Face", static_cast(MainFace)), - luabind::value("Ear2", static_cast(MainEar2)), - luabind::value("Neck", static_cast(MainNeck)), - luabind::value("Shoulder", static_cast(MainShoulders)), // deprecated - luabind::value("Shoulders", static_cast(MainShoulders)), - luabind::value("Arms", static_cast(MainArms)), - luabind::value("Back", static_cast(MainBack)), - luabind::value("Bracer1", static_cast(MainWrist1)), // deprecated - luabind::value("Wrist1", static_cast(MainWrist1)), - luabind::value("Bracer2", static_cast(MainWrist2)), // deprecated - luabind::value("Wrist2", static_cast(MainWrist2)), - luabind::value("Range", static_cast(MainRange)), - luabind::value("Hands", static_cast(MainHands)), - luabind::value("Primary", static_cast(MainPrimary)), - luabind::value("Secondary", static_cast(MainSecondary)), - luabind::value("Ring1", static_cast(MainFinger1)), // deprecated - luabind::value("Finger1", static_cast(MainFinger1)), - luabind::value("Ring2", static_cast(MainFinger2)), // deprecated - luabind::value("Finger2", static_cast(MainFinger2)), - luabind::value("Chest", static_cast(MainChest)), - luabind::value("Legs", static_cast(MainLegs)), - luabind::value("Feet", static_cast(MainFeet)), - luabind::value("Waist", static_cast(MainWaist)), - luabind::value("PowerSource", static_cast(MainPowerSource)), - luabind::value("Ammo", static_cast(MainAmmo)), - luabind::value("General1", static_cast(MainGeneral1)), - luabind::value("General2", static_cast(MainGeneral2)), - luabind::value("General3", static_cast(MainGeneral3)), - luabind::value("General4", static_cast(MainGeneral4)), - luabind::value("General5", static_cast(MainGeneral5)), - luabind::value("General6", static_cast(MainGeneral6)), - luabind::value("General7", static_cast(MainGeneral7)), - luabind::value("General8", static_cast(MainGeneral8)), - luabind::value("Cursor", static_cast(MainCursor)), - luabind::value("PersonalBegin", static_cast(EmuConstants::GENERAL_BEGIN)), // deprecated - luabind::value("GeneralBegin", static_cast(EmuConstants::GENERAL_BEGIN)), - luabind::value("PersonalEnd", static_cast(EmuConstants::GENERAL_END)), // deprecated - luabind::value("GeneralEnd", static_cast(EmuConstants::GENERAL_END)), + 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("CursorEnd", 0xFFFE), // deprecated luabind::value("Tradeskill", static_cast(legacy::SLOT_TRADESKILL)), // deprecated luabind::value("Augment", static_cast(legacy::SLOT_AUGMENT)), // deprecated @@ -1819,9 +1819,9 @@ luabind::scope lua_register_material() { 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("Max", static_cast(MaterialCount)), // deprecated + luabind::value("Count", static_cast(MaterialCount)), + luabind::value("Invalid", static_cast(MaterialInvalid)) ]; } diff --git a/zone/merc.cpp b/zone/merc.cpp index 91a69f374..1379bc697 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -206,7 +206,7 @@ void Merc::CalcItemBonuses(StatBonuses* newbon) { unsigned int i; //should not include 21 (SLOT_AMMO) - for (i=0; irandom.Roll(flurrychance)) { Message_StringID(MT_NPCFlurry, YOU_FLURRY); - Attack(GetTarget(), MainPrimary, false); - Attack(GetTarget(), MainPrimary, false); + Attack(GetTarget(), SlotPrimary, false); + Attack(GetTarget(), SlotPrimary, false); } } @@ -1590,7 +1590,7 @@ void Merc::AI_Process() { if (GetTarget() && ExtraAttackChanceBonus) { if(zone->random.Roll(ExtraAttackChanceBonus)) { - Attack(GetTarget(), MainPrimary, false); + Attack(GetTarget(), SlotPrimary, false); } } } @@ -1625,11 +1625,11 @@ void Merc::AI_Process() { // Max 78% of DW if (zone->random.Roll(DualWieldProbability)) { - Attack(GetTarget(), MainSecondary); // Single attack with offhand + Attack(GetTarget(), SlotSecondary); // Single attack with offhand if(CanThisClassDoubleAttack()) { if(GetTarget() && GetTarget()->GetHP() > -10) - Attack(GetTarget(), MainSecondary); // Single attack with offhand + Attack(GetTarget(), SlotSecondary); // Single attack with offhand } } } @@ -2544,7 +2544,7 @@ int16 Merc::GetFocusEffect(focusType type, uint16 spell_id) { int16 focus_max_real = 0; //item focus - for (int x = 0; x < EmuConstants::EQUIPMENT_SIZE; ++x) + for (int x = 0; x < EQEmu::Constants::EQUIPMENT_SIZE; ++x) { TempItem = nullptr; if (equipment[x] == 0) @@ -5017,12 +5017,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 = EmuConstants::EQUIPMENT_BEGIN; i <= EmuConstants::EQUIPMENT_END; ++i) { + uint8 materialFromSlot = MaterialInvalid; + for (int i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; ++i) { itemID = equipment[i]; if(itemID != NO_ITEM) { materialFromSlot = Inventory::CalcMaterialFromSlot(i); - if(materialFromSlot != _MaterialInvalid) + if(materialFromSlot != MaterialInvalid) this->SendWearChange(materialFromSlot); } } @@ -5036,8 +5036,8 @@ void Merc::UpdateEquipmentLight() m_Light.Type.Equipment = 0; m_Light.Level.Equipment = 0; - for (int index = MAIN_BEGIN; index < EmuConstants::EQUIPMENT_SIZE; ++index) { - if (index == MainAmmo) { continue; } + for (int index = SLOT_BEGIN; index < EQEmu::Constants::EQUIPMENT_SIZE; ++index) { + if (index == SlotAmmo) { continue; } auto item = database.GetItem(equipment[index]); if (item == nullptr) { continue; } diff --git a/zone/merc.h b/zone/merc.h index 1e409e0ce..2a73bb8a3 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 = MainPrimary, bool FromRiposte = false, bool IsStrikethrough = false, + virtual bool Attack(Mob* other, int Hand = 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[EmuConstants::EQUIPMENT_SIZE]; //this is an array of item IDs + uint32 equipment[EQEmu::Constants::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 c91ae404f..54781d095 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[MaterialCount], uint8 in_aa_title, uint8 in_see_invis, // see through invis/ivu @@ -279,7 +279,7 @@ Mob::Mob(const char* in_name, RangedProcs[j].level_override = -1; } - for (i = 0; i < _MaterialCount; i++) + for (i = 0; i < MaterialCount; i++) { if (in_armor_tint) { @@ -2378,8 +2378,8 @@ bool Mob::CanThisClassDualWield(void) const { return(GetSkill(SkillDualWield) > 0); } else if(CastToClient()->HasSkill(SkillDualWield)) { - const ItemInst* pinst = CastToClient()->GetInv().GetItem(MainPrimary); - const ItemInst* sinst = CastToClient()->GetInv().GetItem(MainSecondary); + const ItemInst* pinst = CastToClient()->GetInv().GetItem(SlotPrimary); + const ItemInst* sinst = CastToClient()->GetInv().GetItem(SlotSecondary); // 2HS, 2HB, or 2HP if(pinst && pinst->IsWeapon()) { diff --git a/zone/mob.h b/zone/mob.h index 8cb899d0f..47d903fc2 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[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 = MainPrimary, bool FromRiposte = false, bool IsStrikethrough = false, + virtual bool Attack(Mob* other, int Hand = 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); @@ -378,7 +378,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 < MaterialCount) ? i : 0]; } inline uint8 GetClass() const { return class_; } inline uint8 GetLevel() const { return level; } inline uint8 GetOrigLevel() const { return orig_level; } @@ -563,7 +563,7 @@ public: bool lookForAftArc = true); //Procs - void TriggerDefensiveProcs(Mob *on, uint16 hand = MainPrimary, bool FromSkillProc=false, int damage = 0); + void TriggerDefensiveProcs(Mob *on, uint16 hand = 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; @@ -1139,16 +1139,16 @@ protected: bool focused; void CalcSpellBonuses(StatBonuses* newbon); virtual void CalcBonuses(); - void TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success = false, uint16 hand = 0, bool IsDefensive = false); // hand = MainCharm? + 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 = MainPrimary); - void TryWeaponProc(const ItemInst* inst, const Item_Struct* weapon, Mob *on, uint16 hand = MainPrimary); - void TrySpellProc(const ItemInst* inst, const Item_Struct* weapon, Mob *on, uint16 hand = MainPrimary); - void TryWeaponProc(const ItemInst* weapon, Mob *on, uint16 hand = MainPrimary); + 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 ExecWeaponProc(const ItemInst* weapon, uint16 spell_id, Mob *on, int level_override = -1); - virtual float GetProcChances(float ProcBonus, uint16 hand = MainPrimary); - virtual float GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 hand = MainPrimary, Mob *on = nullptr); + virtual float GetProcChances(float ProcBonus, uint16 hand = SlotPrimary); + virtual float GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 hand = SlotPrimary, Mob *on = nullptr); virtual float GetSpecialProcChances(uint16 hand); virtual float GetAssassinateProcChances(uint16 ReuseTime); virtual float GetSkillProcChances(uint16 ReuseTime, uint16 hand = 0); // hand = MainCharm? @@ -1239,7 +1239,7 @@ protected: uint32 drakkin_heritage; uint32 drakkin_tattoo; uint32 drakkin_details; - uint32 armor_tint[_MaterialCount]; + uint32 armor_tint[MaterialCount]; uint8 aa_title; diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 918c8afde..70f64b7a7 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -848,7 +848,7 @@ void Client::AI_Process() if (GetTarget() && !IsStunned() && !IsMezzed() && !GetFeigned()) { if (attack_timer.Check()) { // Should charmed clients not be procing? - DoAttackRounds(GetTarget(), MainPrimary); + DoAttackRounds(GetTarget(), SlotPrimary); } } @@ -856,7 +856,7 @@ void Client::AI_Process() if (attack_dw_timer.Check()) { if (CheckDualWield()) { // Should charmed clients not be procing? - DoAttackRounds(GetTarget(), MainSecondary); + DoAttackRounds(GetTarget(), SlotSecondary); } } } @@ -1107,7 +1107,7 @@ void Mob::AI_Process() { //try main hand first if(attack_timer.Check()) { DoMainHandAttackRounds(target); - TriggerDefensiveProcs(target, MainPrimary, false); + TriggerDefensiveProcs(target, SlotPrimary, false); bool specialed = false; // NPCs can only do one of these a round if (GetSpecialAbility(SPECATK_FLURRY)) { @@ -1953,7 +1953,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, MainPrimary, false, false, false, opts); + Attack(target, SlotPrimary, false, false, false, opts); } return true; } diff --git a/zone/npc.cpp b/zone/npc.cpp index 103b5548e..25cdcfb86 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 != 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 = MAIN_BEGIN; index < EmuConstants::EQUIPMENT_SIZE; ++index) { - if (index == MainAmmo) { continue; } + for (int index = SLOT_BEGIN; index < EQEmu::Constants::EQUIPMENT_SIZE; ++index) { + if (index == 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 >= MaterialCount) return 0; int16 invslot = Inventory::CalcSlotFromMaterial(material_slot); diff --git a/zone/npc.h b/zone/npc.h index fe658aab2..e788f414e 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 = MainPrimary, bool FromRiposte = false, bool IsStrikethrough = false, + virtual bool Attack(Mob* other, int Hand = 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[EmuConstants::EQUIPMENT_SIZE]; //this is an array of item IDs + uint32 equipment[EQEmu::Constants::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 d06a311c0..dd3c822c2 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 < EmuConstants::MAP_WORLD_SIZE) { + if (index < EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_CONTAINER_SIZE; i++) + for (uint8 i = SUB_BEGIN; i < EQEmu::Constants::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(MainCursor, *m_inst, false); - sender->SendItemPacket(MainCursor, m_inst, ItemPacketTrade); + sender->PutItemInInventory(SlotCursor, *m_inst, false); + sender->SendItemPacket(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(MainCursor); + sender->DeleteItemInInventory(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_BEGIN; i < EmuConstants::ITEM_CONTAINER_SIZE; i++) { + for (uint8 i = SUB_BEGIN; i < EQEmu::Constants::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 fd777fab4..714f80b3c 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[EmuConstants::EQUIPMENT_SIZE]; + uint32 petinv[EQEmu::Constants::EQUIPMENT_SIZE]; memset(petinv, 0, sizeof(petinv)); const Item_Struct *item = 0; if (database.GetBasePetItems(record.equipmentset, petinv)) { - for (int i = 0; iAddLootDrop(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)*EmuConstants::EQUIPMENT_SIZE); + memcpy(items, equipment, sizeof(uint32) * EQEmu::Constants::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 < EmuConstants::EQUIPMENT_SIZE; i++) { + for (i = 0; i < EQEmu::Constants::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 >= EmuConstants::EQUIPMENT_SIZE) + if (slot >= EQEmu::Constants::EQUIPMENT_SIZE) continue; if (items[slot] == 0) diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 32d215b9b..ce4c3e861 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 = EmuConstants::GENERAL_BEGIN; slot_id <= EmuConstants::GENERAL_END; ++slot_id) + for (slot_id = EQEmu::Constants::GENERAL_BEGIN; slot_id <= EQEmu::Constants::GENERAL_END; ++slot_id) { quantity += collectitems_processSlot(slot_id, item_id, remove); } - for (slot_id = EmuConstants::GENERAL_BAGS_BEGIN; slot_id <= EmuConstants::GENERAL_BAGS_END; ++slot_id) + for (slot_id = EQEmu::Constants::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::Constants::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 27a72f62c..7e424cf09 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 = MainFeet; + item_slot = SlotFeet; break; case SkillBash: - item_slot = MainSecondary; + item_slot = SlotSecondary; break; case SkillDragonPunch: case SkillEagleStrike: case SkillTigerClaw: - item_slot = MainHands; + item_slot = 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(MainSecondary); + ItemInst *item = CastToClient()->GetInv().GetItem(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 = MainPrimary; // Avoid checks hand for throwing/archery exclusion, primary should work for most + int hand = SlotPrimary; // Avoid checks hand for throwing/archery exclusion, primary should work for most if (skill == SkillThrowing || skill == SkillArchery) - hand = MainRange; + hand = SlotRange; if (who->AvoidDamage(this, max_damage, hand)) { if (max_damage == -3) DoRiposte(who); } else { - if (HitChance || who->CheckHitChance(this, skill, MainPrimary)) { + if (HitChance || who->CheckHitChance(this, skill, 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 == MainRange) { + if(ca_atk->m_atk == SlotRange) { if (ca_atk->m_skill == SkillThrowing) { SetAttackTimer(); ThrowingAttack(GetTarget()); @@ -240,7 +240,7 @@ void Client::OPCombatAbility(const EQApplicationPacket *app) { int32 skill_reduction = this->GetSkillReuseTime(ca_atk->m_skill); - // not sure what the '100' indicates..if ->m_atk is not used as 'slot' reference, then change MainRange above back to '11' + // not sure what the '100' indicates..if ->m_atk is not used as 'slot' reference, then change SlotRange above back to '11' if ((ca_atk->m_atk == 100) && (ca_atk->m_skill == SkillBash)) { // SLAM - Bash without a shield equipped if (GetTarget() != this) { @@ -248,8 +248,8 @@ void Client::OPCombatAbility(const EQApplicationPacket *app) { DoAnim(animTailRake); int32 ht = 0; - if(GetWeaponDamage(GetTarget(), GetInv().GetItem(MainSecondary)) <= 0 && - GetWeaponDamage(GetTarget(), GetInv().GetItem(MainShoulders)) <= 0){ + if(GetWeaponDamage(GetTarget(), GetInv().GetItem(SlotSecondary)) <= 0 && + GetWeaponDamage(GetTarget(), GetInv().GetItem(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(MainFeet)) <= 0){ + if(GetWeaponDamage(GetTarget(), GetInv().GetItem(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 = MainFeet; + uint8 itemslot = 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 = MainHands; + itemslot = 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 = MainHands; + itemslot = 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 = MainHands; + itemslot = 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(MainPrimary); + const ItemInst *wpn = CastToClient()->GetInv().GetItem(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, MainPrimary); + Attack(other, 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(MainPrimary); + wpn = CastToClient()->GetInv().GetItem(SlotPrimary); if(wpn) { primaryweapondamage = GetWeaponDamage(other, wpn); backstab_dmg = wpn->GetItem()->BackstabDmg; - for (int i = 0; i < EmuConstants::ITEM_COMMON_SIZE; ++i) + for (int i = 0; i < EQEmu::Constants::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(MainPrimary):(const ItemInst*)nullptr) > 0){ + if(GetWeaponDamage(other, IsClient()?CastToClient()->GetInv().GetItem(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[MainRange]; + const ItemInst* RangeWeapon = m_inv[SlotRange]; //locate ammo - int ammo_slot = MainAmmo; - const ItemInst* Ammo = m_inv[MainAmmo]; + int ammo_slot = SlotAmmo; + const ItemInst* Ammo = m_inv[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(MainRange), MainRange); - Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have no bow!", GetItemIDAt(MainRange)); + 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)); 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(MainAmmo), MainAmmo); - Message(0, "Error: Ammo: GetItem(%i)==0, you have no ammo!", GetItemIDAt(MainAmmo)); + 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)); return; } @@ -729,7 +729,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { //first look for quivers int r; bool found = false; - for(r = EmuConstants::GENERAL_BEGIN; r <= EmuConstants::GENERAL_END; r++) { + for(r = EQEmu::Constants::GENERAL_BEGIN; r <= EQEmu::Constants::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[MainRange]; + _RangeWeapon = CastToClient()->m_inv[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, MainPrimary, chance_mod))) { + if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillArchery, 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, MainRange); + other->AvoidDamage(this, TotalDmg, 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, MainRange); + TrySkillProc(other, SkillArchery, 0, true, 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, MainRange); + TryWeaponProc(RangeWeapon, other, SlotRange); //Ammo Proc if (ammo_lost) - TryWeaponProc(nullptr, ammo_lost, other, MainRange); + TryWeaponProc(nullptr, ammo_lost, other, SlotRange); else if(Ammo && other && !other->HasDied()) - TryWeaponProc(Ammo, other, MainRange); + TryWeaponProc(Ammo, other, SlotRange); //Skill Proc if (HasSkillProcs() && other && !other->HasDied()){ if (ReuseTime) TrySkillProc(other, SkillArchery, ReuseTime); else - TrySkillProc(other, SkillArchery, 0, false, MainRange); + TrySkillProc(other, SkillArchery, 0, false, 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, MainRange, chance_mod)) + if (!other->CheckHitChance(this, skillInUse, 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, MainRange); + other->AvoidDamage(this, TotalDmg, 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, MainRange); + TrySkillProc(other, skillInUse, 0, true, SlotRange); } //try proc on hits and misses if(other && !other->HasDied()) - TrySpellProc(nullptr, (const Item_Struct*)nullptr, other, MainRange); + TrySpellProc(nullptr, (const Item_Struct*)nullptr, other, SlotRange); if (HasSkillProcs() && other && !other->HasDied()) - TrySkillProc(other, skillInUse, 0, false, MainRange); + TrySkillProc(other, skillInUse, 0, false, 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 = MainRange; - const ItemInst* RangeWeapon = m_inv[MainRange]; + int ammo_slot = SlotRange; + const ItemInst* RangeWeapon = m_inv[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(MainRange), MainRange); - Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing to throw!", GetItemIDAt(MainRange)); + 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)); 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(MainRange)); + Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(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[MainAmmo]; + const ItemInst* AmmoItem = m_inv[SlotAmmo]; if(AmmoItem != nullptr && AmmoItem->GetID() == RangeWeapon->GetID()) { //more in the ammo slot, use it RangeWeapon = AmmoItem; - ammo_slot = MainAmmo; + ammo_slot = 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, MainPrimary, chance_mod))){ + if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillThrowing, 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, MainRange); + other->AvoidDamage(this, TotalDmg, 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, MainRange); + TrySkillProc(other, SkillThrowing, 0, true, 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, MainRange); + TryWeaponProc(nullptr, ammo_lost, other, SlotRange); else if(RangeWeapon && other && !other->HasDied()) - TryWeaponProc(RangeWeapon, other, MainRange); + TryWeaponProc(RangeWeapon, other, SlotRange); if (HasSkillProcs() && other && !other->HasDied()){ if (ReuseTime) TrySkillProc(other, SkillThrowing, ReuseTime); else - TrySkillProc(other, SkillThrowing, 0, false, MainRange); + TrySkillProc(other, SkillThrowing, 0, false, 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(MainSecondary)) <= 0 && GetWeaponDamage(ca_target, GetInv().GetItem(MainShoulders)) <= 0){ + if(GetWeaponDamage(ca_target, GetInv().GetItem(SlotSecondary)) <= 0 && GetWeaponDamage(ca_target, GetInv().GetItem(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(MainFeet)) <= 0){ + if(GetWeaponDamage(ca_target, GetInv().GetItem(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(MainRange); + float ProcChance = GetSpecialProcChances(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(MainRange); + ProcChance = GetSpecialProcChances(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 = MainPrimary; + int Hand = 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(MainSecondary); + ItemInst *item = CastToClient()->GetInv().GetItem(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 ? MainRange : MainPrimary)) { // MainRange excludes ripo, primary doesn't have any extra behavior + if (other->AvoidDamage(this, damage, CanRiposte ? SlotRange : 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 f0b93ca9c..445b97b39 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(MainCursor); + ItemInst* transI = CastToClient()->GetInv().GetItem(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(MainCursor, fcharges, true); + CastToClient()->DeleteItemInInventory(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(MainCursor, SummonedItem, ItemPacketSummonItem); + c->SendItemPacket(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 = EmuConstants::MATERIAL_BEGIN; x <= EmuConstants::MATERIAL_TINT_END; x++) + for (int x = EQEmu::Constants::MATERIAL_BEGIN; x <= EQEmu::Constants::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 = EmuConstants::MATERIAL_BEGIN; x <= EmuConstants::MATERIAL_TINT_END; x++) + for (int x = EQEmu::Constants::MATERIAL_BEGIN; x <= EQEmu::Constants::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, MainPrimary, 0, true); // on live wars dont get a duration ramp, its a one shot deal + entity_list.AEAttack(caster, 30, 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(MainCursor, SummonedItem, ItemPacketSummonItem); + c->SendItemPacket(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 = EmuConstants::MATERIAL_BEGIN; x <= EmuConstants::MATERIAL_TINT_END; x++){ + for (int x = EQEmu::Constants::MATERIAL_BEGIN; x <= EQEmu::Constants::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 = EmuConstants::EQUIPMENT_BEGIN; x <= EmuConstants::EQUIPMENT_END; x++) + for (int x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= EQEmu::Constants::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_BEGIN; y < EmuConstants::ITEM_COMMON_SIZE; ++y) + for (int y = AUG_BEGIN; y < EQEmu::Constants::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 = EmuConstants::EQUIPMENT_BEGIN; x <= EmuConstants::EQUIPMENT_END; x++) + for (int x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= EQEmu::Constants::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_BEGIN; y < EmuConstants::ITEM_COMMON_SIZE; ++y) + for (int y = AUG_BEGIN; y < EQEmu::Constants::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 = EmuConstants::TRIBUTE_BEGIN; x <= EmuConstants::TRIBUTE_END; ++x) + for (int x = EQEmu::Constants::TRIBUTE_BEGIN; x <= EQEmu::Constants::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 < EmuConstants::EQUIPMENT_SIZE; i++){ + for (int i = 0; i < EQEmu::Constants::EQUIPMENT_SIZE; i++){ const Item_Struct *cur = database.GetItem(equipment[i]); if(!cur) diff --git a/zone/spells.cpp b/zone/spells.cpp index c386f81bb..7ed9e3012 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 <= MainAmmo || item_slot == MainPowerSource) ){ + if( itm && (itm->GetItem()->Click.Type == ET_EquipClick) && !(item_slot <= SlotAmmo || item_slot == SlotPowerSource) ){ if (CastToClient()->GetClientVersion() < 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_BEGIN; r < EmuConstants::ITEM_COMMON_SIZE; r++) { + for (int r = AUG_BEGIN; r < EQEmu::Constants::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 2efed1e93..e6a4b25b5 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 = MAIN_BEGIN; i < EmuConstants::MAP_WORLD_SIZE; i++) + for (uint8 i = SLOT_BEGIN; i < EQEmu::Constants::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 = MAIN_BEGIN; i < EmuConstants::MAP_WORLD_SIZE; i++) + for (uint8 i = SLOT_BEGIN; i < EQEmu::Constants::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(), MainCursor, container->GetItem()->Icon, atoi(container->GetItem()->IDFile + 2)); + user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), 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(), MainCursor, 0, 0); + user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), 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 = MAIN_BEGIN; i < EmuConstants::MAP_WORLD_SIZE; i++) { + for (uint8 i = SLOT_BEGIN; i < EQEmu::Constants::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 = MAIN_BEGIN; x < EmuConstants::MAP_WORLD_SIZE; x++) { + for (int x = SLOT_BEGIN; x < EQEmu::Constants::TYPE_WORLD_SIZE; x++) { const ItemInst* inst = container->GetItem(x); if(!inst) continue; diff --git a/zone/trading.cpp b/zone/trading.cpp index a12b426e4..6cb081b2f 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(MainCursor); + ItemInst* inst = client->GetInv().GetItem(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(MainCursor); + client->DeleteItemInInventory(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(MainCursor); + client->DeleteItemInInventory(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 - EmuConstants::TRADE_BEGIN, inst, ItemPacketTradeView); + with->SendItemPacket(dest_slot_id - EQEmu::Constants::TRADE_BEGIN, inst, ItemPacketTradeView); if (inst->GetItem()->ItemClass == 1) { - for (uint16 i = SUB_BEGIN; i < EmuConstants::ITEM_CONTAINER_SIZE; i++) { + for (uint16 i = SUB_BEGIN; i < EQEmu::Constants::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 - EmuConstants::TRADE_BEGIN, bagitem, ItemPacketTradeView); + with->SendItemPacket(bagslot_id - EQEmu::Constants::TRADE_BEGIN, bagitem, ItemPacketTradeView); } } } @@ -199,7 +199,7 @@ void Trade::LogTrade() uint8 item_count = 0; if (zone->tradevar != 0) { - for (uint16 i = EmuConstants::TRADE_BEGIN; i <= EmuConstants::TRADE_END; i++) { + for (uint16 i = EQEmu::Constants::TRADE_BEGIN; i <= EQEmu::Constants::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 = EmuConstants::TRADE_BEGIN; i <= EmuConstants::TRADE_END; i++) { + for (uint16 i = EQEmu::Constants::TRADE_BEGIN; i <= EQEmu::Constants::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_BEGIN; j < EmuConstants::ITEM_CONTAINER_SIZE; j++) { + for (uint8 j = SUB_BEGIN; j < EQEmu::Constants::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 = EmuConstants::TRADE_BEGIN; i <= EmuConstants::TRADE_END; i++) { + for (uint16 i = EQEmu::Constants::TRADE_BEGIN; i <= EQEmu::Constants::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_BEGIN; j < EmuConstants::ITEM_CONTAINER_SIZE; j++) { + for (uint8 j = SUB_BEGIN; j < EQEmu::Constants::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 = EmuConstants::TRADE_BEGIN; trade_slot <= EmuConstants::TRADE_END; ++trade_slot) { + for (int16 trade_slot = EQEmu::Constants::TRADE_BEGIN; trade_slot <= EQEmu::Constants::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 = EmuConstants::TRADE_BEGIN; trade_slot <= EmuConstants::TRADE_END; ++trade_slot) { + for (int16 trade_slot = EQEmu::Constants::TRADE_BEGIN; trade_slot <= EQEmu::Constants::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 == MainCursor) || (free_slot == INVALID_INDEX)) + if ((free_slot == 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 = EmuConstants::TRADE_END; trade_slot >= EmuConstants::TRADE_BEGIN; --trade_slot) { + for (int16 trade_slot = EQEmu::Constants::TRADE_END; trade_slot >= EQEmu::Constants::TRADE_BEGIN; --trade_slot) { ItemInst* inst = GetInv().GetItem(trade_slot); if (inst && inst->IsStackable()) { - for (int16 bias_slot = EmuConstants::TRADE_BEGIN; bias_slot <= EmuConstants::TRADE_END; ++bias_slot) { + for (int16 bias_slot = EQEmu::Constants::TRADE_BEGIN; bias_slot <= EQEmu::Constants::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 = EmuConstants::TRADE_BEGIN; trade_slot <= EmuConstants::TRADE_END; ++trade_slot) { + for (int16 trade_slot = EQEmu::Constants::TRADE_BEGIN; trade_slot <= EQEmu::Constants::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 = EmuConstants::TRADE_BEGIN; trade_slot <= EmuConstants::TRADE_END; ++trade_slot) { + for (int16 trade_slot = EQEmu::Constants::TRADE_BEGIN; trade_slot <= EQEmu::Constants::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_BEGIN; (sub_slot < EmuConstants::ITEM_CONTAINER_SIZE); ++sub_slot) { // this is to catch ALL items + for (uint8 sub_slot = SUB_BEGIN; (sub_slot < EQEmu::Constants::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 = EmuConstants::TRADE_BEGIN; trade_slot <= EmuConstants::TRADE_END; ++trade_slot) { + for (int16 trade_slot = EQEmu::Constants::TRADE_BEGIN; trade_slot <= EQEmu::Constants::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 == MainCursor) || (partial_slot == INVALID_INDEX)) + if ((partial_slot == 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 = EmuConstants::TRADE_END; trade_slot >= EmuConstants::TRADE_BEGIN; --trade_slot) { + for (int16 trade_slot = EQEmu::Constants::TRADE_END; trade_slot >= EQEmu::Constants::TRADE_BEGIN; --trade_slot) { ItemInst* inst = GetInv().GetItem(trade_slot); if (inst && inst->IsStackable()) { - for (int16 bias_slot = EmuConstants::TRADE_BEGIN; bias_slot <= EmuConstants::TRADE_END; ++bias_slot) { + for (int16 bias_slot = EQEmu::Constants::TRADE_BEGIN; bias_slot <= EQEmu::Constants::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 = EmuConstants::TRADE_BEGIN; trade_slot <= EmuConstants::TRADE_END; ++trade_slot) { + for (int16 trade_slot = EQEmu::Constants::TRADE_BEGIN; trade_slot <= EQEmu::Constants::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_BEGIN; (sub_slot < EmuConstants::ITEM_CONTAINER_SIZE); ++sub_slot) { // this is to catch ALL items + for (uint8 sub_slot = SUB_BEGIN; (sub_slot < EQEmu::Constants::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 = EmuConstants::TRADE_BEGIN; trade_slot <= EmuConstants::TRADE_NPC_END; ++trade_slot) { + for (int16 trade_slot = EQEmu::Constants::TRADE_BEGIN; trade_slot <= EQEmu::Constants::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 = EmuConstants::TRADE_BEGIN; i <= EmuConstants::TRADE_NPC_END; ++i) { + for (int i = EQEmu::Constants::TRADE_BEGIN; i <= EQEmu::Constants::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 = EmuConstants::TRADE_BEGIN; i <= EmuConstants::TRADE_NPC_END; ++i) { - insts[i - EmuConstants::TRADE_BEGIN] = m_inv.PopItem(i); + for (int i = EQEmu::Constants::TRADE_BEGIN; i <= EQEmu::Constants::TRADE_NPC_END; ++i) { + insts[i - EQEmu::Constants::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 = EmuConstants::TRADE_BEGIN; i <= EmuConstants::TRADE_END; i++){ + for (int16 i = EQEmu::Constants::TRADE_BEGIN; i <= EQEmu::Constants::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 = EmuConstants::TRADE_BAGS_BEGIN; i <= EmuConstants::TRADE_BAGS_END; i++){ + for (int16 i = EQEmu::Constants::TRADE_BAGS_BEGIN; i <= EQEmu::Constants::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 = EmuConstants::GENERAL_BEGIN; i <= EmuConstants::GENERAL_END; i++){ + for (int i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++){ item = this->GetInv().GetItem(i); if (item && item->GetItem()->ID == 17899){ //Traders Satchel - for (int x = SUB_BEGIN; x < EmuConstants::ITEM_CONTAINER_SIZE; x++) { + for (int x = SUB_BEGIN; x < EQEmu::Constants::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 = EmuConstants::GENERAL_BEGIN; i <= EmuConstants::GENERAL_END; i++){ + for (int i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++){ item = this->GetInv().GetItem(i); if(item && item->GetItem()->ID == 17899){ //Traders Satchel - for(int x = SUB_BEGIN; x < EmuConstants::ITEM_CONTAINER_SIZE; x++) { + for (int x = SUB_BEGIN; x < EQEmu::Constants::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 = EmuConstants::GENERAL_BEGIN; i <= EmuConstants::GENERAL_END; i++) { + for (int i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++) { item = this->GetInv().GetItem(i); if(item && item->GetItem()->ID == 17899){ //Traders Satchel - for(int x = SUB_BEGIN; x < EmuConstants::ITEM_CONTAINER_SIZE; x++) { + for (int x = SUB_BEGIN; x < EQEmu::Constants::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 = EmuConstants::GENERAL_BEGIN; i <= EmuConstants::GENERAL_END; i++) { + for (int i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++) { item = this->GetInv().GetItem(i); if(item && item->GetItem()->ID == 17899){ //Traders Satchel - for(int x = SUB_BEGIN; x < EmuConstants::ITEM_CONTAINER_SIZE; x++){ + for (int x = SUB_BEGIN; x < EQEmu::Constants::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 df01f843e..084712f9a 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 < EmuConstants::TRIBUTE_SIZE; r++) { + for (r = 0; r < EQEmu::Constants::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 < EmuConstants::TRIBUTE_SIZE; r++) { + for (r = 0; r < EQEmu::Constants::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 < EmuConstants::TRIBUTE_SIZE; r++) { + for (r = 0; r < EQEmu::Constants::TRIBUTE_SIZE; r++) { uint32 tid = m_pp.tributes[r].tribute; if(tid == TRIBUTE_NONE) { - if(m_inv[EmuConstants::TRIBUTE_BEGIN + r]) - DeleteItemInInventory(EmuConstants::TRIBUTE_BEGIN + r, 0, false); + if (m_inv[EQEmu::Constants::TRIBUTE_BEGIN + r]) + DeleteItemInInventory(EQEmu::Constants::TRIBUTE_BEGIN + r, 0, false); continue; } if(tribute_list.count(tid) != 1) { - if (m_inv[EmuConstants::TRIBUTE_BEGIN + r]) - DeleteItemInInventory(EmuConstants::TRIBUTE_BEGIN + r, 0, false); + if (m_inv[EQEmu::Constants::TRIBUTE_BEGIN + r]) + DeleteItemInInventory(EQEmu::Constants::TRIBUTE_BEGIN + r, 0, false); continue; } //sanity check if(m_pp.tributes[r].tier >= MAX_TRIBUTE_TIERS) { - if (m_inv[EmuConstants::TRIBUTE_BEGIN + r]) - DeleteItemInInventory(EmuConstants::TRIBUTE_BEGIN + r, 0, false); + if (m_inv[EQEmu::Constants::TRIBUTE_BEGIN + r]) + DeleteItemInInventory(EQEmu::Constants::TRIBUTE_BEGIN + r, 0, false); m_pp.tributes[r].tier = 0; continue; } @@ -165,15 +165,15 @@ void Client::DoTributeUpdate() { if(inst == nullptr) continue; - PutItemInInventory(EmuConstants::TRIBUTE_BEGIN + r, *inst, false); - SendItemPacket(EmuConstants::TRIBUTE_BEGIN + r, inst, ItemPacketTributeItem); + PutItemInInventory(EQEmu::Constants::TRIBUTE_BEGIN + r, *inst, false); + SendItemPacket(EQEmu::Constants::TRIBUTE_BEGIN + r, inst, ItemPacketTributeItem); safe_delete(inst); } } else { //unequip tribute items... - for(r = 0; r < EmuConstants::TRIBUTE_SIZE; r++) { - if (m_inv[EmuConstants::TRIBUTE_BEGIN + r]) - DeleteItemInInventory(EmuConstants::TRIBUTE_BEGIN + r, 0, false); + 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); } } CalcBonuses(); @@ -192,7 +192,7 @@ void Client::SendTributeTimer() { void Client::ChangeTributeSettings(TributeInfo_Struct *t) { int r; - for(r = 0; r < EmuConstants::TRIBUTE_SIZE; r++) { + for (r = 0; r < EQEmu::Constants::TRIBUTE_SIZE; r++) { m_pp.tributes[r].tribute = TRIBUTE_NONE; diff --git a/zone/tune.cpp b/zone/tune.cpp index 4153d5b84..30692b5bb 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 = MainPrimary; + int Hand = SlotPrimary; if (!other) return 0; ItemInst* weapon; - weapon = GetInv().GetItem(MainPrimary); + weapon = GetInv().GetItem(SlotPrimary); if(weapon != nullptr) { if (!weapon->IsWeapon()) { @@ -628,7 +628,7 @@ int32 Client::GetMeleeDamage(Mob* other, bool GetMinDamage) int ucDamageBonus = 0; - if( Hand == MainPrimary && GetLevel() >= 28 && IsWarriorClass() ) + if( Hand == 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(MainPrimary); + weapon = attacker->CastToClient()->GetInv().GetItem(SlotPrimary); if(weapon && weapon->IsWeapon()){ - attacker->CastToClient()->AttackAnimation(skillinuse, MainPrimary, weapon); + attacker->CastToClient()->AttackAnimation(skillinuse, SlotPrimary, weapon); } else { - weapon = attacker->CastToClient()->GetInv().GetItem(MainSecondary); + weapon = attacker->CastToClient()->GetInv().GetItem(SlotSecondary); if (weapon && weapon->IsWeapon()) - attacker->CastToClient()->AttackAnimation(skillinuse, MainSecondary, weapon); + attacker->CastToClient()->AttackAnimation(skillinuse, SlotSecondary, weapon); else { - weapon = attacker->CastToClient()->GetInv().GetItem(MainRange); + weapon = attacker->CastToClient()->GetInv().GetItem(SlotRange); if (weapon && weapon->IsWeapon()) - attacker->CastToClient()->AttackAnimation(skillinuse, MainRange, weapon); + attacker->CastToClient()->AttackAnimation(skillinuse, SlotRange, weapon); } } } - tmp_hit_chance = Tune_CheckHitChance(defender,attacker, skillinuse, MainPrimary,0,0,0, avoid_override); + tmp_hit_chance = Tune_CheckHitChance(defender,attacker, skillinuse, 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, MainPrimary,0,false,0, avoid_override, add_acc); + tmp_hit_chance =Tune_CheckHitChance(defender,attacker, skillinuse, 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, MainPrimary,0,Msg,0,avoid_override);//Display Stat Report + Tune_CheckHitChance(defender,attacker, skillinuse, 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(MainPrimary); + weapon = attacker->CastToClient()->GetInv().GetItem(SlotPrimary); if(weapon && weapon->IsWeapon()){ - attacker->CastToClient()->AttackAnimation(skillinuse, MainPrimary, weapon); + attacker->CastToClient()->AttackAnimation(skillinuse, SlotPrimary, weapon); } else { - weapon = attacker->CastToClient()->GetInv().GetItem(MainSecondary); + weapon = attacker->CastToClient()->GetInv().GetItem(SlotSecondary); if (weapon && weapon->IsWeapon()) - attacker->CastToClient()->AttackAnimation(skillinuse, MainSecondary, weapon); + attacker->CastToClient()->AttackAnimation(skillinuse, SlotSecondary, weapon); else { - weapon = attacker->CastToClient()->GetInv().GetItem(MainRange); + weapon = attacker->CastToClient()->GetInv().GetItem(SlotRange); if (weapon && weapon->IsWeapon()) - attacker->CastToClient()->AttackAnimation(skillinuse, MainRange, weapon); + attacker->CastToClient()->AttackAnimation(skillinuse, SlotRange, weapon); } } } - tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, MainPrimary,0,0,acc_override, 0); + tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, 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, MainPrimary, 0,0, acc_override, 0,0,add_avoid); + tmp_hit_chance = Tune_CheckHitChance(defender, attacker, skillinuse, 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, MainPrimary,0,Msg,acc_override, 0);//Display Stat Report + Tune_CheckHitChance(defender,attacker, skillinuse, SlotPrimary,0,Msg,acc_override, 0);//Display Stat Report Message(0, " "); diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 5347b2792..0fc194c1e 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[EmuConstants::ITEM_COMMON_SIZE]; + uint32 aug[EQEmu::Constants::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_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) + for (int i = AUG_BEGIN; i < EQEmu::Constants::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_BEGIN; index < EmuConstants::ITEM_CONTAINER_SIZE; index++) { + for (uint8 index = SUB_BEGIN; index < EQEmu::Constants::ITEM_CONTAINER_SIZE; index++) { ItemInst* inst = container->GetItem(index); if (!inst) continue; uint32 item_id = inst->GetItem()->ID; - uint32 augslot[EmuConstants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; + uint32 augslot[EQEmu::Constants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; if (inst->IsType(ItemClassCommon)) { - for(int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) { + for (int i = AUG_BEGIN; i < EQEmu::Constants::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, EmuConstants::BANDOLIERS_SIZE); + character_id, EQEmu::Constants::BANDOLIERS_SIZE); auto results = database.QueryDatabase(query); int i = 0; int r = 0; int si = 0; - for (i = 0; i < EmuConstants::BANDOLIERS_SIZE; i++) { + for (i = 0; i < EQEmu::Constants::BANDOLIERS_SIZE; i++) { pp->bandoliers[i].Name[0] = '\0'; - for (int si = 0; si < EmuConstants::BANDOLIER_ITEM_COUNT; si++) { + for (int si = 0; si < EQEmu::Constants::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 < EmuConstants::TRIBUTE_SIZE; i++){ + for (i = 0; i < EQEmu::Constants::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, EmuConstants::POTION_BELT_ITEM_COUNT); + character_id, EQEmu::Constants::POTION_BELT_ITEM_COUNT); auto results = database.QueryDatabase(query); int i = 0; - for (i = 0; i < EmuConstants::POTION_BELT_ITEM_COUNT; i++) { + for (i = 0; i < EQEmu::Constants::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 < EmuConstants::TRIBUTE_SIZE; i++){ + for (int i = 0; i < EQEmu::Constants::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 = EmuConstants::MATERIAL_BEGIN; index <= EmuConstants::MATERIAL_END; index++) { + for (int index = EQEmu::Constants::MATERIAL_BEGIN; index <= EQEmu::Constants::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 = MaterialChest; index < 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 <= EmuConstants::MATERIAL_END; index++) + for (int index = MaterialChest; index <= EQEmu::Constants::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 = EmuConstants::MATERIAL_BEGIN; index <= EmuConstants::MATERIAL_END; index++) { + for (int index = EQEmu::Constants::MATERIAL_BEGIN; index <= EQEmu::Constants::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 == EmuConstants::EQUIPMENT_SIZE) + if (itemCount == EQEmu::Constants::EQUIPMENT_SIZE) break; if(atoi(row[0]) == 0) @@ -3199,7 +3199,7 @@ void ZoneDatabase::SavePetInfo(Client *client) query.clear(); // pet inventory! - for (int index = EmuConstants::EQUIPMENT_BEGIN; index <= EmuConstants::EQUIPMENT_END; index++) { + for (int index = EQEmu::Constants::EQUIPMENT_BEGIN; index <= EQEmu::Constants::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 < EmuConstants::EQUIPMENT_BEGIN || slot > EmuConstants::EQUIPMENT_END) + if (slot < EQEmu::Constants::EQUIPMENT_BEGIN || slot > EQEmu::Constants::EQUIPMENT_END) continue; pi->Items[slot] = atoul(row[2]); diff --git a/zone/zonedb.h b/zone/zonedb.h index 3c5ca7b00..250c7106d 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[EmuConstants::EQUIPMENT_SIZE]; + uint32 Items[EQEmu::Constants::EQUIPMENT_SIZE]; char Name[64]; }; diff --git a/zone/zonedump.h b/zone/zonedump.h index e69692339..cc8fe2010 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[MaterialCount]; uint32 min_dmg; uint32 max_dmg; int16 attack_count;