-ApplyPoison

-Encode CastSpell (needs to be checked more)
-Decode animation
This commit is contained in:
KimLS 2024-12-29 19:37:15 -08:00
parent bd2798f2cc
commit 0241a90505
4 changed files with 80 additions and 1 deletions

View File

@ -70,6 +70,7 @@ namespace Laurion
static inline uint32 LaurionToServerCorpseSlot(structs::InventorySlot_Struct laurion_corpse_slot);
static inline uint32 LaurionToServerCorpseMainSlot(uint32 laurion_corpse_slot);
static inline uint32 LaurionToServerTypelessSlot(structs::TypelessInventorySlot_Struct laurion_slot, int16 laurion_type);
static inline structs::InventorySlot_Struct LaurionCastingInventorySlotToInventorySlot(structs::CastSpellInventorySlot_Struct laurion_slot);
// Item packet types
static item::ItemPacketType ServerToLaurionItemPacketType(ItemPacketType laurion_type);
@ -193,6 +194,17 @@ namespace Laurion
FINISH_ENCODE();
}
ENCODE(OP_ApplyPoison)
{
ENCODE_LENGTH_EXACT(ApplyPoison_Struct);
SETUP_DIRECT_ENCODE(ApplyPoison_Struct, structs::ApplyPoison_Struct);
eq->inventorySlot = ServerToLaurionTypelessSlot(emu->inventorySlot, EQ::invtype::typePossessions);
OUT(success);
FINISH_ENCODE();
}
ENCODE(OP_AugmentInfo)
{
ENCODE_LENGTH_EXACT(AugmentInfo_Struct);
@ -323,6 +335,22 @@ namespace Laurion
FINISH_ENCODE();
}
ENCODE(OP_CastSpell)
{
ENCODE_LENGTH_EXACT(CastSpell_Struct);
SETUP_DIRECT_ENCODE(CastSpell_Struct, structs::CastSpell_Struct);
eq->slot = static_cast<uint32>(ServerToLaurionCastingSlot(static_cast<EQ::spells::CastingSlot>(emu->slot)));
OUT(spell_id);
//we should double check this cause it feels wrong
eq->inventory_slot = LaurionInventorySlotToCastingInventorySlot(ServerToLaurionSlot(emu->inventoryslot));
//OUT(inventoryslot);
OUT(target_id);
FINISH_ENCODE();
}
ENCODE(OP_ChannelMessage)
{
EQApplicationPacket* in = *p;
@ -3308,6 +3336,29 @@ namespace Laurion
}
// DECODE methods
DECODE(OP_Animation)
{
DECODE_LENGTH_EXACT(structs::Animation_Struct);
SETUP_DIRECT_DECODE(Animation_Struct, structs::Animation_Struct);
IN(spawnid);
IN(action);
IN(speed);
FINISH_DIRECT_DECODE();
}
DECODE(OP_ApplyPoison)
{
DECODE_LENGTH_EXACT(structs::ApplyPoison_Struct);
SETUP_DIRECT_DECODE(ApplyPoison_Struct, structs::ApplyPoison_Struct);
emu->inventorySlot = LaurionToServerTypelessSlot(eq->inventorySlot, invtype::typePossessions);
IN(success);
FINISH_DIRECT_DECODE();
}
DECODE(OP_AugmentInfo)
{
DECODE_LENGTH_EXACT(structs::AugmentInfo_Struct);
@ -5050,6 +5101,24 @@ namespace Laurion
return ServerSlot;
}
static inline structs::InventorySlot_Struct LaurionCastingInventorySlotToInventorySlot(structs::CastSpellInventorySlot_Struct laurion_slot) {
structs::InventorySlot_Struct ret;
ret.Type = laurion_slot.type;
ret.Slot = laurion_slot.slot;
ret.SubIndex = laurion_slot.sub_index;
ret.AugIndex = laurion_slot.aug_index;
return ret;
}
static inline structs::CastSpellInventorySlot_Struct LaurionInventorySlotToCastingInventorySlot(structs::InventorySlot_Struct laurion_slot) {
structs::CastSpellInventorySlot_Struct ret;
ret.type = laurion_slot.Type;
ret.slot = laurion_slot.Slot;
ret.sub_index = laurion_slot.SubIndex;
ret.aug_index = laurion_slot.AugIndex;
return ret;
}
static item::ItemPacketType ServerToLaurionItemPacketType(ItemPacketType server_type) {
switch (server_type) {
case ItemPacketType::ItemPacketMerchant:

View File

@ -2,11 +2,13 @@
//list of packets we need to encode on the way out:
E(OP_Action)
E(OP_Animation)
E(OP_ApplyPoison)
E(OP_AugmentInfo)
E(OP_BeginCast)
E(OP_BlockedBuffs)
E(OP_Buff)
E(OP_BuffCreate)
E(OP_CastSpell)
E(OP_ChannelMessage)
E(OP_CharInventory)
E(OP_ClientUpdate)
@ -53,6 +55,8 @@ E(OP_ZonePlayerToBind)
E(OP_ZoneSpawns)
//list of packets we need to decode on the way in:
D(OP_Animation)
D(OP_ApplyPoison)
D(OP_AugmentInfo)
D(OP_AugmentItem)
D(OP_BlockedBuffs)

View File

@ -898,6 +898,12 @@ namespace Laurion {
/*36*/ //int32 augment_slot;
/*40*/
};
struct ApplyPoison_Struct
{
TypelessInventorySlot_Struct inventorySlot;
uint32 success;
};
#pragma pack()
}; //end namespace structs

View File

@ -284,7 +284,7 @@ OP_AugmentItem=0x3a1b
OP_WeaponEquip1=0x0000
OP_PlayerStateAdd=0x2178
OP_PlayerStateRemove=0x178e
OP_ApplyPoison=0x0000
OP_ApplyPoison=0x55b9
OP_Save=0x6da2
OP_TestBuff=0x0000
OP_CustomTitles=0x0000