Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Custom

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 07-16-2009, 09:06 AM
Capheus
Hill Giant
 
Join Date: Apr 2008
Location: Milwaukee
Posts: 141
Default goto (playername)

Another one I put on my bot. This will move you to any player in the zone.

Code:
#goto (playername)

sub EVENT_SAY {

 if($text=~/goto/i){
  $here = 0;
  $mee = $client;
  $zid = $zoneid;
  @word = split /\s+/, $text;
  $go = $word[1];
  quest::say("Looking for $go...");
  my $list_check = 0;

  for ($list_check = 0; $list_check < 2000; $list_check++) {

   $client_search = $entity_list->GetClientByID($list_check);

   if ($client_search) {
    my $cx = int($client_search->GetX());
    my $cy = int($client_search->GetY());
    my $cz = int($client_search->GetZ());
    $person = $client_search->GetCleanName();

    if ($person =~ /$go/i) {
     $mee->MovePC($zid,$cx,$cy,$cz,0);
     $here = 1;
  }
   }
    }

  if ($here == 0) {
   quest::say("I can't find $go. He/She may not be in the zone anymore.");
  }

 }
}
Reply With Quote
  #2  
Old 07-16-2009, 09:32 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

You should be able to use $entity_list->GetClientByName($go) rather than looping like that, or at least use 'last' to break out of the loop once you find a player name that matches.
Reply With Quote
  #3  
Old 07-16-2009, 01:39 PM
Capheus
Hill Giant
 
Join Date: Apr 2008
Location: Milwaukee
Posts: 141
Default

Wow can't believe I missed that one, thanks a lot! shortened version here.

Code:
sub EVENT_SAY {

 if($text=~/goto/i){
  $mee = $client;
  $zid = $zoneid;
  @word = split /\s+/, $text;
  $go = $word[1];
  quest::say("Looking for $go...");
  $client_search = $entity_list->GetClientByName($go);

  if ($client_search) {
   my $cx = int($client_search->GetX());
   my $cy = int($client_search->GetY());
   my $cz = int($client_search->GetZ());
   $mee->MovePC($zid,$cx,$cy,$cz,0);
  }

  else {
    quest::say("I can't find $go. He/She may not be in the zone anymore.");
  }
  
 }
}
Reply With Quote
  #4  
Old 07-24-2009, 11:52 AM
drzoyburg
Sarnak
 
Join Date: Jun 2009
Location: ohio,usa
Posts: 36
Default

Where did you insert this to make this work?

Doc
Reply With Quote
  #5  
Old 07-24-2009, 11:59 PM
Capheus
Hill Giant
 
Join Date: Apr 2008
Location: Milwaukee
Posts: 141
Default

If you want to make it work on your bot in all zones you will need to name it as botname.pl and save it in the .../quests/templates directory. If you didn't already know, the templates templates directory acts as all zones for quests and scripts. Using npctypeidnumber.pl doesn't seem to work, it has to be name.pl
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 12:36 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3