mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-01-11 15:27:07 +00:00
added some pet debug commands
This commit is contained in:
parent
93592c775b
commit
1c01219ae9
@ -155,12 +155,12 @@ void PetComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpd
|
||||
void PetComponent::OnUse(Entity* originator) {
|
||||
LOG("PET USE!");
|
||||
|
||||
if(m_ReadyToDig) {
|
||||
/*if(m_ReadyToDig) {
|
||||
LOG("Dig initiated!");
|
||||
m_TresureTime = 2.0f;
|
||||
//m_ReadyToDig = false;
|
||||
SetAbility(PetAbilityType::DigAtPosition);
|
||||
}
|
||||
}*/
|
||||
|
||||
if (m_Owner != LWOOBJID_EMPTY) {
|
||||
return;
|
||||
@ -434,9 +434,9 @@ void PetComponent::Update(float deltaTime) {
|
||||
|
||||
skipTresure:
|
||||
|
||||
m_MovementAI->SetHaltDistance(haltDistance);
|
||||
//m_MovementAI->SetHaltDistance(haltDistance);
|
||||
|
||||
m_MovementAI->SetMaxSpeed(2.5f);
|
||||
//m_MovementAI->SetMaxSpeed(2.5f);
|
||||
|
||||
m_MovementAI->SetDestination(destination);
|
||||
|
||||
|
@ -8,10 +8,6 @@
|
||||
|
||||
enum PetStatus : uint32_t {
|
||||
NONE,
|
||||
UNKNOWN1 = 0x1,
|
||||
UNKNOWN2 = 0x2,
|
||||
UNKNOWN3 = 0x4,
|
||||
UNKNOWN4 = 0x8,
|
||||
BEING_TAMED = 0x10,
|
||||
IS_NOT_WAITING = 0x20, // Right name? - used to be decimal 20
|
||||
PLAY_SPAWN_ANIM = 0x80,
|
||||
|
@ -803,6 +803,92 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
petComponent->Command(commandPos, entity->GetObjectID(), commandType, typeId, true);
|
||||
}
|
||||
|
||||
// Pet speed utility
|
||||
if (chatCommand == "setpetmaxspeed" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
if (args.size() != 1) {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Invalid number of arguments!");
|
||||
return;
|
||||
}
|
||||
|
||||
float petMaxSpeed;
|
||||
if (!GeneralUtils::TryParse(args[0], petMaxSpeed)) {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Invalid speed!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Determine if player has a pet summoned
|
||||
auto* petComponent = PetComponent::GetActivePet(entity->GetObjectID());
|
||||
if (!petComponent) {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"No active pet found!");
|
||||
return;
|
||||
}
|
||||
|
||||
auto* movementAIComponent = petComponent->GetParentEntity()->GetComponent<MovementAIComponent>();
|
||||
if (!movementAIComponent) return;
|
||||
|
||||
movementAIComponent->SetMaxSpeed(petMaxSpeed);
|
||||
|
||||
std::u16string msg = u"Set pet max speed to " + (GeneralUtils::to_u16string(petMaxSpeed));
|
||||
ChatPackets::SendSystemMessage(sysAddr, msg);
|
||||
}
|
||||
|
||||
// Set pet acceleration
|
||||
if (chatCommand == "setpetaccel" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
if (args.size() != 1) {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Invalid number of arguments!");
|
||||
return;
|
||||
}
|
||||
|
||||
float petAccel;
|
||||
if (!GeneralUtils::TryParse(args[0], petAccel)) {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Invalid acceleration!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Determine if player has a pet summoned
|
||||
auto* petComponent = PetComponent::GetActivePet(entity->GetObjectID());
|
||||
if (!petComponent) {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"No active pet found!");
|
||||
return;
|
||||
}
|
||||
|
||||
auto* movementAIComponent = petComponent->GetParentEntity()->GetComponent<MovementAIComponent>();
|
||||
if (!movementAIComponent) return;
|
||||
|
||||
movementAIComponent->SetAcceleration(petAccel);
|
||||
|
||||
std::u16string msg = u"Set pet acceleration to " + (GeneralUtils::to_u16string(petAccel));
|
||||
ChatPackets::SendSystemMessage(sysAddr, msg);
|
||||
}
|
||||
|
||||
// Set pet halt distance
|
||||
if (chatCommand == "setpethalt" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
if (args.size() != 1) {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Invalid number of arguments!");
|
||||
return;
|
||||
}
|
||||
|
||||
float petHaltDistance;
|
||||
if (!GeneralUtils::TryParse(args[0], petHaltDistance)) {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Invalid halt distance!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Determine if player has a pet summoned
|
||||
auto* petComponent = PetComponent::GetActivePet(entity->GetObjectID());
|
||||
if (!petComponent) {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"No active pet found!");
|
||||
return;
|
||||
}
|
||||
|
||||
auto* movementAIComponent = petComponent->GetParentEntity()->GetComponent<MovementAIComponent>();
|
||||
if (!movementAIComponent) return;
|
||||
|
||||
movementAIComponent->SetHaltDistance(petHaltDistance);
|
||||
|
||||
std::u16string msg = u"Set pet halt distance to " + (GeneralUtils::to_u16string(petHaltDistance));
|
||||
ChatPackets::SendSystemMessage(sysAddr, msg);
|
||||
}
|
||||
|
||||
if (chatCommand == "playeffect" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() >= 3) {
|
||||
int32_t effectID = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user