Renamed and moved SkillUseTypes enumeration to EQEmu::skills::SkillType; eq_dictionary work

This commit is contained in:
Uleat
2016-05-25 18:50:26 -04:00
parent 615158e701
commit 71f128731f
86 changed files with 4987 additions and 3074 deletions
+2
View File
@@ -15,6 +15,7 @@ SET(common_sources
deity.cpp
emu_constants.cpp
emu_legacy.cpp
emu_limits.cpp
emu_opcodes.cpp
emu_tcp_connection.cpp
emu_tcp_server.cpp
@@ -121,6 +122,7 @@ SET(common_headers
deity.h
emu_constants.h
emu_legacy.h
emu_limits.h
emu_opcodes.h
emu_oplist.h
emu_tcp_connection.h
-238
View File
@@ -18,241 +18,3 @@
*/
#include "emu_constants.h"
#include "string_util.h"
uint16 EQEmu::constants::InventoryTypeSize(int16 type_index)
{
switch (type_index) {
case legacy::TypePossessions:
return legacy::TYPE_POSSESSIONS_SIZE;
case legacy::TypeBank:
return legacy::TYPE_BANK_SIZE;
case legacy::TypeSharedBank:
return legacy::TYPE_SHARED_BANK_SIZE;
case legacy::TypeTrade:
return legacy::TYPE_TRADE_SIZE;
case legacy::TypeWorld:
return legacy::TYPE_WORLD_SIZE;
case legacy::TypeLimbo:
return legacy::TYPE_LIMBO_SIZE;
case legacy::TypeTribute:
return legacy::TYPE_TRIBUTE_SIZE;
case legacy::TypeTrophyTribute:
return legacy::TYPE_TROPHY_TRIBUTE_SIZE;
case legacy::TypeGuildTribute:
return legacy::TYPE_GUILD_TRIBUTE_SIZE;
case legacy::TypeMerchant:
return legacy::TYPE_MERCHANT_SIZE;
case legacy::TypeDeleted:
return legacy::TYPE_DELETED_SIZE;
case legacy::TypeCorpse:
return legacy::TYPE_CORPSE_SIZE;
case legacy::TypeBazaar:
return legacy::TYPE_BAZAAR_SIZE;
case legacy::TypeInspect:
return legacy::TYPE_INSPECT_SIZE;
case legacy::TypeRealEstate:
return legacy::TYPE_REAL_ESTATE_SIZE;
case legacy::TypeViewMODPC:
return legacy::TYPE_VIEW_MOD_PC_SIZE;
case legacy::TypeViewMODBank:
return legacy::TYPE_VIEW_MOD_BANK_SIZE;
case legacy::TypeViewMODSharedBank:
return legacy::TYPE_VIEW_MOD_SHARED_BANK_SIZE;
case legacy::TypeViewMODLimbo:
return legacy::TYPE_VIEW_MOD_LIMBO_SIZE;
case legacy::TypeAltStorage:
return legacy::TYPE_ALT_STORAGE_SIZE;
case legacy::TypeArchived:
return legacy::TYPE_ARCHIVED_SIZE;
case legacy::TypeMail:
return legacy::TYPE_MAIL_SIZE;
case legacy::TypeGuildTrophyTribute:
return legacy::TYPE_GUILD_TROPHY_TRIBUTE_SIZE;
case legacy::TypeKrono:
return legacy::TYPE_KRONO_SIZE;
case legacy::TypeOther:
return legacy::TYPE_OTHER_SIZE;
default:
return NOT_USED;
}
}
/*
const char* EQEmu::constants::InventoryLocationName(Location_Struct location)
{
// not ready for implementation...
std::string ret_str;
StringFormat(ret_str, "%s, %s, %s, %s", InventoryMapName(location.map), InventoryMainName(location.main), InventorySubName(location.sub), InventoryAugName(location.aug));
return ret_str;
}
*/
const char* EQEmu::constants::InventoryTypeName(int16 type_index)
{
switch (type_index) {
case INVALID_INDEX:
return "Invalid Type";
case legacy::TypePossessions:
return "Possessions";
case legacy::TypeBank:
return "Bank";
case legacy::TypeSharedBank:
return "SharedBank";
case legacy::TypeTrade:
return "Trade";
case legacy::TypeWorld:
return "World";
case legacy::TypeLimbo:
return "Limbo";
case legacy::TypeTribute:
return "Tribute";
case legacy::TypeTrophyTribute:
return "TrophyTribute";
case legacy::TypeGuildTribute:
return "GuildTribute";
case legacy::TypeMerchant:
return "Merchant";
case legacy::TypeDeleted:
return "Deleted";
case legacy::TypeCorpse:
return "Corpse";
case legacy::TypeBazaar:
return "Bazaar";
case legacy::TypeInspect:
return "Inspect";
case legacy::TypeRealEstate:
return "RealEstate";
case legacy::TypeViewMODPC:
return "ViewMODPC";
case legacy::TypeViewMODBank:
return "ViewMODBank";
case legacy::TypeViewMODSharedBank:
return "ViewMODSharedBank";
case legacy::TypeViewMODLimbo:
return "ViewMODLimbo";
case legacy::TypeAltStorage:
return "AltStorage";
case legacy::TypeArchived:
return "Archived";
case legacy::TypeMail:
return "Mail";
case legacy::TypeGuildTrophyTribute:
return "GuildTrophyTribute";
case legacy::TypeKrono:
return "Krono";
case legacy::TypeOther:
return "Other";
default:
return "Unknown Type";
}
}
const char* EQEmu::constants::InventorySlotName(int16 slot_index)
{
switch (slot_index) {
case INVALID_INDEX:
return "Invalid Slot";
case legacy::SlotCharm:
return "Charm";
case legacy::SlotEar1:
return "Ear1";
case legacy::SlotHead:
return "Head";
case legacy::SlotFace:
return "Face";
case legacy::SlotEar2:
return "Ear2";
case legacy::SlotNeck:
return "Neck";
case legacy::SlotShoulders:
return "Shoulders";
case legacy::SlotArms:
return "Arms";
case legacy::SlotBack:
return "Back";
case legacy::SlotWrist1:
return "Wrist1";
case legacy::SlotWrist2:
return "Wrist2";
case legacy::SlotRange:
return "Range";
case legacy::SlotHands:
return "Hands";
case legacy::SlotPrimary:
return "Primary";
case legacy::SlotSecondary:
return "Secondary";
case legacy::SlotFinger1:
return "Finger1";
case legacy::SlotFinger2:
return "Finger2";
case legacy::SlotChest:
return "Chest";
case legacy::SlotLegs:
return "Legs";
case legacy::SlotFeet:
return "Feet";
case legacy::SlotWaist:
return "Waist";
case legacy::SlotPowerSource:
return "PowerSource";
case legacy::SlotAmmo:
return "Ammo";
case legacy::SlotGeneral1:
return "General1";
case legacy::SlotGeneral2:
return "General2";
case legacy::SlotGeneral3:
return "General3";
case legacy::SlotGeneral4:
return "General4";
case legacy::SlotGeneral5:
return "General5";
case legacy::SlotGeneral6:
return "General6";
case legacy::SlotGeneral7:
return "General7";
case legacy::SlotGeneral8:
return "General8";
/*
case legacy::SlotGeneral9:
return "General9";
case legacy::SlotGeneral10:
return "General10";
*/
case legacy::SlotCursor:
return "Cursor";
default:
return "Unknown Slot";
}
}
const char* EQEmu::constants::InventorySubName(int16 sub_index)
{
if (sub_index == INVALID_INDEX)
return "Invalid Sub";
if ((uint16)sub_index >= legacy::ITEM_CONTAINER_SIZE)
return "Unknown Sub";
static std::string ret_str;
ret_str = StringFormat("Container%i", (sub_index + 1)); // zero-based index..but, count starts at one
return ret_str.c_str();
}
const char* EQEmu::constants::InventoryAugName(int16 aug_index)
{
if (aug_index == INVALID_INDEX)
return "Invalid Aug";
if ((uint16)aug_index >= legacy::ITEM_COMMON_SIZE)
return "Unknown Aug";
static std::string ret_str;
ret_str = StringFormat("Augment%i", (aug_index + 1)); // zero-based index..but, count starts at one
return ret_str.c_str();
}
+18 -27
View File
@@ -21,41 +21,32 @@
#define COMMON_EMU_CONSTANTS_H
#include "eq_limits.h"
// (future use)
//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)
#include "emu_legacy.h"
#include "inventory_version.h"
#include "light_source.h"
#include "deity.h"
#include "say_link.h"
//#include "deity.h"
//#include "say_link.h"
#include <string>
// *** DO NOT CHANGE without a full understanding of the consequences..the server is set up to use these settings explicitly!! ***
// *** You will cause compilation failures and corrupt your database if partial or incorrect attempts to change them are made!! ***
// Hard-coded values usually indicate that further research is needed and the values given are from the old (known) system
namespace EQEmu
{
// an immutable value is required to initialize arrays, etc... use this class as a repository for those
namespace inventory {
//using namespace RoF2::invtype;
//using namespace RoF2::invslot;
//using namespace RoF2::invbag;
//using namespace RoF2::invaug;
} /*inventory*/
namespace constants {
// database
static const EQEmu::versions::ClientVersion CharacterCreationClient = EQEmu::versions::ClientVersion::RoF2;
static const size_t CharacterCreationLimit = RoF2::consts::CHARACTER_CREATION_LIMIT;
const EQEmu::versions::ClientVersion CharacterCreationClient = EQEmu::versions::ClientVersion::RoF2;
const size_t CharacterCreationMax = RoF2::constants::CharacterCreationLimit;
// inventory
extern uint16 InventoryTypeSize(int16 type_index);
//extern const char* InventoryLocationName(Location_Struct location);
extern const char* InventoryTypeName(int16 type_index);
extern const char* InventorySlotName(int16 slot_index);
extern const char* InventorySubName(int16 sub_index);
extern const char* InventoryAugName(int16 aug_index);
}
}
const size_t SayLinkBodySize = RoF2::constants::SayLinkBodySize;
#endif /* COMMON_EMU_CONSTANTS_H */
} /*constants*/
} /*EQEmu*/
#endif /*COMMON_EMU_CONSTANTS_H*/
+18
View File
@@ -0,0 +1,18 @@
/* EQEMu: Everquest Server Emulator
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
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+56
View File
@@ -0,0 +1,56 @@
/* EQEMu: Everquest Server Emulator
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
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef COMMON_EMU_LIMITS_H
#define COMMON_EMU_LIMITS_H
#include "types.h"
#include <stdlib.h>
namespace EntityLimits
{
namespace npc {
enum : int { Invalid = -1, Null, Safety };
enum : bool { False = false, True = true };
}
namespace merc {
enum : int { Invalid = -1, Null, Safety };
enum : bool { False = false, True = true };
}
namespace bot {
enum : int { Invalid = -1, Null, Safety };
enum : bool { False = false, True = true };
}
namespace pet {
enum : int { Invalid = -1, Null, Safety };
enum : bool { False = false, True = true };
}
}; /*EntityLimits*/
#endif /*COMMON_EMU_LIMITS_H*/
+1 -1
View File
@@ -399,7 +399,7 @@ static const uint8 DamageTypeUnknown = 0xFF;
**
** (indexed by 'Skill' of SkillUseTypes)
*/
static const uint8 SkillDamageTypes[HIGHEST_SKILL + 1] = // change to _SkillServerArraySize once activated
static const uint8 SkillDamageTypes[EQEmu::skills::HIGHEST_SKILL + 1] = // change to _SkillServerArraySize once activated
{
/*1HBlunt*/ 0,
/*1HSlashing*/ 1,
+394 -513
View File
File diff suppressed because it is too large Load Diff
+35 -20
View File
@@ -22,7 +22,7 @@
#include "types.h"
#include "eq_constants.h"
#include "inventory_version.h" // inv2 watch
#include "inventory_version.h"
#include "../common/patches/titanium_limits.h"
#include "../common/patches/sof_limits.h"
#include "../common/patches/sod_limits.h"
@@ -31,35 +31,50 @@
#include "../common/patches/rof2_limits.h"
// *** DO NOT CHANGE without a full understanding of the consequences..the server is set up to use these settings explicitly!! ***
// *** You will cause compilation failures and corrupt your database if partial or incorrect attempts to change them are made!! ***
// Hard-coded values usually indicate that further research is needed and the values given are from the old (known) system
namespace EQEmu
{
namespace limits {
// database
namespace constants {
extern size_t CharacterCreationLimit(versions::ClientVersion client_version);
// inventory
} /*constants*/
namespace inventory {
extern uint16 InventoryTypeSize(versions::InventoryVersion inventory_version, int16 inv_type);
extern uint64 PossessionsBitmask(versions::InventoryVersion inventory_version);
extern uint64 EquipmentBitmask(versions::InventoryVersion inventory_version);
extern uint64 GeneralBitmask(versions::InventoryVersion inventory_version);
extern uint64 CursorBitmask(versions::InventoryVersion inventory_version);
extern bool AllowEmptyBagInBag(versions::InventoryVersion inventory_version);
extern bool AllowClickCastFromBag(versions::InventoryVersion inventory_version);
// items
extern uint16 ItemCommonSize(versions::InventoryVersion inventory_version);
extern uint16 ItemContainerSize(versions::InventoryVersion inventory_version);
extern uint16 ItemAugSize(versions::InventoryVersion inventory_version);
extern uint16 ItemBagSize(versions::InventoryVersion inventory_version);
// player profile
extern bool ConcatenateInvTypeLimbo(versions::InventoryVersion inventory_version);
extern bool AllowOverLevelEquipment(versions::InventoryVersion inventory_version);
} /*inventory*/
namespace profile {
extern bool CoinHasWeight(versions::InventoryVersion inventory_version);
}
}
#endif /* COMMON_EQ_LIMITS_H */
} /*profile*/
} /*EQEmu*/
namespace ClientUnknown
{
enum : int { Invalid = -1, Null, Safety };
enum : bool { False = false, True = true };
} /*ClientUnknown*/
namespace Client62
{
enum : int { Invalid = -1, Null, Safety };
enum : bool { False = false, True = true };
} /*Client62*/
#endif /*COMMON_EQ_LIMITS_H*/
+24 -3
View File
@@ -1517,17 +1517,38 @@ struct ExpUpdate_Struct
enum ItemPacketType
{
ItemPacketViewLink = 0x00,
ItemPacketMerchant = 0x64,
ItemPacketTradeView = 0x65,
ItemPacketLoot = 0x66,
ItemPacketTrade = 0x67,
ItemPacketCharInventory = 0x69,
ItemPacketSummonItem = 0x6A,
ItemPacketTributeItem = 0x6C,
ItemPacketMerchant = 0x64,
ItemPacketWorldContainer = 0x6B,
ItemPacketCharmUpdate = 0x6E,
ItemPacketTributeItem = 0x6C,
ItemPacketGuildTribute = 0x6D,
ItemPacketCharmUpdate = 0x6E, // noted as incorrect
ItemPacketInvalid = 0xFF
};
//enum ItemPacketType
//{
// ItemPacketMerchant = /*100*/ 0x64, // Titanium+
// ItemPacketTradeView = /*101*/ 0x65,
// ItemPacketLoot = /*102*/ 0x66,
// ItemPacketTrade = /*103*/ 0x67,
// ItemPacketCharInventory = /*105*/ 0x69,
// ItemPacketLimbo = /*106*/ 0x6A, // name change
// ItemPacketWorldContainer = /*107*/ 0x6B,
// ItemPacketTributeItem = /*108*/ 0x6C,
// ItemPacketGuildTribute = /*109*/ 0x6D, // missing from EQEmu
// ItemPacket10 = /*110*/ 0x6E,
// ItemPacket11 = /*111*/ 0x6F, // UF+ (equipment slots only) (RoF+ checks '(WORD*)slot + 4 != -1' [(WORD*)]slot + 2 would be bag index - if used) (guess)
// ItemPacket12 = /*112*/ 0x70, // RoF+ (causes stat update) (could be TrophyTribute and GuildTrophyTribute together - two case methodology - is it checking for GuildID?)
// ItemPacketRecovery = /*113*/ 0x71, (same handler as merchant..exception: parameter is '1' versus merchant '0' looks like tab id)
// ItemPacket14 = /*115*/ 0x73, (real estate/moving crate?)
// ItemPacket__ = /*xxx*/ 0xXX // switch 'default' - all clients
//};
struct ItemPacket_Struct
{
/*00*/ ItemPacketType PacketType;
+3 -1
View File
@@ -24,6 +24,8 @@
#include "shareddb.h"
#include "string_util.h"
#include "../common/light_source.h"
#include <limits.h>
#include <iostream>
@@ -927,7 +929,7 @@ bool Inventory::SupportsClickCasting(int16 slot_id)
}
else if (slot_id >= EQEmu::legacy::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::legacy::GENERAL_BAGS_END)
{
if (EQEmu::limits::AllowClickCastFromBag(m_inventory_version))
if (EQEmu::inventory::AllowClickCastFromBag(m_inventory_version))
return true;
}
+2
View File
@@ -32,6 +32,7 @@ class EvolveInfo; // Stores information about an evolving item family
#include "../common/item_struct.h"
#include "../common/timer.h"
#include "../common/bodytypes.h"
#include "../common/deity.h" // aren't we already in '/common'?
#include "string_util.h"
@@ -77,6 +78,7 @@ enum {
invWhereCursor = 0x20
};
class ItemInst;
// ########################################
// Class: Queue
+37 -37
View File
@@ -2346,12 +2346,12 @@ namespace RoF
outapp->WriteUInt8(0); // Unknown
outapp->WriteUInt8(0); // Unknown
outapp->WriteUInt32(consts::BANDOLIERS_SIZE);
outapp->WriteUInt32(profile::BandoliersSize);
// Copy bandoliers where server and client indexes converge
for (uint32 r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
for (uint32 r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < profile::BandoliersSize; ++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
for (uint32 j = 0; j < profile::BandolierItemCount; ++j) { // Will need adjusting if 'server != client' is ever true
outapp->WriteString(emu->bandoliers[r].Items[j].Name);
outapp->WriteUInt32(emu->bandoliers[r].Items[j].ID);
if (emu->bandoliers[r].Items[j].Icon) {
@@ -2364,19 +2364,19 @@ namespace RoF
}
}
// Nullify bandoliers where server and client indexes diverge, with a client bias
for (uint32 r = EQEmu::legacy::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
for (uint32 r = EQEmu::legacy::BANDOLIERS_SIZE; r < profile::BandoliersSize; ++r) {
outapp->WriteString("");
for (uint32 j = 0; j < consts::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
for (uint32 j = 0; j < profile::BandolierItemCount; ++j) { // Will need adjusting if 'server != client' is ever true
outapp->WriteString("");
outapp->WriteUInt32(0);
outapp->WriteSInt32(-1);
}
}
outapp->WriteUInt32(consts::POTION_BELT_ITEM_COUNT);
outapp->WriteUInt32(profile::PotionBeltSize);
// Copy potion belt where server and client indexes converge
for (uint32 r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (uint32 r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < profile::PotionBeltSize; ++r) {
outapp->WriteString(emu->potionbelt.Items[r].Name);
outapp->WriteUInt32(emu->potionbelt.Items[r].ID);
if (emu->potionbelt.Items[r].Icon) {
@@ -2388,7 +2388,7 @@ namespace RoF
}
}
// Nullify potion belt where server and client indexes diverge, with a client bias
for (uint32 r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (uint32 r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < profile::PotionBeltSize; ++r) {
outapp->WriteString("");
outapp->WriteUInt32(0);
outapp->WriteSInt32(-1);
@@ -3002,7 +3002,7 @@ namespace RoF
size_t names_length = 0;
size_t character_count = 0;
for (; character_count < emu->CharCount && character_count < consts::CHARACTER_CREATION_LIMIT; ++character_count) {
for (; character_count < emu->CharCount && character_count < constants::SayLinkBodySize; ++character_count) {
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
names_length += strlen(emu_cse->Name);
emu_ptr += sizeof(CharacterSelectEntry_Struct);
@@ -5214,7 +5214,7 @@ namespace RoF
structs::InventorySlot_Struct slot_id = ServerToRoFSlot(slot_id_in);
hdr.slot_type = (inst->GetMerchantSlot() ? inventory::TypeMerchant : slot_id.Type);
hdr.slot_type = (inst->GetMerchantSlot() ? invtype::InvTypeMerchant : slot_id.Type);
hdr.main_slot = (inst->GetMerchantSlot() ? inst->GetMerchantSlot() : slot_id.Slot);
hdr.sub_slot = (inst->GetMerchantSlot() ? 0xffff : slot_id.SubIndex);
hdr.aug_slot = (inst->GetMerchantSlot() ? 0xffff : slot_id.AugIndex);
@@ -5402,7 +5402,7 @@ namespace RoF
isbs.augdistiller = 65535;
isbs.augrestrict = item->AugRestrict;
for (int index = 0; index < consts::ITEM_COMMON_SIZE; ++index) {
for (int index = 0; index < invaug::ItemAugSize; ++index) {
isbs.augslots[index].type = item->AugSlotType[index];
isbs.augslots[index].visible = item->AugSlotVisible[index];
isbs.augslots[index].unknown = item->AugSlotUnk2[index];
@@ -5650,11 +5650,11 @@ namespace RoF
uint32 TempSlot = 0;
if (serverSlot < 56 || serverSlot == EQEmu::legacy::SlotPowerSource) { // Main Inventory and Cursor
RoFSlot.Type = inventory::TypePossessions;
RoFSlot.Type = invtype::InvTypePossessions;
RoFSlot.Slot = serverSlot;
if (serverSlot == EQEmu::legacy::SlotPowerSource)
RoFSlot.Slot = inventory::SlotPowerSource;
RoFSlot.Slot = invslot::PossessionsPowerSource;
else if (serverSlot >= EQEmu::legacy::SlotCursor) // Cursor and Extended Corpse Inventory
RoFSlot.Slot += 3;
@@ -5669,22 +5669,22 @@ namespace RoF
}*/
else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END) { // (> 250 && < 341)
RoFSlot.Type = inventory::TypePossessions;
RoFSlot.Type = invtype::InvTypePossessions;
TempSlot = serverSlot - 1;
RoFSlot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 2;
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::legacy::ITEM_CONTAINER_SIZE);
if (RoFSlot.Slot >= inventory::SlotGeneral9) // (> 30)
RoFSlot.Slot = inventory::SlotCursor;
if (RoFSlot.Slot >= invslot::PossessionsGeneral9) // (> 30)
RoFSlot.Slot = invslot::PossessionsCursor;
}
else if (serverSlot >= EQEmu::legacy::TRIBUTE_BEGIN && serverSlot <= EQEmu::legacy::TRIBUTE_END) { // Tribute
RoFSlot.Type = inventory::TypeTribute;
RoFSlot.Type = invtype::InvTypeTribute;
RoFSlot.Slot = serverSlot - EQEmu::legacy::TRIBUTE_BEGIN;
}
else if (serverSlot >= EQEmu::legacy::BANK_BEGIN && serverSlot <= EQEmu::legacy::BANK_BAGS_END) {
RoFSlot.Type = inventory::TypeBank;
RoFSlot.Type = invtype::InvTypeBank;
TempSlot = serverSlot - EQEmu::legacy::BANK_BEGIN;
RoFSlot.Slot = TempSlot;
@@ -5695,7 +5695,7 @@ namespace RoF
}
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END) {
RoFSlot.Type = inventory::TypeSharedBank;
RoFSlot.Type = invtype::InvTypeSharedBank;
TempSlot = serverSlot - EQEmu::legacy::SHARED_BANK_BEGIN;
RoFSlot.Slot = TempSlot;
@@ -5706,7 +5706,7 @@ namespace RoF
}
else if (serverSlot >= EQEmu::legacy::TRADE_BEGIN && serverSlot <= EQEmu::legacy::TRADE_BAGS_END) {
RoFSlot.Type = inventory::TypeTrade;
RoFSlot.Type = invtype::InvTypeTrade;
TempSlot = serverSlot - EQEmu::legacy::TRADE_BEGIN;
RoFSlot.Slot = TempSlot;
@@ -5730,7 +5730,7 @@ namespace RoF
}
else if (serverSlot >= EQEmu::legacy::WORLD_BEGIN && serverSlot <= EQEmu::legacy::WORLD_END) {
RoFSlot.Type = inventory::TypeWorld;
RoFSlot.Type = invtype::InvTypeWorld;
TempSlot = serverSlot - EQEmu::legacy::WORLD_BEGIN;
RoFSlot.Slot = TempSlot;
}
@@ -5754,7 +5754,7 @@ namespace RoF
RoFSlot.Slot = serverSlot;
if (serverSlot == EQEmu::legacy::SlotPowerSource)
RoFSlot.Slot = inventory::SlotPowerSource;
RoFSlot.Slot = invslot::PossessionsPowerSource;
else if (serverSlot >= EQEmu::legacy::SlotCursor) // Cursor and Extended Corpse Inventory
RoFSlot.Slot += 3;
@@ -5791,11 +5791,11 @@ namespace RoF
uint32 ServerSlot = INVALID_INDEX;
uint32 TempSlot = 0;
if (rofSlot.Type == inventory::TypePossessions && rofSlot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 51)
if (rofSlot.Slot == inventory::SlotPowerSource)
if (rofSlot.Type == invtype::InvTypePossessions && rofSlot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 51)
if (rofSlot.Slot == invslot::PossessionsPowerSource)
TempSlot = EQEmu::legacy::SlotPowerSource;
else if (rofSlot.Slot >= inventory::SlotCursor) // Cursor and Extended Corpse Inventory
else if (rofSlot.Slot >= invslot::PossessionsCursor) // 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
@@ -5809,7 +5809,7 @@ 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.Slot >= inventory::SlotAmmo) // Ammo and Main Inventory
else if (rofSlot.Slot >= invslot::PossessionsAmmo) // Ammo and Main Inventory
TempSlot = rofSlot.Slot - 1;
else // Worn Slots
@@ -5821,7 +5821,7 @@ namespace RoF
ServerSlot = TempSlot;
}
else if (rofSlot.Type == inventory::TypeBank) {
else if (rofSlot.Type == invtype::InvTypeBank) {
TempSlot = EQEmu::legacy::BANK_BEGIN;
if (rofSlot.SubIndex >= SUB_INDEX_BEGIN)
@@ -5833,7 +5833,7 @@ namespace RoF
ServerSlot = TempSlot;
}
else if (rofSlot.Type == inventory::TypeSharedBank) {
else if (rofSlot.Type == invtype::InvTypeSharedBank) {
TempSlot = EQEmu::legacy::SHARED_BANK_BEGIN;
if (rofSlot.SubIndex >= SUB_INDEX_BEGIN)
@@ -5845,7 +5845,7 @@ namespace RoF
ServerSlot = TempSlot;
}
else if (rofSlot.Type == inventory::TypeTrade) {
else if (rofSlot.Type == invtype::InvTypeTrade) {
TempSlot = EQEmu::legacy::TRADE_BEGIN;
if (rofSlot.SubIndex >= SUB_INDEX_BEGIN)
@@ -5859,7 +5859,7 @@ namespace RoF
ServerSlot = TempSlot;
}
else if (rofSlot.Type == inventory::TypeWorld) {
else if (rofSlot.Type == invtype::InvTypeWorld) {
TempSlot = EQEmu::legacy::WORLD_BEGIN;
if (rofSlot.Slot >= SUB_INDEX_BEGIN)
@@ -5877,7 +5877,7 @@ namespace RoF
ServerSlot = TempSlot;
}*/
else if (rofSlot.Type == inventory::TypeGuildTribute) {
else if (rofSlot.Type == invtype::InvTypeGuildTribute) {
ServerSlot = INVALID_INDEX;
}
@@ -5892,10 +5892,10 @@ namespace RoF
uint32 TempSlot = 0;
if (rofSlot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 33)
if (rofSlot.Slot == inventory::SlotPowerSource)
if (rofSlot.Slot == invslot::PossessionsPowerSource)
TempSlot = EQEmu::legacy::SlotPowerSource;
else if (rofSlot.Slot >= inventory::SlotCursor) // Cursor and Extended Corpse Inventory
else if (rofSlot.Slot >= invslot::PossessionsCursor) // 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
@@ -5904,7 +5904,7 @@ namespace RoF
// Same as above
}*/
else if (rofSlot.Slot >= inventory::SlotAmmo) // Main Inventory and Ammo Slots
else if (rofSlot.Slot >= invslot::PossessionsAmmo) // Main Inventory and Ammo Slots
TempSlot = rofSlot.Slot - 1;
else
@@ -5928,7 +5928,7 @@ namespace RoF
static inline void ServerToRoFTextLink(std::string& rofTextLink, const std::string& serverTextLink)
{
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
if ((constants::SayLinkBodySize == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
rofTextLink = serverTextLink;
return;
}
@@ -5967,7 +5967,7 @@ namespace RoF
static inline void RoFToServerTextLink(std::string& serverTextLink, const std::string& rofTextLink)
{
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (rofTextLink.find('\x12') == std::string::npos)) {
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == constants::SayLinkBodySize) || (rofTextLink.find('\x12') == std::string::npos)) {
serverTextLink = rofTextLink;
return;
}
@@ -5976,7 +5976,7 @@ namespace RoF
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= consts::TEXT_LINK_BODY_LENGTH) {
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
serverTextLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
+39 -39
View File
@@ -2429,12 +2429,12 @@ namespace RoF2
outapp->WriteUInt8(0); // Unknown
outapp->WriteUInt8(0); // Unknown
outapp->WriteUInt32(consts::BANDOLIERS_SIZE);
outapp->WriteUInt32(profile::BandoliersSize);
// Copy bandoliers where server and client indexes converge
for (uint32 r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
for (uint32 r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < profile::BandoliersSize; ++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
for (uint32 j = 0; j < profile::BandolierItemCount; ++j) { // Will need adjusting if 'server != client' is ever true
outapp->WriteString(emu->bandoliers[r].Items[j].Name);
outapp->WriteUInt32(emu->bandoliers[r].Items[j].ID);
if (emu->bandoliers[r].Items[j].Icon) {
@@ -2447,19 +2447,19 @@ namespace RoF2
}
}
// Nullify bandoliers where server and client indexes diverge, with a client bias
for (uint32 r = EQEmu::legacy::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
for (uint32 r = EQEmu::legacy::BANDOLIERS_SIZE; r < profile::BandoliersSize; ++r) {
outapp->WriteString("");
for (uint32 j = 0; j < consts::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
for (uint32 j = 0; j < profile::BandolierItemCount; ++j) { // Will need adjusting if 'server != client' is ever true
outapp->WriteString("");
outapp->WriteUInt32(0);
outapp->WriteSInt32(-1);
}
}
outapp->WriteUInt32(consts::POTION_BELT_ITEM_COUNT);
outapp->WriteUInt32(profile::PotionBeltSize);
// Copy potion belt where server and client indexes converge
for (uint32 r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (uint32 r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < profile::PotionBeltSize; ++r) {
outapp->WriteString(emu->potionbelt.Items[r].Name);
outapp->WriteUInt32(emu->potionbelt.Items[r].ID);
if (emu->potionbelt.Items[r].Icon) {
@@ -2471,7 +2471,7 @@ namespace RoF2
}
}
// Nullify potion belt where server and client indexes diverge, with a client bias
for (uint32 r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (uint32 r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < profile::PotionBeltSize; ++r) {
outapp->WriteString("");
outapp->WriteUInt32(0);
outapp->WriteSInt32(-1);
@@ -3095,7 +3095,7 @@ namespace RoF2
size_t names_length = 0;
size_t character_count = 0;
for (; character_count < emu->CharCount && character_count < consts::CHARACTER_CREATION_LIMIT; ++character_count) {
for (; character_count < emu->CharCount && character_count < constants::CharacterCreationLimit; ++character_count) {
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
names_length += strlen(emu_cse->Name);
emu_ptr += sizeof(CharacterSelectEntry_Struct);
@@ -5489,7 +5489,7 @@ namespace RoF2
structs::InventorySlot_Struct slot_id = ServerToRoF2Slot(slot_id_in, packet_type);
hdr.slot_type = (inst->GetMerchantSlot() ? inventory::TypeMerchant : slot_id.Type);
hdr.slot_type = (inst->GetMerchantSlot() ? invtype::InvTypeMerchant : slot_id.Type);
hdr.main_slot = (inst->GetMerchantSlot() ? inst->GetMerchantSlot() : slot_id.Slot);
hdr.sub_slot = (inst->GetMerchantSlot() ? 0xffff : slot_id.SubIndex);
hdr.aug_slot = (inst->GetMerchantSlot() ? 0xffff : slot_id.AugIndex);
@@ -5677,7 +5677,7 @@ namespace RoF2
isbs.augrestrict2 = -1;
isbs.augrestrict = item->AugRestrict;
for (int index = 0; index < consts::ITEM_COMMON_SIZE; ++index) {
for (int index = 0; index < invaug::ItemAugSize; ++index) {
isbs.augslots[index].type = item->AugSlotType[index];
isbs.augslots[index].visible = item->AugSlotVisible[index];
isbs.augslots[index].unknown = item->AugSlotUnk2[index];
@@ -5937,17 +5937,17 @@ namespace RoF2
if (serverSlot < 56 || serverSlot == EQEmu::legacy::SlotPowerSource) { // Main Inventory and Cursor
if (PacketType == ItemPacketLoot)
{
RoF2Slot.Type = inventory::TypeCorpse;
RoF2Slot.Type = invtype::InvTypeCorpse;
RoF2Slot.Slot = serverSlot - EQEmu::legacy::CORPSE_BEGIN;
}
else
{
RoF2Slot.Type = inventory::TypePossessions;
RoF2Slot.Type = invtype::InvTypePossessions;
RoF2Slot.Slot = serverSlot;
}
if (serverSlot == EQEmu::legacy::SlotPowerSource)
RoF2Slot.Slot = inventory::SlotPowerSource;
RoF2Slot.Slot = invslot::PossessionsPowerSource;
else if (serverSlot >= EQEmu::legacy::SlotCursor && PacketType != ItemPacketLoot) // Cursor and Extended Corpse Inventory
RoF2Slot.Slot += 3;
@@ -5962,22 +5962,22 @@ namespace RoF2
}*/
else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END) { // (> 250 && < 341)
RoF2Slot.Type = inventory::TypePossessions;
RoF2Slot.Type = invtype::InvTypePossessions;
TempSlot = serverSlot - 1;
RoF2Slot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 2;
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::legacy::ITEM_CONTAINER_SIZE);
if (RoF2Slot.Slot >= inventory::SlotGeneral9) // (> 30)
RoF2Slot.Slot = inventory::SlotCursor;
if (RoF2Slot.Slot >= invslot::PossessionsGeneral9) // (> 30)
RoF2Slot.Slot = invslot::PossessionsCursor;
}
else if (serverSlot >= EQEmu::legacy::TRIBUTE_BEGIN && serverSlot <= EQEmu::legacy::TRIBUTE_END) { // Tribute
RoF2Slot.Type = inventory::TypeTribute;
RoF2Slot.Type = invtype::InvTypeTribute;
RoF2Slot.Slot = serverSlot - EQEmu::legacy::TRIBUTE_BEGIN;
}
else if (serverSlot >= EQEmu::legacy::BANK_BEGIN && serverSlot <= EQEmu::legacy::BANK_BAGS_END) {
RoF2Slot.Type = inventory::TypeBank;
RoF2Slot.Type = invtype::InvTypeBank;
TempSlot = serverSlot - EQEmu::legacy::BANK_BEGIN;
RoF2Slot.Slot = TempSlot;
@@ -5988,7 +5988,7 @@ namespace RoF2
}
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END) {
RoF2Slot.Type = inventory::TypeSharedBank;
RoF2Slot.Type = invtype::InvTypeSharedBank;
TempSlot = serverSlot - EQEmu::legacy::SHARED_BANK_BEGIN;
RoF2Slot.Slot = TempSlot;
@@ -5999,7 +5999,7 @@ namespace RoF2
}
else if (serverSlot >= EQEmu::legacy::TRADE_BEGIN && serverSlot <= EQEmu::legacy::TRADE_BAGS_END) {
RoF2Slot.Type = inventory::TypeTrade;
RoF2Slot.Type = invtype::InvTypeTrade;
TempSlot = serverSlot - EQEmu::legacy::TRADE_BEGIN;
RoF2Slot.Slot = TempSlot;
@@ -6023,7 +6023,7 @@ namespace RoF2
}
else if (serverSlot >= EQEmu::legacy::WORLD_BEGIN && serverSlot <= EQEmu::legacy::WORLD_END) {
RoF2Slot.Type = inventory::TypeWorld;
RoF2Slot.Type = invtype::InvTypeWorld;
TempSlot = serverSlot - EQEmu::legacy::WORLD_BEGIN;
RoF2Slot.Slot = TempSlot;
}
@@ -6047,7 +6047,7 @@ namespace RoF2
RoF2Slot.Slot = serverSlot;
if (serverSlot == EQEmu::legacy::SlotPowerSource)
RoF2Slot.Slot = inventory::SlotPowerSource;
RoF2Slot.Slot = invslot::PossessionsPowerSource;
else if (serverSlot >= EQEmu::legacy::SlotCursor) // Cursor and Extended Corpse Inventory
RoF2Slot.Slot += 3;
@@ -6084,11 +6084,11 @@ namespace RoF2
uint32 ServerSlot = INVALID_INDEX;
uint32 TempSlot = 0;
if (rof2Slot.Type == inventory::TypePossessions && rof2Slot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 51)
if (rof2Slot.Slot == inventory::SlotPowerSource)
if (rof2Slot.Type == invtype::InvTypePossessions && rof2Slot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 51)
if (rof2Slot.Slot == invslot::PossessionsPowerSource)
TempSlot = EQEmu::legacy::SlotPowerSource;
else if (rof2Slot.Slot >= inventory::SlotCursor) // Cursor and Extended Corpse Inventory
else if (rof2Slot.Slot >= invslot::PossessionsCursor) // 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
@@ -6102,7 +6102,7 @@ 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.Slot >= inventory::SlotAmmo) // Ammo and Main Inventory
else if (rof2Slot.Slot >= invslot::PossessionsAmmo) // Ammo and Main Inventory
TempSlot = rof2Slot.Slot - 1;
else // Worn Slots
@@ -6114,7 +6114,7 @@ namespace RoF2
ServerSlot = TempSlot;
}
else if (rof2Slot.Type == inventory::TypeBank) {
else if (rof2Slot.Type == invtype::InvTypeBank) {
TempSlot = EQEmu::legacy::BANK_BEGIN;
if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN)
@@ -6126,7 +6126,7 @@ namespace RoF2
ServerSlot = TempSlot;
}
else if (rof2Slot.Type == inventory::TypeSharedBank) {
else if (rof2Slot.Type == invtype::InvTypeSharedBank) {
TempSlot = EQEmu::legacy::SHARED_BANK_BEGIN;
if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN)
@@ -6138,7 +6138,7 @@ namespace RoF2
ServerSlot = TempSlot;
}
else if (rof2Slot.Type == inventory::TypeTrade) {
else if (rof2Slot.Type == invtype::InvTypeTrade) {
TempSlot = EQEmu::legacy::TRADE_BEGIN;
if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN)
@@ -6152,7 +6152,7 @@ namespace RoF2
ServerSlot = TempSlot;
}
else if (rof2Slot.Type == inventory::TypeWorld) {
else if (rof2Slot.Type == invtype::InvTypeWorld) {
TempSlot = EQEmu::legacy::WORLD_BEGIN;
if (rof2Slot.Slot >= SUB_INDEX_BEGIN)
@@ -6170,11 +6170,11 @@ namespace RoF2
ServerSlot = TempSlot;
}*/
else if (rof2Slot.Type == inventory::TypeGuildTribute) {
else if (rof2Slot.Type == invtype::InvTypeGuildTribute) {
ServerSlot = INVALID_INDEX;
}
else if (rof2Slot.Type == inventory::TypeCorpse) {
else if (rof2Slot.Type == invtype::InvTypeCorpse) {
ServerSlot = rof2Slot.Slot + EQEmu::legacy::CORPSE_BEGIN;
}
@@ -6189,10 +6189,10 @@ namespace RoF2
uint32 TempSlot = 0;
if (rof2Slot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 33)
if (rof2Slot.Slot == inventory::SlotPowerSource)
if (rof2Slot.Slot == invslot::PossessionsPowerSource)
TempSlot = EQEmu::legacy::SlotPowerSource;
else if (rof2Slot.Slot >= inventory::SlotCursor) // Cursor and Extended Corpse Inventory
else if (rof2Slot.Slot >= invslot::PossessionsCursor) // 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
@@ -6201,7 +6201,7 @@ namespace RoF2
// Same as above
}*/
else if (rof2Slot.Slot >= inventory::SlotAmmo) // Main Inventory and Ammo Slots
else if (rof2Slot.Slot >= invslot::PossessionsAmmo) // Main Inventory and Ammo Slots
TempSlot = rof2Slot.Slot - 1;
else
@@ -6225,7 +6225,7 @@ namespace RoF2
static inline void ServerToRoF2TextLink(std::string& rof2TextLink, const std::string& serverTextLink)
{
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
if ((constants::SayLinkBodySize == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
rof2TextLink = serverTextLink;
return;
}
@@ -6257,7 +6257,7 @@ namespace RoF2
static inline void RoF2ToServerTextLink(std::string& serverTextLink, const std::string& rof2TextLink)
{
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (rof2TextLink.find('\x12') == std::string::npos)) {
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == constants::SayLinkBodySize) || (rof2TextLink.find('\x12') == std::string::npos)) {
serverTextLink = rof2TextLink;
return;
}
@@ -6266,7 +6266,7 @@ namespace RoF2
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= consts::TEXT_LINK_BODY_LENGTH) {
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
serverTextLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
+248
View File
@@ -16,3 +16,251 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "rof2_limits.h"
#include "../string_util.h"
size_t RoF2::invtype::InvTypeSize(int inv_type)
{
switch (inv_type) {
case invtype::InvTypePossessions:
return invtype::InvTypePossessionsSize;
case invtype::InvTypeBank:
return invtype::InvTypeBankSize;
case invtype::InvTypeSharedBank:
return invtype::InvTypeSharedBankSize;
case invtype::InvTypeTrade:
return invtype::InvTypeTradeSize;
case invtype::InvTypeWorld:
return invtype::InvTypeWorldSize;
case invtype::InvTypeLimbo:
return invtype::InvTypeLimboSize;
case invtype::InvTypeTribute:
return invtype::InvTypeTributeSize;
case invtype::InvTypeTrophyTribute:
return invtype::InvTypeTrophyTributeSize;
case invtype::InvTypeGuildTribute:
return invtype::InvTypeGuildTributeSize;
case invtype::InvTypeMerchant:
return invtype::InvTypeMerchantSize;
case invtype::InvTypeDeleted:
return invtype::InvTypeDeletedSize;
case invtype::InvTypeCorpse:
return invtype::InvTypeCorpseSize;
case invtype::InvTypeBazaar:
return invtype::InvTypeBazaarSize;
case invtype::InvTypeInspect:
return invtype::InvTypeInspectSize;
case invtype::InvTypeRealEstate:
return invtype::InvTypeRealEstateSize;
case invtype::InvTypeViewMODPC:
return invtype::InvTypeViewMODPCSize;
case invtype::InvTypeViewMODBank:
return invtype::InvTypeViewMODBankSize;
case invtype::InvTypeViewMODSharedBank:
return invtype::InvTypeViewMODSharedBankSize;
case invtype::InvTypeViewMODLimbo:
return invtype::InvTypeViewMODLimboSize;
case invtype::InvTypeAltStorage:
return invtype::InvTypeAltStorageSize;
case invtype::InvTypeArchived:
return invtype::InvTypeArchivedSize;
case invtype::InvTypeMail:
return invtype::InvTypeMailSize;
case invtype::InvTypeGuildTrophyTribute:
return invtype::InvTypeGuildTrophyTributeSize;
case invtype::InvTypeKrono:
return invtype::InvTypeKronoSize;
case invtype::InvTypeOther:
return invtype::InvTypeOtherSize;
default:
return 0;
}
}
const char* RoF2::invtype::InvTypeName(int inv_type)
{
switch (inv_type) {
case invtype::InvTypeInvalid:
return "Invalid Type";
case invtype::InvTypePossessions:
return "Possessions";
case invtype::InvTypeBank:
return "Bank";
case invtype::InvTypeSharedBank:
return "Shared Bank";
case invtype::InvTypeTrade:
return "Trade";
case invtype::InvTypeWorld:
return "World";
case invtype::InvTypeLimbo:
return "Limbo";
case invtype::InvTypeTribute:
return "Tribute";
case invtype::InvTypeTrophyTribute:
return "Trophy Tribute";
case invtype::InvTypeGuildTribute:
return "Guild Tribute";
case invtype::InvTypeMerchant:
return "Merchant";
case invtype::InvTypeDeleted:
return "Deleted";
case invtype::InvTypeCorpse:
return "Corpse";
case invtype::InvTypeBazaar:
return "Bazaar";
case invtype::InvTypeInspect:
return "Inspect";
case invtype::InvTypeRealEstate:
return "Real Estate";
case invtype::InvTypeViewMODPC:
return "View MOD PC";
case invtype::InvTypeViewMODBank:
return "View MOD Bank";
case invtype::InvTypeViewMODSharedBank:
return "View MOD Shared Bank";
case invtype::InvTypeViewMODLimbo:
return "View MOD Limbo";
case invtype::InvTypeAltStorage:
return "Alt Storage";
case invtype::InvTypeArchived:
return "Archived";
case invtype::InvTypeMail:
return "Mail";
case invtype::InvTypeGuildTrophyTribute:
return "Guild Trophy Tribute";
case invtype::InvTypeKrono:
return "Krono";
case invtype::InvTypeOther:
return "Other";
default:
return "Unknown Type";
}
}
const char* RoF2::invslot::InvPossessionsSlotName(int inv_slot)
{
switch (inv_slot) {
case invslot::InvSlotInvalid:
return "Invalid Slot";
case invslot::PossessionsCharm:
return "Charm";
case invslot::PossessionsEar1:
return "Ear 1";
case invslot::PossessionsHead:
return "Head";
case invslot::PossessionsFace:
return "Face";
case invslot::PossessionsEar2:
return "Ear 2";
case invslot::PossessionsNeck:
return "Neck";
case invslot::PossessionsShoulders:
return "Shoulders";
case invslot::PossessionsArms:
return "Arms";
case invslot::PossessionsBack:
return "Back";
case invslot::PossessionsWrist1:
return "Wrist 1";
case invslot::PossessionsWrist2:
return "Wrist 2";
case invslot::PossessionsRange:
return "Range";
case invslot::PossessionsHands:
return "Hands";
case invslot::PossessionsPrimary:
return "Primary";
case invslot::PossessionsSecondary:
return "Secondary";
case invslot::PossessionsFinger1:
return "Finger 1";
case invslot::PossessionsFinger2:
return "Finger 2";
case invslot::PossessionsChest:
return "Chest";
case invslot::PossessionsLegs:
return "Legs";
case invslot::PossessionsFeet:
return "Feet";
case invslot::PossessionsWaist:
return "Waist";
case invslot::PossessionsPowerSource:
return "Power Source";
case invslot::PossessionsAmmo:
return "Ammo";
case invslot::PossessionsGeneral1:
return "General 1";
case invslot::PossessionsGeneral2:
return "General 2";
case invslot::PossessionsGeneral3:
return "General 3";
case invslot::PossessionsGeneral4:
return "General 4";
case invslot::PossessionsGeneral5:
return "General 5";
case invslot::PossessionsGeneral6:
return "General 6";
case invslot::PossessionsGeneral7:
return "General 7";
case invslot::PossessionsGeneral8:
return "General 8";
case invslot::PossessionsGeneral9:
return "General 9";
case invslot::PossessionsGeneral10:
return "General 10";
case invslot::PossessionsCursor:
return "Cursor";
default:
return "Unknown Slot";
}
}
const char* RoF2::invslot::InvSlotName(int inv_type, int inv_slot)
{
if (inv_type == invtype::InvTypePossessions)
return invslot::InvPossessionsSlotName(inv_slot);
size_t type_size = invtype::InvTypeSize(inv_type);
if (!type_size || inv_slot == invslot::InvSlotInvalid)
return "Invalid Slot";
if ((size_t)(inv_slot + 1) >= type_size)
return "Unknown Slot";
static std::string ret_str;
ret_str = StringFormat("Slot %i", (inv_slot + 1));
return ret_str.c_str();
}
const char* RoF2::invbag::InvBagIndexName(int bag_index)
{
if (bag_index == invbag::InvBagInvalid)
return "Invalid Bag";
if ((size_t)bag_index >= invbag::ItemBagSize)
return "Unknown Bag";
static std::string ret_str;
ret_str = StringFormat("Bag %i", (bag_index + 1));
return ret_str.c_str();
}
const char* RoF2::invaug::InvAugIndexName(int aug_index)
{
if (aug_index == invaug::InvAugInvalid)
return "Invalid Augment";
if ((size_t)aug_index >= invaug::ItemAugSize)
return "Unknown Augment";
static std::string ret_str;
ret_str = StringFormat("Augment %i", (aug_index + 1));
return ret_str.c_str();
}
+239 -153
View File
@@ -17,183 +17,269 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef COMMON_ROF2_CONSTANTS_H
#define COMMON_ROF2_CONSTANTS_H
#ifndef COMMON_ROF2_LIMITS_H
#define COMMON_ROF2_LIMITS_H
#include "../types.h"
#include "../client_version.h"
#include "../skills.h"
namespace RoF2
{
namespace inventory {
typedef enum : int16 {
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;
enum : int { Invalid = -1, Null, Safety };
typedef enum : int16 {
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;
}
enum : bool { False = false, True = true };
namespace consts {
static const size_t CHARACTER_CREATION_LIMIT = 12;
// pre-declarations
namespace invtype {
inline EQEmu::versions::ClientVersion InvTypeRef() { return EQEmu::versions::ClientVersion::RoF2; }
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;
enum : int { InvTypeInvalid = -1, InvTypeBegin };
// 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 = inventory::SlotCharm;
static const int16 EQUIPMENT_END = inventory::SlotAmmo;
static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount;
enum InventoryType : int {
InvTypePossessions = InvTypeBegin,
InvTypeBank,
InvTypeSharedBank,
InvTypeTrade,
InvTypeWorld,
InvTypeLimbo,
InvTypeTribute,
InvTypeTrophyTribute,
InvTypeGuildTribute,
InvTypeMerchant,
InvTypeDeleted,
InvTypeCorpse,
InvTypeBazaar,
InvTypeInspect,
InvTypeRealEstate,
InvTypeViewMODPC,
InvTypeViewMODBank,
InvTypeViewMODSharedBank,
InvTypeViewMODLimbo,
InvTypeAltStorage,
InvTypeArchived,
InvTypeMail,
InvTypeGuildTrophyTribute,
InvTypeKrono,
InvTypeOther,
InvTypeCount
};
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;
} /*invtype*/
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;
namespace invslot {
inline EQEmu::versions::ClientVersion InvSlotRef() { return EQEmu::versions::ClientVersion::RoF2; }
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;
enum : int { InvSlotInvalid = -1, InvSlotBegin };
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;
enum PossessionsSlot : int {
PossessionsCharm = InvSlotBegin,
PossessionsEar1,
PossessionsHead,
PossessionsFace,
PossessionsEar2,
PossessionsNeck,
PossessionsShoulders,
PossessionsArms,
PossessionsBack,
PossessionsWrist1,
PossessionsWrist2,
PossessionsRange,
PossessionsHands,
PossessionsPrimary,
PossessionsSecondary,
PossessionsFinger1,
PossessionsFinger2,
PossessionsChest,
PossessionsLegs,
PossessionsFeet,
PossessionsWaist,
PossessionsPowerSource,
PossessionsAmmo,
PossessionsGeneral1,
PossessionsGeneral2,
PossessionsGeneral3,
PossessionsGeneral4,
PossessionsGeneral5,
PossessionsGeneral6,
PossessionsGeneral7,
PossessionsGeneral8,
PossessionsGeneral9,
PossessionsGeneral10,
PossessionsCursor,
PossessionsCount
};
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;
const int EquipmentBegin = PossessionsCharm;
const int EquipmentEnd = PossessionsAmmo;
const int EquipmentCount = (EquipmentEnd - EquipmentBegin + 1);
static const int16 WORLD_BEGIN = 4000;
static const int16 WORLD_END = 4009;
const int GeneralBegin = PossessionsGeneral1;
const int GeneralEnd = PossessionsGeneral10;
const int GeneralCount = (GeneralEnd - GeneralBegin + 1);
static const int16 TRIBUTE_BEGIN = 400;
static const int16 TRIBUTE_END = 404;
} /*invslot*/
static const int16 CORPSE_BEGIN = inventory::SlotGeneral1;
static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor;
namespace invbag {
inline EQEmu::versions::ClientVersion InvBagRef() { return EQEmu::versions::ClientVersion::RoF2; }
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)
enum : int { InvBagInvalid = -1, InvBagBegin };
static const size_t BANDOLIERS_SIZE = 20; // number of bandolier instances
static const size_t BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
} /*invbag*/
static const size_t POTION_BELT_ITEM_COUNT = 5;
namespace invaug {
inline EQEmu::versions::ClientVersion InvAugRef() { return EQEmu::versions::ClientVersion::RoF2; }
static const size_t TEXT_LINK_BODY_LENGTH = 56;
enum : int { InvAugInvalid = -1, InvAugBegin };
static const size_t PLAYER_PROFILE_SKILL_MAX = Skill2HPiercing;
}
} /*invaug*/
namespace limits {
static const bool ALLOWS_EMPTY_BAG_IN_BAG = true;
static const bool ALLOWS_CLICK_CAST_FROM_BAG = true;
static const bool COIN_HAS_WEIGHT = false;
}
namespace item {
inline EQEmu::versions::ClientVersion ItemRef() { return EQEmu::versions::ClientVersion::RoF2; }
//enum Unknown : int { // looks like item class..but, RoF has it too - nothing in UF-
// Unknown1 = 0,
// Unknown2 = 1,
// Unknown3 = 2,
// Unknown4 = 5 // krono?
//};
enum ItemPacketType : int {
ItemPacketMerchant = 100,
ItemPacketTradeView = 101,
ItemPacketLoot = 102,
ItemPacketTrade = 103,
ItemPacketCharInventory = 105,
ItemPacketLimbo = 106,
ItemPacketWorldContainer = 107,
ItemPacketTributeItem = 108,
ItemPacketGuildTribute = 109,
ItemPacket10 = 110,
ItemPacket11 = 111,
ItemPacket12 = 112,
ItemPacketRecovery = 113,
ItemPacket14 = 115
};
} /*item*/
namespace profile {
inline EQEmu::versions::ClientVersion ProfileRef() { return EQEmu::versions::ClientVersion::RoF2; }
} /*profile*/
namespace constants {
inline EQEmu::versions::ClientVersion ConstantsRef() { return EQEmu::versions::ClientVersion::RoF2; }
} /*constants*/
namespace behavior {
inline EQEmu::versions::ClientVersion BehaviorRef() { return EQEmu::versions::ClientVersion::RoF2; }
} /*behavior*/
namespace skills {
inline EQEmu::versions::ClientVersion SkillsRef() { return EQEmu::versions::ClientVersion::RoF2; }
} /*skills*/
// declarations
namespace invtype {
const size_t InvTypePossessionsSize = invslot::PossessionsCount;
const size_t InvTypeBankSize = 24;
const size_t InvTypeSharedBankSize = 2;
const size_t InvTypeTradeSize = 8;
const size_t InvTypeWorldSize = 10;
const size_t InvTypeLimboSize = 36;
const size_t InvTypeTributeSize = 5;
const size_t InvTypeTrophyTributeSize = 0;//unknown
const size_t InvTypeGuildTributeSize = 0;//unknown
const size_t InvTypeMerchantSize = 200;
const size_t InvTypeDeletedSize = 0;//unknown - "Recovery Tab"
const size_t InvTypeCorpseSize = InvTypePossessionsSize;
const size_t InvTypeBazaarSize = 200;
const size_t InvTypeInspectSize = invslot::EquipmentCount;
const size_t InvTypeRealEstateSize = 0;//unknown
const size_t InvTypeViewMODPCSize = InvTypePossessionsSize;
const size_t InvTypeViewMODBankSize = InvTypeBankSize;
const size_t InvTypeViewMODSharedBankSize = InvTypeSharedBankSize;
const size_t InvTypeViewMODLimboSize = InvTypeLimboSize;
const size_t InvTypeAltStorageSize = 0;//unknown - "Shroud Bank"
const size_t InvTypeArchivedSize = 0;//unknown
const size_t InvTypeMailSize = 0;//unknown
const size_t InvTypeGuildTrophyTributeSize = 0;//unknown
const size_t InvTypeKronoSize = 0;//unknown
const size_t InvTypeOtherSize = 0;//unknown
const size_t NPCTradeSize = 4;
extern size_t InvTypeSize(int inv_type);
extern const char* InvTypeName(int inv_type);
} /*invtype*/
namespace invslot {
extern const char* InvPossessionsSlotName(int inv_slot);
extern const char* InvSlotName(int inv_type, int inv_slot);
} /*invslot*/
namespace invbag {
const size_t ItemBagSize = 255; // server Size will be 255..unsure what actual client is (test)
extern const char* InvBagIndexName(int bag_index);
} /*invbag*/
namespace invaug {
const size_t ItemAugSize = 6;
extern const char* InvAugIndexName(int aug_index);
} /*invaug*/
namespace item {
} /*item*/
namespace profile {
const size_t TributeSize = invtype::InvTypeTributeSize;
const size_t BandoliersSize = 20; // number of bandolier instances
const size_t BandolierItemCount = 4; // number of equipment slots in bandolier instance
const size_t PotionBeltSize = 5;
const size_t SkillArraySize = 100;
} /*profile*/
namespace constants {
const size_t CharacterCreationLimit = 12;
const size_t SayLinkBodySize = 56;
} /*constants*/
namespace behavior {
const bool ConcatenateInvTypeLimbo = false;
const bool AllowOverLevelEquipment = true;
const bool AllowEmptyBagInBag = true;
const bool AllowClickCastFromBag = true;
const bool CoinHasWeight = false;
} /*behavior*/
namespace skills {
const size_t LastUsableSkill = EQEmu::skills::Skill2HPiercing;
} /*skills*/
}; /*RoF2*/
#endif /*COMMON_ROF2_CONSTANTS_H*/
#endif /*COMMON_ROF2_LIMITS_H*/
+5 -5
View File
@@ -948,13 +948,13 @@ struct BandolierItem_Struct_Old
struct Bandolier_Struct
{
char Name[1]; // Variable Length
BandolierItem_Struct Items[consts::BANDOLIER_ITEM_COUNT];
BandolierItem_Struct Items[profile::BandolierItemCount];
};
struct Bandolier_Struct_Old
{
char Name[32];
BandolierItem_Struct Items[consts::BANDOLIER_ITEM_COUNT];
BandolierItem_Struct Items[profile::BandolierItemCount];
};
struct PotionBeltItem_Struct
@@ -974,12 +974,12 @@ struct PotionBeltItem_Struct_Old
struct PotionBelt_Struct
{
PotionBeltItem_Struct Items[consts::POTION_BELT_ITEM_COUNT];
PotionBeltItem_Struct Items[profile::PotionBeltSize];
};
struct PotionBelt_Struct_Old
{
PotionBeltItem_Struct_Old Items[consts::POTION_BELT_ITEM_COUNT];
PotionBeltItem_Struct_Old Items[profile::PotionBeltSize];
};
struct GroupLeadershipAA_Struct {
@@ -1189,7 +1189,7 @@ union
/*12949*/ uint32 aapoints; // Unspent AA points - Seen 1
/*12953*/ uint16 unknown_rof20; //
/*12955*/ uint32 bandolier_count; // Seen 20
/*12959*/ Bandolier_Struct bandoliers[consts::BANDOLIERS_SIZE]; // [20] 740 bytes (Variable Name Sizes) - bandolier contents
/*12959*/ Bandolier_Struct bandoliers[profile::BandoliersSize]; // [20] 740 bytes (Variable Name Sizes) - bandolier contents
/*13699*/ uint32 potionbelt_count; // Seen 5
/*13703*/ PotionBelt_Struct potionbelt; // [5] 45 bytes potion belt - (Variable Name Sizes)
/*13748*/ int32 unknown_rof21; // Seen -1
+244
View File
@@ -16,3 +16,247 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "rof_limits.h"
#include "../string_util.h"
size_t RoF::invtype::InvTypeSize(int inv_type)
{
switch (inv_type) {
case invtype::InvTypePossessions:
return invtype::InvTypePossessionsSize;
case invtype::InvTypeBank:
return invtype::InvTypeBankSize;
case invtype::InvTypeSharedBank:
return invtype::InvTypeSharedBankSize;
case invtype::InvTypeTrade:
return invtype::InvTypeTradeSize;
case invtype::InvTypeWorld:
return invtype::InvTypeWorldSize;
case invtype::InvTypeLimbo:
return invtype::InvTypeLimboSize;
case invtype::InvTypeTribute:
return invtype::InvTypeTributeSize;
case invtype::InvTypeTrophyTribute:
return invtype::InvTypeTrophyTributeSize;
case invtype::InvTypeGuildTribute:
return invtype::InvTypeGuildTributeSize;
case invtype::InvTypeMerchant:
return invtype::InvTypeMerchantSize;
case invtype::InvTypeDeleted:
return invtype::InvTypeDeletedSize;
case invtype::InvTypeCorpse:
return invtype::InvTypeCorpseSize;
case invtype::InvTypeBazaar:
return invtype::InvTypeBazaarSize;
case invtype::InvTypeInspect:
return invtype::InvTypeInspectSize;
case invtype::InvTypeRealEstate:
return invtype::InvTypeRealEstateSize;
case invtype::InvTypeViewMODPC:
return invtype::InvTypeViewMODPCSize;
case invtype::InvTypeViewMODBank:
return invtype::InvTypeViewMODBankSize;
case invtype::InvTypeViewMODSharedBank:
return invtype::InvTypeViewMODSharedBankSize;
case invtype::InvTypeViewMODLimbo:
return invtype::InvTypeViewMODLimboSize;
case invtype::InvTypeAltStorage:
return invtype::InvTypeAltStorageSize;
case invtype::InvTypeArchived:
return invtype::InvTypeArchivedSize;
case invtype::InvTypeMail:
return invtype::InvTypeMailSize;
case invtype::InvTypeGuildTrophyTribute:
return invtype::InvTypeGuildTrophyTributeSize;
case invtype::InvTypeOther:
return invtype::InvTypeOtherSize;
default:
return 0;
}
}
const char* RoF::invtype::InvTypeName(int inv_type)
{
switch (inv_type) {
case invtype::InvTypeInvalid:
return "Invalid Type";
case invtype::InvTypePossessions:
return "Possessions";
case invtype::InvTypeBank:
return "Bank";
case invtype::InvTypeSharedBank:
return "Shared Bank";
case invtype::InvTypeTrade:
return "Trade";
case invtype::InvTypeWorld:
return "World";
case invtype::InvTypeLimbo:
return "Limbo";
case invtype::InvTypeTribute:
return "Tribute";
case invtype::InvTypeTrophyTribute:
return "Trophy Tribute";
case invtype::InvTypeGuildTribute:
return "Guild Tribute";
case invtype::InvTypeMerchant:
return "Merchant";
case invtype::InvTypeDeleted:
return "Deleted";
case invtype::InvTypeCorpse:
return "Corpse";
case invtype::InvTypeBazaar:
return "Bazaar";
case invtype::InvTypeInspect:
return "Inspect";
case invtype::InvTypeRealEstate:
return "Real Estate";
case invtype::InvTypeViewMODPC:
return "View MOD PC";
case invtype::InvTypeViewMODBank:
return "View MOD Bank";
case invtype::InvTypeViewMODSharedBank:
return "View MOD Shared Bank";
case invtype::InvTypeViewMODLimbo:
return "View MOD Limbo";
case invtype::InvTypeAltStorage:
return "Alt Storage";
case invtype::InvTypeArchived:
return "Archived";
case invtype::InvTypeMail:
return "Mail";
case invtype::InvTypeGuildTrophyTribute:
return "Guild Trophy Tribute";
case invtype::InvTypeOther:
return "Other";
default:
return "Unknown Type";
}
}
const char* RoF::invslot::InvPossessionsSlotName(int inv_slot)
{
switch (inv_slot) {
case invslot::InvSlotInvalid:
return "Invalid Slot";
case invslot::PossessionsCharm:
return "Charm";
case invslot::PossessionsEar1:
return "Ear 1";
case invslot::PossessionsHead:
return "Head";
case invslot::PossessionsFace:
return "Face";
case invslot::PossessionsEar2:
return "Ear 2";
case invslot::PossessionsNeck:
return "Neck";
case invslot::PossessionsShoulders:
return "Shoulders";
case invslot::PossessionsArms:
return "Arms";
case invslot::PossessionsBack:
return "Back";
case invslot::PossessionsWrist1:
return "Wrist 1";
case invslot::PossessionsWrist2:
return "Wrist 2";
case invslot::PossessionsRange:
return "Range";
case invslot::PossessionsHands:
return "Hands";
case invslot::PossessionsPrimary:
return "Primary";
case invslot::PossessionsSecondary:
return "Secondary";
case invslot::PossessionsFinger1:
return "Finger 1";
case invslot::PossessionsFinger2:
return "Finger 2";
case invslot::PossessionsChest:
return "Chest";
case invslot::PossessionsLegs:
return "Legs";
case invslot::PossessionsFeet:
return "Feet";
case invslot::PossessionsWaist:
return "Waist";
case invslot::PossessionsPowerSource:
return "Power Source";
case invslot::PossessionsAmmo:
return "Ammo";
case invslot::PossessionsGeneral1:
return "General 1";
case invslot::PossessionsGeneral2:
return "General 2";
case invslot::PossessionsGeneral3:
return "General 3";
case invslot::PossessionsGeneral4:
return "General 4";
case invslot::PossessionsGeneral5:
return "General 5";
case invslot::PossessionsGeneral6:
return "General 6";
case invslot::PossessionsGeneral7:
return "General 7";
case invslot::PossessionsGeneral8:
return "General 8";
case invslot::PossessionsGeneral9:
return "General 9";
case invslot::PossessionsGeneral10:
return "General 10";
case invslot::PossessionsCursor:
return "Cursor";
default:
return "Unknown Slot";
}
}
const char* RoF::invslot::InvSlotName(int inv_type, int inv_slot)
{
if (inv_type == invtype::InvTypePossessions)
return invslot::InvPossessionsSlotName(inv_slot);
size_t type_size = invtype::InvTypeSize(inv_type);
if (!type_size || inv_slot == invslot::InvSlotInvalid)
return "Invalid Slot";
if ((size_t)(inv_slot + 1) >= type_size)
return "Unknown Slot";
static std::string ret_str;
ret_str = StringFormat("Slot %i", (inv_slot + 1));
return ret_str.c_str();
}
const char* RoF::invbag::InvBagIndexName(int bag_index)
{
if (bag_index == invbag::InvBagInvalid)
return "Invalid Bag";
if ((size_t)bag_index >= invbag::ItemBagSize)
return "Unknown Bag";
static std::string ret_str;
ret_str = StringFormat("Bag %i", (bag_index + 1));
return ret_str.c_str();
}
const char* RoF::invaug::InvAugIndexName(int aug_index)
{
if (aug_index == invaug::InvAugInvalid)
return "Invalid Augment";
if ((size_t)aug_index >= invaug::ItemAugSize)
return "Unknown Augment";
static std::string ret_str;
ret_str = StringFormat("Augment %i", (aug_index + 1));
return ret_str.c_str();
}
+230 -152
View File
@@ -17,182 +17,260 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef COMMON_ROF_CONSTANTS_H
#define COMMON_ROF_CONSTANTS_H
#ifndef COMMON_ROF_LIMITS_H
#define COMMON_ROF_LIMITS_H
#include "../types.h"
#include "../client_version.h"
#include "../skills.h"
namespace RoF
{
namespace inventory {
typedef enum : int16 {
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;
enum : int { Invalid = -1, Null, Safety };
typedef enum : int16 {
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;
}
enum : bool { False = false, True = true };
namespace consts {
static const size_t CHARACTER_CREATION_LIMIT = 12;
// pre-declarations
namespace invtype {
inline EQEmu::versions::ClientVersion InvTypeRef() { return EQEmu::versions::ClientVersion::RoF; }
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;
enum : int { InvTypeInvalid = -1, InvTypeBegin };
// 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 = inventory::SlotCharm;
static const int16 EQUIPMENT_END = inventory::SlotAmmo;
static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount;
enum InventoryType : int {
InvTypePossessions = InvTypeBegin,
InvTypeBank,
InvTypeSharedBank,
InvTypeTrade,
InvTypeWorld,
InvTypeLimbo,
InvTypeTribute,
InvTypeTrophyTribute,
InvTypeGuildTribute,
InvTypeMerchant,
InvTypeDeleted,
InvTypeCorpse,
InvTypeBazaar,
InvTypeInspect,
InvTypeRealEstate,
InvTypeViewMODPC,
InvTypeViewMODBank,
InvTypeViewMODSharedBank,
InvTypeViewMODLimbo,
InvTypeAltStorage,
InvTypeArchived,
InvTypeMail,
InvTypeGuildTrophyTribute,
InvTypeOther,
InvTypeCount
};
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;
} /*invtype*/
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;
namespace invslot {
inline EQEmu::versions::ClientVersion InvSlotRef() { return EQEmu::versions::ClientVersion::RoF; }
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;
enum : int { InvSlotInvalid = -1, InvSlotBegin };
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;
enum PossessionsSlot : int {
PossessionsCharm = InvSlotBegin,
PossessionsEar1,
PossessionsHead,
PossessionsFace,
PossessionsEar2,
PossessionsNeck,
PossessionsShoulders,
PossessionsArms,
PossessionsBack,
PossessionsWrist1,
PossessionsWrist2,
PossessionsRange,
PossessionsHands,
PossessionsPrimary,
PossessionsSecondary,
PossessionsFinger1,
PossessionsFinger2,
PossessionsChest,
PossessionsLegs,
PossessionsFeet,
PossessionsWaist,
PossessionsPowerSource,
PossessionsAmmo,
PossessionsGeneral1,
PossessionsGeneral2,
PossessionsGeneral3,
PossessionsGeneral4,
PossessionsGeneral5,
PossessionsGeneral6,
PossessionsGeneral7,
PossessionsGeneral8,
PossessionsGeneral9,
PossessionsGeneral10,
PossessionsCursor,
PossessionsCount
};
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;
const int EquipmentBegin = PossessionsCharm;
const int EquipmentEnd = PossessionsAmmo;
const int EquipmentCount = (EquipmentEnd - EquipmentBegin + 1);
static const int16 WORLD_BEGIN = 4000;
static const int16 WORLD_END = 4009;
const int GeneralBegin = PossessionsGeneral1;
const int GeneralEnd = PossessionsGeneral10;
const int GeneralCount = (GeneralEnd - GeneralBegin + 1);
static const int16 TRIBUTE_BEGIN = 400;
static const int16 TRIBUTE_END = 404;
} /*invslot*/
static const int16 CORPSE_BEGIN = inventory::SlotGeneral1;
static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor;
namespace invbag {
inline EQEmu::versions::ClientVersion InvBagRef() { return EQEmu::versions::ClientVersion::RoF; }
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)
enum : int { InvBagInvalid = -1, InvBagBegin };
static const size_t BANDOLIERS_SIZE = 20; // number of bandolier instances
static const size_t BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
} /*invbag*/
static const size_t POTION_BELT_ITEM_COUNT = 5;
namespace invaug {
inline EQEmu::versions::ClientVersion InvAugRef() { return EQEmu::versions::ClientVersion::RoF; }
static const size_t TEXT_LINK_BODY_LENGTH = 55;
enum : int { InvAugInvalid = -1, InvAugBegin };
static const size_t PLAYER_PROFILE_SKILL_MAX = SkillTripleAttack;
}
} /*invaug*/
namespace limits {
static const bool ALLOWS_EMPTY_BAG_IN_BAG = true;
static const bool ALLOWS_CLICK_CAST_FROM_BAG = true;
static const bool COIN_HAS_WEIGHT = false;
}
namespace item {
inline EQEmu::versions::ClientVersion ItemRef() { return EQEmu::versions::ClientVersion::RoF; }
enum ItemPacketType : int {
ItemPacketMerchant = 100,
ItemPacketTradeView = 101,
ItemPacketLoot = 102,
ItemPacketTrade = 103,
ItemPacketCharInventory = 105,
ItemPacketLimbo = 106,
ItemPacketWorldContainer = 107,
ItemPacketTributeItem = 108,
ItemPacketGuildTribute = 109,
ItemPacket10 = 110,
ItemPacket11 = 111,
ItemPacket12 = 112,
ItemPacketRecovery = 113,
ItemPacket14 = 115
};
} /*item*/
namespace profile {
inline EQEmu::versions::ClientVersion ProfileRef() { return EQEmu::versions::ClientVersion::RoF; }
} /*profile*/
namespace constants {
inline EQEmu::versions::ClientVersion ConstantsRef() { return EQEmu::versions::ClientVersion::RoF; }
} /*constants*/
namespace behavior {
inline EQEmu::versions::ClientVersion BehaviorRef() { return EQEmu::versions::ClientVersion::RoF; }
} /*behavior*/
namespace skills {
inline EQEmu::versions::ClientVersion SkillsRef() { return EQEmu::versions::ClientVersion::RoF; }
} /*skills*/
// declarations
namespace invtype {
const size_t InvTypePossessionsSize = invslot::PossessionsCount;
const size_t InvTypeBankSize = 24;
const size_t InvTypeSharedBankSize = 2;
const size_t InvTypeTradeSize = 8;
const size_t InvTypeWorldSize = 10;
const size_t InvTypeLimboSize = 36;
const size_t InvTypeTributeSize = 5;
const size_t InvTypeTrophyTributeSize = 0;//unknown
const size_t InvTypeGuildTributeSize = 0;//unknown
const size_t InvTypeMerchantSize = 200;
const size_t InvTypeDeletedSize = 0;//unknown - "Recovery Tab"
const size_t InvTypeCorpseSize = InvTypePossessionsSize;
const size_t InvTypeBazaarSize = 200;
const size_t InvTypeInspectSize = invslot::EquipmentCount;
const size_t InvTypeRealEstateSize = 0;//unknown
const size_t InvTypeViewMODPCSize = InvTypePossessionsSize;
const size_t InvTypeViewMODBankSize = InvTypeBankSize;
const size_t InvTypeViewMODSharedBankSize = InvTypeSharedBankSize;
const size_t InvTypeViewMODLimboSize = InvTypeLimboSize;
const size_t InvTypeAltStorageSize = 0;//unknown - "Shroud Bank"
const size_t InvTypeArchivedSize = 0;//unknown
const size_t InvTypeMailSize = 0;//unknown
const size_t InvTypeGuildTrophyTributeSize = 0;//unknown
const size_t InvTypeOtherSize = 0;//unknown
const size_t NPCTradeSize = 4;
extern size_t InvTypeSize(int inv_type);
extern const char* InvTypeName(int inv_type);
} /*invtype*/
namespace invslot {
extern const char* InvPossessionsSlotName(int inv_slot);
extern const char* InvSlotName(int inv_type, int inv_slot);
} /*invslot*/
namespace invbag {
const size_t ItemBagSize = 255; // server Size will be 255..unsure what actual client is (test)
extern const char* InvBagIndexName(int bag_index);
} /*invbag*/
namespace invaug {
const size_t ItemAugSize = 6;
extern const char* InvAugIndexName(int aug_index);
} /*invaug*/
namespace item {
} /*item*/
namespace profile {
const size_t TributeSize = invtype::InvTypeTributeSize;
const size_t BandoliersSize = 20; // number of bandolier instances
const size_t BandolierItemCount = 4; // number of equipment slots in bandolier instance
const size_t PotionBeltSize = 5;
const size_t SkillArraySize = 100;
} /*profile*/
namespace constants {
const size_t CharacterCreationLimit = 12;
const size_t SayLinkBodySize = 55;
} /*constants*/
namespace behavior {
const bool ConcatenateInvTypeLimbo = false;
const bool AllowOverLevelEquipment = true;
const bool AllowEmptyBagInBag = true;
const bool AllowClickCastFromBag = true;
const bool CoinHasWeight = false;
} /*behavior*/
namespace skills {
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
} /*skills*/
}; /*RoF*/
#endif /*COMMON_ROF_CONSTANTS_H*/
#endif /*COMMON_ROF_LIMITS_H*/
+5 -5
View File
@@ -931,13 +931,13 @@ struct BandolierItem_Struct_Old
struct Bandolier_Struct
{
char Name[1]; // Variable Length
BandolierItem_Struct Items[consts::BANDOLIER_ITEM_COUNT];
BandolierItem_Struct Items[profile::BandolierItemCount];
};
struct Bandolier_Struct_Old
{
char Name[32];
BandolierItem_Struct Items[consts::BANDOLIER_ITEM_COUNT];
BandolierItem_Struct Items[profile::BandolierItemCount];
};
struct PotionBeltItem_Struct
@@ -957,12 +957,12 @@ struct PotionBeltItem_Struct_Old
struct PotionBelt_Struct
{
PotionBeltItem_Struct Items[consts::POTION_BELT_ITEM_COUNT];
PotionBeltItem_Struct Items[profile::PotionBeltSize];
};
struct PotionBelt_Struct_Old
{
PotionBeltItem_Struct_Old Items[consts::POTION_BELT_ITEM_COUNT];
PotionBeltItem_Struct_Old Items[profile::PotionBeltSize];
};
struct GroupLeadershipAA_Struct {
@@ -1172,7 +1172,7 @@ union
/*12949*/ uint32 aapoints; // Unspent AA points - Seen 1
/*12953*/ uint16 unknown_rof20; //
/*12955*/ uint32 bandolier_count; // Seen 20
/*12959*/ Bandolier_Struct bandoliers[consts::BANDOLIERS_SIZE]; // [20] 740 bytes (Variable Name Sizes) - bandolier contents
/*12959*/ Bandolier_Struct bandoliers[profile::BandoliersSize]; // [20] 740 bytes (Variable Name Sizes) - bandolier contents
/*13699*/ uint32 potionbelt_count; // Seen 5
/*13703*/ PotionBelt_Struct potionbelt; // [5] 45 bytes potion belt - (Variable Name Sizes)
/*13748*/ int32 unknown_rof21; // Seen -1
+21 -21
View File
@@ -1623,18 +1623,18 @@ namespace SoD
// OUT(unknown06160[4]);
// Copy bandoliers where server and client indexes converge
for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < profile::BandoliersSize; ++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
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
OUT(bandoliers[r].Items[k].ID);
OUT(bandoliers[r].Items[k].Icon);
OUT_str(bandoliers[r].Items[k].Name);
}
}
// Nullify bandoliers where server and client indexes diverge, with a client bias
for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < profile::BandoliersSize; ++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
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
eq->bandoliers[r].Items[k].ID = 0;
eq->bandoliers[r].Items[k].Icon = 0;
eq->bandoliers[r].Items[k].Name[0] = '\0';
@@ -1644,13 +1644,13 @@ namespace SoD
// OUT(unknown07444[5120]);
// Copy potion belt where server and client indexes converge
for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < profile::PotionBeltSize; ++r) {
OUT(potionbelt.Items[r].ID);
OUT(potionbelt.Items[r].Icon);
OUT_str(potionbelt.Items[r].Name);
}
// Nullify potion belt where server and client indexes diverge, with a client bias
for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < profile::PotionBeltSize; ++r) {
eq->potionbelt.Items[r].ID = 0;
eq->potionbelt.Items[r].Icon = 0;
eq->potionbelt.Items[r].Name[0] = '\0';
@@ -1938,8 +1938,8 @@ namespace SoD
eq->CharCount = emu->CharCount;
eq->TotalChars = emu->TotalChars;
if (eq->TotalChars > consts::CHARACTER_CREATION_LIMIT)
eq->TotalChars = consts::CHARACTER_CREATION_LIMIT;
if (eq->TotalChars > constants::CharacterCreationLimit)
eq->TotalChars = constants::CharacterCreationLimit;
FINISH_ENCODE();
return;
@@ -1951,7 +1951,7 @@ namespace SoD
size_t names_length = 0;
size_t character_count = 0;
for (; character_count < emu->CharCount && character_count < consts::CHARACTER_CREATION_LIMIT; ++character_count) {
for (; character_count < emu->CharCount && character_count < constants::CharacterCreationLimit; ++character_count) {
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
names_length += strlen(emu_cse->Name);
emu_ptr += sizeof(CharacterSelectEntry_Struct);
@@ -1967,8 +1967,8 @@ namespace SoD
eq->CharCount = character_count;
eq->TotalChars = emu->TotalChars;
if (eq->TotalChars > consts::CHARACTER_CREATION_LIMIT)
eq->TotalChars = consts::CHARACTER_CREATION_LIMIT;
if (eq->TotalChars > constants::CharacterCreationLimit)
eq->TotalChars = constants::CharacterCreationLimit;
emu_ptr = __emu_buffer;
emu_ptr += sizeof(CharacterSelect_Struct);
@@ -3706,7 +3706,7 @@ namespace SoD
isbs.augtype = item->AugType;
isbs.augrestrict = item->AugRestrict;
for (int index = 0; index < consts::ITEM_COMMON_SIZE; ++index) {
for (int index = 0; index < invaug::ItemAugSize; ++index) {
isbs.augslots[index].type = item->AugSlotType[index];
isbs.augslots[index].visible = item->AugSlotVisible[index];
isbs.augslots[index].unknown = item->AugSlotUnk2[index];
@@ -3917,7 +3917,7 @@ namespace SoD
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END)
SoDSlot = serverSlot + 1;
else if (serverSlot == EQEmu::legacy::SlotPowerSource)
SoDSlot = inventory::SlotPowerSource;
SoDSlot = invslot::PossessionsPowerSource;
else
SoDSlot = serverSlot;
return SoDSlot;
@@ -3933,15 +3933,15 @@ namespace SoD
{
uint32 ServerSlot = 0;
if (sodSlot >= inventory::SlotAmmo && sodSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots
if (sodSlot >= invslot::PossessionsAmmo && sodSlot <= invslot::CorpseEnd) // Cursor/Ammo/Power Source and Normal Inventory Slots
ServerSlot = sodSlot - 1;
else if (sodSlot >= consts::GENERAL_BAGS_BEGIN && sodSlot <= consts::CURSOR_BAG_END)
else if (sodSlot >= invbag::GeneralBagsBegin && sodSlot <= invbag::CursorBagEnd)
ServerSlot = sodSlot - 11;
else if (sodSlot >= consts::BANK_BAGS_BEGIN && sodSlot <= consts::BANK_BAGS_END)
else if (sodSlot >= invbag::BankBagsBegin && sodSlot <= invbag::BankBagsEnd)
ServerSlot = sodSlot - 1;
else if (sodSlot >= consts::SHARED_BANK_BAGS_BEGIN && sodSlot <= consts::SHARED_BANK_BAGS_END)
else if (sodSlot >= invbag::SharedBankBagsBegin && sodSlot <= invbag::SharedBankBagsEnd)
ServerSlot = sodSlot - 1;
else if (sodSlot == inventory::SlotPowerSource)
else if (sodSlot == invslot::PossessionsPowerSource)
ServerSlot = EQEmu::legacy::SlotPowerSource;
else
ServerSlot = sodSlot;
@@ -3956,7 +3956,7 @@ namespace SoD
static inline void ServerToSoDTextLink(std::string& sodTextLink, const std::string& serverTextLink)
{
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
if ((constants::SayLinkBodySize == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
sodTextLink = serverTextLink;
return;
}
@@ -3996,7 +3996,7 @@ namespace SoD
static inline void SoDToServerTextLink(std::string& serverTextLink, const std::string& sodTextLink)
{
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (sodTextLink.find('\x12') == std::string::npos)) {
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == constants::SayLinkBodySize) || (sodTextLink.find('\x12') == std::string::npos)) {
serverTextLink = sodTextLink;
return;
}
@@ -4005,7 +4005,7 @@ namespace SoD
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= consts::TEXT_LINK_BODY_LENGTH) {
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
serverTextLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
+237
View File
@@ -16,3 +16,240 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "sod_limits.h"
#include "../string_util.h"
size_t SoD::invtype::InvTypeSize(int inv_type)
{
switch (inv_type) {
case invtype::InvTypePossessions:
return invtype::InvTypePossessionsSize;
case invtype::InvTypeBank:
return invtype::InvTypeBankSize;
case invtype::InvTypeSharedBank:
return invtype::InvTypeSharedBankSize;
case invtype::InvTypeTrade:
return invtype::InvTypeTradeSize;
case invtype::InvTypeWorld:
return invtype::InvTypeWorldSize;
case invtype::InvTypeLimbo:
return invtype::InvTypeLimboSize;
case invtype::InvTypeTribute:
return invtype::InvTypeTributeSize;
case invtype::InvTypeGuildTribute:
return invtype::InvTypeGuildTributeSize;
case invtype::InvTypeMerchant:
return invtype::InvTypeMerchantSize;
case invtype::InvTypeCorpse:
return invtype::InvTypeCorpseSize;
case invtype::InvTypeBazaar:
return invtype::InvTypeBazaarSize;
case invtype::InvTypeInspect:
return invtype::InvTypeInspectSize;
case invtype::InvTypeViewMODPC:
return invtype::InvTypeViewMODPCSize;
case invtype::InvTypeViewMODBank:
return invtype::InvTypeViewMODBankSize;
case invtype::InvTypeViewMODSharedBank:
return invtype::InvTypeViewMODSharedBankSize;
case invtype::InvTypeViewMODLimbo:
return invtype::InvTypeViewMODLimboSize;
case invtype::InvTypeAltStorage:
return invtype::InvTypeAltStorageSize;
case invtype::InvTypeArchived:
return invtype::InvTypeArchivedSize;
case invtype::InvTypeOther:
return invtype::InvTypeOtherSize;
default:
return 0;
}
}
const char* SoD::invtype::InvTypeName(int inv_type)
{
switch (inv_type) {
case invtype::InvTypeInvalid:
return "Invalid Type";
case invtype::InvTypePossessions:
return "Possessions";
case invtype::InvTypeBank:
return "Bank";
case invtype::InvTypeSharedBank:
return "Shared Bank";
case invtype::InvTypeTrade:
return "Trade";
case invtype::InvTypeWorld:
return "World";
case invtype::InvTypeLimbo:
return "Limbo";
case invtype::InvTypeTribute:
return "Tribute";
case invtype::InvTypeGuildTribute:
return "Guild Tribute";
case invtype::InvTypeMerchant:
return "Merchant";
case invtype::InvTypeCorpse:
return "Corpse";
case invtype::InvTypeBazaar:
return "Bazaar";
case invtype::InvTypeInspect:
return "Inspect";
case invtype::InvTypeViewMODPC:
return "View MOD PC";
case invtype::InvTypeViewMODBank:
return "View MOD Bank";
case invtype::InvTypeViewMODSharedBank:
return "View MOD Shared Bank";
case invtype::InvTypeViewMODLimbo:
return "View MOD Limbo";
case invtype::InvTypeAltStorage:
return "Alt Storage";
case invtype::InvTypeArchived:
return "Archived";
case invtype::InvTypeOther:
return "Other";
default:
return "Unknown Type";
}
}
const char* SoD::invslot::InvPossessionsSlotName(int inv_slot)
{
switch (inv_slot) {
case invslot::InvSlotInvalid:
return "Invalid Slot";
case invslot::PossessionsCharm:
return "Charm";
case invslot::PossessionsEar1:
return "Ear 1";
case invslot::PossessionsHead:
return "Head";
case invslot::PossessionsFace:
return "Face";
case invslot::PossessionsEar2:
return "Ear 2";
case invslot::PossessionsNeck:
return "Neck";
case invslot::PossessionsShoulders:
return "Shoulders";
case invslot::PossessionsArms:
return "Arms";
case invslot::PossessionsBack:
return "Back";
case invslot::PossessionsWrist1:
return "Wrist 1";
case invslot::PossessionsWrist2:
return "Wrist 2";
case invslot::PossessionsRange:
return "Range";
case invslot::PossessionsHands:
return "Hands";
case invslot::PossessionsPrimary:
return "Primary";
case invslot::PossessionsSecondary:
return "Secondary";
case invslot::PossessionsFinger1:
return "Finger 1";
case invslot::PossessionsFinger2:
return "Finger 2";
case invslot::PossessionsChest:
return "Chest";
case invslot::PossessionsLegs:
return "Legs";
case invslot::PossessionsFeet:
return "Feet";
case invslot::PossessionsWaist:
return "Waist";
case invslot::PossessionsPowerSource:
return "Power Source";
case invslot::PossessionsAmmo:
return "Ammo";
case invslot::PossessionsGeneral1:
return "General 1";
case invslot::PossessionsGeneral2:
return "General 2";
case invslot::PossessionsGeneral3:
return "General 3";
case invslot::PossessionsGeneral4:
return "General 4";
case invslot::PossessionsGeneral5:
return "General 5";
case invslot::PossessionsGeneral6:
return "General 6";
case invslot::PossessionsGeneral7:
return "General 7";
case invslot::PossessionsGeneral8:
return "General 8";
case invslot::PossessionsCursor:
return "Cursor";
default:
return "Unknown Slot";
}
}
const char* SoD::invslot::InvCorpseSlotName(int inv_slot)
{
if (!invtype::InvTypeSize(invtype::InvTypeCorpse) || inv_slot == invslot::InvSlotInvalid)
return "Invalid Slot";
// needs work
if ((size_t)(inv_slot + 1) < invslot::CorpseBegin || (size_t)(inv_slot + 1) >= invslot::CorpseEnd)
return "Unknown Slot";
static std::string ret_str;
ret_str = StringFormat("Slot %i", (inv_slot + 1));
return ret_str.c_str();
}
const char* SoD::invslot::InvSlotName(int inv_type, int inv_slot)
{
if (inv_type == invtype::InvTypePossessions)
return invslot::InvPossessionsSlotName(inv_slot);
else if (inv_type == invtype::InvTypeCorpse)
return invslot::InvCorpseSlotName(inv_slot);
size_t type_size = invtype::InvTypeSize(inv_type);
if (!type_size || inv_slot == invslot::InvSlotInvalid)
return "Invalid Slot";
if ((size_t)(inv_slot + 1) >= type_size)
return "Unknown Slot";
static std::string ret_str;
ret_str = StringFormat("Slot %i", (inv_slot + 1));
return ret_str.c_str();
}
const char* SoD::invbag::InvBagIndexName(int bag_index)
{
if (bag_index == invbag::InvBagInvalid)
return "Invalid Bag";
if ((size_t)bag_index >= invbag::ItemBagSize)
return "Unknown Bag";
static std::string ret_str;
ret_str = StringFormat("Bag %i", (bag_index + 1));
return ret_str.c_str();
}
const char* SoD::invaug::InvAugIndexName(int aug_index)
{
if (aug_index == invaug::InvAugInvalid)
return "Invalid Augment";
if ((size_t)aug_index >= invaug::ItemAugSize)
return "Unknown Augment";
static std::string ret_str;
ret_str = StringFormat("Augment %i", (aug_index + 1));
return ret_str.c_str();
}
+254 -148
View File
@@ -17,178 +17,284 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef COMMON_SOD_CONSTANTS_H
#define COMMON_SOD_CONSTANTS_H
#ifndef COMMON_SOD_LIMITS_H
#define COMMON_SOD_LIMITS_H
#include "../types.h"
#include "../client_version.h"
#include "../skills.h"
namespace SoD
{
namespace inventory {
typedef enum : int16 {
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;
enum : int { Invalid = -1, Null, Safety };
typedef enum : int16 {
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;
}
enum : bool { False = false, True = true };
namespace consts {
static const size_t CHARACTER_CREATION_LIMIT = 12;
// pre-declarations
namespace invtype {
inline EQEmu::versions::ClientVersion InvTypeRef() { return EQEmu::versions::ClientVersion::SoD; }
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;
enum : int { InvTypeInvalid = -1, InvTypeBegin };
static const int16 EQUIPMENT_BEGIN = inventory::SlotCharm;
static const int16 EQUIPMENT_END = inventory::SlotAmmo;
static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount;
enum InventoryType : int {
InvTypePossessions = InvTypeBegin,
InvTypeBank,
InvTypeSharedBank,
InvTypeTrade,
InvTypeWorld,
InvTypeLimbo,
InvTypeTribute,
InvTypeGuildTribute,
InvTypeMerchant,
InvTypeCorpse,
InvTypeBazaar,
InvTypeInspect,
InvTypeViewMODPC,
InvTypeViewMODBank,
InvTypeViewMODSharedBank,
InvTypeViewMODLimbo,
InvTypeAltStorage,
InvTypeArchived,
InvTypeOther,
InvTypeCount
};
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;
} /*invtype*/
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;
namespace invslot {
inline EQEmu::versions::ClientVersion InvSlotRef() { return EQEmu::versions::ClientVersion::SoD; }
static const int16 BANK_BEGIN = 2000;
static const int16 BANK_END = 2023;
static const int16 BANK_BAGS_BEGIN = 2032;
static const int16 BANK_BAGS_END_OFFSET = 239;
static const int16 BANK_BAGS_END = BANK_BAGS_BEGIN + BANK_BAGS_END_OFFSET;
enum : int { InvSlotInvalid = -1, InvSlotBegin };
static const int16 SHARED_BANK_BEGIN = 2500;
static const int16 SHARED_BANK_END = 2501;
static const int16 SHARED_BANK_BAGS_BEGIN = 2532;
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;
enum PossessionsSlot : int {
PossessionsCharm = InvSlotBegin,
PossessionsEar1,
PossessionsHead,
PossessionsFace,
PossessionsEar2,
PossessionsNeck,
PossessionsShoulders,
PossessionsArms,
PossessionsBack,
PossessionsWrist1,
PossessionsWrist2,
PossessionsRange,
PossessionsHands,
PossessionsPrimary,
PossessionsSecondary,
PossessionsFinger1,
PossessionsFinger2,
PossessionsChest,
PossessionsLegs,
PossessionsFeet,
PossessionsWaist,
PossessionsPowerSource,
PossessionsAmmo,
PossessionsGeneral1,
PossessionsGeneral2,
PossessionsGeneral3,
PossessionsGeneral4,
PossessionsGeneral5,
PossessionsGeneral6,
PossessionsGeneral7,
PossessionsGeneral8,
PossessionsCursor,
PossessionsCount
};
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;
const int EquipmentBegin = PossessionsCharm;
const int EquipmentEnd = PossessionsAmmo;
const int EquipmentCount = (EquipmentEnd - EquipmentBegin + 1);
static const int16 WORLD_BEGIN = 4000;
static const int16 WORLD_END = 4009;
const int GeneralBegin = PossessionsGeneral1;
const int GeneralEnd = PossessionsGeneral8;
const int GeneralCount = (GeneralEnd - GeneralBegin + 1);
static const int16 TRIBUTE_BEGIN = 400;
static const int16 TRIBUTE_END = 404;
} /*invslot*/
static const int16 CORPSE_BEGIN = inventory::SlotGeneral1;
static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor;
namespace invbag {
inline EQEmu::versions::ClientVersion InvBagRef() { return EQEmu::versions::ClientVersion::SoD; }
static const uint16 ITEM_COMMON_SIZE = 5;
static const uint16 ITEM_CONTAINER_SIZE = 10;
enum : int { InvBagInvalid = -1, InvBagBegin };
static const size_t BANDOLIERS_SIZE = 20; // number of bandolier instances
static const size_t BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
} /*invbag*/
static const size_t POTION_BELT_ITEM_COUNT = 5;
namespace invaug {
inline EQEmu::versions::ClientVersion InvAugRef() { return EQEmu::versions::ClientVersion::SoD; }
static const size_t TEXT_LINK_BODY_LENGTH = 50;
enum : int { InvAugInvalid = -1, InvAugBegin };
static const size_t PLAYER_PROFILE_SKILL_MAX = SkillTripleAttack;
}
} /*invaug*/
namespace limits {
static const bool ALLOWS_EMPTY_BAG_IN_BAG = false;
static const bool ALLOWS_CLICK_CAST_FROM_BAG = false;
static const bool COIN_HAS_WEIGHT = false;
}
namespace item {
inline EQEmu::versions::ClientVersion ItemRef() { return EQEmu::versions::ClientVersion::SoD; }
enum ItemPacketType : int {
ItemPacketMerchant = 100,
ItemPacketTradeView = 101,
ItemPacketLoot = 102,
ItemPacketTrade = 103,
ItemPacketCharInventory = 105,
ItemPacketLimbo = 106,
ItemPacketWorldContainer = 107,
ItemPacketTributeItem = 108,
ItemPacketGuildTribute = 109,
ItemPacketCharmUpdate = 110
};
} /*item*/
namespace profile {
inline EQEmu::versions::ClientVersion ProfileRef() { return EQEmu::versions::ClientVersion::SoD; }
} /*profile*/
namespace constants {
inline EQEmu::versions::ClientVersion ConstantsRef() { return EQEmu::versions::ClientVersion::SoD; }
} /*constants*/
namespace behavior {
inline EQEmu::versions::ClientVersion BehaviorRef() { return EQEmu::versions::ClientVersion::SoD; }
} /*behavior*/
namespace skills {
inline EQEmu::versions::ClientVersion SkillsRef() { return EQEmu::versions::ClientVersion::SoD; }
} /*skills*/
// declarations
namespace invtype {
const size_t InvTypePossessionsSize = invslot::PossessionsCount;
const size_t InvTypeBankSize = 24;
const size_t InvTypeSharedBankSize = 2;
const size_t InvTypeTradeSize = 8;
const size_t InvTypeWorldSize = 10;
const size_t InvTypeLimboSize = 36;
const size_t InvTypeTributeSize = 5;
const size_t InvTypeGuildTributeSize = 0;//unknown
const size_t InvTypeMerchantSize = 80;
const size_t InvTypeCorpseSize = InvTypePossessionsSize;
const size_t InvTypeBazaarSize = 80;
const size_t InvTypeInspectSize = invslot::EquipmentCount;
const size_t InvTypeViewMODPCSize = InvTypePossessionsSize;
const size_t InvTypeViewMODBankSize = InvTypeBankSize;
const size_t InvTypeViewMODSharedBankSize = InvTypeSharedBankSize;
const size_t InvTypeViewMODLimboSize = InvTypeLimboSize;
const size_t InvTypeAltStorageSize = 0;//unknown - "Shroud Bank"
const size_t InvTypeArchivedSize = 0;//unknown
const size_t InvTypeOtherSize = 0;//unknown
const size_t NPCTradeSize = 4;
extern size_t InvTypeSize(int inv_type);
extern const char* InvTypeName(int inv_type);
} /*invtype*/
namespace invslot {
const int BankBegin = 2000;
const int BankEnd = (BankBegin + invtype::InvTypeBankSize) - 1;
const int SharedBankBegin = 2500;
const int SharedBankEnd = (SharedBankBegin + invtype::InvTypeSharedBankSize) - 1;
const int TradeBegin = 3000;
const int TradeEnd = (TradeBegin + invtype::InvTypeTradeSize) - 1;
const int TradeNPCEnd = 3003;
const int WorldBegin = 4000;
const int WorldEnd = (WorldBegin + invtype::InvTypeWorldSize) - 1;
const int TributeBegin = 400;
const int TributeEnd = 404;
const int CorpseBegin = invslot::PossessionsGeneral1;
const int CorpseEnd = invslot::PossessionsGeneral1 + invslot::PossessionsCursor;
extern const char* InvPossessionsSlotName(int inv_slot);
extern const char* InvCorpseSlotName(int inv_slot);
extern const char* InvSlotName(int inv_type, int inv_slot);
} /*invslot*/
namespace invbag {
const size_t ItemBagSize = 10;
const int GeneralBagsBegin = 262;
const int GeneralBagsSize = invslot::GeneralCount * ItemBagSize;
const int GeneralBagsEnd = (GeneralBagsBegin + GeneralBagsSize) - 1;
const int CursorBagBegin = 342;
const int CursorBagSize = ItemBagSize;
const int CursorBagEnd = (CursorBagBegin + CursorBagSize) - 1;
const int BankBagsBegin = 2032;
const int BankBagsSize = (invtype::InvTypeBankSize * ItemBagSize);
const int BankBagsEnd = (BankBagsBegin + BankBagsSize) - 1;
const int SharedBankBagsBegin = 2532;
const int SharedBankBagsSize = invtype::InvTypeSharedBankSize * ItemBagSize;
const int SharedBankBagsEnd = (SharedBankBagsBegin + SharedBankBagsSize) - 1;
const int TradeBagsBegin = 3031;
const int TradeBagsSize = invtype::InvTypeTradeSize * ItemBagSize;
const int TradeBagsEnd = (TradeBagsBegin + TradeBagsSize) - 1;
extern const char* InvBagIndexName(int bag_index);
} /*invbag*/
namespace invaug {
const size_t ItemAugSize = 5;
extern const char* InvAugIndexName(int aug_index);
} /*invaug*/
namespace item {
} /*item*/
namespace profile {
const size_t TributeSize = invtype::InvTypeTributeSize;
const size_t BandoliersSize = 20; // number of bandolier instances
const size_t BandolierItemCount = 4; // number of equipment slots in bandolier instance
const size_t PotionBeltSize = 5;
const size_t SkillArraySize = 100;
} /*profile*/
namespace constants {
const size_t CharacterCreationLimit = 12;
const size_t SayLinkBodySize = 50;
} /*constants*/
namespace behavior {
const bool ConcatenateInvTypeLimbo = true;
const bool AllowOverLevelEquipment = false;
const bool AllowEmptyBagInBag = false;
const bool AllowClickCastFromBag = false;
const bool CoinHasWeight = false;
} /*behavior*/
namespace skills {
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
} /*skills*/
}; /*SoD*/
#endif /*COMMON_SOD_CONSTANTS_H*/
#endif /*COMMON_SOD_LIMITS_H*/
+3 -3
View File
@@ -726,7 +726,7 @@ struct BandolierItem_Struct
struct Bandolier_Struct
{
char Name[32];
BandolierItem_Struct Items[consts::BANDOLIER_ITEM_COUNT];
BandolierItem_Struct Items[profile::BandolierItemCount];
};
//len = 72
@@ -740,7 +740,7 @@ struct PotionBeltItem_Struct
//len = 288
struct PotionBelt_Struct
{
PotionBeltItem_Struct Items[consts::POTION_BELT_ITEM_COUNT];
PotionBeltItem_Struct Items[profile::PotionBeltSize];
};
static const uint32 MAX_GROUP_LEADERSHIP_AA_ARRAY = 16;
@@ -960,7 +960,7 @@ struct PlayerProfile_Struct
/*08288*/ uint32 aapoints_spent; // Number of spent AA points
/*08292*/ uint32 aapoints; // Unspent AA points
/*08296*/ uint8 unknown06160[4];
/*08300*/ Bandolier_Struct bandoliers[consts::BANDOLIERS_SIZE]; // [6400] bandolier contents
/*08300*/ Bandolier_Struct bandoliers[profile::BandoliersSize]; // [6400] bandolier contents
/*14700*/ PotionBelt_Struct potionbelt; // [360] potion belt 72 extra octets by adding 1 more belt slot
/*15060*/ uint8 unknown12852[8];
/*15068*/ uint32 available_slots;
+21 -21
View File
@@ -1279,18 +1279,18 @@ namespace SoF
// OUT(unknown06160[4]);
// Copy bandoliers where server and client indexes converge
for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < profile::BandoliersSize; ++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
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
OUT(bandoliers[r].Items[k].ID);
OUT(bandoliers[r].Items[k].Icon);
OUT_str(bandoliers[r].Items[k].Name);
}
}
// Nullify bandoliers where server and client indexes diverge, with a client bias
for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < profile::BandoliersSize; ++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
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
eq->bandoliers[r].Items[k].ID = 0;
eq->bandoliers[r].Items[k].Icon = 0;
eq->bandoliers[r].Items[k].Name[0] = '\0';
@@ -1300,13 +1300,13 @@ namespace SoF
// OUT(unknown07444[5120]);
// Copy potion belt where server and client indexes converge
for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < profile::PotionBeltSize; ++r) {
OUT(potionbelt.Items[r].ID);
OUT(potionbelt.Items[r].Icon);
OUT_str(potionbelt.Items[r].Name);
}
// Nullify potion belt where server and client indexes diverge, with a client bias
for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < profile::PotionBeltSize; ++r) {
eq->potionbelt.Items[r].ID = 0;
eq->potionbelt.Items[r].Icon = 0;
eq->potionbelt.Items[r].Name[0] = '\0';
@@ -1594,8 +1594,8 @@ namespace SoF
eq->CharCount = emu->CharCount;
eq->TotalChars = emu->TotalChars;
if (eq->TotalChars > consts::CHARACTER_CREATION_LIMIT)
eq->TotalChars = consts::CHARACTER_CREATION_LIMIT;
if (eq->TotalChars > constants::CharacterCreationLimit)
eq->TotalChars = constants::CharacterCreationLimit;
FINISH_ENCODE();
return;
@@ -1607,7 +1607,7 @@ namespace SoF
size_t names_length = 0;
size_t character_count = 0;
for (; character_count < emu->CharCount && character_count < consts::CHARACTER_CREATION_LIMIT; ++character_count) {
for (; character_count < emu->CharCount && character_count < constants::CharacterCreationLimit; ++character_count) {
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
names_length += strlen(emu_cse->Name);
emu_ptr += sizeof(CharacterSelectEntry_Struct);
@@ -1623,8 +1623,8 @@ namespace SoF
eq->CharCount = character_count;
eq->TotalChars = emu->TotalChars;
if (eq->TotalChars > consts::CHARACTER_CREATION_LIMIT)
eq->TotalChars = consts::CHARACTER_CREATION_LIMIT;
if (eq->TotalChars > constants::CharacterCreationLimit)
eq->TotalChars = constants::CharacterCreationLimit;
emu_ptr = __emu_buffer;
emu_ptr += sizeof(CharacterSelect_Struct);
@@ -3027,7 +3027,7 @@ namespace SoF
isbs.augtype = item->AugType;
isbs.augrestrict = item->AugRestrict;
for (int index = 0; index < consts::ITEM_COMMON_SIZE; ++index) {
for (int index = 0; index < invaug::ItemAugSize; ++index) {
isbs.augslots[index].type = item->AugSlotType[index];
isbs.augslots[index].visible = item->AugSlotVisible[index];
isbs.augslots[index].unknown = item->AugSlotUnk2[index];
@@ -3237,7 +3237,7 @@ namespace SoF
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END)
SoFSlot = serverSlot + 1;
else if (serverSlot == EQEmu::legacy::SlotPowerSource)
SoFSlot = inventory::SlotPowerSource;
SoFSlot = invslot::PossessionsPowerSource;
else
SoFSlot = serverSlot;
@@ -3254,15 +3254,15 @@ namespace SoF
{
uint32 ServerSlot = 0;
if (sofSlot >= inventory::SlotAmmo && sofSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots
if (sofSlot >= invslot::PossessionsAmmo && sofSlot <= invslot::CorpseEnd) // Cursor/Ammo/Power Source and Normal Inventory Slots
ServerSlot = sofSlot - 1;
else if (sofSlot >= consts::GENERAL_BAGS_BEGIN && sofSlot <= consts::CURSOR_BAG_END)
else if (sofSlot >= invbag::GeneralBagsBegin && sofSlot <= invbag::CursorBagEnd)
ServerSlot = sofSlot - 11;
else if (sofSlot >= consts::BANK_BAGS_BEGIN && sofSlot <= consts::BANK_BAGS_END)
else if (sofSlot >= invbag::BankBagsBegin && sofSlot <= invbag::BankBagsEnd)
ServerSlot = sofSlot - 1;
else if (sofSlot >= consts::SHARED_BANK_BAGS_BEGIN && sofSlot <= consts::SHARED_BANK_BAGS_END)
else if (sofSlot >= invbag::SharedBankBagsBegin && sofSlot <= invbag::SharedBankBagsEnd)
ServerSlot = sofSlot - 1;
else if (sofSlot == inventory::SlotPowerSource)
else if (sofSlot == invslot::PossessionsPowerSource)
ServerSlot = EQEmu::legacy::SlotPowerSource;
else
ServerSlot = sofSlot;
@@ -3278,7 +3278,7 @@ namespace SoF
static inline void ServerToSoFTextLink(std::string& sofTextLink, const std::string& serverTextLink)
{
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
if ((constants::SayLinkBodySize == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
sofTextLink = serverTextLink;
return;
}
@@ -3318,7 +3318,7 @@ namespace SoF
static inline void SoFToServerTextLink(std::string& serverTextLink, const std::string& sofTextLink)
{
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (sofTextLink.find('\x12') == std::string::npos)) {
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == constants::SayLinkBodySize) || (sofTextLink.find('\x12') == std::string::npos)) {
serverTextLink = sofTextLink;
return;
}
@@ -3327,7 +3327,7 @@ namespace SoF
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= consts::TEXT_LINK_BODY_LENGTH) {
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
serverTextLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
+237
View File
@@ -16,3 +16,240 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "sof_limits.h"
#include "../string_util.h"
size_t SoF::invtype::InvTypeSize(int inv_type)
{
switch (inv_type) {
case invtype::InvTypePossessions:
return invtype::InvTypePossessionsSize;
case invtype::InvTypeBank:
return invtype::InvTypeBankSize;
case invtype::InvTypeSharedBank:
return invtype::InvTypeSharedBankSize;
case invtype::InvTypeTrade:
return invtype::InvTypeTradeSize;
case invtype::InvTypeWorld:
return invtype::InvTypeWorldSize;
case invtype::InvTypeLimbo:
return invtype::InvTypeLimboSize;
case invtype::InvTypeTribute:
return invtype::InvTypeTributeSize;
case invtype::InvTypeGuildTribute:
return invtype::InvTypeGuildTributeSize;
case invtype::InvTypeMerchant:
return invtype::InvTypeMerchantSize;
case invtype::InvTypeCorpse:
return invtype::InvTypeCorpseSize;
case invtype::InvTypeBazaar:
return invtype::InvTypeBazaarSize;
case invtype::InvTypeInspect:
return invtype::InvTypeInspectSize;
case invtype::InvTypeViewMODPC:
return invtype::InvTypeViewMODPCSize;
case invtype::InvTypeViewMODBank:
return invtype::InvTypeViewMODBankSize;
case invtype::InvTypeViewMODSharedBank:
return invtype::InvTypeViewMODSharedBankSize;
case invtype::InvTypeViewMODLimbo:
return invtype::InvTypeViewMODLimboSize;
case invtype::InvTypeAltStorage:
return invtype::InvTypeAltStorageSize;
case invtype::InvTypeArchived:
return invtype::InvTypeArchivedSize;
case invtype::InvTypeOther:
return invtype::InvTypeOtherSize;
default:
return 0;
}
}
const char* SoF::invtype::InvTypeName(int inv_type)
{
switch (inv_type) {
case invtype::InvTypeInvalid:
return "Invalid Type";
case invtype::InvTypePossessions:
return "Possessions";
case invtype::InvTypeBank:
return "Bank";
case invtype::InvTypeSharedBank:
return "Shared Bank";
case invtype::InvTypeTrade:
return "Trade";
case invtype::InvTypeWorld:
return "World";
case invtype::InvTypeLimbo:
return "Limbo";
case invtype::InvTypeTribute:
return "Tribute";
case invtype::InvTypeGuildTribute:
return "Guild Tribute";
case invtype::InvTypeMerchant:
return "Merchant";
case invtype::InvTypeCorpse:
return "Corpse";
case invtype::InvTypeBazaar:
return "Bazaar";
case invtype::InvTypeInspect:
return "Inspect";
case invtype::InvTypeViewMODPC:
return "View MOD PC";
case invtype::InvTypeViewMODBank:
return "View MOD Bank";
case invtype::InvTypeViewMODSharedBank:
return "View MOD Shared Bank";
case invtype::InvTypeViewMODLimbo:
return "View MOD Limbo";
case invtype::InvTypeAltStorage:
return "Alt Storage";
case invtype::InvTypeArchived:
return "Archived";
case invtype::InvTypeOther:
return "Other";
default:
return "Unknown Type";
}
}
const char* SoF::invslot::InvPossessionsSlotName(int inv_slot)
{
switch (inv_slot) {
case invslot::InvSlotInvalid:
return "Invalid Slot";
case invslot::PossessionsCharm:
return "Charm";
case invslot::PossessionsEar1:
return "Ear 1";
case invslot::PossessionsHead:
return "Head";
case invslot::PossessionsFace:
return "Face";
case invslot::PossessionsEar2:
return "Ear 2";
case invslot::PossessionsNeck:
return "Neck";
case invslot::PossessionsShoulders:
return "Shoulders";
case invslot::PossessionsArms:
return "Arms";
case invslot::PossessionsBack:
return "Back";
case invslot::PossessionsWrist1:
return "Wrist 1";
case invslot::PossessionsWrist2:
return "Wrist 2";
case invslot::PossessionsRange:
return "Range";
case invslot::PossessionsHands:
return "Hands";
case invslot::PossessionsPrimary:
return "Primary";
case invslot::PossessionsSecondary:
return "Secondary";
case invslot::PossessionsFinger1:
return "Finger 1";
case invslot::PossessionsFinger2:
return "Finger 2";
case invslot::PossessionsChest:
return "Chest";
case invslot::PossessionsLegs:
return "Legs";
case invslot::PossessionsFeet:
return "Feet";
case invslot::PossessionsWaist:
return "Waist";
case invslot::PossessionsPowerSource:
return "Power Source";
case invslot::PossessionsAmmo:
return "Ammo";
case invslot::PossessionsGeneral1:
return "General 1";
case invslot::PossessionsGeneral2:
return "General 2";
case invslot::PossessionsGeneral3:
return "General 3";
case invslot::PossessionsGeneral4:
return "General 4";
case invslot::PossessionsGeneral5:
return "General 5";
case invslot::PossessionsGeneral6:
return "General 6";
case invslot::PossessionsGeneral7:
return "General 7";
case invslot::PossessionsGeneral8:
return "General 8";
case invslot::PossessionsCursor:
return "Cursor";
default:
return "Unknown Slot";
}
}
const char* SoF::invslot::InvCorpseSlotName(int inv_slot)
{
if (!invtype::InvTypeSize(invtype::InvTypeCorpse) || inv_slot == invslot::InvSlotInvalid)
return "Invalid Slot";
// needs work
if ((size_t)(inv_slot + 1) < invslot::CorpseBegin || (size_t)(inv_slot + 1) >= invslot::CorpseEnd)
return "Unknown Slot";
static std::string ret_str;
ret_str = StringFormat("Slot %i", (inv_slot + 1));
return ret_str.c_str();
}
const char* SoF::invslot::InvSlotName(int inv_type, int inv_slot)
{
if (inv_type == invtype::InvTypePossessions)
return invslot::InvPossessionsSlotName(inv_slot);
else if (inv_type == invtype::InvTypeCorpse)
return invslot::InvCorpseSlotName(inv_slot);
size_t type_size = invtype::InvTypeSize(inv_type);
if (!type_size || inv_slot == invslot::InvSlotInvalid)
return "Invalid Slot";
if ((size_t)(inv_slot + 1) >= type_size)
return "Unknown Slot";
static std::string ret_str;
ret_str = StringFormat("Slot %i", (inv_slot + 1));
return ret_str.c_str();
}
const char* SoF::invbag::InvBagIndexName(int bag_index)
{
if (bag_index == invbag::InvBagInvalid)
return "Invalid Bag";
if ((size_t)bag_index >= invbag::ItemBagSize)
return "Unknown Bag";
static std::string ret_str;
ret_str = StringFormat("Bag %i", (bag_index + 1));
return ret_str.c_str();
}
const char* SoF::invaug::InvAugIndexName(int aug_index)
{
if (aug_index == invaug::InvAugInvalid)
return "Invalid Augment";
if ((size_t)aug_index >= invaug::ItemAugSize)
return "Unknown Augment";
static std::string ret_str;
ret_str = StringFormat("Augment %i", (aug_index + 1));
return ret_str.c_str();
}
+254 -148
View File
@@ -17,178 +17,284 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef COMMON_SOF_CONSTANTS_H
#define COMMON_SOF_CONSTANTS_H
#ifndef COMMON_SOF_LIMITS_H
#define COMMON_SOF_LIMITS_H
#include "../types.h"
#include "../client_version.h"
#include "../skills.h"
namespace SoF
{
namespace inventory {
typedef enum : int16 {
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;
enum : int { Invalid = -1, Null, Safety };
typedef enum : int16 {
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;
}
enum : bool { False = false, True = true };
namespace consts {
static const size_t CHARACTER_CREATION_LIMIT = 12;
// pre-declarations
namespace invtype {
inline EQEmu::versions::ClientVersion InvTypeRef() { return EQEmu::versions::ClientVersion::SoF; }
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;
enum : int { InvTypeInvalid = -1, InvTypeBegin };
static const int16 EQUIPMENT_BEGIN = inventory::SlotCharm;
static const int16 EQUIPMENT_END = inventory::SlotAmmo;
static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount;
enum InventoryType : int {
InvTypePossessions = InvTypeBegin,
InvTypeBank,
InvTypeSharedBank,
InvTypeTrade,
InvTypeWorld,
InvTypeLimbo,
InvTypeTribute,
InvTypeGuildTribute,
InvTypeMerchant,
InvTypeCorpse,
InvTypeBazaar,
InvTypeInspect,
InvTypeViewMODPC,
InvTypeViewMODBank,
InvTypeViewMODSharedBank,
InvTypeViewMODLimbo,
InvTypeAltStorage,
InvTypeArchived,
InvTypeOther,
InvTypeCount
};
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;
} /*invtype*/
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;
namespace invslot {
inline EQEmu::versions::ClientVersion InvSlotRef() { return EQEmu::versions::ClientVersion::SoF; }
static const int16 BANK_BEGIN = 2000;
static const int16 BANK_END = 2023;
static const int16 BANK_BAGS_BEGIN = 2032;
static const int16 BANK_BAGS_END_OFFSET = 239;
static const int16 BANK_BAGS_END = BANK_BAGS_BEGIN + BANK_BAGS_END_OFFSET;
enum : int { InvSlotInvalid = -1, InvSlotBegin };
static const int16 SHARED_BANK_BEGIN = 2500;
static const int16 SHARED_BANK_END = 2501;
static const int16 SHARED_BANK_BAGS_BEGIN = 2532;
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;
enum PossessionsSlot : int {
PossessionsCharm = InvSlotBegin,
PossessionsEar1,
PossessionsHead,
PossessionsFace,
PossessionsEar2,
PossessionsNeck,
PossessionsShoulders,
PossessionsArms,
PossessionsBack,
PossessionsWrist1,
PossessionsWrist2,
PossessionsRange,
PossessionsHands,
PossessionsPrimary,
PossessionsSecondary,
PossessionsFinger1,
PossessionsFinger2,
PossessionsChest,
PossessionsLegs,
PossessionsFeet,
PossessionsWaist,
PossessionsPowerSource,
PossessionsAmmo,
PossessionsGeneral1,
PossessionsGeneral2,
PossessionsGeneral3,
PossessionsGeneral4,
PossessionsGeneral5,
PossessionsGeneral6,
PossessionsGeneral7,
PossessionsGeneral8,
PossessionsCursor,
PossessionsCount
};
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;
const int EquipmentBegin = PossessionsCharm;
const int EquipmentEnd = PossessionsAmmo;
const int EquipmentCount = (EquipmentEnd - EquipmentBegin + 1);
static const int16 WORLD_BEGIN = 4000;
static const int16 WORLD_END = 4009;
const int GeneralBegin = PossessionsGeneral1;
const int GeneralEnd = PossessionsGeneral8;
const int GeneralCount = (GeneralEnd - GeneralBegin + 1);
static const int16 TRIBUTE_BEGIN = 400;
static const int16 TRIBUTE_END = 404;
} /*invslot*/
static const int16 CORPSE_BEGIN = inventory::SlotGeneral1;
static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor;
namespace invbag {
inline EQEmu::versions::ClientVersion InvBagRef() { return EQEmu::versions::ClientVersion::SoF; }
static const uint16 ITEM_COMMON_SIZE = 5;
static const uint16 ITEM_CONTAINER_SIZE = 10;
enum : int { InvBagInvalid = -1, InvBagBegin };
static const size_t BANDOLIERS_SIZE = 20; // number of bandolier instances
static const size_t BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
} /*invbag*/
static const size_t POTION_BELT_ITEM_COUNT = 5;
namespace invaug {
inline EQEmu::versions::ClientVersion InvAugRef() { return EQEmu::versions::ClientVersion::SoF; }
static const size_t TEXT_LINK_BODY_LENGTH = 50;
enum : int { InvAugInvalid = -1, InvAugBegin };
static const size_t PLAYER_PROFILE_SKILL_MAX = SkillTripleAttack;
}
} /*invaug*/
namespace limits {
static const bool ALLOWS_EMPTY_BAG_IN_BAG = false;
static const bool ALLOWS_CLICK_CAST_FROM_BAG = false;
static const bool COIN_HAS_WEIGHT = true;
}
namespace item {
inline EQEmu::versions::ClientVersion ItemRef() { return EQEmu::versions::ClientVersion::SoF; }
enum ItemPacketType : int {
ItemPacketMerchant = 100,
ItemPacketTradeView = 101,
ItemPacketLoot = 102,
ItemPacketTrade = 103,
ItemPacketCharInventory = 105,
ItemPacketLimbo = 106,
ItemPacketWorldContainer = 107,
ItemPacketTributeItem = 108,
ItemPacketGuildTribute = 109,
ItemPacketCharmUpdate = 110
};
} /*item*/
namespace profile {
inline EQEmu::versions::ClientVersion ProfileRef() { return EQEmu::versions::ClientVersion::SoF; }
} /*profile*/
namespace constants {
inline EQEmu::versions::ClientVersion ConstantsRef() { return EQEmu::versions::ClientVersion::SoF; }
} /*constants*/
namespace behavior {
inline EQEmu::versions::ClientVersion BehaviorRef() { return EQEmu::versions::ClientVersion::SoF; }
} /*behavior*/
namespace skills {
inline EQEmu::versions::ClientVersion SkillsRef() { return EQEmu::versions::ClientVersion::SoF; }
} /*skills*/
// declarations
namespace invtype {
const size_t InvTypePossessionsSize = invslot::PossessionsCount;
const size_t InvTypeBankSize = 24;
const size_t InvTypeSharedBankSize = 2;
const size_t InvTypeTradeSize = 8;
const size_t InvTypeWorldSize = 10;
const size_t InvTypeLimboSize = 36;
const size_t InvTypeTributeSize = 5;
const size_t InvTypeGuildTributeSize = 0;//unknown
const size_t InvTypeMerchantSize = 80;
const size_t InvTypeCorpseSize = InvTypePossessionsSize;
const size_t InvTypeBazaarSize = 80;
const size_t InvTypeInspectSize = invslot::EquipmentCount;
const size_t InvTypeViewMODPCSize = InvTypePossessionsSize;
const size_t InvTypeViewMODBankSize = InvTypeBankSize;
const size_t InvTypeViewMODSharedBankSize = InvTypeSharedBankSize;
const size_t InvTypeViewMODLimboSize = InvTypeLimboSize;
const size_t InvTypeAltStorageSize = 0;//unknown - "Shroud Bank"
const size_t InvTypeArchivedSize = 0;//unknown
const size_t InvTypeOtherSize = 0;//unknown
const size_t NPCTradeSize = 4;
extern size_t InvTypeSize(int inv_type);
extern const char* InvTypeName(int inv_type);
} /*invtype*/
namespace invslot {
const int BankBegin = 2000;
const int BankEnd = (BankBegin + invtype::InvTypeBankSize) - 1;
const int SharedBankBegin = 2500;
const int SharedBankEnd = (SharedBankBegin + invtype::InvTypeSharedBankSize) - 1;
const int TradeBegin = 3000;
const int TradeEnd = (TradeBegin + invtype::InvTypeTradeSize) - 1;
const int TradeNPCEnd = 3003;
const int WorldBegin = 4000;
const int WorldEnd = (WorldBegin + invtype::InvTypeWorldSize) - 1;
const int TributeBegin = 400;
const int TributeEnd = 404;
const int CorpseBegin = PossessionsGeneral1;
const int CorpseEnd = PossessionsGeneral1 + PossessionsCursor;
extern const char* InvPossessionsSlotName(int inv_slot);
extern const char* InvCorpseSlotName(int inv_slot);
extern const char* InvSlotName(int inv_type, int inv_slot);
} /*invslot*/
namespace invbag {
const size_t ItemBagSize = 10;
const int GeneralBagsBegin = 262;
const int GeneralBagsSize = invslot::GeneralCount * ItemBagSize;
const int GeneralBagsEnd = (GeneralBagsBegin + GeneralBagsSize) - 1;
const int CursorBagBegin = 342;
const int CursorBagSize = ItemBagSize;
const int CursorBagEnd = (CursorBagBegin + CursorBagSize) - 1;
const int BankBagsBegin = 2032;
const int BankBagsSize = (invtype::InvTypeBankSize * ItemBagSize);
const int BankBagsEnd = (BankBagsBegin + BankBagsSize) - 1;
const int SharedBankBagsBegin = 2532;
const int SharedBankBagsSize = invtype::InvTypeSharedBankSize * ItemBagSize;
const int SharedBankBagsEnd = (SharedBankBagsBegin + SharedBankBagsSize) - 1;
const int TradeBagsBegin = 3031;
const int TradeBagsSize = invtype::InvTypeTradeSize * ItemBagSize;
const int TradeBagsEnd = (TradeBagsBegin + TradeBagsSize) - 1;
extern const char* InvBagIndexName(int bag_index);
} /*invbag*/
namespace invaug {
const size_t ItemAugSize = 5;
extern const char* InvAugIndexName(int aug_index);
} /*invaug*/
namespace item {
} /*item*/
namespace profile {
const size_t TributeSize = invtype::InvTypeTributeSize;
const size_t BandoliersSize = 20; // number of bandolier instances
const size_t BandolierItemCount = 4; // number of equipment slots in bandolier instance
const size_t PotionBeltSize = 5;
const size_t SkillArraySize = 100;
} /*profile*/
namespace constants {
const size_t CharacterCreationLimit = 12;
const size_t SayLinkBodySize = 50;
} /*constants*/
namespace behavior {
const bool ConcatenateInvTypeLimbo = true;
const bool AllowOverLevelEquipment = false;
const bool AllowEmptyBagInBag = false;
const bool AllowClickCastFromBag = false;
const bool CoinHasWeight = true;
} /*behavior*/
namespace skills {
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
} /*skills*/
}; /*SoF*/
#endif /*COMMON_SOF_CONSTANTS_H*/
#endif /*COMMON_SOF_LIMITS_H*/
+3 -3
View File
@@ -705,7 +705,7 @@ struct BandolierItem_Struct
struct Bandolier_Struct
{
char Name[32];
BandolierItem_Struct Items[consts::BANDOLIER_ITEM_COUNT];
BandolierItem_Struct Items[profile::BandolierItemCount];
};
//len = 72
@@ -719,7 +719,7 @@ struct PotionBeltItem_Struct
//len = 288
struct PotionBelt_Struct
{
PotionBeltItem_Struct Items[consts::POTION_BELT_ITEM_COUNT];
PotionBeltItem_Struct Items[profile::PotionBeltSize];
};
static const uint32 MAX_GROUP_LEADERSHIP_AA_ARRAY = 16;
@@ -938,7 +938,7 @@ struct PlayerProfile_Struct //23576 Octets
/*08288*/ uint32 aapoints_spent; // Number of spent AA points
/*08292*/ uint32 aapoints; // Unspent AA points
/*08296*/ uint8 unknown06160[4];
/*08300*/ Bandolier_Struct bandoliers[consts::BANDOLIERS_SIZE]; // [6400] bandolier contents
/*08300*/ Bandolier_Struct bandoliers[profile::BandoliersSize]; // [6400] bandolier contents
/*14700*/ PotionBelt_Struct potionbelt; // [360] potion belt 72 extra octets by adding 1 more belt slot
/*15060*/ uint8 unknown12852[8];
/*15068*/ uint32 available_slots;
+10 -10
View File
@@ -966,18 +966,18 @@ namespace Titanium
// OUT(unknown06160[4]);
// Copy bandoliers where server and client indexes converge
for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < profile::BandoliersSize; ++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
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
OUT(bandoliers[r].Items[k].ID);
OUT(bandoliers[r].Items[k].Icon);
OUT_str(bandoliers[r].Items[k].Name);
}
}
// Nullify bandoliers where server and client indexes diverge, with a client bias
for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < profile::BandoliersSize; ++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
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
eq->bandoliers[r].Items[k].ID = 0;
eq->bandoliers[r].Items[k].Icon = 0;
eq->bandoliers[r].Items[k].Name[0] = '\0';
@@ -987,13 +987,13 @@ namespace Titanium
// OUT(unknown07444[5120]);
// Copy potion belt where server and client indexes converge
for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < profile::PotionBeltSize; ++r) {
OUT(potionbelt.Items[r].ID);
OUT(potionbelt.Items[r].Icon);
OUT_str(potionbelt.Items[r].Name);
}
// Nullify potion belt where server and client indexes diverge, with a client bias
for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < profile::PotionBeltSize; ++r) {
eq->potionbelt.Items[r].ID = 0;
eq->potionbelt.Items[r].Icon = 0;
eq->potionbelt.Items[r].Name[0] = '\0';
@@ -2325,7 +2325,7 @@ namespace Titanium
ob << StringFormat("%.*s\"", depth, protection); // Quotes (and protection, if needed) around static data
// Sub data
for (int index = SUB_INDEX_BEGIN; index < consts::ITEM_CONTAINER_SIZE; ++index) {
for (int index = SUB_INDEX_BEGIN; index < invbag::ItemBagSize; ++index) {
ob << '|';
ItemInst* sub = inst->GetItem(index);
@@ -2373,7 +2373,7 @@ namespace Titanium
static inline void ServerToTitaniumTextLink(std::string& titaniumTextLink, const std::string& serverTextLink)
{
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
if ((constants::SayLinkBodySize == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
titaniumTextLink = serverTextLink;
return;
}
@@ -2413,7 +2413,7 @@ namespace Titanium
static inline void TitaniumToServerTextLink(std::string& serverTextLink, const std::string& titaniumTextLink)
{
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (titaniumTextLink.find('\x12') == std::string::npos)) {
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == constants::SayLinkBodySize) || (titaniumTextLink.find('\x12') == std::string::npos)) {
serverTextLink = titaniumTextLink;
return;
}
@@ -2422,7 +2422,7 @@ namespace Titanium
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= consts::TEXT_LINK_BODY_LENGTH) {
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
serverTextLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
+235
View File
@@ -16,3 +16,238 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "titanium_limits.h"
#include "../string_util.h"
size_t Titanium::invtype::InvTypeSize(int inv_type)
{
switch (inv_type) {
case invtype::InvTypePossessions:
return invtype::InvTypePossessionsSize;
case invtype::InvTypeBank:
return invtype::InvTypeBankSize;
case invtype::InvTypeSharedBank:
return invtype::InvTypeSharedBankSize;
case invtype::InvTypeTrade:
return invtype::InvTypeTradeSize;
case invtype::InvTypeWorld:
return invtype::InvTypeWorldSize;
case invtype::InvTypeLimbo:
return invtype::InvTypeLimboSize;
case invtype::InvTypeTribute:
return invtype::InvTypeTributeSize;
case invtype::InvTypeGuildTribute:
return invtype::InvTypeGuildTributeSize;
case invtype::InvTypeMerchant:
return invtype::InvTypeMerchantSize;
case invtype::InvTypeCorpse:
return invtype::InvTypeCorpseSize;
case invtype::InvTypeBazaar:
return invtype::InvTypeBazaarSize;
case invtype::InvTypeInspect:
return invtype::InvTypeInspectSize;
case invtype::InvTypeViewMODPC:
return invtype::InvTypeViewMODPCSize;
case invtype::InvTypeViewMODBank:
return invtype::InvTypeViewMODBankSize;
case invtype::InvTypeViewMODSharedBank:
return invtype::InvTypeViewMODSharedBankSize;
case invtype::InvTypeViewMODLimbo:
return invtype::InvTypeViewMODLimboSize;
case invtype::InvTypeAltStorage:
return invtype::InvTypeAltStorageSize;
case invtype::InvTypeArchived:
return invtype::InvTypeArchivedSize;
case invtype::InvTypeOther:
return invtype::InvTypeOtherSize;
default:
return 0;
}
}
const char* Titanium::invtype::InvTypeName(int inv_type)
{
switch (inv_type) {
case invtype::InvTypeInvalid:
return "Invalid Type";
case invtype::InvTypePossessions:
return "Possessions";
case invtype::InvTypeBank:
return "Bank";
case invtype::InvTypeSharedBank:
return "Shared Bank";
case invtype::InvTypeTrade:
return "Trade";
case invtype::InvTypeWorld:
return "World";
case invtype::InvTypeLimbo:
return "Limbo";
case invtype::InvTypeTribute:
return "Tribute";
case invtype::InvTypeGuildTribute:
return "Guild Tribute";
case invtype::InvTypeMerchant:
return "Merchant";
case invtype::InvTypeCorpse:
return "Corpse";
case invtype::InvTypeBazaar:
return "Bazaar";
case invtype::InvTypeInspect:
return "Inspect";
case invtype::InvTypeViewMODPC:
return "View MOD PC";
case invtype::InvTypeViewMODBank:
return "View MOD Bank";
case invtype::InvTypeViewMODSharedBank:
return "View MOD Shared Bank";
case invtype::InvTypeViewMODLimbo:
return "View MOD Limbo";
case invtype::InvTypeAltStorage:
return "Alt Storage";
case invtype::InvTypeArchived:
return "Archived";
case invtype::InvTypeOther:
return "Other";
default:
return "Unknown Type";
}
}
const char* Titanium::invslot::InvPossessionsSlotName(int inv_slot)
{
switch (inv_slot) {
case invslot::InvSlotInvalid:
return "Invalid Slot";
case invslot::PossessionsCharm:
return "Charm";
case invslot::PossessionsEar1:
return "Ear 1";
case invslot::PossessionsHead:
return "Head";
case invslot::PossessionsFace:
return "Face";
case invslot::PossessionsEar2:
return "Ear 2";
case invslot::PossessionsNeck:
return "Neck";
case invslot::PossessionsShoulders:
return "Shoulders";
case invslot::PossessionsArms:
return "Arms";
case invslot::PossessionsBack:
return "Back";
case invslot::PossessionsWrist1:
return "Wrist 1";
case invslot::PossessionsWrist2:
return "Wrist 2";
case invslot::PossessionsRange:
return "Range";
case invslot::PossessionsHands:
return "Hands";
case invslot::PossessionsPrimary:
return "Primary";
case invslot::PossessionsSecondary:
return "Secondary";
case invslot::PossessionsFinger1:
return "Finger 1";
case invslot::PossessionsFinger2:
return "Finger 2";
case invslot::PossessionsChest:
return "Chest";
case invslot::PossessionsLegs:
return "Legs";
case invslot::PossessionsFeet:
return "Feet";
case invslot::PossessionsWaist:
return "Waist";
case invslot::PossessionsAmmo:
return "Ammo";
case invslot::PossessionsGeneral1:
return "General 1";
case invslot::PossessionsGeneral2:
return "General 2";
case invslot::PossessionsGeneral3:
return "General 3";
case invslot::PossessionsGeneral4:
return "General 4";
case invslot::PossessionsGeneral5:
return "General 5";
case invslot::PossessionsGeneral6:
return "General 6";
case invslot::PossessionsGeneral7:
return "General 7";
case invslot::PossessionsGeneral8:
return "General 8";
case invslot::PossessionsCursor:
return "Cursor";
default:
return "Unknown Slot";
}
}
const char* Titanium::invslot::InvCorpseSlotName(int inv_slot)
{
if (!invtype::InvTypeSize(invtype::InvTypeCorpse) || inv_slot == invslot::InvSlotInvalid)
return "Invalid Slot";
// needs work
if ((size_t)(inv_slot + 1) < invslot::CorpseBegin || (size_t)(inv_slot + 1) >= invslot::CorpseEnd)
return "Unknown Slot";
static std::string ret_str;
ret_str = StringFormat("Slot %i", (inv_slot + 1));
return ret_str.c_str();
}
const char* Titanium::invslot::InvSlotName(int inv_type, int inv_slot)
{
if (inv_type == invtype::InvTypePossessions)
return invslot::InvPossessionsSlotName(inv_slot);
else if (inv_type == invtype::InvTypeCorpse)
return invslot::InvCorpseSlotName(inv_slot);
size_t type_size = invtype::InvTypeSize(inv_type);
if (!type_size || inv_slot == invslot::InvSlotInvalid)
return "Invalid Slot";
if ((size_t)(inv_slot + 1) >= type_size)
return "Unknown Slot";
static std::string ret_str;
ret_str = StringFormat("Slot %i", (inv_slot + 1));
return ret_str.c_str();
}
const char* Titanium::invbag::InvBagIndexName(int bag_index)
{
if (bag_index == invbag::InvBagInvalid)
return "Invalid Bag";
if ((size_t)bag_index >= invbag::ItemBagSize)
return "Unknown Bag";
static std::string ret_str;
ret_str = StringFormat("Bag %i", (bag_index + 1));
return ret_str.c_str();
}
const char* Titanium::invaug::InvAugIndexName(int aug_index)
{
if (aug_index == invaug::InvAugInvalid)
return "Invalid Augment";
if ((size_t)aug_index >= invaug::ItemAugSize)
return "Unknown Augment";
static std::string ret_str;
ret_str = StringFormat("Augment %i", (aug_index + 1));
return ret_str.c_str();
}
+253 -147
View File
@@ -17,177 +17,283 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef COMMON_TITANIUM_CONSTANTS_H
#define COMMON_TITANIUM_CONSTANTS_H
#ifndef COMMON_TITANIUM_LIMITS_H
#define COMMON_TITANIUM_LIMITS_H
#include "../types.h"
#include "../client_version.h"
#include "../skills.h"
namespace Titanium
{
namespace inventory {
typedef enum : int16 {
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;
enum : int { Invalid = -1, Null, Safety };
typedef enum : int16 {
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;
}
enum : bool { False = false, True = true };
// pre-declarations
namespace invtype {
inline EQEmu::versions::ClientVersion InvTypeRef() { return EQEmu::versions::ClientVersion::Titanium; }
namespace consts {
static const size_t CHARACTER_CREATION_LIMIT = 8; // Hard-coded in client - DO NOT ALTER
enum : int { InvTypeInvalid = -1, InvTypeBegin };
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;
enum InventoryType : int {
InvTypePossessions = InvTypeBegin,
InvTypeBank,
InvTypeSharedBank,
InvTypeTrade,
InvTypeWorld,
InvTypeLimbo,
InvTypeTribute,
InvTypeGuildTribute,
InvTypeMerchant,
InvTypeCorpse,
InvTypeBazaar,
InvTypeInspect,
InvTypeViewMODPC,
InvTypeViewMODBank,
InvTypeViewMODSharedBank,
InvTypeViewMODLimbo,
InvTypeAltStorage,
InvTypeArchived,
InvTypeOther,
InvTypeCount
};
static const int16 EQUIPMENT_BEGIN = inventory::SlotCharm;
static const int16 EQUIPMENT_END = inventory::SlotAmmo;
static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount;
} /*invtype*/
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;
namespace invslot {
inline EQEmu::versions::ClientVersion InvSlotRef() { return EQEmu::versions::ClientVersion::Titanium; }
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;
enum : int { InvSlotInvalid = -1, InvSlotBegin };
static const int16 BANK_BEGIN = 2000;
static const int16 BANK_END = 2015;
static const int16 BANK_BAGS_BEGIN = 2031;
static const int16 BANK_BAGS_END_OFFSET = 159;
static const int16 BANK_BAGS_END = BANK_BAGS_BEGIN + BANK_BAGS_END_OFFSET;
enum PossessionsSlot : int {
PossessionsCharm = InvSlotBegin,
PossessionsEar1,
PossessionsHead,
PossessionsFace,
PossessionsEar2,
PossessionsNeck,
PossessionsShoulders,
PossessionsArms,
PossessionsBack,
PossessionsWrist1,
PossessionsWrist2,
PossessionsRange,
PossessionsHands,
PossessionsPrimary,
PossessionsSecondary,
PossessionsFinger1,
PossessionsFinger2,
PossessionsChest,
PossessionsLegs,
PossessionsFeet,
PossessionsWaist,
PossessionsAmmo,
PossessionsGeneral1,
PossessionsGeneral2,
PossessionsGeneral3,
PossessionsGeneral4,
PossessionsGeneral5,
PossessionsGeneral6,
PossessionsGeneral7,
PossessionsGeneral8,
PossessionsCursor,
PossessionsCount
};
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;
const int EquipmentBegin = PossessionsCharm;
const int EquipmentEnd = PossessionsAmmo;
const int EquipmentCount = (EquipmentEnd - EquipmentBegin + 1);
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;
const int GeneralBegin = PossessionsGeneral1;
const int GeneralEnd = PossessionsGeneral8;
const int GeneralCount = (GeneralEnd - GeneralBegin + 1);
static const int16 WORLD_BEGIN = 4000;
static const int16 WORLD_END = 4009;
} /*invslot*/
static const int16 TRIBUTE_BEGIN = 400;
static const int16 TRIBUTE_END = 404;
namespace invbag {
inline EQEmu::versions::ClientVersion InvBagRef() { return EQEmu::versions::ClientVersion::Titanium; }
static const int16 CORPSE_BEGIN = inventory::SlotGeneral1;
static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor;
enum : int { InvBagInvalid = -1, InvBagBegin };
static const uint16 ITEM_COMMON_SIZE = 5;
static const uint16 ITEM_CONTAINER_SIZE = 10;
} /*invbag*/
static const size_t BANDOLIERS_SIZE = 4; // number of bandolier instances
static const size_t BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
namespace invaug {
inline EQEmu::versions::ClientVersion InvAugRef() { return EQEmu::versions::ClientVersion::Titanium; }
static const size_t POTION_BELT_ITEM_COUNT = 4;
enum : int { InvAugInvalid = -1, InvAugBegin };
static const size_t TEXT_LINK_BODY_LENGTH = 45;
} /*invaug*/
static const size_t PLAYER_PROFILE_SKILL_MAX = SkillFrenzy;
}
namespace item {
inline EQEmu::versions::ClientVersion ItemRef() { return EQEmu::versions::ClientVersion::Titanium; }
namespace limits {
static const bool ALLOWS_EMPTY_BAG_IN_BAG = false;
static const bool ALLOWS_CLICK_CAST_FROM_BAG = false;
static const bool COIN_HAS_WEIGHT = true;
}
enum ItemPacketType : int {
ItemPacketMerchant = 100,
ItemPacketTradeView = 101,
ItemPacketLoot = 102,
ItemPacketTrade = 103,
ItemPacketCharInventory = 105,
ItemPacketLimbo = 106,
ItemPacketWorldContainer = 107,
ItemPacketTributeItem = 108,
ItemPacketGuildTribute = 109,
ItemPacketCharmUpdate = 110
};
} /*item*/
namespace profile {
inline EQEmu::versions::ClientVersion ProfileRef() { return EQEmu::versions::ClientVersion::Titanium; }
} /*profile*/
namespace constants {
inline EQEmu::versions::ClientVersion ConstantsRef() { return EQEmu::versions::ClientVersion::Titanium; }
} /*constants*/
namespace behavior {
inline EQEmu::versions::ClientVersion BehaviorRef() { return EQEmu::versions::ClientVersion::Titanium; }
} /*behavior*/
namespace skills {
inline EQEmu::versions::ClientVersion SkillsRef() { return EQEmu::versions::ClientVersion::Titanium; }
} /*skills*/
// declarations
namespace invtype {
const size_t InvTypePossessionsSize = invslot::PossessionsCount;
const size_t InvTypeBankSize = 16;
const size_t InvTypeSharedBankSize = 2;
const size_t InvTypeTradeSize = 8;
const size_t InvTypeWorldSize = 10;
const size_t InvTypeLimboSize = 36;
const size_t InvTypeTributeSize = 5;
const size_t InvTypeGuildTributeSize = 0;//unknown
const size_t InvTypeMerchantSize = 80;
const size_t InvTypeCorpseSize = InvTypePossessionsSize;
const size_t InvTypeBazaarSize = 80;
const size_t InvTypeInspectSize = invslot::EquipmentCount;
const size_t InvTypeViewMODPCSize = InvTypePossessionsSize;
const size_t InvTypeViewMODBankSize = InvTypeBankSize;
const size_t InvTypeViewMODSharedBankSize = InvTypeSharedBankSize;
const size_t InvTypeViewMODLimboSize = InvTypeLimboSize;
const size_t InvTypeAltStorageSize = 0;//unknown - "Shroud Bank"
const size_t InvTypeArchivedSize = 0;//unknown
const size_t InvTypeOtherSize = 0;//unknown
const size_t NPCTradeSize = 4;
extern size_t InvTypeSize(int inv_type);
extern const char* InvTypeName(int inv_type);
} /*invtype*/
namespace invslot {
const int BankBegin = 2000;
const int BankEnd = (BankBegin + invtype::InvTypeBankSize) - 1;
const int SharedBankBegin = 2500;
const int SharedBankEnd = (SharedBankBegin + invtype::InvTypeSharedBankSize) - 1;
const int TradeBegin = 3000;
const int TradeEnd = (TradeBegin + invtype::InvTypeTradeSize) - 1;
const int TradeNPCEnd = 3003;
const int WorldBegin = 4000;
const int WorldEnd = (WorldBegin + invtype::InvTypeWorldSize) - 1;
const int TributeBegin = 400;
const int TributeEnd = 404;
const int CorpseBegin = PossessionsGeneral1;
const int CorpseEnd = PossessionsGeneral1 + PossessionsCursor;
extern const char* InvPossessionsSlotName(int inv_slot);
extern const char* InvCorpseSlotName(int inv_slot);
extern const char* InvSlotName(int inv_type, int inv_slot);
} /*invslot*/
namespace invbag {
const size_t ItemBagSize = 10;
const int GeneralBagsBegin = 251;
const int GeneralBagsSize = invslot::GeneralCount * ItemBagSize;
const int GeneralBagsEnd = (GeneralBagsBegin + GeneralBagsSize) - 1;
const int CursorBagBegin = 331;
const int CursorBagSize = ItemBagSize;
const int CursorBagEnd = (CursorBagBegin + CursorBagSize) - 1;
const int BankBagsBegin = 2031;
const int BankBagsSize = (invtype::InvTypeBankSize * ItemBagSize);
const int BankBagsEnd = (BankBagsBegin + BankBagsSize) - 1;
const int SharedBankBagsBegin = 2531;
const int SharedBankBagsSize = invtype::InvTypeSharedBankSize * ItemBagSize;
const int SharedBankBagsEnd = (SharedBankBagsBegin + SharedBankBagsSize) - 1;
const int TradeBagsBegin = 3031;
const int TradeBagsSize = invtype::InvTypeTradeSize * ItemBagSize;
const int TradeBagsEnd = (TradeBagsBegin + TradeBagsSize) - 1;
extern const char* InvBagIndexName(int bag_index);
} /*invbag*/
namespace invaug {
const size_t ItemAugSize = 5;
extern const char* InvAugIndexName(int aug_index);
} /*invaug*/
namespace item {
} /*item*/
namespace profile {
const size_t TributeSize = invtype::InvTypeTributeSize;
const size_t BandoliersSize = 4; // number of bandolier instances
const size_t BandolierItemCount = 4; // number of equipment slots in bandolier instance
const size_t PotionBeltSize = 4;
const size_t SkillArraySize = 100;
} /*profile*/
namespace constants {
const size_t CharacterCreationLimit = 8; // Hard-coded in client - DO NOT ALTER
const size_t SayLinkBodySize = 45;
} /*constants*/
namespace behavior {
const bool ConcatenateInvTypeLimbo = true;
const bool AllowOverLevelEquipment = false;
const bool AllowEmptyBagInBag = false;
const bool AllowClickCastFromBag = false;
const bool CoinHasWeight = true;
} /*behavior*/
namespace skills {
const size_t LastUsableSkill = EQEmu::skills::SkillFrenzy;
} /*skills*/
}; /*Titanium*/
#endif /*COMMON_TITANIUM_CONSTANTS_H*/
#endif /*COMMON_TITANIUM_LIMITS_H*/
+3 -3
View File
@@ -633,7 +633,7 @@ struct BandolierItem_Struct
struct Bandolier_Struct
{
char Name[32];
BandolierItem_Struct Items[consts::BANDOLIER_ITEM_COUNT];
BandolierItem_Struct Items[profile::BandolierItemCount];
};
//len = 72
@@ -647,7 +647,7 @@ struct PotionBeltItem_Struct
//len = 288
struct PotionBelt_Struct
{
PotionBeltItem_Struct Items[consts::POTION_BELT_ITEM_COUNT];
PotionBeltItem_Struct Items[profile::PotionBeltSize];
};
static const uint32 MAX_GROUP_LEADERSHIP_AA_ARRAY = 16;
@@ -851,7 +851,7 @@ struct PlayerProfile_Struct
/*06152*/ uint32 aapoints_spent; // Number of spent AA points
/*06156*/ uint32 aapoints; // Unspent AA points
/*06160*/ uint8 unknown06160[4];
/*06164*/ Bandolier_Struct bandoliers[consts::BANDOLIERS_SIZE]; // bandolier contents
/*06164*/ Bandolier_Struct bandoliers[profile::BandoliersSize]; // bandolier contents
/*07444*/ uint8 unknown07444[5120];
/*12564*/ PotionBelt_Struct potionbelt; // potion belt
/*12852*/ uint8 unknown12852[8];
+21 -21
View File
@@ -1891,18 +1891,18 @@ namespace UF
// OUT(unknown06160[4]);
// Copy bandoliers where server and client indexes converge
for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < profile::BandoliersSize; ++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
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
OUT(bandoliers[r].Items[k].ID);
OUT(bandoliers[r].Items[k].Icon);
OUT_str(bandoliers[r].Items[k].Name);
}
}
// Nullify bandoliers where server and client indexes diverge, with a client bias
for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < profile::BandoliersSize; ++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
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
eq->bandoliers[r].Items[k].ID = 0;
eq->bandoliers[r].Items[k].Icon = 0;
eq->bandoliers[r].Items[k].Name[0] = '\0';
@@ -1912,13 +1912,13 @@ namespace UF
// OUT(unknown07444[5120]);
// Copy potion belt where server and client indexes converge
for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < profile::PotionBeltSize; ++r) {
OUT(potionbelt.Items[r].ID);
OUT(potionbelt.Items[r].Icon);
OUT_str(potionbelt.Items[r].Name);
}
// Nullify potion belt where server and client indexes diverge, with a client bias
for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < profile::PotionBeltSize; ++r) {
eq->potionbelt.Items[r].ID = 0;
eq->potionbelt.Items[r].Icon = 0;
eq->potionbelt.Items[r].Name[0] = '\0';
@@ -2227,8 +2227,8 @@ namespace UF
eq->CharCount = emu->CharCount;
eq->TotalChars = emu->TotalChars;
if (eq->TotalChars > consts::CHARACTER_CREATION_LIMIT)
eq->TotalChars = consts::CHARACTER_CREATION_LIMIT;
if (eq->TotalChars > constants::CharacterCreationLimit)
eq->TotalChars = constants::CharacterCreationLimit;
// Special Underfoot adjustment - field should really be 'AdditionalChars' or 'BonusChars'
uint32 adjusted_total = eq->TotalChars - 8; // Yes, it rolls under for '< 8' - probably an int32 field
@@ -2244,7 +2244,7 @@ namespace UF
size_t names_length = 0;
size_t character_count = 0;
for (; character_count < emu->CharCount && character_count < consts::CHARACTER_CREATION_LIMIT; ++character_count) {
for (; character_count < emu->CharCount && character_count < constants::CharacterCreationLimit; ++character_count) {
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
names_length += strlen(emu_cse->Name);
emu_ptr += sizeof(CharacterSelectEntry_Struct);
@@ -2260,8 +2260,8 @@ namespace UF
eq->CharCount = character_count;
eq->TotalChars = emu->TotalChars;
if (eq->TotalChars > consts::CHARACTER_CREATION_LIMIT)
eq->TotalChars = consts::CHARACTER_CREATION_LIMIT;
if (eq->TotalChars > constants::CharacterCreationLimit)
eq->TotalChars = constants::CharacterCreationLimit;
// Special Underfoot adjustment - field should really be 'AdditionalChars' or 'BonusChars' in this client
uint32 adjusted_total = eq->TotalChars - 8; // Yes, it rolls under for '< 8' - probably an int32 field
@@ -4020,7 +4020,7 @@ namespace UF
isbs.augtype = item->AugType;
isbs.augrestrict = item->AugRestrict;
for (int index = 0; index < consts::ITEM_COMMON_SIZE; ++index) {
for (int index = 0; index < invaug::ItemAugSize; ++index) {
isbs.augslots[index].type = item->AugSlotType[index];
isbs.augslots[index].visible = item->AugSlotVisible[index];
isbs.augslots[index].unknown = item->AugSlotUnk2[index];
@@ -4254,7 +4254,7 @@ namespace UF
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END)
UnderfootSlot = serverSlot + 1;
else if (serverSlot == EQEmu::legacy::SlotPowerSource)
UnderfootSlot = inventory::SlotPowerSource;
UnderfootSlot = invslot::PossessionsPowerSource;
else
UnderfootSlot = serverSlot;
@@ -4271,15 +4271,15 @@ namespace UF
{
uint32 ServerSlot = 0;
if (ufSlot >= inventory::SlotAmmo && ufSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots
if (ufSlot >= invslot::PossessionsAmmo && ufSlot <= invslot::CorpseEnd) // Cursor/Ammo/Power Source and Normal Inventory Slots
ServerSlot = ufSlot - 1;
else if (ufSlot >= consts::GENERAL_BAGS_BEGIN && ufSlot <= consts::CURSOR_BAG_END)
else if (ufSlot >= invbag::GeneralBagsBegin && ufSlot <= invbag::CursorBagEnd)
ServerSlot = ufSlot - 11;
else if (ufSlot >= consts::BANK_BAGS_BEGIN && ufSlot <= consts::BANK_BAGS_END)
else if (ufSlot >= invbag::BankBagsBegin && ufSlot <= invbag::BankBagsEnd)
ServerSlot = ufSlot - 1;
else if (ufSlot >= consts::SHARED_BANK_BAGS_BEGIN && ufSlot <= consts::SHARED_BANK_BAGS_END)
else if (ufSlot >= invbag::SharedBankBagsBegin && ufSlot <= invbag::SharedBankBagsEnd)
ServerSlot = ufSlot - 1;
else if (ufSlot == inventory::SlotPowerSource)
else if (ufSlot == invslot::PossessionsPowerSource)
ServerSlot = EQEmu::legacy::SlotPowerSource;
else
ServerSlot = ufSlot;
@@ -4295,7 +4295,7 @@ namespace UF
static inline void ServerToUFTextLink(std::string& ufTextLink, const std::string& serverTextLink)
{
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
if ((constants::SayLinkBodySize == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
ufTextLink = serverTextLink;
return;
}
@@ -4335,7 +4335,7 @@ namespace UF
static inline void UFToServerTextLink(std::string& serverTextLink, const std::string& ufTextLink)
{
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (ufTextLink.find('\x12') == std::string::npos)) {
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == constants::SayLinkBodySize) || (ufTextLink.find('\x12') == std::string::npos)) {
serverTextLink = ufTextLink;
return;
}
@@ -4344,7 +4344,7 @@ namespace UF
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= consts::TEXT_LINK_BODY_LENGTH) {
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
serverTextLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
+237
View File
@@ -16,3 +16,240 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "uf_limits.h"
#include "../string_util.h"
size_t UF::invtype::InvTypeSize(int inv_type)
{
switch (inv_type) {
case invtype::InvTypePossessions:
return invtype::InvTypePossessionsSize;
case invtype::InvTypeBank:
return invtype::InvTypeBankSize;
case invtype::InvTypeSharedBank:
return invtype::InvTypeSharedBankSize;
case invtype::InvTypeTrade:
return invtype::InvTypeTradeSize;
case invtype::InvTypeWorld:
return invtype::InvTypeWorldSize;
case invtype::InvTypeLimbo:
return invtype::InvTypeLimboSize;
case invtype::InvTypeTribute:
return invtype::InvTypeTributeSize;
case invtype::InvTypeGuildTribute:
return invtype::InvTypeGuildTributeSize;
case invtype::InvTypeMerchant:
return invtype::InvTypeMerchantSize;
case invtype::InvTypeCorpse:
return invtype::InvTypeCorpseSize;
case invtype::InvTypeBazaar:
return invtype::InvTypeBazaarSize;
case invtype::InvTypeInspect:
return invtype::InvTypeInspectSize;
case invtype::InvTypeViewMODPC:
return invtype::InvTypeViewMODPCSize;
case invtype::InvTypeViewMODBank:
return invtype::InvTypeViewMODBankSize;
case invtype::InvTypeViewMODSharedBank:
return invtype::InvTypeViewMODSharedBankSize;
case invtype::InvTypeViewMODLimbo:
return invtype::InvTypeViewMODLimboSize;
case invtype::InvTypeAltStorage:
return invtype::InvTypeAltStorageSize;
case invtype::InvTypeArchived:
return invtype::InvTypeArchivedSize;
case invtype::InvTypeOther:
return invtype::InvTypeOtherSize;
default:
return 0;
}
}
const char* UF::invtype::InvTypeName(int inv_type)
{
switch (inv_type) {
case invtype::InvTypeInvalid:
return "Invalid Type";
case invtype::InvTypePossessions:
return "Possessions";
case invtype::InvTypeBank:
return "Bank";
case invtype::InvTypeSharedBank:
return "Shared Bank";
case invtype::InvTypeTrade:
return "Trade";
case invtype::InvTypeWorld:
return "World";
case invtype::InvTypeLimbo:
return "Limbo";
case invtype::InvTypeTribute:
return "Tribute";
case invtype::InvTypeGuildTribute:
return "Guild Tribute";
case invtype::InvTypeMerchant:
return "Merchant";
case invtype::InvTypeCorpse:
return "Corpse";
case invtype::InvTypeBazaar:
return "Bazaar";
case invtype::InvTypeInspect:
return "Inspect";
case invtype::InvTypeViewMODPC:
return "View MOD PC";
case invtype::InvTypeViewMODBank:
return "View MOD Bank";
case invtype::InvTypeViewMODSharedBank:
return "View MOD Shared Bank";
case invtype::InvTypeViewMODLimbo:
return "View MOD Limbo";
case invtype::InvTypeAltStorage:
return "Alt Storage";
case invtype::InvTypeArchived:
return "Archived";
case invtype::InvTypeOther:
return "Other";
default:
return "Unknown Type";
}
}
const char* UF::invslot::InvPossessionsSlotName(int inv_slot)
{
switch (inv_slot) {
case invslot::InvSlotInvalid:
return "Invalid Slot";
case invslot::PossessionsCharm:
return "Charm";
case invslot::PossessionsEar1:
return "Ear 1";
case invslot::PossessionsHead:
return "Head";
case invslot::PossessionsFace:
return "Face";
case invslot::PossessionsEar2:
return "Ear 2";
case invslot::PossessionsNeck:
return "Neck";
case invslot::PossessionsShoulders:
return "Shoulders";
case invslot::PossessionsArms:
return "Arms";
case invslot::PossessionsBack:
return "Back";
case invslot::PossessionsWrist1:
return "Wrist 1";
case invslot::PossessionsWrist2:
return "Wrist 2";
case invslot::PossessionsRange:
return "Range";
case invslot::PossessionsHands:
return "Hands";
case invslot::PossessionsPrimary:
return "Primary";
case invslot::PossessionsSecondary:
return "Secondary";
case invslot::PossessionsFinger1:
return "Finger 1";
case invslot::PossessionsFinger2:
return "Finger 2";
case invslot::PossessionsChest:
return "Chest";
case invslot::PossessionsLegs:
return "Legs";
case invslot::PossessionsFeet:
return "Feet";
case invslot::PossessionsWaist:
return "Waist";
case invslot::PossessionsPowerSource:
return "Power Source";
case invslot::PossessionsAmmo:
return "Ammo";
case invslot::PossessionsGeneral1:
return "General 1";
case invslot::PossessionsGeneral2:
return "General 2";
case invslot::PossessionsGeneral3:
return "General 3";
case invslot::PossessionsGeneral4:
return "General 4";
case invslot::PossessionsGeneral5:
return "General 5";
case invslot::PossessionsGeneral6:
return "General 6";
case invslot::PossessionsGeneral7:
return "General 7";
case invslot::PossessionsGeneral8:
return "General 8";
case invslot::PossessionsCursor:
return "Cursor";
default:
return "Unknown Slot";
}
}
const char* UF::invslot::InvCorpseSlotName(int inv_slot)
{
if (!invtype::InvTypeSize(invtype::InvTypeCorpse) || inv_slot == invslot::InvSlotInvalid)
return "Invalid Slot";
// needs work
if ((size_t)(inv_slot + 1) < invslot::CorpseBegin || (size_t)(inv_slot + 1) >= invslot::CorpseEnd)
return "Unknown Slot";
static std::string ret_str;
ret_str = StringFormat("Slot %i", (inv_slot + 1));
return ret_str.c_str();
}
const char* UF::invslot::InvSlotName(int inv_type, int inv_slot)
{
if (inv_type == invtype::InvTypePossessions)
return invslot::InvPossessionsSlotName(inv_slot);
else if (inv_type == invtype::InvTypeCorpse)
return invslot::InvCorpseSlotName(inv_slot);
size_t type_size = invtype::InvTypeSize(inv_type);
if (!type_size || inv_slot == invslot::InvSlotInvalid)
return "Invalid Slot";
if ((size_t)(inv_slot + 1) >= type_size)
return "Unknown Slot";
static std::string ret_str;
ret_str = StringFormat("Slot %i", (inv_slot + 1));
return ret_str.c_str();
}
const char* UF::invbag::InvBagIndexName(int bag_index)
{
if (bag_index == invbag::InvBagInvalid)
return "Invalid Bag";
if ((size_t)bag_index >= invbag::ItemBagSize)
return "Unknown Bag";
static std::string ret_str;
ret_str = StringFormat("Bag %i", (bag_index + 1));
return ret_str.c_str();
}
const char* UF::invaug::InvAugIndexName(int aug_index)
{
if (aug_index == invaug::InvAugInvalid)
return "Invalid Augment";
if ((size_t)aug_index >= invaug::ItemAugSize)
return "Unknown Augment";
static std::string ret_str;
ret_str = StringFormat("Augment %i", (aug_index + 1));
return ret_str.c_str();
}
+255 -148
View File
@@ -17,178 +17,285 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef COMMON_UF_CONSTANTS_H
#define COMMON_UF_CONSTANTS_H
#ifndef COMMON_UF_LIMITS_H
#define COMMON_UF_LIMITS_H
#include "../types.h"
#include "../client_version.h"
#include "../skills.h"
namespace UF
{
namespace inventory {
typedef enum : int16 {
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;
enum : int { Invalid = -1, Null, Safety };
typedef enum : int16 {
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;
}
enum : bool { False = false, True = true };
namespace consts {
static const size_t CHARACTER_CREATION_LIMIT = 12;
// pre-declarations
namespace invtype {
inline EQEmu::versions::ClientVersion InvTypeRef() { return EQEmu::versions::ClientVersion::UF; }
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;
enum : int { InvTypeInvalid = -1, InvTypeBegin };
static const int16 EQUIPMENT_BEGIN = inventory::SlotCharm;
static const int16 EQUIPMENT_END = inventory::SlotAmmo;
static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount;
enum InventoryType : int {
InvTypePossessions = InvTypeBegin,
InvTypeBank,
InvTypeSharedBank,
InvTypeTrade,
InvTypeWorld,
InvTypeLimbo,
InvTypeTribute,
InvTypeGuildTribute,
InvTypeMerchant,
InvTypeCorpse,
InvTypeBazaar,
InvTypeInspect,
InvTypeViewMODPC,
InvTypeViewMODBank,
InvTypeViewMODSharedBank,
InvTypeViewMODLimbo,
InvTypeAltStorage,
InvTypeArchived,
InvTypeOther,
InvTypeCount
};
} /*invtype*/
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;
namespace invslot {
inline EQEmu::versions::ClientVersion InvSlotRef() { return EQEmu::versions::ClientVersion::UF; }
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;
enum : int { InvSlotInvalid = -1, InvSlotBegin };
static const int16 BANK_BEGIN = 2000;
static const int16 BANK_END = 2023;
static const int16 BANK_BAGS_BEGIN = 2032;
static const int16 BANK_BAGS_END_OFFSET = 239;
static const int16 BANK_BAGS_END = BANK_BAGS_BEGIN + BANK_BAGS_END_OFFSET;
enum PossessionsSlot : int {
PossessionsCharm = InvSlotBegin,
PossessionsEar1,
PossessionsHead,
PossessionsFace,
PossessionsEar2,
PossessionsNeck,
PossessionsShoulders,
PossessionsArms,
PossessionsBack,
PossessionsWrist1,
PossessionsWrist2,
PossessionsRange,
PossessionsHands,
PossessionsPrimary,
PossessionsSecondary,
PossessionsFinger1,
PossessionsFinger2,
PossessionsChest,
PossessionsLegs,
PossessionsFeet,
PossessionsWaist,
PossessionsPowerSource,
PossessionsAmmo,
PossessionsGeneral1,
PossessionsGeneral2,
PossessionsGeneral3,
PossessionsGeneral4,
PossessionsGeneral5,
PossessionsGeneral6,
PossessionsGeneral7,
PossessionsGeneral8,
PossessionsCursor,
PossessionsCount
};
static const int16 SHARED_BANK_BEGIN = 2500;
static const int16 SHARED_BANK_END = 2501;
static const int16 SHARED_BANK_BAGS_BEGIN = 2532;
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;
const int EquipmentBegin = PossessionsCharm;
const int EquipmentEnd = PossessionsAmmo;
const int EquipmentCount = (EquipmentEnd - EquipmentBegin + 1);
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;
const int GeneralBegin = PossessionsGeneral1;
const int GeneralEnd = PossessionsGeneral8;
const int GeneralCount = (GeneralEnd - GeneralBegin + 1);
} /*invslot*/
static const int16 WORLD_BEGIN = 4000;
static const int16 WORLD_END = 4009;
namespace invbag {
inline EQEmu::versions::ClientVersion InvBagRef() { return EQEmu::versions::ClientVersion::UF; }
static const int16 TRIBUTE_BEGIN = 400;
static const int16 TRIBUTE_END = 404;
enum : int { InvBagInvalid = -1, InvBagBegin };
} /*invbag*/
static const int16 CORPSE_BEGIN = inventory::SlotGeneral1;
static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor;
namespace invaug {
inline EQEmu::versions::ClientVersion InvAugRef() { return EQEmu::versions::ClientVersion::UF; }
static const uint16 ITEM_COMMON_SIZE = 5;
static const uint16 ITEM_CONTAINER_SIZE = 10;
enum : int { InvAugInvalid = -1, InvAugBegin };
} /*invaug*/
static const size_t BANDOLIERS_SIZE = 20; // number of bandolier instances
static const size_t BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
namespace item {
inline EQEmu::versions::ClientVersion ItemRef() { return EQEmu::versions::ClientVersion::UF; }
static const size_t POTION_BELT_ITEM_COUNT = 5;
enum ItemPacketType : int {
ItemPacketMerchant = 100,
ItemPacketTradeView = 101,
ItemPacketLoot = 102,
ItemPacketTrade = 103,
ItemPacketCharInventory = 105,
ItemPacketLimbo = 106,
ItemPacketWorldContainer = 107,
ItemPacketTributeItem = 108,
ItemPacketGuildTribute = 109,
ItemPacketCharmUpdate = 110,
ItemPacket11 = 111
};
} /*item*/
static const size_t TEXT_LINK_BODY_LENGTH = 50;
namespace profile {
inline EQEmu::versions::ClientVersion ProfileRef() { return EQEmu::versions::ClientVersion::UF; }
} /*profile*/
static const size_t PLAYER_PROFILE_SKILL_MAX = SkillTripleAttack;
}
namespace constants {
inline EQEmu::versions::ClientVersion ConstantsRef() { return EQEmu::versions::ClientVersion::UF; }
} /*constants*/
namespace limits {
static const bool ALLOWS_EMPTY_BAG_IN_BAG = false;
static const bool ALLOWS_CLICK_CAST_FROM_BAG = false;
static const bool COIN_HAS_WEIGHT = false;
}
namespace behavior {
inline EQEmu::versions::ClientVersion BehaviorRef() { return EQEmu::versions::ClientVersion::UF; }
} /*behavior*/
namespace skills {
inline EQEmu::versions::ClientVersion SkillsRef() { return EQEmu::versions::ClientVersion::UF; }
} /*skills*/
// declarations
namespace invtype {
const size_t InvTypePossessionsSize = invslot::PossessionsCount;
const size_t InvTypeBankSize = 24;
const size_t InvTypeSharedBankSize = 2;
const size_t InvTypeTradeSize = 8;
const size_t InvTypeWorldSize = 10;
const size_t InvTypeLimboSize = 36;
const size_t InvTypeTributeSize = 5;
const size_t InvTypeGuildTributeSize = 0;//unknown
const size_t InvTypeMerchantSize = 80;
const size_t InvTypeCorpseSize = InvTypePossessionsSize;
const size_t InvTypeBazaarSize = 80;
const size_t InvTypeInspectSize = invslot::EquipmentCount;
const size_t InvTypeViewMODPCSize = InvTypePossessionsSize;
const size_t InvTypeViewMODBankSize = InvTypeBankSize;
const size_t InvTypeViewMODSharedBankSize = InvTypeSharedBankSize;
const size_t InvTypeViewMODLimboSize = InvTypeLimboSize;
const size_t InvTypeAltStorageSize = 0;//unknown - "Shroud Bank"
const size_t InvTypeArchivedSize = 0;//unknown
const size_t InvTypeOtherSize = 0;//unknown
const size_t NPCTradeSize = 4;
extern size_t InvTypeSize(int inv_type);
extern const char* InvTypeName(int inv_type);
} /*invtype*/
namespace invslot {
const int BankBegin = 2000;
const int BankEnd = (BankBegin + invtype::InvTypeBankSize) - 1;
const int SharedBankBegin = 2500;
const int SharedBankEnd = (SharedBankBegin + invtype::InvTypeSharedBankSize) - 1;
const int TradeBegin = 3000;
const int TradeEnd = (TradeBegin + invtype::InvTypeTradeSize) - 1;
const int TradeNPCEnd = 3003;
const int WorldBegin = 4000;
const int WorldEnd = (WorldBegin + invtype::InvTypeWorldSize) - 1;
const int TributeBegin = 400;
const int TributeEnd = 404;
const int CorpseBegin = invslot::PossessionsGeneral1;
const int CorpseEnd = invslot::PossessionsGeneral1 + invslot::PossessionsCursor;
extern const char* InvPossessionsSlotName(int inv_slot);
extern const char* InvCorpseSlotName(int inv_slot);
extern const char* InvSlotName(int inv_type, int inv_slot);
} /*invslot*/
namespace invbag {
const size_t ItemBagSize = 10;
const int GeneralBagsBegin = 262;
const int GeneralBagsSize = invslot::GeneralCount * ItemBagSize;
const int GeneralBagsEnd = (GeneralBagsBegin + GeneralBagsSize) - 1;
const int CursorBagBegin = 342;
const int CursorBagSize = ItemBagSize;
const int CursorBagEnd = (CursorBagBegin + CursorBagSize) - 1;
const int BankBagsBegin = 2032;
const int BankBagsSize = (invtype::InvTypeBankSize * ItemBagSize);
const int BankBagsEnd = (BankBagsBegin + BankBagsSize) - 1;
const int SharedBankBagsBegin = 2532;
const int SharedBankBagsSize = invtype::InvTypeSharedBankSize * ItemBagSize;
const int SharedBankBagsEnd = (SharedBankBagsBegin + SharedBankBagsSize) - 1;
const int TradeBagsBegin = 3031;
const int TradeBagsSize = invtype::InvTypeTradeSize * ItemBagSize;
const int TradeBagsEnd = (TradeBagsBegin + TradeBagsSize) - 1;
extern const char* InvBagIndexName(int bag_index);
} /*invbag*/
namespace invaug {
const size_t ItemAugSize = 5;
extern const char* InvAugIndexName(int aug_index);
} /*invaug*/
namespace item {
} /*item*/
namespace profile {
const size_t TributeSize = invtype::InvTypeTributeSize;
const size_t BandoliersSize = 20; // number of bandolier instances
const size_t BandolierItemCount = 4; // number of equipment slots in bandolier instance
const size_t PotionBeltSize = 5;
const size_t SkillArraySize = 100;
} /*profile*/
namespace constants {
const size_t CharacterCreationLimit = 12;
const size_t SayLinkBodySize = 50;
} /*constants*/
namespace behavior {
const bool ConcatenateInvTypeLimbo = true;
const bool AllowOverLevelEquipment = true;
const bool AllowEmptyBagInBag = false;
const bool AllowClickCastFromBag = false;
const bool CoinHasWeight = false;
} /*behavior*/
namespace skills {
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
} /*skills*/
}; /*UF*/
#endif /*COMMON_UF_CONSTANTS_H*/
#endif /*COMMON_UF_LIMITS_H*/
+3 -3
View File
@@ -773,7 +773,7 @@ struct BandolierItem_Struct
struct Bandolier_Struct
{
char Name[32];
BandolierItem_Struct Items[consts::BANDOLIER_ITEM_COUNT];
BandolierItem_Struct Items[profile::BandolierItemCount];
};
//len = 72
@@ -787,7 +787,7 @@ struct PotionBeltItem_Struct
//len = 288
struct PotionBelt_Struct
{
PotionBeltItem_Struct Items[consts::POTION_BELT_ITEM_COUNT];
PotionBeltItem_Struct Items[profile::PotionBeltSize];
};
static const uint32 MAX_GROUP_LEADERSHIP_AA_ARRAY = 16;
@@ -1010,7 +1010,7 @@ struct PlayerProfile_Struct
/*11236*/ uint32 aapoints_spent; // Number of spent AA points
/*11240*/ uint32 aapoints; // Unspent AA points
/*11244*/ uint8 unknown11244[4];
/*11248*/ Bandolier_Struct bandoliers[consts::BANDOLIERS_SIZE]; // [6400] bandolier contents
/*11248*/ Bandolier_Struct bandoliers[profile::BandoliersSize]; // [6400] bandolier contents
/*17648*/ PotionBelt_Struct potionbelt; // [360] potion belt 72 extra octets by adding 1 more belt slot
/*18008*/ uint8 unknown18008[8];
/*18016*/ uint32 available_slots;
+1
View File
@@ -17,6 +17,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "say_link.h"
#include "emu_constants.h"
#include "string_util.h"
+9 -9
View File
@@ -1382,7 +1382,7 @@ bool SharedDatabase::LoadSkillCaps(const std::string &prefix) {
skill_caps_mmf.reset(nullptr);
uint32 class_count = PLAYER_CLASS_COUNT;
uint32 skill_count = HIGHEST_SKILL + 1;
uint32 skill_count = EQEmu::skills::HIGHEST_SKILL + 1;
uint32 level_count = HARD_LEVEL_CAP + 1;
uint32 size = (class_count * skill_count * level_count * sizeof(uint16));
@@ -1403,7 +1403,7 @@ bool SharedDatabase::LoadSkillCaps(const std::string &prefix) {
void SharedDatabase::LoadSkillCaps(void *data) {
uint32 class_count = PLAYER_CLASS_COUNT;
uint32 skill_count = HIGHEST_SKILL + 1;
uint32 skill_count = EQEmu::skills::HIGHEST_SKILL + 1;
uint32 level_count = HARD_LEVEL_CAP + 1;
uint16 *skill_caps_table = reinterpret_cast<uint16*>(data);
@@ -1428,7 +1428,7 @@ void SharedDatabase::LoadSkillCaps(void *data) {
}
}
uint16 SharedDatabase::GetSkillCap(uint8 Class_, SkillUseTypes Skill, uint8 Level) {
uint16 SharedDatabase::GetSkillCap(uint8 Class_, EQEmu::skills::SkillType Skill, uint8 Level) {
if(!skill_caps_mmf) {
return 0;
}
@@ -1442,7 +1442,7 @@ uint16 SharedDatabase::GetSkillCap(uint8 Class_, SkillUseTypes Skill, uint8 Leve
}
uint32 class_count = PLAYER_CLASS_COUNT;
uint32 skill_count = HIGHEST_SKILL + 1;
uint32 skill_count = EQEmu::skills::HIGHEST_SKILL + 1;
uint32 level_count = HARD_LEVEL_CAP + 1;
if(Class_ > class_count || static_cast<uint32>(Skill) > skill_count || Level > level_count) {
return 0;
@@ -1457,7 +1457,7 @@ uint16 SharedDatabase::GetSkillCap(uint8 Class_, SkillUseTypes Skill, uint8 Leve
return skill_caps_table[index];
}
uint8 SharedDatabase::GetTrainLevel(uint8 Class_, SkillUseTypes Skill, uint8 Level) {
uint8 SharedDatabase::GetTrainLevel(uint8 Class_, EQEmu::skills::SkillType Skill, uint8 Level) {
if(!skill_caps_mmf) {
return 0;
}
@@ -1471,7 +1471,7 @@ uint8 SharedDatabase::GetTrainLevel(uint8 Class_, SkillUseTypes Skill, uint8 Lev
}
uint32 class_count = PLAYER_CLASS_COUNT;
uint32 skill_count = HIGHEST_SKILL + 1;
uint32 skill_count = EQEmu::skills::HIGHEST_SKILL + 1;
uint32 level_count = HARD_LEVEL_CAP + 1;
if(Class_ > class_count || static_cast<uint32>(Skill) > skill_count || Level > level_count) {
return 0;
@@ -1642,10 +1642,10 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) {
int tmp_skill = atoi(row[100]);;
if(tmp_skill < 0 || tmp_skill > HIGHEST_SKILL)
sp[tempid].skill = SkillBegging; /* not much better we can do. */ // can probably be changed to client-based 'SkillNone' once activated
if (tmp_skill < 0 || tmp_skill > EQEmu::skills::HIGHEST_SKILL)
sp[tempid].skill = EQEmu::skills::SkillBegging; /* not much better we can do. */ // can probably be changed to client-based 'SkillNone' once activated
else
sp[tempid].skill = (SkillUseTypes) tmp_skill;
sp[tempid].skill = (EQEmu::skills::SkillType) tmp_skill;
sp[tempid].zonetype=atoi(row[101]);
sp[tempid].EnvironmentType=atoi(row[102]);
+2 -2
View File
@@ -131,8 +131,8 @@ class SharedDatabase : public Database
void LoadSkillCaps(void *data);
bool LoadSkillCaps(const std::string &prefix);
uint16 GetSkillCap(uint8 Class_, SkillUseTypes Skill, uint8 Level);
uint8 GetTrainLevel(uint8 Class_, SkillUseTypes Skill, uint8 Level);
uint16 GetSkillCap(uint8 Class_, EQEmu::skills::SkillType Skill, uint8 Level);
uint8 GetTrainLevel(uint8 Class_, EQEmu::skills::SkillType Skill, uint8 Level);
int GetMaxSpellID();
bool LoadSpells(const std::string &prefix, int32 *records, const SPDat_Spell_Struct **sp);
+164 -14
View File
@@ -1,5 +1,6 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
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
@@ -9,17 +10,20 @@
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "types.h"
#include "skills.h"
bool EQEmu::IsTradeskill(SkillUseTypes skill)
#include <string.h>
bool EQEmu::skills::IsTradeskill(SkillType skill)
{
switch (skill) {
case SkillFishing:
@@ -40,7 +44,7 @@ bool EQEmu::IsTradeskill(SkillUseTypes skill)
}
}
bool EQEmu::IsSpecializedSkill(SkillUseTypes skill)
bool EQEmu::skills::IsSpecializedSkill(SkillType skill)
{
// this could be a simple if, but if this is more portable if any IDs change (probably won't)
// or any other specialized are added (also unlikely)
@@ -56,7 +60,7 @@ bool EQEmu::IsSpecializedSkill(SkillUseTypes skill)
}
}
float EQEmu::GetSkillMeleePushForce(SkillUseTypes skill)
float EQEmu::skills::GetSkillMeleePushForce(SkillType skill)
{
// This is the force/magnitude of the push from an attack of this skill type
// You can find these numbers in the clients skill struct
@@ -93,7 +97,7 @@ float EQEmu::GetSkillMeleePushForce(SkillUseTypes skill)
}
}
bool EQEmu::IsBardInstrumentSkill(SkillUseTypes skill)
bool EQEmu::skills::IsBardInstrumentSkill(SkillType skill)
{
switch (skill) {
case SkillBrassInstruments:
@@ -107,7 +111,7 @@ bool EQEmu::IsBardInstrumentSkill(SkillUseTypes skill)
}
}
const std::map<SkillUseTypes, std::string>& EQEmu::GetSkillUseTypesMap()
const std::map<EQEmu::skills::SkillType, std::string>& EQEmu::skills::GetSkillTypeMap()
{
/* VS2013 code
static const std::map<SkillUseTypes, std::string> skill_use_types_map = {
@@ -194,7 +198,7 @@ const std::map<SkillUseTypes, std::string>& EQEmu::GetSkillUseTypesMap()
/* VS2012 code - begin */
static const char* skill_use_names[_EmuSkillCount] = {
static const char* skill_use_names[SkillCount] = {
"1H Blunt",
"1H Slashing",
"2H Blunt",
@@ -275,14 +279,160 @@ const std::map<SkillUseTypes, std::string>& EQEmu::GetSkillUseTypesMap()
"2H Piercing"
};
static std::map<SkillUseTypes, std::string> skill_use_types_map;
static std::map<SkillType, std::string> skill_type_map;
skill_use_types_map.clear();
skill_type_map.clear();
for (int i = Skill1HBlunt; i < _EmuSkillCount; ++i)
skill_use_types_map[(SkillUseTypes)i] = skill_use_names[i];
for (int i = Skill1HBlunt; i < SkillCount; ++i)
skill_type_map[(SkillType)i] = skill_use_names[i];
/* VS2012 code - end */
return skill_use_types_map;
return skill_type_map;
}
struct EQEmu::SkillProfile // prototype - not implemented
{
union {
struct {
uint32 _1HBlunt;
uint32 _1HSlashing;
uint32 _2HBlunt;
uint32 _2HSlashing;
uint32 Abjuration;
uint32 Alteration;
uint32 ApplyPoison;
uint32 Archery;
uint32 Backstab;
uint32 BindWound;
uint32 Bash;
uint32 Block;
uint32 BrassInstruments;
uint32 Channeling;
uint32 Conjuration;
uint32 Defense;
uint32 Disarm;
uint32 DisarmTraps;
uint32 Divination;
uint32 Dodge;
uint32 DoubleAttack;
union {
uint32 DragonPunch;
uint32 TailRake;
};
uint32 DualWield;
uint32 EagleStrike;
uint32 Evocation;
uint32 FeignDeath;
uint32 FlyingKick;
uint32 Forage;
uint32 HandtoHand;
uint32 Hide;
uint32 Kick;
uint32 Meditate;
uint32 Mend;
uint32 Offense;
uint32 Parry;
uint32 PickLock;
uint32 _1HPiercing;
uint32 Riposte;
uint32 RoundKick;
uint32 SafeFall;
uint32 SenseHeading;
uint32 Singing;
uint32 Sneak;
uint32 SpecializeAbjure;
uint32 SpecializeAlteration;
uint32 SpecializeConjuration;
uint32 SpecializeDivination;
uint32 SpecializeEvocation;
uint32 PickPockets;
uint32 StringedInstruments;
uint32 Swimming;
uint32 Throwing;
uint32 TigerClaw;
uint32 Tracking;
uint32 WindInstruments;
uint32 Fishing;
uint32 MakePoison;
uint32 Tinkering;
uint32 Research;
uint32 Alchemy;
uint32 Baking;
uint32 Tailoring;
uint32 SenseTraps;
uint32 Blacksmithing;
uint32 Fletching;
uint32 Brewing;
uint32 AlcoholTolerance;
uint32 Begging;
uint32 JewelryMaking;
uint32 Pottery;
uint32 PercussionInstruments;
uint32 Intimidation;
uint32 Berserking;
uint32 Taunt;
uint32 Frenzy;
uint32 RemoveTraps;
uint32 TripleAttack;
uint32 _2HPiercing;
uint32 unused1;
uint32 unused2;
uint32 unused3;
uint32 unused4;
uint32 unused5;
uint32 unused6;
uint32 unused7;
uint32 unused8;
uint32 unused9;
uint32 unused10;
uint32 unused11;
uint32 unused12;
uint32 unused13;
uint32 unused14;
uint32 unused15;
uint32 unused16;
uint32 unused17;
uint32 unused18;
uint32 unused19;
uint32 unused20;
uint32 unused21;
uint32 unused22;
};
uint32 skill[PACKET_SKILL_ARRAY_SIZE];
};
SkillProfile();
uint32* GetSkills() { return reinterpret_cast<uint32*>(&skill); }
skills::SkillType GetLastUseableSkill() { return EQEmu::skills::Skill2HPiercing; }
size_t GetSkillsArraySize() { return PACKET_SKILL_ARRAY_SIZE; }
uint32 GetSkill(int skill_id);
uint32 operator[](int skill_id) { return GetSkill(skill_id); }
// const
uint32* GetSkills() const { return const_cast<SkillProfile*>(this)->GetSkills(); }
skills::SkillType GetLastUseableSkill() const { return const_cast<SkillProfile*>(this)->GetLastUseableSkill(); }
size_t GetSkillsArraySize() const { return const_cast<SkillProfile*>(this)->GetSkillsArraySize(); }
uint32 GetSkill(int skill_id) const { return const_cast<SkillProfile*>(this)->GetSkill(skill_id); }
uint32 operator[](int skill_id) const { return const_cast<SkillProfile*>(this)->GetSkill(skill_id); }
};
EQEmu::SkillProfile::SkillProfile()
{
memset(&skill, 0, (sizeof(uint32) * PACKET_SKILL_ARRAY_SIZE));
}
uint32 EQEmu::SkillProfile::GetSkill(int skill_id)
{
if (skill_id < 0 || skill_id >= PACKET_SKILL_ARRAY_SIZE)
return 0;
return skill[skill_id];
}
+52 -65
View File
@@ -1,5 +1,6 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemulator.org)
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
@@ -9,25 +10,24 @@
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef SKILLS_H
#define SKILLS_H
#ifndef COMMON_SKILLS_H
#define COMMON_SKILLS_H
#include <string>
#include <map>
/*
** Skill use types
**
** (ref: eqstr_us.txt [05-10-2013])
*/
enum SkillUseTypes
namespace EQEmu
{
namespace skills {
enum SkillType : int {
/*13855*/ Skill1HBlunt = 0,
/*13856*/ Skill1HSlashing,
/*13857*/ Skill2HBlunt,
@@ -111,78 +111,65 @@ enum SkillUseTypes
// RoF2+ specific skills
/*00789*/ Skill2HPiercing, // 77
// /*01216*/ SkillNone, // This needs to move down as new skills are added
// /*01216*/ SkillNone, // This needs to move down as new skills are added
/*00000*/ _EmuSkillCount // move to last position of active enumeration labels
/*00000*/ SkillCount // move to last position of active enumeration labels
// Skill Counts
// /*-----*/ _SkillCount_62 = 75, // use for Ti and earlier max skill checks
// /*-----*/ _SkillCount_SoF = 77, // use for SoF thru RoF1 max skill checks
// /*-----*/ _SkillCount_RoF2 = 78, // use for RoF2 max skill checks
// /*-----*/ SkillCount_62 = 75, // use for Ti and earlier max skill checks
// /*-----*/ SkillCount_SoF = 77, // use for SoF thru RoF1 max skill checks
// /*-----*/ SkillCount_RoF2 = 78, // use for RoF2 max skill checks
// Support values
// /*-----*/ _SkillServerArraySize = _SkillCount_RoF2, // Should reflect last client '_SkillCount'
// /*-----*/ SkillServerArraySize = _SkillCount_RoF2, // Should reflect last client '_SkillCount'
// Superfluous additions to SkillUseTypes..server-use only
// /*-----*/ ExtSkillGenericTradeskill = 100
/* ([EQClientVersion] [0] - Unknown, [3] - SoF, [7] - RoF2[05-10-2013])
[Skill] [index] | [0] [1] [2] [3] [4] [5] [6] [7]
Frenzy (05837) | --- 074 074 074 074 074 074 074
Remove Traps (03670) | --- --- --- 075 075 075 075 075
Triple Attack (13049) | --- --- --- 076 076 076 076 076
2H Piercing (00789) | --- --- --- --- --- --- --- 077
*/
/* ([EQClientVersion] [0] - Unknown, [3] - SoF, [7] - RoF2[05-10-2013])
[Skill] [index] | [0] [1] [2] [3] [4] [5] [6] [7]
Frenzy (05837) | --- 074 074 074 074 074 074 074
Remove Traps (03670) | --- --- --- 075 075 075 075 075
Triple Attack (13049) | --- --- --- 076 076 076 076 076
2H Piercing (00789) | --- --- --- --- --- --- --- 077
*/
/*
[SkillCaps.txt] (SoF+)
a^b^c^d(^e) (^e is RoF+, but cursory glance appears to be all zeros)
/*
[SkillCaps.txt] (SoF+)
a^b^c^d(^e) (^e is RoF+, but cursory glance appears to be all zeros)
a - Class
b - Skill
c - Level
d - Max Value
(e - Unknown)
*/
a - Class
b - Skill
c - Level
d - Max Value
(e - Unknown)
*/
/*
NOTE: Disregard this until it is sorted out
/*
Changed (tradeskill==75) to ExtSkillGenericTradeskill in tradeskills.cpp for both instances. If it's a pseudo-enumeration of
an AA ability, then use the 'ExtSkill' ('ExtendedSkill') prefix with a value >= 100. (current implementation)
*/
};
I changed (tradeskill==75) to ExtSkillGenericTradeskill in tradeskills.cpp for both instances. If it's a pseudo-enumeration of
an AA ability, then use the 'ExtSkill' ('ExtendedSkill') prefix with a value >= 100. (current implementation)
We probably need to recode ALL of the skill checks to use the new Skill2HPiercing and ensure that the animation value is
properly changed in the patch files. As far as earlier clients using this new skill, it can be done, but we just need to ensure
that skill address is not inadvertently passed to the client..and we can just send an actual message for the skill-up. Use of a
command can tell the player what that particular skill value is.
Nothing on SkillTripleAttack just yet..haven't looked into its current implementation.
In addition to the above re-coding, we're probably going to need to rework the database pp blob to reserve space for the current
100-dword buffer allocation. This way, we can just add new ones without having to rework it each time.
(Wasn't done for this in particular..but, thanks Akkadius!)
-U
*/
};
// temporary until it can be sorted out...
// temporary until it can be sorted out...
#define HIGHEST_SKILL Skill2HPiercing
// Spell Effects use this value to determine if an effect applies to all skills.
// Spell Effects use this value to determine if an effect applies to all skills.
#define ALL_SKILLS -1
// server profile does not reflect this yet..so, prefixed with 'PACKET_'
// server profile does not reflect this yet..so, prefixed with 'PACKET_'
#define PACKET_SKILL_ARRAY_SIZE 100
extern bool IsTradeskill(SkillType skill);
extern bool IsSpecializedSkill(SkillType skill);
extern float GetSkillMeleePushForce(SkillType skill);
extern bool IsBardInstrumentSkill(SkillType skill);
// for skill related helper functions
namespace EQEmu {
bool IsTradeskill(SkillUseTypes skill);
bool IsSpecializedSkill(SkillUseTypes skill);
float GetSkillMeleePushForce(SkillUseTypes skill);
bool IsBardInstrumentSkill(SkillUseTypes skill);
extern const std::map<SkillType, std::string>& GetSkillTypeMap();
const std::map<SkillUseTypes, std::string>& GetSkillUseTypesMap();
}
} /*skills*/
#endif
struct SkillProfile;
} /*EQEmu*/
#endif /*COMMON_SKILLS_H*/
+1 -1
View File
@@ -681,7 +681,7 @@ struct SPDat_Spell_Struct
/* 086 */ int effectid[EFFECT_COUNT]; // Spell's effects
/* 098 */ SpellTargetType targettype; // Spell's Target
/* 099 */ int basediff; // base difficulty fizzle adjustment
/* 100 */ SkillUseTypes skill;
/* 100 */ EQEmu::skills::SkillType skill;
/* 101 */ int8 zonetype; // 01=Outdoors, 02=dungeons, ff=Any
/* 102 */ int8 EnvironmentType;
/* 103 */ int8 TimeOfDay;