mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 22:01:30 +00:00
Rework of eq_dictionary
This commit is contained in:
parent
6ea061dc55
commit
e75a53b775
@ -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
|
||||
|
||||
|
||||
@ -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++;
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -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, <EQClientVersion))
|
||||
static const uint16 MAP_BAZAAR_SIZE = 80;
|
||||
static const uint16 MAP_INSPECT_SIZE = 22;
|
||||
static const uint16 MAP_REAL_ESTATE_SIZE = 0;
|
||||
static const uint16 MAP_VIEW_MOD_PC_SIZE = NOT_USED;
|
||||
static const uint16 MAP_VIEW_MOD_BANK_SIZE = NOT_USED;
|
||||
static const uint16 MAP_VIEW_MOD_SHARED_BANK_SIZE = NOT_USED;
|
||||
static const uint16 MAP_VIEW_MOD_LIMBO_SIZE = NOT_USED;
|
||||
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 = 0;
|
||||
static const uint16 MAP_OTHER_SIZE = 0;
|
||||
// these are currently hard-coded for existing inventory system..do not use in place of special client version handlers until ready
|
||||
static const uint16 TYPE_POSSESSIONS_SIZE = SlotCount;
|
||||
static const uint16 TYPE_BANK_SIZE = 24;
|
||||
static const uint16 TYPE_SHARED_BANK_SIZE = 2;
|
||||
static const uint16 TYPE_TRADE_SIZE = 8;
|
||||
static const uint16 TYPE_WORLD_SIZE = 10;
|
||||
static const uint16 TYPE_LIMBO_SIZE = 36;
|
||||
static const uint16 TYPE_TRIBUTE_SIZE = 5; // (need client values)
|
||||
static const uint16 TYPE_TROPHY_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_GUILD_TRIBUTE_SIZE = 0;
|
||||
static const uint16 TYPE_MERCHANT_SIZE = 0;
|
||||
static const uint16 TYPE_DELETED_SIZE = 0;
|
||||
static const uint16 TYPE_CORPSE_SIZE = SlotCount; // no bitmask use..limits to size of client corpse window (see EQLimits::InventoryMapSize(MapCorpse, <EQClientVersion))
|
||||
static const uint16 TYPE_BAZAAR_SIZE = 80;
|
||||
static const uint16 TYPE_INSPECT_SIZE = 22;
|
||||
static const uint16 TYPE_REAL_ESTATE_SIZE = 0;
|
||||
static const uint16 TYPE_VIEW_MOD_PC_SIZE = NOT_USED;
|
||||
static const uint16 TYPE_VIEW_MOD_BANK_SIZE = NOT_USED;
|
||||
static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = NOT_USED;
|
||||
static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = NOT_USED;
|
||||
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 = 0;
|
||||
static const uint16 TYPE_OTHER_SIZE = 0;
|
||||
|
||||
// most of these definitions will go away with the structure-based system..this maintains compatibility for now
|
||||
// (these are mainly to assign specific values to constants used in conversions and to identify per-client ranges/offsets)
|
||||
static const int16 EQUIPMENT_BEGIN = MainCharm;
|
||||
static const int16 EQUIPMENT_END = MainAmmo;
|
||||
static const uint16 EQUIPMENT_SIZE = 22; // does not account for 'Power Source' - used mainly for npc equipment arrays
|
||||
// most of these definitions will go away with the structure-based system..this maintains compatibility for now
|
||||
// (these are mainly to assign specific values to constants used in conversions and to identify per-client ranges/offsets)
|
||||
static const int16 EQUIPMENT_BEGIN = SlotCharm;
|
||||
static const int16 EQUIPMENT_END = SlotAmmo;
|
||||
static const uint16 EQUIPMENT_SIZE = 22; // does not account for 'Power Source' - used mainly for npc equipment arrays
|
||||
|
||||
static const int16 GENERAL_BEGIN = MainGeneral1;
|
||||
static const int16 GENERAL_END = MainGeneral8;
|
||||
static const uint16 GENERAL_SIZE = 8;
|
||||
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 GENERAL_BEGIN = SlotGeneral1;
|
||||
static const int16 GENERAL_END = SlotGeneral8;
|
||||
static const uint16 GENERAL_SIZE = 8;
|
||||
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_BAG_BEGIN = 331;
|
||||
static const int16 CURSOR_BAG_END_OFFSET = 9;
|
||||
static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET;
|
||||
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;
|
||||
|
||||
static const int16 BANK_BEGIN = 2000;
|
||||
static const int16 BANK_END = 2023;
|
||||
static const int16 BANK_BAGS_BEGIN = 2031;
|
||||
static const int16 BANK_BAGS_END_OFFSET = 239;
|
||||
static const int16 BANK_BAGS_END = BANK_BAGS_BEGIN + BANK_BAGS_END_OFFSET;
|
||||
static const int16 BANK_BEGIN = 2000;
|
||||
static const int16 BANK_END = 2023;
|
||||
static const int16 BANK_BAGS_BEGIN = 2031;
|
||||
static const int16 BANK_BAGS_END_OFFSET = 239;
|
||||
static const int16 BANK_BAGS_END = BANK_BAGS_BEGIN + BANK_BAGS_END_OFFSET;
|
||||
|
||||
static const int16 SHARED_BANK_BEGIN = 2500;
|
||||
static const int16 SHARED_BANK_END = 2501;
|
||||
static const int16 SHARED_BANK_BAGS_BEGIN = 2531;
|
||||
static const int16 SHARED_BANK_BAGS_END_OFFSET = 19;
|
||||
static const int16 SHARED_BANK_BAGS_END = SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_END_OFFSET;
|
||||
static const int16 SHARED_BANK_BEGIN = 2500;
|
||||
static const int16 SHARED_BANK_END = 2501;
|
||||
static const int16 SHARED_BANK_BAGS_BEGIN = 2531;
|
||||
static const int16 SHARED_BANK_BAGS_END_OFFSET = 19;
|
||||
static const int16 SHARED_BANK_BAGS_END = SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_END_OFFSET;
|
||||
|
||||
static const int16 TRADE_BEGIN = 3000;
|
||||
static const int16 TRADE_END = 3007;
|
||||
static const int16 TRADE_NPC_END = 3003;
|
||||
static const int16 TRADE_BAGS_BEGIN = 3031;
|
||||
static const int16 TRADE_BAGS_END_OFFSET = 79;
|
||||
static const int16 TRADE_BAGS_END = TRADE_BAGS_BEGIN + TRADE_BAGS_END_OFFSET;
|
||||
static const int16 TRADE_BEGIN = 3000;
|
||||
static const int16 TRADE_END = 3007;
|
||||
static const int16 TRADE_NPC_END = 3003;
|
||||
static const int16 TRADE_BAGS_BEGIN = 3031;
|
||||
static const int16 TRADE_BAGS_END_OFFSET = 79;
|
||||
static const int16 TRADE_BAGS_END = TRADE_BAGS_BEGIN + TRADE_BAGS_END_OFFSET;
|
||||
|
||||
static const int16 WORLD_BEGIN = 4000;
|
||||
static const int16 WORLD_END = 4009;
|
||||
static const int16 WORLD_SIZE = MAP_WORLD_SIZE;
|
||||
static const int16 WORLD_BEGIN = 4000;
|
||||
static const int16 WORLD_END = 4009;
|
||||
static const int16 WORLD_SIZE = TYPE_WORLD_SIZE;
|
||||
|
||||
static const int16 TRIBUTE_BEGIN = 400;
|
||||
static const int16 TRIBUTE_END = 404;
|
||||
static const int16 TRIBUTE_SIZE = MAP_TRIBUTE_SIZE;
|
||||
static const int16 TRIBUTE_BEGIN = 400;
|
||||
static const int16 TRIBUTE_END = 404;
|
||||
static const int16 TRIBUTE_SIZE = TYPE_TRIBUTE_SIZE;
|
||||
|
||||
static const int16 CORPSE_BEGIN = 22;
|
||||
//static const int16 CORPSE_END = RoF::consts::CORPSE_END; // not ready for use
|
||||
static const int16 CORPSE_BEGIN = 22;
|
||||
//static const int16 CORPSE_END = RoF::consts::CORPSE_END; // not ready for use
|
||||
|
||||
static const int16 MATERIAL_BEGIN = MaterialHead;
|
||||
static const int16 MATERIAL_END = MaterialSecondary;
|
||||
static const int16 MATERIAL_TINT_END = MaterialFeet;
|
||||
static const int16 MATERIAL_SIZE = _MaterialCount;
|
||||
static const int16 MATERIAL_BEGIN = MaterialHead;
|
||||
static const int16 MATERIAL_END = MaterialSecondary;
|
||||
static const int16 MATERIAL_TINT_END = MaterialFeet;
|
||||
static const int16 MATERIAL_SIZE = MaterialCount;
|
||||
|
||||
// items
|
||||
// common and container sizes will not increase until the new 'location' struct is implemented
|
||||
static const uint16 ITEM_COMMON_SIZE = RoF::consts::ITEM_COMMON_SIZE;
|
||||
static const uint16 ITEM_CONTAINER_SIZE = Titanium::consts::ITEM_CONTAINER_SIZE;
|
||||
// items
|
||||
// common and container sizes will not increase until the new 'location' struct is implemented
|
||||
static const uint16 ITEM_COMMON_SIZE = RoF::consts::ITEM_COMMON_SIZE;
|
||||
static const uint16 ITEM_CONTAINER_SIZE = Titanium::consts::ITEM_CONTAINER_SIZE;
|
||||
|
||||
// BANDOLIERS_SIZE sets maximum limit..active limit will need to be handled by the appropriate AA or spell (or item?)
|
||||
static const size_t BANDOLIERS_SIZE = RoF2::consts::BANDOLIERS_SIZE; // number of bandolier instances
|
||||
static const size_t BANDOLIER_ITEM_COUNT = RoF2::consts::BANDOLIER_ITEM_COUNT; // number of equipment slots in bandolier instance
|
||||
// BANDOLIERS_SIZE sets maximum limit..active limit will need to be handled by the appropriate AA or spell (or item?)
|
||||
static const size_t BANDOLIERS_SIZE = RoF2::consts::BANDOLIERS_SIZE; // number of bandolier instances
|
||||
static const size_t BANDOLIER_ITEM_COUNT = RoF2::consts::BANDOLIER_ITEM_COUNT; // number of equipment slots in bandolier instance
|
||||
|
||||
// POTION_BELT_SIZE sets maximum limit..active limit will need to be handled by the appropriate AA or spell (or item?)
|
||||
static const size_t POTION_BELT_ITEM_COUNT = RoF2::consts::POTION_BELT_ITEM_COUNT;
|
||||
// POTION_BELT_SIZE sets maximum limit..active limit will need to be handled by the appropriate AA or spell (or item?)
|
||||
static const size_t POTION_BELT_ITEM_COUNT = RoF2::consts::POTION_BELT_ITEM_COUNT;
|
||||
|
||||
static const size_t TEXT_LINK_BODY_LENGTH = RoF2::consts::TEXT_LINK_BODY_LENGTH;
|
||||
};
|
||||
static const size_t TEXT_LINK_BODY_LENGTH = RoF2::consts::TEXT_LINK_BODY_LENGTH;
|
||||
};
|
||||
|
||||
class EQLimits
|
||||
{
|
||||
// values should default to a non-beneficial value..unless value conflicts with intended operation
|
||||
//
|
||||
// EmuConstants may be used as references..but, not every reference needs to be in EmuConstants (i.e., AllowsEmptyBagInBag(), CoinHasWeight(), etc...)
|
||||
public:
|
||||
// client version validation (checks to avoid crashing zone server when accessing reference arrays)
|
||||
// use this inside of class Client (limits to actual clients)
|
||||
static bool IsValidPCClientVersion(ClientVersion clientVersion);
|
||||
static ClientVersion ValidatePCClientVersion(ClientVersion clientVersion);
|
||||
// EQEmu::Constants may be used as references..but, not every reference needs to be in EQEmu::Constants (i.e., AllowsEmptyBagInBag(), CoinHasWeight(), etc...)
|
||||
class Limits {
|
||||
public:
|
||||
// client version validation (checks to avoid crashing zone server when accessing reference arrays)
|
||||
// use this inside of class Client (limits to actual clients)
|
||||
static bool IsValidPCClientVersion(ClientVersion clientVersion);
|
||||
static ClientVersion ValidatePCClientVersion(ClientVersion clientVersion);
|
||||
|
||||
// basically..any non-client classes - do not when setting a valid client
|
||||
static bool IsValidNPCClientVersion(ClientVersion clientVersion);
|
||||
static ClientVersion ValidateNPCClientVersion(ClientVersion clientVersion);
|
||||
// basically..any non-client classes - do not when setting a valid client
|
||||
static bool IsValidNPCClientVersion(ClientVersion clientVersion);
|
||||
static ClientVersion ValidateNPCClientVersion(ClientVersion clientVersion);
|
||||
|
||||
// these are 'universal' - do not when setting a valid client
|
||||
static bool IsValidMobClientVersion(ClientVersion clientVersion);
|
||||
static ClientVersion ValidateMobClientVersion(ClientVersion clientVersion);
|
||||
// these are 'universal' - do not when setting a valid client
|
||||
static bool IsValidMobClientVersion(ClientVersion clientVersion);
|
||||
static ClientVersion ValidateMobClientVersion(ClientVersion clientVersion);
|
||||
|
||||
// database
|
||||
static size_t CharacterCreationLimit(ClientVersion clientVersion);
|
||||
// database
|
||||
static size_t CharacterCreationLimit(ClientVersion clientVersion);
|
||||
|
||||
// inventory
|
||||
static uint16 InventoryMapSize(int16 indexMap, ClientVersion clientVersion);
|
||||
static uint64 PossessionsBitmask(ClientVersion clientVersion);
|
||||
static uint64 EquipmentBitmask(ClientVersion clientVersion);
|
||||
static uint64 GeneralBitmask(ClientVersion clientVersion);
|
||||
static uint64 CursorBitmask(ClientVersion clientVersion);
|
||||
// inventory
|
||||
static uint16 InventoryMapSize(int16 indexMap, ClientVersion clientVersion);
|
||||
static uint64 PossessionsBitmask(ClientVersion clientVersion);
|
||||
static uint64 EquipmentBitmask(ClientVersion clientVersion);
|
||||
static uint64 GeneralBitmask(ClientVersion clientVersion);
|
||||
static uint64 CursorBitmask(ClientVersion clientVersion);
|
||||
|
||||
static bool AllowsEmptyBagInBag(ClientVersion clientVersion);
|
||||
static bool AllowsClickCastFromBag(ClientVersion clientVersion);
|
||||
static bool AllowsEmptyBagInBag(ClientVersion clientVersion);
|
||||
static bool AllowsClickCastFromBag(ClientVersion clientVersion);
|
||||
|
||||
// items
|
||||
static uint16 ItemCommonSize(ClientVersion clientVersion);
|
||||
static uint16 ItemContainerSize(ClientVersion clientVersion);
|
||||
// items
|
||||
static uint16 ItemCommonSize(ClientVersion clientVersion);
|
||||
static uint16 ItemContainerSize(ClientVersion clientVersion);
|
||||
|
||||
// player profile
|
||||
static bool CoinHasWeight(ClientVersion clientVersion);
|
||||
};
|
||||
// player profile
|
||||
static bool CoinHasWeight(ClientVersion clientVersion);
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* EQ_DICTIONARY_H */
|
||||
|
||||
|
||||
@ -294,7 +294,7 @@ struct Spawn_Struct {
|
||||
/*0000*/ EquipStruct equip_primary; // Equipment: Main visual
|
||||
/*0000*/ EquipStruct equip_secondary; // Equipment: Off visual
|
||||
} equip;
|
||||
/*0000*/ EquipStruct equipment[_MaterialCount];
|
||||
/*0000*/ EquipStruct equipment[MaterialCount];
|
||||
};
|
||||
/*0233*/ float runspeed; // Speed when running
|
||||
/*0036*/ uint8 afk; // 0=no, 1=afk
|
||||
@ -340,7 +340,7 @@ union
|
||||
/*0376*/ Color_Struct color_primary; // Color of primary item
|
||||
/*0380*/ Color_Struct color_secondary; // Color of secondary item
|
||||
} equipment_colors;
|
||||
/*0348*/ Color_Struct colors[_MaterialCount]; // Array elements correspond to struct equipment_colors above
|
||||
/*0348*/ Color_Struct colors[MaterialCount]; // Array elements correspond to struct equipment_colors above
|
||||
};
|
||||
/*0384*/ uint8 lfg; // 0=off, 1=lfg on
|
||||
/*0385*/
|
||||
@ -777,7 +777,7 @@ struct BandolierItem_Struct
|
||||
struct Bandolier_Struct
|
||||
{
|
||||
char Name[32];
|
||||
BandolierItem_Struct Items[EmuConstants::BANDOLIER_ITEM_COUNT];
|
||||
BandolierItem_Struct Items[EQEmu::Constants::BANDOLIER_ITEM_COUNT];
|
||||
};
|
||||
|
||||
//len = 72
|
||||
@ -791,7 +791,7 @@ struct PotionBeltItem_Struct
|
||||
//len = 288
|
||||
struct PotionBelt_Struct
|
||||
{
|
||||
PotionBeltItem_Struct Items[EmuConstants::POTION_BELT_ITEM_COUNT];
|
||||
PotionBeltItem_Struct Items[EQEmu::Constants::POTION_BELT_ITEM_COUNT];
|
||||
};
|
||||
|
||||
struct MovePotionToBelt_Struct
|
||||
@ -882,7 +882,7 @@ struct SuspendedMinion_Struct
|
||||
/*002*/ uint32 HP;
|
||||
/*006*/ uint32 Mana;
|
||||
/*010*/ SpellBuff_Struct Buffs[BUFF_COUNT];
|
||||
/*510*/ uint32 Items[_MaterialCount];
|
||||
/*510*/ uint32 Items[MaterialCount];
|
||||
/*546*/ char Name[64];
|
||||
/*610*/
|
||||
};
|
||||
@ -990,9 +990,9 @@ struct PlayerProfile_Struct
|
||||
/*0304*/ uint8 ability_time_minutes;
|
||||
/*0305*/ uint8 ability_time_hours; //place holder
|
||||
/*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag?
|
||||
/*0312*/ uint32 item_material[_MaterialCount]; // Item texture/material of worn/held items
|
||||
/*0312*/ uint32 item_material[MaterialCount]; // Item texture/material of worn/held items
|
||||
/*0348*/ uint8 unknown0348[44];
|
||||
/*0392*/ Color_Struct item_tint[_MaterialCount];
|
||||
/*0392*/ Color_Struct item_tint[MaterialCount];
|
||||
/*0428*/ AA_Array aa_array[MAX_PP_AA_ARRAY];
|
||||
/*2348*/ float unknown2384; //seen ~128, ~47
|
||||
/*2352*/ char servername[32]; // length probably not right
|
||||
@ -1093,7 +1093,7 @@ struct PlayerProfile_Struct
|
||||
/*7212*/ uint32 tribute_points;
|
||||
/*7216*/ uint32 unknown7252;
|
||||
/*7220*/ uint32 tribute_active; //1=active
|
||||
/*7224*/ Tribute_Struct tributes[EmuConstants::TRIBUTE_SIZE];
|
||||
/*7224*/ Tribute_Struct tributes[EQEmu::Constants::TRIBUTE_SIZE];
|
||||
/*7264*/ Disciplines_Struct disciplines;
|
||||
/*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use)
|
||||
/*7744*/ char unknown7780[160];
|
||||
@ -1120,7 +1120,7 @@ struct PlayerProfile_Struct
|
||||
/*12800*/ uint32 expAA;
|
||||
/*12804*/ uint32 aapoints; //avaliable, unspent
|
||||
/*12808*/ uint8 unknown12844[36];
|
||||
/*12844*/ Bandolier_Struct bandoliers[EmuConstants::BANDOLIERS_SIZE];
|
||||
/*12844*/ Bandolier_Struct bandoliers[EQEmu::Constants::BANDOLIERS_SIZE];
|
||||
/*14124*/ uint8 unknown14160[4506];
|
||||
/*18630*/ SuspendedMinion_Struct SuspendedMinion; // No longer in use
|
||||
/*19240*/ uint32 timeentitledonaccount;
|
||||
@ -2125,7 +2125,7 @@ struct Illusion_Struct { //size: 256 - SoF
|
||||
/*092*/ uint32 drakkin_heritage; //
|
||||
/*096*/ uint32 drakkin_tattoo; //
|
||||
/*100*/ uint32 drakkin_details; //
|
||||
/*104*/ uint32 armor_tint[_MaterialCount]; //
|
||||
/*104*/ uint32 armor_tint[MaterialCount]; //
|
||||
/*140*/ uint8 eyecolor1; // Field Not Identified in any Illusion Struct
|
||||
/*141*/ uint8 eyecolor2; // Field Not Identified in any Illusion Struct
|
||||
/*142*/ uint8 unknown138[114]; //
|
||||
@ -3412,7 +3412,7 @@ struct DyeStruct
|
||||
struct Color_Struct secondary; // or this
|
||||
}
|
||||
dyes;
|
||||
struct Color_Struct dye[_MaterialCount];
|
||||
struct Color_Struct dye[MaterialCount];
|
||||
};
|
||||
};
|
||||
|
||||
@ -3473,8 +3473,8 @@ struct SelectTributeReply_Struct {
|
||||
|
||||
struct TributeInfo_Struct {
|
||||
uint32 active; //0 == inactive, 1 == active
|
||||
uint32 tributes[EmuConstants::TRIBUTE_SIZE]; //-1 == NONE
|
||||
uint32 tiers[EmuConstants::TRIBUTE_SIZE]; //all 00's
|
||||
uint32 tributes[EQEmu::Constants::TRIBUTE_SIZE]; //-1 == NONE
|
||||
uint32 tiers[EQEmu::Constants::TRIBUTE_SIZE]; //all 00's
|
||||
uint32 tribute_master_id;
|
||||
};
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ struct ExtendedProfile_Struct {
|
||||
uint16 old_pet_hp; /* Not Used */
|
||||
uint16 old_pet_mana; /* Not Used */
|
||||
SpellBuff_Struct pet_buffs[BUFF_COUNT]; /* Not Used */
|
||||
uint32 pet_items[_MaterialCount]; /* Not Used */
|
||||
uint32 pet_items[MaterialCount]; /* Not Used */
|
||||
char merc_name[64]; /* Used */
|
||||
|
||||
uint32 aa_effects; /* Used */
|
||||
|
||||
358
common/item.cpp
358
common/item.cpp
File diff suppressed because it is too large
Load Diff
@ -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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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*/
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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*/
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -104,8 +104,8 @@ bool SharedDatabase::SaveCursor(uint32 char_id, std::list<ItemInst*>::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<ItemInst*>::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]);
|
||||
}
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
104
zone/attack.cpp
104
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<SkillUseTypes>(GetPrimSkill());
|
||||
OffHandAtk(false);
|
||||
}
|
||||
if (Hand == MainSecondary) {
|
||||
if (Hand == SlotSecondary) {
|
||||
skillinuse = static_cast<SkillUseTypes>(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<float>(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<float>(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<int>(((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;
|
||||
|
||||
@ -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; }
|
||||
|
||||
@ -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)
|
||||
|
||||
252
zone/bot.cpp
252
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 <EmuConstants::ITEM_COMMON_SIZE; ++m) {
|
||||
for (int m = AUG_BEGIN; m < EQEmu::Constants::ITEM_COMMON_SIZE; ++m) {
|
||||
ItemInst *itm = inst->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<int>(((delay / haste_mod) + ((hhe / 1000.0f) * (delay / haste_mod))) * 100) : static_cast<int>(((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);
|
||||
|
||||
@ -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); }
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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())
|
||||
|
||||
112
zone/client.cpp
112
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)
|
||||
{
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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<uint16, std::string>::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.");
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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<uint32> 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; }
|
||||
|
||||
@ -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; }
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -272,7 +272,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
|
||||
// it is an improvement.
|
||||
|
||||
if (!item2->NoPet) {
|
||||
for (int i = 0; !found && i<EmuConstants::EQUIPMENT_SIZE; i++) {
|
||||
for (int i = 0; !found && i < EQEmu::Constants::EQUIPMENT_SIZE; i++) {
|
||||
uint32 slots = (1 << i);
|
||||
if (item2->Slots & slots) {
|
||||
if(equipment[i])
|
||||
@ -313,7 +313,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
|
||||
// @merth: IDFile size has been increased, this needs to change
|
||||
uint16 emat;
|
||||
if(item2->Material <= 0
|
||||
|| item2->Slots & (1 << 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;
|
||||
}
|
||||
|
||||
|
||||
@ -1757,47 +1757,47 @@ luabind::scope lua_register_slot() {
|
||||
return luabind::class_<Slots>("Slot")
|
||||
.enum_("constants")
|
||||
[
|
||||
luabind::value("Charm", static_cast<int>(MainCharm)),
|
||||
luabind::value("Ear1", static_cast<int>(MainEar1)),
|
||||
luabind::value("Head", static_cast<int>(MainHead)),
|
||||
luabind::value("Face", static_cast<int>(MainFace)),
|
||||
luabind::value("Ear2", static_cast<int>(MainEar2)),
|
||||
luabind::value("Neck", static_cast<int>(MainNeck)),
|
||||
luabind::value("Shoulder", static_cast<int>(MainShoulders)), // deprecated
|
||||
luabind::value("Shoulders", static_cast<int>(MainShoulders)),
|
||||
luabind::value("Arms", static_cast<int>(MainArms)),
|
||||
luabind::value("Back", static_cast<int>(MainBack)),
|
||||
luabind::value("Bracer1", static_cast<int>(MainWrist1)), // deprecated
|
||||
luabind::value("Wrist1", static_cast<int>(MainWrist1)),
|
||||
luabind::value("Bracer2", static_cast<int>(MainWrist2)), // deprecated
|
||||
luabind::value("Wrist2", static_cast<int>(MainWrist2)),
|
||||
luabind::value("Range", static_cast<int>(MainRange)),
|
||||
luabind::value("Hands", static_cast<int>(MainHands)),
|
||||
luabind::value("Primary", static_cast<int>(MainPrimary)),
|
||||
luabind::value("Secondary", static_cast<int>(MainSecondary)),
|
||||
luabind::value("Ring1", static_cast<int>(MainFinger1)), // deprecated
|
||||
luabind::value("Finger1", static_cast<int>(MainFinger1)),
|
||||
luabind::value("Ring2", static_cast<int>(MainFinger2)), // deprecated
|
||||
luabind::value("Finger2", static_cast<int>(MainFinger2)),
|
||||
luabind::value("Chest", static_cast<int>(MainChest)),
|
||||
luabind::value("Legs", static_cast<int>(MainLegs)),
|
||||
luabind::value("Feet", static_cast<int>(MainFeet)),
|
||||
luabind::value("Waist", static_cast<int>(MainWaist)),
|
||||
luabind::value("PowerSource", static_cast<int>(MainPowerSource)),
|
||||
luabind::value("Ammo", static_cast<int>(MainAmmo)),
|
||||
luabind::value("General1", static_cast<int>(MainGeneral1)),
|
||||
luabind::value("General2", static_cast<int>(MainGeneral2)),
|
||||
luabind::value("General3", static_cast<int>(MainGeneral3)),
|
||||
luabind::value("General4", static_cast<int>(MainGeneral4)),
|
||||
luabind::value("General5", static_cast<int>(MainGeneral5)),
|
||||
luabind::value("General6", static_cast<int>(MainGeneral6)),
|
||||
luabind::value("General7", static_cast<int>(MainGeneral7)),
|
||||
luabind::value("General8", static_cast<int>(MainGeneral8)),
|
||||
luabind::value("Cursor", static_cast<int>(MainCursor)),
|
||||
luabind::value("PersonalBegin", static_cast<int>(EmuConstants::GENERAL_BEGIN)), // deprecated
|
||||
luabind::value("GeneralBegin", static_cast<int>(EmuConstants::GENERAL_BEGIN)),
|
||||
luabind::value("PersonalEnd", static_cast<int>(EmuConstants::GENERAL_END)), // deprecated
|
||||
luabind::value("GeneralEnd", static_cast<int>(EmuConstants::GENERAL_END)),
|
||||
luabind::value("Charm", static_cast<int>(SlotCharm)),
|
||||
luabind::value("Ear1", static_cast<int>(SlotEar1)),
|
||||
luabind::value("Head", static_cast<int>(SlotHead)),
|
||||
luabind::value("Face", static_cast<int>(SlotFace)),
|
||||
luabind::value("Ear2", static_cast<int>(SlotEar2)),
|
||||
luabind::value("Neck", static_cast<int>(SlotNeck)),
|
||||
luabind::value("Shoulder", static_cast<int>(SlotShoulders)), // deprecated
|
||||
luabind::value("Shoulders", static_cast<int>(SlotShoulders)),
|
||||
luabind::value("Arms", static_cast<int>(SlotArms)),
|
||||
luabind::value("Back", static_cast<int>(SlotBack)),
|
||||
luabind::value("Bracer1", static_cast<int>(SlotWrist1)), // deprecated
|
||||
luabind::value("Wrist1", static_cast<int>(SlotWrist1)),
|
||||
luabind::value("Bracer2", static_cast<int>(SlotWrist2)), // deprecated
|
||||
luabind::value("Wrist2", static_cast<int>(SlotWrist2)),
|
||||
luabind::value("Range", static_cast<int>(SlotRange)),
|
||||
luabind::value("Hands", static_cast<int>(SlotHands)),
|
||||
luabind::value("Primary", static_cast<int>(SlotPrimary)),
|
||||
luabind::value("Secondary", static_cast<int>(SlotSecondary)),
|
||||
luabind::value("Ring1", static_cast<int>(SlotFinger1)), // deprecated
|
||||
luabind::value("Finger1", static_cast<int>(SlotFinger1)),
|
||||
luabind::value("Ring2", static_cast<int>(SlotFinger2)), // deprecated
|
||||
luabind::value("Finger2", static_cast<int>(SlotFinger2)),
|
||||
luabind::value("Chest", static_cast<int>(SlotChest)),
|
||||
luabind::value("Legs", static_cast<int>(SlotLegs)),
|
||||
luabind::value("Feet", static_cast<int>(SlotFeet)),
|
||||
luabind::value("Waist", static_cast<int>(SlotWaist)),
|
||||
luabind::value("PowerSource", static_cast<int>(SlotPowerSource)),
|
||||
luabind::value("Ammo", static_cast<int>(SlotAmmo)),
|
||||
luabind::value("General1", static_cast<int>(SlotGeneral1)),
|
||||
luabind::value("General2", static_cast<int>(SlotGeneral2)),
|
||||
luabind::value("General3", static_cast<int>(SlotGeneral3)),
|
||||
luabind::value("General4", static_cast<int>(SlotGeneral4)),
|
||||
luabind::value("General5", static_cast<int>(SlotGeneral5)),
|
||||
luabind::value("General6", static_cast<int>(SlotGeneral6)),
|
||||
luabind::value("General7", static_cast<int>(SlotGeneral7)),
|
||||
luabind::value("General8", static_cast<int>(SlotGeneral8)),
|
||||
luabind::value("Cursor", static_cast<int>(SlotCursor)),
|
||||
luabind::value("PersonalBegin", static_cast<int>(EQEmu::Constants::GENERAL_BEGIN)), // deprecated
|
||||
luabind::value("GeneralBegin", static_cast<int>(EQEmu::Constants::GENERAL_BEGIN)),
|
||||
luabind::value("PersonalEnd", static_cast<int>(EQEmu::Constants::GENERAL_END)), // deprecated
|
||||
luabind::value("GeneralEnd", static_cast<int>(EQEmu::Constants::GENERAL_END)),
|
||||
luabind::value("CursorEnd", 0xFFFE), // deprecated
|
||||
luabind::value("Tradeskill", static_cast<int>(legacy::SLOT_TRADESKILL)), // deprecated
|
||||
luabind::value("Augment", static_cast<int>(legacy::SLOT_AUGMENT)), // deprecated
|
||||
@ -1819,9 +1819,9 @@ luabind::scope lua_register_material() {
|
||||
luabind::value("Feet", static_cast<int>(MaterialFeet)),
|
||||
luabind::value("Primary", static_cast<int>(MaterialPrimary)),
|
||||
luabind::value("Secondary", static_cast<int>(MaterialSecondary)),
|
||||
luabind::value("Max", static_cast<int>(_MaterialCount)), // deprecated
|
||||
luabind::value("Count", static_cast<int>(_MaterialCount)),
|
||||
luabind::value("Invalid", static_cast<int>(_MaterialInvalid))
|
||||
luabind::value("Max", static_cast<int>(MaterialCount)), // deprecated
|
||||
luabind::value("Count", static_cast<int>(MaterialCount)),
|
||||
luabind::value("Invalid", static_cast<int>(MaterialInvalid))
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -206,7 +206,7 @@ void Merc::CalcItemBonuses(StatBonuses* newbon) {
|
||||
|
||||
unsigned int i;
|
||||
//should not include 21 (SLOT_AMMO)
|
||||
for (i=0; i<MainAmmo; i++) {
|
||||
for (i = 0; i < SlotAmmo; i++) {
|
||||
if(equipment[i] == 0)
|
||||
continue;
|
||||
const Item_Struct * itm = database.GetItem(equipment[i]);
|
||||
@ -1551,24 +1551,24 @@ void Merc::AI_Process() {
|
||||
//try main hand first
|
||||
if(attack_timer.Check())
|
||||
{
|
||||
Attack(GetTarget(), MainPrimary);
|
||||
Attack(GetTarget(), SlotPrimary);
|
||||
|
||||
bool tripleSuccess = false;
|
||||
|
||||
if(GetOwner() && GetTarget() && CanThisClassDoubleAttack())
|
||||
{
|
||||
if(GetOwner()) {
|
||||
Attack(GetTarget(), MainPrimary, true);
|
||||
Attack(GetTarget(), SlotPrimary, true);
|
||||
}
|
||||
|
||||
if(GetOwner() && GetTarget() && GetSpecialAbility(SPECATK_TRIPLE)) {
|
||||
tripleSuccess = true;
|
||||
Attack(GetTarget(), MainPrimary, true);
|
||||
Attack(GetTarget(), SlotPrimary, true);
|
||||
}
|
||||
|
||||
//quad attack, does this belong here??
|
||||
if(GetOwner() && GetTarget() && GetSpecialAbility(SPECATK_QUAD)) {
|
||||
Attack(GetTarget(), MainPrimary, true);
|
||||
Attack(GetTarget(), SlotPrimary, true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1580,8 +1580,8 @@ void Merc::AI_Process() {
|
||||
if(zone->random.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; }
|
||||
|
||||
@ -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<uint32,MercTimer> 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
|
||||
|
||||
@ -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()) {
|
||||
|
||||
24
zone/mob.h
24
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;
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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; i<EmuConstants::EQUIPMENT_SIZE; i++)
|
||||
for (int i = 0; i < EQEmu::Constants::EQUIPMENT_SIZE; i++)
|
||||
if (petinv[i]) {
|
||||
item = database.GetItem(petinv[i]);
|
||||
npc->AddLootDrop(item, &npc->itemlist, 0, 1, 127, true, true);
|
||||
@ -572,7 +572,7 @@ void NPC::GetPetState(SpellBuff_Struct *pet_buffs, uint32 *items, char *name) {
|
||||
strn0cpy(name, GetName(), 64);
|
||||
|
||||
//save their items, we only care about what they are actually wearing
|
||||
memcpy(items, equipment, sizeof(uint32)*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)
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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())
|
||||
|
||||
@ -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<uint32>(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)
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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<EQEmu::Any> item_list;
|
||||
std::list<ItemInst*> 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);
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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, " ");
|
||||
|
||||
|
||||
@ -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]);
|
||||
|
||||
@ -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];
|
||||
};
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user