2023-08-08 01:40:06 +00:00
|
|
|
#ifndef MOVEMENTAICOMPONENT_H
|
|
|
|
#include "MovementAIComponent.h"
|
|
|
|
#endif
|
2023-08-10 02:37:36 +00:00
|
|
|
#include "eWaypointCommandType.h"
|
2023-08-08 01:40:06 +00:00
|
|
|
|
|
|
|
void MovementAIComponent::HandleWaypointArrived() {
|
2023-08-10 08:55:35 +00:00
|
|
|
if (!m_Path) return;
|
2023-08-10 02:37:36 +00:00
|
|
|
if (m_Path->pathWaypoints[m_CurrentPathWaypointIndex].commands.empty()) return;
|
|
|
|
for(auto [command, data] : m_Path->pathWaypoints[m_CurrentPathWaypointIndex].commands){
|
|
|
|
switch(command){
|
|
|
|
case eWaypointCommandType::STOP:
|
2023-08-10 04:29:04 +00:00
|
|
|
// call stop
|
2023-08-10 02:37:36 +00:00
|
|
|
break;
|
|
|
|
case eWaypointCommandType::GROUP_EMOTE:
|
2023-08-10 04:29:04 +00:00
|
|
|
// get group
|
|
|
|
// make them all emote
|
2023-08-10 02:37:36 +00:00
|
|
|
break;
|
|
|
|
case eWaypointCommandType::SET_VARIABLE:
|
2023-08-10 04:29:04 +00:00
|
|
|
// set network variable???
|
2023-08-10 02:37:36 +00:00
|
|
|
break;
|
|
|
|
case eWaypointCommandType::CAST_SKILL:
|
2023-08-10 04:29:04 +00:00
|
|
|
// just call cast skill lol
|
2023-08-10 02:37:36 +00:00
|
|
|
break;
|
|
|
|
case eWaypointCommandType::EQUIP_INVENTORY:
|
2023-08-10 04:29:04 +00:00
|
|
|
// equip item via ID (not lot???)
|
2023-08-10 02:37:36 +00:00
|
|
|
break;
|
|
|
|
case eWaypointCommandType::UNEQUIP_INVENTORY:
|
2023-08-10 04:29:04 +00:00
|
|
|
// unequip item via ID (not lot??)
|
2023-08-10 02:37:36 +00:00
|
|
|
break;
|
|
|
|
case eWaypointCommandType::DELAY:
|
2023-08-10 04:29:04 +00:00
|
|
|
// number
|
2023-08-10 02:37:36 +00:00
|
|
|
break;
|
|
|
|
case eWaypointCommandType::EMOTE:
|
2023-08-10 04:29:04 +00:00
|
|
|
// emote name
|
2023-08-10 02:37:36 +00:00
|
|
|
break;
|
|
|
|
case eWaypointCommandType::TELEPORT:
|
2023-08-10 04:29:04 +00:00
|
|
|
// x,y,z
|
2023-08-10 02:37:36 +00:00
|
|
|
break;
|
|
|
|
case eWaypointCommandType::PATH_SPEED:
|
2023-08-10 04:29:04 +00:00
|
|
|
// set speed?
|
2023-08-10 02:37:36 +00:00
|
|
|
break;
|
|
|
|
case eWaypointCommandType::REMOVE_NPC:
|
2023-08-10 04:29:04 +00:00
|
|
|
// get objects in proximity
|
|
|
|
// KillOBJS ???
|
2023-08-10 02:37:36 +00:00
|
|
|
break;
|
|
|
|
case eWaypointCommandType::CHANGE_WAYPOINT:
|
2023-08-10 04:29:04 +00:00
|
|
|
// std::string path_string = "";
|
|
|
|
// sometimes there's a path and what waypoint to start, which are comma separated
|
|
|
|
// if (intermed.find(",") != std::string::npos){
|
|
|
|
// auto datas = GeneralUtils::SplitString(intermed, ',');
|
|
|
|
// path_string = datas[0];
|
|
|
|
// m_PathIndex = stoi(datas[1]) - 1;
|
|
|
|
// } else {
|
|
|
|
// path_string = intermed;
|
|
|
|
// m_PathIndex = 0;
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (path_string != "") {
|
|
|
|
// SetMovementPath(const_cast<Path*>(dZoneManager::Instance()->GetZone()->GetPath(path_string)));
|
|
|
|
// } else m_MovementPath = nullptr;
|
2023-08-10 02:37:36 +00:00
|
|
|
break;
|
|
|
|
case eWaypointCommandType::KILL_SELF:
|
2023-08-10 04:29:04 +00:00
|
|
|
// Kill Silent
|
2023-08-10 02:37:36 +00:00
|
|
|
break;
|
2023-08-10 04:29:04 +00:00
|
|
|
case eWaypointCommandType::DELETE_SELF:
|
2023-08-10 02:37:36 +00:00
|
|
|
case eWaypointCommandType::REMOVE_SELF:
|
2023-08-10 04:29:04 +00:00
|
|
|
// Delete Object
|
2023-08-10 02:37:36 +00:00
|
|
|
break;
|
|
|
|
case eWaypointCommandType::SPAWN_OBJECT:
|
2023-08-10 04:29:04 +00:00
|
|
|
// just make a new object
|
2023-08-10 02:37:36 +00:00
|
|
|
break;
|
|
|
|
case eWaypointCommandType::PLAY_SOUND:
|
2023-08-10 04:29:04 +00:00
|
|
|
// msgPlayNDAudioEmitter
|
|
|
|
break;
|
|
|
|
case eWaypointCommandType::BOUNCE:
|
|
|
|
Game::logger->Log("MovementAIComponentAronwk", "Unusable Command %i", command);
|
2023-08-10 02:37:36 +00:00
|
|
|
break;
|
|
|
|
case eWaypointCommandType::INVALID:
|
2023-08-10 08:55:35 +00:00
|
|
|
default:
|
2023-08-10 02:37:36 +00:00
|
|
|
Game::logger->LogDebug("MovementAIComponentAronwk", "Got invalid waypoint command %i", command);
|
2023-08-10 04:29:04 +00:00
|
|
|
break;
|
2023-08-10 02:37:36 +00:00
|
|
|
}
|
|
|
|
}
|
2023-08-08 01:40:06 +00:00
|
|
|
}
|