Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Bug Reports

Development::Bug Reports Post detailed bug reports and what you would like to see next in the emu here.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-23-2007, 01:37 AM
number6
Sarnak
 
Join Date: Sep 2006
Posts: 62
Default Clicky items recast timer bug and fix

I noticed that items with clicky effects (in my case and most noticeably, the shadowknight epic) ignored the recastdelay field in the items database, so that it was possible to re-click such items incessantly. I worked up a quick fix to this. I don't 100% like it because if the clicky is cancelled (e.g. by ducking during a long cast) the re-use timer is still set, but I can't work out how to access the m_inv variable (thus accessing the inventory and then the original item to get the recast delay) later on once the spell cast is finished - any ideas appreciated. Anyway for now this might be useful:

Code:
--- client_packet.cpp.orig      2007-03-23 15:33:40.000000000 +0000
+++ client_packet.cpp   2007-03-23 15:31:27.000000000 +0000
@@ -2935,6 +2935,16 @@
                        safe_delete(outapp);
                        if ((item->Click.Type == ET_ClickEffect) || (item->Click.Type == ET_Expendable) || (item->Click.Type == ET_EquipClick) || (item->Click.Type == ET_ClickEffect2))
                        {
+                               // here is where we can check recast times
+                               if (item->RecastDelay > 0) {
+                                       // check to see if it's in progress
+                                       if(!CastToClient()->GetPTimers().Expired(&database, pTimerSpellStart + item->Click.Effect, false)) {
+                                               InterruptSpell(item->Click.Effect);
+                                               Message(13,"Item recast time not yet met, %d seconds left.",CastToClient()->GetPTimers().GetRemainingTime(pTimerSpellStart + item->Click.Effect));
+                                               return;
+                                       }
+                                       CastToClient()->GetPTimers().Start(pTimerSpellStart + item->Click.Effect, item->RecastDelay);
+                               }
                                CastSpell(item->Click.Effect, castspell->target_id, castspell->slot, item->CastTime, 0, 0, castspell->inventoryslot);
                        }
                        else
Cheers

Paul.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 12:27 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3