mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-01-12 15:57:08 +00:00
mission fix redo
This commit is contained in:
parent
cb65de61ca
commit
3f1468ebdf
@ -368,15 +368,12 @@ void PetComponent::Update(float deltaTime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto* owner = GetOwner();
|
auto* owner = GetOwner();
|
||||||
|
|
||||||
if (owner == nullptr) {
|
if (owner == nullptr) {
|
||||||
m_Parent->Kill();
|
m_Parent->Kill();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_MovementAI = m_Parent->GetComponent<MovementAIComponent>();
|
m_MovementAI = m_Parent->GetComponent<MovementAIComponent>();
|
||||||
|
|
||||||
if (m_MovementAI == nullptr) {
|
if (m_MovementAI == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -390,7 +387,6 @@ void PetComponent::Update(float deltaTime) {
|
|||||||
NiPoint3 position = m_MovementAI->GetParent()->GetPosition();
|
NiPoint3 position = m_MovementAI->GetParent()->GetPosition();
|
||||||
|
|
||||||
float distanceToOwner = Vector3::DistanceSquared(position, destination);
|
float distanceToOwner = Vector3::DistanceSquared(position, destination);
|
||||||
|
|
||||||
if (distanceToOwner > 50 * 50 || m_TimerAway > 5) {
|
if (distanceToOwner > 50 * 50 || m_TimerAway > 5) {
|
||||||
m_MovementAI->Warp(destination);
|
m_MovementAI->Warp(destination);
|
||||||
|
|
||||||
@ -437,7 +433,6 @@ void PetComponent::Update(float deltaTime) {
|
|||||||
const bool digUnlocked = missionComponent->GetMissionState(842) == eMissionState::COMPLETE;
|
const bool digUnlocked = missionComponent->GetMissionState(842) == eMissionState::COMPLETE;
|
||||||
|
|
||||||
Entity* closestTresure = PetDigServer::GetClosestTresure(position);
|
Entity* closestTresure = PetDigServer::GetClosestTresure(position);
|
||||||
|
|
||||||
if (closestTresure != nullptr && digUnlocked) {
|
if (closestTresure != nullptr && digUnlocked) {
|
||||||
// Skeleton Dragon Pat special case for bone digging
|
// Skeleton Dragon Pat special case for bone digging
|
||||||
if (closestTresure->GetLOT() == 12192 && m_Parent->GetLOT() != 13067) {
|
if (closestTresure->GetLOT() == 12192 && m_Parent->GetLOT() != 13067) {
|
||||||
|
@ -5017,8 +5017,17 @@ void GameMessages::HandlePlayEmote(RakNet::BitStream* inStream, Entity* entity)
|
|||||||
if (emoteID == 0) return;
|
if (emoteID == 0) return;
|
||||||
std::string sAnimationName = "deaded"; //Default name in case we fail to get the emote
|
std::string sAnimationName = "deaded"; //Default name in case we fail to get the emote
|
||||||
|
|
||||||
|
CDEmoteTableTable* emotes = CDClientManager::Instance().GetTable<CDEmoteTableTable>();
|
||||||
|
if (emotes) {
|
||||||
|
CDEmoteTable* emote = emotes->GetEmote(emoteID);
|
||||||
|
if (emote) sAnimationName = emote->animationName;
|
||||||
|
}
|
||||||
|
|
||||||
|
RenderComponent::PlayAnimation(entity, sAnimationName);
|
||||||
|
|
||||||
MissionComponent* missionComponent = entity->GetComponent<MissionComponent>();
|
MissionComponent* missionComponent = entity->GetComponent<MissionComponent>();
|
||||||
if (missionComponent) {
|
if (!missionComponent) return;
|
||||||
|
|
||||||
if (targetID != LWOOBJID_EMPTY) {
|
if (targetID != LWOOBJID_EMPTY) {
|
||||||
auto* targetEntity = Game::entityManager->GetEntity(targetID);
|
auto* targetEntity = Game::entityManager->GetEntity(targetID);
|
||||||
|
|
||||||
@ -5043,15 +5052,6 @@ void GameMessages::HandlePlayEmote(RakNet::BitStream* inStream, Entity* entity)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CDEmoteTableTable* emotes = CDClientManager::Instance().GetTable<CDEmoteTableTable>();
|
|
||||||
if (emotes) {
|
|
||||||
CDEmoteTable* emote = emotes->GetEmote(emoteID);
|
|
||||||
if (emote) sAnimationName = emote->animationName;
|
|
||||||
}
|
|
||||||
|
|
||||||
RenderComponent::PlayAnimation(entity, sAnimationName);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GameMessages::HandleModularBuildConvertModel(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
|
void GameMessages::HandleModularBuildConvertModel(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
|
||||||
LWOOBJID modelID;
|
LWOOBJID modelID;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user