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

Development::Bots Forum for bots.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-07-2011, 08:01 AM
Criimson
Hill Giant
 
Join Date: Sep 2006
Posts: 172
Default Enchanter mez code

SO looking through some of the code I found an agro check and thought I'd start there.

But my C++ knowledge hasn't quite gotten to pointers. Ive only taken early classes at this point and am hoping somone can help.

Code:
//Criimson:  Testing AI mez code
					//Say("BotOwner = %s.", GetBotOwner());
					//Say("Target = %s.", GetTarget());
					//int testMez = (entity_list.GetHatedCount(GetBotOwner(), GetTarget()));
					//Say("The number of mobs I could mez is %s.", testMez);
This is the code I was working with. A simple check during the enchanter spell ai to see if the chanter can even see how many mobs the MT has agroing him.

Here is the actual code I am calling:

Code:
int EntityList::GetHatedCount(Mob *attacker, Mob *exclude) {

	// Return a list of how many non-feared, non-mezzed, non-green mobs, within aggro range, hate *attacker

	if(!attacker) return 0;

	int Count = 0;

	LinkedListIterator<NPC*> iterator(npc_list);

	for(iterator.Reset(); iterator.MoreElements(); iterator.Advance()) {

		NPC* mob = iterator.GetData();

		if(!mob || (mob == exclude)) continue;
		
		if(!mob->IsEngaged()) continue;

		if(mob->IsFeared() || mob->IsMezzed()) continue;

		if(attacker->GetLevelCon(mob->GetLevel()) == CON_GREEN) continue;

		if(!mob->CheckAggro(attacker)) continue;

		float AggroRange = mob->GetAggroRange();

		// Square it because we will be using DistNoRoot
			
		AggroRange = AggroRange * AggroRange;

		if(mob->DistNoRoot(*attacker) > AggroRange) continue;

		Count++;

	}

	return Count;

}
I was hoping this code could be modified a bit to allow the enchanter bot to mez the adds.

I'm guessing I'm missing something simple

Criimson
Reply With Quote
 

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 02:35 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