EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   Combat Ability hot buttons / reuse timers. (https://www.eqemulator.org/forums/showthread.php?t=28313)

Derision 05-23-2009 10:04 AM

Combat Ability hot buttons / reuse timers.
 
My DSL is down so I probably won't be able to commit anything to the SVN from my Linux server for a few days, hence me posting this code here.

I was asked yesterday if I could look into making the hot buttons for Combat Abilities (Alt-C) remain down until their reuse timer is up.

This seems to work well, but I could do with someone more familiar with disciplines and their shared reuse timers testing it out.
Code:

Index: utils/patch_SoF.conf
===================================================================
--- utils/patch_SoF.conf        (revision 554)
+++ utils/patch_SoF.conf        (working copy)
@@ -278,6 +278,7 @@
 OP_Charm=0x2F32                                #
 OP_Stun=0x55BF                        #
 OP_DisciplineUpdate=0x0000            #
+OP_DisciplineTimer=0x53c5              #
 OP_FindPersonRequest=0x07F0            #
 OP_FindPersonReply=0x7770              #
 OP_Sound=0x2B02                                #
Index: utils/patch_Titanium.conf
===================================================================
--- utils/patch_Titanium.conf  (revision 554)
+++ utils/patch_Titanium.conf  (working copy)
@@ -387,6 +387,7 @@
 OP_ZoneComplete=0x0000
 OP_ItemLinkText=0x0000
 OP_DisciplineUpdate=0x7180
+OP_DisciplineTimer=0x53df
 OP_LocInfo=0x0000
 OP_FindPersonRequest=0x3c41                    # ShowEQ 10/27/05
 OP_FindPersonReply=0x5711                      # ShowEQ 10/27/05
Index: utils/patch_6.2.conf
===================================================================
--- utils/patch_6.2.conf        (revision 554)
+++ utils/patch_6.2.conf        (working copy)
@@ -384,6 +384,7 @@
 OP_ItemLinkText=0x0000
 OP_ClearObject=0x8258
 OP_DisciplineUpdate=0x7180
+OP_DisciplineTimer=0x53df
 OP_LocInfo=0x0000
 OP_FindPersonRequest=0x3c41            # ShowEQ 06/29/05
 OP_FindPersonReply=0x5711
Index: common/emu_oplist.h
===================================================================
--- common/emu_oplist.h (revision 554)
+++ common/emu_oplist.h (working copy)
@@ -433,4 +433,5 @@
 N(OP_PVPLeaderBoardReply),
 N(OP_PVPLeaderBoardDetailsRequest),
 N(OP_PVPLeaderBoardDetailsReply),
+N(OP_DisciplineTimer),

Index: common/eq_packet_structs.h
===================================================================
--- common/eq_packet_structs.h  (revision 554)
+++ common/eq_packet_structs.h  (working copy)
@@ -631,6 +631,7 @@


 static const uint32 MAX_PP_DISCIPLINES = 100;
+static const uint32 MAX_DISCIPLINE_TIMERS = 20;

 struct Disciplines_Struct {
        uint32 values[MAX_PP_DISCIPLINES];
@@ -3865,6 +3866,13 @@
 /*168*/
 };

+struct DisciplineTimer_Struct
+{
+/*00*/ uint32  TimerID;
+/*04*/ uint32  Duration;
+/*08*/ uint32  Unknown08;
+};
+
 //old structures live here:
 #include "eq_old_structs.h"

Index: zone/client_packet.cpp
===================================================================
--- zone/client_packet.cpp      (revision 554)
+++ zone/client_packet.cpp      (working copy)
@@ -7572,6 +7572,8 @@

        TotalKarma = database.GetKarma(AccountID());

+      SendDisciplineTimers();
+
 #ifdef EMBPERL
        ((PerlembParser *)parse)->Event(EVENT_ENTERZONE, 0, "", (NPC*)NULL, this);
 #endif
Index: zone/client.cpp
===================================================================
--- zone/client.cpp    (revision 554)
+++ zone/client.cpp    (working copy)
@@ -3961,3 +3961,24 @@
        QueuePacket(outapp);
        safe_delete(outapp);
 }
+
+void Client::SendDisciplineTimers()
+{
+
+      EQApplicationPacket *outapp = new EQApplicationPacket(OP_DisciplineTimer, sizeof(DisciplineTimer_Struct));
+      DisciplineTimer_Struct *dts = (DisciplineTimer_Struct *)outapp->pBuffer;
+
+      for(int i = 0; i < MAX_DISCIPLINE_TIMERS; ++i)
+      {
+              int32 RemainingTime = p_timers.GetRemainingTime(pTimerDisciplineReuseStart + i);
+
+              if(RemainingTime > 0)
+              {
+                      dts->TimerID = i;
+                      dts->Duration = RemainingTime;
+                      QueuePacket(outapp);
+              }
+      }
+
+      safe_delete(outapp);
+}
Index: zone/client.h
===================================================================
--- zone/client.h      (revision 554)
+++ zone/client.h      (working copy)
@@ -809,6 +809,7 @@
        void IncrementAggroCount();
        void DecrementAggroCount();
        void SendPVPStats();
+      void SendDisciplineTimers();

 protected:
        friend class Mob;
Index: zone/effects.cpp
===================================================================
--- zone/effects.cpp    (revision 553)
+++ zone/effects.cpp    (working copy)
@@ -676,6 +676,15 @@
        if(spell.recast_time > 0)
        {
                p_timers.Start(DiscTimer, spell.recast_time / 1000);
+              if(spells[spell_id].EndurTimerIndex < MAX_DISCIPLINE_TIMERS)
+              {
+                      EQApplicationPacket *outapp = new EQApplicationPacket(OP_DisciplineTimer, sizeof(DisciplineTimer_Struct));
+                      DisciplineTimer_Struct *dts = (DisciplineTimer_Struct *)outapp->pBuffer;
+                      dts->TimerID = spells[spell_id].EndurTimerIndex;
+                      dts->Duration = spell.recast_time / 1000;
+                      QueuePacket(outapp);
+                      safe_delete(outapp);
+              }
        }
        return(true);
 }


KLS 05-23-2009 12:38 PM

I'll take a look at it.

demonstar55 05-23-2009 04:27 PM

From my small testing it seems to work nicely, didn't notice anything wrong with shared cool down timers, but then again I didn't testing it out all too much, really looking forward to this

KLS 05-23-2009 05:03 PM

Yeah, worked fine: I couldn't break it or anything.

Derision 05-23-2009 05:09 PM

Quote:

Originally Posted by KLS (Post 170380)
Yeah, worked fine: I couldn't break it or anything.

Thanks for testing it (and Demonstar). Feel free to commit it if you want. I discovered my ADSL was meant to be upgraded from 7Mb/s to ADSL2+ (15Mb/s) on Friday, but evidently something went wrong. Dial-up really sucks. :(


All times are GMT -4. The time now is 10:26 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.