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 04-30-2002, 12:07 PM
Malevolent
Hill Giant
 
Join Date: Mar 2002
Posts: 171
Default Scripted waypoints with the scripting engine.

Previously, I used a database to do this. This time, I've used the scripting engine. The performance is about the same, so far as I can tell.

You can try it out in the lab, just zone to butcherblock.

Let me attach the script file I'm using before going into the code.

This attached quest file will move the sirens bane in a kind of elipse around the shore in butcherblock.
Reply With Quote
  #2  
Old 04-30-2002, 12:09 PM
Malevolent
Hill Giant
 
Join Date: Mar 2002
Posts: 171
Default

I had a problem with the triggers all going off at the same time. I fixed this by just assigning some really large random number.
In NPC.CPP, specifically in the constructor:

Code:
	SetWayPointStep(0);
	waypoint_timer = new Timer(30000+rand()%20000);
	waypoint_timer->Start();
In NPC.CPP, specifically in process:

Code:
	/*********************************************
	Waypoints
	*********************************************/	


	if (ismovinghome==false && !IsEngaged()){
		if (waypoint_timer->Check()){			
			if (this->GetWayPointStep() < 6){
				
				if (!this->IsCorpse() && !this->IsClient())
				this->CheckQuests(zone->GetShortName(), "WAYPOINT_CHECK", this->GetNPCTypeID());
				
			} else
			{
				this->SetWayPointStep(0);
			}

			waypoint_timer->Start(50000+rand()%25000);

		}		

	}
Reply With Quote
  #3  
Old 04-30-2002, 12:10 PM
Malevolent
Hill Giant
 
Join Date: Mar 2002
Posts: 171
Default

In npc.h, add these parts to the public members of the NPC class.

Code:
	/******************************************************
	WayPoints
	******************************************************/
	
	void SetWayPointStep(uint32 step){ Step=step;}
	uint32 GetWayPointStep(){return Step;}
	uint32 Step;
	
	/******************************************************
	Mob quest engine
	******************************************************/
	void CheckQuests(char* zonename, char * message, int32 npc_id, int32 item_id = 0, bool IsDoorScript = false);
	bool IsEnd(char* string);
	bool IsCommented(char* string);
	char * rmnl(char* nstring);	
	char * strreplace(char* searchstring, char* searchquery, char* replacement);
And add this to the private member:
Code:
	Timer*  waypoint_timer;
Reply With Quote
  #4  
Old 04-30-2002, 12:11 PM
Malevolent
Hill Giant
 
Join Date: Mar 2002
Posts: 171
Default

Use this hacked and dirt wesquests.cpp:
Reply With Quote
  #5  
Old 04-30-2002, 12:17 PM
Malevolent
Hill Giant
 
Join Date: Mar 2002
Posts: 171
Default

Oh, and in npc.h in public: I have
Code:
void    SetIsMovingHome(bool ToF) { ismovinghome=ToF;}
bool    GetIsMovingHome() { return ismovinghome;}
And I moved
float org_x, org_y, org_z, org_heading; up from protected to public.
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 06:32 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