AA struct work

This commit is contained in:
KimLS 2024-12-16 18:08:27 -08:00
parent 33ab28c1e0
commit 62a84388c0
5 changed files with 61 additions and 18 deletions

View File

@ -3162,6 +3162,30 @@ namespace Laurion
FINISH_ENCODE();
}
ENCODE(OP_RespondAA)
{
SETUP_DIRECT_ENCODE(AATable_Struct, structs::AATable_Struct);
eq->aa_spent = emu->aa_spent;
// These fields may need to be correctly populated at some point
eq->aapoints_assigned[0] = emu->aa_spent;
eq->aapoints_assigned[1] = 0;
eq->aapoints_assigned[2] = 0;
eq->aapoints_assigned[3] = 0;
eq->aapoints_assigned[4] = 0;
eq->aapoints_assigned[5] = 0;
for (uint32 i = 0; i < MAX_PP_AA_ARRAY; ++i)
{
eq->aa_list[i].AA = emu->aa_list[i].AA;
eq->aa_list[i].value = emu->aa_list[i].value;
eq->aa_list[i].charges = emu->aa_list[i].charges;
eq->aa_list[i].bUnknown0x0c = false;
}
FINISH_ENCODE();
}
// DECODE methods
DECODE(OP_EnterWorld)

View File

@ -7,7 +7,6 @@ E(OP_SendMaxCharacters)
E(OP_SendCharInfo)
E(OP_ExpansionInfo)
E(OP_SpawnAppearance)
//E(OP_SendAATable)
E(OP_PlayerProfile)
E(OP_ZoneEntry)
E(OP_ZoneSpawns)
@ -44,6 +43,7 @@ E(OP_MobHealth)
E(OP_GMTraining)
E(OP_GMTrainSkillConfirm)
E(OP_SkillUpdate)
E(OP_RespondAA)
//list of packets we need to decode on the way in:
D(OP_EnterWorld)
D(OP_ZoneEntry)

View File

@ -765,6 +765,26 @@ namespace Laurion {
/*12*/
};
struct AA_Array
{
uint32 AA;
uint32 value;
uint32 charges; // expendable charges
bool bUnknown0x0c; // added test winter 2024; removed sometime in summer 2024
};
struct AATable_Struct {
/*00*/ uint32 aa_spent; // Total AAs Spent
/*04*/ uint32 aapoints_assigned[6]; // none, general, arch, class, special, focus, merc
/*24*/ AA_Array aa_list[MAX_PP_AA_ARRAY];
};
struct AltAdvStats_Struct {
/*000*/ uint32 experience;
/*004*/ uint32 unspent;
/*008*/ uint8 percentage;
/*009*/ uint8 unknown009[3];
};
#pragma pack()
}; //end namespace structs

View File

@ -97,10 +97,10 @@ OP_SendExpZonein=0x02b4
OP_SendAATable=0x5f30
OP_ClearAA=0x3498
OP_ClearLeadershipAbilities=0x0000 #removed; leadership abilities are baked in and always on
OP_RespondAA=0x0000
OP_UpdateAA=0x0000
OP_SendAAStats=0x0000
OP_AAExpUpdate=0x0000 #0x642f
OP_RespondAA=0x4c67
OP_UpdateAA=0x3b30
OP_SendAAStats=0x7d65 #i'll be honest i think this was removed at some point but this is the op at the spot in the list
OP_AAExpUpdate=0x642f #need to look into whether this has changed; exp did
OP_ExpUpdate=0x611d
OP_HPUpdate=0x775c
OP_ManaChange=0x700f
@ -299,11 +299,11 @@ OP_SaveOnZoneReq=0x3bfe
OP_ReadBook=0x0000
OP_Dye=0x0000
OP_InterruptCast=0x0000
OP_AAAction=0x0000
OP_AAAction=0x71BB
OP_LeadershipExpToggle=0x0000
OP_LeadershipExpUpdate=0x0000
OP_PurchaseLeadershipAA=0x0000
OP_UpdateLeadershipAA=0x0000
OP_PurchaseLeadershipAA=0x0000 #removed, these act as if all purchased now
OP_UpdateLeadershipAA=0x0000 #removed, these act as if all purchased now
OP_MarkNPC=0x0000
OP_ClearNPCMarks=0x0000
OP_DelegateAbility=0x0000
@ -366,7 +366,7 @@ OP_OpenContainer=0x0000
OP_Marquee=0x0000
OP_ItemRecastDelay=0x0000
#OP_OpenInventory=0x0000 # Likely does not exist in RoF -U
OP_ResetAA=0x0000
OP_ResetAA=0x53c0
OP_Fling=0x0000
OP_CancelSneakHide=0x0000
OP_AggroMeterLockTarget=0x0000
@ -546,7 +546,7 @@ OP_GroupLeaderChange=0x0000
OP_GroupRoles=0x0000
OP_GroupMakeLeader=0x0000
OP_DoGroupLeadershipAbility=0x0000
OP_GroupLeadershipAAUpdate=0x0000
OP_GroupLeadershipAAUpdate=0x0000 # removed these act as if you have always purchased them
OP_GroupMentor=0x0000
OP_InspectBuffs=0x0000

View File

@ -537,18 +537,17 @@ void Client::SendZoneInPackets()
outapp = new EQApplicationPacket(OP_ExpUpdate, sizeof(ExpUpdate_Struct));
ExpUpdate_Struct* eu = (ExpUpdate_Struct*)outapp->pBuffer;
auto tmpxp2 = GetEXPForLevel(GetLevel() + 1);
auto tmpxp1 = GetEXPForLevel(GetLevel());
uint32 tmpxp1 = GetEXPForLevel(GetLevel() + 1);
uint32 tmpxp2 = GetEXPForLevel(GetLevel());
// Crash bug fix... Divide by zero when tmpxp1 and 2 equalled each other, most likely the error case from GetEXPForLevel() (invalid class, etc)
if (tmpxp1 != tmpxp2 && tmpxp1 != 0xFFFFFFFF && tmpxp2 != 0xFFFFFFFF) {
float tmpxp = (float)((float)m_pp.exp - tmpxp2) / ((float)tmpxp1 - tmpxp2);
eu->exp = (uint32)(330.0f * tmpxp);
FastQueuePacket(&outapp);
}
else {
eu->exp = 0;
FastQueuePacket(&outapp);
outapp->priority = 6;
QueuePacket(outapp);
}
safe_delete(outapp);
SendAlternateAdvancementTimers();