View Single Post
  #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