Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 10-17-2002, 05:35 AM
Wynsom
Sarnak
 
Join Date: Oct 2002
Posts: 36
Default Faction - DistNoRoot or DistNoRootNoz?

I noticed not all NPC aggro faction is working so i was looking through the source. I can trace what is going on up to this snippet here:

Code:
if(currentmob->CastToClient()->DistNoRoot(sender) <= dist2) {
						if (!sender->IsEngaged())
							// Mob not engaged, kos to client, and client is fully connected
						{
							sender->AddToHateList(currentmob,1);				
							//char buffer[200];
							//_snprintf(buffer,200,"%s says: 'I shall attack you %s, because I hate you!'",sender->GetName(),currentmob->GetName());
							//currentmob->Message(0,buffer);
							cout << sender->GetName() << ": Aggro Added! Calculated aggrorange: " << dist2 << endl;						
							return true; // Only aggro first player
						}
						
					}
I wanted to look over DistNoRoot( ) to see what exactly was going on but then i found DistNoRootNoZ( ) in npc.c. So which function is the one that tests if a npc is within radius? I've found the faction test in npcai.c and it looks like it should be working. Im still trying to familiarize myself with the source so its all a bit foggy to me still.

Thanks
Reply With Quote
  #2  
Old 10-17-2002, 12:11 PM
kathgar
Discordant
 
Join Date: May 2002
Posts: 434
Default

The distance formula for x,y is
squareroot((x1 - x2)^2 +(y1-y2)^2).. noz is that
distnorootnoz is the same, without the root(not always needed, takes cpu time)
distnoroot is xyz, with no root, same reason
dist is xyz with root
__________________
++[>++++++<-]>[<++++++>-]<.>++++[>+++++<-]>[<
+++++>-]<+.+++++++..+++.>>+++++[<++++++>-]<+
+.<<+++++++++++++++.>.+++.------.--------.>+.
Reply With Quote
Reply


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 03:50 PM.


 

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