Jump to content

[11879.5][patch] fix some behavior of pets


Guest faramir118

Recommended Posts

What bug does the patch fix? What features does the patch add?

several bugs related to pets:

  • Unit::Update always calls StopCombat for pets that are owned by NPCs
  • Pets are prevented from calling for or receiving assistance
  • Pets aren't unsummoned when NPC owner dies (may not be blizzlike)

For which repository revision was the patch created?

11000

Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

no

Who has been writing this patch? Please include either forum user names or email addresses.

me

patch:

https://gist.github.com/777044

Link to comment
Share on other sites

Pets aren't unsummoned when NPC owner dies (may not be blizzlike)

In some cases they are, and in others they aren't. I have a feeling that most of the time in the cases where they despawn they aren't really "pets" so much as adds though. And the pet only stays if the person who attacked the NPC owner is still in combat with it, otherwise I believe the pet does despawn.

Link to comment
Share on other sites

Using UDB 395, you can tests these on and entries 1564 (Bloodsail Warlock) and 10928 (Succubus Minion, the pet)

  1. succubus doesn't despawn when warlock dies
  2. succubus doesn't fight, because StopCombat is called from Unit::Update
  3. warlock doesn't aggro when succubus is attacked
  4. succubus doesn't aggro when warlock is attacked (not as easy to see because of #2)

As for the player-owned pets, it makes sense to allow them to call for assistance (for example, so city guards can assist)

Player-owned pets probably should not assist others though... that's easy to add back in.

Link to comment
Share on other sites

Tested and this patch works for the most part except if you attack the pet owner the pet does NOT assist. If you attack the pet the owner DOES assist, however.

Also, there is no code in the current core to replace as shown in your Git revision (unless you're using 2.4.3?)

if (!GetCharmerOrOwnerGuid().IsEmpty())

Link to comment
Share on other sites

Ok, I found out why pets aren't added to assistants list - they are stored as world object instead of grid object.

Rather than visit a whole other storage, is it better to trigger pet assist directly from the owner?

PS

Who wrote the Visitor-pattern and related code? With all of that functional-style code, I would have been 100% lost if I hadn't taken a class that covered Scheme during undergrad.

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

Looks solid and well-thought. Unfortunately, I'm unable to test it due to my server PC suffering a hard drive failure, but I'm definitely adding your commits to my local repo.

Regarding the commit that despawns a pet when their NPC master dies: It may not be the same behavior as retail, but the result is the way it should work. I'd say you've done the commercial devs one better! After all, duplicating retail functionality shouldn't mean there is no room for improvement.

Thank you very much for these fixes, good sir.

Link to comment
Share on other sites

It's strange how little attention we usually pay to details when playing this game. Despite having seen quite some NPC + pet combinations in the world, I couldn't answer some of the questions. So in the name of science, I visited a few 'Bloodsail Warlock' NPCs and tested a few things ;)

These warlocks have minions that don't walk nicely to their side but seems to walk around by themselves, in the close neighborhood of their master. When trying to aggro something, I tried to do so when the distance between both was maximal (and non destructive, with a curse of elements).

1. When you aggro the pet (Imp minion or Succubus minion), you aggro the master too.

2. When you aggro the master, you aggro the pet too.

3. When you kill the warlock first, the pet doesn't despawn but keeps fighting until you kill it too. However, if you kill the warlock and then walk away, the pet follows you but eventually stops combat (the well known 'distance reset'), returns to it spot (I'm not sure if that's the point where you aggroed them, their spawn point or the master's spawn point) and then despawns upon arriving there!

4. When you kill the pet first, the warlocks obviously don't stop fighting. I haven't seen any that resummon their pet while still in combat. When you distance reset the warlock, they return to their spot and immediately summon their pets again upon arrival.

Fun fact: being 85, their spells usually missed me. If the minion was an imp, its firebolt usually missed me too. I've had a few cases where both the warlock and imp missed me several times in a row (5+), and then dropped combat despite the fact I didn't move at all. So it certainly wasn't a 'distance reset'. It's like they just gave up: they stopped combat and started walking around again. The succubus minion did minimal melee damage, so that combination didn't do that.

Just posting this here, you never know it helps in some way, now or in the feature :)

Please note this was done with the current patch, 4.0.6.

Link to comment
Share on other sites

  • 6 months later...

[mangos] Revision 11800

[sD2] 2290

[uDB] 402

[ACID] 3.0.8

Hi

Just tested your patch on newest mangos... I added it manualy (ctrl+C ...ctrl+v). <--- compiled without any problems...

After tests....

- bug with "StopCombat" disappeared :).... Finally we can attack npc's pet.

- Npc will attack us ...when we'll atack his pet.

- had no console errors at all. ( no crash etc)

When we kill npc... pet disappears (not sure if this is blizzlike) but .... thats not problem at all

And again question to devs... can you look at this patch..(for me works really well)

+1 to master from me.

faramir118 - Thank you very much for your hard work.

EDIT:

for mangos: Rev.11800

http://paste2.org/p/1669107

Link to comment
Share on other sites

  • 3 months later...
×
×
  • 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