mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-05 18:24:12 +00:00
cleanup enums to make them more consistent
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#include "eMissionTaskType.h"
|
||||
|
||||
#ifndef __ACHIEVEMENTCACHEKEY__H__
|
||||
#define __ACHIEVEMENTCACHEKEY__H__
|
||||
|
||||
@@ -6,7 +8,7 @@ public:
|
||||
AchievementCacheKey() {
|
||||
targets = "";
|
||||
value = 0;
|
||||
type = MissionTaskType::MISSION_TASK_TYPE_UNKNOWN;
|
||||
type = eMissionTaskType::UNKNOWN;
|
||||
};
|
||||
|
||||
bool operator==(const AchievementCacheKey& point) const {
|
||||
@@ -14,15 +16,15 @@ public:
|
||||
};
|
||||
void SetTargets(const std::string value) { this->targets = value; };
|
||||
void SetValue(uint32_t value) { this->value = value; };
|
||||
void SetType(MissionTaskType value) { this->type = value; };
|
||||
void SetType(eMissionTaskType value) { this->type = value; };
|
||||
|
||||
std::string GetTargets() const { return this->targets; };
|
||||
uint32_t GetValue() const { return this->value; };
|
||||
MissionTaskType GetType() const { return this->type; };
|
||||
eMissionTaskType GetType() const { return this->type; };
|
||||
private:
|
||||
std::string targets;
|
||||
uint32_t value;
|
||||
MissionTaskType type;
|
||||
eMissionTaskType type;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#include "InventoryComponent.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "WorldConfig.h"
|
||||
#include "eMissionTaskType.h"
|
||||
|
||||
DestroyableComponent::DestroyableComponent(Entity* parent) : Component(parent) {
|
||||
m_iArmor = 0;
|
||||
@@ -467,9 +468,9 @@ bool DestroyableComponent::IsKnockbackImmune() const {
|
||||
|
||||
if (characterComponent != nullptr && inventoryComponent != nullptr && characterComponent->GetCurrentActivity() == eGameActivities::ACTIVITY_QUICKBUILDING) {
|
||||
const auto hasPassive = inventoryComponent->HasAnyPassive({
|
||||
ItemSetPassiveAbilityID::EngineerRank2, ItemSetPassiveAbilityID::EngineerRank3,
|
||||
ItemSetPassiveAbilityID::SummonerRank2, ItemSetPassiveAbilityID::SummonerRank3,
|
||||
ItemSetPassiveAbilityID::InventorRank2, ItemSetPassiveAbilityID::InventorRank3,
|
||||
eItemSetPassiveAbilityID::EngineerRank2, eItemSetPassiveAbilityID::EngineerRank3,
|
||||
eItemSetPassiveAbilityID::SummonerRank2, eItemSetPassiveAbilityID::SummonerRank3,
|
||||
eItemSetPassiveAbilityID::InventorRank2, eItemSetPassiveAbilityID::InventorRank3,
|
||||
}, 5);
|
||||
|
||||
if (hasPassive) {
|
||||
@@ -736,12 +737,12 @@ void DestroyableComponent::Smash(const LWOOBJID source, const eKillType killType
|
||||
|
||||
if (memberMissions == nullptr) continue;
|
||||
|
||||
memberMissions->Progress(MissionTaskType::MISSION_TASK_TYPE_SMASH, m_Parent->GetLOT());
|
||||
memberMissions->Progress(MissionTaskType::MISSION_TASK_TYPE_SKILL, m_Parent->GetLOT(), skillID);
|
||||
memberMissions->Progress(eMissionTaskType::SMASH, m_Parent->GetLOT());
|
||||
memberMissions->Progress(eMissionTaskType::USE_SKILL, m_Parent->GetLOT(), skillID);
|
||||
}
|
||||
} else {
|
||||
missions->Progress(MissionTaskType::MISSION_TASK_TYPE_SMASH, m_Parent->GetLOT());
|
||||
missions->Progress(MissionTaskType::MISSION_TASK_TYPE_SKILL, m_Parent->GetLOT(), skillID);
|
||||
missions->Progress(eMissionTaskType::SMASH, m_Parent->GetLOT());
|
||||
missions->Progress(eMissionTaskType::USE_SKILL, m_Parent->GetLOT(), skillID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include "eItemType.h"
|
||||
#include "eUnequippableActiveType.h"
|
||||
#include "CppScripts.h"
|
||||
#include "eMissionTaskType.h"
|
||||
|
||||
InventoryComponent::InventoryComponent(Entity* parent, tinyxml2::XMLDocument* document): Component(parent) {
|
||||
this->m_Dirty = true;
|
||||
@@ -196,7 +197,7 @@ void InventoryComponent::AddItem(
|
||||
auto* item = new Item(lot, inventory, slot, count, config, parent, showFlyingLoot, isModMoveAndEquip, subKey, bound, lootSourceType);
|
||||
|
||||
if (missions != nullptr && !IsTransferInventory(inventoryType)) {
|
||||
missions->Progress(MissionTaskType::MISSION_TASK_TYPE_ITEM_COLLECTION, lot, LWOOBJID_EMPTY, "", count, IsTransferInventory(inventorySourceType));
|
||||
missions->Progress(eMissionTaskType::GATHER, lot, LWOOBJID_EMPTY, "", count, IsTransferInventory(inventorySourceType));
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -284,7 +285,7 @@ void InventoryComponent::AddItem(
|
||||
}
|
||||
|
||||
if (missions != nullptr && !IsTransferInventory(inventoryType)) {
|
||||
missions->Progress(MissionTaskType::MISSION_TASK_TYPE_ITEM_COLLECTION, lot, LWOOBJID_EMPTY, "", count - outOfSpace, IsTransferInventory(inventorySourceType));
|
||||
missions->Progress(eMissionTaskType::GATHER, lot, LWOOBJID_EMPTY, "", count - outOfSpace, IsTransferInventory(inventorySourceType));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,7 +374,7 @@ void InventoryComponent::MoveItemToInventory(Item* item, const eInventoryType in
|
||||
|
||||
if (missionComponent != nullptr) {
|
||||
if (IsTransferInventory(inventory)) {
|
||||
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_ITEM_COLLECTION, lot, LWOOBJID_EMPTY, "", -static_cast<int32_t>(count));
|
||||
missionComponent->Progress(eMissionTaskType::GATHER, lot, LWOOBJID_EMPTY, "", -static_cast<int32_t>(count));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -841,9 +842,9 @@ void InventoryComponent::EquipItem(Item* item, const bool skipChecks) {
|
||||
const auto type = static_cast<eItemType>(item->GetInfo().itemType);
|
||||
|
||||
|
||||
if (!building && (item->GetLot() == 6086 || type == eItemType::ITEM_TYPE_LOOT_MODEL || type == eItemType::ITEM_TYPE_VEHICLE)) return;
|
||||
if (!building && (item->GetLot() == 6086 || type == eItemType::LOOT_MODEL || type == eItemType::VEHICLE)) return;
|
||||
|
||||
if (type != eItemType::ITEM_TYPE_LOOT_MODEL && type != eItemType::ITEM_TYPE_MODEL) {
|
||||
if (type != eItemType::LOOT_MODEL && type != eItemType::MODEL) {
|
||||
if (!item->GetBound() && !item->GetPreconditionExpression()->Check(m_Parent)) {
|
||||
return;
|
||||
}
|
||||
@@ -1202,14 +1203,14 @@ void InventoryComponent::TriggerPassiveAbility(PassiveAbilityTrigger trigger, En
|
||||
}
|
||||
}
|
||||
|
||||
bool InventoryComponent::HasAnyPassive(const std::vector<ItemSetPassiveAbilityID>& passiveIDs, int32_t equipmentRequirement) const {
|
||||
bool InventoryComponent::HasAnyPassive(const std::vector<eItemSetPassiveAbilityID>& passiveIDs, int32_t equipmentRequirement) const {
|
||||
for (auto* set : m_Itemsets) {
|
||||
if (set->GetEquippedCount() < equipmentRequirement) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check if the set has any of the passive abilities
|
||||
if (std::find(passiveIDs.begin(), passiveIDs.end(), static_cast<ItemSetPassiveAbilityID>(set->GetID())) != passiveIDs.end()) {
|
||||
if (std::find(passiveIDs.begin(), passiveIDs.end(), static_cast<eItemSetPassiveAbilityID>(set->GetID())) != passiveIDs.end()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1285,15 +1286,15 @@ void InventoryComponent::RemoveDatabasePet(LWOOBJID id) {
|
||||
|
||||
BehaviorSlot InventoryComponent::FindBehaviorSlot(const eItemType type) {
|
||||
switch (type) {
|
||||
case eItemType::ITEM_TYPE_HAT:
|
||||
case eItemType::HAT:
|
||||
return BehaviorSlot::Head;
|
||||
case eItemType::ITEM_TYPE_NECK:
|
||||
case eItemType::NECK:
|
||||
return BehaviorSlot::Neck;
|
||||
case eItemType::ITEM_TYPE_LEFT_HAND:
|
||||
case eItemType::LEFT_HAND:
|
||||
return BehaviorSlot::Offhand;
|
||||
case eItemType::ITEM_TYPE_RIGHT_HAND:
|
||||
case eItemType::RIGHT_HAND:
|
||||
return BehaviorSlot::Primary;
|
||||
case eItemType::ITEM_TYPE_CONSUMABLE:
|
||||
case eItemType::CONSUMABLE:
|
||||
return BehaviorSlot::Consumable;
|
||||
default:
|
||||
return BehaviorSlot::Invalid;
|
||||
@@ -1343,7 +1344,7 @@ std::vector<uint32_t> InventoryComponent::FindBuffs(Item* item, bool castOnEquip
|
||||
}
|
||||
|
||||
if (missions != nullptr && castOnEquip) {
|
||||
missions->Progress(MissionTaskType::MISSION_TASK_TYPE_SKILL, result.skillID);
|
||||
missions->Progress(eMissionTaskType::USE_SKILL, result.skillID);
|
||||
}
|
||||
|
||||
// If item is not a proxy, add its buff to the added buffs.
|
||||
|
@@ -17,7 +17,7 @@
|
||||
#include "DatabasePet.h"
|
||||
#include "Component.h"
|
||||
#include "ItemSetPassiveAbility.h"
|
||||
#include "ItemSetPassiveAbilityID.h"
|
||||
#include "eItemSetPassiveAbilityID.h"
|
||||
#include "PossessorComponent.h"
|
||||
#include "eInventoryType.h"
|
||||
|
||||
@@ -291,7 +291,7 @@ public:
|
||||
* @param equipmentRequirement the number of equipment required to be allowed to have the ability
|
||||
* @return if the entity has any of the passed passive abilities equipped
|
||||
*/
|
||||
bool HasAnyPassive(const std::vector<ItemSetPassiveAbilityID>& passiveIDs, int32_t equipmentRequirement) const;
|
||||
bool HasAnyPassive(const std::vector<eItemSetPassiveAbilityID>& passiveIDs, int32_t equipmentRequirement) const;
|
||||
|
||||
/**
|
||||
* Despawns the currently active pet, if any
|
||||
@@ -354,14 +354,14 @@ public:
|
||||
|
||||
/**
|
||||
* Call this when you equip an item. This calls OnFactionTriggerItemEquipped for any scripts found on the items.
|
||||
*
|
||||
*
|
||||
* @param equippedItem The item script to lookup and call equip on
|
||||
*/
|
||||
void EquipScripts(Item* equippedItem);
|
||||
|
||||
|
||||
/**
|
||||
* Call this when you unequip an item. This calls OnFactionTriggerItemUnequipped for any scripts found on the items.
|
||||
*
|
||||
*
|
||||
* @param unequippedItem The item script to lookup and call unequip on
|
||||
*/
|
||||
void UnequipScripts(Item* unequippedItem);
|
||||
|
@@ -18,6 +18,7 @@
|
||||
#include "Mail.h"
|
||||
#include "MissionPrerequisites.h"
|
||||
#include "AchievementCacheKey.h"
|
||||
#include "eMissionState.h"
|
||||
|
||||
// MARK: Mission Component
|
||||
|
||||
@@ -53,11 +54,11 @@ Mission* MissionComponent::GetMission(const uint32_t missionId) const {
|
||||
}
|
||||
|
||||
|
||||
MissionState MissionComponent::GetMissionState(const uint32_t missionId) const {
|
||||
eMissionState MissionComponent::GetMissionState(const uint32_t missionId) const {
|
||||
auto* mission = GetMission(missionId);
|
||||
|
||||
if (mission == nullptr) {
|
||||
return CanAccept(missionId) ? MissionState::MISSION_STATE_AVAILABLE : MissionState::MISSION_STATE_UNKNOWN;
|
||||
return CanAccept(missionId) ? eMissionState::AVAILABLE : eMissionState::UNKNOWN;
|
||||
}
|
||||
|
||||
return mission->GetMissionState();
|
||||
@@ -143,7 +144,7 @@ void MissionComponent::RemoveMission(uint32_t missionId) {
|
||||
m_Missions.erase(missionId);
|
||||
}
|
||||
|
||||
void MissionComponent::Progress(MissionTaskType type, int32_t value, LWOOBJID associate, const std::string& targets, int32_t count, bool ignoreAchievements) {
|
||||
void MissionComponent::Progress(eMissionTaskType type, int32_t value, LWOOBJID associate, const std::string& targets, int32_t count, bool ignoreAchievements) {
|
||||
for (const auto& pair : m_Missions) {
|
||||
auto* mission = pair.second;
|
||||
|
||||
@@ -215,7 +216,7 @@ void MissionComponent::ForceProgressTaskType(const uint32_t missionId, const uin
|
||||
}
|
||||
|
||||
for (auto* element : mission->GetTasks()) {
|
||||
if (element->GetType() != static_cast<MissionTaskType>(taskType)) continue;
|
||||
if (element->GetType() != static_cast<eMissionTaskType>(taskType)) continue;
|
||||
|
||||
element->AddProgress(value);
|
||||
}
|
||||
@@ -253,7 +254,7 @@ void MissionComponent::ForceProgressValue(uint32_t missionId, uint32_t taskType,
|
||||
}
|
||||
|
||||
for (auto* element : mission->GetTasks()) {
|
||||
if (element->GetType() != static_cast<MissionTaskType>(taskType) || !element->InAllTargets(value)) continue;
|
||||
if (element->GetType() != static_cast<eMissionTaskType>(taskType) || !element->InAllTargets(value)) continue;
|
||||
|
||||
element->AddProgress(1);
|
||||
}
|
||||
@@ -281,7 +282,7 @@ bool MissionComponent::GetMissionInfo(uint32_t missionId, CDMissions& result) {
|
||||
|
||||
#define MISSION_NEW_METHOD
|
||||
|
||||
bool MissionComponent::LookForAchievements(MissionTaskType type, int32_t value, bool progress, LWOOBJID associate, const std::string& targets, int32_t count) {
|
||||
bool MissionComponent::LookForAchievements(eMissionTaskType type, int32_t value, bool progress, LWOOBJID associate, const std::string& targets, int32_t count) {
|
||||
#ifdef MISSION_NEW_METHOD
|
||||
// Query for achievments, using the cache
|
||||
const auto& result = QueryAchievements(type, value, targets);
|
||||
@@ -390,7 +391,7 @@ bool MissionComponent::LookForAchievements(MissionTaskType type, int32_t value,
|
||||
#endif
|
||||
}
|
||||
|
||||
const std::vector<uint32_t>& MissionComponent::QueryAchievements(MissionTaskType type, int32_t value, const std::string targets) {
|
||||
const std::vector<uint32_t>& MissionComponent::QueryAchievements(eMissionTaskType type, int32_t value, const std::string targets) {
|
||||
// Create a hash which represent this query for achievements
|
||||
AchievementCacheKey toFind;
|
||||
toFind.SetType(type);
|
||||
@@ -484,7 +485,7 @@ bool MissionComponent::RequiresItem(const LOT lot) {
|
||||
}
|
||||
|
||||
for (auto* task : mission->GetTasks()) {
|
||||
if (task->IsComplete() || task->GetType() != MissionTaskType::MISSION_TASK_TYPE_ITEM_COLLECTION) {
|
||||
if (task->IsComplete() || task->GetType() != eMissionTaskType::GATHER) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -496,7 +497,7 @@ bool MissionComponent::RequiresItem(const LOT lot) {
|
||||
}
|
||||
}
|
||||
|
||||
const auto required = LookForAchievements(MissionTaskType::MISSION_TASK_TYPE_ITEM_COLLECTION, lot, false);
|
||||
const auto required = LookForAchievements(eMissionTaskType::GATHER, lot, false);
|
||||
|
||||
return required;
|
||||
}
|
||||
|
@@ -19,11 +19,11 @@
|
||||
|
||||
class AchievementCacheKey;
|
||||
|
||||
/**
|
||||
* The mission inventory of an entity. Tracks mission state for each mission that can be accepted and allows for
|
||||
* progression of each of the mission task types (see MissionTaskType).
|
||||
*/
|
||||
class MissionComponent: public Component
|
||||
/**
|
||||
* The mission inventory of an entity. Tracks mission state for each mission that can be accepted and allows for
|
||||
* progression of each of the mission task types (see eMissionTaskType).
|
||||
*/
|
||||
class MissionComponent : public Component
|
||||
{
|
||||
public:
|
||||
static const uint32_t ComponentType = COMPONENT_TYPE_MISSION;
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
* @param missionId the ID of the mission to get the mission state for
|
||||
* @return the mission state of the mission specified by the ID
|
||||
*/
|
||||
MissionState GetMissionState(uint32_t missionId) const;
|
||||
eMissionState GetMissionState(uint32_t missionId) const;
|
||||
|
||||
/**
|
||||
* Checks if the entity has all the requirements for accepting the mission specified by the ID.
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
* @param count the number to progress by, for example the number of items
|
||||
* @param ignoreAchievements do not progress achievements
|
||||
*/
|
||||
void Progress(MissionTaskType type, int32_t value, LWOOBJID associate = 0, const std::string& targets = "", int32_t count = 1, bool ignoreAchievements = false);
|
||||
void Progress(eMissionTaskType type, int32_t value, LWOOBJID associate = 0, const std::string& targets = "", int32_t count = 1, bool ignoreAchievements = false);
|
||||
|
||||
/**
|
||||
* Forces progression for a mission and task, ignoring checks
|
||||
@@ -140,7 +140,7 @@ public:
|
||||
* @param count the number of values to progress by (differs by task type)
|
||||
* @return true if a achievement was accepted, false otherwise
|
||||
*/
|
||||
bool LookForAchievements(MissionTaskType type, int32_t value, bool progress = true, LWOOBJID associate = LWOOBJID_EMPTY, const std::string& targets = "", int32_t count = 1);
|
||||
bool LookForAchievements(eMissionTaskType type, int32_t value, bool progress = true, LWOOBJID associate = LWOOBJID_EMPTY, const std::string& targets = "", int32_t count = 1);
|
||||
|
||||
/**
|
||||
* Checks if there's a mission active that requires the collection of the specified LOT
|
||||
@@ -188,7 +188,7 @@ private:
|
||||
* @param targets optional targets to progress with
|
||||
* @return list of mission IDs (achievements) that can be progressed for the given parameters
|
||||
*/
|
||||
static const std::vector<uint32_t>& QueryAchievements(MissionTaskType type, int32_t value, const std::string targets);
|
||||
static const std::vector<uint32_t>& QueryAchievements(eMissionTaskType type, int32_t value, const std::string targets);
|
||||
|
||||
/**
|
||||
* As achievements can be hard to query, we here store a list of all the mission IDs that can be unlocked for a
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include "dLogger.h"
|
||||
#include "Game.h"
|
||||
#include "MissionPrerequisites.h"
|
||||
#include "eMissionState.h"
|
||||
|
||||
OfferedMission::OfferedMission(const uint32_t missionId, const bool offersMission, const bool acceptsMission) {
|
||||
this->missionId = missionId;
|
||||
@@ -170,10 +171,10 @@ void MissionOfferComponent::OfferMissions(Entity* entity, const uint32_t specifi
|
||||
for (const auto sample : randomMissionPool) {
|
||||
const auto state = missionComponent->GetMissionState(sample);
|
||||
|
||||
if (state == MissionState::MISSION_STATE_ACTIVE ||
|
||||
state == MissionState::MISSION_STATE_COMPLETE_ACTIVE ||
|
||||
state == MissionState::MISSION_STATE_READY_TO_COMPLETE ||
|
||||
state == MissionState::MISSION_STATE_COMPLETE_READY_TO_COMPLETE ||
|
||||
if (state == eMissionState::ACTIVE ||
|
||||
state == eMissionState::COMPLETE_ACTIVE ||
|
||||
state == eMissionState::READY_TO_COMPLETE ||
|
||||
state == eMissionState::COMPLETE_READY_TO_COMPLETE ||
|
||||
sample == specifiedMissionId) {
|
||||
mission = missionComponent->GetMission(sample);
|
||||
|
||||
|
@@ -21,6 +21,8 @@
|
||||
#include "dChatFilter.h"
|
||||
#include "Database.h"
|
||||
#include "EntityInfo.h"
|
||||
#include "eMissionTaskType.h"
|
||||
|
||||
|
||||
std::unordered_map<LOT, PetComponent::PetPuzzleData> PetComponent::buildCache{};
|
||||
std::unordered_map<LWOOBJID, LWOOBJID> PetComponent::currentActivities{};
|
||||
@@ -602,7 +604,7 @@ void PetComponent::NotifyTamingBuildSuccess(NiPoint3 position) {
|
||||
auto* missionComponent = tamer->GetComponent<MissionComponent>();
|
||||
|
||||
if (missionComponent != nullptr) {
|
||||
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_PET_TAMING, m_Parent->GetLOT());
|
||||
missionComponent->Progress(eMissionTaskType::PET_TAMING, m_Parent->GetLOT());
|
||||
}
|
||||
|
||||
SetStatus(1);
|
||||
|
@@ -18,6 +18,7 @@
|
||||
#include "RocketLaunchpadControlComponent.h"
|
||||
#include "PropertyEntranceComponent.h"
|
||||
#include "InventoryComponent.h"
|
||||
#include "eMissionTaskType.h"
|
||||
|
||||
#include <vector>
|
||||
#include "CppScripts.h"
|
||||
@@ -404,7 +405,7 @@ void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const N
|
||||
});
|
||||
// Progress place model missions
|
||||
auto missionComponent = entity->GetComponent<MissionComponent>();
|
||||
if (missionComponent != nullptr) missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_PLACE_MODEL, 0);
|
||||
if (missionComponent != nullptr) missionComponent->Progress(eMissionTaskType::PLACE_MODEL, 0);
|
||||
}
|
||||
|
||||
void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int deleteReason) {
|
||||
|
@@ -15,13 +15,14 @@
|
||||
#include "Player.h"
|
||||
#include "PossessableComponent.h"
|
||||
#include "PossessorComponent.h"
|
||||
#include "RacingTaskParam.h"
|
||||
#include "eRacingTaskParam.h"
|
||||
#include "Spawner.h"
|
||||
#include "VehiclePhysicsComponent.h"
|
||||
#include "dServer.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "dConfig.h"
|
||||
#include "Loot.h"
|
||||
#include "eMissionTaskType.h"
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846264338327950288
|
||||
@@ -395,18 +396,18 @@ void RacingControlComponent::HandleMessageBoxResponse(Entity* player,
|
||||
|
||||
if (missionComponent == nullptr) return;
|
||||
|
||||
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_RACING, 0, (LWOOBJID)RacingTaskParam::RACING_TASK_PARAM_COMPETED_IN_RACE); // Progress task for competing in a race
|
||||
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_RACING, data->smashedTimes, (LWOOBJID)RacingTaskParam::RACING_TASK_PARAM_SAFE_DRIVER); // Finish a race without being smashed.
|
||||
missionComponent->Progress(eMissionTaskType::RACING, 0, (LWOOBJID)eRacingTaskParam::COMPETED_IN_RACE); // Progress task for competing in a race
|
||||
missionComponent->Progress(eMissionTaskType::RACING, data->smashedTimes, (LWOOBJID)eRacingTaskParam::SAFE_DRIVER); // Finish a race without being smashed.
|
||||
|
||||
// If solo racing is enabled OR if there are 3 players in the race, progress placement tasks.
|
||||
if (m_SoloRacing || m_LoadedPlayers > 2) {
|
||||
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_RACING, data->finished, (LWOOBJID)RacingTaskParam::RACING_TASK_PARAM_FINISH_WITH_PLACEMENT); // Finish in 1st place on a race
|
||||
missionComponent->Progress(eMissionTaskType::RACING, data->finished, (LWOOBJID)eRacingTaskParam::FINISH_WITH_PLACEMENT); // Finish in 1st place on a race
|
||||
if (data->finished == 1) {
|
||||
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_RACING, dZoneManager::Instance()->GetZone()->GetWorldID(), (LWOOBJID)RacingTaskParam::RACING_TASK_PARAM_FIRST_PLACE_MULTIPLE_TRACKS); // Finish in 1st place on multiple tracks.
|
||||
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_RACING, dZoneManager::Instance()->GetZone()->GetWorldID(), (LWOOBJID)RacingTaskParam::RACING_TASK_PARAM_WIN_RACE_IN_WORLD); // Finished first place in specific world.
|
||||
missionComponent->Progress(eMissionTaskType::RACING, dZoneManager::Instance()->GetZone()->GetWorldID(), (LWOOBJID)eRacingTaskParam::FIRST_PLACE_MULTIPLE_TRACKS); // Finish in 1st place on multiple tracks.
|
||||
missionComponent->Progress(eMissionTaskType::RACING, dZoneManager::Instance()->GetZone()->GetWorldID(), (LWOOBJID)eRacingTaskParam::WIN_RACE_IN_WORLD); // Finished first place in specific world.
|
||||
}
|
||||
if (data->finished == m_LoadedPlayers) {
|
||||
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_RACING, dZoneManager::Instance()->GetZone()->GetWorldID(), (LWOOBJID)RacingTaskParam::RACING_TASK_PARAM_LAST_PLACE_FINISH); // Finished first place in specific world.
|
||||
missionComponent->Progress(eMissionTaskType::RACING, dZoneManager::Instance()->GetZone()->GetWorldID(), (LWOOBJID)eRacingTaskParam::LAST_PLACE_FINISH); // Finished first place in specific world.
|
||||
}
|
||||
}
|
||||
} else if (id == "ACT_RACE_EXIT_THE_RACE?" || id == "Exit") {
|
||||
@@ -828,7 +829,7 @@ void RacingControlComponent::Update(float deltaTime) {
|
||||
if (missionComponent != nullptr) {
|
||||
|
||||
// Progress lap time tasks
|
||||
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_RACING, (lapTime) * 1000, (LWOOBJID)RacingTaskParam::RACING_TASK_PARAM_LAP_TIME);
|
||||
missionComponent->Progress(eMissionTaskType::RACING, (lapTime) * 1000, (LWOOBJID)eRacingTaskParam::LAP_TIME);
|
||||
|
||||
if (player.lap == 3) {
|
||||
m_Finished++;
|
||||
@@ -844,7 +845,7 @@ void RacingControlComponent::Update(float deltaTime) {
|
||||
raceTime, raceTime * 1000);
|
||||
|
||||
// Entire race time
|
||||
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_RACING, (raceTime) * 1000, (LWOOBJID)RacingTaskParam::RACING_TASK_PARAM_TOTAL_TRACK_TIME);
|
||||
missionComponent->Progress(eMissionTaskType::RACING, (raceTime) * 1000, (LWOOBJID)eRacingTaskParam::TOTAL_TRACK_TIME);
|
||||
|
||||
auto* characterComponent = playerEntity->GetComponent<CharacterComponent>();
|
||||
if (characterComponent != nullptr) {
|
||||
|
@@ -7,7 +7,7 @@
|
||||
#include "dLogger.h"
|
||||
#include "CharacterComponent.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "MissionTaskType.h"
|
||||
#include "eMissionTaskType.h"
|
||||
|
||||
#include "dServer.h"
|
||||
#include "PacketUtils.h"
|
||||
@@ -473,12 +473,12 @@ void RebuildComponent::CompleteRebuild(Entity* user) {
|
||||
auto* member = EntityManager::Instance()->GetEntity(memberId);
|
||||
if (member) {
|
||||
auto* missionComponent = member->GetComponent<MissionComponent>();
|
||||
if (missionComponent) missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_ACTIVITY, m_ActivityId);
|
||||
if (missionComponent) missionComponent->Progress(eMissionTaskType::ACTIVITY, m_ActivityId);
|
||||
}
|
||||
}
|
||||
} else{
|
||||
auto* missionComponent = builder->GetComponent<MissionComponent>();
|
||||
if (missionComponent) missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_ACTIVITY, m_ActivityId);
|
||||
if (missionComponent) missionComponent->Progress(eMissionTaskType::ACTIVITY, m_ActivityId);
|
||||
}
|
||||
LootGenerator::Instance().DropActivityLoot(builder, m_Parent, m_ActivityId, 1);
|
||||
}
|
||||
|
@@ -20,6 +20,7 @@
|
||||
#include "DestroyableComponent.h"
|
||||
#include "dMessageIdentifiers.h"
|
||||
#include "Loot.h"
|
||||
#include "eMissionTaskType.h"
|
||||
|
||||
ScriptedActivityComponent::ScriptedActivityComponent(Entity* parent, int activityID) : Component(parent) {
|
||||
m_ActivityID = activityID;
|
||||
@@ -552,7 +553,7 @@ void ActivityInstance::StartZone() {
|
||||
void ActivityInstance::RewardParticipant(Entity* participant) {
|
||||
auto* missionComponent = participant->GetComponent<MissionComponent>();
|
||||
if (missionComponent) {
|
||||
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_ACTIVITY, m_ActivityInfo.ActivityID);
|
||||
missionComponent->Progress(eMissionTaskType::ACTIVITY, m_ActivityInfo.ActivityID);
|
||||
}
|
||||
|
||||
// First, get the activity data
|
||||
|
Reference in New Issue
Block a user