Jump to content
  • Pet not despawn

    • Status: Unconfirmed
      Main Category: Database
      Sub-Category: Creature
      Version: 21.1 Milestone: 20 Priority: New
      Implemented Version: 0.20

    Pet not despawn if master die

    For example:

    Master creature_template: "1915" AND his Pet creature_template: "1860"


    What can I do with it?

    User Feedback

    Recommended Comments

    ok! I fixed it.

    [B]+[/B] - Adding code.

    void PetAI::UpdateAI(const uint32 diff)
    if (!m_creature->IsAlive()) { return; }

    Unit* owner = m_creature->GetCharmerOrOwner();

    + if (!owner->IsAlive())
    + {
    + Pet* pet = owner->GetPet();
    + pet->SetDeathState(CORPSE);
    + return;
    + }

    And in DataBase: Table - "creature_template" where "entry" is pet of creature - needed add or edit a field "AIName" to "AIPet".

    >>>I think need test it, but it work...

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use