From be0c6b5e0584d9f60729af49a47ac913842c46d2 Mon Sep 17 00:00:00 2001 From: KimLS Date: Sat, 14 Dec 2024 19:37:10 -0800 Subject: [PATCH] Work on skill updates. --- common/patches/laurion.cpp | 25 +++++++++++++++++++++++++ common/patches/laurion_ops.h | 2 ++ common/patches/laurion_structs.h | 17 +++++++++++++++++ utils/patches/patch_Laurion.conf | 14 +++++++------- 4 files changed, 51 insertions(+), 7 deletions(-) diff --git a/common/patches/laurion.cpp b/common/patches/laurion.cpp index a31f77d02..74cd716ef 100644 --- a/common/patches/laurion.cpp +++ b/common/patches/laurion.cpp @@ -3137,6 +3137,31 @@ namespace Laurion FINISH_ENCODE(); } + ENCODE(OP_GMTrainSkillConfirm) + { + ENCODE_LENGTH_EXACT(GMTrainSkillConfirm_Struct); + SETUP_DIRECT_ENCODE(GMTrainSkillConfirm_Struct, structs::GMTrainSkillConfirm_Struct); + + OUT(SkillID); + OUT(Cost); + OUT(NewSkill); + OUT_str(TrainerName); + + FINISH_ENCODE(); + } + + ENCODE(OP_SkillUpdate) + { + ENCODE_LENGTH_EXACT(SkillUpdate_Struct); + SETUP_DIRECT_ENCODE(SkillUpdate_Struct, structs::SkillUpdate_Struct); + + OUT(skillId); + OUT(value); + eq->active = 1; + + FINISH_ENCODE(); + } + // DECODE methods DECODE(OP_EnterWorld) diff --git a/common/patches/laurion_ops.h b/common/patches/laurion_ops.h index b975c6561..fb0d63898 100644 --- a/common/patches/laurion_ops.h +++ b/common/patches/laurion_ops.h @@ -42,6 +42,8 @@ E(OP_ManaChange) E(OP_Action) E(OP_MobHealth) E(OP_GMTraining) +E(OP_GMTrainSkillConfirm) +E(OP_SkillUpdate) //list of packets we need to decode on the way in: D(OP_EnterWorld) D(OP_ZoneEntry) diff --git a/common/patches/laurion_structs.h b/common/patches/laurion_structs.h index 2e4364be9..0cd5c9a57 100644 --- a/common/patches/laurion_structs.h +++ b/common/patches/laurion_structs.h @@ -748,6 +748,23 @@ namespace Laurion { /*444*/ }; + struct GMTrainSkillConfirm_Struct { + /*000*/ uint32 SkillID; + /*004*/ uint32 Cost; + /*008*/ uint8 NewSkill; // Set to 1 for 'You have learned the basics' message. + /*009*/ char TrainerName[64]; + /*073*/ uint8 Unknown073[3]; + /*076*/ + }; + + struct SkillUpdate_Struct { + /*00*/ uint32 skillId; + /*04*/ uint32 value; + /*08*/ uint8 active; + /*09*/ uint8 padding[3]; + /*12*/ + }; + #pragma pack() }; //end namespace structs diff --git a/utils/patches/patch_Laurion.conf b/utils/patches/patch_Laurion.conf index 75ffa04cd..ab7bb36aa 100644 --- a/utils/patches/patch_Laurion.conf +++ b/utils/patches/patch_Laurion.conf @@ -188,15 +188,15 @@ OP_Illusion=0x0000 OP_MoneyOnCorpse=0x0000 OP_RandomReply=0x0000 OP_DenyResponse=0x0000 -OP_SkillUpdate=0x04c -OP_GMTrainSkillConfirm=0x0000 +OP_SkillUpdate=0x6735 +OP_GMTrainSkillConfirm=0x6fbc OP_RandomReq=0x0000 OP_Death=0x429a OP_GMTraining=0x7c7a -OP_GMEndTraining=0x0000 -OP_GMTrainSkill=0x0000 +OP_GMEndTraining=0x3ec6 +OP_GMTrainSkill=0x54e1 OP_Animation=0x79c7 -OP_Begging=0x0000 +OP_Begging=0x7ded OP_Consent=0x0000 OP_ConsentDeny=0x0000 OP_AutoFire=0x0000 @@ -219,8 +219,8 @@ OP_Feedback=0x0000 OP_Report=0x0000 OP_Damage=0x7d07 OP_ChannelMessage=0x6adc -OP_Assist=0x0000 -OP_AssistGroup=0x0000 +OP_Assist=0x51f1 +OP_AssistGroup=0x3f23 OP_MoveCoin=0x0000 OP_ZonePlayerToBind=0x0000 OP_KeyRing=0x0000