View Full Version : Cleric bot healing mobs?
prickle
01-23-2010, 04:07 PM
I'm currently using rev 1141 (no custom code). While playing on this Rev, I noticed that a lot of the mobs health bar would go up and down during a fight instead of steadily down like it did with previous builds (1112 and earlier). Today, I started paying closer attention to my battle spam and noticed this:
[Sat Jan 23 11:47:21 2010] Elliot begins to cast a spell.
[Sat Jan 23 11:47:23 2010] Tanku scores a Finishing Blow!!
[Sat Jan 23 11:47:23 2010] a rusted model has been slain by Tanku!
[Sat Jan 23 11:47:23 2010] You gain party experience!!
[Sat Jan 23 11:47:23 2010] Pusher begins to cast a spell.
[Sat Jan 23 11:47:26 2010] Rogue looks very tranquil.
[Sat Jan 23 11:47:26 2010] A rusted model's wounds fade away.Elliot is a Cleric bot. I found this bot is casting "Ethereal Remedy" on the target that the group is attempting to kill.
I removed all cleric nukes from my 701 (cleric bot) spell list, because i wanted them to save mana for heals and buffs. To take advantage of the new AI changes, I added all of the level 50 - 60 cleric heals into the cleric bot spells list (single target quick cast and single target HOTs). While the group and player heals are awesome now, the mob healing is a bit of a surprise.
Anyone else noticing this also?
prickle
01-23-2010, 06:33 PM
I take back my statement about when my cleric started healing the mob we're trying to kill. I reverted to Rev 1112, and noticed my cleric was healing the mob we were killing. I then reverted to Rev 1085, and the cleric then stopped healing the target we were killing.
Additionally, I found that as soon as I logged in to server Rev1085, my enchanter cast KEI on the group and the cleric cast Acient: Gift of Aegolism on the group, AND my chanter started casting Boon of the Garou on itself again (didn't notice it stopped doing that before). All toons/bots in the group were wearing single target versions prior to reverting to Rev 1085.
WkimWes
01-24-2010, 03:12 AM
It isn't just the cleric who is healing the mobs, the druid also healed the mob that the group was fighting. So it looks like the healing overall.
Secrets
01-24-2010, 12:47 PM
I noticed this a while back when we implemented the new Bot AI code.
Latest revisions should resolve it.
prickle
01-24-2010, 01:10 PM
sweet, I'll have to check them out then. Thanks for the reply
prickle
01-24-2010, 06:13 PM
nope... Just tried out Rev1159. My cleric is still healing the things we're trying to kill. I looked through the change logs between 1159 and 1163 and didn't see any changes to the botspellsai.cpp or bot.cpp files... so i'm certain it's not fixed in the latest revisions
prickle
01-29-2010, 01:10 PM
a light bulb just came on while preparing to add my Cleric bot nukes back into the 701 spell list. The npc_spells_entries table indexes the id column (in addition to the npc_spells_id and spellid columns). Anyway, my first monification to my cleric's spell list was to remove nukes (spell "type" 1) to force them to save mana. Later, I added in additional heal spells to that list. However, when I did so, I did not define an "id" for the new heals. So, MySQL would have automatically assigned an id to the spell, and as a result it's highly likely that the id that the spell picked up was one of the ids that the nukes use to have.
If the new bot code uses the "id" column to identify spells (instead of spellid), and doesn't check the 'type' column while deciding where or not to cast the spell, this could cause the bot to cast a heal on the target that is being killed, if the npc_spell_entries table has been altered in the way mine has.
Anyway, I'm going to add my nukes back into the cleric spell list, compile the latest source and see if it fixes anything for me.
prickle
01-29-2010, 01:59 PM
just proved my thoughts incorrect. I compared my 701 spells tables, so using the "id" column is definitely not what causes my healers to heal the mob we're killing...
prickle
01-29-2010, 10:41 PM
Well, I added my cleric nukes back into their spell list, and they've stopped healing mobs.
However, it seems my druids or my shamans are still healing mobs, and they're still using their default spell lists...
WkimWes
01-30-2010, 01:06 AM
You can add Ranger, Beastlords, and Paladins too. I've seen them heal the mobs. Does that happen to you prickle?
prickle
01-30-2010, 03:15 AM
hmmm... my druids for sure are healing mobs (stopped spawning my ranger+druid group during raids because of it)... haven't played with just my ranger bots out... don't have any beastlord bots, or paladins for that matter
WkimWes
01-30-2010, 09:49 AM
Yeah raiding gets messy when my healers heal the raid boss. lol Like he needs more help. ;)
prickle
01-30-2010, 12:39 PM
Yeah, when I first started noticing the healing was going on, it was against a raid boss that I should have been able to easily smack down. Instead, with all the healing the raid boss was receiving, the raid wiped at 50% raid boss health. When it got to that point, I noticed that the raid boss's health would go down 2% and go back up 1%, then eventually down 1% and back up 1%, and then just before total wipe it was going up more than it was going down.
I updated to Rev 1192 yesterday, and with nukes in place, it seems my group's cleric takes longer to decide whether or not to heal me, or which heal to use on me than it did when it had no nukes to choose from.
I'm gonna compare the code between 1085 and 11** revs to see if i can figure out how to make my cleric function without nukes. I'm not very good with C++, but I can sort of make heads and tails out o fit...
prickle
01-30-2010, 05:48 PM
You can add Ranger, Beastlords, and Paladins too. I've seen them heal the mobs. Does that happen to you prickle?
yup, just confirmed my Ranger bots are casting Sylvan Light on the targets I'm killing... I just yanked that spell out of my Ranger bot spell list...
gonna test a bit more... i ~think~ i've fixed my druids......
prickle
01-30-2010, 06:04 PM
I'm not entirely sure why this would make a difference, but I added ' #include "spdat.h" ' to my bot.h file and recompiled and my druids are no longer healing the target that we're killing.
To the best of my knowledge, including spdat.h in the bot.h file shouldn't make a difference because mob.h has an include statement for spdat.h, and bot.h includes mob.h.
iRFNA
02-11-2010, 02:07 PM
Well, I think I found the problem. There's a check for seeing if a particular spell is a nuke spell in spdat.cpp called IsPureNukeSpell. While it does check to see if the spell alters a target's HP, it neglects to see if that is a positive or negative change. On around line 355, I changed:
return
(
spells[spell_id].effectid[0] == SE_CurrentHP &&
effect_count == 1
);
to
return
(
spells[spell_id].effectid[0] == SE_CurrentHP &&
spells[spell_id].base[0] < 0 &&
effect_count == 1
);
and I haven't seen my bots healing enemies anymore.
Rykeau
02-11-2010, 07:01 PM
iRFNA -
Since I'm a noob and still learning how all this works, what would I need to do to implement your change into my server? I am assuming it's simply more than modifying the CPP file.
iRFNA
02-12-2010, 06:20 PM
Short answer, no it is not much more than modifying the .cpp file. You just have to change it and recompile.
Oh god, this turned into a lot of text. I'm sorry.
I'm not sure what all you have, so here's the basics. Obviously, skip everything you already have!
First, you need Visual C++ 2008 Express (http://www.microsoft.com/express/Downloads/#2008-Visual-CPP). This is for compiling the source code (including .cpp files).
While it's downloading, get the other stuff too. You'll need to get the source from SVN, and the typical SVN client is TortoiseSVN (http://tortoisesvn.net/downloads).
With TortoiseSVN installed, you'll want to make a new folder, right-click it, and click "SVN Checkout...". Set the URL of the repository to "http://projecteqemu.googlecode.com/svn/trunk/EQEmuServer" (without quotes), make sure the checkout directory is set to the one you right-clicked, and hit ok. It'll download lots of stuff, this is all the up to date source code and such.
When it's done and you have VC++ 2008 express installed, double-click the Server.sln file in the folder you checked out into. It'll open the solution for the entire emulator's code. Click the + next to Zone in the left panel, this will open up the tree for the Zone project, which compiles to Zone.exe and does pretty much all of the in-game emulation stuff. Open the "Source Files" folder with another click of a +, and scroll down until you find "spdat.cpp". You'll want to make my changes as I've suggested, by double-clicking the file so it appears in the main window. You should see line numbers, so just follow my post instructions and use a little copy and pasting.
At the top area in a toolbar, there should be a drop-down box that says something like "Debug", "DebugBots", "Release", or "ReleaseBots". You'll want to set it to "ReleaseBots". If there isn't a toolbar for it, go into the Build menu at the top and click "Configuration manager...". The top left dropdown box should be like the one I described, so set it to ReleaseBots if it isn't already and hit ok.
Now go back to that left panel where it says "Zone" that you clicked the + to early on. This part might be a bit annoying. We've gotta link up the directories for various dependencies that are required for Zone to compile. Right-click Zone and click Properties way at the bottom. Now, to run the server you've already got perl and mysql installed, so those directories just need to get linked to. Under "Configuration Properties" -> "C/C++" -> "General" in the left panel, select "Additional Include Directories" in the right panel. A little "..." button should (?) appear with your version on the far right side of that list, so click it. If not, I guess you get to type into the text box. I'm guessing that place-holder directories are already there, but they may not be. If they are, you'll see something that goes to "...\some perl folder\lib\core". You'll want to change that "...\some perl folder\" part to your perl directory, and I'm pretty sure you'll have lib\core in it. So set it to that. Same for the mysql part, you want it to go to "...\MySQL Server x.x\include". If you don't have these 2 things, add them in but with your directories for those 2 things. Hit ok if you're in that box and get out of there.
Now you need to get into "Configuration Properties" -> "Linker" -> "General" and find "Additional Library Directories" on the right. Again, there may or may not be placeholders, I dunno, but what you need to add/edit are 2 directories for perl and mysql again. It's "...\your perl folder\lib\core" and "...\MySQL Server x.x\lib\opt" that you need. Click ok for that whole properties dialog; you're out of there!
Finally, you just need to do one more annoying step... You need to get zlib. Personally, I grabbed it from here (http://www.zlib.net/zlib123-dll.zip). Extract that into your Common folder at the root of your SVN repository, so the Common folder is in the same folder as Server.sln and the zone folder, among others. I was getting pretty bored with setting stuff up at this point, so I just copied the files out of the extracted "include" and "lib" folders from zlib123-dll.zip and put them directly inside the Common folder (overwriting, without errors, zlib.h, I think). You'll need these files directly inside your Common folder for compiling to work, too. I think you need zlib1.dll there too, but I don't remember. I was sort of throwing files at things at this point.
Ok, the awful part is over if you've survived this far. Now cross your fingers, it's time to compile!
Find that nasty "Zone" in the left panel of VC++ again, it's time to show it who's boss. Right-click it, go into "Project Only", and click "Build Only Zone". It'll start spamming stuff at the bottom with hopefully no errors! Eventually it should say it is done. Your shiny new Zone.exe will be in the Build folder, which is in the same folder as Server.sln. Shut down your server if it is running and over-write your current Zone.exe wherever your server is (or back it up if you're extra-cautious, but it shouldn't be a prob). You're good to go.
If it says you're missing files, post that stuff here and I'll (or someone actually involved in the project will) sort it out, I probably forgot about things. There shouldn't be actual errors in the code, but who knows, it's always an adventure.
Once this is all working properly, you can right-click that folder you checked out into and click "SVN Update" whenever you feel like it, and it'll update the folder to the latest version of the emu. Then you can go and recompile things if they get changed instead of waiting for the occasional pre-compiled releases. It's worth it.
pfyon
02-12-2010, 06:58 PM
iRFNA -
Since I'm a noob and still learning how all this works, what would I need to do to implement your change into my server? I am assuming it's simply more than modifying the CPP file.
Short answer, no it is not much more than modifying the .cpp file. You just have to change it and recompile.
gaeorn
02-16-2010, 12:56 AM
Well, I think I found the problem. There's a check for seeing if a particular spell is a nuke spell in spdat.cpp called IsPureNukeSpell. While it does check to see if the spell alters a target's HP, it neglects to see if that is a positive or negative change. On around line 355, I changed:
return
(
spells[spell_id].effectid[0] == SE_CurrentHP &&
effect_count == 1
);
to
return
(
spells[spell_id].effectid[0] == SE_CurrentHP &&
spells[spell_id].base[0] < 0 &&
effect_count == 1
);
and I haven't seen my bots healing enemies anymore.
Committed to rev 1255. Thanks iRFNA!
Rykeau
02-23-2010, 05:36 PM
Sorry for the delay in responding - thanks all for the great responses. I appreciate it!
vBulletin® v3.8.11, Copyright ©2000-2024, vBulletin Solutions Inc.