mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
[10741] Add AI function OwnerKilledUnit for protector pets (when owner kills unit)
Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
82505a8633
commit
21d63d491b
3 changed files with 15 additions and 1 deletions
|
|
@ -785,7 +785,18 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
|||
|
||||
// Call KilledUnit for creatures
|
||||
if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->AI())
|
||||
{
|
||||
((Creature*)this)->AI()->KilledUnit(pVictim);
|
||||
}
|
||||
else if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
// currently not known if other pet types (not controllable) may have some action at owner kills
|
||||
if (Pet* pProtector = GetProtectorPet())
|
||||
{
|
||||
if (pProtector->AI())
|
||||
pProtector->AI()->OwnerKilledUnit(pVictim);
|
||||
}
|
||||
}
|
||||
|
||||
// achievement stuff
|
||||
if (pVictim->GetTypeId() == TYPEID_PLAYER)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue