PDA

View Full Version : Cleric Heals


kofac
04-19-2010, 07:34 AM
I am running Rev1395 on Windows & have noticed a few things.

Its not only Rev1395 its been this way for a good while. But its only today I have had more time to look into it.

The problem seems to be with Cleric Bots Heals. They initially open with a HOT I am level 60 War so my bot is 60. Thats a 300 per tic lasts 30 seconds.

So far so good thats great open early with a HOT really helps. But then I noticed that while the HOT is running my bot will not cast any other heals period.

Generally when the HOT wore off it would simply cast another HOT. Which was a bit of a nightmare as my HPs would generally be to low and I end up dead.

So I looked into the botspellssai.cpp file. Changed a few of the parameters for heals. Its not perfect. But I have it so at least after the initial HOT has worn off. My bot will then usually cast a CHEAL. That also works well out of combat to.

Problem is I can not see what in the code that sets the bot to only heal again after the HOT has worn off.

The bot casts plenty of other spells when the HOT is still running. Such as Judgement. But never any heals.

Anyone know where in the code its set not to cast heals while a HOT is running please ? as that would help out a lot.

Currently I 2 box with a Healer as I dont trust my Cleric bot enough to keep me alive lol.

BTW I love the bots there great. I would have not seen half the stuff in the game with out them. They literally changed the way I play the game. :)

Frosef
04-19-2010, 11:24 PM
Bots, I believe, use the cast code located in MobAI.cpp, which controls NPCs too. Specifically, do a find for "NPC::AICastSpell" and I believe that's the function bots/NPCs use to determine spell choice. I did some poking around trying to build a better healer, too.

Edit - I had an idea for a tweak. I noticed in the table for Cleric Bot spells, the HoTs are listed as type 2, a healing spell. Perhaps if they're changed to type 1024, which is for in-combat buffs, they might only refresh HoTs when nobody needs healing? This however might make them keep HoTs going on the entire group which would chew through mana pretty hard I think.

You could also try some custom code in bot.cpp's "Bot_AICheckCloseBeneficialSpells" function, which is what determines the call to AICastSpell, this wouldn't intrude upon NPC spells at least.

The easiest solution is probably to just remove the HoTs from the cleric bot list of spells. GeorgeS's Database Editing Suite works nicely, although there's no confirmation on deleting an entire table (as I found out first hand from an accidental misclick where I deleted the entire Cleric Bot spell list) so do be careful if you use it: http://www.georgestools.eqemulator.net/

If you have your own database editing software, Cleric bot spells are ID 701 in npc_spells_entries, this query will return all 75:

SELECT * FROM npc_spells_entries WHERE npc_spells_id=701

Then it's a matter of getting the spellid for the HoTs/spells you want to remove and deleting the relevant lines from the table.

gaeorn
04-19-2010, 11:30 PM
Bots, I believe, use the cast code located in MobAI.cpp, which controls NPCs too. Specifically, do a find for "NPC::AICastSpell" and I believe that's the function bots/NPCs use to determine spell choice. I did some poking around trying to build a better healer, too.

This is incorrect. There is a specific Bot::AICastSpell function for the bots in botspellsai.cpp. I started looking through this function and related functions today and found there is room for improvement in the logic. Also, a specific bot will only heal within it's own group and no bot will cast another heal on the same character for at least 2 seconds.

I have plans to improve the spell casting AI for bots but I am waiting for the spells branch to be completed so I do not have to do the work twice. Feel free to tweak the existing code in the meantime. I'll be happy to commit reasonable submissions to SVN.

Frosef
04-19-2010, 11:47 PM
This is incorrect. There is a specific Bot::AICastSpell function for the bots in botspellsai.cpp. I started looking through this function and related functions today and found there is room for improvement in the logic. Also, a specific bot will only heal within it's own group and no bot will cast another heal on the same character for at least 2 seconds.

I have plans to improve the spell casting AI for bots but I am waiting for the spells branch to be completed so I do not have to do the work twice. Feel free to tweak the existing code in the meantime. I'll be happy to commit reasonable submissions to SVN.

Ah ha! Thanks for the correction, that belays my fears of toying with bot AI messing up NPC AI.

kofac
04-20-2010, 04:08 AM
Thanks very much for the input guys.

At the moment I am still in the process of learning C++. So still finding my way around the code and what bits mean what.

I am not adverse to the HOT in fact its a very good thing at the start of the fight. Its just the long pause after it that kills off my WAR or did.

With the small changes I made the CHEAL really helps. Last night spent a good hour or so in PON. With out my 2 box Cleric. Just using a bot group with 1 cleric in. The changes as I say are no where near perfect but they did help a lot.

I actually lived and there was less down time. Due to after the HOT has worn off I was guaranteed pretty much a CHEAL to follow. Worked ok unless I pulled 3 then it got a bit tight LOL.

Only real changes I have made so far was to the following bits. As you can see I just messing with the numbers on the existing code a little.

I was trying to get my bot to cast Fast Heals etc but it seemed to make no real difference. It was a HOT followed by a CHEAL. No matter how I changed the numbers.

I did for an experiment Rem out the lines that where with //Let heal over time buff do its thing.. lines and compile. Remed out the line above it and the lines below to the } That was a bad idea it just kept casting HOT over and over again. With about a 2 or 3 seconds in between casting it.

if(tar->FindType(SE_HealOverTime)) {
// Let the heal over time buff do it's thing ...
if(tar->IsEngaged() && hpr >= 95)
break;
else if(!tar->IsEngaged())
break;
}


// Evaluate the situation
if((tar->IsEngaged()) && ((botClass == CLERIC) || (botClass == DRUID) || (botClass == SHAMAN))) {
if(hpr < 70)
botSpell = GetBestBotSpellForFastHeal(this);
else if(hpr >= 10 && hpr < 50)
botSpell = GetBestBotSpellForPercentageHeal(this);
else if(hpr >= 40 && hpr < 70)
botSpell = GetBestBotSpellForRegularSingleTargetHeal(this);
else
botSpell = GetBestBotSpellForHealOverTime(this);
}
else if ((botClass == CLERIC) || (botClass == DRUID) || (botClass == SHAMAN)) {
if(hpr < 80)
botSpell = GetBestBotSpellForPercentageHeal(this);
else if(hpr >= 10 && hpr < 95)
botSpell = GetBestBotSpellForRegularSingleTargetHeal(this);
else
botSpell = GetBestBotSpellForHealOverTime(this);
}