WIP; buff doesn't seem to full work; need to fix op_action

This commit is contained in:
KimLS 2024-12-07 19:42:40 -08:00
parent 7083a74b31
commit 13f57f3c5d
3 changed files with 48 additions and 10 deletions

View File

@ -2938,6 +2938,7 @@ namespace Laurion
ENCODE(OP_BeginCast) ENCODE(OP_BeginCast)
{ {
ENCODE_LENGTH_EXACT(BeginCast_Struct);
SETUP_DIRECT_ENCODE(BeginCast_Struct, structs::BeginCast_Struct); SETUP_DIRECT_ENCODE(BeginCast_Struct, structs::BeginCast_Struct);
OUT(spell_id); OUT(spell_id);
@ -3034,6 +3035,19 @@ namespace Laurion
} }
} }
ENCODE(OP_ManaChange) {
ENCODE_LENGTH_EXACT(ManaChange_Struct);
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
OUT(new_mana);
OUT(stamina);
OUT(spell_id);
OUT(keepcasting);
OUT(slot);
FINISH_ENCODE();
}
// DECODE methods // DECODE methods
DECODE(OP_EnterWorld) DECODE(OP_EnterWorld)
@ -3239,13 +3253,12 @@ namespace Laurion
emu->slot = static_cast<uint32>(LaurionToServerCastingSlot(static_cast<spells::CastingSlot>(eq->slot))); emu->slot = static_cast<uint32>(LaurionToServerCastingSlot(static_cast<spells::CastingSlot>(eq->slot)));
//We need to figure out the x y z position stuff
IN(spell_id); IN(spell_id);
emu->inventoryslot = LaurionToServerSlot(eq->inventory_slot); emu->inventoryslot = -1;
IN(target_id); IN(target_id);
//IN(y_pos); IN(y_pos);
//IN(x_pos); IN(x_pos);
//IN(z_pos); IN(z_pos);
FINISH_DIRECT_DECODE(); FINISH_DIRECT_DECODE();
} }

View File

@ -38,6 +38,7 @@ E(OP_ShopRequest)
E(OP_BeginCast) E(OP_BeginCast)
E(OP_BuffCreate) E(OP_BuffCreate)
E(OP_Buff) E(OP_Buff)
E(OP_ManaChange)
//list of packets we need to decode on the way in: //list of packets we need to decode on the way in:
D(OP_EnterWorld) D(OP_EnterWorld)
D(OP_ZoneEntry) D(OP_ZoneEntry)

View File

@ -631,14 +631,29 @@ namespace Laurion {
/*015*/ /*015*/
}; };
//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.
struct CastSpellInventorySlot_Struct {
/*00*/ int16 type;
/*02*/ int16 slot;
/*04*/ int16 sub_index;
/*06*/ int16 aug_index;
/*08*/ int16 unknown1;
/*10*/
};
struct CastSpell_Struct struct CastSpell_Struct
{ {
/*00*/ uint32 slot; /*00*/ uint32 slot;
/*04*/ uint32 spell_id; /*04*/ uint32 spell_id;
/*08*/ InventorySlot_Struct inventory_slot; // slot for clicky item, Seen unknown of 131 = normal cast /*08*/ CastSpellInventorySlot_Struct inventory_slot;
/*20*/ uint32 spell_crc; // this is pinstSpellManager_x->SpellsCrc[spell_id] /*18*/ uint32 target_id;
/*24*/ uint32 target_id; /*22*/ uint32 spell_crc;
/*28*/ uint8 unknown2[11]; /*26*/ float y_pos;
/*30*/ float x_pos;
/*34*/ float z_pos;
/*38*/ uint8 unknown; //not sure, might also be before y_pos; only ever seen zero for both but should be easy to figure out later
/*39*/ /*39*/
}; };
@ -680,6 +695,15 @@ namespace Laurion {
/*168*/ /*168*/
}; };
struct ManaChange_Struct
{
uint32 new_mana;
uint32 stamina;
uint32 spell_id;
uint32 keepcasting;
int32 slot;
};
#pragma pack() #pragma pack()
}; //end namespace structs }; //end namespace structs