From 33164dc47ae052ad5dcc7253906b2c783e02e0a3 Mon Sep 17 00:00:00 2001 From: KimLS Date: Mon, 30 Dec 2024 19:39:26 -0800 Subject: [PATCH] Added rof2 style discipline opcodes. Might need work but looking at assembly looks like it might work too. --- common/patches/laurion.cpp | 10 ++++++++++ common/patches/laurion_ops.h | 1 + common/patches/laurion_structs.h | 4 ++++ utils/patches/patch_Laurion.conf | 4 ++-- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/common/patches/laurion.cpp b/common/patches/laurion.cpp index 9fa50a63c..feb38f6b3 100644 --- a/common/patches/laurion.cpp +++ b/common/patches/laurion.cpp @@ -557,6 +557,16 @@ namespace Laurion FINISH_ENCODE(); } + ENCODE(OP_DisciplineUpdate) + { + ENCODE_LENGTH_EXACT(Disciplines_Struct); + SETUP_DIRECT_ENCODE(Disciplines_Struct, structs::Disciplines_Struct); + + memcpy(&eq->values, &emu->values, sizeof(Disciplines_Struct)); + + FINISH_ENCODE(); + } + ENCODE(OP_ExpansionInfo) { ENCODE_LENGTH_EXACT(ExpansionInfo_Struct); diff --git a/common/patches/laurion_ops.h b/common/patches/laurion_ops.h index c4d7be633..d665f8e1e 100644 --- a/common/patches/laurion_ops.h +++ b/common/patches/laurion_ops.h @@ -19,6 +19,7 @@ E(OP_Death) E(OP_DeleteCharge) E(OP_DeleteItem) E(OP_DeleteSpawn) +E(OP_DisciplineUpdate) E(OP_ExpansionInfo) E(OP_ExpUpdate) E(OP_FormattedMessage) diff --git a/common/patches/laurion_structs.h b/common/patches/laurion_structs.h index 6d14ccdb3..ddd75a7b9 100644 --- a/common/patches/laurion_structs.h +++ b/common/patches/laurion_structs.h @@ -948,6 +948,10 @@ namespace Laurion { /*12*/ InventorySlot_Struct guildtribute_slot; // Slot type is 8? (MapGuildTribute = 8) /*24*/ }; + + struct Disciplines_Struct { + uint32 values[MAX_PP_DISCIPLINES]; + }; #pragma pack() }; //end namespace structs diff --git a/utils/patches/patch_Laurion.conf b/utils/patches/patch_Laurion.conf index 7471131f1..b89301765 100644 --- a/utils/patches/patch_Laurion.conf +++ b/utils/patches/patch_Laurion.conf @@ -339,8 +339,8 @@ OP_ItemViewUnknown=0x0000 OP_VetRewardsAvaliable=0x0000 OP_VetClaimRequest=0x0000 OP_VetClaimReply=0x0000 -OP_DisciplineUpdate=0x0000 -OP_DisciplineTimer=0x0000 +OP_DisciplineUpdate=0x6ce4 +OP_DisciplineTimer=0x7436 OP_BecomeCorpse=0x0000 # Unused? OP_Action2=0x0000 # Unused? OP_MobUpdate=0x0000