Basic spellcasting works a bit.

This commit is contained in:
KimLS
2024-12-08 22:56:34 -08:00
parent 13f57f3c5d
commit ce98118cc8
4 changed files with 59 additions and 6 deletions
+23
View File
@@ -3048,6 +3048,29 @@ namespace Laurion
FINISH_ENCODE();
}
ENCODE(OP_Action) {
ENCODE_LENGTH_EXACT(Action_Struct);
SETUP_DIRECT_ENCODE(Action_Struct, structs::MissileHitInfo);
//This is mostly figured out; there's two unknowns, only unknown1 is read by the client
OUT(target);
OUT(source);
eq->spell_id = emu->spell;
eq->effect_type = emu->effect_flag;
eq->effective_casting_level = 0; //if you set this to != 0 it will use this level instead of calculating it
eq->unknown1 = 0;
eq->unknown2 = 0;
eq->damage = 0; //client doesn't read this but live sends it here, can just set 0
eq->modifier = 1.0f + (emu->instrument_mod - 10) / 10.0f;
OUT(force);
OUT(hit_heading);
OUT(hit_pitch);
eq->skill = emu->type;
OUT(level);
FINISH_ENCODE();
}
// DECODE methods
DECODE(OP_EnterWorld)
+1
View File
@@ -39,6 +39,7 @@ E(OP_BeginCast)
E(OP_BuffCreate)
E(OP_Buff)
E(OP_ManaChange)
E(OP_Action)
//list of packets we need to decode on the way in:
D(OP_EnterWorld)
D(OP_ZoneEntry)
+29
View File
@@ -704,6 +704,35 @@ namespace Laurion {
int32 slot;
};
//This is what we call OP_Action
//To the client though this is basically a missile hit though
//OP_Action is basically "instant missile hit" to the client
//@0x1401f0970 MissileHitInfo::Deserialize(CUnSerializeBuffer *buffer);
struct MissileHitInfo
{
uint16 target;
uint16 source;
uint32 spell_id;
//4 leaves a buff
uint32 effect_type;
uint32 effective_casting_level;
//Client does read this but only does something if it's negative
int64 unknown1;
//I don't see the client read this one outside basic serialization
int64 unknown2;
//I don't see the client read this one either but based on captures from live it seems to match spell damage
int64 damage;
float modifier;
float force;
float hit_heading;
float hit_pitch;
//same convention as damage
//231 for spell, otherwise it's skill in use
uint8 skill;
uint8 level; //the client doesn't actually deserialize anything past level
//live however has a lot more info here depending on packet type
};
#pragma pack()
}; //end namespace structs