PDA

View Full Version : Spell List Timers



serberus
01-26-2002, 06:36 AM
I've mentioned this before, I was just wondering if it had been given any consideration or if it was something the devs were wondering about.

At the moment the Spell List is a bit sketchy, it shows great potential but has a few inherent bugs.

A few examples are:

It adds the spell to the list the instant you cast it and starts the spell timer as soon as you cast, this means the timer is out by the length of the casting time and it also adds spells that were interrupted, just adding junk data to the display.

Someone on the forum said the simplest thing to do is change it so it adds the spell from when it finishes casting (and they posted a bit of code, but I don't happen to have that to hand).

That would fix the issue of interrupts and out of sync timers.

The only other issue is resists, I assume its possible to see when a mob resists so it would also be possible to stop that spell being added to the spell list as it essentially wasn't cast.

Also, i've been unable to remove spells from the spell list for some time, I don't know if the way to do this has changed, it used to be a case of clicking on the spell and it would be removed from the list, but that no longer seems to work. It gets a bit annoying when you have about 5 or 6 copies of a 2 hour spell sitting in the list because it drops for reasons such as zoning, and has to be cast again hence adding it back onto the list (wolf form in my experience).

Unfortunately I don't have any programming experience so I couldn't help as such on the coding side. I'd happily go through the spelltimes.h file and set all the spell times for the spells (but this can be inconvinient with lots of ensnares or other reasonable duration frequently cast spell).


Thanks

Serberus

serberus
01-31-2002, 09:48 AM
Also if you re-cast a spell shortly before it runs out, then once the 'XXX spell has worn off' message is printed ShowEQ will remove it from the list, this means that if for example I cast Winged Death on a creature, which has a 1 minute duration, if I cast again at 55 secs through the spell (so the dot isn't dropped for long) then it will update the timer as soon as the spell is cast, then set it to 0 and remove the spell once the 'worn off' message appears so I have a dot on a mob and the spell list doesn't show the remaining duration.

Thanks

Serberus

serberus
02-03-2002, 12:07 PM
ok, I've just sifted through the spellshell.cpp code and the reason the spells get deleted when you recast is because theres no way to tell which mob the spell just wore off so it removes the last occurance of that spell (when it recieves the 'worn off' message, which is after you've cast, so it gets removed almost instantly).

The only solution I can think of currently is to add a fixed/random duration flag to the spells so you know from the timers which spell has run out and which is still going, or if its a random spell then apply the current method of removal.

I tried editing the spellshell.cpp file so it would add spells to the list after it had finished casting but this was a bit tricky for someone who can't code, so it didn't happen.

It doesn't look too complicated but without knowing what i'm doing I can't really say, it could require a complete rewrite of ShowEQ for all I know =)

Serberus

serberus
02-03-2002, 04:57 PM
ok, I may have a more elegant solution to the spells being removed incorrectly, as most spells has a message when they land such as '%t is so and so by the wrath of', does that give you the ID or unique name of the mob?

You could use this message to apply the appropriate spell timer to the appropriate mob.

I don't know if that'd work but its the best idea I can come up with.

Serberus

fryfrog
02-04-2002, 03:29 AM
another beef i have (and i'm sure i could be wrong, as i can't say for sure i've tried it one way or the other that i remember) is that you can't click spells out of the list like in sins. hopefully i'm wrong though :)

okay, just tried it can i can't click them out using left, right or middle click :)

cjd1
02-06-2002, 08:39 AM
The middle mouse button (or both left/right if you only define a 2 button mouse to the X server and have emulate3buttons enabled) removes entries for me. Stick some printf's in that slot and see if it's noticed on your end.

The timers begin on the start cast packet because not all spells in game have a cast time (ie instacast right-clickies, jboots, etc). My intent was to someday go back and reset the time on the finishCast packet. I haven't gotten that far in life, yet.

Keep in mind, the original idea when I made this was A) it's a hack to start being somewhat useful to buff type peoples, and B) I forget, it's been a while. :)

A few issues with keeping things in-sync make things less than perfect. First, resists, interrupts, and spells that wear off before the time completes (root, fear, invis, etc). All we see is a message, "Your spell was interrupted/resisted/has wore off." I just made some guesses, and basically search through the list backwards removing one that matches. For many situations, we don't know exactly which mob was the target.

