mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-23 00:08:23 +00:00
Merge remote-tracking branch 'remotes/origin/master' into web_interface
Conflicts: common/shareddb.cpp
This commit is contained in:
@@ -1509,7 +1509,8 @@ enum ItemPacketType
|
||||
ItemPacketTributeItem = 0x6C,
|
||||
ItemPacketMerchant = 0x64,
|
||||
ItemPacketWorldContainer = 0x6B,
|
||||
ItemPacketCharmUpdate = 0x6E
|
||||
ItemPacketCharmUpdate = 0x6E,
|
||||
ItemPacketInvalid = 0xFF
|
||||
};
|
||||
struct ItemPacket_Struct
|
||||
{
|
||||
@@ -3015,14 +3016,14 @@ struct ClientError_Struct
|
||||
};
|
||||
|
||||
struct Track_Struct {
|
||||
uint16 entityid;
|
||||
uint16 padding002;
|
||||
uint32 entityid;
|
||||
float distance;
|
||||
// Fields for SoD and later
|
||||
uint8 level;
|
||||
uint8 NPC;
|
||||
uint8 GroupMember;
|
||||
uint8 is_npc;
|
||||
char name[64];
|
||||
uint8 is_pet;
|
||||
uint8 is_merc;
|
||||
};
|
||||
|
||||
struct Tracking_Struct {
|
||||
|
||||
+26
-8
@@ -89,6 +89,17 @@ ItemInst* ItemInstQueue::pop()
|
||||
return inst;
|
||||
}
|
||||
|
||||
// Remove item from back of queue
|
||||
ItemInst* ItemInstQueue::pop_back()
|
||||
{
|
||||
if (m_list.size() == 0)
|
||||
return nullptr;
|
||||
|
||||
ItemInst* inst = m_list.back();
|
||||
m_list.pop_back();
|
||||
return inst;
|
||||
}
|
||||
|
||||
// Look at item at front of queue
|
||||
ItemInst* ItemInstQueue::peek_front() const
|
||||
{
|
||||
@@ -259,6 +270,11 @@ int16 Inventory::PushCursor(const ItemInst& inst)
|
||||
return MainCursor;
|
||||
}
|
||||
|
||||
ItemInst* Inventory::GetCursorItem()
|
||||
{
|
||||
return m_cursor.peek_front();
|
||||
}
|
||||
|
||||
// Swap items in inventory
|
||||
bool Inventory::SwapItem(int16 slot_a, int16 slot_b)
|
||||
{
|
||||
@@ -1170,13 +1186,13 @@ int16 Inventory::_HasItem(std::map<int16, ItemInst*>& bucket, uint32 item_id, ui
|
||||
|
||||
for (itb = inst->_begin(); itb != inst->_end(); ++itb) {
|
||||
ItemInst* baginst = itb->second;
|
||||
if (baginst->GetID() == item_id) {
|
||||
if (baginst && baginst->GetID() == item_id) {
|
||||
quantity_found += (baginst->GetCharges() <= 0) ? 1 : baginst->GetCharges();
|
||||
if (quantity_found >= quantity)
|
||||
return Inventory::CalcSlotId(it->first, itb->first);
|
||||
}
|
||||
for (int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
|
||||
if (baginst->GetAugmentItemID(i) == item_id && quantity <= 1)
|
||||
if (baginst && baginst->GetAugmentItemID(i) == item_id && quantity <= 1)
|
||||
return legacy::SLOT_AUGMENT; // Only one augment per slot.
|
||||
}
|
||||
}
|
||||
@@ -1214,13 +1230,13 @@ int16 Inventory::_HasItem(ItemInstQueue& iqueue, uint32 item_id, uint8 quantity)
|
||||
|
||||
for (itb = inst->_begin(); itb != inst->_end(); ++itb) {
|
||||
ItemInst* baginst = itb->second;
|
||||
if (baginst->GetID() == item_id) {
|
||||
if (baginst && baginst->GetID() == item_id) {
|
||||
quantity_found += (baginst->GetCharges() <= 0) ? 1 : baginst->GetCharges();
|
||||
if (quantity_found >= quantity)
|
||||
return Inventory::CalcSlotId(MainCursor, itb->first);
|
||||
}
|
||||
for (int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
|
||||
if (baginst->GetAugmentItemID(i) == item_id && quantity <= 1)
|
||||
if (baginst && baginst->GetAugmentItemID(i) == item_id && quantity <= 1)
|
||||
return legacy::SLOT_AUGMENT; // Only one augment per slot.
|
||||
}
|
||||
|
||||
@@ -1314,7 +1330,7 @@ int16 Inventory::_HasItemByLoreGroup(std::map<int16, ItemInst*>& bucket, uint32
|
||||
if (inst->GetItem()->LoreGroup == loregroup)
|
||||
return it->first;
|
||||
|
||||
ItemInst* Aug;
|
||||
ItemInst* Aug = nullptr;
|
||||
for (int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
|
||||
Aug = inst->GetAugment(i);
|
||||
if (Aug && Aug->GetItem()->LoreGroup == loregroup)
|
||||
@@ -1329,7 +1345,7 @@ int16 Inventory::_HasItemByLoreGroup(std::map<int16, ItemInst*>& bucket, uint32
|
||||
if (baginst && baginst->IsType(ItemClassCommon) && baginst->GetItem()->LoreGroup == loregroup)
|
||||
return Inventory::CalcSlotId(it->first, itb->first);
|
||||
|
||||
ItemInst* Aug2;
|
||||
ItemInst* Aug2 = nullptr;
|
||||
for (int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
|
||||
Aug2 = baginst->GetAugment(i);
|
||||
if (Aug2 && Aug2->GetItem()->LoreGroup == loregroup)
|
||||
@@ -1357,7 +1373,7 @@ int16 Inventory::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup)
|
||||
if (inst->GetItem()->LoreGroup == loregroup)
|
||||
return MainCursor;
|
||||
|
||||
ItemInst* Aug;
|
||||
ItemInst* Aug = nullptr;
|
||||
for (int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
|
||||
Aug = inst->GetAugment(i);
|
||||
if (Aug && Aug->GetItem()->LoreGroup == loregroup)
|
||||
@@ -1373,7 +1389,7 @@ int16 Inventory::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup)
|
||||
return Inventory::CalcSlotId(MainCursor, itb->first);
|
||||
|
||||
|
||||
ItemInst* Aug2;
|
||||
ItemInst* Aug2 = nullptr;
|
||||
for (int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
|
||||
Aug2 = baginst->GetAugment(i);
|
||||
if (Aug2 && Aug2->GetItem()->LoreGroup == loregroup)
|
||||
@@ -1703,6 +1719,8 @@ void ItemInst::ClearByFlags(byFlagSetting is_nodrop, byFlagSetting is_norent)
|
||||
end = m_contents.end();
|
||||
for (; cur != end;) {
|
||||
ItemInst* inst = cur->second;
|
||||
if (inst == nullptr)
|
||||
continue;
|
||||
const Item_Struct* item = inst->GetItem();
|
||||
del = cur;
|
||||
++cur;
|
||||
|
||||
@@ -93,6 +93,7 @@ public:
|
||||
void push(ItemInst* inst);
|
||||
void push_front(ItemInst* inst);
|
||||
ItemInst* pop();
|
||||
ItemInst* pop_back();
|
||||
ItemInst* peek_front() const;
|
||||
inline int size() { return static_cast<int>(m_list.size()); }
|
||||
|
||||
@@ -152,6 +153,9 @@ public:
|
||||
// Add item to cursor queue
|
||||
int16 PushCursor(const ItemInst& inst);
|
||||
|
||||
// Get cursor item in front of queue
|
||||
ItemInst* GetCursorItem();
|
||||
|
||||
// Swap items in inventory
|
||||
bool SwapItem(int16 slot_a, int16 slot_b);
|
||||
|
||||
|
||||
+8
-31
@@ -2315,7 +2315,7 @@ namespace RoF
|
||||
outapp->WriteUInt8(emu->gm);
|
||||
|
||||
outapp->WriteUInt32(emu->guild_id);
|
||||
outapp->WriteUInt8(0); // Unknown - observed 1 in a live packet.
|
||||
outapp->WriteUInt8(emu->guildrank); // guildrank
|
||||
outapp->WriteUInt32(0); // Unknown - observed 1 in a live packet.
|
||||
outapp->WriteUInt8(0); // Unknown - observed 1 in a live packet.
|
||||
outapp->WriteUInt32(0); // Unknown
|
||||
@@ -2576,7 +2576,7 @@ namespace RoF
|
||||
strn0cpy(general->player_name, raid_create->leader_name, 64);
|
||||
|
||||
dest->FastQueuePacket(&outapp_create);
|
||||
delete[] __emu_buffer;
|
||||
safe_delete(inapp);
|
||||
}
|
||||
|
||||
ENCODE(OP_RaidUpdate)
|
||||
@@ -2643,7 +2643,7 @@ namespace RoF
|
||||
dest->FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
delete[] __emu_buffer;
|
||||
safe_delete(inapp);
|
||||
}
|
||||
|
||||
ENCODE(OP_ReadBook)
|
||||
@@ -2900,7 +2900,7 @@ namespace RoF
|
||||
{
|
||||
eq->entries[i] = emu->entries[i];
|
||||
}
|
||||
eq->entries[21] = 0;
|
||||
eq->entries[21] = 1;
|
||||
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
@@ -3294,9 +3294,9 @@ namespace RoF
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->entityid);
|
||||
VARSTRUCT_ENCODE_TYPE(float, Buffer, emu->distance);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->level);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->NPC);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->is_npc);
|
||||
VARSTRUCT_ENCODE_STRING(Buffer, emu->name);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->GroupMember);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->is_merc);
|
||||
}
|
||||
|
||||
delete[] __emu_buffer;
|
||||
@@ -4854,27 +4854,8 @@ namespace RoF
|
||||
ss.write((const char*)&evotop, sizeof(RoF::structs::EvolvingItem));
|
||||
}
|
||||
//ORNAMENT IDFILE / ICON
|
||||
uint16 ornaIcon = 0;
|
||||
int32 heroModel = 0;
|
||||
/*
|
||||
if (inst->GetOrnamentationAug(ornamentationAugtype))
|
||||
{
|
||||
const Item_Struct *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
|
||||
//Mainhand
|
||||
ss.write(aug_weap->IDFile, strlen(aug_weap->IDFile));
|
||||
ss.write((const char*)&null_term, sizeof(uint8));
|
||||
//Offhand
|
||||
ss.write(aug_weap->IDFile, strlen(aug_weap->IDFile));
|
||||
ss.write((const char*)&null_term, sizeof(uint8));
|
||||
//Icon
|
||||
ornaIcon = aug_weap->Icon;
|
||||
if (aug_weap->HerosForgeModel > 0)
|
||||
{
|
||||
heroModel = (aug_weap->HerosForgeModel * 100) + Inventory::CalcMaterialFromSlot(slot_id_in);
|
||||
}
|
||||
}
|
||||
else
|
||||
*/
|
||||
uint32 ornaIcon = 0;
|
||||
uint32 heroModel = 0;
|
||||
|
||||
if (inst->GetOrnamentationIDFile() && inst->GetOrnamentationIcon())
|
||||
{
|
||||
@@ -4896,8 +4877,6 @@ namespace RoF
|
||||
|
||||
RoF::structs::ItemSerializationHeaderFinish hdrf;
|
||||
hdrf.ornamentIcon = ornaIcon;
|
||||
hdrf.unknown061 = 0;
|
||||
hdrf.unknown062 = 0;
|
||||
hdrf.unknowna1 = 0xffffffff;
|
||||
hdrf.ornamentHeroModel = heroModel;
|
||||
hdrf.unknown063 = 0;
|
||||
@@ -5506,7 +5485,6 @@ namespace RoF
|
||||
|
||||
static inline uint32 ServerToRoFCorpseSlot(uint32 ServerCorpse)
|
||||
{
|
||||
//uint32 RoFCorpse;
|
||||
return (ServerCorpse + 1);
|
||||
}
|
||||
|
||||
@@ -5647,7 +5625,6 @@ namespace RoF
|
||||
|
||||
static inline uint32 RoFToServerCorpseSlot(uint32 RoFCorpse)
|
||||
{
|
||||
//uint32 ServerCorpse;
|
||||
return (RoFCorpse - 1);
|
||||
}
|
||||
}
|
||||
|
||||
+140
-84
@@ -21,15 +21,15 @@ namespace RoF2
|
||||
static OpcodeManager *opcodes = nullptr;
|
||||
static Strategy struct_strategy;
|
||||
|
||||
char* SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth);
|
||||
char* SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth, ItemPacketType packet_type);
|
||||
|
||||
// server to client inventory location converters
|
||||
static inline structs::ItemSlotStruct ServerToRoF2Slot(uint32 ServerSlot);
|
||||
static inline structs::ItemSlotStruct ServerToRoF2Slot(uint32 ServerSlot, ItemPacketType PacketType = ItemPacketInvalid);
|
||||
static inline structs::MainInvItemSlotStruct ServerToRoF2MainInvSlot(uint32 ServerSlot);
|
||||
static inline uint32 ServerToRoF2CorpseSlot(uint32 ServerCorpse);
|
||||
|
||||
// client to server inventory location converters
|
||||
static inline uint32 RoF2ToServerSlot(structs::ItemSlotStruct RoF2Slot);
|
||||
static inline uint32 RoF2ToServerSlot(structs::ItemSlotStruct RoF2Slot, ItemPacketType PacketType = ItemPacketInvalid);
|
||||
static inline uint32 RoF2ToServerMainInvSlot(structs::MainInvItemSlotStruct RoF2Slot);
|
||||
static inline uint32 RoF2ToServerCorpseSlot(uint32 RoF2Corpse);
|
||||
|
||||
@@ -116,6 +116,72 @@ namespace RoF2
|
||||
#include "ss_define.h"
|
||||
|
||||
// ENCODE methods
|
||||
|
||||
|
||||
// RoF2 Specific Encodes Begin
|
||||
ENCODE(OP_SendMembershipDetails)
|
||||
{
|
||||
ENCODE_LENGTH_EXACT(Membership_Details_Struct);
|
||||
SETUP_DIRECT_ENCODE(Membership_Details_Struct, structs::Membership_Details_Struct);
|
||||
|
||||
eq->membership_setting_count = 72;
|
||||
for (uint32 i = 0; i < emu->membership_setting_count; ++i) // 66
|
||||
{
|
||||
OUT(settings[i].setting_index);
|
||||
OUT(settings[i].setting_id);
|
||||
OUT(settings[i].setting_value);
|
||||
}
|
||||
// Last 6 new settings fields are all 0s on Live as of 12/29/14
|
||||
|
||||
eq->race_entry_count = emu->race_entry_count;
|
||||
for (uint32 i = 0; i < emu->race_entry_count; ++i) // 15
|
||||
{
|
||||
OUT(membership_races[i].purchase_id);
|
||||
OUT(membership_races[i].bitwise_entry);
|
||||
}
|
||||
|
||||
eq->class_entry_count = emu->class_entry_count;
|
||||
for (uint32 i = 0; i < emu->class_entry_count; ++i) // 15
|
||||
{
|
||||
OUT(membership_classes[i].purchase_id);
|
||||
OUT(membership_classes[i].bitwise_entry);
|
||||
}
|
||||
|
||||
eq->exit_url_length = emu->exit_url_length;
|
||||
eq->exit_url_length2 = emu->exit_url_length2;
|
||||
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
ENCODE(OP_SendMembership)
|
||||
{
|
||||
ENCODE_LENGTH_EXACT(Membership_Struct);
|
||||
SETUP_DIRECT_ENCODE(Membership_Struct, structs::Membership_Struct);
|
||||
|
||||
eq->membership = emu->membership;
|
||||
eq->races = emu->races;
|
||||
eq->classes = emu->classes;
|
||||
eq->entrysize = 25; //emu->entrysize;
|
||||
|
||||
for (uint32 i = 0; i < emu->entrysize; ++i) // 21
|
||||
{
|
||||
OUT(entries[i]);
|
||||
}
|
||||
// Last 4 new entries are 0s on Live Silver as of 12/29/14
|
||||
// Setting them each to 1 for now.
|
||||
// This removes the "Buy Now" button from aug type 21 slots on items.
|
||||
for (uint32 i = 21; i < 25; ++i) // 4
|
||||
{
|
||||
eq->entries[i] = 1;
|
||||
}
|
||||
|
||||
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
// RoF2 Specific Encodes End
|
||||
|
||||
|
||||
ENCODE(OP_Action)
|
||||
{
|
||||
ENCODE_LENGTH_EXACT(Action_Struct);
|
||||
@@ -556,7 +622,7 @@ namespace RoF2
|
||||
|
||||
uint32 Length = 0;
|
||||
|
||||
char* Serialized = SerializeItem((const ItemInst*)eq->inst, eq->slot_id, &Length, 0);
|
||||
char* Serialized = SerializeItem((const ItemInst*)eq->inst, eq->slot_id, &Length, 0, ItemPacketCharInventory);
|
||||
|
||||
if (Serialized) {
|
||||
|
||||
@@ -1370,7 +1436,7 @@ namespace RoF2
|
||||
InternalSerializedItem_Struct *int_struct = (InternalSerializedItem_Struct *)(old_item_pkt->SerializedItem);
|
||||
|
||||
uint32 length;
|
||||
char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0);
|
||||
char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0, old_item_pkt->PacketType);
|
||||
|
||||
if (!serialized) {
|
||||
_log(NET__STRUCTS, "Serialization failed on item slot %d.", int_struct->slot_id);
|
||||
@@ -1676,8 +1742,15 @@ namespace RoF2
|
||||
eq->FogDensity = emu->fog_density;
|
||||
|
||||
/*fill in some unknowns with observed values, hopefully it will help */
|
||||
eq->unknown569 = 0;
|
||||
eq->unknown571 = 0;
|
||||
eq->unknown572 = 4;
|
||||
eq->unknown576 = 2;
|
||||
eq->unknown580 = 0;
|
||||
|
||||
eq->unknown800 = -1;
|
||||
eq->unknown844 = 600;
|
||||
eq->unknown848 = 2008; // Guild Lobby observed value
|
||||
eq->unknown880 = 50;
|
||||
eq->unknown884 = 10;
|
||||
eq->unknown888 = 1;
|
||||
@@ -1987,17 +2060,17 @@ namespace RoF2
|
||||
outapp->WriteUInt32(emu->drakkin_tattoo);
|
||||
outapp->WriteUInt32(emu->drakkin_details);
|
||||
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
outapp->WriteUInt8(0); // Unknown 0
|
||||
outapp->WriteUInt8(0xff); // Unknown 0xff
|
||||
outapp->WriteUInt8(1); // Unknown 1
|
||||
outapp->WriteUInt8(0xff); // Unknown 0xff
|
||||
outapp->WriteUInt8(1); // Unknown 1
|
||||
|
||||
outapp->WriteFloat(5.0f); // Height ?
|
||||
outapp->WriteFloat(5.0f); // Height
|
||||
|
||||
outapp->WriteFloat(3.0f); // Unknown
|
||||
outapp->WriteFloat(2.5f); // Unknown
|
||||
outapp->WriteFloat(5.5f); // Unknown
|
||||
outapp->WriteFloat(3.0f); // Unknown 3.0
|
||||
outapp->WriteFloat(2.5f); // Unknown 2.5
|
||||
outapp->WriteFloat(5.5f); // Unknown 5.5
|
||||
|
||||
outapp->WriteUInt32(0); // Primary ?
|
||||
outapp->WriteUInt32(0); // Secondary ?
|
||||
@@ -2316,14 +2389,14 @@ namespace RoF2
|
||||
outapp->WriteUInt8(emu->gm);
|
||||
outapp->WriteUInt32(emu->guild_id);
|
||||
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
outapp->WriteUInt8(emu->guildrank); // guildrank
|
||||
outapp->WriteUInt32(0); // Unknown
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
outapp->WriteUInt32(0); // Unknown
|
||||
|
||||
outapp->WriteUInt64(emu->exp); // int32 in client
|
||||
|
||||
outapp->WriteUInt8(0); // Unknown - Seen 5 on Live
|
||||
outapp->WriteUInt8(5); // Unknown - Seen 5 on Live - Eye Height?
|
||||
|
||||
outapp->WriteUInt32(emu->platinum_bank);
|
||||
outapp->WriteUInt32(emu->gold_bank);
|
||||
@@ -2587,7 +2660,7 @@ namespace RoF2
|
||||
strn0cpy(general->player_name, raid_create->leader_name, 64);
|
||||
|
||||
dest->FastQueuePacket(&outapp_create);
|
||||
delete[] __emu_buffer;
|
||||
safe_delete(inapp);
|
||||
}
|
||||
|
||||
ENCODE(OP_RaidUpdate)
|
||||
@@ -2654,7 +2727,7 @@ namespace RoF2
|
||||
dest->FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
delete[] __emu_buffer;
|
||||
safe_delete(inapp);
|
||||
}
|
||||
|
||||
ENCODE(OP_ReadBook)
|
||||
@@ -2898,24 +2971,6 @@ namespace RoF2
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
ENCODE(OP_SendMembership)
|
||||
{
|
||||
ENCODE_LENGTH_EXACT(Membership_Struct);
|
||||
SETUP_DIRECT_ENCODE(Membership_Struct, structs::Membership_Struct);
|
||||
|
||||
eq->membership = emu->membership;
|
||||
eq->races = emu->races;
|
||||
eq->classes = emu->classes;
|
||||
eq->entrysize = 22;
|
||||
for (int i = 0; i<21; i++)
|
||||
{
|
||||
eq->entries[i] = emu->entries[i];
|
||||
}
|
||||
eq->entries[21] = 0;
|
||||
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
|
||||
ENCODE(OP_SendZonepoints)
|
||||
{
|
||||
SETUP_VAR_ENCODE(ZonePoints);
|
||||
@@ -3289,7 +3344,7 @@ namespace RoF2
|
||||
int PacketSize = 2;
|
||||
|
||||
for (int i = 0; i < EntryCount; ++i, ++emu)
|
||||
PacketSize += (12 + strlen(emu->name));
|
||||
PacketSize += (13 + strlen(emu->name));
|
||||
|
||||
emu = (Track_Struct *)__emu_buffer;
|
||||
|
||||
@@ -3305,9 +3360,10 @@ namespace RoF2
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->entityid);
|
||||
VARSTRUCT_ENCODE_TYPE(float, Buffer, emu->distance);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->level);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->NPC);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->is_npc);
|
||||
VARSTRUCT_ENCODE_STRING(Buffer, emu->name);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->GroupMember);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->is_pet);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->is_merc);
|
||||
}
|
||||
|
||||
delete[] __emu_buffer;
|
||||
@@ -3734,7 +3790,7 @@ namespace RoF2
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->drakkin_tattoo);
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->drakkin_details);
|
||||
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->equip_chest2); // unknown8
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->equip_chest2);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0); // unknown9
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0); // unknown10
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->helm); // unknown11
|
||||
@@ -4811,7 +4867,7 @@ namespace RoF2
|
||||
return NextItemInstSerialNumber;
|
||||
}
|
||||
|
||||
char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint8 depth)
|
||||
char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint8 depth, ItemPacketType packet_type)
|
||||
{
|
||||
int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
|
||||
uint8 null_term = 0;
|
||||
@@ -4835,15 +4891,14 @@ namespace RoF2
|
||||
hdr.stacksize = stackable ? charges : 1;
|
||||
hdr.unknown004 = 0;
|
||||
|
||||
structs::ItemSlotStruct slot_id = ServerToRoF2Slot(slot_id_in);
|
||||
structs::ItemSlotStruct slot_id = ServerToRoF2Slot(slot_id_in, packet_type);
|
||||
|
||||
hdr.slot_type = (merchant_slot == 0) ? slot_id.SlotType : 9; // 9 is merchant 20 is reclaim items?
|
||||
hdr.main_slot = (merchant_slot == 0) ? slot_id.MainSlot : merchant_slot;
|
||||
hdr.sub_slot = (merchant_slot == 0) ? slot_id.SubSlot : 0xffff;
|
||||
hdr.unknown013 = (merchant_slot == 0) ? slot_id.AugSlot : 0xffff;
|
||||
hdr.aug_slot = (merchant_slot == 0) ? slot_id.AugSlot : 0xffff;
|
||||
hdr.price = inst->GetPrice();
|
||||
hdr.merchant_slot = (merchant_slot == 0) ? 1 : inst->GetMerchantCount();
|
||||
//hdr.merchant_slot = (merchant_slot == 0) ? 1 : 0xffffffff;
|
||||
hdr.scaled_value = inst->IsScaling() ? inst->GetExp() / 100 : 0;
|
||||
hdr.instance_id = (merchant_slot == 0) ? inst->GetSerialNumber() : merchant_slot;
|
||||
hdr.unknown028 = 0;
|
||||
@@ -4869,28 +4924,9 @@ namespace RoF2
|
||||
ss.write((const char*)&evotop, sizeof(RoF2::structs::EvolvingItem));
|
||||
}
|
||||
//ORNAMENT IDFILE / ICON
|
||||
uint16 ornaIcon = 0;
|
||||
int32 heroModel = 0;
|
||||
/*
|
||||
if (inst->GetOrnamentationAug(ornamentationAugtype))
|
||||
{
|
||||
const Item_Struct *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
|
||||
//Mainhand
|
||||
ss.write(aug_weap->IDFile, strlen(aug_weap->IDFile));
|
||||
ss.write((const char*)&null_term, sizeof(uint8));
|
||||
//Offhand
|
||||
ss.write(aug_weap->IDFile, strlen(aug_weap->IDFile));
|
||||
ss.write((const char*)&null_term, sizeof(uint8));
|
||||
//Icon
|
||||
ornaIcon = aug_weap->Icon;
|
||||
if (aug_weap->HerosForgeModel > 0)
|
||||
{
|
||||
heroModel = (aug_weap->HerosForgeModel * 100) + Inventory::CalcMaterialFromSlot(slot_id_in);
|
||||
}
|
||||
}
|
||||
else
|
||||
*/
|
||||
|
||||
uint32 ornaIcon = 0;
|
||||
uint32 heroModel = 0;
|
||||
|
||||
if (inst->GetOrnamentationIDFile() && inst->GetOrnamentationIcon())
|
||||
{
|
||||
char tmp[30]; memset(tmp, 0x0, 30); sprintf(tmp, "IT%d", inst->GetOrnamentationIDFile());
|
||||
@@ -4911,12 +4947,10 @@ namespace RoF2
|
||||
|
||||
RoF2::structs::ItemSerializationHeaderFinish hdrf;
|
||||
hdrf.ornamentIcon = ornaIcon;
|
||||
hdrf.unknown061 = 0;
|
||||
hdrf.unknown062 = 0;
|
||||
hdrf.unknowna1 = 0xffffffff;
|
||||
hdrf.ornamentHeroModel = heroModel;
|
||||
hdrf.unknown063 = 0;
|
||||
hdrf.unknowna3 = 0;
|
||||
hdrf.Copied = 0;
|
||||
hdrf.unknowna4 = 0xffffffff;
|
||||
hdrf.unknowna5 = 0;
|
||||
hdrf.ItemClass = item->ItemClass;
|
||||
@@ -5066,7 +5100,7 @@ namespace RoF2
|
||||
memset(&isbs, 0, sizeof(RoF2::structs::ItemSecondaryBodyStruct));
|
||||
|
||||
isbs.augtype = item->AugType;
|
||||
isbs.augdistiller = 65535;
|
||||
isbs.augrestrict2 = -1;
|
||||
isbs.augrestrict = item->AugRestrict;
|
||||
|
||||
for (int x = AUG_BEGIN; x < consts::ITEM_COMMON_SIZE; x++)
|
||||
@@ -5310,9 +5344,21 @@ namespace RoF2
|
||||
iqbs.HealAmt = item->HealAmt;
|
||||
iqbs.SpellDmg = item->SpellDmg;
|
||||
iqbs.clairvoyance = item->Clairvoyance;
|
||||
iqbs.unknown28 = 0;
|
||||
iqbs.unknown30 = 0;
|
||||
iqbs.unknown37a = 0;
|
||||
|
||||
//unknown18; //Power Source Capacity or evolve filename?
|
||||
//evolve_string; // Some String, but being evolution related is just a guess
|
||||
|
||||
iqbs.Heirloom = 0;
|
||||
iqbs.Placeable = 0;
|
||||
|
||||
iqbs.unknown28 = -1;
|
||||
iqbs.unknown30 = -1;
|
||||
|
||||
iqbs.NoZone = 0;
|
||||
iqbs.NoGround = 0;
|
||||
iqbs.unknown37a = 0; // (guessed position) New to RoF2
|
||||
iqbs.unknown38 = 0;
|
||||
|
||||
iqbs.unknown39 = 1;
|
||||
|
||||
iqbs.subitem_count = 0;
|
||||
@@ -5350,7 +5396,7 @@ namespace RoF2
|
||||
SubSlotNumber = Inventory::CalcSlotID(slot_id_in, x);
|
||||
*/
|
||||
|
||||
SubSerializations[x] = SerializeItem(subitem, SubSlotNumber, &SubLengths[x], depth + 1);
|
||||
SubSerializations[x] = SerializeItem(subitem, SubSlotNumber, &SubLengths[x], depth + 1, packet_type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5376,7 +5422,7 @@ namespace RoF2
|
||||
return item_serial;
|
||||
}
|
||||
|
||||
static inline structs::ItemSlotStruct ServerToRoF2Slot(uint32 ServerSlot)
|
||||
static inline structs::ItemSlotStruct ServerToRoF2Slot(uint32 ServerSlot, ItemPacketType PacketType)
|
||||
{
|
||||
structs::ItemSlotStruct RoF2Slot;
|
||||
RoF2Slot.SlotType = INVALID_INDEX;
|
||||
@@ -5389,13 +5435,21 @@ namespace RoF2
|
||||
uint32 TempSlot = 0;
|
||||
|
||||
if (ServerSlot < 56 || ServerSlot == MainPowerSource) { // Main Inventory and Cursor
|
||||
RoF2Slot.SlotType = maps::MapPossessions;
|
||||
RoF2Slot.MainSlot = ServerSlot;
|
||||
|
||||
if (PacketType == ItemPacketLoot)
|
||||
{
|
||||
RoF2Slot.SlotType = maps::MapCorpse;
|
||||
RoF2Slot.MainSlot = ServerSlot - EmuConstants::CORPSE_BEGIN;
|
||||
}
|
||||
else
|
||||
{
|
||||
RoF2Slot.SlotType = maps::MapPossessions;
|
||||
RoF2Slot.MainSlot = ServerSlot;
|
||||
}
|
||||
|
||||
if (ServerSlot == MainPowerSource)
|
||||
RoF2Slot.MainSlot = slots::MainPowerSource;
|
||||
|
||||
else if (ServerSlot >= MainCursor) // Cursor and Extended Corpse Inventory
|
||||
else if (ServerSlot >= MainCursor && PacketType != ItemPacketLoot) // Cursor and Extended Corpse Inventory
|
||||
RoF2Slot.MainSlot += 3;
|
||||
|
||||
else if (ServerSlot >= MainAmmo) // (> 20)
|
||||
@@ -5522,11 +5576,10 @@ namespace RoF2
|
||||
|
||||
static inline uint32 ServerToRoF2CorpseSlot(uint32 ServerCorpse)
|
||||
{
|
||||
//uint32 RoF2Corpse;
|
||||
return (ServerCorpse + 1);
|
||||
return (ServerCorpse - EmuConstants::CORPSE_BEGIN + 1);
|
||||
}
|
||||
|
||||
static inline uint32 RoF2ToServerSlot(structs::ItemSlotStruct RoF2Slot)
|
||||
static inline uint32 RoF2ToServerSlot(structs::ItemSlotStruct RoF2Slot, ItemPacketType PacketType)
|
||||
{
|
||||
uint32 ServerSlot = INVALID_INDEX;
|
||||
uint32 TempSlot = 0;
|
||||
@@ -5621,6 +5674,10 @@ namespace RoF2
|
||||
ServerSlot = INVALID_INDEX;
|
||||
}
|
||||
|
||||
else if (RoF2Slot.SlotType == maps::MapCorpse) {
|
||||
ServerSlot = RoF2Slot.MainSlot + EmuConstants::CORPSE_BEGIN;
|
||||
}
|
||||
|
||||
_log(NET__ERROR, "Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot);
|
||||
|
||||
return ServerSlot;
|
||||
@@ -5663,8 +5720,7 @@ namespace RoF2
|
||||
|
||||
static inline uint32 RoF2ToServerCorpseSlot(uint32 RoF2Corpse)
|
||||
{
|
||||
//uint32 ServerCorpse;
|
||||
return (RoF2Corpse - 1);
|
||||
return (RoF2Corpse + EmuConstants::CORPSE_BEGIN - 1);
|
||||
}
|
||||
}
|
||||
// end namespace RoF2
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// out-going packets that require an ENCODE translation:
|
||||
// Begin RoF2 Encodes
|
||||
|
||||
E(OP_SendMembershipDetails)
|
||||
|
||||
// incoming packets that require a DECODE translation:
|
||||
// Begin RoF2 Decodes
|
||||
|
||||
|
||||
@@ -243,11 +243,11 @@ struct Membership_Setting_Struct
|
||||
struct Membership_Details_Struct
|
||||
{
|
||||
/*0000*/ uint32 membership_setting_count; // Seen 66
|
||||
/*0016*/ Membership_Setting_Struct settings[66];
|
||||
/*0016*/ Membership_Setting_Struct settings[72]; // 864 Bytes
|
||||
/*0012*/ uint32 race_entry_count; // Seen 15
|
||||
/*1044*/ Membership_Entry_Struct membership_races[15];
|
||||
/*1044*/ Membership_Entry_Struct membership_races[15]; // 120 Bytes
|
||||
/*0012*/ uint32 class_entry_count; // Seen 15
|
||||
/*1044*/ Membership_Entry_Struct membership_classes[15];
|
||||
/*1044*/ Membership_Entry_Struct membership_classes[15]; // 120 Bytes
|
||||
/*1044*/ uint32 exit_url_length; // Length of the exit_url string (0 for none)
|
||||
/*1048*/ //char exit_url[42]; // Upgrade to Silver or Gold Membership URL
|
||||
/*1048*/ uint32 exit_url_length2; // Length of the exit_url2 string (0 for none)
|
||||
@@ -260,7 +260,7 @@ struct Membership_Struct
|
||||
/*004*/ uint32 races; // Seen ff ff 01 00
|
||||
/*008*/ uint32 classes; // Seen ff ff 01 01
|
||||
/*012*/ uint32 entrysize; // Seen 22
|
||||
/*016*/ int32 entries[22]; // Most -1, 1, and 0 for Gold Status
|
||||
/*016*/ int32 entries[25]; // Most -1, 1, and 0 for Gold Status
|
||||
/*104*/
|
||||
};
|
||||
|
||||
@@ -537,9 +537,13 @@ struct NewZone_Struct {
|
||||
/*0525*/ uint8 rain_duration[4];
|
||||
/*0529*/ uint8 snow_chance[4];
|
||||
/*0533*/ uint8 snow_duration[4];
|
||||
/*0537*/ uint8 unknown537[33];
|
||||
/*0537*/ uint8 unknown537[32]; // Seen all 0xff
|
||||
/*0569*/ uint8 unknown569; // Unknown - Seen 0
|
||||
/*0570*/ uint8 sky; // Sky Type
|
||||
/*0571*/ uint8 unknown571[13]; // ***Placeholder
|
||||
/*0571*/ uint8 unknown571; // Unknown - Seen 0
|
||||
/*0572*/ uint32 unknown572; // Unknown - Seen 4 in Guild Lobby
|
||||
/*0576*/ uint32 unknown576; // Unknown - Seen 2 in Guild Lobby
|
||||
/*0580*/ uint32 unknown580; // Unknown - Seen 0 in Guild Lobby
|
||||
/*0584*/ float zone_exp_multiplier; // Experience Multiplier
|
||||
/*0588*/ float safe_y; // Zone Safe Y
|
||||
/*0592*/ float safe_x; // Zone Safe X
|
||||
@@ -554,7 +558,7 @@ struct NewZone_Struct {
|
||||
/*0800*/ int32 unknown800; //seen -1
|
||||
/*0804*/ char unknown804[40]; //
|
||||
/*0844*/ int32 unknown844; //seen 600
|
||||
/*0848*/ int32 unknown848;
|
||||
/*0848*/ int32 unknown848; //seen 2008
|
||||
/*0852*/ uint16 zone_id;
|
||||
/*0854*/ uint16 zone_instance;
|
||||
/*0856*/ char unknown856[20];
|
||||
@@ -581,7 +585,7 @@ struct NewZone_Struct {
|
||||
/*0932*/ int32 unknown932; // Seen -1
|
||||
/*0936*/ int32 unknown936; // Seen -1
|
||||
/*0940*/ uint32 unknown940; // Seen 0
|
||||
/*0944*/ float unknown944; // Seen 1.0
|
||||
/*0944*/ float unknown944; // Seen 1.0 in PoK, and 0.25 in Guild Lobby
|
||||
/*0948*/ uint32 unknown948; // Seen 0 - New on Live as of Dec 15 2014
|
||||
/*0952*/ uint32 unknown952; // Seen 100 - New on Live as of Dec 15 2014
|
||||
/*0956*/
|
||||
@@ -1219,64 +1223,17 @@ union
|
||||
|
||||
/*
|
||||
///////////////////// - Haven't identified the below fields in the PP yet
|
||||
uint8 pvp; // 1=pvp, 0=not pvp
|
||||
uint8 anon; // 2=roleplay, 1=anon, 0=not anon
|
||||
uint8 gm; // 0=no, 1=yes (guessing!)
|
||||
uint32 guild_id; // guildid
|
||||
uint8 guildrank; // 0=member, 1=officer, 2=guildleader -1=no guild
|
||||
uint32 guildbanker;
|
||||
uint32 available_slots;
|
||||
uint32 endurance; // Current endurance
|
||||
uint32 spellSlotRefresh[MAX_PP_MEMSPELL]; // Refresh time (millis) - 4 bytes Each * 16 = 64 bytes
|
||||
uint32 abilitySlotRefresh;
|
||||
///////////////////////
|
||||
|
||||
uint32 platinum_bank; // Platinum Pieces in Bank
|
||||
uint32 gold_bank; // Gold Pieces in Bank
|
||||
uint32 silver_bank; // Silver Pieces in Bank
|
||||
uint32 copper_bank; // Copper Pieces in Bank
|
||||
uint32 platinum_shared; // Shared platinum pieces
|
||||
|
||||
uint32 autosplit; // 0 = off, 1 = on
|
||||
|
||||
char groupMembers[MAX_GROUP_MEMBERS][64];// 384 all the members in group, including self
|
||||
char groupLeader[64]; // Leader of the group ?
|
||||
uint32 entityid;
|
||||
|
||||
uint32 leadAAActive; // 0 = leader AA off, 1 = leader AA on
|
||||
int32 ldon_points_guk; // Earned GUK points
|
||||
int32 ldon_points_mir; // Earned MIR points
|
||||
int32 ldon_points_mmc; // Earned MMC points
|
||||
int32 ldon_points_ruj; // Earned RUJ points
|
||||
int32 ldon_points_tak; // Earned TAK points
|
||||
int32 ldon_points_available;// Available LDON points
|
||||
float tribute_time_remaining;// Time remaining on tribute (millisecs)
|
||||
uint32 career_tribute_points;// Total favor points for this char
|
||||
uint32 tribute_points; // Current tribute points
|
||||
uint32 tribute_active; // 0 = off, 1=on
|
||||
Tribute_Struct tributes[MAX_PLAYER_TRIBUTES]; // [40] Current tribute loadout
|
||||
double group_leadership_exp; // Current group lead exp points
|
||||
double raid_leadership_exp; // Current raid lead AA exp points
|
||||
uint32 group_leadership_points; // Unspent group lead AA points
|
||||
uint32 raid_leadership_points; // Unspent raid lead AA points
|
||||
LeadershipAA_Struct leader_abilities; // [128]Leader AA ranks 19332
|
||||
|
||||
uint32 PVPKills;
|
||||
uint32 PVPDeaths;
|
||||
uint32 PVPCurrentPoints;
|
||||
uint32 PVPCareerPoints;
|
||||
uint32 PVPBestKillStreak;
|
||||
uint32 PVPWorstDeathStreak;
|
||||
uint32 PVPCurrentKillStreak;
|
||||
PVPStatsEntry_Struct PVPLastKill; // size 88
|
||||
PVPStatsEntry_Struct PVPLastDeath; // size 88
|
||||
uint32 PVPNumberOfKillsInLast24Hours;
|
||||
PVPStatsEntry_Struct PVPRecentKills[50]; // size 4400 - 88 each
|
||||
uint32 expAA; // Exp earned in current AA point
|
||||
uint32 currentRadCrystals; // Current count of radiant crystals
|
||||
uint32 careerRadCrystals; // Total count of radiant crystals ever
|
||||
uint32 currentEbonCrystals; // Current count of ebon crystals
|
||||
uint32 careerEbonCrystals; // Total count of ebon crystals ever
|
||||
*/
|
||||
|
||||
};
|
||||
@@ -1886,8 +1843,8 @@ struct LootingItem_Struct {
|
||||
/*000*/ uint32 lootee;
|
||||
/*004*/ uint32 looter;
|
||||
/*008*/ uint16 slot_id;
|
||||
/*010*/ uint16 unknown10;
|
||||
/*012*/ uint32 auto_loot;
|
||||
/*010*/ uint16 unknown10; // slot_id is probably uint32
|
||||
/*012*/ int32 auto_loot;
|
||||
/*016*/ uint32 unknown16;
|
||||
/*020*/
|
||||
};
|
||||
@@ -2892,7 +2849,8 @@ struct Resurrect_Struct
|
||||
/*160*/ char corpse_name[64];
|
||||
/*224*/ uint32 action;
|
||||
/*228*/ uint32 unknown228;
|
||||
/*232*/
|
||||
/*232*/ uint32 unknown232;
|
||||
/*236*/
|
||||
};
|
||||
|
||||
struct SetRunMode_Struct {
|
||||
@@ -3111,29 +3069,24 @@ struct MobHealth
|
||||
};
|
||||
|
||||
struct Track_Struct {
|
||||
uint16 entityid;
|
||||
uint16 y;
|
||||
uint16 x;
|
||||
uint16 z;
|
||||
uint32 entityid;
|
||||
float distance;
|
||||
// Fields for SoD and later
|
||||
uint8 level;
|
||||
uint8 is_npc;
|
||||
char name[64];
|
||||
uint8 is_pet;
|
||||
uint8 is_merc;
|
||||
};
|
||||
|
||||
struct Tracking_Struct {
|
||||
uint16 entry_count;
|
||||
Track_Struct Entrys[0];
|
||||
};
|
||||
|
||||
// Looks like new tracking structures - Opcode: 0x57a7
|
||||
struct Tracking_Struct_New {
|
||||
uint16 totalcount; // Total Count of mobs within tracking range
|
||||
Track_Struct Entrys[0];
|
||||
};
|
||||
|
||||
struct Track_Struct_New {
|
||||
uint16 entityid; // Entity ID
|
||||
uint16 unknown002; // 00 00
|
||||
uint32 unknown004; //
|
||||
uint8 level; // level of mob
|
||||
uint8 unknown009; // 01 maybe type of mob? player/npc?
|
||||
char name[1]; // name of mob
|
||||
struct TrackTarget_Struct
|
||||
{
|
||||
uint32 EntityID;
|
||||
};
|
||||
|
||||
|
||||
@@ -4399,7 +4352,7 @@ struct ItemSerializationHeader
|
||||
/*025*/ uint8 slot_type; // 0 = normal, 1 = bank, 2 = shared bank, 9 = merchant, 20 = ?
|
||||
/*026*/ uint16 main_slot;
|
||||
/*028*/ uint16 sub_slot;
|
||||
/*030*/ uint16 unknown013; // 0xffff
|
||||
/*030*/ uint16 aug_slot; // 0xffff
|
||||
/*032*/ uint32 price;
|
||||
/*036*/ uint32 merchant_slot; //1 if not a merchant item
|
||||
/*040*/ uint32 scaled_value; //0
|
||||
@@ -4428,17 +4381,14 @@ struct EvolvingItem {
|
||||
|
||||
struct ItemSerializationHeaderFinish
|
||||
{
|
||||
/*079*/ uint16 ornamentIcon;
|
||||
/*081*/ uint8 unknown061; // 0 - Add Evolving Item struct if this isn't set to 0?
|
||||
/*082*/ uint8 unknown062; // 0
|
||||
/*083*/ int32 unknowna1; // 0xffffffff
|
||||
/*087*/ uint32 ornamentHeroModel; // 0
|
||||
/*091*/ uint8 unknown063; // 0
|
||||
/*092*/ uint32 unknowna3; // 0
|
||||
/*096*/ int32 unknowna4; // 0xffffffff
|
||||
/*100*/ uint32 unknowna5; // 0
|
||||
/*104*/ uint8 ItemClass; //0, 1, or 2
|
||||
/*105*/
|
||||
uint32 ornamentIcon;
|
||||
int32 unknowna1; // 0xffffffff
|
||||
uint32 ornamentHeroModel;
|
||||
int32 unknown063; // 0
|
||||
uint8 Copied; // Copied Flag - Possibly for items copied during server transfer?
|
||||
int32 unknowna4; // 0xffffffff
|
||||
int32 unknowna5; // 0
|
||||
uint8 ItemClass; //0, 1, or 2
|
||||
};
|
||||
|
||||
struct ItemBodyStruct
|
||||
@@ -4542,7 +4492,7 @@ struct ItemSecondaryBodyStruct
|
||||
// swapped augrestrict and augdistiller positions
|
||||
// (this swap does show the proper augment restrictions in Item Information window now)
|
||||
// unsure what the purpose of augdistiller is at this time -U 3/17/2014
|
||||
uint32 augdistiller; // New to December 10th 2012 client - NEW
|
||||
int32 augrestrict2; // New to December 10th 2012 client - Hidden Aug Restriction
|
||||
uint32 augrestrict;
|
||||
AugSlotStruct augslots[6];
|
||||
|
||||
@@ -4647,7 +4597,7 @@ struct ItemQuaternaryBodyStruct
|
||||
uint8 quest_item;
|
||||
uint32 Power; // Enables "Power" percentage field used by Power Sources
|
||||
uint32 Purity;
|
||||
uint8 unknown16; // RoF2
|
||||
uint8 unknown16; // RoF
|
||||
uint32 BackstabDmg;
|
||||
uint32 DSMitigation;
|
||||
int32 HeroicStr;
|
||||
@@ -4669,15 +4619,19 @@ struct ItemQuaternaryBodyStruct
|
||||
uint8 unknown18; //Power Source Capacity or evolve filename?
|
||||
uint32 evolve_string; // Some String, but being evolution related is just a guess
|
||||
uint8 unknown19;
|
||||
uint32 unknown20; // Bard Stuff?
|
||||
//uint32 unknown21;
|
||||
uint8 unknown22;
|
||||
uint16 unknown20;
|
||||
uint8 unknown21;
|
||||
uint8 Heirloom; // Heirloom Flag
|
||||
uint8 Placeable; // Placeable Flag
|
||||
uint8 unknown22b;
|
||||
uint8 unknown22c;
|
||||
uint8 unknown22d;
|
||||
uint32 unknown23;
|
||||
uint32 unknown24;
|
||||
uint32 unknown25;
|
||||
float unknown26;
|
||||
float unknown27;
|
||||
uint32 unknown_RoF26; // 0 New to March 21 2012 client
|
||||
uint32 unknown_RoF_6; // 0 New to March 21 2012 client
|
||||
uint32 unknown28; // 0xffffffff
|
||||
uint16 unknown29;
|
||||
uint32 unknown30; // 0xffffffff
|
||||
@@ -4688,9 +4642,15 @@ struct ItemQuaternaryBodyStruct
|
||||
uint32 unknown35;
|
||||
uint32 unknown36;
|
||||
uint32 unknown37;
|
||||
uint32 unknown_RoF27;
|
||||
uint32 unknown_RoF28;
|
||||
uint8 unknown37a; // (guessed position) New to RoF2
|
||||
uint8 NoZone; // No Zone Flag - Item will disappear upon zoning?
|
||||
uint8 unknown_RoF_7b; // Maybe Uint32 ?
|
||||
uint8 unknown_RoF_7c;
|
||||
uint8 unknown_RoF_7d;
|
||||
uint8 unknown_RoF_8a;
|
||||
uint8 NoGround; // No Ground Flag - Item cannot be dropped on the ground?
|
||||
uint8 unknown_RoF_8c;
|
||||
uint8 unknown_RoF_8d;
|
||||
uint8 unknown37a; // New to RoF2 - Probably variable length string
|
||||
uint8 unknown38; // 0
|
||||
uint8 unknown39; // 1
|
||||
uint32 subitem_count;
|
||||
|
||||
@@ -3103,32 +3103,25 @@ struct MobHealth
|
||||
};
|
||||
|
||||
struct Track_Struct {
|
||||
uint16 entityid;
|
||||
uint16 y;
|
||||
uint16 x;
|
||||
uint16 z;
|
||||
uint32 entityid;
|
||||
float distance;
|
||||
// Fields for SoD and later
|
||||
uint8 level;
|
||||
uint8 is_npc;
|
||||
char name[64];
|
||||
uint8 is_merc;
|
||||
};
|
||||
|
||||
struct Tracking_Struct {
|
||||
uint16 entry_count;
|
||||
Track_Struct Entrys[0];
|
||||
};
|
||||
|
||||
// Looks like new tracking structures - Opcode: 0x57a7
|
||||
struct Tracking_Struct_New {
|
||||
uint16 totalcount; // Total Count of mobs within tracking range
|
||||
Track_Struct Entrys[0];
|
||||
struct TrackTarget_Struct
|
||||
{
|
||||
uint32 EntityID;
|
||||
};
|
||||
|
||||
struct Track_Struct_New {
|
||||
uint16 entityid; // Entity ID
|
||||
uint16 unknown002; // 00 00
|
||||
uint32 unknown004; //
|
||||
uint8 level; // level of mob
|
||||
uint8 unknown009; // 01 maybe type of mob? player/npc?
|
||||
char name[1]; // name of mob
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
** ZoneServerInfo_Struct
|
||||
** Zone server information
|
||||
@@ -4420,9 +4413,7 @@ struct EvolvingItem {
|
||||
|
||||
struct ItemSerializationHeaderFinish
|
||||
{
|
||||
/*079*/ uint16 ornamentIcon;
|
||||
/*081*/ uint8 unknown061; // 0 - Add Evolving Item struct if this isn't set to 0?
|
||||
/*082*/ uint8 unknown062; // 0
|
||||
/*079*/ uint32 ornamentIcon;
|
||||
/*083*/ int32 unknowna1; // 0xffffffff
|
||||
/*087*/ uint32 ornamentHeroModel; // 0
|
||||
/*091*/ uint8 unknown063; // 0
|
||||
|
||||
@@ -1638,7 +1638,7 @@ namespace SoD
|
||||
strn0cpy(general->player_name, raid_create->leader_name, 64);
|
||||
|
||||
dest->FastQueuePacket(&outapp_create);
|
||||
delete[] __emu_buffer;
|
||||
safe_delete(inapp);
|
||||
}
|
||||
|
||||
ENCODE(OP_RaidUpdate)
|
||||
@@ -1705,7 +1705,7 @@ namespace SoD
|
||||
dest->FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
delete[] __emu_buffer;
|
||||
safe_delete(inapp);
|
||||
}
|
||||
|
||||
ENCODE(OP_ReadBook)
|
||||
@@ -2058,9 +2058,9 @@ namespace SoD
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->entityid);
|
||||
VARSTRUCT_ENCODE_TYPE(float, Buffer, emu->distance);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->level);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->NPC);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->is_npc);
|
||||
VARSTRUCT_ENCODE_STRING(Buffer, emu->name);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->GroupMember);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->is_merc);
|
||||
}
|
||||
|
||||
delete[] __emu_buffer;
|
||||
|
||||
@@ -1296,7 +1296,7 @@ namespace SoF
|
||||
strn0cpy(general->player_name, raid_create->leader_name, 64);
|
||||
|
||||
dest->FastQueuePacket(&outapp_create);
|
||||
delete[] __emu_buffer;
|
||||
safe_delete(inapp);
|
||||
}
|
||||
|
||||
ENCODE(OP_RaidUpdate)
|
||||
@@ -1363,7 +1363,7 @@ namespace SoF
|
||||
dest->FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
delete[] __emu_buffer;
|
||||
safe_delete(inapp);
|
||||
}
|
||||
|
||||
ENCODE(OP_ReadBook)
|
||||
@@ -1645,7 +1645,7 @@ namespace SoF
|
||||
for (int i = 0; i < EntryCount; ++i, ++eq, ++emu)
|
||||
{
|
||||
OUT(entityid);
|
||||
OUT(padding002);
|
||||
//OUT(padding002);
|
||||
OUT(distance);
|
||||
}
|
||||
|
||||
|
||||
@@ -2624,8 +2624,8 @@ struct MobHealth
|
||||
};
|
||||
|
||||
struct Track_Struct {
|
||||
uint16 entityid;
|
||||
uint16 padding002;
|
||||
uint32 entityid;
|
||||
//uint16 padding002;
|
||||
float distance;
|
||||
};
|
||||
|
||||
|
||||
@@ -1094,7 +1094,7 @@ namespace Titanium
|
||||
for (int i = 0; i < EntryCount; ++i, ++eq, ++emu)
|
||||
{
|
||||
OUT(entityid);
|
||||
OUT(padding002);
|
||||
//OUT(padding002);
|
||||
OUT(distance);
|
||||
}
|
||||
|
||||
|
||||
@@ -2319,8 +2319,8 @@ struct MobHealth
|
||||
};
|
||||
|
||||
struct Track_Struct {
|
||||
uint16 entityid;
|
||||
uint16 padding002;
|
||||
uint32 entityid;
|
||||
//uint16 padding002;
|
||||
float distance;
|
||||
};
|
||||
|
||||
|
||||
@@ -1924,7 +1924,7 @@ namespace Underfoot
|
||||
strn0cpy(general->player_name, raid_create->leader_name, 64);
|
||||
|
||||
dest->FastQueuePacket(&outapp_create);
|
||||
delete[] __emu_buffer;
|
||||
safe_delete(inapp);
|
||||
}
|
||||
|
||||
ENCODE(OP_RaidUpdate)
|
||||
@@ -1991,7 +1991,7 @@ namespace Underfoot
|
||||
dest->FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
delete[] __emu_buffer;
|
||||
safe_delete(inapp);
|
||||
}
|
||||
|
||||
ENCODE(OP_ReadBook)
|
||||
@@ -2348,9 +2348,9 @@ namespace Underfoot
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->entityid);
|
||||
VARSTRUCT_ENCODE_TYPE(float, Buffer, emu->distance);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->level);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->NPC);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->is_npc);
|
||||
VARSTRUCT_ENCODE_STRING(Buffer, emu->name);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->GroupMember);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->is_merc);
|
||||
}
|
||||
|
||||
delete[] __emu_buffer;
|
||||
|
||||
+30
-4
@@ -177,6 +177,7 @@ bool SharedDatabase::SaveInventory(uint32 char_id, const ItemInst* inst, int16 s
|
||||
}
|
||||
|
||||
bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, int16 slot_id) {
|
||||
// need to check 'inst' argument for valid pointer
|
||||
|
||||
uint32 augslot[EmuConstants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM };
|
||||
if (inst->IsType(ItemClassCommon))
|
||||
@@ -221,6 +222,7 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i
|
||||
}
|
||||
|
||||
bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst, int16 slot_id) {
|
||||
// need to check 'inst' argument for valid pointer
|
||||
|
||||
uint32 augslot[EmuConstants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM };
|
||||
if (inst->IsType(ItemClassCommon))
|
||||
@@ -429,10 +431,6 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) {
|
||||
|
||||
int16 put_slot_id = INVALID_INDEX;
|
||||
|
||||
ItemInst* inst = CreateBaseItem(item, charges);
|
||||
if (item->ItemClass == ItemClassCommon) {
|
||||
for(int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
|
||||
if (aug[i]) {
|
||||
inst->PutAugment(this, i, aug[i]);
|
||||
}
|
||||
}
|
||||
@@ -527,6 +525,9 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) {
|
||||
|
||||
ItemInst* inst = CreateBaseItem(item, charges);
|
||||
|
||||
if (inst == nullptr)
|
||||
continue;
|
||||
|
||||
if(row[11]) {
|
||||
std::string data_str(row[11]);
|
||||
std::string idAsString;
|
||||
@@ -635,6 +636,10 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv)
|
||||
continue;
|
||||
|
||||
ItemInst* inst = CreateBaseItem(item, charges);
|
||||
|
||||
if (inst == nullptr)
|
||||
continue;
|
||||
|
||||
inst->SetAttuned(instnodrop);
|
||||
|
||||
if(row[11]) {
|
||||
@@ -1193,9 +1198,17 @@ ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1,
|
||||
{
|
||||
const Item_Struct* item = nullptr;
|
||||
ItemInst* inst = nullptr;
|
||||
|
||||
item = GetItem(item_id);
|
||||
if (item) {
|
||||
inst = CreateBaseItem(item, charges);
|
||||
|
||||
if (inst == nullptr) {
|
||||
LogFile->write(EQEMuLog::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()");
|
||||
LogFile->write(EQEMuLog::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
inst->PutAugment(this, 0, aug1);
|
||||
inst->PutAugment(this, 1, aug2);
|
||||
inst->PutAugment(this, 2, aug3);
|
||||
@@ -1215,6 +1228,13 @@ ItemInst* SharedDatabase::CreateItem(const Item_Struct* item, int16 charges, uin
|
||||
ItemInst* inst = nullptr;
|
||||
if (item) {
|
||||
inst = CreateBaseItem(item, charges);
|
||||
|
||||
if (inst == nullptr) {
|
||||
LogFile->write(EQEMuLog::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()");
|
||||
LogFile->write(EQEMuLog::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
inst->PutAugment(this, 0, aug1);
|
||||
inst->PutAugment(this, 1, aug2);
|
||||
inst->PutAugment(this, 2, aug3);
|
||||
@@ -1240,6 +1260,12 @@ ItemInst* SharedDatabase::CreateBaseItem(const Item_Struct* item, int16 charges)
|
||||
|
||||
inst = new ItemInst(item, charges);
|
||||
|
||||
if (inst == nullptr) {
|
||||
LogFile->write(EQEMuLog::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateBaseItem()");
|
||||
LogFile->write(EQEMuLog::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if(item->CharmFileID != 0 || (item->LoreGroup >= 1000 && item->LoreGroup != -1)) {
|
||||
inst->Initialize(this);
|
||||
}
|
||||
|
||||
+3
-1
@@ -141,11 +141,13 @@ uint32 Timer::GetRemainingTime() {
|
||||
}
|
||||
}
|
||||
|
||||
void Timer::SetAtTrigger(uint32 in_set_at_trigger, bool iEnableIfDisabled) {
|
||||
void Timer::SetAtTrigger(uint32 in_set_at_trigger, bool iEnableIfDisabled, bool ChangeTimerTime) {
|
||||
set_at_trigger = in_set_at_trigger;
|
||||
if (!Enabled() && iEnableIfDisabled) {
|
||||
Enable();
|
||||
}
|
||||
if (ChangeTimerTime)
|
||||
timer_time = set_at_trigger;
|
||||
}
|
||||
|
||||
void Timer::Trigger()
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ public:
|
||||
inline const uint32& GetTimerTime() { return timer_time; }
|
||||
inline const uint32& GetSetAtTrigger() { return set_at_trigger; }
|
||||
void Trigger();
|
||||
void SetAtTrigger(uint32 set_at_trigger, bool iEnableIfDisabled = false);
|
||||
void SetAtTrigger(uint32 set_at_trigger, bool iEnableIfDisabled = false, bool ChangeTimerTime = false);
|
||||
|
||||
inline bool Enabled() { return enabled; }
|
||||
inline uint32 GetStartTime() { return(start_time); }
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@
|
||||
Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
||||
*/
|
||||
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9062
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9066
|
||||
#define COMPILE_DATE __DATE__
|
||||
#define COMPILE_TIME __TIME__
|
||||
#ifndef WIN32
|
||||
|
||||
Reference in New Issue
Block a user