-Basic move item support.

-Update some Laurion limits to better support new item slots.
-Camping on Laurion will now work like it does on live.
-Fixed a few of the Laurion exp messages (this will need some work).  Packet calc is still all fked up.
This commit is contained in:
KimLS
2024-12-02 22:41:20 -08:00
parent 392998325b
commit af8f85cfd9
7 changed files with 89 additions and 15 deletions
+29 -1
View File
@@ -1178,7 +1178,7 @@ namespace Laurion
//u32 claim_count;
out.WriteUInt32(0);
//Claim claims[claim_count];
//Claim claims[claim_count];
//Tribute tribute;
/*
@@ -2657,6 +2657,20 @@ namespace Laurion
FINISH_ENCODE();
}
ENCODE(OP_MoveItem)
{
ENCODE_LENGTH_EXACT(MoveItem_Struct);
SETUP_DIRECT_ENCODE(MoveItem_Struct, structs::MoveItem_Struct);
Log(Logs::Detail, Logs::Netcode, "Laurion::ENCODE(OP_MoveItem)");
eq->from_slot = ServerToLaurionSlot(emu->from_slot);
eq->to_slot = ServerToLaurionSlot(emu->to_slot);
OUT(number_in_stack);
FINISH_ENCODE();
}
// DECODE methods
DECODE(OP_EnterWorld)
@@ -2831,6 +2845,20 @@ namespace Laurion
FINISH_DIRECT_DECODE();
}
DECODE(OP_MoveItem)
{
DECODE_LENGTH_EXACT(structs::MoveItem_Struct);
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
Log(Logs::Detail, Logs::Netcode, "Laurion::DECODE(OP_MoveItem)");
emu->from_slot = LaurionToServerSlot(eq->from_slot);
emu->to_slot = LaurionToServerSlot(eq->to_slot);
IN(number_in_stack);
FINISH_DIRECT_DECODE();
}
//Naive version but should work well enough for now
int ExtractIDFile(const std::string& input) {
std::string number;
+7 -4
View File
@@ -170,6 +170,8 @@ namespace Laurion
slotGeneral8,
slotGeneral9,
slotGeneral10,
slotGeneral11,
slotGeneral12,
slotCursor
};
@@ -188,6 +190,7 @@ namespace Laurion
const int16 EQUIPMENT_END = slotAmmo;
const int16 EQUIPMENT_COUNT = (EQUIPMENT_END - EQUIPMENT_BEGIN) + 1;
//We support more if enabled but for now lets leave it at the 10 slots
const int16 GENERAL_BEGIN = slotGeneral1;
const int16 GENERAL_END = slotGeneral10;
const int16 GENERAL_COUNT = (GENERAL_END - GENERAL_BEGIN) + 1;
@@ -200,10 +203,10 @@ namespace Laurion
const int16 CORPSE_END = invslot::slotGeneral1 + invslot::slotCursor;
const uint64 EQUIPMENT_BITMASK = 0x00000000007FFFFF;
const uint64 GENERAL_BITMASK = 0x00000001FF800000;
const uint64 CURSOR_BITMASK = 0x0000000200000000;
const uint64 POSSESSIONS_BITMASK = (EQUIPMENT_BITMASK | GENERAL_BITMASK | CURSOR_BITMASK); // based on 34-slot count (RoF+)
const uint64 CORPSE_BITMASK = (GENERAL_BITMASK | CURSOR_BITMASK | (EQUIPMENT_BITMASK << 34)); // based on 34-slot count (RoF+)
const uint64 GENERAL_BITMASK = 0x00000007FF800000;
const uint64 CURSOR_BITMASK = 0x0000000800000000;
const uint64 POSSESSIONS_BITMASK = (EQUIPMENT_BITMASK | GENERAL_BITMASK | CURSOR_BITMASK); // based on 36-slot count (Laurion+)
const uint64 CORPSE_BITMASK = (GENERAL_BITMASK | CURSOR_BITMASK | (EQUIPMENT_BITMASK << 36)); // based on 36-slot count (Laurion+)
const char* GetInvPossessionsSlotName(int16 inv_slot);
+2
View File
@@ -30,6 +30,7 @@ E(OP_HPUpdate)
E(OP_Damage)
E(OP_Animation)
E(OP_Death)
E(OP_MoveItem)
//list of packets we need to decode on the way in:
D(OP_EnterWorld)
D(OP_ZoneEntry)
@@ -42,6 +43,7 @@ D(OP_Consider)
D(OP_ConsiderCorpse)
D(OP_ClickDoor)
D(OP_SpawnAppearance)
D(OP_MoveItem)
#undef E
#undef D
+16
View File
@@ -587,6 +587,22 @@ namespace Laurion {
/*040*/
};
struct DeleteItem_Struct
{
/*0000*/ InventorySlot_Struct from_slot;
/*0012*/ InventorySlot_Struct to_slot;
/*0024*/ uint32 number_in_stack;
/*0028*/
};
struct MoveItem_Struct
{
/*0000*/ InventorySlot_Struct from_slot;
/*0012*/ InventorySlot_Struct to_slot;
/*0024*/ uint32 number_in_stack;
/*0028*/
};
#pragma pack()
}; //end namespace structs