NPC Spell List Recast Delay Not Working
I have done some testing with the recast delay setting for NPC spell lists and it doesn't seem to be having any effect at all. If I am wrong, or just missing something to get it working properly, this post could be moved to the general or server support section.
I first tried setting the recast delay in seconds, thinking that it would be used similar to the recast delay setting for item clickies. That did nothing and did not effect the actual reuse time that NPCs were able to cast the same spell again. So, I then tried changing it to Milliseconds and that too seemed to have no effect. Even if I set it as high as 1200000, which should be 20 minutes in milliseconds, the NPCs could still re-cast the same spell withing just a few seconds of having cast it. And, they can just cast it over and over again as if it is ignoring that restriction completely. I am aware that any changes to spell lists requires a server reboot to take effect and I have been doing reboots after each new change I make. What I am trying to do is use the spell version of Melee disciplines for Warrior, Rogue, and Monk to create a spell list that will let my melee NPCs disc for the new zone I am making. I am also adding discs to my highest level pet class pets (mage, necro, beastlord). I think it will add some nice diversity. Unfortunately, with the way it is currently working, they are firing off disciplines every few swings and without recast delays working, I will be forced to remove this fun feature. I am wondering if the code for recast delay on item clickies and player spells might be useful in getting the NPC spells list recast delays working properly. I also wanted to note that I have the disciplines set as type 1 and type 2 for spell type in the lists. I used type 1 (nuke setting) for damage increasing discs, and type 2 (heal setting) for defensive disciplines. |
I believe I had this working a couple months back when I changed all my npc's. I'll test again and let you know.
|
Yeah mines working fine. I'm not on the latest build, but fairly recent.
It's in seconds for me. For example, the heal I just tested: ID: 367 npc_spells_id: 6 spellid: 200 type: 2 minlevel: 1 maxlevel: 8 manacost: -1 recast_delay: 30 priority: 1 |
I noticed this recently, and it's especially obvious among death-touching mobs like the Golems in Fear. I was even considering a work-around.
Currently, they cast it shortly after they're first aggro'd, and then you never see it again. On Live, it had a refresh timer of one minute, and they'd nuke whoever was at the top of their hate list. I know perl isn't the best solution for this, but I considered writing a script that would fire it off once a minute as it should, using a timer. But if this recast delay and priority thing is straightened out, it'd be much better, for sure. |
Maybe it has something to do with the Spell Type setting for the NPC Spell Lists. I am wondering if only certain types will recognize the Recast Delay setting and some will ignore it. IMO, they should all follow the Recast Delay restriction. The ones I have tested so far are set to type 1, which is the Nuke setting. So, maybe the Nuke setting doesn't follow that restriction. Maybe I can try setting them to another type (maybe the DoT setting) and see if that makes any difference. Though, I still think that they should all follow the Recast Delay restriction.
|
I don't think it affects it. I'm only testing lvl 5 npc's but my druids never nuke twice in a row as well as not healing. I've got 15 second delay on their nukes too. They'll cast bust of flame, and then firefist, or whatever that dot is, but never 2 burst of flame in a row.
|
The proc chance might be why you aren't seeing them very close together. Try upping the proc chance up to 100% so that they should try to cast it every time it is available. Then, try setting your recast delay to something longer like 180 seconds and see if they cast it before that 3 minutes are up.
I will have to do more testing on it, but it is hard when I can only reset my server every now and then to test the changes, or it will effect my players too much if I reset alot. |
I tried setting the proc rate to 100 and oddly they don't seem to try to cast any quicker. Like, I attack them, and they wait awhile to cast the first nuke. Possibly because they need to wait the recast delay before casting the first spell.
Trust me though, I've sat in front of these things a lot. I would have seen one double cast by now. I originally implemented the recast so that healers wouldn't chain heal themselves when they got low on health. And they don't anymore. I guess it's possible this has been broken in one of the somewhat recent updates. |
Well, I am still trying to figure out why this is happening on my server. I was looking at my variables table and I have a setting for "ailevel", and it is set to 6 (which is how it came from the PEQ db), but I don't really know what that does. So far, it is the only thing I can think of that might be causing this issue. I am running the latest version of the emu (1118) with some modified code additions, but nothing that I think would relate to this issue at all.
I was looking at the source and in npc.h, I see a public section that mentions ailevel, and has some recast delay info in there. So, I am wondering if maybe my ailevel is set wrong, and maybe setting it to 6 isn't enough for it to use recast delays... Here is the code from the public section of npc.h that I am referring to (I highlighted a few things in RED cause I think they are involved in making the decision for recast delay settings): Code:
class NPC : public Mob |
After more testing, it seems like recast delay is working properly, but is picky about what kind of spells you set to which type:
From MobAI.cpp: Code:
const int SpellType_Nuke=1; It seems that when you set a discipline to type 1 (nuke), it will cast properly, but since it is self only, it apparently doesn't pass all of the checks for being a "nuke" spell. So, I think the problem is that it is never reaching the point where it is supposed to check the recast delay setting. Maybe the nuke one could just be edited to allow this, or a whole new type could be added: Code:
const int SpellType_Combat_Buff=512; Code:
const int SpellTypes_Detrimental = SpellType_Nuke|SpellType_Root|SpellType_Lifetap|SpellType_Snare|SpellType_DOT|SpellType_Combat_Buff; Buff Code:
case SpellType_Buff: { Code:
case SpellType_Nuke: { Code:
default: { Code:
//this gets called from InterruptSpell() for failure or SpellFinished() for success Code:
case SpellType_Combat_Buff: { If anyone else has any input on getting this to work the way I want, I would love to hear it :D |
Just found 3 more lines that I think needed to be adjusted for it to work:
Code:
|| AIspells[i].type == SpellType_Combat_Buff Code:
if(!AICastSpell(target, 20, SpellType_Nuke | SpellType_Lifetap | SpellType_DOT | SpellType_Combat_Buff)) { Code:
if(!AICastSpell(target, 90, SpellType_Root | SpellType_Nuke | SpellType_Lifetap | SpellType_Snare | SpellType_DOT | SpellType_Combat_Buff)) { |
Well, it compiled fine, but now when I set my NPCs spells to type 512, it doesn't seem to use them at all in combat or out of combat... Guess this needs further looking into, but I think it is closer now heh.
|
Well, I didn't have to add a new category after-all lol. I found the reason why my recast delays weren't working. It was because I was using recast timers similar to actual disc reuse timers. Some of them were 20 minutes or more. And in seconds, that is 1200.
I looked at recast delay settings in the source and I found this: MobAI.cpp Code:
void NPC::AI_Event_SpellCastFinished(bool iCastSucceeded, int8 slot) { Code:
void NPC::AI_Event_SpellCastFinished(bool iCastSucceeded, int8 slot) { |
Well, I am starting again to get the new spell type category working for NPCs. I haven't fully decided if I want to just make 1 new category or 2. I think Yaulp would be fine to set as a buff that is used in combat, but disciplines need a little extra rules to them. I currently have my NPC disciplines set to the nuke category and that almost works the way that I want with the only problem being that they will stack multiple discs at once which makes them way too overpowered. The idea is to make a new category just for discs that will do combat buffs, but only do 1 at a time and won't use another until the previous one has worn off.
I think the code I posted above for combat_buffs is probably very close to working for this. I just need to figure out why the new category wasn't being used when I set it for an NPC in their spell list. I imagine I am only missing something minor to get it to start using them. Then, the only other thing I would need is a way to make sure only 1 combat buff (disc) is being used at a time. Of course since KLS added a new field for dispells and it is 512, then the new discipline field would have to use 1024. And if I added a combat_buff field as well for Yaulp and maybe others, it would have to be 2048. If anyone has time to look over my code, I think these would make for some nice new features to help expand what NPCs can do without having to make quest scripts for every mob. |
Sir, get out of my head. I was seriously just thinking about expanding the npc cast system further with in combat buffs classification only like 2 days ago.
|
All times are GMT -4. The time now is 11:06 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.