EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Spell Support (https://www.eqemulator.org/forums/forumdisplay.php?f=664)
-   -   Pet Death Upon Zoning (https://www.eqemulator.org/forums/showthread.php?t=42737)

strugglegenerator 12-04-2019 08:53 AM

Pet Death Upon Zoning
 
I want pets to die when the player zones. I know I can achieve this by putting a script on every pet NPC in the game, but before I go doing that, I'm curious if there is a simple on/off switch somewhere in the database. I can't find it anywhere.

Please advise! =)

**SOLVED**

I added this .pl script in my global_player.pl file and it worked like a charm:
Code:

sub EVENT_ZONE {
#:: Match if a player has a pet when exiting a zone
if ($client->GetPetID()) {
        #:: Get the pet's ID and kill it
        $PetID = $entity_list->GetMobByID($client->GetPetID());
        $PetID->Kill();
}
}

sub EVENT_ENTERZONE {
#:: Match if a player has a pet when entering a zone
if ($client->GetPetID()) {
        #:: Get the pet's ID and kill it
        $PetID = $entity_list->GetMobByID($client->GetPetID());
        $PetID->Kill();
}
}



All times are GMT -4. The time now is 01:30 AM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.