diff --git a/common/eq_packet_structs.h b/common/eq_packet_structs.h index e5ab88e57..8e9f97138 100644 --- a/common/eq_packet_structs.h +++ b/common/eq_packet_structs.h @@ -726,6 +726,7 @@ struct AA_Array { uint32 AA; uint32 value; + uint32 charges; }; @@ -4276,14 +4277,6 @@ struct AA_Action { /*12*/ uint32 exp_value; }; - -struct AA_Skills { //this should be removed and changed to AA_Array -/*00*/ uint32 aa_skill; // Total AAs Spent -/*04*/ uint32 aa_value; -/*08*/ uint32 unknown08; -/*12*/ -}; - struct AAExpUpdate_Struct { /*00*/ uint32 unknown00; //seems to be a value from AA_Action.ability /*04*/ uint32 aapoints_unspent; @@ -4301,12 +4294,12 @@ struct AltAdvStats_Struct { }; struct PlayerAA_Struct { // Is this still used? - AA_Skills aa_list[MAX_PP_AA_ARRAY]; + AA_Array aa_list[MAX_PP_AA_ARRAY]; }; struct AATable_Struct { /*00*/ int32 aa_spent; // Total AAs Spent -/*04*/ AA_Skills aa_list[MAX_PP_AA_ARRAY]; +/*04*/ AA_Array aa_list[MAX_PP_AA_ARRAY]; }; struct Weather_Struct { diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index fae650eb5..f4f01e300 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -2120,7 +2120,7 @@ namespace RoF { outapp->WriteUInt32(emu->aa_array[r].AA); outapp->WriteUInt32(emu->aa_array[r].value); - outapp->WriteUInt32(0); + outapp->WriteUInt32(emu->aa_array[r].charges); } // Fill the other 60 AAs with zeroes @@ -2818,9 +2818,9 @@ namespace RoF for (uint32 i = 0; i < MAX_PP_AA_ARRAY; ++i) { - eq->aa_list[i].aa_skill = emu->aa_list[i].aa_skill; - eq->aa_list[i].aa_value = emu->aa_list[i].aa_value; - eq->aa_list[i].unknown08 = emu->aa_list[i].unknown08; + 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; } FINISH_ENCODE(); @@ -2868,9 +2868,9 @@ namespace RoF OUT(cost); OUT(seq); OUT(current_level); - eq->unknown037 = 1; // Introduced during HoT + eq->prereq_skill_count = 1; // min 1 OUT(prereq_skill); - eq->unknown045 = 1; // New Mar 21 2012 - Seen 1 + eq->prereq_minpoints_count = 1; // min 1 OUT(prereq_minpoints); eq->type = emu->sof_type; OUT(spellid); @@ -2886,6 +2886,7 @@ namespace RoF OUT(cost2); eq->aa_expansion = emu->aa_expansion; eq->special_category = emu->special_category; + eq->expendable_charges = emu->special_category == 7 ? 1 : 0; // temp hack, this can actually be any number OUT(total_abilities); unsigned int r; for (r = 0; r < emu->total_abilities; r++) { diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 42e97b9eb..096467edf 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -2200,7 +2200,7 @@ namespace RoF2 { outapp->WriteUInt32(emu->aa_array[r].AA); outapp->WriteUInt32(emu->aa_array[r].value); - outapp->WriteUInt32(0); + outapp->WriteUInt32(emu->aa_array[r].charges); } // Fill the other 60 AAs with zeroes @@ -2907,9 +2907,9 @@ namespace RoF2 for (uint32 i = 0; i < MAX_PP_AA_ARRAY; ++i) { - eq->aa_list[i].aa_skill = emu->aa_list[i].aa_skill; - eq->aa_list[i].aa_value = emu->aa_list[i].aa_value; - eq->aa_list[i].unknown08 = emu->aa_list[i].unknown08; + 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; } FINISH_ENCODE(); @@ -2957,9 +2957,9 @@ namespace RoF2 OUT(cost); OUT(seq); OUT(current_level); - eq->unknown037 = 1; // Introduced during HoT + eq->prereq_skill_count = 1; // min 1 OUT(prereq_skill); - eq->unknown045 = 1; // New Mar 21 2012 - Seen 1 + eq->prereq_minpoints_count = 1; // min 1 OUT(prereq_minpoints); eq->type = emu->sof_type; OUT(spellid); @@ -2976,6 +2976,7 @@ namespace RoF2 eq->aa_expansion = emu->aa_expansion; eq->special_category = emu->special_category; OUT(total_abilities); + eq->expendable_charges = emu->special_category == 7 ? 1 : 0; // temp hack, this can actually be any number unsigned int r; for (r = 0; r < emu->total_abilities; r++) { OUT(abilities[r].skill_id); diff --git a/common/patches/rof2_structs.h b/common/patches/rof2_structs.h index a572a3834..812e9c464 100644 --- a/common/patches/rof2_structs.h +++ b/common/patches/rof2_structs.h @@ -877,7 +877,7 @@ struct AA_Array { uint32 AA; uint32 value; - uint32 unknown08; // Looks like AA_Array is now 12 bytes in Live + uint32 charges; // expendable charges }; struct Disciplines_Struct { @@ -4253,9 +4253,9 @@ struct SendAA_Struct { /*0025*/ uint32 cost; /*0029*/ uint32 seq; /*0033*/ uint32 current_level; //1s, MQ2 calls this AARankRequired -/*0037*/ uint32 unknown037; // Introduced during HoT +/*0037*/ uint32 prereq_skill_count; // mutliple prereqs at least 1, even no prereqs /*0041*/ uint32 prereq_skill; //is < 0, abs() is category # -/*0045*/ uint32 unknown045; // New Mar 21 2012 - Seen 1 +/*0045*/ uint32 prereq_minpoints_count; // mutliple prereqs at least 1, even no prereqs /*0049*/ uint32 prereq_minpoints; //min points in the prereq /*0053*/ uint32 type; /*0057*/ uint32 spellid; @@ -4268,10 +4268,16 @@ struct SendAA_Struct { /*0081*/ uint32 last_id; /*0085*/ uint32 next_id; /*0089*/ uint32 cost2; -/*0093*/ uint8 unknown80[7]; +/*0093*/ uint8 unknown93; +/*0094*/ uint8 grant_only; // VetAAs, progression, etc +/*0095*/ uint8 unknown95; // 1 for skill cap increase AAs, Mystical Attuning, and RNG attack inc, doesn't seem to matter though +/*0096*/ uint32 expendable_charges; // max charges of the AA /*0100*/ uint32 aa_expansion; /*0104*/ uint32 special_category; -/*0108*/ uint32 unknown0096; +/*0108*/ uint8 shroud; +/*0109*/ uint8 unknown109; +/*0110*/ uint8 layonhands; // 1 for lay on hands -- doesn't seem to matter? +/*0111*/ uint8 unknown111; /*0112*/ uint32 total_abilities; /*0116*/ AA_Ability abilities[0]; }; @@ -4288,12 +4294,6 @@ struct AA_Action { /*16*/ }; -struct AA_Skills { //this should be removed and changed to AA_Array -/*00*/ uint32 aa_skill; // Total AAs Spent -/*04*/ uint32 aa_value; -/*08*/ uint32 unknown08; -/*12*/ -}; struct AAExpUpdate_Struct { /*00*/ uint32 unknown00; //seems to be a value from AA_Action.ability @@ -4313,14 +4313,7 @@ struct AltAdvStats_Struct { }; struct PlayerAA_Struct { // Is this still used? - AA_Skills aa_list[MAX_PP_AA_ARRAY]; -}; - -struct AA_Values { -/*00*/ uint32 aa_skill; -/*04*/ uint32 aa_value; -/*08*/ uint32 unknown08; -/*12*/ + AA_Array aa_list[MAX_PP_AA_ARRAY]; }; struct AATable_Struct { @@ -4330,7 +4323,7 @@ struct AATable_Struct { /*12*/ uint32 aa_spent_archetype; // Seen 40 /*16*/ uint32 aa_spent_class; // Seen 103 /*20*/ uint32 aa_spent_special; // Seen 0 -/*24*/ AA_Values aa_list[MAX_PP_AA_ARRAY]; +/*24*/ AA_Array aa_list[MAX_PP_AA_ARRAY]; }; struct Weather_Struct { diff --git a/common/patches/rof_structs.h b/common/patches/rof_structs.h index 7db21597c..a87b530c4 100644 --- a/common/patches/rof_structs.h +++ b/common/patches/rof_structs.h @@ -866,7 +866,7 @@ struct AA_Array { uint32 AA; uint32 value; - uint32 unknown08; // Looks like AA_Array is now 12 bytes in Live + uint32 charges; // expendable charges }; struct Disciplines_Struct { @@ -4252,9 +4252,9 @@ struct SendAA_Struct { /*0025*/ uint32 cost; /*0029*/ uint32 seq; /*0033*/ uint32 current_level; //1s, MQ2 calls this AARankRequired -/*0037*/ uint32 unknown037; // Introduced during HoT +/*0037*/ uint32 prereq_skill_count; // mutliple prereqs at least 1, even no prereqs /*0041*/ uint32 prereq_skill; //is < 0, abs() is category # -/*0045*/ uint32 unknown045; // New Mar 21 2012 - Seen 1 +/*0045*/ uint32 prereq_minpoints_count; // mutliple prereqs at least 1, even no prereqs /*0049*/ uint32 prereq_minpoints; //min points in the prereq /*0053*/ uint32 type; /*0057*/ uint32 spellid; @@ -4267,10 +4267,16 @@ struct SendAA_Struct { /*0081*/ uint32 last_id; /*0085*/ uint32 next_id; /*0089*/ uint32 cost2; -/*0093*/ uint8 unknown80[7]; +/*0093*/ uint8 unknown93; +/*0094*/ uint8 grant_only; // VetAAs, progression, etc +/*0095*/ uint8 unknown95; // 1 for skill cap increase AAs, Mystical Attuning, and RNG attack inc, doesn't seem to matter though +/*0096*/ uint32 expendable_charges; // max charges of the AA /*0100*/ uint32 aa_expansion; /*0104*/ uint32 special_category; -/*0108*/ uint32 unknown0096; +/*0108*/ uint8 shroud; +/*0109*/ uint8 unknown109; +/*0110*/ uint8 layonhands; // 1 for lay on hands -- doesn't seem to matter? +/*0111*/ uint8 unknown111; /*0112*/ uint32 total_abilities; /*0116*/ AA_Ability abilities[0]; }; @@ -4287,13 +4293,6 @@ struct AA_Action { /*16*/ }; -struct AA_Skills { //this should be removed and changed to AA_Array -/*00*/ uint32 aa_skill; // Total AAs Spent -/*04*/ uint32 aa_value; -/*08*/ uint32 unknown08; -/*12*/ -}; - struct AAExpUpdate_Struct { /*00*/ uint32 unknown00; //seems to be a value from AA_Action.ability /*04*/ uint32 aapoints_unspent; @@ -4312,14 +4311,7 @@ struct AltAdvStats_Struct { }; struct PlayerAA_Struct { // Is this still used? - AA_Skills aa_list[MAX_PP_AA_ARRAY]; -}; - -struct AA_Values { -/*00*/ uint32 aa_skill; -/*04*/ uint32 aa_value; -/*08*/ uint32 unknown08; -/*12*/ + AA_Array aa_list[MAX_PP_AA_ARRAY]; }; struct AATable_Struct { @@ -4329,7 +4321,7 @@ struct AATable_Struct { /*12*/ uint32 aa_spent_archetype; // Seen 40 /*16*/ uint32 aa_spent_class; // Seen 103 /*20*/ uint32 aa_spent_special; // Seen 0 -/*24*/ AA_Values aa_list[MAX_PP_AA_ARRAY]; +/*24*/ AA_Array aa_list[MAX_PP_AA_ARRAY]; }; struct Weather_Struct { diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 0a8073131..80201da1e 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -1558,6 +1558,7 @@ namespace SoD for (r = 0; r < MAX_PP_AA_ARRAY; r++) { OUT(aa_array[r].AA); OUT(aa_array[r].value); + OUT(aa_array[r].charges); } // OUT(unknown02220[4]); OUT(mana); @@ -1898,6 +1899,7 @@ namespace SoD OUT(cost2); eq->aa_expansion = emu->aa_expansion; eq->special_category = emu->special_category; + eq->expendable_charges = emu->special_category == 7 ? 1 : 0; // temp hack, this can actually be any number OUT(total_abilities); unsigned int r; for (r = 0; r < emu->total_abilities; r++) { diff --git a/common/patches/sod_structs.h b/common/patches/sod_structs.h index 2b7178daf..2f5d2c2db 100644 --- a/common/patches/sod_structs.h +++ b/common/patches/sod_structs.h @@ -666,7 +666,7 @@ struct AA_Array { uint32 AA; uint32 value; - uint32 unknown08; // Looks like AA_Array is now 12 bytes in Live + uint32 charges; // expendable }; @@ -3819,10 +3819,16 @@ struct SendAA_Struct { /*0069*/ uint32 last_id; /*0073*/ uint32 next_id; /*0077*/ uint32 cost2; -/*0081*/ uint8 unknown80[7]; +/*0081*/ uint8 unknown81; +/*0082*/ uint8 grant_only; // VetAAs, progression, etc +/*0083*/ uint8 unknown83; // 1 for skill cap increase AAs, Mystical Attuning, and RNG attack inc, doesn't seem to matter though +/*0084*/ uint32 expendable_charges; // max charges of the AA /*0088*/ uint32 aa_expansion; /*0092*/ uint32 special_category; -/*0096*/ uint32 unknown0096; +/*0096*/ uint8 shroud; +/*0097*/ uint8 unknown97; +/*0098*/ uint8 layonhands; // 1 for lay on hands -- doesn't seem to matter? +/*0099*/ uint8 unknown99; /*0100*/ uint32 total_abilities; /*0104*/ AA_Ability abilities[0]; }; @@ -3838,12 +3844,6 @@ struct AA_Action { /*12*/ uint32 exp_value; }; -struct AA_Skills { //this should be removed and changed to AA_Array -/*00*/ uint32 aa_skill; // Total AAs Spent -/*04*/ uint32 aa_value; -/*08*/ uint32 unknown08; -}; - struct AAExpUpdate_Struct { /*00*/ uint32 unknown00; //seems to be a value from AA_Action.ability /*04*/ uint32 aapoints_unspent; @@ -3861,12 +3861,12 @@ struct AltAdvStats_Struct { }; struct PlayerAA_Struct { // Is this still used? - AA_Skills aa_list[MAX_PP_AA_ARRAY]; + AA_Array aa_list[MAX_PP_AA_ARRAY]; }; struct AATable_Struct { /*00*/ int32 aa_spent; // Total AAs Spent -/*04*/ AA_Skills aa_list[MAX_PP_AA_ARRAY]; +/*04*/ AA_Array aa_list[MAX_PP_AA_ARRAY]; }; struct Weather_Struct { diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index f0e8a2dbe..7b0e14c1c 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -1216,6 +1216,7 @@ namespace SoF for (r = 0; r < MAX_PP_AA_ARRAY; r++) { OUT(aa_array[r].AA); OUT(aa_array[r].value); + OUT(aa_array[r].charges); } // OUT(unknown02220[4]); OUT(mana); @@ -1557,6 +1558,7 @@ namespace SoF OUT(cost2); eq->aa_expansion = emu->aa_expansion; eq->special_category = emu->special_category; + eq->expendable_charges = emu->special_category == 7 ? 1 : 0; // temp hack, this can actually be any number OUT(total_abilities); unsigned int r; for (r = 0; r < emu->total_abilities; r++) { diff --git a/common/patches/sof_structs.h b/common/patches/sof_structs.h index f7ad59011..afd34ba68 100644 --- a/common/patches/sof_structs.h +++ b/common/patches/sof_structs.h @@ -645,7 +645,7 @@ struct AA_Array { uint32 AA; uint32 value; - uint32 unknown08; // Looks like AA_Array is now 12 bytes in Live + uint32 charges; // expendable charges }; @@ -3683,10 +3683,14 @@ struct SendAA_Struct { /*0069*/ uint32 last_id; /*0073*/ uint32 next_id; /*0077*/ uint32 cost2; -/*0081*/ uint8 unknown80[7]; +/*0081*/ uint8 unknown81; +/*0082*/ uint8 grant_only; // VetAAs, progression, etc +/*0083*/ uint8 unknown83; // 1 for skill cap increase AAs, Mystical Attuning, and RNG attack inc, doesn't seem to matter though +/*0084*/ uint32 expendable_charges; // max charges of the AA /*0088*/ uint32 aa_expansion; /*0092*/ uint32 special_category; -/*0096*/ uint16 unknown0096; +/*0096*/ uint8 shroud; +/*0097*/ uint8 unknown97; /*0098*/ uint32 total_abilities; /*0102*/ AA_Ability abilities[0]; }; @@ -3702,12 +3706,6 @@ struct AA_Action { /*12*/ uint32 exp_value; }; -struct AA_Skills { //this should be removed and changed to AA_Array -/*00*/ uint32 aa_skill; // Total AAs Spent -/*04*/ uint32 aa_value; -/*08*/ uint32 unknown08; -}; - struct AAExpUpdate_Struct { /*00*/ uint32 unknown00; //seems to be a value from AA_Action.ability /*04*/ uint32 aapoints_unspent; @@ -3725,12 +3723,12 @@ struct AltAdvStats_Struct { }; struct PlayerAA_Struct { - AA_Skills aa_list[MAX_PP_AA_ARRAY]; + AA_Array aa_list[MAX_PP_AA_ARRAY]; }; struct AATable_Struct { /*00*/ int32 aa_spent; // Total AAs Spent -/*04*/ AA_Skills aa_list[MAX_PP_AA_ARRAY]; +/*04*/ AA_Array aa_list[MAX_PP_AA_ARRAY]; }; struct Weather_Struct { diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index e23202c87..2fda4038a 100644 --- a/common/patches/titanium.cpp +++ b/common/patches/titanium.cpp @@ -1098,8 +1098,8 @@ namespace Titanium unsigned int r; for (r = 0; r < structs::MAX_PP_AA_ARRAY; r++) { - OUT(aa_list[r].aa_skill); - OUT(aa_list[r].aa_value); + OUT(aa_list[r].AA); + OUT(aa_list[r].value); } FINISH_ENCODE(); diff --git a/common/patches/titanium_structs.h b/common/patches/titanium_structs.h index bdca057d0..f836395c9 100644 --- a/common/patches/titanium_structs.h +++ b/common/patches/titanium_structs.h @@ -3179,11 +3179,6 @@ struct AA_Action { /*12*/ uint32 exp_value; }; -struct AA_Skills { //this should be removed and changed to AA_Array -/*00*/ uint32 aa_skill; -/*04*/ uint32 aa_value; -}; - struct AAExpUpdate_Struct { /*00*/ uint32 unknown00; //seems to be a value from AA_Action.ability /*04*/ uint32 aapoints_unspent; @@ -3201,11 +3196,11 @@ struct AltAdvStats_Struct { }; struct PlayerAA_Struct { - AA_Skills aa_list[MAX_PP_AA_ARRAY]; + AA_Array aa_list[MAX_PP_AA_ARRAY]; }; struct AATable_Struct { - AA_Skills aa_list[MAX_PP_AA_ARRAY]; + AA_Array aa_list[MAX_PP_AA_ARRAY]; }; struct Weather_Struct { diff --git a/common/patches/uf.cpp b/common/patches/uf.cpp index e963312e2..deedcec5f 100644 --- a/common/patches/uf.cpp +++ b/common/patches/uf.cpp @@ -1807,6 +1807,7 @@ namespace UF for (r = 0; r < MAX_PP_AA_ARRAY; r++) { OUT(aa_array[r].AA); OUT(aa_array[r].value); + OUT(aa_array[r].charges); } // OUT(unknown02220[4]); OUT(mana); @@ -2134,9 +2135,9 @@ namespace UF for (uint32 i = 0; i < MAX_PP_AA_ARRAY; ++i) { - eq->aa_list[i].aa_skill = emu->aa_list[i].aa_skill; - eq->aa_list[i].aa_value = emu->aa_list[i].aa_value; - eq->aa_list[i].unknown08 = emu->aa_list[i].unknown08; + 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; } FINISH_ENCODE(); @@ -2181,6 +2182,7 @@ namespace UF OUT(cost2); eq->aa_expansion = emu->aa_expansion; eq->special_category = emu->special_category; + eq->expendable_charges = emu->special_category == 7 ? 1 : 0; // temp hack, this can actually be any number OUT(total_abilities); unsigned int r; for (r = 0; r < emu->total_abilities; r++) { diff --git a/common/patches/uf_structs.h b/common/patches/uf_structs.h index 79363d68a..c943c6ea5 100644 --- a/common/patches/uf_structs.h +++ b/common/patches/uf_structs.h @@ -713,7 +713,7 @@ struct AA_Array { uint32 AA; uint32 value; - uint32 unknown08; // Looks like AA_Array is now 12 bytes in Underfoot + uint32 charges; // expendable }; @@ -3892,10 +3892,16 @@ struct SendAA_Struct { /*0069*/ uint32 last_id; /*0073*/ uint32 next_id; /*0077*/ uint32 cost2; -/*0081*/ uint8 unknown80[7]; +/*0081*/ uint8 unknown81; +/*0082*/ uint8 grant_only; // VetAAs, progression, etc +/*0083*/ uint8 unknown83; // 1 for skill cap increase AAs, Mystical Attuning, and RNG attack inc, doesn't seem to matter though +/*0084*/ uint32 expendable_charges; // max charges of the AA /*0088*/ uint32 aa_expansion; /*0092*/ uint32 special_category; -/*0096*/ uint32 unknown0096; +/*0096*/ uint8 shroud; +/*0097*/ uint8 unknown97; +/*0098*/ uint8 layonhands; // 1 for lay on hands -- doesn't seem to matter? +/*0099*/ uint8 unknown99; /*0100*/ uint32 total_abilities; /*0104*/ AA_Ability abilities[0]; }; @@ -3911,11 +3917,6 @@ struct AA_Action { /*12*/ uint32 exp_value; }; -struct AA_Skills { //this should be removed and changed to AA_Array -/*00*/ uint32 aa_skill; // Total AAs Spent -/*04*/ uint32 aa_value; -/*08*/ uint32 unknown08; -}; struct AAExpUpdate_Struct { /*00*/ uint32 unknown00; //seems to be a value from AA_Action.ability @@ -3934,7 +3935,7 @@ struct AltAdvStats_Struct { }; struct PlayerAA_Struct { // Is this still used? - AA_Skills aa_list[MAX_PP_AA_ARRAY]; + AA_Array aa_list[MAX_PP_AA_ARRAY]; }; struct AATable_Struct { @@ -3944,7 +3945,7 @@ struct AATable_Struct { /*12*/ int32 unknown012; /*16*/ int32 unknown016; /*20*/ int32 unknown020; -/*24*/ AA_Skills aa_list[MAX_PP_AA_ARRAY]; +/*24*/ AA_Array aa_list[MAX_PP_AA_ARRAY]; }; struct Weather_Struct { diff --git a/common/version.h b/common/version.h index 78f7a67b3..1813f77c3 100644 --- a/common/version.h +++ b/common/version.h @@ -30,7 +30,7 @@ Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt */ -#define CURRENT_BINARY_DATABASE_VERSION 9082 +#define CURRENT_BINARY_DATABASE_VERSION 9083 #define COMPILE_DATE __DATE__ #define COMPILE_TIME __TIME__ #ifndef WIN32 diff --git a/utils/sql/db_update_manifest.txt b/utils/sql/db_update_manifest.txt index 5ca25a029..e7aa46221 100644 --- a/utils/sql/db_update_manifest.txt +++ b/utils/sql/db_update_manifest.txt @@ -336,6 +336,7 @@ 9080|2015_05_23_PetBuffInstrumentMod.sql|SHOW COLUMNS FROM `character_pet_buffs` LIKE 'instrument_mod'|empty| 9081|2015_05_23_dbstr_us.sql|SHOW TABLES LIKE 'db_str'|empty| 9082|2015_05_25_npc_types_texture_fields.sql|SHOW COLUMNS FROM `npc_types` LIKE 'armtexture'|empty| +9083|2015_06_07_aa_update.sql|SHOW COLUMNS FROM `character_alternate_abilities` LIKE 'charges'|empty| # Upgrade conditions: # This won't be needed after this system is implemented, but it is used database that are not diff --git a/zone/aa.cpp b/zone/aa.cpp index b6e220d60..3718e3391 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -1104,9 +1104,9 @@ void Client::SendAATable() { uint32 i; for(i=0;i < MAX_PP_AA_ARRAY;i++){ - aa2->aa_list[i].aa_skill = aa[i]->AA; - aa2->aa_list[i].aa_value = aa[i]->value; - aa2->aa_list[i].unknown08 = 0; + aa2->aa_list[i].AA = aa[i]->AA; + aa2->aa_list[i].value = aa[i]->value; + aa2->aa_list[i].charges = aa[i]->charges; } QueuePacket(outapp); safe_delete(outapp); @@ -1395,6 +1395,8 @@ uint32 Client::GetAA(uint32 aa_id) const { bool Client::SetAA(uint32 aa_id, uint32 new_value) { aa_points[aa_id] = new_value; uint32 cur; + auto sendaa = zone->FindAA(aa_id); // this is a bit hacky + uint32 charges = sendaa->special_category == 7 && new_value ? 1 : 0; for(cur=0;cur < MAX_PP_AA_ARRAY;cur++){ if((aa[cur]->value > 1) && ((aa[cur]->AA - aa[cur]->value + 1)== aa_id)){ aa[cur]->value = new_value; @@ -1402,6 +1404,7 @@ bool Client::SetAA(uint32 aa_id, uint32 new_value) { aa[cur]->AA++; else aa[cur]->AA = 0; + aa[cur]->charges = charges; return true; } else if((aa[cur]->value == 1) && (aa[cur]->AA == aa_id)){ @@ -1410,11 +1413,13 @@ bool Client::SetAA(uint32 aa_id, uint32 new_value) { aa[cur]->AA++; else aa[cur]->AA = 0; + aa[cur]->charges = charges; return true; } else if(aa[cur]->AA==0){ //end of list aa[cur]->AA = aa_id; aa[cur]->value = new_value; + aa[cur]->charges = charges; return true; } } @@ -1485,8 +1490,10 @@ void Client::ResetAA(){ for (i=0; i < MAX_PP_AA_ARRAY; i++) { aa[i]->AA = 0; aa[i]->value = 0; - m_pp.aa_array[MAX_PP_AA_ARRAY].AA = 0; - m_pp.aa_array[MAX_PP_AA_ARRAY].value = 0; + aa[i]->charges = 0; + m_pp.aa_array[i].AA = 0; + m_pp.aa_array[i].value = 0; + m_pp.aa_array[i].charges= 0; } std::map::iterator itr; diff --git a/zone/client.cpp b/zone/client.cpp index bdcbbbf68..f7e160851 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -550,13 +550,13 @@ bool Client::SaveAA(){ } m_pp.aapoints_spent = spentpoints + m_epp.expended_aa; for (int a = 0; a < MAX_PP_AA_ARRAY; a++) { - if (aa[a]->AA > 0 && aa[a]->value){ + if (aa[a]->AA > 0) { // those with value 0 will be cleaned up on next load if (first_entry != 1){ - rquery = StringFormat("REPLACE INTO `character_alternate_abilities` (id, slot, aa_id, aa_value)" - " VALUES (%u, %u, %u, %u)", character_id, a, aa[a]->AA, aa[a]->value); + rquery = StringFormat("REPLACE INTO `character_alternate_abilities` (id, slot, aa_id, aa_value, charges)" + " VALUES (%u, %u, %u, %u, %u)", character_id, a, aa[a]->AA, aa[a]->value, aa[a]->charges); first_entry = 1; } - rquery = rquery + StringFormat(", (%u, %u, %u, %u)", character_id, a, aa[a]->AA, aa[a]->value); + rquery = rquery + StringFormat(", (%u, %u, %u, %u, %u)", character_id, a, aa[a]->AA, aa[a]->value, aa[a]->charges); } } auto results = database.QueryDatabase(rquery); diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index e4ce874fc..b9ac81d89 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -1440,12 +1440,14 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) if (m_pp.ldon_points_available < 0 || m_pp.ldon_points_available > 2000000000){ m_pp.ldon_points_available = 0; } /* Initialize AA's : Move to function eventually */ - for (uint32 a = 0; a < MAX_PP_AA_ARRAY; a++){ aa[a] = &m_pp.aa_array[a]; } + for (uint32 a = 0; a < MAX_PP_AA_ARRAY; a++) + aa[a] = &m_pp.aa_array[a]; query = StringFormat( "SELECT " "slot, " "aa_id, " - "aa_value " + "aa_value, " + "charges " "FROM " "`character_alternate_abilities` " "WHERE `id` = %u ORDER BY `slot`", this->CharacterID()); @@ -1454,8 +1456,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) i = atoi(row[0]); m_pp.aa_array[i].AA = atoi(row[1]); m_pp.aa_array[i].value = atoi(row[2]); - aa[i]->AA = atoi(row[1]); - aa[i]->value = atoi(row[2]); + m_pp.aa_array[i].charges = atoi(row[3]); } for (uint32 a = 0; a < MAX_PP_AA_ARRAY; a++){ uint32 id = aa[a]->AA; diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index e81a66308..08a3dd38a 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -1710,10 +1710,10 @@ bool ZoneDatabase::SaveCharacterCurrency(uint32 character_id, PlayerProfile_Stru return true; } -bool ZoneDatabase::SaveCharacterAA(uint32 character_id, uint32 aa_id, uint32 current_level){ - std::string rquery = StringFormat("REPLACE INTO `character_alternate_abilities` (id, aa_id, aa_value)" - " VALUES (%u, %u, %u)", - character_id, aa_id, current_level); +bool ZoneDatabase::SaveCharacterAA(uint32 character_id, uint32 aa_id, uint32 current_level, uint32 charges){ + std::string rquery = StringFormat("REPLACE INTO `character_alternate_abilities` (id, aa_id, aa_value, charges)" + " VALUES (%u, %u, %u, %u)", + character_id, aa_id, current_level, charges); auto results = QueryDatabase(rquery); Log.Out(Logs::General, Logs::None, "Saving AA for character ID: %u, aa_id: %u current_level: %u", character_id, aa_id, current_level); return true; diff --git a/zone/zonedb.h b/zone/zonedb.h index cac380a96..1fb4d3b29 100644 --- a/zone/zonedb.h +++ b/zone/zonedb.h @@ -278,7 +278,7 @@ public: bool SaveCharacterBindPoint(uint32 character_id, uint32 zone_id, uint32 instance_id, const glm::vec4& position, uint8 is_home); bool SaveCharacterCurrency(uint32 character_id, PlayerProfile_Struct* pp); bool SaveCharacterData(uint32 character_id, uint32 account_id, PlayerProfile_Struct* pp, ExtendedProfile_Struct* m_epp); - bool SaveCharacterAA(uint32 character_id, uint32 aa_id, uint32 current_level); + bool SaveCharacterAA(uint32 character_id, uint32 aa_id, uint32 current_level, uint32 charges); bool SaveCharacterSpell(uint32 character_id, uint32 spell_id, uint32 slot_id); bool SaveCharacterMemorizedSpell(uint32 character_id, uint32 spell_id, uint32 slot_id); bool SaveCharacterMaterialColor(uint32 character_id, uint32 slot_id, uint32 color);