Validated up to OP_MemorizeSpell (still needs testing in client)

This commit is contained in:
dannuic
2026-04-17 18:07:39 -06:00
parent 2da6d3f37c
commit ec5a9d0bd4
5 changed files with 52 additions and 6 deletions
+34
View File
@@ -957,6 +957,23 @@ namespace TOB
FINISH_ENCODE();
}
ENCODE(OP_MemorizeSpell) {
ENCODE_LENGTH_EXACT(MemorizeSpell_Struct);
SETUP_DIRECT_ENCODE(MemorizeSpell_Struct, structs::MemorizeSpell_Struct);
// TODO: TOB has a "finish memming" value (2) here, might be needed to keep client spell gems in sync
if (emu->scribing == 2)
eq->scribing = 3;
else
OUT(scribing);
OUT(slot);
OUT(spell_id);
OUT(reduction);
FINISH_ENCODE();
}
ENCODE(OP_MobHealth) {
ENCODE_LENGTH_EXACT(SpawnHPUpdate_Struct2);
SETUP_DIRECT_ENCODE(SpawnHPUpdate_Struct2, structs::MobHealth_Struct);
@@ -3821,6 +3838,23 @@ namespace TOB
DECODE_FORWARD(OP_GroupInvite);
}
DECODE(OP_MemorizeSpell) {
DECODE_LENGTH_EXACT(structs::MemorizeSpell_Struct);
SETUP_DIRECT_DECODE(MemorizeSpell_Struct, structs::MemorizeSpell_Struct);
// TODO: TOB has a "finish memming" value (2) here, might be needed to keep client spell gems in sync
if (emu->scribing == 3)
eq->scribing = 2;
else
IN(scribing);
IN(slot);
IN(spell_id);
IN(reduction);
FINISH_DIRECT_DECODE();
}
DECODE(OP_MoveItem)
{
DECODE_LENGTH_EXACT(structs::MoveItem_Struct);
+2
View File
@@ -33,6 +33,7 @@ E(OP_Illusion)
E(OP_ItemPacket)
E(OP_LogServer)
E(OP_ManaChange)
E(OP_MemorizeSpell)
E(OP_MobHealth)
E(OP_MoneyOnCorpse)
E(OP_MoveItem)
@@ -84,6 +85,7 @@ D(OP_GMTraining)
D(OP_GroupDisband)
D(OP_GroupInvite)
D(OP_GroupInvite2)
D(OP_MemorizeSpell)
D(OP_MoveItem)
D(OP_RemoveBlockedBuffs)
D(OP_SetServerFilter)
+8 -1
View File
@@ -675,11 +675,18 @@ namespace TOB {
/*000*/ uint32 spell_id;
/*004*/ uint16 caster_id;
/*006*/ uint32 cast_time; // in miliseconds
/*010*/ uint32 unknown0a; // I think this is caster effective level but im not sure. live always sends 0
/*010*/ uint32 unknown0a; // I think this is caster effective level but im not sure. live always sends 0. The client uses this for the spell link
/*014*/ uint8 unknown0e; // 0 will short circuit the cast, seen 1 from live usually, maybe related to interrupts or particles or something
/*015*/
};
struct MemorizeSpell_Struct {
uint32 slot; // Spot in the spell book/memorized slot
uint32 spell_id; // Spell id (200 or c8 is minor healing, etc)
uint32 scribing; // -1 refreshes book, 0 scribe to book, 2 end mem, 1 start mem, 3 unmem, 4 set activated item keyring -- client will send back 2 if a 0 operation updated a memorized spell of the same group + subgroup
uint32 reduction; // lower reuse (only used if scribing is 4)
};
//I've observed 5 s16 that are all -1.
//Clicky items don't even trigger this as far as i can tell so not sure what this is for now.
//One of these could have changed to a s32 but im not sure.