Merge branch 'master' into web_interface

This commit is contained in:
KimLS
2014-07-20 12:25:17 -07:00
42 changed files with 1323 additions and 662 deletions
+2
View File
@@ -14,6 +14,7 @@ SET(common_sources
emu_opcodes.cpp
EmuTCPConnection.cpp
EmuTCPServer.cpp
eq_dictionary.cpp
EQDB.cpp
EQDBRes.cpp
eqemu_exception.cpp
@@ -111,6 +112,7 @@ SET(common_headers
EmuTCPConnection.h
EmuTCPServer.h
eq_constants.h
eq_dictionary.h
eq_packet_structs.h
EQDB.h
EQDBRes.h
+77 -77
View File
@@ -166,7 +166,7 @@ ItemInst* Inventory::GetItem(int16 slot_id) const
ItemInst* result = nullptr;
// Cursor
if (slot_id == SLOT_CURSOR) {
if (slot_id == MainCursor) {
// Cursor slot
result = m_cursor.peek_front();
}
@@ -258,7 +258,7 @@ int16 Inventory::PutItem(int16 slot_id, const ItemInst& inst)
int16 Inventory::PushCursor(const ItemInst& inst)
{
m_cursor.push(inst.Clone());
return SLOT_CURSOR;
return MainCursor;
}
// Swap items in inventory
@@ -332,7 +332,7 @@ ItemInst* Inventory::PopItem(int16 slot_id)
{
ItemInst* p = nullptr;
if (slot_id == SLOT_CURSOR) { // Cursor
if (slot_id == MainCursor) { // Cursor
p = m_cursor.pop();
}
else if ((slot_id >= 0 && slot_id <= 21) || (slot_id >= 400 && slot_id <= 404) || (slot_id == 9999)) { // Worn slots
@@ -469,7 +469,7 @@ bool Inventory::HasSpaceForItem(const Item_Struct *ItemToTry, int16 Quantity) {
//when quantity is greater than 1 and not all of quantity can be found in 1 stack.
int16 Inventory::HasItem(uint32 item_id, uint8 quantity, uint8 where)
{
int16 slot_id = SLOT_INVALID;
int16 slot_id = INVALID_INDEX;
//Altered by Father Nitwit to support a specification of
//where to search, with a default value to maintain compatibility
@@ -477,38 +477,38 @@ int16 Inventory::HasItem(uint32 item_id, uint8 quantity, uint8 where)
// Check each inventory bucket
if (where & invWhereWorn) {
slot_id = _HasItem(m_worn, item_id, quantity);
if (slot_id != SLOT_INVALID)
if (slot_id != INVALID_INDEX)
return slot_id;
}
if (where & invWherePersonal) {
slot_id = _HasItem(m_inv, item_id, quantity);
if (slot_id != SLOT_INVALID)
if (slot_id != INVALID_INDEX)
return slot_id;
}
if (where & invWhereBank) {
slot_id = _HasItem(m_bank, item_id, quantity);
if (slot_id != SLOT_INVALID)
if (slot_id != INVALID_INDEX)
return slot_id;
}
if (where & invWhereSharedBank) {
slot_id = _HasItem(m_shbank, item_id, quantity);
if (slot_id != SLOT_INVALID)
if (slot_id != INVALID_INDEX)
return slot_id;
}
if (where & invWhereTrading) {
slot_id = _HasItem(m_trade, item_id, quantity);
if (slot_id != SLOT_INVALID)
if (slot_id != INVALID_INDEX)
return slot_id;
}
if (where & invWhereCursor) {
// Check cursor queue
slot_id = _HasItem(m_cursor, item_id, quantity);
if (slot_id != SLOT_INVALID)
if (slot_id != INVALID_INDEX)
return slot_id;
}
@@ -518,43 +518,43 @@ int16 Inventory::HasItem(uint32 item_id, uint8 quantity, uint8 where)
//this function has the same quantity flaw mentioned above in HasItem()
int16 Inventory::HasItemByUse(uint8 use, uint8 quantity, uint8 where)
{
int16 slot_id = SLOT_INVALID;
int16 slot_id = INVALID_INDEX;
// Check each inventory bucket
if (where & invWhereWorn) {
slot_id = _HasItemByUse(m_worn, use, quantity);
if (slot_id != SLOT_INVALID)
if (slot_id != INVALID_INDEX)
return slot_id;
}
if (where & invWherePersonal) {
slot_id = _HasItemByUse(m_inv, use, quantity);
if (slot_id != SLOT_INVALID)
if (slot_id != INVALID_INDEX)
return slot_id;
}
if (where & invWhereBank) {
slot_id = _HasItemByUse(m_bank, use, quantity);
if (slot_id != SLOT_INVALID)
if (slot_id != INVALID_INDEX)
return slot_id;
}
if (where & invWhereSharedBank) {
slot_id = _HasItemByUse(m_shbank, use, quantity);
if (slot_id != SLOT_INVALID)
if (slot_id != INVALID_INDEX)
return slot_id;
}
if (where & invWhereTrading) {
slot_id = _HasItemByUse(m_trade, use, quantity);
if (slot_id != SLOT_INVALID)
if (slot_id != INVALID_INDEX)
return slot_id;
}
if (where & invWhereCursor) {
// Check cursor queue
slot_id = _HasItemByUse(m_cursor, use, quantity);
if (slot_id != SLOT_INVALID)
if (slot_id != INVALID_INDEX)
return slot_id;
}
@@ -563,43 +563,43 @@ int16 Inventory::HasItemByUse(uint8 use, uint8 quantity, uint8 where)
int16 Inventory::HasItemByLoreGroup(uint32 loregroup, uint8 where)
{
int16 slot_id = SLOT_INVALID;
int16 slot_id = INVALID_INDEX;
// Check each inventory bucket
if (where & invWhereWorn) {
slot_id = _HasItemByLoreGroup(m_worn, loregroup);
if (slot_id != SLOT_INVALID)
if (slot_id != INVALID_INDEX)
return slot_id;
}
if (where & invWherePersonal) {
slot_id = _HasItemByLoreGroup(m_inv, loregroup);
if (slot_id != SLOT_INVALID)
if (slot_id != INVALID_INDEX)
return slot_id;
}
if (where & invWhereBank) {
slot_id = _HasItemByLoreGroup(m_bank, loregroup);
if (slot_id != SLOT_INVALID)
if (slot_id != INVALID_INDEX)
return slot_id;
}
if (where & invWhereSharedBank) {
slot_id = _HasItemByLoreGroup(m_shbank, loregroup);
if (slot_id != SLOT_INVALID)
if (slot_id != INVALID_INDEX)
return slot_id;
}
if (where & invWhereTrading) {
slot_id = _HasItemByLoreGroup(m_trade, loregroup);
if (slot_id != SLOT_INVALID)
if (slot_id != INVALID_INDEX)
return slot_id;
}
if (where & invWhereCursor) {
// Check cursor queue
slot_id = _HasItemByLoreGroup(m_cursor, loregroup);
if (slot_id != SLOT_INVALID)
if (slot_id != INVALID_INDEX)
return slot_id;
}
@@ -644,21 +644,21 @@ int16 Inventory::FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size, boo
if (try_cursor)
// Always room on cursor (it's a queue)
// (we may wish to cap this in the future)
return SLOT_CURSOR;
return MainCursor;
// No available slots
return SLOT_INVALID;
return INVALID_INDEX;
}
// Opposite of below: Get parent bag slot_id from a slot inside of bag
int16 Inventory::CalcSlotId(int16 slot_id)
{
int16 parent_slot_id = SLOT_INVALID;
int16 parent_slot_id = INVALID_INDEX;
if (slot_id >= 251 && slot_id <= 330)
parent_slot_id = IDX_INV + (slot_id - 251) / MAX_ITEMS_PER_BAG;
else if (slot_id >= 331 && slot_id <= 340)
parent_slot_id = SLOT_CURSOR;
parent_slot_id = MainCursor;
else if (slot_id >= 2000 && slot_id <= 2023)
parent_slot_id = IDX_BANK + (slot_id - 2000) / MAX_ITEMS_PER_BAG;
else if (slot_id >= 2031 && slot_id <= 2270)
@@ -675,12 +675,12 @@ int16 Inventory::CalcSlotId(int16 slot_id)
int16 Inventory::CalcSlotId(int16 bagslot_id, uint8 bagidx)
{
if (!Inventory::SupportsContainers(bagslot_id)) {
return SLOT_INVALID;
return INVALID_INDEX;
}
int16 slot_id = SLOT_INVALID;
int16 slot_id = INVALID_INDEX;
if (bagslot_id == SLOT_CURSOR || bagslot_id == 8000) // Cursor
if (bagslot_id == MainCursor || bagslot_id == 8000) // Cursor
slot_id = IDX_CURSOR_BAG + bagidx;
else if (bagslot_id >= 22 && bagslot_id <= 29) // Inventory slots
slot_id = IDX_INV_BAG + (bagslot_id - 22)*MAX_ITEMS_PER_BAG + bagidx;
@@ -721,25 +721,25 @@ int16 Inventory::CalcSlotFromMaterial(uint8 material)
switch (material)
{
case MaterialHead:
return SLOT_HEAD;
return MainHead;
case MaterialChest:
return SLOT_CHEST;
return MainChest;
case MaterialArms:
return SLOT_ARMS;
return MainArms;
case MaterialWrist:
return SLOT_BRACER01; // there's 2 bracers, only one bracer material
return MainWrist1; // there's 2 bracers, only one bracer material
case MaterialHands:
return SLOT_HANDS;
return MainHands;
case MaterialLegs:
return SLOT_LEGS;
return MainLegs;
case MaterialFeet:
return SLOT_FEET;
return MainFeet;
case MaterialPrimary:
return SLOT_PRIMARY;
return MainPrimary;
case MaterialSecondary:
return SLOT_SECONDARY;
return MainSecondary;
default:
return SLOT_INVALID;
return INVALID_INDEX;
}
}
@@ -747,24 +747,24 @@ uint8 Inventory::CalcMaterialFromSlot(int16 equipslot)
{
switch (equipslot)
{
case SLOT_HEAD:
case MainHead:
return MaterialHead;
case SLOT_CHEST:
case MainChest:
return MaterialChest;
case SLOT_ARMS:
case MainArms:
return MaterialArms;
case SLOT_BRACER01:
case SLOT_BRACER02:
case MainWrist1:
//case SLOT_BRACER02: // non-live behavior
return MaterialWrist;
case SLOT_HANDS:
case MainHands:
return MaterialHands;
case SLOT_LEGS:
case MainLegs:
return MaterialLegs;
case SLOT_FEET:
case MainFeet:
return MaterialFeet;
case SLOT_PRIMARY:
case MainPrimary:
return MaterialPrimary;
case SLOT_SECONDARY:
case MainSecondary:
return MaterialSecondary;
default:
return _MaterialInvalid;
@@ -790,7 +790,7 @@ bool Inventory::SupportsContainers(int16 slot_id)
if ((slot_id >= 22 && slot_id <= 30) || // Personal inventory slots
(slot_id >= 2000 && slot_id <= 2023) || // Bank slots
(slot_id >= 2500 && slot_id <= 2501) || // Shared bank slots
(slot_id == SLOT_CURSOR) || // Cursor
(slot_id == MainCursor) || // Cursor
(slot_id >= 3000 && slot_id <= 3007)) // Trade window
return true;
return false;
@@ -826,7 +826,7 @@ int Inventory::GetSlotByItemInst(ItemInst *inst) {
}
if (m_cursor.peek_front() == inst) {
return SLOT_CURSOR;
return MainCursor;
}
return -1;
@@ -944,9 +944,9 @@ int16 Inventory::_PutItem(int16 slot_id, ItemInst* inst)
return slot_id;
}
int16 result = SLOT_INVALID;
int16 result = INVALID_INDEX;
if (slot_id == SLOT_CURSOR) { // Cursor
if (slot_id == MainCursor) { // Cursor
// Replace current item on cursor, if exists
m_cursor.pop(); // no memory delete, clients of this function know what they are doing
m_cursor.push_front(inst);
@@ -981,7 +981,7 @@ int16 Inventory::_PutItem(int16 slot_id, ItemInst* inst)
}
}
if (result == SLOT_INVALID) {
if (result == INVALID_INDEX) {
LogFile->write(EQEMuLog::Error, "Inventory::_PutItem: Invalid slot_id specified (%i)", slot_id);
Inventory::MarkDirty(inst); // Slot not found, clean up
}
@@ -1007,7 +1007,7 @@ int16 Inventory::_HasItem(std::map<int16, ItemInst*>& bucket, uint32 item_id, ui
return it->first;
}
for (int i = 0; i < MAX_AUGMENT_SLOTS; i++) {
for (int i = 0; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
if (inst->GetAugmentItemID(i) == item_id && quantity <= 1)
return SLOT_AUGMENT; // Only one augment per slot.
}
@@ -1022,7 +1022,7 @@ int16 Inventory::_HasItem(std::map<int16, ItemInst*>& bucket, uint32 item_id, ui
if (quantity_found >= quantity)
return Inventory::CalcSlotId(it->first, itb->first);
}
for (int i = 0; i < MAX_AUGMENT_SLOTS; i++) {
for (int i = 0; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
if (baginst->GetAugmentItemID(i) == item_id && quantity <= 1)
return SLOT_AUGMENT; // Only one augment per slot.
}
@@ -1031,7 +1031,7 @@ int16 Inventory::_HasItem(std::map<int16, ItemInst*>& bucket, uint32 item_id, ui
}
// Not found
return SLOT_INVALID;
return INVALID_INDEX;
}
// Internal Method: Checks an inventory queue type bucket for a particular item
@@ -1049,9 +1049,9 @@ int16 Inventory::_HasItem(ItemInstQueue& iqueue, uint32 item_id, uint8 quantity)
if (inst->GetID() == item_id) {
quantity_found += (inst->GetCharges() <= 0) ? 1 : inst->GetCharges();
if (quantity_found >= quantity)
return SLOT_CURSOR;
return MainCursor;
}
for (int i = 0; i < MAX_AUGMENT_SLOTS; i++) {
for (int i = 0; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
if (inst->GetAugmentItemID(i) == item_id && quantity <= 1)
return SLOT_AUGMENT; // Only one augment per slot.
}
@@ -1064,9 +1064,9 @@ int16 Inventory::_HasItem(ItemInstQueue& iqueue, uint32 item_id, uint8 quantity)
if (baginst->GetID() == item_id) {
quantity_found += (baginst->GetCharges() <= 0) ? 1 : baginst->GetCharges();
if (quantity_found >= quantity)
return Inventory::CalcSlotId(SLOT_CURSOR, itb->first);
return Inventory::CalcSlotId(MainCursor, itb->first);
}
for (int i = 0; i < MAX_AUGMENT_SLOTS; i++) {
for (int i = 0; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
if (baginst->GetAugmentItemID(i) == item_id && quantity <= 1)
return SLOT_AUGMENT; // Only one augment per slot.
}
@@ -1076,7 +1076,7 @@ int16 Inventory::_HasItem(ItemInstQueue& iqueue, uint32 item_id, uint8 quantity)
}
// Not found
return SLOT_INVALID;
return INVALID_INDEX;
}
// Internal Method: Checks an inventory bucket for a particular item
@@ -1111,7 +1111,7 @@ int16 Inventory::_HasItemByUse(std::map<int16, ItemInst*>& bucket, uint8 use, ui
}
// Not found
return SLOT_INVALID;
return INVALID_INDEX;
}
// Internal Method: Checks an inventory queue type bucket for a particular item
@@ -1127,7 +1127,7 @@ int16 Inventory::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, uint8 quantity)
if (inst && inst->IsType(ItemClassCommon) && inst->GetItem()->ItemType == use) {
quantity_found += (inst->GetCharges() <= 0) ? 1 : inst->GetCharges();
if (quantity_found >= quantity)
return SLOT_CURSOR;
return MainCursor;
}
// Go through bag, if bag
@@ -1138,14 +1138,14 @@ int16 Inventory::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, uint8 quantity)
if (baginst && baginst->IsType(ItemClassCommon) && baginst->GetItem()->ItemType == use) {
quantity_found += (baginst->GetCharges() <= 0) ? 1 : baginst->GetCharges();
if (quantity_found >= quantity)
return Inventory::CalcSlotId(SLOT_CURSOR, itb->first);
return Inventory::CalcSlotId(MainCursor, itb->first);
}
}
}
}
// Not found
return SLOT_INVALID;
return INVALID_INDEX;
}
int16 Inventory::_HasItemByLoreGroup(std::map<int16, ItemInst*>& bucket, uint32 loregroup)
@@ -1162,7 +1162,7 @@ int16 Inventory::_HasItemByLoreGroup(std::map<int16, ItemInst*>& bucket, uint32
return it->first;
ItemInst* Aug;
for (int i = 0; i < MAX_AUGMENT_SLOTS; i++) {
for (int i = 0; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
Aug = inst->GetAugment(i);
if (Aug && Aug->GetItem()->LoreGroup == loregroup)
return SLOT_AUGMENT; // Only one augment per slot.
@@ -1177,7 +1177,7 @@ int16 Inventory::_HasItemByLoreGroup(std::map<int16, ItemInst*>& bucket, uint32
return Inventory::CalcSlotId(it->first, itb->first);
ItemInst* Aug2;
for (int i = 0; i < MAX_AUGMENT_SLOTS; i++) {
for (int i = 0; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
Aug2 = baginst->GetAugment(i);
if (Aug2 && Aug2->GetItem()->LoreGroup == loregroup)
return SLOT_AUGMENT; // Only one augment per slot.
@@ -1187,7 +1187,7 @@ int16 Inventory::_HasItemByLoreGroup(std::map<int16, ItemInst*>& bucket, uint32
}
// Not found
return SLOT_INVALID;
return INVALID_INDEX;
}
// Internal Method: Checks an inventory queue type bucket for a particular item
@@ -1202,10 +1202,10 @@ int16 Inventory::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup)
if (inst)
{
if (inst->GetItem()->LoreGroup == loregroup)
return SLOT_CURSOR;
return MainCursor;
ItemInst* Aug;
for (int i = 0; i < MAX_AUGMENT_SLOTS; i++) {
for (int i = 0; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
Aug = inst->GetAugment(i);
if (Aug && Aug->GetItem()->LoreGroup == loregroup)
return SLOT_AUGMENT; // Only one augment per slot.
@@ -1217,11 +1217,11 @@ int16 Inventory::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup)
for (itb = inst->_begin(); itb != inst->_end(); ++itb) {
ItemInst* baginst = itb->second;
if (baginst && baginst->IsType(ItemClassCommon) && baginst->GetItem()->LoreGroup == loregroup)
return Inventory::CalcSlotId(SLOT_CURSOR, itb->first);
return Inventory::CalcSlotId(MainCursor, itb->first);
ItemInst* Aug2;
for (int i = 0; i < MAX_AUGMENT_SLOTS; i++) {
for (int i = 0; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
Aug2 = baginst->GetAugment(i);
if (Aug2 && Aug2->GetItem()->LoreGroup == loregroup)
return SLOT_AUGMENT; // Only one augment per slot.
@@ -1232,7 +1232,7 @@ int16 Inventory::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup)
}
// Not found
return SLOT_INVALID;
return INVALID_INDEX;
}
@@ -1656,7 +1656,7 @@ ItemInst* ItemInst::RemoveAugment(uint8 index)
bool ItemInst::IsAugmented()
{
for (int i = 0; i < MAX_AUGMENT_SLOTS; ++i)
for (int i = 0; i < EmuConstants::ITEM_COMMON_SIZE; ++i)
if (GetAugmentItemID(i))
return true;
+38 -18
View File
@@ -1,27 +1,47 @@
#ifndef CLIENTVERSIONS_H
#define CLIENTVERSIONS_H
static const uint32 BIT_Client62 = 1;
static const uint32 BIT_Titanium = 2;
static const uint32 BIT_SoF = 4;
static const uint32 BIT_SoD = 8;
static const uint32 BIT_Underfoot = 16;
static const uint32 BIT_RoF = 32;
static const uint32 BIT_TitaniumAndEarlier = 3;
static const uint32 BIT_SoFAndLater = 0xFFFFFFFC;
static const uint32 BIT_SoDAndLater = 0xFFFFFFF8;
static const uint32 BIT_UnderfootAndLater = 0xFFFFFFF0;
static const uint32 BIT_RoFAndLater = 0xFFFFFFE0;
static const uint32 BIT_AllClients = 0xFFFFFFFF;
static const uint32 BIT_Client62 = 1;
static const uint32 BIT_Titanium = 2;
static const uint32 BIT_SoF = 4;
static const uint32 BIT_SoD = 8;
static const uint32 BIT_Underfoot = 16;
static const uint32 BIT_RoF = 32;
static const uint32 BIT_RoF2 = 64;
static const uint32 BIT_TitaniumAndEarlier = 0x00000003;
static const uint32 BIT_SoFAndLater = 0xFFFFFFFC;
static const uint32 BIT_SoDAndLater = 0xFFFFFFF8;
static const uint32 BIT_UnderfootAndLater = 0xFFFFFFF0;
static const uint32 BIT_RoFAndLater = 0xFFFFFFE0;
static const uint32 BIT_RoF2AndLater = 0xFFFFFFC0;
static const uint32 BIT_AllClients = 0xFFFFFFFF;
typedef enum {
EQClientUnknown = 0,
EQClient62,
EQClientTitanium,
EQClientSoF,
EQClientSoD,
EQClientUnderfoot,
EQClientRoF
EQClient62, // Build: 'Aug 4 2005 15:40:59'
EQClientTitanium, // Build: 'Oct 31 2005 10:33:37'
EQClientSoF, // Build: 'Sep 7 2007 09:11:49'
EQClientSoD, // Build: 'Dec 19 2008 15:22:49'
EQClientUnderfoot, // Build: 'Jun 8 2010 16:44:32'
EQClientRoF, // Build: 'Dec 10 2012 17:35:44'
EQClientRoF2, // Build: 'May 10 2013 23:30:08'
_EQClientCount, // place new clients before this point (preferably, in release/attribute order)
// Values below are not implemented, as yet...
// - RoF2 is added for convenience of implementor..creation client will need to be changed once that client is actually added
// - Code will be added to 'relieve' characters of any illegal inventory items based on their client version. This will
// oversee cheats and mis-placement of starting items whenever a client is loaded.
_EQCreationClient = EQClientRoF, // bump to latest client as new ones are added (make sure that db is updated accordingly)
EmuNPC = _EQClientCount,
EmuMerc,
EmuBot,
EmuPet,
_EmuClientCount // array size for EQLimits
} EQClientVersion;
#endif /* CLIENTVERSIONS_H */
+177 -64
View File
@@ -138,45 +138,86 @@ enum ItemUseTypes : uint8
};
/*
** Augmentation use types (in-work)
** Augmentation use type bitmasks (1-based)
**
** (ref: dbstr_us.txt)
**
*/
enum AugmentationUseTypes : uint32 {
AugTypeNone = 0, // not 100% sure on this...
AugTypeGeneralSingleStat, /*1^16^1 (General: Single Stat)^0*/
AugTypeGeneralMultipleStat, /*2^16^2 (General: Multiple Stat)^0*/
AugTypeGeneralSpellEffect, /*3^16^3 (General: Spell Effect)^0*/
AugTypeWeaponGeneral, /*4^16^4 (Weapon: General)^0*/
AugTypeWeaponElemDamage, /*5^16^5 (Weapon: Elem Damage)^0*/
AugTypeWeaponBaseDamage, /*6^16^6 (Weapon: Base Damage)^0*/
AugTypeGeneralGroup, /*7^16^7 (General: Group)^0*/
AugTypeGeneralRaid, /*8^16^8 (General: Raid)^0*/
AugTypeGeneralDragonsPoints, /*9^16^9 (General: Dragons Points)^0*/
AugTypeCraftedCommon, /*10^16^10 (Crafted: Common)^0*/
AugTypeCraftedGroup1, /*11^16^11 (Crafted: Group)^0*/
AugTypeCraftedRaid1, /*12^16^12 (Crafted: Raid)^0*/
AugTypeEnergeiacGroup, /*13^16^13 (Energeiac: Group)^0*/
AugTypeEnergeiacRaid, /*14^16^14 (Energeiac: Raid)^0*/
AugTypeEmblem, /*15^16^15 (Emblem)^0*/
AugTypeCraftedGroup2, /*16^16^16 (Crafted: Group)^0*/
AugTypeCraftedRaid2, /*17^16^17 (Crafted: Raid)^0*/
AugTypeUnknown1, /*18^16^18^0*/
AugTypeUnknown2, /*19^16^19^0*/
AugTypeOrnamentation, /*20^16^20 (Ornamentation)^0*/
AugTypeSpecialOrnamentation, /*21^16^21 (Special Ornamentation)^0*/
AugTypeUnknown3, /*22^16^22^0*/
AugTypeUnknown4, /*23^16^23^0*/
AugTypeUnknown5, /*24^16^24^0*/
AugTypeUnknown6, /*25^16^25^0*/
AugTypeUnknown7, /*26^16^26^0*/
AugTypeUnknown8, /*27^16^27^0*/
AugTypeUnknown9, /*28^16^28^0*/
AugTypeUnknown10, /*29^16^29^0*/
AugTypeEpic25, /*30^16^30^0*/
AugTypeTest, /*31^16^Test^0*/ // listed as 31^16^31^0 in 5-10 client
_AugTypeCount
enum AugmentationUseTypeBitmasks : uint32 {
AugUseNone = 0x00000000,
AugUseGeneralSingleStat = 0x00000001, /*1^16^1 (General: Single Stat)^0*/
AugUseGeneralMultipleStat = 0x00000002, /*2^16^2 (General: Multiple Stat)^0*/
AugUseGeneralSpellEffect = 0x00000004, /*3^16^3 (General: Spell Effect)^0*/
AugUseWeaponGeneral = 0x00000008, /*4^16^4 (Weapon: General)^0*/
AugUseWeaponElemDamage = 0x00000010, /*5^16^5 (Weapon: Elem Damage)^0*/
AugUseWeaponBaseDamage = 0x00000020, /*6^16^6 (Weapon: Base Damage)^0*/
AugUseGeneralGroup = 0x00000040, /*7^16^7 (General: Group)^0*/
AugUseGeneralRaid = 0x00000080, /*8^16^8 (General: Raid)^0*/
AugUseGeneralDragonsPoints = 0x00000100, /*9^16^9 (General: Dragons Points)^0*/
AugUseCraftedCommon = 0x00000200, /*10^16^10 (Crafted: Common)^0*/
AugUseCraftedGroup1 = 0x00000400, /*11^16^11 (Crafted: Group)^0*/
AugUseCraftedRaid1 = 0x00000800, /*12^16^12 (Crafted: Raid)^0*/
AugUseEnergeiacGroup = 0x00001000, /*13^16^13 (Energeiac: Group)^0*/
AugUseEnergeiacRaid = 0x00002000, /*14^16^14 (Energeiac: Raid)^0*/
AugUseEmblem = 0x00004000, /*15^16^15 (Emblem)^0*/
AugUseCraftedGroup2 = 0x00008000, /*16^16^16 (Crafted: Group)^0*/
AugUseCraftedRaid2 = 0x00010000, /*17^16^17 (Crafted: Raid)^0*/
AugUseUnknown1 = 0x00020000, /*18^16^18^0*/
AugUseUnknown2 = 0x00040000, /*19^16^19^0*/
AugUseOrnamentation = 0x00080000, /*20^16^20 (Ornamentation)^0*/
AugUseSpecialOrnamentation = 0x00100000, /*21^16^21 (Special Ornamentation)^0*/
AugUseUnknown3 = 0x00200000, /*22^16^22^0*/
AugUseUnknown4 = 0x00400000, /*23^16^23^0*/
AugUseUnknown5 = 0x00800000, /*24^16^24^0*/
AugUseUnknown6 = 0x01000000, /*25^16^25^0*/
AugUseUnknown7 = 0x02000000, /*26^16^26^0*/
AugUseUnknown8 = 0x04000000, /*27^16^27^0*/
AugUseUnknown9 = 0x08000000, /*28^16^28^0*/
AugUseUnknown10 = 0x10000000, /*29^16^29^0*/
AugUseEpic25 = 0x20000000, /*30^16^30^0*/
AugUseTest = 0x40000000, /*31^16^Test^0*/ // listed as 31^16^31^0 in 5-10 client
AugUseAll = 0xFFFFFFFF
};
/*
** Augmentation use types (enumerated)
**
*/
enum AugmentationUseTypes : uint8 {
AugTypeNone = 0,
AugTypeGeneralSingleStat,
AugTypeGeneralMultipleStat,
AugTypeGeneralSpellEffect,
AugTypeWeaponGeneral,
AugTypeWeaponElemDamage,
AugTypeWeaponBaseDamage,
AugTypeGeneralGroup,
AugTypeGeneralRaid,
AugTypeGeneralDragonsPoints,
AugTypeCraftedCommon,
AugTypeCraftedGroup1,
AugTypeCraftedRaid1,
AugTypeEnergeiacGroup,
AugTypeEnergeiacRaid,
AugTypeEmblem,
AugTypeCraftedGroup2,
AugTypeCraftedRaid2,
AugTypeUnknown1,
AugTypeUnknown2,
AugTypeOrnamentation,
AugTypeSpecialOrnamentation,
AugTypeUnknown3,
AugTypeUnknown4,
AugTypeUnknown5,
AugTypeUnknown6,
AugTypeUnknown7,
AugTypeUnknown8,
AugTypeUnknown9,
AugTypeUnknown10,
AugTypeEpic25,
AugTypeTest,
_AugTypeCount,
AugTypeAll = 255
};
/*
@@ -735,10 +776,11 @@ enum MaterialUseSlots : uint8
_MaterialInvalid = 255
};
/*
// Used for worn NPC inventory tracking. NPCs don't use
// augments, so only the basic slots need to be kept track of.
#define MAX_WORN_INVENTORY 22
*/
/*
** Inventory Slot Equipment Enum
@@ -768,42 +810,109 @@ enum MaterialUseSlots : uint8
**
*/
enum InventoryMapTypes : int16 {
MapPossessions = 0,
MapBank,
MapSharedBank,
MapTrade,
MapWorld,
MapLimbo,
MapTribute,
MapTrophyTribute,
MapGuildTribute,
MapMerchant,
MapDeleted,
MapCorpse,
MapBazaar,
MapInspect,
MapRealEstate,
MapViewMODPC,
MapViewMODBank,
MapViewMODSharedBank,
MapViewMODLimbo,
MapAltStorage,
MapArchived,
MapMail,
MapGuildTrophyTribute,
MapKrono,
MapOther,
_MapCount
};
enum InventoryMainTypes : int16 {
MainCharm = 0,
MainEar1,
MainHead,
MainFace,
MainEar2,
MainNeck,
MainShoulders,
MainArms,
MainBack,
MainWrist1,
MainWrist2,
MainRange,
MainHands,
MainPrimary,
MainSecondary,
MainFinger1,
MainFinger2,
MainChest,
MainLegs,
MainFeet,
MainWaist,
MainPowerSource = 9999, // temp
MainAmmo = 21, // temp
MainGeneral1,
MainGeneral2,
MainGeneral3,
MainGeneral4,
MainGeneral5,
MainGeneral6,
MainGeneral7,
MainGeneral8,
//MainGeneral9,
//MainGeneral10,
MainCursor //,
//_MainCount,
};
enum InventorySlot
{
////////////////////////
// Equip slots
////////////////////////
SLOT_CHARM = 0,
SLOT_EAR01 = 1,
SLOT_HEAD = 2,
SLOT_FACE = 3,
SLOT_EAR02 = 4,
SLOT_NECK = 5,
SLOT_SHOULDER = 6,
SLOT_ARMS = 7,
SLOT_BACK = 8,
SLOT_BRACER01 = 9,
SLOT_BRACER02 = 10,
SLOT_RANGE = 11,
SLOT_HANDS = 12,
SLOT_PRIMARY = 13,
SLOT_SECONDARY = 14,
SLOT_RING01 = 15,
SLOT_RING02 = 16,
SLOT_CHEST = 17,
SLOT_LEGS = 18,
SLOT_FEET = 19,
SLOT_WAIST = 20,
SLOT_AMMO = 21,
//SLOT_CHARM = 0,
//SLOT_EAR01 = 1,
//SLOT_HEAD = 2,
//SLOT_FACE = 3,
//SLOT_EAR02 = 4,
//SLOT_NECK = 5,
//SLOT_SHOULDER = 6,
//SLOT_ARMS = 7,
//SLOT_BACK = 8,
//SLOT_BRACER01 = 9,
//SLOT_BRACER02 = 10,
//SLOT_RANGE = 11,
//SLOT_HANDS = 12,
//SLOT_PRIMARY = 13,
//SLOT_SECONDARY = 14,
//SLOT_RING01 = 15,
//SLOT_RING02 = 16,
//SLOT_CHEST = 17,
//SLOT_LEGS = 18,
//SLOT_FEET = 19,
//SLOT_WAIST = 20,
//SLOT_AMMO = 21,
////////////////////////
// All other slots
////////////////////////
SLOT_PERSONAL_BEGIN = 22,
SLOT_PERSONAL_END = 29,
//SLOT_PERSONAL_BEGIN = 22,
//SLOT_PERSONAL_END = 29,
SLOT_CURSOR = 30,
//SLOT_CURSOR = 30,
SLOT_CURSOR_END = (int16)0xFFFE, // Last item on cursor queue
// Cursor bag slots are 331->340 (10 slots)
@@ -830,11 +939,15 @@ enum InventorySlot
// Slot used in OP_TradeSkillCombine for world tradeskill containers
SLOT_TRADESKILL = 1000,
SLOT_AUGMENT = 1001,
SLOT_POWER_SOURCE = 9999,
SLOT_AUGMENT = 1001//,
//SLOT_POWER_SOURCE = 9999//,
// Value recognized by client for destroying an item
SLOT_INVALID = (int16)0xFFFF
//SLOT_INVALID = (int16)0xFFFF
};
#define INVALID_INDEX -1
#define NOT_USED 0
#define NO_ITEM 0
#endif
+363
View File
@@ -0,0 +1,363 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2003 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
*/
#include "eq_dictionary.h"
//
// class ServerConstants
//
uint16 EmuConstants::InventoryMapSize(int16 map) {
switch (map) {
case MapPossessions:
return MAP_POSSESSIONS_SIZE;
case MapBank:
return MAP_BANK_SIZE;
case MapSharedBank:
return MAP_SHAREDBANK_SIZE;
case MapTrade:
return MAP_TRADE_SIZE;
case MapWorld:
return MAP_WORLD_SIZE;
case MapLimbo:
return MAP_LIMBO_SIZE;
case MapTribute:
return MAP_TRIBUTE_SIZE;
case MapTrophyTribute:
return MAP_TROPHYTRIBUTE_SIZE;
case MapGuildTribute:
return MAP_GUILDTRIBUTE_SIZE;
case MapMerchant:
return MAP_MERCHANT_SIZE;
case MapDeleted:
return MAP_DELETED_SIZE;
case MapCorpse:
return MAP_CORPSE_SIZE;
case MapBazaar:
return MAP_BAZAAR_SIZE;
case MapInspect:
return MAP_INSPECT_SIZE;
case MapRealEstate:
return MAP_REALESTATE_SIZE;
case MapViewMODPC:
return MAP_VIEWMODPC_SIZE;
case MapViewMODBank:
return MAP_VIEWMODBANK_SIZE;
case MapViewMODSharedBank:
return MAP_VIEWMODSHAREDBANK_SIZE;
case MapViewMODLimbo:
return MAP_VIEWMODLIMBO_SIZE;
case MapAltStorage:
return MAP_ALTSTORAGE_SIZE;
case MapArchived:
return MAP_ARCHIVED_SIZE;
case MapMail:
return MAP_MAIL_SIZE;
case MapGuildTrophyTribute:
return MAP_GUILDTROPHYTRIBUTE_SIZE;
case MapKrono:
return MAP_KRONO_SIZE;
case MapOther:
return MAP_OTHER_SIZE;
default:
return NOT_USED;
}
}
//
// class ClientLimits
//
// client validation
bool EQLimits::IsValidClientVersion(uint32 version) {
if (version < _EQClientCount)
return true;
return false;
}
uint32 EQLimits::ValidateClientVersion(uint32 version) {
if (version < _EQClientCount)
return version;
return EQClientUnknown;
}
EQClientVersion EQLimits::ValidateClientVersion(EQClientVersion version) {
if (version >= EQClientUnknown)
if (version < _EQClientCount)
return version;
return EQClientUnknown;
}
// npc validation
bool EQLimits::IsValidNPCVersion(uint32 version) {
if (version >= _EQClientCount)
if (version < _EmuClientCount)
return true;
return false;
}
uint32 EQLimits::ValidateNPCVersion(uint32 version) {
if (version >= _EQClientCount)
if (version < _EmuClientCount)
return version;
return EQClientUnknown;
}
EQClientVersion EQLimits::ValidateNPCVersion(EQClientVersion version) {
if (version >= _EQClientCount)
if (version < _EmuClientCount)
return version;
return EQClientUnknown;
}
// mob validation
bool EQLimits::IsValidMobVersion(uint32 version) {
if (version < _EmuClientCount)
return true;
return false;
}
uint32 EQLimits::ValidateMobVersion(uint32 version) {
if (version < _EmuClientCount)
return version;
return EQClientUnknown;
}
EQClientVersion EQLimits::ValidateMobVersion(EQClientVersion version) {
if (version >= EQClientUnknown)
if (version < _EmuClientCount)
return version;
return EQClientUnknown;
}
// inventory
uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) {
// not all maps will have an instantiated container..some are references for queue generators (i.e., bazaar, mail, etc...)
// a zero '0' indicates a needed value..otherwise, change to '_NOTUSED' for a null value so indices requiring research can be identified
// ALL of these values need to be verified before pushing to live
//
// make sure that you transcribe the actual value from 'defaults' to here before updating or client crashes will ensue..and/or...
// insert older clients inside of the progression of client order
static const uint16 local[_MapCount][_EmuClientCount] = {
/* { Unknown, 62, Titanium, SoF, SoD, Underfoot, RoF, RoF2, NPC, Merc, Bot, Pet }*/
{ NOT_USED, 34, 34, 34, 34, 34, EmuConstants::MAP_POSSESSIONS_SIZE, 0, 0, 0, 0, 0 }, // (requires bitmask use...)
{ NOT_USED, 16, 16, 24, 24, 24, EmuConstants::MAP_BANK_SIZE, 0, 0, 0, 0, 0 },
{ NOT_USED, 2, 2, 2, 2, 2, EmuConstants::MAP_SHAREDBANK_SIZE, 0, 0, 0, 0, 0 },
{ NOT_USED, 8, 8, 8, 8, 8, EmuConstants::MAP_TRADE_SIZE, 0, 0, 0, 0, 0 },
{ NOT_USED, 10, 10, 10, 10, 10, EmuConstants::MAP_WORLD_SIZE, 0, 0, 0, 0, 0 },
{ NOT_USED, 36, 36, 36, 36, 36, EmuConstants::MAP_LIMBO_SIZE, 0, 0, 0, 0, 0 },
{ NOT_USED, 0, 0, 0, 0, 0, EmuConstants::MAP_TRIBUTE_SIZE, 0, 0, 0, 0, 0 },
{ NOT_USED, 0, 0, 0, 0, 0, EmuConstants::MAP_TROPHYTRIBUTE_SIZE, 0, 0, 0, 0, 0 },
{ NOT_USED, 0, 0, 0, 0, 0, EmuConstants::MAP_GUILDTRIBUTE_SIZE, 0, 0, 0, 0, 0 },
{ NOT_USED, 0, 0, 0, 0, 0, EmuConstants::MAP_MERCHANT_SIZE, 0, 0, 0, 0, 0 },
{ NOT_USED, 0, 0, 0, 0, 0, EmuConstants::MAP_DELETED_SIZE, 0, 0, 0, 0, 0 },
{ NOT_USED, 0, 0, 0, 0, 34, EmuConstants::MAP_CORPSE_SIZE, 0, 0, 0, 0, 0 },
{ NOT_USED, 0, 0, 0, 0, 80, EmuConstants::MAP_BAZAAR_SIZE, 0, 0, 0, 0, 0 },
{ NOT_USED, 0, 0, 0, 0, 0, EmuConstants::MAP_INSPECT_SIZE, 0, 0, 0, 0, 0 },
{ NOT_USED, 0, 0, 0, 0, 0, EmuConstants::MAP_REALESTATE_SIZE, 0, 0, 0, 0, 0 },
{ NOT_USED, 0, 0, 0, 0, 0, EmuConstants::MAP_VIEWMODPC_SIZE, 0, 0, 0, 0, 0 },
{ NOT_USED, 0, 0, 0, 0, 0, EmuConstants::MAP_VIEWMODBANK_SIZE, 0, 0, 0, 0, 0 },
{ NOT_USED, 0, 0, 0, 0, 0, EmuConstants::MAP_VIEWMODSHAREDBANK_SIZE, 0, 0, 0, 0, 0 },
{ NOT_USED, 0, 0, 0, 0, 0, EmuConstants::MAP_VIEWMODLIMBO_SIZE, 0, 0, 0, 0, 0 },
{ NOT_USED, 0, 0, 0, 0, 0, EmuConstants::MAP_ALTSTORAGE_SIZE, 0, 0, 0, 0, 0 },
{ NOT_USED, 0, 0, 0, 0, 0, EmuConstants::MAP_ARCHIVED_SIZE, 0, 0, 0, 0, 0 },
{ NOT_USED, 0, 0, 0, 0, 0, EmuConstants::MAP_MAIL_SIZE, 0, 0, 0, 0, 0 },
{ NOT_USED, 0, 0, 0, 0, 0, EmuConstants::MAP_GUILDTROPHYTRIBUTE_SIZE, 0, 0, 0, 0, 0 },
{ NOT_USED, NOT_USED, NOT_USED, NOT_USED, NOT_USED, NOT_USED, EmuConstants::MAP_KRONO_SIZE, 0, 0, 0, 0, 0 }, // (will be implemented in RoF2)
{ NOT_USED, 0, 0, 0, 0, 0, EmuConstants::MAP_OTHER_SIZE, 0, 0, 0, 0, 0 }
};
if ((uint16)map < _MapCount)
return local[map][ValidateMobVersion(version)];
return NOT_USED;
}
uint64 EQLimits::PossessionsBitmask(uint32 version) {
// these are for the new inventory system..not the current one...
// 0x0000000000200000 is SlotPowerSource (SoF+)
// 0x0000000100000000 is SlotGeneral9 (RoF+)
// 0x0000000200000000 is SlotGeneral10 (RoF+)
static const uint64 local[_EmuClientCount] = {
/*Unknown*/ NOT_USED,
/*62*/ 0x000000027FDFFFFF,
/*Titanium*/ 0x000000027FDFFFFF,
/*SoF*/ 0x000000027FFFFFFF,
/*SoD*/ 0x000000027FFFFFFF,
/*Underfoot*/ 0x000000027FFFFFFF,
/*RoF*/ 0x00000003FFFFFFFF,
/*RoF2*/ 0,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
};
return local[ValidateMobVersion(version)];
}
uint64 EQLimits::EquipmentBitmask(uint32 version) {
static const uint64 local[_EmuClientCount] = {
/*Unknown*/ NOT_USED,
/*62*/ 0x00000000005FFFFF,
/*Titanium*/ 0x00000000005FFFFF,
/*SoF*/ 0x00000000007FFFFF,
/*SoD*/ 0x00000000007FFFFF,
/*Underfoot*/ 0x00000000007FFFFF,
/*RoF*/ 0x00000000007FFFFF,
/*RoF2*/ 0,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
};
return local[ValidateMobVersion(version)];
}
uint64 EQLimits::GeneralBitmask(uint32 version) {
static const uint64 local[_EmuClientCount] = {
/*Unknown*/ NOT_USED,
/*62*/ 0x000000007F800000,
/*Titanium*/ 0x000000007F800000,
/*SoF*/ 0x000000007F800000,
/*SoD*/ 0x000000007F800000,
/*Underfoot*/ 0x000000007F800000,
/*RoF*/ 0x00000001FF800000,
/*RoF2*/ 0,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
};
return local[ValidateMobVersion(version)];
}
uint64 EQLimits::CursorBitmask(uint32 version) {
static const uint64 local[_EmuClientCount] = {
/*Unknown*/ NOT_USED,
/*62*/ 0x0000000200000000,
/*Titanium*/ 0x0000000200000000,
/*SoF*/ 0x0000000200000000,
/*SoD*/ 0x0000000200000000,
/*Underfoot*/ 0x0000000200000000,
/*RoF*/ 0x0000000200000000,
/*RoF2*/ 0,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
};
return local[ValidateMobVersion(version)];
}
bool EQLimits::AllowsEmptyBagInBag(uint32 version) {
static const bool local[_EmuClientCount] = {
/*Unknown*/ false,
/*62*/ false,
/*Titanium*/ false,
/*SoF*/ false,
/*SoD*/ false,
/*Underfoot*/ false,
/*RoF*/ true,
/*RoF2*/ true,
/*NPC*/ true,
/*Merc*/ true,
/*Bot*/ true,
/*Pet*/ true
};
return local[ValidateMobVersion(version)];
}
// items
uint16 EQLimits::ItemCommonSize(uint32 version) {
static const uint16 local[_EmuClientCount] = {
/*Unknown*/ NOT_USED,
/*62*/ 5,
/*Titanium*/ 5,
/*SoF*/ 5,
/*SoD*/ 5,
/*Underfoot*/ 5,
/*RoF*/ EmuConstants::ITEM_COMMON_SIZE,
/*RoF2*/ 0,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
};
return local[ValidateMobVersion(version)];
}
uint16 EQLimits::ItemContainerSize(uint32 version) {
static const uint16 local[_EmuClientCount] = {
/*Unknown*/ NOT_USED,
/*62*/ 10,
/*Titanium*/ 10,
/*SoF*/ 10,
/*SoD*/ 10,
/*Underfoot*/ 10,
/*RoF*/ EmuConstants::ITEM_CONTAINER_SIZE,
/*RoF2*/ 0,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
};
return local[ValidateMobVersion(version)];
}
bool EQLimits::CoinHasWeight(uint32 version) {
static const bool local[_EmuClientCount] = {
/*Unknown*/ true,
/*62*/ true,
/*Titanium*/ true,
/*SoF*/ true,
/*SoD*/ false,
/*Underfoot*/ false,
/*RoF*/ false,
/*RoF2*/ false,
/*NPC*/ false,
/*Merc*/ false,
/*Bot*/ false,
/*Pet*/ false
};
return local[ValidateMobVersion(version)];
}
+118
View File
@@ -0,0 +1,118 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2003 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 EQ_DICTIONARY_H
#define EQ_DICTIONARY_H
#include "types.h"
#include "eq_constants.h"
#include "clientversions.h"
// an immutable value is required to initialize arrays, etc... use this class as a repository for those
typedef class {
public:
// database
static const EQClientVersion CHARACTER_CREATION_CLIENT = _EQCreationClient;
// inventory
static uint16 InventoryMapSize(int16 map);
static const uint16 MAP_POSSESSIONS_SIZE = 22; //_SlotCount;
static const uint16 MAP_BANK_SIZE = 24;
static const uint16 MAP_SHAREDBANK_SIZE = 2;
static const uint16 MAP_TRADE_SIZE = 8;
static const uint16 MAP_WORLD_SIZE = 10;
static const uint16 MAP_LIMBO_SIZE = 36;
static const uint16 MAP_TRIBUTE_SIZE = 5;
static const uint16 MAP_TROPHYTRIBUTE_SIZE = 0;
static const uint16 MAP_GUILDTRIBUTE_SIZE = 0;
static const uint16 MAP_MERCHANT_SIZE = 0;
static const uint16 MAP_DELETED_SIZE = 0;
static const uint16 MAP_CORPSE_SIZE = 22; //_SlotCount; // actual code still needs lots of work...
static const uint16 MAP_BAZAAR_SIZE = 80; //200;
static const uint16 MAP_INSPECT_SIZE = 22; //_SlotEquipmentCount;
static const uint16 MAP_REALESTATE_SIZE = 0;
static const uint16 MAP_VIEWMODPC_SIZE = NOT_USED;
static const uint16 MAP_VIEWMODBANK_SIZE = NOT_USED;
static const uint16 MAP_VIEWMODSHAREDBANK_SIZE = NOT_USED;
static const uint16 MAP_VIEWMODLIMBO_SIZE = NOT_USED;
static const uint16 MAP_ALTSTORAGE_SIZE = 0;
static const uint16 MAP_ARCHIVED_SIZE = 0;
static const uint16 MAP_MAIL_SIZE = 0;
static const uint16 MAP_GUILDTROPHYTRIBUTE_SIZE = 0;
static const uint16 MAP_KRONO_SIZE = 0; // this will be '1' when RoF2 is implemented
static const uint16 MAP_OTHER_SIZE = 0;
//static const int16 EQUIPMENT_BEGIN = _SlotEquipmentBegin;
//static const int16 EQUIPMENT_END = _SlotEquipmentEnd;
static const uint16 EQUIPMENT_SIZE = 22; //_SlotEquipmentCount; // not ready for client usage..only equipment arrays for npcs...
static const int16 GENERAL_BEGIN = 22; //_SlotGeneralBegin;
static const int16 GENERAL_END = 29; //_SlotGeneralEnd;
static const uint16 GENERAL_SIZE = 8; //_SlotGeneralCount;
// items
static const uint16 ITEM_COMMON_SIZE = 5;
static const uint16 ITEM_CONTAINER_SIZE = 10;
// player profile
//static const uint32 CLASS_BITMASK = 0; // needs value
//static const uint32 RACE_BITMASK = 0; // needs value
// TODO: resolve naming convention and use for bandolier count versus size
//static const uint32 BANDOLIER_COUNT = 4;
static const uint32 BANDOLIER_SIZE = 4;
static const uint32 POTION_BELT_SIZE = 5;
} EmuConstants;
typedef class {
public:
// client version validation (checks to avoid crashing zone server when accessing reference arrays)
// use this inside of class Client (limits to actual clients)
static bool IsValidClientVersion(uint32 version);
static uint32 ValidateClientVersion(uint32 version);
static EQClientVersion ValidateClientVersion(EQClientVersion version);
// basically..any non-client classes - do not when setting a valid client
static bool IsValidNPCVersion(uint32 version);
static uint32 ValidateNPCVersion(uint32 version);
static EQClientVersion ValidateNPCVersion(EQClientVersion version);
// these are 'universal' - do not when setting a valid client
static bool IsValidMobVersion(uint32 version);
static uint32 ValidateMobVersion(uint32 version);
static EQClientVersion ValidateMobVersion(EQClientVersion version);
// inventory
static uint16 InventoryMapSize(int16 map, uint32 version);
static uint64 PossessionsBitmask(uint32 version);
static uint64 EquipmentBitmask(uint32 version);
static uint64 GeneralBitmask(uint32 version);
static uint64 CursorBitmask(uint32 version);
static bool AllowsEmptyBagInBag(uint32 version);
// items
static uint16 ItemCommonSize(uint32 version);
static uint16 ItemContainerSize(uint32 version);
// player profile
static bool CoinHasWeight(uint32 version);
} EQLimits;
#endif /* EQ_LIMITS_H */
+2 -1
View File
@@ -32,7 +32,8 @@ static const uint32 MAX_MERC_GRADES = 10;
static const uint32 MAX_MERC_STANCES = 10;
static const uint32 BLOCKED_BUFF_COUNT = 20;
#include "eq_constants.h"
//#include "eq_constants.h"
#include "eq_dictionary.h"
/*
** Compiler override to ensure
+7 -5
View File
@@ -42,7 +42,8 @@
* Made ya look! Ha!
*/
#include "eq_constants.h"
//#include "eq_constants.h"
#include "eq_dictionary.h"
/*
** Child struct of Item_Struct:
@@ -68,7 +69,8 @@ struct InternalSerializedItem_Struct {
const void * inst;
};
#define MAX_AUGMENT_SLOTS 5
// use EmuConstants::ITEM_COMMON_SIZE
//#define MAX_AUGMENT_SLOTS 5
struct Item_Struct {
bool IsEquipable(uint16 Race, uint16 Class) const;
@@ -180,9 +182,9 @@ struct Item_Struct {
int32 FactionAmt4; // Faction Amt 4
char CharmFile[32]; // ?
uint32 AugType;
uint8 AugSlotType[MAX_AUGMENT_SLOTS]; // LDoN: Augment Slot 1-5 Type
uint8 AugSlotVisible[MAX_AUGMENT_SLOTS]; // LDoN: Augment Slot 1-5 Visible
uint8 AugSlotUnk2[MAX_AUGMENT_SLOTS]; // LDoN: Augment Slot 1-5 Unknown
uint8 AugSlotType[EmuConstants::ITEM_COMMON_SIZE]; // LDoN: Augment Slot 1-5 Type
uint8 AugSlotVisible[EmuConstants::ITEM_COMMON_SIZE]; // LDoN: Augment Slot 1-5 Visible
uint8 AugSlotUnk2[EmuConstants::ITEM_COMMON_SIZE]; // LDoN: Augment Slot 1-5 Unknown
uint32 LDoNTheme;
uint32 LDoNPrice;
uint32 LDoNSold;
+6 -6
View File
@@ -439,7 +439,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) {
const Item_Struct* item = GetItem(item_id);
if (item) {
int16 put_slot_id = SLOT_INVALID;
int16 put_slot_id = INVALID_INDEX;
ItemInst* inst = CreateBaseItem(item, charges);
if (item->ItemClass == ItemClassCommon) {
@@ -479,7 +479,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) {
safe_delete(inst);
// Save ptr to item in inventory
if (put_slot_id == SLOT_INVALID) {
if (put_slot_id == INVALID_INDEX) {
LogFile->write(EQEMuLog::Error,
"Warning: Invalid slot_id for item in shared bank inventory: %s=%i, item_id=%i, slot_id=%i",
((is_charid==true) ? "charid" : "acctid"), id, item_id, slot_id);
@@ -535,7 +535,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) {
const Item_Struct* item = GetItem(item_id);
if (item) {
int16 put_slot_id = SLOT_INVALID;
int16 put_slot_id = INVALID_INDEX;
ItemInst* inst = CreateBaseItem(item, charges);
@@ -589,7 +589,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) {
safe_delete(inst);
// Save ptr to item in inventory
if (put_slot_id == SLOT_INVALID) {
if (put_slot_id == INVALID_INDEX) {
LogFile->write(EQEMuLog::Error,
"Warning: Invalid slot_id for item in inventory: charid=%i, item_id=%i, slot_id=%i",
char_id, item_id, slot_id);
@@ -641,7 +641,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv)
aug[4] = (uint32)atoi(row[8]);
bool instnodrop = (row[9] && (uint16)atoi(row[9])) ? true : false;
const Item_Struct* item = GetItem(item_id);
int16 put_slot_id = SLOT_INVALID;
int16 put_slot_id = INVALID_INDEX;
if(!item)
continue;
@@ -692,7 +692,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv)
safe_delete(inst);
// Save ptr to item in inventory
if (put_slot_id == SLOT_INVALID) {
if (put_slot_id == INVALID_INDEX) {
LogFile->write(EQEMuLog::Error,
"Warning: Invalid slot_id for item in inventory: name=%s, acctid=%i, item_id=%i, slot_id=%i",
name, account_id, item_id, slot_id);
+3 -2
View File
@@ -53,7 +53,8 @@ enum SkillUseTypes : uint32
/*13879*/ SkillDivination,
/*13880*/ SkillDodge,
/*13881*/ SkillDoubleAttack,
/*13882*/ SkillDragonPunch, /*13924 SkillTailRake*/
/*13882*/ SkillDragonPunch,
/*13924*/ SkillTailRake = SkillDragonPunch, // Iksar Monk equivilent
/*13883*/ SkillDualWield,
/*13884*/ SkillEagleStrike,
/*13885*/ SkillEvocation,
@@ -199,7 +200,7 @@ typedef enum {
DIVINATION = 18,
DODGE = 19,
DOUBLE_ATTACK = 20,
DRAGON_PUNCH = 21 , //aka Tail Rake
DRAGON_PUNCH = 21, //aka Tail Rake
DUAL_WIELD = 22,
EAGLE_STRIKE = 23,
EVOCATION = 24,