diff --git a/common/patches/laurion.cpp b/common/patches/laurion.cpp index c028db8ae..bfcb03ad8 100644 --- a/common/patches/laurion.cpp +++ b/common/patches/laurion.cpp @@ -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(ServerToLaurionCastingSlot(static_cast(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: diff --git a/common/patches/laurion_ops.h b/common/patches/laurion_ops.h index 14c8f8182..3e2485a84 100644 --- a/common/patches/laurion_ops.h +++ b/common/patches/laurion_ops.h @@ -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) diff --git a/common/patches/laurion_structs.h b/common/patches/laurion_structs.h index 7c9870937..9ed1829e4 100644 --- a/common/patches/laurion_structs.h +++ b/common/patches/laurion_structs.h @@ -898,6 +898,12 @@ namespace Laurion { /*36*/ //int32 augment_slot; /*40*/ }; + + struct ApplyPoison_Struct + { + TypelessInventorySlot_Struct inventorySlot; + uint32 success; + }; #pragma pack() }; //end namespace structs diff --git a/utils/patches/patch_Laurion.conf b/utils/patches/patch_Laurion.conf index 89aa1845c..40381fe43 100644 --- a/utils/patches/patch_Laurion.conf +++ b/utils/patches/patch_Laurion.conf @@ -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