PDA

View Full Version : Clicky items recast timer bug and fix


number6
03-23-2007, 01:37 AM
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:


--- 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.

number6
04-01-2007, 08:13 PM
Does anyone read this forum? I'm a bit disheartened by the "1 views" tag that I'm seeing :( Should I send code contributions somewhere else?

Paul.

KLS
04-01-2007, 09:28 PM
I read it.. in fact I'm pretty sure I wrote out a reply at one point not sure why I never posted it.. anyway. I had it fixed after initially reading this, tho I do it a bit differently, actually checking for the timer type on the item instead of spell timer.

number6
04-02-2007, 07:55 AM
Thanks :)

Having looked at the forums a bit more, I have a suspicion that the forum software is putting the number of posts in the thread in where it should be showing the number of views, which is a bit strange!

Cheers

Paul.

minbus
07-01-2007, 05:23 PM
I am new to all of this and I was wanting to enable the timers on the items, I am confused as to where this code is placed. is it in the world.exe or zone.exe or do I just have to creat another file and place it in a directory somewhere.

I am hoping that it is the create a file and place in a directory fix :)

moydock
07-01-2007, 08:00 PM
You can't fix it unless you know how to compile and such, wait for the next build that has the fix.

ChaosSlayer
01-23-2008, 07:36 PM
I am sorry to bump this thread, but I looked at log files and cannot seem to find any mention about recast issue been fixed (unless you simply forgot to add it to the log file)

another thing, if you could tell what is the diffirence bitween diffirent recast types? I seen types 1, 6 and 8 on most items, but have no idea what importance they have.

thanks =)

Furniture
04-12-2016, 07:31 PM
This is still happening with my custom item. I guess the fix never made it in?

N0ctrnl
04-12-2016, 09:53 PM
Probably best to make a new post with details and questions. Bumping posts from 8 years ago isn't all that great an idea.