From 852667016d02e69a1fae166f04f56561ad061169 Mon Sep 17 00:00:00 2001 From: KimLS Date: Mon, 16 Dec 2024 22:13:37 -0800 Subject: [PATCH] Blocked buffs --- common/patches/laurion.cpp | 39 ++++++++++++++++++++++++++++++++ common/patches/laurion_ops.h | 5 ++++ common/patches/laurion_structs.h | 10 ++++++++ utils/patches/patch_Laurion.conf | 16 ++++++------- 4 files changed, 62 insertions(+), 8 deletions(-) diff --git a/common/patches/laurion.cpp b/common/patches/laurion.cpp index 7ce971e39..7f32bcd02 100644 --- a/common/patches/laurion.cpp +++ b/common/patches/laurion.cpp @@ -3186,6 +3186,27 @@ namespace Laurion FINISH_ENCODE(); } + ENCODE(OP_BlockedBuffs) + { + ENCODE_LENGTH_EXACT(BlockedBuffs_Struct); + SETUP_DIRECT_ENCODE(BlockedBuffs_Struct, structs::BlockedBuffs_Struct); + + for (uint32 i = 0; i < BLOCKED_BUFF_COUNT; ++i) + eq->SpellID[i] = emu->SpellID[i]; + + for (uint32 i = BLOCKED_BUFF_COUNT; i < structs::BLOCKED_BUFF_COUNT; ++i) + eq->SpellID[i] = -1; + + OUT(Count); + OUT(Pet); + OUT(Initialise); + OUT(Flags); + + FINISH_ENCODE(); + } + + ENCODE(OP_RemoveBlockedBuffs) { ENCODE_FORWARD(OP_BlockedBuffs); } + // DECODE methods DECODE(OP_EnterWorld) @@ -3415,6 +3436,24 @@ namespace Laurion FINISH_DIRECT_DECODE(); } + DECODE(OP_BlockedBuffs) + { + DECODE_LENGTH_EXACT(structs::BlockedBuffs_Struct); + SETUP_DIRECT_DECODE(BlockedBuffs_Struct, structs::BlockedBuffs_Struct); + + for (uint32 i = 0; i < BLOCKED_BUFF_COUNT; ++i) + emu->SpellID[i] = eq->SpellID[i]; + + IN(Count); + IN(Pet); + IN(Initialise); + IN(Flags); + + FINISH_DIRECT_DECODE(); + } + + DECODE(OP_RemoveBlockedBuffs) { DECODE_FORWARD(OP_BlockedBuffs); } + //Naive version but should work well enough for now int ExtractIDFile(const std::string& input) { std::string number; diff --git a/common/patches/laurion_ops.h b/common/patches/laurion_ops.h index 13a33ec71..e9aa1d734 100644 --- a/common/patches/laurion_ops.h +++ b/common/patches/laurion_ops.h @@ -44,6 +44,9 @@ E(OP_GMTraining) E(OP_GMTrainSkillConfirm) E(OP_SkillUpdate) E(OP_RespondAA) +E(OP_BlockedBuffs) +E(OP_RemoveBlockedBuffs) + //list of packets we need to decode on the way in: D(OP_EnterWorld) D(OP_ZoneEntry) @@ -60,6 +63,8 @@ D(OP_MoveItem) D(OP_ShopRequest) D(OP_CastSpell) D(OP_GMTraining) +D(OP_BlockedBuffs) +D(OP_RemoveBlockedBuffs) #undef E #undef D diff --git a/common/patches/laurion_structs.h b/common/patches/laurion_structs.h index 28a205366..2ee8d1b6a 100644 --- a/common/patches/laurion_structs.h +++ b/common/patches/laurion_structs.h @@ -12,6 +12,7 @@ namespace Laurion { static const uint32 MAX_PP_UNKNOWN_ABILITIES = 25; static const uint32 MAX_RECAST_TYPES = 25; static const uint32 MAX_ITEM_RECAST_TYPES = 100; + static const uint32 BLOCKED_BUFF_COUNT = 40; static const uint32 BUFF_COUNT = 62; static const uint32 MAX_PP_LANGUAGE = 32; #pragma pack(1) @@ -785,6 +786,15 @@ namespace Laurion { /*008*/ uint8 percentage; /*009*/ uint8 unknown009[3]; }; + + struct BlockedBuffs_Struct + { + /*000*/ int32 SpellID[BLOCKED_BUFF_COUNT]; + /*120*/ uint32 Count; + /*124*/ uint8 Pet; + /*125*/ uint8 Initialise; + /*126*/ uint16 Flags; + }; #pragma pack() }; //end namespace structs diff --git a/utils/patches/patch_Laurion.conf b/utils/patches/patch_Laurion.conf index 5b0e6f09e..0c77a42f7 100644 --- a/utils/patches/patch_Laurion.conf +++ b/utils/patches/patch_Laurion.conf @@ -19,7 +19,6 @@ OP_ApproveWorld=0x0000 OP_LogServer=0x6d4d OP_SendCharInfo=0x832 OP_ExpansionInfo=0x066d -OP_GuildsList=0x0000 OP_EnterWorld=0x6691 OP_PostEnterWorld=0x2062 OP_World_Client_CRC1=0x74c8 @@ -89,9 +88,9 @@ OP_ReqClientSpawn=0x6732 OP_SpawnDoor=0x4273 OP_GroundSpawn=0x49c5 OP_SendZonepoints=0x279f -OP_BlockedBuffs=0x0000 -OP_RemoveBlockedBuffs=0x0000 -OP_ClearBlockedBuffs=0x0000 +OP_BlockedBuffs=0x4fdb +OP_RemoveBlockedBuffs=0x53cd +OP_ClearBlockedBuffs=0x5752 OP_WorldObjectsSent=0x2879 OP_SendExpZonein=0x02b4 OP_SendAATable=0x5f30 @@ -106,8 +105,6 @@ OP_HPUpdate=0x775c OP_ManaChange=0x700f OP_TGB=0x0000 #removed; tgb is baked in and always on OP_SpecialMesg=0x7d93 -OP_GuildMemberList=0x0000 -OP_GuildMOTD=0x0000 OP_CharInventory=0x21d6 OP_WearChange=0x44c0 OP_ClientUpdate=0x3a4b @@ -115,6 +112,9 @@ OP_ClientReady=0x0831 OP_SetServerFilter=0x6b7f # Guild Opcodes +OP_GuildsList=0x0000 +OP_GuildMemberList=0x0000 +OP_GuildMOTD=0x0000 OP_GetGuildMOTD=0x0000 OP_GetGuildMOTDReply=0x0000 OP_GuildMemberUpdate=0x0000 @@ -174,9 +174,9 @@ OP_InspectRequest=0x0000 OP_InspectAnswer=0x0000 OP_InspectMessageUpdate=0x0000 OP_BeginCast=0x31f9 -OP_ColoredText=0x0000 +OP_ColoredText=0x0f3c OP_ConsentResponse=0x0000 -OP_MemorizeSpell=0x0000 +OP_MemorizeSpell=0x1d31 OP_LinkedReuse=0x0000 OP_SwapSpell=0x0000 OP_CastSpell=0x325b