Jump to content

[One] Improve Pets & Stealth


Guest rowman

Recommended Posts

think petai ignores stealth in two cases

1)

dont attack rogues too early

2)

dont attack them any longer if they use stealth

diff --git a/src/game/PetAI.cpp 
b/src/game/PetAI.cpp index 9f9b4dd..32c1f09 100644 
--- a/src/game/PetAI.cpp 
+++ b/src/game/PetAI.cpp 
@@ -61,8 +61,11 @@ void PetAI::MoveInLineOfSight(Unit *u)          
{
             if(m_creature->IsWithinLOSInMap(u))
             { 
-                AttackStart(u); 
-                u->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); 
+                if (IsVisible(u)) 
+                { 
+                    AttackStart(u); 
+                    u->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); 
+                }
             }
         }
     } 
@@ -99,7 +102,7 @@ bool PetAI::_needToStop() const      
if(m_creature->isCharmed() && m_creature->getVictim() == m_creature->GetCharmer())          return true;   
-    return !m_creature->getVictim()->isTargetableForAttack(); 
+    return !m_creature->getVictim()->isTargetableForAttack() && IsVisible(m_creature->getVictim());
 }  

Link to comment
Share on other sites

  • 4 weeks later...

yeah but this has nothing to do with this fix ;)

you cant implement feign death in ->isTargetableForAttack() for example

- pet must be stopped if the hunter uses feign death, but if the pet is send to attack (to interupt feign death) this must be possible

Link to comment
Share on other sites

  • 6 months later...
  • 2 weeks 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