Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Bots

Development::Bots Forum for bots.

Reply
 
Thread Tools Display Modes
  #1  
Old 08-29-2010, 09:33 AM
bad_captain
Developer
 
Join Date: Feb 2009
Location: Cincinnati, OH
Posts: 512
Default

A lot of the bot commands have hard coded spells that they use depending on level, etc. The bots usually don't have those same spells in their spell lists (or they would try to cast them when they shouldn't). Check in bots.cpp to find the commands for mez, resist buffs, cures, etc. For mez, specifically, the command calls Bot::MesmerizeTarget(Mob* target) which has the spell ids for the mez spells.
Reply With Quote
  #2  
Old 08-29-2010, 02:37 PM
lich2594
Sarnak
 
Join Date: Jun 2006
Location: Tennessee, USA
Posts: 77
Default

Yeah, I did a little more digging last night and see that it loads spells in order by level and mana consumption, directly from the... That's as far as I could see, from the functions. What I want to know is if it is loading spells from the spells_new table, npc_spells, or a bot table?

It's a lot of code to back track through to find what I am looking for, but I may just have to do that. I was just hoping that someone already knew.

My logic is that, if it is loading directly from the spells_new table, then why is their spell sets for the bots? Is the list just obsolete now? Also, if it is loading spells directly from the spells table, shouldn't it automatically use the newest spells that I have created? It just leads me on to more and more questions.

Thanks for your input.
__________________
Reply With Quote
  #3  
Old 08-29-2010, 06:36 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,449
Default

I believe the bot lists are hardcoded (?!) to use certain spell list IDs in the 700's. Correct me if i'm wrong though, I haven't touched that code in forever.

It should be in latest PEQ as Bot Enchanter Spell List for example, under npc_spells.

You should be able to add more to the hardcoded lists and they will pick it up. Bots are only coded to know what to do on certain spelltypes though. You'll have to code any custom spelltypes into bots. Their logic is similar, though a bit advanced to NPC Spell logic, and it should be fairly easy to port some stuff into the bot AI logic that isn't present from NPC AI logic.

Also, I didn't bother putting a debugger on them but there's a ton of bot crashes still. I would advise you don't use them unless you are an advanced developer who can fix the bots. Either that or if you are feeling brave, make them a friend class of client.
Reply With Quote
  #4  
Old 08-29-2010, 06:42 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,449
Default

It also seems like a lot of the mezzing spells are hardcoded, I assume the same for Enduring Breath spells, etc.

Take this example code for mezzing an NPC:

Code:
bool Bot::MesmerizeTarget(Mob* target) {
	bool Result = false;

	if(target) {
		int mezid = 0;
		int mezlevel = GetLevel();

		if(mezlevel >= 69) {
			mezid = 5520;
		}
		else if(mezlevel == 68) {
			mezid = 8035;
		}
		else if(mezlevel == 67) {
			mezid = 5503;
		}
		else if(mezlevel >= 64) {
			mezid = 3358;
		}
		else if(mezlevel == 63) {
			mezid = 3354;
		}
		else if(mezlevel >= 61) {
			mezid = 3341;
		}
		else if(mezlevel == 60) {
			mezid = 2120;
		}
		else if(mezlevel == 59) {
			mezid = 1692;
		}
		else if(mezlevel >= 54) {
			mezid = 1691;
		}
		else if(mezlevel >= 47) {
			mezid = 190;
		}
		else if(mezlevel >= 30) {
			mezid = 188;
		}
		else if(mezlevel >= 13) {
			mezid = 187;
		}
		else if(mezlevel >= 2) {
			mezid = 292;
		}
		if(mezid > 0) {
			int32 DontRootMeBeforeTime = 0;
			CastSpell(mezid, target->GetID(), 1, -1, -1, &DontRootMeBeforeTime);
			target->SetDontRootMeBefore(DontRootMeBeforeTime);
			Result = true;
		}
	}

	return Result;
}
So yeah, it is level-dependant and somewhat hardcoded as I thought. The spell lists only apply to the AI logic, not a bot command.

What it seems like is that you are going to have to either: Check the spell array on zone bootup, load the bots' spells into memory that is the best spell for them for each level, then just reference the memory every time you cast a spell.

Or: Change the hardcoded spells. Not as flexible but it works.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 11:42 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3