From 57a196a50c96d3d7f3a5c52665c872fcd5b8a4b4 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Fri, 5 Dec 2014 22:26:01 -0500 Subject: [PATCH 1/4] Rename OP_ShroudClearAA to OP_ClearAA --- utils/patches/patch_RoF.conf | 2 +- utils/patches/patch_SoD.conf | 2 +- utils/patches/patch_SoF.conf | 2 +- utils/patches/patch_Underfoot.conf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/patches/patch_RoF.conf b/utils/patches/patch_RoF.conf index 16973c202..db0e2dbba 100644 --- a/utils/patches/patch_RoF.conf +++ b/utils/patches/patch_RoF.conf @@ -94,7 +94,7 @@ OP_ClearBlockedBuffs=0x5d3c OP_WorldObjectsSent=0x7fa8 OP_SendExpZonein=0x25ab OP_SendAATable=0x7791 -OP_ShroudClearAA=0x422e +OP_ClearAA=0x422e OP_RespondAA=0x379d OP_UpdateAA=0x504f OP_SendAAStats=0x3d1c diff --git a/utils/patches/patch_SoD.conf b/utils/patches/patch_SoD.conf index f42231238..fca095db7 100644 --- a/utils/patches/patch_SoD.conf +++ b/utils/patches/patch_SoD.conf @@ -531,7 +531,7 @@ OP_Shroud=0x6d1f OP_ShroudRemove=0x17f6 OP_ShroudUnknown1=0x169a OP_ShroudUnknown2=0x4292 -OP_ShroudClearAA=0x3bef +OP_ClearAA=0x3bef OP_ShroudSelectionWindow=0x4d79 OP_ShroudRequestStats=0x28ce OP_ShroudRespondStats=0x33f2 diff --git a/utils/patches/patch_SoF.conf b/utils/patches/patch_SoF.conf index 7b0c41ad2..8b8629d7c 100644 --- a/utils/patches/patch_SoF.conf +++ b/utils/patches/patch_SoF.conf @@ -85,7 +85,7 @@ OP_TaskActivity=0x2E60 #SEQ 12/04/08 OP_CompletedTasks=0x75AC #Derision 2009 OP_Weather=0x70A5 #SEQ 12/04/08 OP_SendAATable=0x6F05 #Trevius 12/20/08 -OP_ShroudClearAA=0x71b9 +OP_ClearAA=0x71b9 OP_UpdateAA=0x45D2 #Trevius 12/20/08 OP_RespondAA=0x4426 #Trevius 12/20/08 OP_ReqClientSpawn=0x014C #SEQ 12/04/08 diff --git a/utils/patches/patch_Underfoot.conf b/utils/patches/patch_Underfoot.conf index 2b1c41dd9..190554c64 100644 --- a/utils/patches/patch_Underfoot.conf +++ b/utils/patches/patch_Underfoot.conf @@ -88,7 +88,7 @@ OP_TaskActivity=0x31f3 # C OP_CompletedTasks=0x687f # C OP_Weather=0x4658 # V OP_SendAATable=0x6ef9 # V -OP_ShroudClearAA=0x2cd4 +OP_ClearAA=0x2cd4 OP_UpdateAA=0x7bf6 # V OP_RespondAA=0x1fbd # C 0x2bad OP_ReqClientSpawn=0x69cd # V From 1ac92c603ef8820be49a0b371ec9fb8a45ea1510 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Fri, 5 Dec 2014 22:27:39 -0500 Subject: [PATCH 2/4] Add OP_ClearLeadershipAbilties --- utils/patches/patch_RoF.conf | 1 + utils/patches/patch_SoD.conf | 1 + utils/patches/patch_SoF.conf | 1 + utils/patches/patch_Underfoot.conf | 1 + 4 files changed, 4 insertions(+) diff --git a/utils/patches/patch_RoF.conf b/utils/patches/patch_RoF.conf index db0e2dbba..05a3a4a76 100644 --- a/utils/patches/patch_RoF.conf +++ b/utils/patches/patch_RoF.conf @@ -95,6 +95,7 @@ OP_WorldObjectsSent=0x7fa8 OP_SendExpZonein=0x25ab OP_SendAATable=0x7791 OP_ClearAA=0x422e +OP_ClearLeadershipAbilities=0xb978 OP_RespondAA=0x379d OP_UpdateAA=0x504f OP_SendAAStats=0x3d1c diff --git a/utils/patches/patch_SoD.conf b/utils/patches/patch_SoD.conf index fca095db7..a5dee668c 100644 --- a/utils/patches/patch_SoD.conf +++ b/utils/patches/patch_SoD.conf @@ -532,6 +532,7 @@ OP_ShroudRemove=0x17f6 OP_ShroudUnknown1=0x169a OP_ShroudUnknown2=0x4292 OP_ClearAA=0x3bef +OP_ClearLeadershipAbilities=0x6e58 OP_ShroudSelectionWindow=0x4d79 OP_ShroudRequestStats=0x28ce OP_ShroudRespondStats=0x33f2 diff --git a/utils/patches/patch_SoF.conf b/utils/patches/patch_SoF.conf index 8b8629d7c..80aee8bdc 100644 --- a/utils/patches/patch_SoF.conf +++ b/utils/patches/patch_SoF.conf @@ -86,6 +86,7 @@ OP_CompletedTasks=0x75AC #Derision 2009 OP_Weather=0x70A5 #SEQ 12/04/08 OP_SendAATable=0x6F05 #Trevius 12/20/08 OP_ClearAA=0x71b9 +OP_ClearLeadershipAbilities=0x74e5 OP_UpdateAA=0x45D2 #Trevius 12/20/08 OP_RespondAA=0x4426 #Trevius 12/20/08 OP_ReqClientSpawn=0x014C #SEQ 12/04/08 diff --git a/utils/patches/patch_Underfoot.conf b/utils/patches/patch_Underfoot.conf index 190554c64..09c6a8252 100644 --- a/utils/patches/patch_Underfoot.conf +++ b/utils/patches/patch_Underfoot.conf @@ -89,6 +89,7 @@ OP_CompletedTasks=0x687f # C OP_Weather=0x4658 # V OP_SendAATable=0x6ef9 # V OP_ClearAA=0x2cd4 +OP_ClearLeadershipAbilities=0x7b77 OP_UpdateAA=0x7bf6 # V OP_RespondAA=0x1fbd # C 0x2bad OP_ReqClientSpawn=0x69cd # V From 51b997aa27661620b6d8fc4044e8b21f7bcd3dcc Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Fri, 5 Dec 2014 22:29:41 -0500 Subject: [PATCH 3/4] Implement OP_ClearAA and OP_ClearLeadershipAbilities for SoF+ This is nice since #resetaa will no longer require a kick --- common/emu_oplist.h | 2 ++ zone/aa.cpp | 28 +++++++++++++++++++++------- zone/client.h | 1 + 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/common/emu_oplist.h b/common/emu_oplist.h index e8ce3b986..62978655a 100644 --- a/common/emu_oplist.h +++ b/common/emu_oplist.h @@ -74,7 +74,9 @@ N(OP_CharacterCreateRequest), N(OP_CharInventory), N(OP_Charm), N(OP_ChatMessage), +N(OP_ClearAA), N(OP_ClearBlockedBuffs), +N(OP_ClearLeadershipAbilities), N(OP_ClearNPCMarks), N(OP_ClearObject), N(OP_ClearSurname), diff --git a/zone/aa.cpp b/zone/aa.cpp index a8c6ff3d0..65062b7bc 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -1471,21 +1471,22 @@ bool ZoneDatabase::LoadAAEffects2() { return true; } + void Client::ResetAA(){ - RefundAA(); + RefundAA(); uint32 i; - for(i=0;iAA = 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; + m_pp.aa_array[MAX_PP_AA_ARRAY].value = 0; } std::map::iterator itr; - for(itr=aa_points.begin();itr!=aa_points.end();++itr) + for(itr = aa_points.begin(); itr != aa_points.end(); ++itr) aa_points[itr->first] = 0; - for(int i = 0; i < _maxLeaderAA; ++i) + for(int i = 0; i < _maxLeaderAA; ++i) m_pp.leader_abilities.ranks[i] = 0; m_pp.group_leadership_points = 0; @@ -1494,10 +1495,23 @@ void Client::ResetAA(){ m_pp.raid_leadership_exp = 0; database.DeleteCharacterAAs(this->CharacterID()); - SaveAA(); + SaveAA(); + SendClearAA(); + SendAAList(); SendAATable(); + SendAAStats(); database.DeleteCharacterLeadershipAAs(this->CharacterID()); - Kick(); + // undefined for these clients + if (GetClientVersionBit & BIT_TitaniumAndEarlier) + Kick(); +} + +void Client::SendClearAA() +{ + EQApplicationPacket *outapp = new EQApplicationPacket(OP_ClearLeadershipAbilities, 0); + FastQueuePacket(&outapp); + outapp = new EQApplicationPacket(OP_ClearAA, 0); + FastQueuePacket(&outapp); } int Client::GroupLeadershipAAHealthEnhancement() diff --git a/zone/client.h b/zone/client.h index 4c69917fd..a63f37b2f 100644 --- a/zone/client.h +++ b/zone/client.h @@ -755,6 +755,7 @@ public: //AA Methods void SendAAList(); void ResetAA(); + void SendClearAA(); void SendAA(uint32 id, int seq=1); void SendPreviousAA(uint32 id, int seq=1); void BuyAA(AA_Action* action); From ce7a995223314de05917b39e62cf19b6004a021b Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Fri, 5 Dec 2014 22:31:36 -0500 Subject: [PATCH 4/4] Fix previous commit --- zone/aa.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/aa.cpp b/zone/aa.cpp index 65062b7bc..ba61c9005 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -1502,7 +1502,7 @@ void Client::ResetAA(){ SendAAStats(); database.DeleteCharacterLeadershipAAs(this->CharacterID()); // undefined for these clients - if (GetClientVersionBit & BIT_TitaniumAndEarlier) + if (GetClientVersionBit() & BIT_TitaniumAndEarlier) Kick(); }