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.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-21-2003, 12:59 PM
Scorpious2k's Avatar
Scorpious2k
Demi-God
 
Join Date: Mar 2003
Location: USA
Posts: 1,067
Default New NPC Wander Type

I have found the need in my work with the Scorpious2k Server for a different NPC wander type.

The type I have come up with I call single run. In this type, the NPC starts at waypoint 1 and travels in sequence to the last waypoint. When he reaches it, he depops and respawns (after the specified respawn time) to start again at waypoint 1.

In order to implement this wandertype, you MUST have installed the fixes I describe in http://www.eqemulator.net/forums/viewtopic.php?t=10204

Here are the changes. In mobAI.cpp Mob::CalculateNewWaypoint() after
Code:
	switch (wandertype)
	{
	case 0: //Circular
		if (reached_end)
			cur_wp = 0;
		else
			cur_wp = cur_wp + 1;
		break;
	case 1: //Random 5
		if (ranmax > 5)
			ranmax = 5;
		if (ranmax2 > 5)
			ranmax2 = 5;
		cur_wp = cur_wp + rand()%(ranmax+1) - rand()%(ranmax2+1);
		break;
	case 2: //Random
			cur_wp = (rand()%max_wp) + (rand()%2);
		break;
	case 3: //Patrol
		if (reached_end)
			patrol = 1;
		else if (reached_beginning)
			patrol = 0;
		if (patrol == 1)
			cur_wp = cur_wp - 1;
		else
			cur_wp = cur_wp + 1;
		break;
add
Code:
	case 4:	// single run
		cur_wp = cur_wp + 1;
		break;
in Mob::AI_Process() change the line (this is in the fix I gave for wandering bug fix)
Code:
								if (gridno < 50 && cur_wp == max_wp)
to read
Code:
							if (wandertype == 4 && cur_wp == max_wp)
That's it. You will now have wander type 4 - single run.

If I can find somewhere to host it, I will make the final version of this available for download.
__________________
Maybe I should try making one of these servers...
Reply With Quote
 


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:21 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