As for recasting a spell and having it wiped out when the first instance completes, I don't know. :P Each single item is matched on spell id, target id (if target=true in spelltimes.h), and caster id. If it already exists, it just resets the timer. Otherwise, it adds a new entry, and even this scheme isn't perfect. But I just have never seen anything where it removes a recast spell when the first wears off. More details? It either resets the timer on the existing spell, in which it won't wear off in the SpellList until that one counts down, or it adds a second entry (which still boggles me) and then the first entry will have a timer with like 5 seconds remaining and the second will have the full spell length (as defined in spelltimes.h). In this scenario, the first will wear off when it counts down (just ignore it if you know you recast it) and let the second one continue on.

As always, if anyone gets the motivation to do it properly, by all means submit a patch. If you want help understanding specific parts of the process, let me know and I can do what I can to figure out my original mindset. :P

Doku
02-08-2002, 03:00 AM
It seems to me that spliting the spell list or somehow identifying spells CAST on YOU and then spells you cast would simply (or atleast clarify) whats happening.

So you currently only have spells cast upon self or spells you cast on others... The client knows what spells are cast, when they wear off... so the data is in the packets, right?

my guess (read ASSumption) is that the client (EQ) has a framework for spells with lasting spell effects...It uses the fixed times and only resyncs with the server when there is something server side (or client side- right clicking the icon) that would adversly affect the spell (cancel magic, etc)

Sometimes the client and server are out of sync... I have noticed when casting C2 or other buffs sometimes they dont BLINK when they are about to wear off...then suddenly disappear. The disappearing without warning would be the server telling the client NO stupid... the spell effect has already left. <---- might be lag induced.

So .... hmm

There are 2 spell timers running: Serverside, Clientside

Serverside Timer: Master Timer
Clientside: Slaved Timer -what does the Slaved Timer use for a hack....finshcast packet? Then use the spdata for times... blink for the last 20 secs of fixed duration spells.

..... Back to C++

Doku

serberus
02-08-2002, 11:44 AM
As for spells being removed from the list after a recast, it goes a little something like this:

Cast Drones of Doom on a Wyvern
wait for 55 seconds then recast
6 second casting time with 60 second duration
as the second casting of Drones of Doom lands 61 seconds after the first has landed, the first instance of drones of doom gives a 'your spell has worn off' while your still casting your second round of drones of doom, and because it sees that worn off message, it then removes the entry from the spell list.

Thats what's going wrong there.

Hope that cleared it up a bit, its basically because i'm casting so it lands just after its worn off (for efficiency) and its giving the worn off message while I cast.

Would it be any easier to put spells in the spell list from successful spell landing messages. e.g. 'cjd1 is surrounded by a complete newb' and using that test to verify the spell landed properly, and as it reports the mobs name, and I assume its ID, it can be tied to a mob pretty specifically.

Still can't think of a better way to deal with spells wearing off.

Thanks

Serberus

cjd1
02-09-2002, 07:23 PM
Cast Drones of Doom on a Wyvern
wait for 55 seconds then recast
6 second casting time with 60 second duration
as the second casting of Drones of Doom lands 61 seconds after the first has landed, the first instance of drones of doom gives a 'your spell has worn off' while your still casting your second round of drones of doom, and because it sees that worn off message, it then removes the entry from the spell list.

Thats what's going wrong there.


Ok, gotchya. And that would be completely solved by doing things correctly, resetting the timer on the "successful cast" packet. I'll look into it a bit Monday (hopefully).


Hope that cleared it up a bit, its basically because i'm casting so it lands just after its worn off (for efficiency) and its giving the worn off message while I cast.

Yup, since it currently only sets the timer on the beginning of a cast, then it sets the timer to 0 on the 'wore off' message. I remember I ran into a bit of trouble doing this when I first implemented it. I don't recall what that stumbling block was though. Maybe I'll find it and fix it, ya never know.

;)

cjd1
02-13-2002, 09:47 AM
I've put into CVS a fix, by the looks of it. Now it resets the timer on completion of the spell.

Interrupts are sketchy right now so they are commented out. I ran into quite a few crashes in the code when a bard came next to me and started skipping notes. I haven't looked into it a whole lot. Damn bards.

sequser
02-13-2002, 01:02 PM
One thing which would be really useful to some of us would be if the timer worked for procs (and other spells cast on you), when you didnt get the 'begins to cast a spell' message/packet. I dont know if a special case is called for in this case or not, but I would love to be able to see when avatar is going to wear off so I can switch weapons to proc it again.

Mr Guy
02-14-2002, 07:54 AM
My spell timers are rarely accurate. IE I'll see 2 minutes left and my icon will already be blinking. It also updates sporadically, like counting: 4:32 4:23 4:08


Is this a slow computer problem? Movement on map seems fine...