Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Feature Requests

Development::Feature Requests Post suggestions/feature requests here.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-27-2009, 06:46 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

In this thread, Justsomeguy shows how to use quest::moveto and save the new WP after each move fairly easily:

http://www.eqemulator.net/forums/sho...329#post175329


As long as you have this in your script, it will save every WP it gets to as long as the NPC isn't already using a grid:

Code:
sub EVENT_WAYPOINT {

  $npc->SaveGuardSpot(0);

}
If your NPC is already on a grid, you can just have them do a quest::stop() to make them leave the grid, and you can add a $npc->SaveGuardSpot(0) in after the stop so it will stay at it's current position. Then, if you want to have say messages trigger at certain WPs, you can just use variable settings after you do your moveto command and then set the say message to happen when EVENT_WAYPOINT is triggered if that certain variable is currently set. Something like this:

Code:
my $Destination = "None";

sub EVENT_SAY {

	if ($text=~/hail/i) {
		quest::say("I can [move] if I am in your way.");
	}

	if ($text=~/move/i) {
		#Moves and sets a variable for the waypoint
		quest::say("Very well.");
		quest::moveto(100, 200, 300);
		$Destination = "RoomB"; #Naming this makes it easy to know which point you are dealing with if you have many.
		quest::stop(); #only required if the NPC is already on a grid
	}
}

sub EVENT_WAYPOINT {

$npc->SaveGuardSpot(0);	#this is so npcs don't not walk to waypoint and return immediately

	if($Destination eq "RoomB") {	#NPC Has Moved
		quest::say("That move went well enough.");
	}
}
This way isn't too overly complex and you don't need to use timers for say messages unless you want the NPC to say something sometime after it arrives at it's destination.

I do agree that the stop option should definitely be added to the moveto quest command. It would have saved me a bit of work on a script I am currently working on that has quite a bit of moving around in it. Heading probably wouldn't be a bad thing to have as an option either. I might try to look into adding these features if I get some time soon. For now, the above method works pretty well.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
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 02:57 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