feat(Core/Eluna): Added new OnPetAddedToWorld() hook for Eluna. (#8084)
This commit is contained in:
@@ -239,6 +239,9 @@ void Creature::AddToWorld()
|
|||||||
GetVehicleKit()->Install();
|
GetVehicleKit()->Install();
|
||||||
#ifdef ELUNA
|
#ifdef ELUNA
|
||||||
sEluna->OnAddToWorld(this);
|
sEluna->OnAddToWorld(this);
|
||||||
|
|
||||||
|
if (IsGuardian() && ToTempSummon() && ToTempSummon()->GetSummonerGUID().IsPlayer())
|
||||||
|
sEluna->OnPetAddedToWorld(ToTempSummon()->GetSummonerUnit()->ToPlayer(), this);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,10 @@
|
|||||||
#include "WorldPacket.h"
|
#include "WorldPacket.h"
|
||||||
#include "WorldSession.h"
|
#include "WorldSession.h"
|
||||||
|
|
||||||
|
#ifdef ELUNA
|
||||||
|
#include "LuaEngine.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
Pet::Pet(Player* owner, PetType type) : Guardian(nullptr, owner ? owner->GetGUID() : ObjectGuid::Empty, true),
|
Pet::Pet(Player* owner, PetType type) : Guardian(nullptr, owner ? owner->GetGUID() : ObjectGuid::Empty, true),
|
||||||
m_usedTalentCount(0), m_removed(false), m_owner(owner),
|
m_usedTalentCount(0), m_removed(false), m_owner(owner),
|
||||||
m_happinessTimer(PET_LOSE_HAPPINES_INTERVAL), m_petType(type), m_duration(0),
|
m_happinessTimer(PET_LOSE_HAPPINES_INTERVAL), m_petType(type), m_duration(0),
|
||||||
@@ -93,6 +97,11 @@ void Pet::AddToWorld()
|
|||||||
GetCharmInfo()->SetIsFollowing(false);
|
GetCharmInfo()->SetIsFollowing(false);
|
||||||
GetCharmInfo()->SetIsReturning(false);
|
GetCharmInfo()->SetIsReturning(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ELUNA
|
||||||
|
if (GetOwnerGUID().IsPlayer())
|
||||||
|
sEluna->OnPetAddedToWorld(GetOwner(), this);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pet::RemoveFromWorld()
|
void Pet::RemoveFromWorld()
|
||||||
|
|||||||
Reference in New Issue
Block a user