Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mob's pets can not clear aggro list #1460

Closed
PadreWoW opened this Issue Jul 7, 2016 · 17 comments

Comments

Projects
None yet
5 participants
@PadreWoW
Copy link

PadreWoW commented Jul 7, 2016

Revision:
last
Operating system:
serv2008r2
Current behavior:
Mob's pets can not clear aggro list
They pursue player through all maps
the problem was detected in Zangarmarsh with Tamed Sporebat
untitled

Expected behavior:
Pets should clear aggro list same as their masters

Steps to reproduce the problem:

@PadreWoW

This comment has been minimized.

Copy link
Author

PadreWoW commented Jul 13, 2016

Tested on clear core without any third-party patches

@PadreWoW

This comment has been minimized.

Copy link
Author

PadreWoW commented Aug 19, 2016

I have a fix - PLEASE TEST IT!

In PetAI.cpp
after
// Must also check if victim is alive
if (inCombat && (!me->GetVictim() || (me->ToPet() && me->ToPet()->GetModeFlags() & PET_MODE_DISABLE_ACTIONS)))
_stopAttack();

add this:
if (!owner->IsInCombat())
{
_stopAttack();
me->DeleteThreatList();
me->CombatStop();
return;
}

@PadreWoW

This comment has been minimized.

Copy link
Author

PadreWoW commented Aug 20, 2016

Can anyone answer me?
Or all dead?

@DkVagabonden

This comment has been minimized.

Copy link
Contributor

DkVagabonden commented Aug 24, 2016

Hello Padre,

Going to test this now!

@Phatcat

This comment has been minimized.

Copy link

Phatcat commented Aug 24, 2016

Yeah, you may want to hold off on that, because....

https://github.com/OregonCore/OregonCore/blob/master/src/game/CreatureAISelector.cpp#L53

Creature's pets don't even use PetAI. Only player's pets and controllable guardians.

@Phatcat

This comment has been minimized.

Copy link

Phatcat commented Aug 25, 2016

@Phatcat

This comment has been minimized.

Copy link

Phatcat commented Aug 25, 2016

Sorry, ignore my comments altogether; they don't have anything to do with this issue or the proposed fix, they only have to do with the AISelector.

@ljwlaji

This comment has been minimized.

Copy link

ljwlaji commented Aug 25, 2016

i think this should be write in unit.cpp while the Creature is out of combat then check if they have any pet(s). and pet(s)->combatstop();

edit: DO NOT check when master is a player

em....should be like this;


void Unit::CombatStop(bool includingCast)
{
if (includingCast && IsNonMeleeSpellCast(false))
InterruptNonMeleeSpells(false);

AttackStop();
RemoveAllAttackers();
m_HostileRefManager.deleteReferences();
if (GetTypeId() == TYPEID_PLAYER)
    ToPlayer()->SendAttackSwingCancelAttack();     // melee and ranged forced attack cancel
else if (Unit*pet = this->GetCharm())
{
        pet->CombatStop();
}
ClearInCombat();

}


not test yet = =

@Phatcat

This comment has been minimized.

Copy link

Phatcat commented Aug 25, 2016

i think this should be write in unit.cpp while the Creature is out of combat then check if they have any pet(s). and pet(s)->combatstop();

I'd agree that this seems like the more proper fix.

@ljwlaji

This comment has been minimized.

Copy link

ljwlaji commented Aug 25, 2016

bool CreatureAI::_EnterEvadeMode()
{
if (!me->IsAlive())
return false;

// sometimes bosses stuck in combat?
me->DeleteThreatList();
me->CombatStop(true);
me->SetLootRecipient(NULL);
me->SetPlayerDamaged(false);
me->SetLastDamagedTime(0);
+if (Creature*creature = me->GetGuardianPet())
    +creature->AI()->_EnterEvadeMode();
if (me->IsInEvadeMode())
    return false;

me->RemoveAllAuras();
me->LoadCreaturesAddon();
// @todo Determine if required
//me->SetReactState(REACT_AGGRESSIVE);

return true;

}

OK seems like worked

@PadreWoW

This comment has been minimized.

Copy link
Author

PadreWoW commented Aug 25, 2016

tested?

@ljwlaji

This comment has been minimized.

Copy link

ljwlaji commented Aug 25, 2016

sure tested

@PadreWoW

This comment has been minimized.

Copy link
Author

PadreWoW commented Aug 25, 2016

Why do you think that your fix better?
My fix checks if pet's owner is not in combat - I think this is better than simple "EnterEvadeMode" without owner check
You don't think so?

@ljwlaji

This comment has been minimized.

Copy link

ljwlaji commented Aug 25, 2016

@PadreWoW
That's NOT I said lol I just repo the fix..

@PadreWoW

This comment has been minimized.

Copy link
Author

PadreWoW commented Aug 25, 2016

I'm trying to engage in a constructive discussion
I want to understand what's better

@Phatcat

This comment has been minimized.

Copy link

Phatcat commented Aug 27, 2016

I'll try to answer this to my best knowledge;

the reason it is better to do this in the owner's evade call is that it's very cumbersome to do something that specific directly in the generic AI (petAI). All active pets will have to do those checks, even though they are only relevant in a very small fraction of any time (which in my opinion is exactly when the owner itself is evading), and only with creature pets (as players pets don't go into evade - by doing it with the unit owner player's pets will never do those checks)

My fix checks if pet's owner is not in combat

When a mob enters 'evade mode' he usually be default leaves combat; ie by default the owner cannot both be in combat while also evading. sorta.

@Phatcat

This comment has been minimized.

Copy link

Phatcat commented Aug 27, 2016

Also by doing it in the owners evade call rather than the AI is that nomatter what AI the pet is using (if it would ever use anything else than petAI); otherwise you'd have to add the functionality to any AI that a summon with a owner can be assigned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.