Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 04-03-2011, 11:01 AM
lanystvyl
Sarnak
 
Join Date: Jan 2010
Posts: 53
Default need the client to issue a command

I thought this would be easy but I can't find the right way to do this.

#need to check if client has pet not sure if i need to but it makes sense to, if pet == true then remove the pet on zone from player.

sub EVENT_ENTERZONE {

GetPetID()

#assuming this will let me know if there is a pet, not sure on syntax.

how do you force the client issue the pet kill command? I cant find this part.
/pet get lost
Reply With Quote
  #2  
Old 04-03-2011, 12:16 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

Should be something like this:

Code:
sub EVENT_ENTERZONE {
  my $pet_id = $client->GetPetID();
  if ($pet_id) {
    $pet = $entity_list->GetNPCByID($pet_id);
    $pet->Depop();
  }
}
Reply With Quote
  #3  
Old 04-03-2011, 05:54 PM
lanystvyl
Sarnak
 
Join Date: Jan 2010
Posts: 53
Default

This almost works Depop() doesn't depop the pet. It leaves the pet at the zone-line, and also keeps it in the pet window. Although the pet is no longer yours.
Reply With Quote
  #4  
Old 04-03-2011, 08:48 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

Then it's most likely the server and client arent synced. Your client may see a ghost. You can add a delay using a timer to ensure pet and client are in zone for the client before it depops.
Reply With Quote
  #5  
Old 04-04-2011, 08:15 AM
lanystvyl
Sarnak
 
Join Date: Jan 2010
Posts: 53
Default

Going to try this when i get the chance;

Code:
for ($count = 10; $count >= 1; $count--) {

sub EVENT_ENTERZONE {
  my $pet_id = $client->GetPetID();
  if ($pet_id) {
    $pet = $entity_list->GetNPCByID($pet_id);
    $pet->Depop();
      }
   }
 	
}
If it looks wrong let me know.
Reply With Quote
  #6  
Old 04-04-2011, 10:14 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

Yeah, I wouldn't do it that way. I would use a timer. Something like this:

Code:
sub EVENT_ENTERZONE {
  my $pet_id = $client->GetPetID();
  if ($pet_id) {
    quest::settimer($pet_id, 3);
  }
}

sub EVENT_TIMER {
  quest::stoptimer($timer);
  $pet = $entity_list->GetNPCByID($timer);
  $pet->Depop();
}
And if lag seems to still make it not catch the pet, move the entire function underneath the timer.
Reply With Quote
  #7  
Old 04-05-2011, 07:51 AM
lanystvyl
Sarnak
 
Join Date: Jan 2010
Posts: 53
Default

Thank you, this works. I adjusted the time a little for each zone I want it to work in. It takes 3 seconds after zone before the name turns red, so after that the pet can die off. pretty cool stuff.
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 09:12 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3