mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
cleanup enums to make them more consistent
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "GameMessages.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "SkillComponent.h"
|
||||
#include "eMissionTaskType.h"
|
||||
|
||||
//TODO: this has to be updated so that you only get killed if you're in a certain radius.
|
||||
//And so that all entities in a certain radius are killed, not just the attacker.
|
||||
@@ -51,14 +52,14 @@ void ExplodingAsset::OnHit(Entity* self, Entity* attacker) {
|
||||
if (missionComponent != nullptr) {
|
||||
if (missionID != 0) {
|
||||
missionComponent->ForceProgressValue(missionID,
|
||||
static_cast<uint32_t>(MissionTaskType::MISSION_TASK_TYPE_SCRIPT),
|
||||
static_cast<uint32_t>(eMissionTaskType::SCRIPT),
|
||||
self->GetLOT(), false);
|
||||
}
|
||||
|
||||
if (!achievementIDs.empty()) {
|
||||
for (const auto& achievementID : GeneralUtils::SplitString(achievementIDs, u'_')) {
|
||||
missionComponent->ForceProgressValue(std::stoi(GeneralUtils::UTF16ToWTF8(achievementID)),
|
||||
static_cast<uint32_t>(MissionTaskType::MISSION_TASK_TYPE_SCRIPT),
|
||||
static_cast<uint32_t>(eMissionTaskType::SCRIPT),
|
||||
self->GetLOT());
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,7 @@
|
||||
#include "GrowingFlower.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "eMissionTaskType.h"
|
||||
#include "eMissionState.h"
|
||||
#include "Loot.h"
|
||||
|
||||
void GrowingFlower::OnSkillEventFired(Entity* self, Entity* target, const std::string& message) {
|
||||
@@ -16,13 +18,13 @@ void GrowingFlower::OnSkillEventFired(Entity* self, Entity* target, const std::s
|
||||
auto* missionComponent = target->GetComponent<MissionComponent>();
|
||||
if (missionComponent != nullptr) {
|
||||
for (const auto mission : achievementIDs)
|
||||
missionComponent->ForceProgressTaskType(mission, static_cast<uint32_t>(MissionTaskType::MISSION_TASK_TYPE_SCRIPT), 1);
|
||||
missionComponent->ForceProgressTaskType(mission, static_cast<uint32_t>(eMissionTaskType::SCRIPT), 1);
|
||||
|
||||
if (mission1 && missionComponent->GetMissionState(mission1) == MissionState::MISSION_STATE_ACTIVE)
|
||||
missionComponent->ForceProgressTaskType(mission1, static_cast<uint32_t>(MissionTaskType::MISSION_TASK_TYPE_SCRIPT), 1);
|
||||
if (mission1 && missionComponent->GetMissionState(mission1) == eMissionState::ACTIVE)
|
||||
missionComponent->ForceProgressTaskType(mission1, static_cast<uint32_t>(eMissionTaskType::SCRIPT), 1);
|
||||
|
||||
if (mission2 && missionComponent->GetMissionState(mission2) == MissionState::MISSION_STATE_ACTIVE)
|
||||
missionComponent->ForceProgressTaskType(mission2, static_cast<uint32_t>(MissionTaskType::MISSION_TASK_TYPE_SCRIPT), 1);
|
||||
if (mission2 && missionComponent->GetMissionState(mission2) == eMissionState::ACTIVE)
|
||||
missionComponent->ForceProgressTaskType(mission2, static_cast<uint32_t>(eMissionTaskType::SCRIPT), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,8 @@
|
||||
#include "ImaginationBackpackHealServer.h"
|
||||
#include "GameMessages.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "eMissionTaskType.h"
|
||||
#include "eMissionState.h"
|
||||
|
||||
void ImaginationBackpackHealServer::OnSkillEventFired(Entity* self, Entity* caster, const std::string& message) {
|
||||
if (message == "CastImaginationBackpack") {
|
||||
@@ -11,8 +13,8 @@ void ImaginationBackpackHealServer::OnSkillEventFired(Entity* self, Entity* cast
|
||||
return;
|
||||
|
||||
auto* missionComponent = caster->GetComponent<MissionComponent>();
|
||||
if (missionComponent != nullptr && missionComponent->GetMissionState(healMission) == MissionState::MISSION_STATE_ACTIVE) {
|
||||
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_SCRIPT, self->GetLOT());
|
||||
if (missionComponent != nullptr && missionComponent->GetMissionState(healMission) == eMissionState::ACTIVE) {
|
||||
missionComponent->Progress(eMissionTaskType::SCRIPT, self->GetLOT());
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"ClearMaelstrom", 0, 0,
|
||||
caster->GetObjectID(), "", caster->GetSystemAddress());
|
||||
}
|
||||
|
@@ -5,6 +5,7 @@
|
||||
#include "Character.h"
|
||||
#include "PetComponent.h"
|
||||
#include "User.h"
|
||||
#include "eMissionState.h"
|
||||
|
||||
std::vector<LWOOBJID> PetDigServer::treasures{};
|
||||
|
||||
@@ -163,13 +164,13 @@ void PetDigServer::ProgressPetDigMissions(const Entity* owner, const Entity* che
|
||||
if (missionComponent != nullptr) {
|
||||
// Can You Dig It progress
|
||||
const auto digMissionState = missionComponent->GetMissionState(843);
|
||||
if (digMissionState == MissionState::MISSION_STATE_ACTIVE) {
|
||||
if (digMissionState == eMissionState::ACTIVE) {
|
||||
missionComponent->ForceProgress(843, 1216, 1);
|
||||
}
|
||||
|
||||
// Pet Excavator progress
|
||||
const auto excavatorMissionState = missionComponent->GetMissionState(505);
|
||||
if (excavatorMissionState == MissionState::MISSION_STATE_ACTIVE) {
|
||||
if (excavatorMissionState == eMissionState::ACTIVE) {
|
||||
if (chest->HasVar(u"PetDig")) {
|
||||
int32_t playerFlag = 1260 + chest->GetVarAs<int32_t>(u"PetDig");
|
||||
Character* player = owner->GetCharacter();
|
||||
@@ -193,7 +194,7 @@ void PetDigServer::SpawnPet(Entity* self, const Entity* owner, const DigInfo dig
|
||||
// Some treasures require a mission to be active
|
||||
if (digInfo.requiredMission >= 0) {
|
||||
auto* missionComponent = owner->GetComponent<MissionComponent>();
|
||||
if (missionComponent != nullptr && missionComponent->GetMissionState(digInfo.requiredMission) < MissionState::MISSION_STATE_ACTIVE) {
|
||||
if (missionComponent != nullptr && missionComponent->GetMissionState(digInfo.requiredMission) < eMissionState::ACTIVE) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@
|
||||
#include "GameMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "eMissionState.h"
|
||||
|
||||
void PropertyDevice::OnStartup(Entity* self) {
|
||||
auto* zoneControl = EntityManager::Instance()->GetZoneControlEntity();
|
||||
@@ -17,7 +18,7 @@ void PropertyDevice::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
|
||||
auto* missionComponent = target->GetComponent<MissionComponent>();
|
||||
if (missionComponent != nullptr) {
|
||||
if (missionComponent->GetMissionState(m_PropertyMissionID) == MissionState::MISSION_STATE_ACTIVE) {
|
||||
if (missionComponent->GetMissionState(m_PropertyMissionID) == eMissionState::ACTIVE) {
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 641, u"create", "callhome");
|
||||
missionComponent->ForceProgress(m_PropertyMissionID, 1793, self->GetLOT());
|
||||
}
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#include "Entity.h"
|
||||
#include "GameMessages.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "eMissionState.h"
|
||||
|
||||
void TouchMissionUpdateServer::OnStartup(Entity* self) {
|
||||
self->SetProximityRadius(20, "touchCheck"); // Those does not have a collider for some reason?
|
||||
@@ -29,7 +30,7 @@ void TouchMissionUpdateServer::OnCollisionPhantom(Entity* self, Entity* target)
|
||||
|
||||
const auto state = mission->GetMissionState();
|
||||
|
||||
if (state >= MissionState::MISSION_STATE_COMPLETE || mission->GetCompletions() > 1) {
|
||||
if (state >= eMissionState::COMPLETE || mission->GetCompletions() > 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user