diff --git a/changelog.txt b/changelog.txt index b6f5f2ad6..ed10c7173 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) Uleat: Updated command #peekinv to display item links properly in RoF clients demonstar55: Group Mentoring in raids demonstar55: Inspect Buffs (text only version) works in raid groups +demonstar55: Make use of the Inspect Buffs op/packet. 62 SOL until someone finds its op == 10/18/2014== demonstar55: Implement group mentor, sharing leadership exp (SoF+ only) diff --git a/common/emu_oplist.h b/common/emu_oplist.h index c0ca0ca4e..e8ce3b986 100644 --- a/common/emu_oplist.h +++ b/common/emu_oplist.h @@ -245,6 +245,7 @@ N(OP_IncreaseStats), N(OP_InitialHPUpdate), N(OP_InitialMobHealth), N(OP_InspectAnswer), +N(OP_InspectBuffs), N(OP_InspectMessageUpdate), N(OP_InspectRequest), N(OP_InstillDoubt), diff --git a/common/eq_packet_structs.h b/common/eq_packet_structs.h index d0792fd37..a5e22e44e 100644 --- a/common/eq_packet_structs.h +++ b/common/eq_packet_structs.h @@ -3968,6 +3968,11 @@ struct MarkNPC_Struct /*08**/ char Name[64]; }; +struct InspectBuffs_Struct { +/*000*/ uint32 spell_id[BUFF_COUNT]; +/*100*/ uint32 tics_remaining[BUFF_COUNT]; +}; + struct RaidGeneral_Struct { /*00*/ uint32 action; //=10 /*04*/ char player_name[64]; //should both be the player's name diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 1fcb74078..3a03b3a62 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -1309,6 +1309,20 @@ namespace RoF FINISH_ENCODE(); }*/ + ENCODE(OP_InspectBuffs) + { + ENCODE_LENGTH_EXACT(InspectBuffs_Struct); + SETUP_DIRECT_ENCODE(InspectBuffs_Struct, structs::InspectBuffs_Struct); + + // we go over the internal 25 instead of the packet's since no entry is 0, which it will be already + for (int i = 0; i < BUFF_COUNT; i++) { + OUT(spell_id[i]); + OUT(tics_remaining[i]); + } + + FINISH_ENCODE(); + } + ENCODE(OP_InspectRequest) { ENCODE_LENGTH_EXACT(Inspect_Struct); diff --git a/common/patches/rof_ops.h b/common/patches/rof_ops.h index 030c331d6..57ff1f91d 100644 --- a/common/patches/rof_ops.h +++ b/common/patches/rof_ops.h @@ -44,6 +44,7 @@ E(OP_GuildMemberUpdate) E(OP_GuildsList) E(OP_HPUpdate) E(OP_Illusion) +E(OP_InspectBuffs) E(OP_InspectRequest) E(OP_InterruptCast) E(OP_ItemLinkResponse) diff --git a/common/patches/rof_structs.h b/common/patches/rof_structs.h index e65f2b74d..1393b026e 100644 --- a/common/patches/rof_structs.h +++ b/common/patches/rof_structs.h @@ -2473,6 +2473,11 @@ struct GroupFollow_Struct { // Live Follow Struct /*0152*/ }; +struct InspectBuffs_Struct { +/*000*/ uint32 spell_id[BUFF_COUNT]; +/*168*/ uint32 tics_remaining[BUFF_COUNT]; +}; + struct LFG_Struct { /*000*/ uint32 unknown000; /*004*/ uint32 value; // 0x00 = off 0x01 = on diff --git a/common/patches/underfoot.cpp b/common/patches/underfoot.cpp index aa342a412..ad850be36 100644 --- a/common/patches/underfoot.cpp +++ b/common/patches/underfoot.cpp @@ -1125,6 +1125,20 @@ namespace Underfoot FINISH_ENCODE(); } + ENCODE(OP_InspectBuffs) + { + ENCODE_LENGTH_EXACT(InspectBuffs_Struct); + SETUP_DIRECT_ENCODE(InspectBuffs_Struct, structs::InspectBuffs_Struct); + + // we go over the internal 25 instead of the packet's since no entry is 0, which it will be already + for (int i = 0; i < BUFF_COUNT; i++) { + OUT(spell_id[i]); + OUT(tics_remaining[i]); + } + + FINISH_ENCODE(); + } + ENCODE(OP_InspectRequest) { ENCODE_LENGTH_EXACT(Inspect_Struct); diff --git a/common/patches/underfoot_ops.h b/common/patches/underfoot_ops.h index 28864301d..38cfb79e3 100644 --- a/common/patches/underfoot_ops.h +++ b/common/patches/underfoot_ops.h @@ -34,6 +34,7 @@ E(OP_GroupUpdate) E(OP_GuildMemberList) E(OP_GuildsList) E(OP_Illusion) +E(OP_InspectBuffs) E(OP_InspectRequest) E(OP_ItemLinkResponse) E(OP_ItemPacket) diff --git a/common/patches/underfoot_structs.h b/common/patches/underfoot_structs.h index 2b7163bcf..eec3270f5 100644 --- a/common/patches/underfoot_structs.h +++ b/common/patches/underfoot_structs.h @@ -2166,6 +2166,14 @@ struct GroupFollow_Struct { // Underfoot Follow Struct /*0152*/ }; +struct InspectBuffs_Struct { +/*000*/ uint32 spell_id[BUFF_COUNT]; +/*100*/ uint32 filler100[5]; // BUFF_COUNT is really 30... +/*120*/ uint32 tics_remaining[BUFF_COUNT]; +/*220*/ uint32 filler220[5]; // BUFF_COUNT is really 30... +}; + + struct LFG_Struct { /*000*/ uint32 unknown000; /*004*/ uint32 value; // 0x00 = off 0x01 = on diff --git a/utils/patches/patch_RoF.conf b/utils/patches/patch_RoF.conf index 6bd486bfa..97098946d 100644 --- a/utils/patches/patch_RoF.conf +++ b/utils/patches/patch_RoF.conf @@ -501,6 +501,7 @@ OP_GroupMakeLeader=0x4129 OP_DoGroupLeadershipAbility=0x17d7 OP_GroupLeadershipAAUpdate=0x6567 OP_GroupMentor=0x56DB +OP_InspectBuffs=0x01f3 # LFG/LFP Opcodes OP_LFGCommand=0x4463 diff --git a/utils/patches/patch_SoD.conf b/utils/patches/patch_SoD.conf index 0effd1b3c..338ee82e7 100644 --- a/utils/patches/patch_SoD.conf +++ b/utils/patches/patch_SoD.conf @@ -487,6 +487,7 @@ OP_GroupLeaderChange=0x7545 OP_GroupRoles=0x6b67 OP_GroupMakeLeader=0x6087 OP_GroupMentor=0x1224 +OP_InspectBuffs=0x66bf # LFG/LFP Opcodes OP_LFGCommand=0x3288 # C OP_LFGGetMatchesRequest=0x5613 # C diff --git a/utils/patches/patch_SoF.conf b/utils/patches/patch_SoF.conf index 0b53daefd..fc0c716e1 100644 --- a/utils/patches/patch_SoF.conf +++ b/utils/patches/patch_SoF.conf @@ -453,6 +453,7 @@ OP_CancelInvite=0x596C #Trevius 03/02/09 OP_GroupFollow2=0x59D4 #Xinu 02/20/09 OP_GroupInvite2=0x07F6 #Xinu 02/20/09 OP_GroupMentor=0x9EF3 +OP_InspectBuffs=0x3547 #LFG/LFP Opcodes OP_LFGCommand=0x5D81 #Trevius 01/16/09 diff --git a/utils/patches/patch_Titanium.conf b/utils/patches/patch_Titanium.conf index 50e426874..841f77bf5 100644 --- a/utils/patches/patch_Titanium.conf +++ b/utils/patches/patch_Titanium.conf @@ -420,6 +420,8 @@ OP_RaidJoin=0x1f21 # ShowEQ 10/27/05 OP_RaidInvite=0x5891 # ShowEQ 10/27/05 OP_RaidUpdate=0x1f21 # EQEmu 06/29/05 +OP_InspectBuffs=0x4FB6 + OP_ZoneComplete=0x0000 OP_ItemLinkText=0x0000 diff --git a/utils/patches/patch_Underfoot.conf b/utils/patches/patch_Underfoot.conf index 01cc1ad47..56838da65 100644 --- a/utils/patches/patch_Underfoot.conf +++ b/utils/patches/patch_Underfoot.conf @@ -490,6 +490,7 @@ OP_GroupLeaderChange=0x0c33 # C OP_GroupRoles=0x116d # C OP_GroupMakeLeader=0x5851 OP_GroupMentor=0x292f +OP_InspectBuffs=0x105b # LFG/LFP Opcodes OP_LFGCommand=0x2c38 # C diff --git a/zone/aa.cpp b/zone/aa.cpp index d07ed72cf..83a6b7967 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -1793,29 +1793,26 @@ int Client::GroupLeadershipAAOffenseEnhancement() void Client::InspectBuffs(Client* Inspector, int Rank) { - if(!Inspector || (Rank == 0)) return; + // At some point the removed the restriction of being a group member for this to work + // not sure when, but the way it's coded now, it wouldn't work with mobs. + if (!Inspector || Rank == 0) + return; + + EQApplicationPacket *outapp = new EQApplicationPacket(OP_InspectBuffs, sizeof(InspectBuffs_Struct)); + InspectBuffs_Struct *ib = (InspectBuffs_Struct *)outapp->pBuffer; - Inspector->Message_StringID(0, CURRENT_SPELL_EFFECTS, GetName()); uint32 buff_count = GetMaxTotalSlots(); - for (uint32 i = 0; i < buff_count; ++i) - { - if (buffs[i].spellid != SPELL_UNKNOWN) - { - if(Rank == 1) - Inspector->Message(0, "%s", spells[buffs[i].spellid].name); - else - { - if (spells[buffs[i].spellid].buffdurationformula == DF_Permanent) - Inspector->Message(0, "%s (Permanent)", spells[buffs[i].spellid].name); - else { - char *TempString = nullptr; - MakeAnyLenString(&TempString, "%.1f", static_cast(buffs[i].ticsremaining) / 10.0f); - Inspector->Message_StringID(0, BUFF_MINUTES_REMAINING, spells[buffs[i].spellid].name, TempString); - safe_delete_array(TempString); - } - } - } + uint32 packet_index = 0; + for (uint32 i = 0; i < buff_count; i++) { + if (buffs[i].spellid == SPELL_UNKNOWN) + continue; + ib->spell_id[packet_index] = buffs[i].spellid; + if (Rank > 1) + ib->tics_remaining[packet_index] = spells[buffs[i].spellid].buffdurationformula == DF_Permanent ? 0xFFFFFFFF : buffs[i].ticsremaining; + packet_index++; } + + Inspector->FastQueuePacket(&outapp); } //this really need to be renamed to LoadAAActions()