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 10-10-2010, 11:34 PM
Cottus
Fire Beetle
 
Join Date: Sep 2010
Posts: 11
Default Checking pet owners in script files

I have a quest file which basically has the following:

Code:
sub EVENT_ATTACK {
    quest::shout("$name is attacking me (level $ulevel)");
}

sub EVENT_AGGRO {
    quest::shout("$name has aggroed me (level $ulevel)");
}
This NPC casts an aoe. Now I have my warrior and a mage with a pet, lets call him Larer.

When my warrior attacks I get

"Cottus has aggroed me (level 60)"
"Cottus is attacking me (level 60)"

Then the aoe goes off and I get:
"Larer000 is attacking me (level 49)".

The aggro event never fires for the mage, even though the mage makes it onto the hatelist. And the attack event only fires for the pet, which makes sense.

Is there any way in the perl script to check if the "client" is a pet in the attack portion and get its owner? Calling $mob->GetOwnerID() doesnt seem to work, nor does $mob->GetOwnerOrSelf().
Reply With Quote
  #2  
Old 10-11-2010, 01:06 AM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,449
Default

Quote:
Originally Posted by Cottus View Post
Is there any way in the perl script to check if the "client" is a pet in the attack portion and get its owner? Calling $mob->GetOwnerID() doesnt seem to work, nor does $mob->GetOwnerOrSelf().

Something like this should work:

Code:
sub EVENT_ATTACK {

f( $mob->IsPet() && $mob->IsNPC() )
{
$mob = $mob->GetOwner();
}

    quest::shout("$mob->GetCleanName() is attacking me (level $mob->GetLevel())");
}

sub EVENT_AGGRO {

f( $mob->IsPet() && $mob->IsNPC() )
{
$mob = $mob->GetOwner();
}

    quest::shout("$mob->GetCleanName() has aggroed me (level $mob->GetLevel())");
}
You can even call other functions, because you now have a pointer to that client object. So if you want to do other things based on that client who aggroed, you can by using $mob->CastToClient()
Reply With Quote
  #3  
Old 10-13-2010, 12:40 AM
Cottus
Fire Beetle
 
Join Date: Sep 2010
Posts: 11
Default

Thanks much for the suggestions, Secrets.

The script still isnt working, so I need to dig into what version of eqemu I'm working with. I am nearly 100% its an issue with the $mob variable or some of its methods not being properly exposed to perl.
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 01:26 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