Merge pull request #963 from DarkflameUniverse/enum-cleanup

cleanup enums to make them more consistent style wise
This commit is contained in:
Aaron Kimbrell 2023-01-24 16:38:41 -06:00 committed by GitHub
commit ac5f08f601
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
134 changed files with 901 additions and 808 deletions

View File

@ -6,3 +6,6 @@
# convert to unix line endings # convert to unix line endings
72477e01e2711e0f61cdb192ee266e5e21b8846f 72477e01e2711e0f61cdb192ee266e5e21b8846f
# enum cleanup
faf42d2f8cf432df2993b031f079b0b8c6d7dbe7

View File

@ -8,8 +8,8 @@
#include "dServer.h" #include "dServer.h"
#include "GeneralUtils.h" #include "GeneralUtils.h"
#include "dLogger.h" #include "dLogger.h"
#include "AddFriendResponseCode.h" #include "eAddFriendResponseCode.h"
#include "AddFriendResponseType.h" #include "eAddFriendResponseType.h"
#include "RakString.h" #include "RakString.h"
#include "dConfig.h" #include "dConfig.h"
@ -115,7 +115,7 @@ void ChatPacketHandler::HandleFriendRequest(Packet* packet) {
auto requestor = playerContainer.GetPlayerData(requestorPlayerID); auto requestor = playerContainer.GetPlayerData(requestorPlayerID);
if (requestor->playerName == playerName) { if (requestor->playerName == playerName) {
SendFriendResponse(requestor, requestor, AddFriendResponseType::MYTHRAN); SendFriendResponse(requestor, requestor, eAddFriendResponseType::MYTHRAN);
return; return;
}; };
std::unique_ptr<PlayerData> requestee(playerContainer.GetPlayerData(playerName)); std::unique_ptr<PlayerData> requestee(playerContainer.GetPlayerData(playerName));
@ -153,7 +153,7 @@ void ChatPacketHandler::HandleFriendRequest(Packet* packet) {
requestee.reset(new PlayerData()); requestee.reset(new PlayerData());
requestee->playerName = playerName; requestee->playerName = playerName;
SendFriendResponse(requestor, requestee.get(), result->next() ? AddFriendResponseType::NOTONLINE : AddFriendResponseType::INVALIDCHARACTER); SendFriendResponse(requestor, requestee.get(), result->next() ? eAddFriendResponseType::NOTONLINE : eAddFriendResponseType::INVALIDCHARACTER);
return; return;
} }
@ -197,10 +197,10 @@ void ChatPacketHandler::HandleFriendRequest(Packet* packet) {
if (oldBestFriendStatus != bestFriendStatus) { if (oldBestFriendStatus != bestFriendStatus) {
if (requestee->countOfBestFriends >= maxNumberOfBestFriends || requestor->countOfBestFriends >= maxNumberOfBestFriends) { if (requestee->countOfBestFriends >= maxNumberOfBestFriends || requestor->countOfBestFriends >= maxNumberOfBestFriends) {
if (requestee->countOfBestFriends >= maxNumberOfBestFriends) { if (requestee->countOfBestFriends >= maxNumberOfBestFriends) {
SendFriendResponse(requestor, requestee.get(), AddFriendResponseType::THEIRFRIENDLISTFULL, false); SendFriendResponse(requestor, requestee.get(), eAddFriendResponseType::THEIRFRIENDLISTFULL, false);
} }
if (requestor->countOfBestFriends >= maxNumberOfBestFriends) { if (requestor->countOfBestFriends >= maxNumberOfBestFriends) {
SendFriendResponse(requestor, requestee.get(), AddFriendResponseType::YOURFRIENDSLISTFULL, false); SendFriendResponse(requestor, requestee.get(), eAddFriendResponseType::YOURFRIENDSLISTFULL, false);
} }
} else { } else {
// Then update the database with this new info. // Then update the database with this new info.
@ -215,8 +215,8 @@ void ChatPacketHandler::HandleFriendRequest(Packet* packet) {
if (bestFriendStatus == 3U) { if (bestFriendStatus == 3U) {
requestee->countOfBestFriends += 1; requestee->countOfBestFriends += 1;
requestor->countOfBestFriends += 1; requestor->countOfBestFriends += 1;
if (requestee->sysAddr != UNASSIGNED_SYSTEM_ADDRESS) SendFriendResponse(requestee.get(), requestor, AddFriendResponseType::ACCEPTED, false, true); if (requestee->sysAddr != UNASSIGNED_SYSTEM_ADDRESS) SendFriendResponse(requestee.get(), requestor, eAddFriendResponseType::ACCEPTED, false, true);
if (requestor->sysAddr != UNASSIGNED_SYSTEM_ADDRESS) SendFriendResponse(requestor, requestee.get(), AddFriendResponseType::ACCEPTED, false, true); if (requestor->sysAddr != UNASSIGNED_SYSTEM_ADDRESS) SendFriendResponse(requestor, requestee.get(), eAddFriendResponseType::ACCEPTED, false, true);
for (auto& friendData : requestor->friends) { for (auto& friendData : requestor->friends) {
if (friendData.friendID == requestee->playerID) { if (friendData.friendID == requestee->playerID) {
friendData.isBestFriend = true; friendData.isBestFriend = true;
@ -230,7 +230,7 @@ void ChatPacketHandler::HandleFriendRequest(Packet* packet) {
} }
} }
} else { } else {
if (requestor->sysAddr != UNASSIGNED_SYSTEM_ADDRESS) SendFriendResponse(requestor, requestee.get(), AddFriendResponseType::WAITINGAPPROVAL, true, true); if (requestor->sysAddr != UNASSIGNED_SYSTEM_ADDRESS) SendFriendResponse(requestor, requestee.get(), eAddFriendResponseType::WAITINGAPPROVAL, true, true);
} }
} else { } else {
// Do not send this if we are requesting to be a best friend. // Do not send this if we are requesting to be a best friend.
@ -247,7 +247,7 @@ void ChatPacketHandler::HandleFriendResponse(Packet* packet) {
inStream.Read(playerID); inStream.Read(playerID);
inStream.Read(playerID); inStream.Read(playerID);
AddFriendResponseCode clientResponseCode = static_cast<AddFriendResponseCode>(packet->data[0x14]); eAddFriendResponseCode clientResponseCode = static_cast<eAddFriendResponseCode>(packet->data[0x14]);
std::string friendName = PacketUtils::ReadString(0x15, packet, true); std::string friendName = PacketUtils::ReadString(0x15, packet, true);
//Now to try and find both of these: //Now to try and find both of these:
@ -255,29 +255,29 @@ void ChatPacketHandler::HandleFriendResponse(Packet* packet) {
auto requestee = playerContainer.GetPlayerData(friendName); auto requestee = playerContainer.GetPlayerData(friendName);
if (!requestor || !requestee) return; if (!requestor || !requestee) return;
AddFriendResponseType serverResponseCode{}; eAddFriendResponseType serverResponseCode{};
uint8_t isAlreadyBestFriends = 0U; uint8_t isAlreadyBestFriends = 0U;
// We need to convert this response code to one we can actually send back to the client. // We need to convert this response code to one we can actually send back to the client.
switch (clientResponseCode) { switch (clientResponseCode) {
case AddFriendResponseCode::ACCEPTED: case eAddFriendResponseCode::ACCEPTED:
serverResponseCode = AddFriendResponseType::ACCEPTED; serverResponseCode = eAddFriendResponseType::ACCEPTED;
break; break;
case AddFriendResponseCode::BUSY: case eAddFriendResponseCode::BUSY:
serverResponseCode = AddFriendResponseType::BUSY; serverResponseCode = eAddFriendResponseType::BUSY;
break; break;
case AddFriendResponseCode::CANCELLED: case eAddFriendResponseCode::CANCELLED:
serverResponseCode = AddFriendResponseType::CANCELLED; serverResponseCode = eAddFriendResponseType::CANCELLED;
break; break;
case AddFriendResponseCode::REJECTED: case eAddFriendResponseCode::REJECTED:
serverResponseCode = AddFriendResponseType::DECLINED; serverResponseCode = eAddFriendResponseType::DECLINED;
break; break;
} }
// Now that we have handled the base cases, we need to check the other cases. // Now that we have handled the base cases, we need to check the other cases.
if (serverResponseCode == AddFriendResponseType::ACCEPTED) { if (serverResponseCode == eAddFriendResponseType::ACCEPTED) {
for (auto friendData : requestor->friends) { for (auto friendData : requestor->friends) {
if (friendData.friendID == requestee->playerID) { if (friendData.friendID == requestee->playerID) {
serverResponseCode = AddFriendResponseType::ALREADYFRIEND; serverResponseCode = eAddFriendResponseType::ALREADYFRIEND;
if (friendData.isBestFriend) { if (friendData.isBestFriend) {
isAlreadyBestFriends = 1U; isAlreadyBestFriends = 1U;
} }
@ -286,7 +286,7 @@ void ChatPacketHandler::HandleFriendResponse(Packet* packet) {
} }
// This message is NOT sent for best friends and is handled differently for those requests. // This message is NOT sent for best friends and is handled differently for those requests.
if (serverResponseCode == AddFriendResponseType::ACCEPTED) { if (serverResponseCode == eAddFriendResponseType::ACCEPTED) {
// Add the each player to the others friend list. // Add the each player to the others friend list.
FriendData requestorData; FriendData requestorData;
requestorData.zoneID = requestor->zoneID; requestorData.zoneID = requestor->zoneID;
@ -313,8 +313,8 @@ void ChatPacketHandler::HandleFriendResponse(Packet* packet) {
statement->execute(); statement->execute();
} }
if (serverResponseCode != AddFriendResponseType::DECLINED) SendFriendResponse(requestor, requestee, serverResponseCode, isAlreadyBestFriends); if (serverResponseCode != eAddFriendResponseType::DECLINED) SendFriendResponse(requestor, requestee, serverResponseCode, isAlreadyBestFriends);
if (serverResponseCode != AddFriendResponseType::ALREADYFRIEND) SendFriendResponse(requestee, requestor, serverResponseCode, isAlreadyBestFriends); if (serverResponseCode != eAddFriendResponseType::ALREADYFRIEND) SendFriendResponse(requestee, requestor, serverResponseCode, isAlreadyBestFriends);
} }
void ChatPacketHandler::HandleRemoveFriend(Packet* packet) { void ChatPacketHandler::HandleRemoveFriend(Packet* packet) {
@ -922,7 +922,7 @@ void ChatPacketHandler::SendFriendRequest(PlayerData* receiver, PlayerData* send
//Make sure people aren't requesting people that they're already friends with: //Make sure people aren't requesting people that they're already friends with:
for (auto fr : receiver->friends) { for (auto fr : receiver->friends) {
if (fr.friendID == sender->playerID) { if (fr.friendID == sender->playerID) {
SendFriendResponse(sender, receiver, AddFriendResponseType::ALREADYFRIEND, fr.isBestFriend); SendFriendResponse(sender, receiver, eAddFriendResponseType::ALREADYFRIEND, fr.isBestFriend);
return; //we have this player as a friend, yeet this function so it doesn't send another request. return; //we have this player as a friend, yeet this function so it doesn't send another request.
} }
} }
@ -940,7 +940,7 @@ void ChatPacketHandler::SendFriendRequest(PlayerData* receiver, PlayerData* send
SEND_PACKET; SEND_PACKET;
} }
void ChatPacketHandler::SendFriendResponse(PlayerData* receiver, PlayerData* sender, AddFriendResponseType responseCode, uint8_t isBestFriendsAlready, uint8_t isBestFriendRequest) { void ChatPacketHandler::SendFriendResponse(PlayerData* receiver, PlayerData* sender, eAddFriendResponseType responseCode, uint8_t isBestFriendsAlready, uint8_t isBestFriendRequest) {
if (!receiver || !sender) return; if (!receiver || !sender) return;
CBITSTREAM; CBITSTREAM;
@ -951,11 +951,11 @@ void ChatPacketHandler::SendFriendResponse(PlayerData* receiver, PlayerData* sen
PacketUtils::WriteHeader(bitStream, CLIENT, MSG_CLIENT_ADD_FRIEND_RESPONSE); PacketUtils::WriteHeader(bitStream, CLIENT, MSG_CLIENT_ADD_FRIEND_RESPONSE);
bitStream.Write(responseCode); bitStream.Write(responseCode);
// For all requests besides accepted, write a flag that says whether or not we are already best friends with the receiver. // For all requests besides accepted, write a flag that says whether or not we are already best friends with the receiver.
bitStream.Write<uint8_t>(responseCode != AddFriendResponseType::ACCEPTED ? isBestFriendsAlready : sender->sysAddr != UNASSIGNED_SYSTEM_ADDRESS); bitStream.Write<uint8_t>(responseCode != eAddFriendResponseType::ACCEPTED ? isBestFriendsAlready : sender->sysAddr != UNASSIGNED_SYSTEM_ADDRESS);
// Then write the player name // Then write the player name
PacketUtils::WritePacketWString(sender->playerName.c_str(), 33, &bitStream); PacketUtils::WritePacketWString(sender->playerName.c_str(), 33, &bitStream);
// Then if this is an acceptance code, write the following extra info. // Then if this is an acceptance code, write the following extra info.
if (responseCode == AddFriendResponseType::ACCEPTED) { if (responseCode == eAddFriendResponseType::ACCEPTED) {
bitStream.Write(sender->playerID); bitStream.Write(sender->playerID);
bitStream.Write(sender->zoneID); bitStream.Write(sender->zoneID);
bitStream.Write(isBestFriendRequest); //isBFF bitStream.Write(isBestFriendRequest); //isBFF

View File

@ -4,7 +4,7 @@
#include "BitStream.h" #include "BitStream.h"
struct PlayerData; struct PlayerData;
enum class AddFriendResponseType : uint8_t; enum class eAddFriendResponseType : uint8_t;
namespace ChatPacketHandler { namespace ChatPacketHandler {
void HandleFriendlistRequest(Packet* packet); void HandleFriendlistRequest(Packet* packet);
@ -35,6 +35,6 @@ namespace ChatPacketHandler {
void SendFriendUpdate(PlayerData* friendData, PlayerData* playerData, uint8_t notifyType, uint8_t isBestFriend); void SendFriendUpdate(PlayerData* friendData, PlayerData* playerData, uint8_t notifyType, uint8_t isBestFriend);
void SendFriendRequest(PlayerData* receiver, PlayerData* sender); void SendFriendRequest(PlayerData* receiver, PlayerData* sender);
void SendFriendResponse(PlayerData* receiver, PlayerData* sender, AddFriendResponseType responseCode, uint8_t isBestFriendsAlready = 0U, uint8_t isBestFriendRequest = 0U); void SendFriendResponse(PlayerData* receiver, PlayerData* sender, eAddFriendResponseType responseCode, uint8_t isBestFriendsAlready = 0U, uint8_t isBestFriendRequest = 0U);
void SendRemoveFriend(PlayerData* receiver, std::string& personToRemove, bool isSuccessful); void SendRemoveFriend(PlayerData* receiver, std::string& personToRemove, bool isSuccessful);
}; };

View File

@ -1,105 +0,0 @@
#pragma once
/**
2 Engineer (Rank 1) Item Set
3 Engineer (Rank 2) Item Set
4 Engineer (Rank 3) Item Set
7 Knight (Rank 1) Item Set
8 Knight (Rank 2) Item Set
9 Knight (Rank 3) Item Set
10 Space Ranger (Rank 1) Item Set
11 Space Ranger (Rank 2) Item Set
12 Space Ranger (Rank 3) Item Set
13 Samurai (Rank 1) Item Set
14 Samurai (Rank 2) Item Set
15 Samurai (Rank 3) Item Set
16 Sorcerer (Rank 1) Item Set
17 Sorcerer (Rank 2) Item Set
18 Sorcerer (Rank 3) Item Set
19 Space Marauder (Rank 1) Item Set
20 Space Marauder (Rank 2) Item Set
21 Space Marauder (Rank 3) Item Set
22 Shinobi (Rank 1) Item Set
23 Shinobi (Rank 2) Item Set
24 Shinobi (Rank 3) Item Set
25 Inventor (Rank 1) Item Set
26 Inventor (Rank 2) Item Set
27 Inventor (Rank 3) Item Set
28 Summoner (Rank 1) Item Set
29 Summoner (Rank 2) Item Set
30 Summoner (Rank 3) Item Set
31 Adventurer (Rank 1) Item Set
32 Adventurer (Rank 2) Item Set
33 Adventurer (Rank 3) Item Set
34 Daredevil (Rank 1) Item Set
35 Daredevil (Rank 2) Item Set
36 Daredevil (Rank 3) Item Set
37 Buccaneer (Rank 1) Item Set
38 Buccaneer (Rank 2) Item Set
39 Buccaneer (Rank 3) Item Set
40 Bone Suit Item Set
41 Imagination Spinjitzu Item Set
42 Bat Lord Item Set
43 Mosaic Jester Item Set
44 Explorien Bot Item Set
45 [Unnamed] Item Set
46 [Unnamed] Item Set
47 [Unnamed] Item Set
48 Earth Spinjitzu Item Set
49 [Unnamed] Item Set
50 Fire Spinjitzu Item Set
51 Ice Spinjitzu Item Set
52 Lightning Spinjitzu Item Set
*/
enum class ItemSetPassiveAbilityID
{
EngineerRank1 = 2,
EngineerRank2 = 3,
EngineerRank3 = 4,
KnightRank1 = 7,
KnightRank2 = 8,
KnightRank3 = 9,
SpaceRangerRank1 = 10,
SpaceRangerRank2 = 11,
SpaceRangerRank3 = 12,
SamuraiRank1 = 13,
SamuraiRank2 = 14,
SamuraiRank3 = 15,
SorcererRank1 = 16,
SorcererRank2 = 17,
SorcererRank3 = 18,
SpaceMarauderRank1 = 19,
SpaceMarauderRank2 = 20,
SpaceMarauderRank3 = 21,
ShinobiRank1 = 22,
ShinobiRank2 = 23,
ShinobiRank3 = 24,
InventorRank1 = 25,
InventorRank2 = 26,
InventorRank3 = 27,
SummonerRank1 = 28,
SummonerRank2 = 29,
SummonerRank3 = 30,
AdventurerRank1 = 31,
AdventurerRank2 = 32,
AdventurerRank3 = 33,
DaredevilRank1 = 34,
DaredevilRank2 = 35,
DaredevilRank3 = 36,
BuccaneerRank1 = 37,
BuccaneerRank2 = 38,
BuccaneerRank3 = 39,
BoneSuit = 40,
ImaginationSpinjitzu = 41,
BatLord = 42,
MosaicJester = 43,
ExplorienBot = 44,
Unnamed1 = 45,
Unnamed2 = 46,
Unnamed3 = 47,
EarthSpinjitzu = 48,
Unnamed4 = 49,
FireSpinjitzu = 50,
IceSpinjitzu = 51,
LightningSpinjitzu = 52
};

View File

@ -1,13 +0,0 @@
#pragma once
#ifndef MISSIONLOCKSTATE_H
#define MISSIONLOCKSTATE_H
enum class MissionLockState : int
{
MISSION_LOCK_LOCKED,
MISSION_LOCK_NEW,
MISSION_LOCK_UNLOCKED,
};
#endif

View File

@ -1,56 +0,0 @@
#pragma once
#ifndef __MISSIONSTATE__H__
#define __MISSIONSTATE__H__
/**
* Represents the possible states a mission can be in
*/
enum class MissionState : int32_t {
/**
* The mission state is unknown
*/
MISSION_STATE_UNKNOWN = -1,
/**
* The mission is yielding rewards
*/
MISSION_STATE_REWARDING = 0,
/**
* The mission can be accepted
*/
MISSION_STATE_AVAILABLE = 1,
/**
* The mission has been accepted but not yet completed
*/
MISSION_STATE_ACTIVE = 2,
/**
* All the tasks for the mission have been completed and the entity can turn the mission in to complete it
*/
MISSION_STATE_READY_TO_COMPLETE = 4, //!< The mission is ready to complete
/**
* The mission has been completed
*/
MISSION_STATE_COMPLETE = 8,
/**
* The mission is available again and has been completed before. Used for daily missions.
*/
MISSION_STATE_COMPLETE_AVAILABLE = 9,
/**
* The mission is active and has been completed before. Used for daily missions.
*/
MISSION_STATE_COMPLETE_ACTIVE = 10,
/**
* The mission has been completed before and has now been completed again. Used for daily missions.
*/
MISSION_STATE_COMPLETE_READY_TO_COMPLETE = 12
};
#endif //!__MISSIONSTATE__H__

View File

@ -1,31 +0,0 @@
#pragma once
#ifndef MISSIONTASKTYPE_H
#define MISSIONTASKTYPE_H
//! An enum for mission task types
enum class MissionTaskType : int {
MISSION_TASK_TYPE_UNKNOWN = -1, //!< The task type is unknown
MISSION_TASK_TYPE_SMASH = 0, //!< A task for smashing something
MISSION_TASK_TYPE_SCRIPT = 1, //!< A task handled by a server LUA script
MISSION_TASK_TYPE_ACTIVITY = 2, //!< A task for completing a quickbuild
MISSION_TASK_TYPE_ENVIRONMENT = 3, //!< A task for something in the environment
MISSION_TASK_TYPE_MISSION_INTERACTION = 4, //!< A task for interacting with a mission
MISSION_TASK_TYPE_EMOTE = 5, //!< A task for playing an emote
MISSION_TASK_TYPE_FOOD = 9, //!< A task for eating food
MISSION_TASK_TYPE_SKILL = 10, //!< A task for performing a skill
MISSION_TASK_TYPE_ITEM_COLLECTION = 11, //!< A task for collecting an item
MISSION_TASK_TYPE_LOCATION = 12, //!< A task for finding a location
MISSION_TASK_TYPE_MINIGAME = 14, //!< A task for doing something in a minigame
MISSION_TASK_TYPE_NON_MISSION_INTERACTION = 15, //!< A task for interacting with a non-mission
MISSION_TASK_TYPE_MISSION_COMPLETE = 16, //!< A task for completing a mission
MISSION_TASK_TYPE_EARN_REPUTATION = 17, //!< A task for earning reputation
MISSION_TASK_TYPE_POWERUP = 21, //!< A task for collecting a powerup
MISSION_TASK_TYPE_PET_TAMING = 22, //!< A task for taming a pet
MISSION_TASK_TYPE_RACING = 23, //!< A task for racing
MISSION_TASK_TYPE_PLAYER_FLAG = 24, //!< A task for setting a player flag
MISSION_TASK_TYPE_PLACE_MODEL = 25, //!< A task for picking up a model
MISSION_TASK_TYPE_VISIT_PROPERTY = 30 //!< A task for visiting a property
};
#endif

View File

@ -1,42 +0,0 @@
#pragma once
#include <cstdint>
/**
* Bitmap of permissions and restrictions for characters.
*/
enum class PermissionMap : uint64_t
{
/**
* Reserved for future use, bit 0-3.
*/
/**
* The character has restricted trade acccess, bit 4.
*/
RestrictedTradeAccess = 0x1 << 4,
/**
* The character has restricted mail access, bit 5.
*/
RestrictedMailAccess = 0x1 << 5,
/**
* The character has restricted chat access, bit 6.
*/
RestrictedChatAccess = 0x1 << 6,
//
// Combined permissions
//
/**
* The character is marked as 'old', restricted from trade and mail.
*/
Old = RestrictedTradeAccess | RestrictedMailAccess,
/**
* The character is soft banned, restricted from trade, mail, and chat.
*/
SoftBanned = RestrictedTradeAccess | RestrictedMailAccess | RestrictedChatAccess,
};

View File

@ -1,20 +0,0 @@
#pragma once
#include <cstdint>
enum class RacingTaskParam : int32_t {
RACING_TASK_PARAM_FINISH_WITH_PLACEMENT = 1, //<! A task param for finishing with a specific placement.
RACING_TASK_PARAM_LAP_TIME = 2, //<! A task param for finishing with a specific lap time.
RACING_TASK_PARAM_TOTAL_TRACK_TIME = 3, //<! A task param for finishing with a specific track time.
RACING_TASK_PARAM_COMPLETE_ANY_RACING_TASK = 4, //<! A task param for completing a racing task.
RACING_TASK_PARAM_COMPLETE_TRACK_TASKS = 5, //<! A task param for completing a task for a specific track.
RACING_TASK_PARAM_MODULAR_BUILDING = 6, //<! A task param for modular building with racing builds.
RACING_TASK_PARAM_SAFE_DRIVER = 10, //<! A task param for completing a race without smashing.
RACING_TASK_PARAM_SMASHABLES = 11, //<! A task param for smashing entities during a race.
RACING_TASK_PARAM_COLLECT_IMAGINATION = 12, //<! A task param for collecting imagination during a race.
RACING_TASK_PARAM_COMPETED_IN_RACE = 13, //<! A task param for competing in a race.
RACING_TASK_PARAM_WIN_RACE_IN_WORLD = 14, //<! A task param for winning a race in a specific world.
RACING_TASK_PARAM_FIRST_PLACE_MULTIPLE_TRACKS = 15, //<! A task param for finishing in first place on multiple tracks.
RACING_TASK_PARAM_LAST_PLACE_FINISH = 16, //<! A task param for finishing in last place.
RACING_TASK_PARAM_SMASH_SPECIFIC_SMASHABLE = 17 //<! A task param for smashing dragon eggs during a race.
};

View File

@ -1,11 +1,11 @@
#pragma once #pragma once
#ifndef __ADDFRIENDRESPONSECODE__H__ #ifndef __EADDFRIENDRESPONSECODE__H__
#define __ADDFRIENDRESPONSECODE__H__ #define __EADDFRIENDRESPONSECODE__H__
#include <cstdint> #include <cstdint>
enum class AddFriendResponseCode : uint8_t { enum class eAddFriendResponseCode : uint8_t {
ACCEPTED = 0, ACCEPTED = 0,
REJECTED, REJECTED,
BUSY, BUSY,

View File

@ -1,11 +1,11 @@
#pragma once #pragma once
#ifndef __ADDFRIENDRESPONSETYPE__H__ #ifndef __EADDFRIENDRESPONSETYPE__H__
#define __ADDFRIENDRESPONSETYPE__H__ #define __EADDFRIENDRESPONSETYPE__H__
#include <cstdint> #include <cstdint>
enum class AddFriendResponseType : uint8_t { enum class eAddFriendResponseType : uint8_t {
ACCEPTED = 0, ACCEPTED = 0,
ALREADYFRIEND, ALREADYFRIEND,
INVALIDCHARACTER, INVALIDCHARACTER,
@ -21,4 +21,4 @@ enum class AddFriendResponseType : uint8_t {
FRIENDISFREETRIAL FRIENDISFREETRIAL
}; };
#endif //!__ADDFRIENDRESPONSETYPE__H__ #endif //!__EADDFRIENDRESPONSETYPE__H__

View File

@ -7,8 +7,8 @@
enum class eBubbleType : uint32_t { enum class eBubbleType : uint32_t {
DEFAULT = 0, DEFAULT = 0,
ENERGY = 1, ENERGY,
SKUNK = 2, SKUNK
}; };
#endif //!__EBUBBLETYPE__H__ #endif //!__EBUBBLETYPE__H__

View File

@ -0,0 +1,41 @@
#ifndef __EHELPTYPE__H__
#define __EHELPTYPE__H__
#include <cstdint>
enum class eHelpType : int32_t {
NONE = 0,
UNLOCK_MINIMAP = 2,
TOGGLETOOLTIP_OUTOFTIME_REBUILD = 3,
TOGGLETOOLTIP_LEAVELOSE_REBUILD = 4,
TOGGLECONTROLSTUTORIAL_WALKING = 6,
DISPLAYTUTORIAL_PASSPORT_1ST_SMASH = 7,
TOOLTIP_1ST_IMAGINATION_PICKUP = 8,
UNKNOWN9 = 9,
PETTAMINGMINIGAME_TUTORIAL_01 = 15,
PR_BOUNCER_TUTORIAL_03 = 16,
PR_TOOLTIP_1ST_PET_JUMPED_ON_SWITCH = 17,
PR_DIG_TUTORIAL_01 = 18,
PR_DIG_TUTORIAL_03 = 19,
PR_BOUNCER_TUTORIAL_01 = 20,
PR_NO_IMAGINATION_HIBERNATE = 21,
UNKNOWN22 = 22,
TOGGLECONTROLSTUTORIAL_JUMPING = 26,
TOGGLECONTROLSTUTORIAL_DOUBLEJUMPING = 27,
TOGGLECONTROLSTUTORIAL_CAMERA = 28,
TOGGLECONTROLSTUTORIAL_SMASH = 30,
UNKNOWN38 = 38,
UI_MOD_BUILD_PUT_ON_HAT = 40,
UI_MOD_BUILD_EQUIP_FIRST_MODULE = 41,
UNKNOWN42 = 42,
UNKNOWN43 = 43,
UI_MOD_BUILD_GO_LAUNCH_ROCKET = 44,
UI_MOD_BUILD_TALK_TO_SKYLANE = 45,
UNKNOWN53 = 53,
PET_DESPAWN_BY_OWNER_HIBERNATE = 69,
PET_DESPAWN_TAMING_NEW_PET = 70,
UI_INVENTORY_FULL_CANNOT_PICKUP_ITEM = 86
};
#endif //!__EHELPTYPE__H__

View File

@ -0,0 +1,58 @@
#pragma once
#ifndef __EITEMSETPASSIVEABILITYID__H__
#define __EITEMSETPASSIVEABILITYID__H__
enum class eItemSetPassiveAbilityID {
EngineerRank1 = 2,
EngineerRank2 = 3,
EngineerRank3 = 4,
KnightRank1 = 7,
KnightRank2 = 8,
KnightRank3 = 9,
SpaceRangerRank1 = 10,
SpaceRangerRank2 = 11,
SpaceRangerRank3 = 12,
SamuraiRank1 = 13,
SamuraiRank2 = 14,
SamuraiRank3 = 15,
SorcererRank1 = 16,
SorcererRank2 = 17,
SorcererRank3 = 18,
SpaceMarauderRank1 = 19,
SpaceMarauderRank2 = 20,
SpaceMarauderRank3 = 21,
ShinobiRank1 = 22,
ShinobiRank2 = 23,
ShinobiRank3 = 24,
InventorRank1 = 25,
InventorRank2 = 26,
InventorRank3 = 27,
SummonerRank1 = 28,
SummonerRank2 = 29,
SummonerRank3 = 30,
AdventurerRank1 = 31,
AdventurerRank2 = 32,
AdventurerRank3 = 33,
DaredevilRank1 = 34,
DaredevilRank2 = 35,
DaredevilRank3 = 36,
BuccaneerRank1 = 37,
BuccaneerRank2 = 38,
BuccaneerRank3 = 39,
BoneSuit = 40,
ImaginationSpinjitzu = 41,
BatLord = 42,
MosaicJester = 43,
ExplorienBot = 44,
Unnamed1 = 45,
Unnamed2 = 46,
Unnamed3 = 47,
EarthSpinjitzu = 48,
Unnamed4 = 49,
FireSpinjitzu = 50,
IceSpinjitzu = 51,
LightningSpinjitzu = 52
};
#endif //!__EITEMSETPASSIVEABILITYID__H__

View File

@ -6,31 +6,31 @@
#include <cstdint> #include <cstdint>
enum class eItemType : int32_t { enum class eItemType : int32_t {
ITEM_TYPE_UNKNOWN = -1, //!< An unknown item type UNKNOWN = -1,
ITEM_TYPE_BRICK = 1, //!< A brick BRICK,
ITEM_TYPE_HAT = 2, //!< A hat / head item HAT,
ITEM_TYPE_HAIR = 3, //!< A hair item HAIR,
ITEM_TYPE_NECK = 4, //!< A neck item NECK,
ITEM_TYPE_LEFT_HAND = 5, //!< A left handed item LEFT_HAND,
ITEM_TYPE_RIGHT_HAND = 6, //!< A right handed item RIGHT_HAND,
ITEM_TYPE_LEGS = 7, //!< A pants item LEGS,
ITEM_TYPE_LEFT_TRINKET = 8, //!< A left handled trinket item LEFT_TRINKET,
ITEM_TYPE_RIGHT_TRINKET = 9, //!< A right handed trinket item RIGHT_TRINKET,
ITEM_TYPE_BEHAVIOR = 10, //!< A behavior BEHAVIOR,
ITEM_TYPE_PROPERTY = 11, //!< A property PROPERTY,
ITEM_TYPE_MODEL = 12, //!< A model MODEL,
ITEM_TYPE_COLLECTIBLE = 13, //!< A collectible item COLLECTIBLE,
ITEM_TYPE_CONSUMABLE = 14, //!< A consumable item CONSUMABLE,
ITEM_TYPE_CHEST = 15, //!< A chest item CHEST,
ITEM_TYPE_EGG = 16, //!< An egg EGG,
ITEM_TYPE_PET_FOOD = 17, //!< A pet food item PET_FOOD,
ITEM_TYPE_QUEST_OBJECT = 18, //!< A quest item QUEST_OBJECT,
ITEM_TYPE_PET_INVENTORY_ITEM = 19, //!< A pet inventory item PET_INVENTORY_ITEM,
ITEM_TYPE_PACKAGE = 20, //!< A package PACKAGE,
ITEM_TYPE_LOOT_MODEL = 21, //!< A loot model LOOT_MODEL,
ITEM_TYPE_VEHICLE = 22, //!< A vehicle VEHICLE,
ITEM_TYPE_CURRENCY = 23, //!< Currency LUP_MODEL,
ITEM_TYPE_MOUNT = 24 //!< A Mount MOUNT
}; };
#endif //!__EITEMTYPE__H__ #endif //!__EITEMTYPE__H__

View File

@ -0,0 +1,12 @@
#pragma once
#ifndef __EMISSIONLOCKSTATE__H__
#define __EMISSIONLOCKSTATE__H__
enum class eMissionLockState : int {
LOCKED,
NEW,
UNLOCKED,
};
#endif //!__EMISSIONLOCKSTATE__H__

View File

@ -0,0 +1,56 @@
#pragma once
#ifndef __MISSIONSTATE__H__
#define __MISSIONSTATE__H__
/**
* Represents the possible states a mission can be in
*/
enum class eMissionState : int {
/**
* The mission state is unknown
*/
UNKNOWN = -1,
/**
* The mission is yielding rewards
*/
REWARDING = 0,
/**
* The mission can be accepted
*/
AVAILABLE = 1,
/**
* The mission has been accepted but not yet completed
*/
ACTIVE = 2,
/**
* All the tasks for the mission have been completed and the entity can turn the mission in to complete it
*/
READY_TO_COMPLETE = 4, //!< The mission is ready to complete
/**
* The mission has been completed
*/
COMPLETE = 8,
/**
* The mission is available again and has been completed before. Used for daily missions.
*/
COMPLETE_AVAILABLE = 9,
/**
* The mission is active and has been completed before. Used for daily missions.
*/
COMPLETE_ACTIVE = 10,
/**
* The mission has been completed before and has now been completed again. Used for daily missions.
*/
COMPLETE_READY_TO_COMPLETE = 12
};
#endif //!__MISSIONSTATE__H__

View File

@ -0,0 +1,43 @@
#pragma once
#ifndef __EMISSIONTASKTYPE__H__
#define __EMISSIONTASKTYPE__H__
enum class eMissionTaskType : int {
UNKNOWN = -1,
SMASH,
SCRIPT,
ACTIVITY,
COLLECTION,
TALK_TO_NPC,
EMOTE,
SHASH_CHAIN,
BUY,
SELL,
USE_ITEM,
USE_SKILL,
GATHER,
EXPLORE,
DELIVERY,
PERFORM_ACTIVITY,
INTERACT,
META,
EARN_REPUTATION,
VOTING,
SHOWCASE_DELIVERY,
REVIECE_CAST,
POWERUP,
PET_TAMING,
RACING,
PLAYER_FLAG,
PLACE_MODEL,
REMOVE_MODEL,
ADD_BEHAVIOR,
REMOVE_BEHAVIOR,
CLAIM_PROPERTY,
VISIT_PROPERTY,
TIME_PLAYED,
DONATION
};
#endif //!__EMISSIONTASKTYPE__H__

View File

@ -0,0 +1,13 @@
#ifndef __EPACKAGETYPE__H__
#define __EPACKAGETYPE__H__
enum class ePackageType {
INVALID = -1,
ITEM,
BRICKS,
MODELS,
CAR_MODELS
};
#endif //!__EPACKAGETYPE__H__

View File

@ -0,0 +1,46 @@
#pragma once
#include <cstdint>
#ifndef __EPERMISSIONMAP__H__
#define __EPERMISSIONMAP__H__
/**
* Bitmap of permissions and restrictions for characters.
*/
enum class ePermissionMap : uint64_t {
/**
* Reserved for future use, bit 0-3.
*/
/**
* The character has restricted trade acccess, bit 4.
*/
RestrictedTradeAccess = 0x1 << 4,
/**
* The character has restricted mail access, bit 5.
*/
RestrictedMailAccess = 0x1 << 5,
/**
* The character has restricted chat access, bit 6.
*/
RestrictedChatAccess = 0x1 << 6,
//
// Combined permissions
//
/**
* The character is marked as 'old', restricted from trade and mail.
*/
Old = RestrictedTradeAccess | RestrictedMailAccess,
/**
* The character is soft banned, restricted from trade, mail, and chat.
*/
SoftBanned = RestrictedTradeAccess | RestrictedMailAccess | RestrictedChatAccess,
};
#endif //!__EPERMISSIONMAP__H__

View File

@ -0,0 +1,25 @@
#pragma once
#ifndef __ERACINGTASKPARAM__H__
#define __ERACINGTASKPARAM__H__
#include <cstdint>
enum class eRacingTaskParam : int32_t {
FINISH_WITH_PLACEMENT = 1,
LAP_TIME,
TOTAL_TRACK_TIME,
COMPLETE_ANY_RACING_TASK,
COMPLETE_TRACK_TASKS,
MODULAR_BUILDING,
SAFE_DRIVER = 10,
SMASHABLES,
COLLECT_IMAGINATION,
COMPETED_IN_RACE,
WIN_RACE_IN_WORLD,
FIRST_PLACE_MULTIPLE_TRACKS,
LAST_PLACE_FINISH,
SMASH_SPECIFIC_SMASHABLE
};
#endif //!__ERACINGTASKPARAM__H__

View File

@ -16,6 +16,8 @@
#include "ChatPackets.h" #include "ChatPackets.h"
#include "Inventory.h" #include "Inventory.h"
#include "InventoryComponent.h" #include "InventoryComponent.h"
#include "eMissionTaskType.h"
#include "eMissionState.h"
Character::Character(uint32_t id, User* parentUser) { Character::Character(uint32_t id, User* parentUser) {
//First load the name, etc: //First load the name, etc:
@ -34,7 +36,7 @@ Character::Character(uint32_t id, User* parentUser) {
m_UnapprovedName = res->getString(2).c_str(); m_UnapprovedName = res->getString(2).c_str();
m_NameRejected = res->getBoolean(3); m_NameRejected = res->getBoolean(3);
m_PropertyCloneID = res->getUInt(4); m_PropertyCloneID = res->getUInt(4);
m_PermissionMap = static_cast<PermissionMap>(res->getUInt64(5)); m_PermissionMap = static_cast<ePermissionMap>(res->getUInt64(5));
} }
delete res; delete res;
@ -93,7 +95,7 @@ void Character::UpdateFromDatabase() {
m_UnapprovedName = res->getString(2).c_str(); m_UnapprovedName = res->getString(2).c_str();
m_NameRejected = res->getBoolean(3); m_NameRejected = res->getBoolean(3);
m_PropertyCloneID = res->getUInt(4); m_PropertyCloneID = res->getUInt(4);
m_PermissionMap = static_cast<PermissionMap>(res->getUInt64(5)); m_PermissionMap = static_cast<ePermissionMap>(res->getUInt64(5));
} }
delete res; delete res;
@ -423,7 +425,7 @@ void Character::SetPlayerFlag(const uint32_t flagId, const bool value) {
auto* missionComponent = player->GetComponent<MissionComponent>(); auto* missionComponent = player->GetComponent<MissionComponent>();
if (missionComponent != nullptr) { if (missionComponent != nullptr) {
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_PLAYER_FLAG, flagId); missionComponent->Progress(eMissionTaskType::PLAYER_FLAG, flagId);
} }
} }
} }
@ -535,7 +537,7 @@ void Character::OnZoneLoad() {
if (missionComponent != nullptr) { if (missionComponent != nullptr) {
// Fix the monument race flag // Fix the monument race flag
if (missionComponent->GetMissionState(319) >= MissionState::MISSION_STATE_READY_TO_COMPLETE) { if (missionComponent->GetMissionState(319) >= eMissionState::READY_TO_COMPLETE) {
SetPlayerFlag(33, true); SetPlayerFlag(33, true);
} }
} }
@ -550,7 +552,7 @@ void Character::OnZoneLoad() {
/** /**
* Restrict old character to 1 million coins * Restrict old character to 1 million coins
*/ */
if (HasPermission(PermissionMap::Old)) { if (HasPermission(ePermissionMap::Old)) {
if (GetCoins() > 1000000) { if (GetCoins() > 1000000) {
SetCoins(1000000, eLootSourceType::LOOT_SOURCE_NONE); SetCoins(1000000, eLootSourceType::LOOT_SOURCE_NONE);
} }
@ -568,11 +570,11 @@ void Character::OnZoneLoad() {
} }
} }
PermissionMap Character::GetPermissionMap() const { ePermissionMap Character::GetPermissionMap() const {
return m_PermissionMap; return m_PermissionMap;
} }
bool Character::HasPermission(PermissionMap permission) const { bool Character::HasPermission(ePermissionMap permission) const {
return (static_cast<uint64_t>(m_PermissionMap) & static_cast<uint64_t>(permission)) != 0; return (static_cast<uint64_t>(m_PermissionMap) & static_cast<uint64_t>(permission)) != 0;
} }

View File

@ -9,11 +9,12 @@
#include "NiPoint3.h" #include "NiPoint3.h"
#include "NiQuaternion.h" #include "NiQuaternion.h"
#include "PermissionMap.h" #include "ePermissionMap.h"
class User; class User;
struct Packet; struct Packet;
class Entity; class Entity;
enum class ePermissionMap : uint64_t;
/** /**
* Meta information about a character, like their name and style * Meta information about a character, like their name and style
@ -385,14 +386,14 @@ public:
* Gets the permissions of the character, determining what actions a character may do * Gets the permissions of the character, determining what actions a character may do
* @return the permissions for this character * @return the permissions for this character
*/ */
PermissionMap GetPermissionMap() const; ePermissionMap GetPermissionMap() const;
/** /**
* Check if this character has a certain permission * Check if this character has a certain permission
* @param permission the ID of the permission to check for * @param permission the ID of the permission to check for
* @return whether the character has the specified permission * @return whether the character has the specified permission
*/ */
bool HasPermission(PermissionMap permission) const; bool HasPermission(ePermissionMap permission) const;
/** /**
* Gets all the emotes this character has unlocked so far * Gets all the emotes this character has unlocked so far
@ -481,7 +482,7 @@ private:
/** /**
* Bitmap of permission attributes this character has. * Bitmap of permission attributes this character has.
*/ */
PermissionMap m_PermissionMap; ePermissionMap m_PermissionMap;
/** /**
* The default name of this character * The default name of this character

View File

@ -22,6 +22,7 @@
#include "EntityTimer.h" #include "EntityTimer.h"
#include "EntityCallbackTimer.h" #include "EntityCallbackTimer.h"
#include "Loot.h" #include "Loot.h"
#include "eMissionTaskType.h"
//Component includes: //Component includes:
#include "Component.h" #include "Component.h"
@ -1318,7 +1319,7 @@ void Entity::OnCollisionPhantom(const LWOOBJID otherEntity) {
auto* missionComponent = other->GetComponent<MissionComponent>(); auto* missionComponent = other->GetComponent<MissionComponent>();
if (missionComponent != nullptr) { if (missionComponent != nullptr) {
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_LOCATION, 0, 0, GeneralUtils::UTF16ToWTF8(poi)); missionComponent->Progress(eMissionTaskType::EXPLORE, 0, 0, GeneralUtils::UTF16ToWTF8(poi));
} }
} }
@ -1614,7 +1615,7 @@ void Entity::PickupItem(const LWOOBJID& objectID) {
auto* missionComponent = GetComponent<MissionComponent>(); auto* missionComponent = GetComponent<MissionComponent>();
if (missionComponent != nullptr) { if (missionComponent != nullptr) {
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_POWERUP, skill.skillID); missionComponent->Progress(eMissionTaskType::POWERUP, skill.skillID);
} }
} }
} else { } else {

View File

@ -9,6 +9,7 @@
#include "Character.h" #include "Character.h"
#include "CharacterComponent.h" #include "CharacterComponent.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "eMissionTaskType.h"
TradingManager* TradingManager::m_Address = nullptr; TradingManager* TradingManager::m_Address = nullptr;
@ -161,14 +162,14 @@ void Trade::Complete() {
for (const auto& tradeItem : m_ItemsA) { for (const auto& tradeItem : m_ItemsA) {
auto* itemToRemove = inventoryA->FindItemById(tradeItem.itemId); auto* itemToRemove = inventoryA->FindItemById(tradeItem.itemId);
if (itemToRemove) itemToRemove->SetCount(itemToRemove->GetCount() - tradeItem.itemCount); if (itemToRemove) itemToRemove->SetCount(itemToRemove->GetCount() - tradeItem.itemCount);
missionsA->Progress(MissionTaskType::MISSION_TASK_TYPE_ITEM_COLLECTION, tradeItem.itemLot, LWOOBJID_EMPTY, "", -tradeItem.itemCount); missionsA->Progress(eMissionTaskType::GATHER, tradeItem.itemLot, LWOOBJID_EMPTY, "", -tradeItem.itemCount);
inventoryB->AddItem(tradeItem.itemLot, tradeItem.itemCount, eLootSourceType::LOOT_SOURCE_TRADE); inventoryB->AddItem(tradeItem.itemLot, tradeItem.itemCount, eLootSourceType::LOOT_SOURCE_TRADE);
} }
for (const auto& tradeItem : m_ItemsB) { for (const auto& tradeItem : m_ItemsB) {
auto* itemToRemove = inventoryB->FindItemById(tradeItem.itemId); auto* itemToRemove = inventoryB->FindItemById(tradeItem.itemId);
if (itemToRemove) itemToRemove->SetCount(itemToRemove->GetCount() - tradeItem.itemCount); if (itemToRemove) itemToRemove->SetCount(itemToRemove->GetCount() - tradeItem.itemCount);
missionsB->Progress(MissionTaskType::MISSION_TASK_TYPE_ITEM_COLLECTION, tradeItem.itemLot, LWOOBJID_EMPTY, "", -tradeItem.itemCount); missionsB->Progress(eMissionTaskType::GATHER, tradeItem.itemLot, LWOOBJID_EMPTY, "", -tradeItem.itemCount);
inventoryA->AddItem(tradeItem.itemLot, tradeItem.itemCount, eLootSourceType::LOOT_SOURCE_TRADE); inventoryA->AddItem(tradeItem.itemLot, tradeItem.itemCount, eLootSourceType::LOOT_SOURCE_TRADE);
} }

View File

@ -1,3 +1,5 @@
#include "eMissionTaskType.h"
#ifndef __ACHIEVEMENTCACHEKEY__H__ #ifndef __ACHIEVEMENTCACHEKEY__H__
#define __ACHIEVEMENTCACHEKEY__H__ #define __ACHIEVEMENTCACHEKEY__H__
@ -6,7 +8,7 @@ public:
AchievementCacheKey() { AchievementCacheKey() {
targets = ""; targets = "";
value = 0; value = 0;
type = MissionTaskType::MISSION_TASK_TYPE_UNKNOWN; type = eMissionTaskType::UNKNOWN;
}; };
bool operator==(const AchievementCacheKey& point) const { bool operator==(const AchievementCacheKey& point) const {
@ -14,15 +16,15 @@ public:
}; };
void SetTargets(const std::string value) { this->targets = value; }; void SetTargets(const std::string value) { this->targets = value; };
void SetValue(uint32_t value) { this->value = 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; }; std::string GetTargets() const { return this->targets; };
uint32_t GetValue() const { return this->value; }; uint32_t GetValue() const { return this->value; };
MissionTaskType GetType() const { return this->type; }; eMissionTaskType GetType() const { return this->type; };
private: private:
std::string targets; std::string targets;
uint32_t value; uint32_t value;
MissionTaskType type; eMissionTaskType type;
}; };

View File

@ -32,6 +32,7 @@
#include "InventoryComponent.h" #include "InventoryComponent.h"
#include "dZoneManager.h" #include "dZoneManager.h"
#include "WorldConfig.h" #include "WorldConfig.h"
#include "eMissionTaskType.h"
DestroyableComponent::DestroyableComponent(Entity* parent) : Component(parent) { DestroyableComponent::DestroyableComponent(Entity* parent) : Component(parent) {
m_iArmor = 0; m_iArmor = 0;
@ -467,9 +468,9 @@ bool DestroyableComponent::IsKnockbackImmune() const {
if (characterComponent != nullptr && inventoryComponent != nullptr && characterComponent->GetCurrentActivity() == eGameActivities::ACTIVITY_QUICKBUILDING) { if (characterComponent != nullptr && inventoryComponent != nullptr && characterComponent->GetCurrentActivity() == eGameActivities::ACTIVITY_QUICKBUILDING) {
const auto hasPassive = inventoryComponent->HasAnyPassive({ const auto hasPassive = inventoryComponent->HasAnyPassive({
ItemSetPassiveAbilityID::EngineerRank2, ItemSetPassiveAbilityID::EngineerRank3, eItemSetPassiveAbilityID::EngineerRank2, eItemSetPassiveAbilityID::EngineerRank3,
ItemSetPassiveAbilityID::SummonerRank2, ItemSetPassiveAbilityID::SummonerRank3, eItemSetPassiveAbilityID::SummonerRank2, eItemSetPassiveAbilityID::SummonerRank3,
ItemSetPassiveAbilityID::InventorRank2, ItemSetPassiveAbilityID::InventorRank3, eItemSetPassiveAbilityID::InventorRank2, eItemSetPassiveAbilityID::InventorRank3,
}, 5); }, 5);
if (hasPassive) { if (hasPassive) {
@ -736,12 +737,12 @@ void DestroyableComponent::Smash(const LWOOBJID source, const eKillType killType
if (memberMissions == nullptr) continue; if (memberMissions == nullptr) continue;
memberMissions->Progress(MissionTaskType::MISSION_TASK_TYPE_SMASH, m_Parent->GetLOT()); memberMissions->Progress(eMissionTaskType::SMASH, m_Parent->GetLOT());
memberMissions->Progress(MissionTaskType::MISSION_TASK_TYPE_SKILL, m_Parent->GetLOT(), skillID); memberMissions->Progress(eMissionTaskType::USE_SKILL, m_Parent->GetLOT(), skillID);
} }
} else { } else {
missions->Progress(MissionTaskType::MISSION_TASK_TYPE_SMASH, m_Parent->GetLOT()); missions->Progress(eMissionTaskType::SMASH, m_Parent->GetLOT());
missions->Progress(MissionTaskType::MISSION_TASK_TYPE_SKILL, m_Parent->GetLOT(), skillID); missions->Progress(eMissionTaskType::USE_SKILL, m_Parent->GetLOT(), skillID);
} }
} }
} }

View File

@ -28,6 +28,7 @@
#include "eItemType.h" #include "eItemType.h"
#include "eUnequippableActiveType.h" #include "eUnequippableActiveType.h"
#include "CppScripts.h" #include "CppScripts.h"
#include "eMissionTaskType.h"
InventoryComponent::InventoryComponent(Entity* parent, tinyxml2::XMLDocument* document): Component(parent) { InventoryComponent::InventoryComponent(Entity* parent, tinyxml2::XMLDocument* document): Component(parent) {
this->m_Dirty = true; 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); auto* item = new Item(lot, inventory, slot, count, config, parent, showFlyingLoot, isModMoveAndEquip, subKey, bound, lootSourceType);
if (missions != nullptr && !IsTransferInventory(inventoryType)) { 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; return;
@ -284,7 +285,7 @@ void InventoryComponent::AddItem(
} }
if (missions != nullptr && !IsTransferInventory(inventoryType)) { 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 (missionComponent != nullptr) {
if (IsTransferInventory(inventory)) { 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); 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)) { if (!item->GetBound() && !item->GetPreconditionExpression()->Check(m_Parent)) {
return; 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) { for (auto* set : m_Itemsets) {
if (set->GetEquippedCount() < equipmentRequirement) { if (set->GetEquippedCount() < equipmentRequirement) {
continue; continue;
} }
// Check if the set has any of the passive abilities // 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; return true;
} }
} }
@ -1285,15 +1286,15 @@ void InventoryComponent::RemoveDatabasePet(LWOOBJID id) {
BehaviorSlot InventoryComponent::FindBehaviorSlot(const eItemType type) { BehaviorSlot InventoryComponent::FindBehaviorSlot(const eItemType type) {
switch (type) { switch (type) {
case eItemType::ITEM_TYPE_HAT: case eItemType::HAT:
return BehaviorSlot::Head; return BehaviorSlot::Head;
case eItemType::ITEM_TYPE_NECK: case eItemType::NECK:
return BehaviorSlot::Neck; return BehaviorSlot::Neck;
case eItemType::ITEM_TYPE_LEFT_HAND: case eItemType::LEFT_HAND:
return BehaviorSlot::Offhand; return BehaviorSlot::Offhand;
case eItemType::ITEM_TYPE_RIGHT_HAND: case eItemType::RIGHT_HAND:
return BehaviorSlot::Primary; return BehaviorSlot::Primary;
case eItemType::ITEM_TYPE_CONSUMABLE: case eItemType::CONSUMABLE:
return BehaviorSlot::Consumable; return BehaviorSlot::Consumable;
default: default:
return BehaviorSlot::Invalid; return BehaviorSlot::Invalid;
@ -1343,7 +1344,7 @@ std::vector<uint32_t> InventoryComponent::FindBuffs(Item* item, bool castOnEquip
} }
if (missions != nullptr && 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. // If item is not a proxy, add its buff to the added buffs.

View File

@ -17,7 +17,7 @@
#include "DatabasePet.h" #include "DatabasePet.h"
#include "Component.h" #include "Component.h"
#include "ItemSetPassiveAbility.h" #include "ItemSetPassiveAbility.h"
#include "ItemSetPassiveAbilityID.h" #include "eItemSetPassiveAbilityID.h"
#include "PossessorComponent.h" #include "PossessorComponent.h"
#include "eInventoryType.h" #include "eInventoryType.h"
@ -291,7 +291,7 @@ public:
* @param equipmentRequirement the number of equipment required to be allowed to have the ability * @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 * @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 * Despawns the currently active pet, if any

View File

@ -18,6 +18,7 @@
#include "Mail.h" #include "Mail.h"
#include "MissionPrerequisites.h" #include "MissionPrerequisites.h"
#include "AchievementCacheKey.h" #include "AchievementCacheKey.h"
#include "eMissionState.h"
// MARK: Mission Component // 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); auto* mission = GetMission(missionId);
if (mission == nullptr) { if (mission == nullptr) {
return CanAccept(missionId) ? MissionState::MISSION_STATE_AVAILABLE : MissionState::MISSION_STATE_UNKNOWN; return CanAccept(missionId) ? eMissionState::AVAILABLE : eMissionState::UNKNOWN;
} }
return mission->GetMissionState(); return mission->GetMissionState();
@ -143,7 +144,7 @@ void MissionComponent::RemoveMission(uint32_t missionId) {
m_Missions.erase(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) { for (const auto& pair : m_Missions) {
auto* mission = pair.second; auto* mission = pair.second;
@ -215,7 +216,7 @@ void MissionComponent::ForceProgressTaskType(const uint32_t missionId, const uin
} }
for (auto* element : mission->GetTasks()) { for (auto* element : mission->GetTasks()) {
if (element->GetType() != static_cast<MissionTaskType>(taskType)) continue; if (element->GetType() != static_cast<eMissionTaskType>(taskType)) continue;
element->AddProgress(value); element->AddProgress(value);
} }
@ -253,7 +254,7 @@ void MissionComponent::ForceProgressValue(uint32_t missionId, uint32_t taskType,
} }
for (auto* element : mission->GetTasks()) { 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); element->AddProgress(1);
} }
@ -281,7 +282,7 @@ bool MissionComponent::GetMissionInfo(uint32_t missionId, CDMissions& result) {
#define MISSION_NEW_METHOD #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 #ifdef MISSION_NEW_METHOD
// Query for achievments, using the cache // Query for achievments, using the cache
const auto& result = QueryAchievements(type, value, targets); const auto& result = QueryAchievements(type, value, targets);
@ -390,7 +391,7 @@ bool MissionComponent::LookForAchievements(MissionTaskType type, int32_t value,
#endif #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 // Create a hash which represent this query for achievements
AchievementCacheKey toFind; AchievementCacheKey toFind;
toFind.SetType(type); toFind.SetType(type);
@ -484,7 +485,7 @@ bool MissionComponent::RequiresItem(const LOT lot) {
} }
for (auto* task : mission->GetTasks()) { for (auto* task : mission->GetTasks()) {
if (task->IsComplete() || task->GetType() != MissionTaskType::MISSION_TASK_TYPE_ITEM_COLLECTION) { if (task->IsComplete() || task->GetType() != eMissionTaskType::GATHER) {
continue; 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; return required;
} }

View File

@ -19,11 +19,11 @@
class AchievementCacheKey; class AchievementCacheKey;
/** /**
* The mission inventory of an entity. Tracks mission state for each mission that can be accepted and allows for * 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). * progression of each of the mission task types (see eMissionTaskType).
*/ */
class MissionComponent: public Component class MissionComponent : public Component
{ {
public: public:
static const uint32_t ComponentType = COMPONENT_TYPE_MISSION; 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 * @param missionId the ID of the mission to get the mission state for
* @return the mission state of the mission specified by the ID * @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. * 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 count the number to progress by, for example the number of items
* @param ignoreAchievements do not progress achievements * @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 * 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) * @param count the number of values to progress by (differs by task type)
* @return true if a achievement was accepted, false otherwise * @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 * 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 * @param targets optional targets to progress with
* @return list of mission IDs (achievements) that can be progressed for the given parameters * @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 * As achievements can be hard to query, we here store a list of all the mission IDs that can be unlocked for a

View File

@ -14,6 +14,7 @@
#include "dLogger.h" #include "dLogger.h"
#include "Game.h" #include "Game.h"
#include "MissionPrerequisites.h" #include "MissionPrerequisites.h"
#include "eMissionState.h"
OfferedMission::OfferedMission(const uint32_t missionId, const bool offersMission, const bool acceptsMission) { OfferedMission::OfferedMission(const uint32_t missionId, const bool offersMission, const bool acceptsMission) {
this->missionId = missionId; this->missionId = missionId;
@ -170,10 +171,10 @@ void MissionOfferComponent::OfferMissions(Entity* entity, const uint32_t specifi
for (const auto sample : randomMissionPool) { for (const auto sample : randomMissionPool) {
const auto state = missionComponent->GetMissionState(sample); const auto state = missionComponent->GetMissionState(sample);
if (state == MissionState::MISSION_STATE_ACTIVE || if (state == eMissionState::ACTIVE ||
state == MissionState::MISSION_STATE_COMPLETE_ACTIVE || state == eMissionState::COMPLETE_ACTIVE ||
state == MissionState::MISSION_STATE_READY_TO_COMPLETE || state == eMissionState::READY_TO_COMPLETE ||
state == MissionState::MISSION_STATE_COMPLETE_READY_TO_COMPLETE || state == eMissionState::COMPLETE_READY_TO_COMPLETE ||
sample == specifiedMissionId) { sample == specifiedMissionId) {
mission = missionComponent->GetMission(sample); mission = missionComponent->GetMission(sample);

View File

@ -21,6 +21,8 @@
#include "dChatFilter.h" #include "dChatFilter.h"
#include "Database.h" #include "Database.h"
#include "EntityInfo.h" #include "EntityInfo.h"
#include "eMissionTaskType.h"
std::unordered_map<LOT, PetComponent::PetPuzzleData> PetComponent::buildCache{}; std::unordered_map<LOT, PetComponent::PetPuzzleData> PetComponent::buildCache{};
std::unordered_map<LWOOBJID, LWOOBJID> PetComponent::currentActivities{}; std::unordered_map<LWOOBJID, LWOOBJID> PetComponent::currentActivities{};
@ -602,7 +604,7 @@ void PetComponent::NotifyTamingBuildSuccess(NiPoint3 position) {
auto* missionComponent = tamer->GetComponent<MissionComponent>(); auto* missionComponent = tamer->GetComponent<MissionComponent>();
if (missionComponent != nullptr) { if (missionComponent != nullptr) {
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_PET_TAMING, m_Parent->GetLOT()); missionComponent->Progress(eMissionTaskType::PET_TAMING, m_Parent->GetLOT());
} }
SetStatus(1); SetStatus(1);

View File

@ -18,6 +18,7 @@
#include "RocketLaunchpadControlComponent.h" #include "RocketLaunchpadControlComponent.h"
#include "PropertyEntranceComponent.h" #include "PropertyEntranceComponent.h"
#include "InventoryComponent.h" #include "InventoryComponent.h"
#include "eMissionTaskType.h"
#include <vector> #include <vector>
#include "CppScripts.h" #include "CppScripts.h"
@ -404,7 +405,7 @@ void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const N
}); });
// Progress place model missions // Progress place model missions
auto missionComponent = entity->GetComponent<MissionComponent>(); 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) { void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int deleteReason) {

View File

@ -15,13 +15,14 @@
#include "Player.h" #include "Player.h"
#include "PossessableComponent.h" #include "PossessableComponent.h"
#include "PossessorComponent.h" #include "PossessorComponent.h"
#include "RacingTaskParam.h" #include "eRacingTaskParam.h"
#include "Spawner.h" #include "Spawner.h"
#include "VehiclePhysicsComponent.h" #include "VehiclePhysicsComponent.h"
#include "dServer.h" #include "dServer.h"
#include "dZoneManager.h" #include "dZoneManager.h"
#include "dConfig.h" #include "dConfig.h"
#include "Loot.h" #include "Loot.h"
#include "eMissionTaskType.h"
#ifndef M_PI #ifndef M_PI
#define M_PI 3.14159265358979323846264338327950288 #define M_PI 3.14159265358979323846264338327950288
@ -395,18 +396,18 @@ void RacingControlComponent::HandleMessageBoxResponse(Entity* player,
if (missionComponent == nullptr) return; 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(eMissionTaskType::RACING, 0, (LWOOBJID)eRacingTaskParam::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, 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 solo racing is enabled OR if there are 3 players in the race, progress placement tasks.
if (m_SoloRacing || m_LoadedPlayers > 2) { 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) { 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(eMissionTaskType::RACING, dZoneManager::Instance()->GetZone()->GetWorldID(), (LWOOBJID)eRacingTaskParam::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::WIN_RACE_IN_WORLD); // Finished first place in specific world.
} }
if (data->finished == m_LoadedPlayers) { 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") { } else if (id == "ACT_RACE_EXIT_THE_RACE?" || id == "Exit") {
@ -828,7 +829,7 @@ void RacingControlComponent::Update(float deltaTime) {
if (missionComponent != nullptr) { if (missionComponent != nullptr) {
// Progress lap time tasks // 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) { if (player.lap == 3) {
m_Finished++; m_Finished++;
@ -844,7 +845,7 @@ void RacingControlComponent::Update(float deltaTime) {
raceTime, raceTime * 1000); raceTime, raceTime * 1000);
// Entire race time // 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>(); auto* characterComponent = playerEntity->GetComponent<CharacterComponent>();
if (characterComponent != nullptr) { if (characterComponent != nullptr) {

View File

@ -7,7 +7,7 @@
#include "dLogger.h" #include "dLogger.h"
#include "CharacterComponent.h" #include "CharacterComponent.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "MissionTaskType.h" #include "eMissionTaskType.h"
#include "dServer.h" #include "dServer.h"
#include "PacketUtils.h" #include "PacketUtils.h"
@ -473,12 +473,12 @@ void RebuildComponent::CompleteRebuild(Entity* user) {
auto* member = EntityManager::Instance()->GetEntity(memberId); auto* member = EntityManager::Instance()->GetEntity(memberId);
if (member) { if (member) {
auto* missionComponent = member->GetComponent<MissionComponent>(); 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{ } else{
auto* missionComponent = builder->GetComponent<MissionComponent>(); 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); LootGenerator::Instance().DropActivityLoot(builder, m_Parent, m_ActivityId, 1);
} }

View File

@ -20,6 +20,7 @@
#include "DestroyableComponent.h" #include "DestroyableComponent.h"
#include "dMessageIdentifiers.h" #include "dMessageIdentifiers.h"
#include "Loot.h" #include "Loot.h"
#include "eMissionTaskType.h"
ScriptedActivityComponent::ScriptedActivityComponent(Entity* parent, int activityID) : Component(parent) { ScriptedActivityComponent::ScriptedActivityComponent(Entity* parent, int activityID) : Component(parent) {
m_ActivityID = activityID; m_ActivityID = activityID;
@ -552,7 +553,7 @@ void ActivityInstance::StartZone() {
void ActivityInstance::RewardParticipant(Entity* participant) { void ActivityInstance::RewardParticipant(Entity* participant) {
auto* missionComponent = participant->GetComponent<MissionComponent>(); auto* missionComponent = participant->GetComponent<MissionComponent>();
if (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 // First, get the activity data

View File

@ -31,6 +31,7 @@
#include "StartSkill.h" #include "StartSkill.h"
#include "EchoStartSkill.h" #include "EchoStartSkill.h"
#include "EchoSyncSkill.h" #include "EchoSyncSkill.h"
#include "eMissionTaskType.h"
using namespace std; using namespace std;
@ -281,7 +282,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
MissionComponent* comp = entity->GetComponent<MissionComponent>(); MissionComponent* comp = entity->GetComponent<MissionComponent>();
if (comp) { if (comp) {
comp->Progress(MissionTaskType::MISSION_TASK_TYPE_SKILL, startSkill.skillID); comp->Progress(eMissionTaskType::USE_SKILL, startSkill.skillID);
} }
CDSkillBehaviorTable* skillTable = CDClientManager::Instance()->GetTable<CDSkillBehaviorTable>("SkillBehavior"); CDSkillBehaviorTable* skillTable = CDClientManager::Instance()->GetTable<CDSkillBehaviorTable>("SkillBehavior");

View File

@ -31,7 +31,9 @@
#include "LeaderboardManager.h" #include "LeaderboardManager.h"
#include "AMFFormat.h" #include "AMFFormat.h"
#include "Loot.h" #include "Loot.h"
#include "RacingTaskParam.h" #include "eRacingTaskParam.h"
#include "eMissionTaskType.h"
#include "eMissionState.h"
#include <sstream> #include <sstream>
#include <future> #include <future>
@ -3264,7 +3266,7 @@ void GameMessages::HandleClientTradeRequest(RakNet::BitStream* inStream, Entity*
// Check if the player has restricted trade access // Check if the player has restricted trade access
auto* character = entity->GetCharacter(); auto* character = entity->GetCharacter();
if (character->HasPermission(PermissionMap::RestrictedTradeAccess)) { if (character->HasPermission(ePermissionMap::RestrictedTradeAccess)) {
// Send a message to the player // Send a message to the player
ChatPackets::SendSystemMessage( ChatPackets::SendSystemMessage(
sysAddr, sysAddr,
@ -3284,7 +3286,7 @@ void GameMessages::HandleClientTradeRequest(RakNet::BitStream* inStream, Entity*
if (invitee != nullptr && invitee->IsPlayer()) { if (invitee != nullptr && invitee->IsPlayer()) {
character = invitee->GetCharacter(); character = invitee->GetCharacter();
if (character->HasPermission(PermissionMap::RestrictedTradeAccess)) { if (character->HasPermission(ePermissionMap::RestrictedTradeAccess)) {
// Send a message to the player // Send a message to the player
ChatPackets::SendSystemMessage( ChatPackets::SendSystemMessage(
sysAddr, sysAddr,
@ -4707,25 +4709,10 @@ void GameMessages::HandleBuyFromVendor(RakNet::BitStream* inStream, Entity* enti
LOT tokenId = -1; LOT tokenId = -1;
if (missionComponent->GetMissionState(545) == MissionState::MISSION_STATE_COMPLETE) // "Join Assembly!" if (missionComponent->GetMissionState(545) == eMissionState::COMPLETE) tokenId = 8318; // "Assembly Token"
{ if (missionComponent->GetMissionState(556) == eMissionState::COMPLETE) tokenId = 8321; // "Venture League Token"
tokenId = 8318; // "Assembly Token" if (missionComponent->GetMissionState(567) == eMissionState::COMPLETE) tokenId = 8319; // "Sentinels Token"
} if (missionComponent->GetMissionState(578) == eMissionState::COMPLETE) tokenId = 8320; // "Paradox Token"
if (missionComponent->GetMissionState(556) == MissionState::MISSION_STATE_COMPLETE) // "Join Venture League!"
{
tokenId = 8321; // "Venture League Token"
}
if (missionComponent->GetMissionState(567) == MissionState::MISSION_STATE_COMPLETE) // "Join The Sentinels!"
{
tokenId = 8319; // "Sentinels Token"
}
if (missionComponent->GetMissionState(578) == MissionState::MISSION_STATE_COMPLETE) // "Join Paradox!"
{
tokenId = 8320; // "Paradox Token"
}
const uint32_t altCurrencyCost = itemComp.commendationCost * count; const uint32_t altCurrencyCost = itemComp.commendationCost * count;
@ -5031,8 +5018,8 @@ void GameMessages::HandleRequestUse(RakNet::BitStream* inStream, Entity* entity,
if (missionComponent == nullptr) return; if (missionComponent == nullptr) return;
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_MISSION_INTERACTION, interactedObject->GetLOT(), interactedObject->GetObjectID()); missionComponent->Progress(eMissionTaskType::TALK_TO_NPC, interactedObject->GetLOT(), interactedObject->GetObjectID());
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_NON_MISSION_INTERACTION, interactedObject->GetLOT(), interactedObject->GetObjectID()); missionComponent->Progress(eMissionTaskType::INTERACT, interactedObject->GetLOT(), interactedObject->GetObjectID());
} }
void GameMessages::HandlePlayEmote(RakNet::BitStream* inStream, Entity* entity) { void GameMessages::HandlePlayEmote(RakNet::BitStream* inStream, Entity* entity) {
@ -5059,7 +5046,7 @@ void GameMessages::HandlePlayEmote(RakNet::BitStream* inStream, Entity* entity)
if (targetEntity != nullptr) { if (targetEntity != nullptr) {
targetEntity->OnEmoteReceived(emoteID, entity); targetEntity->OnEmoteReceived(emoteID, entity);
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_EMOTE, emoteID, targetID); missionComponent->Progress(eMissionTaskType::EMOTE, emoteID, targetID);
} }
} else { } else {
Game::logger->LogDebug("GameMessages", "Target ID is empty, using backup"); Game::logger->LogDebug("GameMessages", "Target ID is empty, using backup");
@ -5071,7 +5058,7 @@ void GameMessages::HandlePlayEmote(RakNet::BitStream* inStream, Entity* entity)
if (Vector3::DistanceSquared(scripted->GetPosition(), referencePoint) > 5.0f * 5.0f) continue; if (Vector3::DistanceSquared(scripted->GetPosition(), referencePoint) > 5.0f * 5.0f) continue;
scripted->OnEmoteReceived(emoteID, entity); scripted->OnEmoteReceived(emoteID, entity);
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_EMOTE, emoteID, scripted->GetObjectID()); missionComponent->Progress(eMissionTaskType::EMOTE, emoteID, scripted->GetObjectID());
} }
} }
@ -5163,7 +5150,7 @@ void GameMessages::HandleRespondToMission(RakNet::BitStream* inStream, Entity* e
void GameMessages::HandleMissionDialogOK(RakNet::BitStream* inStream, Entity* entity) { void GameMessages::HandleMissionDialogOK(RakNet::BitStream* inStream, Entity* entity) {
bool bIsComplete{}; bool bIsComplete{};
MissionState iMissionState{}; eMissionState iMissionState{};
int missionID{}; int missionID{};
LWOOBJID responder{}; LWOOBJID responder{};
Entity* player = nullptr; Entity* player = nullptr;
@ -5185,9 +5172,9 @@ void GameMessages::HandleMissionDialogOK(RakNet::BitStream* inStream, Entity* en
return; return;
} }
if (iMissionState == MissionState::MISSION_STATE_AVAILABLE || iMissionState == MissionState::MISSION_STATE_COMPLETE_AVAILABLE) { if (iMissionState == eMissionState::AVAILABLE || iMissionState == eMissionState::COMPLETE_AVAILABLE) {
missionComponent->AcceptMission(missionID); missionComponent->AcceptMission(missionID);
} else if (iMissionState == MissionState::MISSION_STATE_READY_TO_COMPLETE || iMissionState == MissionState::MISSION_STATE_COMPLETE_READY_TO_COMPLETE) { } else if (iMissionState == eMissionState::READY_TO_COMPLETE || iMissionState == eMissionState::COMPLETE_READY_TO_COMPLETE) {
missionComponent->CompleteMission(missionID); missionComponent->CompleteMission(missionID);
} }
} }
@ -5219,7 +5206,7 @@ void GameMessages::HandleHasBeenCollected(RakNet::BitStream* inStream, Entity* e
MissionComponent* missionComponent = static_cast<MissionComponent*>(player->GetComponent(COMPONENT_TYPE_MISSION)); MissionComponent* missionComponent = static_cast<MissionComponent*>(player->GetComponent(COMPONENT_TYPE_MISSION));
if (missionComponent) { if (missionComponent) {
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_ENVIRONMENT, entity->GetLOT(), entity->GetObjectID()); missionComponent->Progress(eMissionTaskType::COLLECTION, entity->GetLOT(), entity->GetObjectID());
} }
} }
@ -5438,7 +5425,7 @@ void GameMessages::HandleRemoveItemFromInventory(RakNet::BitStream* inStream, En
auto* missionComponent = entity->GetComponent<MissionComponent>(); auto* missionComponent = entity->GetComponent<MissionComponent>();
if (missionComponent != nullptr) { if (missionComponent != nullptr) {
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_ITEM_COLLECTION, item->GetLot(), LWOOBJID_EMPTY, "", -iStackCount); missionComponent->Progress(eMissionTaskType::GATHER, item->GetLot(), LWOOBJID_EMPTY, "", -iStackCount);
} }
} }
} }
@ -5593,8 +5580,8 @@ void GameMessages::HandleModularBuildFinish(RakNet::BitStream* inStream, Entity*
if (entity->GetLOT() != 9980 || Game::server->GetZoneID() != 1200) { if (entity->GetLOT() != 9980 || Game::server->GetZoneID() != 1200) {
if (missionComponent != nullptr) { if (missionComponent != nullptr) {
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_SCRIPT, entity->GetLOT(), entity->GetObjectID()); missionComponent->Progress(eMissionTaskType::SCRIPT, entity->GetLOT(), entity->GetObjectID());
if (count >= 7 && everyPieceSwapped) missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_RACING, LWOOBJID_EMPTY, (LWOOBJID)RacingTaskParam::RACING_TASK_PARAM_MODULAR_BUILDING); if (count >= 7 && everyPieceSwapped) missionComponent->Progress(eMissionTaskType::RACING, LWOOBJID_EMPTY, (LWOOBJID)eRacingTaskParam::MODULAR_BUILDING);
} }
} }
} }
@ -5826,7 +5813,7 @@ void GameMessages::HandleClientItemConsumed(RakNet::BitStream* inStream, Entity*
auto* missions = static_cast<MissionComponent*>(entity->GetComponent(COMPONENT_TYPE_MISSION)); auto* missions = static_cast<MissionComponent*>(entity->GetComponent(COMPONENT_TYPE_MISSION));
if (missions != nullptr) { if (missions != nullptr) {
missions->Progress(MissionTaskType::MISSION_TASK_TYPE_FOOD, itemLot); missions->Progress(eMissionTaskType::USE_ITEM, itemLot);
} }
} }

View File

@ -231,41 +231,42 @@ eInventoryType Inventory::FindInventoryTypeForLot(const LOT lot) {
const auto itemType = static_cast<eItemType>(itemComponent.itemType); const auto itemType = static_cast<eItemType>(itemComponent.itemType);
switch (itemType) { switch (itemType) {
case eItemType::ITEM_TYPE_BRICK: case eItemType::BRICK:
return BRICKS; return BRICKS;
case eItemType::ITEM_TYPE_BEHAVIOR: case eItemType::BEHAVIOR:
return BEHAVIORS; return BEHAVIORS;
case eItemType::ITEM_TYPE_PROPERTY: case eItemType::PROPERTY:
return PROPERTY_DEEDS; return PROPERTY_DEEDS;
case eItemType::ITEM_TYPE_MODEL: case eItemType::MODEL:
case eItemType::ITEM_TYPE_VEHICLE: case eItemType::VEHICLE:
case eItemType::ITEM_TYPE_LOOT_MODEL: case eItemType::LOOT_MODEL:
case eItemType::ITEM_TYPE_MOUNT: case eItemType::LUP_MODEL:
case eItemType::MOUNT:
return MODELS; return MODELS;
case eItemType::ITEM_TYPE_HAT: case eItemType::HAT:
case eItemType::ITEM_TYPE_HAIR: case eItemType::HAIR:
case eItemType::ITEM_TYPE_NECK: case eItemType::NECK:
case eItemType::ITEM_TYPE_LEFT_HAND: case eItemType::LEFT_HAND:
case eItemType::ITEM_TYPE_RIGHT_HAND: case eItemType::RIGHT_HAND:
case eItemType::ITEM_TYPE_LEGS: case eItemType::LEGS:
case eItemType::ITEM_TYPE_LEFT_TRINKET: case eItemType::LEFT_TRINKET:
case eItemType::ITEM_TYPE_RIGHT_TRINKET: case eItemType::RIGHT_TRINKET:
case eItemType::ITEM_TYPE_COLLECTIBLE: case eItemType::COLLECTIBLE:
case eItemType::ITEM_TYPE_CONSUMABLE: case eItemType::CONSUMABLE:
case eItemType::ITEM_TYPE_CHEST: case eItemType::CHEST:
case eItemType::ITEM_TYPE_EGG: case eItemType::EGG:
case eItemType::ITEM_TYPE_PET_FOOD: case eItemType::PET_FOOD:
case eItemType::ITEM_TYPE_PET_INVENTORY_ITEM: case eItemType::PET_INVENTORY_ITEM:
case eItemType::ITEM_TYPE_PACKAGE: case eItemType::PACKAGE:
case eItemType::ITEM_TYPE_CURRENCY:
return ITEMS; return ITEMS;
case eItemType::ITEM_TYPE_QUEST_OBJECT: case eItemType::QUEST_OBJECT:
case eItemType::ITEM_TYPE_UNKNOWN: case eItemType::UNKNOWN:
default: default:
return QUEST; return QUEST;
} }

View File

@ -76,7 +76,7 @@ Item::Item(
const auto type = static_cast<eItemType>(info->itemType); const auto type = static_cast<eItemType>(info->itemType);
if (type == eItemType::ITEM_TYPE_MOUNT) { if (type == eItemType::MOUNT) {
id = GeneralUtils::SetBit(id, OBJECT_BIT_CLIENT); id = GeneralUtils::SetBit(id, OBJECT_BIT_CLIENT);
} }
@ -283,10 +283,10 @@ void Item::UseNonEquip(Item* item) {
} }
const auto type = static_cast<eItemType>(info->itemType); const auto type = static_cast<eItemType>(info->itemType);
if (type == eItemType::ITEM_TYPE_MOUNT) { if (type == eItemType::MOUNT) {
playerInventoryComponent->HandlePossession(this); playerInventoryComponent->HandlePossession(this);
// TODO Check if mounts are allowed to be spawned // TODO Check if mounts are allowed to be spawned
} else if (type == eItemType::ITEM_TYPE_PET_INVENTORY_ITEM && subKey != LWOOBJID_EMPTY) { } else if (type == eItemType::PET_INVENTORY_ITEM && subKey != LWOOBJID_EMPTY) {
const auto& databasePet = playerInventoryComponent->GetDatabasePet(subKey); const auto& databasePet = playerInventoryComponent->GetDatabasePet(subKey);
if (databasePet.lot != LOT_NULL) { if (databasePet.lot != LOT_NULL) {
playerInventoryComponent->SpawnPet(this); playerInventoryComponent->SpawnPet(this);

View File

@ -6,6 +6,7 @@
#include "CDClientDatabase.h" #include "CDClientDatabase.h"
#include "Game.h" #include "Game.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "eMissionTaskType.h"
#include <algorithm> #include <algorithm>
ItemSet::ItemSet(const uint32_t id, InventoryComponent* inventoryComponent) { ItemSet::ItemSet(const uint32_t id, InventoryComponent* inventoryComponent) {
@ -130,7 +131,7 @@ void ItemSet::OnEquip(const LOT lot) {
const auto behaviorId = skillTable->GetSkillByID(skill).behaviorID; const auto behaviorId = skillTable->GetSkillByID(skill).behaviorID;
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_SKILL, skill); missionComponent->Progress(eMissionTaskType::USE_SKILL, skill);
skillComponent->HandleUnmanaged(behaviorId, m_InventoryComponent->GetParent()->GetObjectID()); skillComponent->HandleUnmanaged(behaviorId, m_InventoryComponent->GetParent()->GetObjectID());
} }

View File

@ -3,7 +3,7 @@
#include "DestroyableComponent.h" #include "DestroyableComponent.h"
#include "SkillComponent.h" #include "SkillComponent.h"
#include "ItemSet.h" #include "ItemSet.h"
#include "ItemSetPassiveAbilityID.h" #include "eItemSetPassiveAbilityID.h"
ItemSetPassiveAbility::ItemSetPassiveAbility(PassiveAbilityTrigger trigger, Entity* parent, ItemSet* itemSet) { ItemSetPassiveAbility::ItemSetPassiveAbility(PassiveAbilityTrigger trigger, Entity* parent, ItemSet* itemSet) {
m_Trigger = trigger; m_Trigger = trigger;
@ -46,31 +46,31 @@ void ItemSetPassiveAbility::Activate(Entity* target) {
EntityManager::Instance()->SerializeEntity(m_Parent); EntityManager::Instance()->SerializeEntity(m_Parent);
const auto id = static_cast<ItemSetPassiveAbilityID>(m_ItemSet->GetID()); const auto id = static_cast<eItemSetPassiveAbilityID>(m_ItemSet->GetID());
const auto parentID = m_Parent->GetObjectID(); const auto parentID = m_Parent->GetObjectID();
const auto equippedCount = m_ItemSet->GetEquippedCount(); const auto equippedCount = m_ItemSet->GetEquippedCount();
switch (id) { switch (id) {
// Assembly // Assembly
case ItemSetPassiveAbilityID::InventorRank1: case eItemSetPassiveAbilityID::InventorRank1:
case ItemSetPassiveAbilityID::SummonerRank1: case eItemSetPassiveAbilityID::SummonerRank1:
case ItemSetPassiveAbilityID::EngineerRank1: { case eItemSetPassiveAbilityID::EngineerRank1: {
if (equippedCount < 4) return; if (equippedCount < 4) return;
m_Cooldown = 11.0f; m_Cooldown = 11.0f;
skillComponent->CalculateBehavior(394, 4401, parentID); skillComponent->CalculateBehavior(394, 4401, parentID);
break; break;
} }
case ItemSetPassiveAbilityID::InventorRank2: case eItemSetPassiveAbilityID::InventorRank2:
case ItemSetPassiveAbilityID::SummonerRank2: case eItemSetPassiveAbilityID::SummonerRank2:
case ItemSetPassiveAbilityID::EngineerRank2: { case eItemSetPassiveAbilityID::EngineerRank2: {
if (equippedCount < 4) return; if (equippedCount < 4) return;
m_Cooldown = 11.0f; m_Cooldown = 11.0f;
skillComponent->CalculateBehavior(581, 9433, parentID); skillComponent->CalculateBehavior(581, 9433, parentID);
break; break;
} }
case ItemSetPassiveAbilityID::InventorRank3: case eItemSetPassiveAbilityID::InventorRank3:
case ItemSetPassiveAbilityID::SummonerRank3: case eItemSetPassiveAbilityID::SummonerRank3:
case ItemSetPassiveAbilityID::EngineerRank3: { case eItemSetPassiveAbilityID::EngineerRank3: {
if (equippedCount < 4) return; if (equippedCount < 4) return;
m_Cooldown = 11.0f; m_Cooldown = 11.0f;
skillComponent->CalculateBehavior(582, 9435, parentID); skillComponent->CalculateBehavior(582, 9435, parentID);
@ -78,57 +78,57 @@ void ItemSetPassiveAbility::Activate(Entity* target) {
} }
// Sentinel // Sentinel
case ItemSetPassiveAbilityID::KnightRank1: { case eItemSetPassiveAbilityID::KnightRank1: {
if (equippedCount < 4) return; if (equippedCount < 4) return;
m_Cooldown = 11.0f; m_Cooldown = 11.0f;
skillComponent->CalculateBehavior(559, 8884, parentID); skillComponent->CalculateBehavior(559, 8884, parentID);
break; break;
} }
case ItemSetPassiveAbilityID::KnightRank2: { case eItemSetPassiveAbilityID::KnightRank2: {
if (equippedCount < 4) return; if (equippedCount < 4) return;
m_Cooldown = 11.0f; m_Cooldown = 11.0f;
skillComponent->CalculateBehavior(560, 8885, parentID); skillComponent->CalculateBehavior(560, 8885, parentID);
break; break;
} }
case ItemSetPassiveAbilityID::KnightRank3: { case eItemSetPassiveAbilityID::KnightRank3: {
if (equippedCount < 4) return; if (equippedCount < 4) return;
m_Cooldown = 11.0f; m_Cooldown = 11.0f;
skillComponent->CalculateBehavior(561, 8890, parentID); skillComponent->CalculateBehavior(561, 8890, parentID);
break; break;
} }
case ItemSetPassiveAbilityID::SpaceRangerRank1: { case eItemSetPassiveAbilityID::SpaceRangerRank1: {
if (equippedCount < 4) return; if (equippedCount < 4) return;
m_Cooldown = 11.0f; m_Cooldown = 11.0f;
skillComponent->CalculateBehavior(1101, 24612, parentID); skillComponent->CalculateBehavior(1101, 24612, parentID);
break; break;
} }
case ItemSetPassiveAbilityID::SpaceRangerRank2: { case eItemSetPassiveAbilityID::SpaceRangerRank2: {
if (equippedCount < 4) return; if (equippedCount < 4) return;
m_Cooldown = 11.0f; m_Cooldown = 11.0f;
skillComponent->CalculateBehavior(1102, 24617, parentID); skillComponent->CalculateBehavior(1102, 24617, parentID);
break; break;
} }
case ItemSetPassiveAbilityID::SpaceRangerRank3: { case eItemSetPassiveAbilityID::SpaceRangerRank3: {
if (equippedCount < 4) return; if (equippedCount < 4) return;
m_Cooldown = 11.0f; m_Cooldown = 11.0f;
skillComponent->CalculateBehavior(1103, 24622, parentID); skillComponent->CalculateBehavior(1103, 24622, parentID);
break; break;
} }
case ItemSetPassiveAbilityID::SamuraiRank1: { case eItemSetPassiveAbilityID::SamuraiRank1: {
if (equippedCount < 4) return; if (equippedCount < 4) return;
m_Cooldown = 11.0f; m_Cooldown = 11.0f;
skillComponent->CalculateBehavior(562, 8899, parentID); skillComponent->CalculateBehavior(562, 8899, parentID);
break; break;
} }
case ItemSetPassiveAbilityID::SamuraiRank2: { case eItemSetPassiveAbilityID::SamuraiRank2: {
if (equippedCount < 4) return; if (equippedCount < 4) return;
m_Cooldown = 11.0f; m_Cooldown = 11.0f;
skillComponent->CalculateBehavior(563, 8904, parentID); skillComponent->CalculateBehavior(563, 8904, parentID);
break; break;
} }
case ItemSetPassiveAbilityID::SamuraiRank3: { case eItemSetPassiveAbilityID::SamuraiRank3: {
if (equippedCount < 4) return; if (equippedCount < 4) return;
m_Cooldown = 11.0f; m_Cooldown = 11.0f;
skillComponent->CalculateBehavior(564, 8909, parentID); skillComponent->CalculateBehavior(564, 8909, parentID);
@ -143,47 +143,47 @@ void ItemSetPassiveAbility::Activate(Entity* target) {
std::vector<ItemSetPassiveAbility> ItemSetPassiveAbility::FindAbilities(uint32_t itemSetID, Entity* parent, ItemSet* itemSet) { std::vector<ItemSetPassiveAbility> ItemSetPassiveAbility::FindAbilities(uint32_t itemSetID, Entity* parent, ItemSet* itemSet) {
std::vector<ItemSetPassiveAbility> abilities; std::vector<ItemSetPassiveAbility> abilities;
switch (static_cast<ItemSetPassiveAbilityID>(itemSetID)) { switch (static_cast<eItemSetPassiveAbilityID>(itemSetID)) {
// Assembly // Assembly
case ItemSetPassiveAbilityID::SummonerRank1: case eItemSetPassiveAbilityID::SummonerRank1:
case ItemSetPassiveAbilityID::SummonerRank2: case eItemSetPassiveAbilityID::SummonerRank2:
case ItemSetPassiveAbilityID::SummonerRank3: case eItemSetPassiveAbilityID::SummonerRank3:
case ItemSetPassiveAbilityID::InventorRank1: case eItemSetPassiveAbilityID::InventorRank1:
case ItemSetPassiveAbilityID::InventorRank2: case eItemSetPassiveAbilityID::InventorRank2:
case ItemSetPassiveAbilityID::InventorRank3: case eItemSetPassiveAbilityID::InventorRank3:
case ItemSetPassiveAbilityID::EngineerRank1: case eItemSetPassiveAbilityID::EngineerRank1:
case ItemSetPassiveAbilityID::EngineerRank2: case eItemSetPassiveAbilityID::EngineerRank2:
case ItemSetPassiveAbilityID::EngineerRank3: { case eItemSetPassiveAbilityID::EngineerRank3: {
abilities.emplace_back(PassiveAbilityTrigger::AssemblyImagination, parent, itemSet); abilities.emplace_back(PassiveAbilityTrigger::AssemblyImagination, parent, itemSet);
break; break;
} }
// Sentinel // Sentinel
case ItemSetPassiveAbilityID::KnightRank1: case eItemSetPassiveAbilityID::KnightRank1:
case ItemSetPassiveAbilityID::KnightRank2: case eItemSetPassiveAbilityID::KnightRank2:
case ItemSetPassiveAbilityID::KnightRank3: case eItemSetPassiveAbilityID::KnightRank3:
case ItemSetPassiveAbilityID::SpaceRangerRank1: case eItemSetPassiveAbilityID::SpaceRangerRank1:
case ItemSetPassiveAbilityID::SpaceRangerRank2: case eItemSetPassiveAbilityID::SpaceRangerRank2:
case ItemSetPassiveAbilityID::SpaceRangerRank3: case eItemSetPassiveAbilityID::SpaceRangerRank3:
case ItemSetPassiveAbilityID::SamuraiRank1: case eItemSetPassiveAbilityID::SamuraiRank1:
case ItemSetPassiveAbilityID::SamuraiRank2: case eItemSetPassiveAbilityID::SamuraiRank2:
case ItemSetPassiveAbilityID::SamuraiRank3: { case eItemSetPassiveAbilityID::SamuraiRank3: {
abilities.emplace_back(PassiveAbilityTrigger::SentinelArmor, parent, itemSet); abilities.emplace_back(PassiveAbilityTrigger::SentinelArmor, parent, itemSet);
abilities.emplace_back(PassiveAbilityTrigger::EnemySmashed, parent, itemSet); abilities.emplace_back(PassiveAbilityTrigger::EnemySmashed, parent, itemSet);
break; break;
} }
// Paradox // Paradox
case ItemSetPassiveAbilityID::BatLord: case eItemSetPassiveAbilityID::BatLord:
case ItemSetPassiveAbilityID::SpaceMarauderRank1: case eItemSetPassiveAbilityID::SpaceMarauderRank1:
case ItemSetPassiveAbilityID::SpaceMarauderRank2: case eItemSetPassiveAbilityID::SpaceMarauderRank2:
case ItemSetPassiveAbilityID::SpaceMarauderRank3: case eItemSetPassiveAbilityID::SpaceMarauderRank3:
case ItemSetPassiveAbilityID::SorcererRank1: case eItemSetPassiveAbilityID::SorcererRank1:
case ItemSetPassiveAbilityID::SorcererRank2: case eItemSetPassiveAbilityID::SorcererRank2:
case ItemSetPassiveAbilityID::SorcererRank3: case eItemSetPassiveAbilityID::SorcererRank3:
case ItemSetPassiveAbilityID::ShinobiRank1: case eItemSetPassiveAbilityID::ShinobiRank1:
case ItemSetPassiveAbilityID::ShinobiRank2: case eItemSetPassiveAbilityID::ShinobiRank2:
case ItemSetPassiveAbilityID::ShinobiRank3: { case eItemSetPassiveAbilityID::ShinobiRank3: {
abilities.emplace_back(PassiveAbilityTrigger::EnemySmashed, parent, itemSet); abilities.emplace_back(PassiveAbilityTrigger::EnemySmashed, parent, itemSet);
break; break;
@ -205,110 +205,110 @@ void ItemSetPassiveAbility::OnEnemySmshed(Entity* target) {
EntityManager::Instance()->SerializeEntity(m_Parent); EntityManager::Instance()->SerializeEntity(m_Parent);
const auto id = static_cast<ItemSetPassiveAbilityID>(m_ItemSet->GetID()); const auto id = static_cast<eItemSetPassiveAbilityID>(m_ItemSet->GetID());
const auto parentID = m_Parent->GetObjectID(); const auto parentID = m_Parent->GetObjectID();
const auto equippedCount = m_ItemSet->GetEquippedCount(); const auto equippedCount = m_ItemSet->GetEquippedCount();
switch (id) { switch (id) {
// Bat Lord // Bat Lord
case ItemSetPassiveAbilityID::BatLord: { case eItemSetPassiveAbilityID::BatLord: {
if (equippedCount < 5) return; if (equippedCount < 5) return;
destroyableComponent->Heal(3); destroyableComponent->Heal(3);
break; break;
} }
// Sentinel // Sentinel
case ItemSetPassiveAbilityID::KnightRank1: { case eItemSetPassiveAbilityID::KnightRank1: {
if (equippedCount < 5) return; if (equippedCount < 5) return;
destroyableComponent->Repair(1); destroyableComponent->Repair(1);
break; break;
} }
case ItemSetPassiveAbilityID::KnightRank2: { case eItemSetPassiveAbilityID::KnightRank2: {
if (equippedCount < 5) return; if (equippedCount < 5) return;
destroyableComponent->Repair(1); destroyableComponent->Repair(1);
break; break;
} }
case ItemSetPassiveAbilityID::KnightRank3: { case eItemSetPassiveAbilityID::KnightRank3: {
if (equippedCount < 5) return; if (equippedCount < 5) return;
destroyableComponent->Repair(1); destroyableComponent->Repair(1);
break; break;
} }
case ItemSetPassiveAbilityID::SpaceRangerRank1: { case eItemSetPassiveAbilityID::SpaceRangerRank1: {
if (equippedCount < 5) return; if (equippedCount < 5) return;
destroyableComponent->Repair(1); destroyableComponent->Repair(1);
break; break;
} }
case ItemSetPassiveAbilityID::SpaceRangerRank2: { case eItemSetPassiveAbilityID::SpaceRangerRank2: {
if (equippedCount < 5) return; if (equippedCount < 5) return;
destroyableComponent->Repair(1); destroyableComponent->Repair(1);
break; break;
} }
case ItemSetPassiveAbilityID::SpaceRangerRank3: { case eItemSetPassiveAbilityID::SpaceRangerRank3: {
if (equippedCount < 5) return; if (equippedCount < 5) return;
destroyableComponent->Repair(1); destroyableComponent->Repair(1);
break; break;
} }
case ItemSetPassiveAbilityID::SamuraiRank1: { case eItemSetPassiveAbilityID::SamuraiRank1: {
if (equippedCount < 5) return; if (equippedCount < 5) return;
destroyableComponent->Repair(1); destroyableComponent->Repair(1);
break; break;
} }
case ItemSetPassiveAbilityID::SamuraiRank2: { case eItemSetPassiveAbilityID::SamuraiRank2: {
if (equippedCount < 5) return; if (equippedCount < 5) return;
destroyableComponent->Repair(1); destroyableComponent->Repair(1);
break; break;
} }
case ItemSetPassiveAbilityID::SamuraiRank3: { case eItemSetPassiveAbilityID::SamuraiRank3: {
if (equippedCount < 5) return; if (equippedCount < 5) return;
destroyableComponent->Repair(1); destroyableComponent->Repair(1);
break; break;
} }
// Paradox // Paradox
case ItemSetPassiveAbilityID::SpaceMarauderRank1: { case eItemSetPassiveAbilityID::SpaceMarauderRank1: {
if (equippedCount < 4) return; if (equippedCount < 4) return;
destroyableComponent->Imagine(1); destroyableComponent->Imagine(1);
break; break;
} }
case ItemSetPassiveAbilityID::SpaceMarauderRank2: { case eItemSetPassiveAbilityID::SpaceMarauderRank2: {
if (equippedCount < 4) return; if (equippedCount < 4) return;
destroyableComponent->Imagine(2); destroyableComponent->Imagine(2);
break; break;
} }
case ItemSetPassiveAbilityID::SpaceMarauderRank3: { case eItemSetPassiveAbilityID::SpaceMarauderRank3: {
if (equippedCount < 4) return; if (equippedCount < 4) return;
destroyableComponent->Imagine(3); destroyableComponent->Imagine(3);
break; break;
} }
case ItemSetPassiveAbilityID::ShinobiRank1: { case eItemSetPassiveAbilityID::ShinobiRank1: {
if (equippedCount < 4) return; if (equippedCount < 4) return;
destroyableComponent->Imagine(1); destroyableComponent->Imagine(1);
break; break;
} }
case ItemSetPassiveAbilityID::ShinobiRank2: { case eItemSetPassiveAbilityID::ShinobiRank2: {
if (equippedCount < 4) return; if (equippedCount < 4) return;
destroyableComponent->Imagine(2); destroyableComponent->Imagine(2);
break; break;
} }
case ItemSetPassiveAbilityID::ShinobiRank3: { case eItemSetPassiveAbilityID::ShinobiRank3: {
if (equippedCount < 4 || !target) return; if (equippedCount < 4) return;
skillComponent->CalculateBehavior(695, 11399, target->GetObjectID()); destroyableComponent->Imagine(3);
break; break;
} }
case ItemSetPassiveAbilityID::SorcererRank1: { case eItemSetPassiveAbilityID::SorcererRank1: {
if (equippedCount < 4) return; if (equippedCount < 4) return;
destroyableComponent->Imagine(1); destroyableComponent->Imagine(1);
break; break;
} }
case ItemSetPassiveAbilityID::SorcererRank2: { case eItemSetPassiveAbilityID::SorcererRank2: {
if (equippedCount < 4) return; if (equippedCount < 4) return;
destroyableComponent->Imagine(2); destroyableComponent->Imagine(2);
break; break;
} }
case ItemSetPassiveAbilityID::SorcererRank3: { case eItemSetPassiveAbilityID::SorcererRank3: {
if (equippedCount < 4) return; if (equippedCount < 4) return;
destroyableComponent->Imagine(3); destroyableComponent->Imagine(3);
break; break;

View File

@ -12,7 +12,7 @@
#include "GameMessages.h" #include "GameMessages.h"
#include "Mail.h" #include "Mail.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "RacingTaskParam.h" #include "eRacingTaskParam.h"
#include "dLogger.h" #include "dLogger.h"
#include "dServer.h" #include "dServer.h"
#include "dZoneManager.h" #include "dZoneManager.h"
@ -20,6 +20,10 @@
#include "User.h" #include "User.h"
#include "Database.h" #include "Database.h"
#include "WorldConfig.h" #include "WorldConfig.h"
#include "eMissionState.h"
#include "eMissionTaskType.h"
#include "eMissionLockState.h"
Mission::Mission(MissionComponent* missionComponent, const uint32_t missionId) { Mission::Mission(MissionComponent* missionComponent, const uint32_t missionId) {
m_MissionComponent = missionComponent; m_MissionComponent = missionComponent;
@ -32,7 +36,7 @@ Mission::Mission(MissionComponent* missionComponent, const uint32_t missionId) {
m_Reward = 0; m_Reward = 0;
m_State = MissionState::MISSION_STATE_UNKNOWN; m_State = eMissionState::UNKNOWN;
auto* missionsTable = CDClientManager::Instance()->GetTable<CDMissionsTable>("Missions"); auto* missionsTable = CDClientManager::Instance()->GetTable<CDMissionsTable>("Missions");
@ -60,7 +64,7 @@ Mission::Mission(MissionComponent* missionComponent, const uint32_t missionId) {
void Mission::LoadFromXml(tinyxml2::XMLElement* element) { void Mission::LoadFromXml(tinyxml2::XMLElement* element) {
// Start custom XML // Start custom XML
if (element->Attribute("state") != nullptr) { if (element->Attribute("state") != nullptr) {
m_State = static_cast<MissionState>(std::stoul(element->Attribute("state"))); m_State = static_cast<eMissionState>(std::stoul(element->Attribute("state")));
} }
// End custom XML // End custom XML
@ -85,8 +89,8 @@ void Mission::LoadFromXml(tinyxml2::XMLElement* element) {
const auto type = m_Tasks[index]->GetType(); const auto type = m_Tasks[index]->GetType();
if (type == MissionTaskType::MISSION_TASK_TYPE_ENVIRONMENT || if (type == eMissionTaskType::COLLECTION ||
type == MissionTaskType::MISSION_TASK_TYPE_VISIT_PROPERTY) { type == eMissionTaskType::VISIT_PROPERTY) {
std::vector<uint32_t> uniques; std::vector<uint32_t> uniques;
const auto value = std::stoul(task->Attribute("v")); const auto value = std::stoul(task->Attribute("v"));
@ -100,7 +104,7 @@ void Mission::LoadFromXml(tinyxml2::XMLElement* element) {
uniques.push_back(unique); uniques.push_back(unique);
if (m_MissionComponent != nullptr && type == MissionTaskType::MISSION_TASK_TYPE_ENVIRONMENT) { if (m_MissionComponent != nullptr && type == eMissionTaskType::COLLECTION) {
m_MissionComponent->AddCollectible(unique); m_MissionComponent->AddCollectible(unique);
} }
@ -144,8 +148,8 @@ void Mission::UpdateXml(tinyxml2::XMLElement* element) {
} }
for (auto* task : m_Tasks) { for (auto* task : m_Tasks) {
if (task->GetType() == MissionTaskType::MISSION_TASK_TYPE_ENVIRONMENT || if (task->GetType() == eMissionTaskType::COLLECTION ||
task->GetType() == MissionTaskType::MISSION_TASK_TYPE_VISIT_PROPERTY) { task->GetType() == eMissionTaskType::VISIT_PROPERTY) {
auto* child = element->GetDocument()->NewElement("sv"); auto* child = element->GetDocument()->NewElement("sv");
@ -229,7 +233,7 @@ std::vector<MissionTask*> Mission::GetTasks() const {
return m_Tasks; return m_Tasks;
} }
MissionState Mission::GetMissionState() const { eMissionState Mission::GetMissionState() const {
return m_State; return m_State;
} }
@ -246,47 +250,47 @@ bool Mission::IsRepeatable() const {
} }
bool Mission::IsComplete() const { bool Mission::IsComplete() const {
return m_State == MissionState::MISSION_STATE_COMPLETE; return m_State == eMissionState::COMPLETE;
} }
bool Mission::IsActive() const { bool Mission::IsActive() const {
return m_State == MissionState::MISSION_STATE_ACTIVE || m_State == MissionState::MISSION_STATE_COMPLETE_AVAILABLE; return m_State == eMissionState::ACTIVE || m_State == eMissionState::COMPLETE_AVAILABLE;
} }
void Mission::MakeActive() { void Mission::MakeActive() {
SetMissionState(m_Completions == 0 ? MissionState::MISSION_STATE_ACTIVE : MissionState::MISSION_STATE_COMPLETE_ACTIVE); SetMissionState(m_Completions == 0 ? eMissionState::ACTIVE : eMissionState::COMPLETE_ACTIVE);
} }
bool Mission::IsReadyToComplete() const { bool Mission::IsReadyToComplete() const {
return m_State == MissionState::MISSION_STATE_READY_TO_COMPLETE || m_State == MissionState::MISSION_STATE_COMPLETE_READY_TO_COMPLETE; return m_State == eMissionState::READY_TO_COMPLETE || m_State == eMissionState::COMPLETE_READY_TO_COMPLETE;
} }
void Mission::MakeReadyToComplete() { void Mission::MakeReadyToComplete() {
SetMissionState(m_Completions == 0 ? MissionState::MISSION_STATE_READY_TO_COMPLETE : MissionState::MISSION_STATE_COMPLETE_READY_TO_COMPLETE); SetMissionState(m_Completions == 0 ? eMissionState::READY_TO_COMPLETE : eMissionState::COMPLETE_READY_TO_COMPLETE);
} }
bool Mission::IsAvalible() const { bool Mission::IsAvalible() const {
return m_State == MissionState::MISSION_STATE_AVAILABLE || m_State == MissionState::MISSION_STATE_COMPLETE_AVAILABLE; return m_State == eMissionState::AVAILABLE || m_State == eMissionState::COMPLETE_AVAILABLE;
} }
bool Mission::IsFetchMission() const { bool Mission::IsFetchMission() const {
return m_Tasks.size() == 1 && m_Tasks[0]->GetType() == MissionTaskType::MISSION_TASK_TYPE_MISSION_INTERACTION; return m_Tasks.size() == 1 && m_Tasks[0]->GetType() == eMissionTaskType::TALK_TO_NPC;
} }
void Mission::MakeAvalible() { void Mission::MakeAvalible() {
SetMissionState(m_Completions == 0 ? MissionState::MISSION_STATE_AVAILABLE : MissionState::MISSION_STATE_COMPLETE_AVAILABLE); SetMissionState(m_Completions == 0 ? eMissionState::AVAILABLE : eMissionState::COMPLETE_AVAILABLE);
} }
void Mission::Accept() { void Mission::Accept() {
SetMissionTypeState(MissionLockState::MISSION_LOCK_NEW, info->defined_type, info->defined_subtype); SetMissionTypeState(eMissionLockState::NEW, info->defined_type, info->defined_subtype);
SetMissionState(m_Completions > 0 ? MissionState::MISSION_STATE_COMPLETE_ACTIVE : MissionState::MISSION_STATE_ACTIVE); SetMissionState(m_Completions > 0 ? eMissionState::COMPLETE_ACTIVE : eMissionState::ACTIVE);
Catchup(); Catchup();
} }
void Mission::Complete(const bool yieldRewards) { void Mission::Complete(const bool yieldRewards) {
if (m_State != MissionState::MISSION_STATE_ACTIVE && m_State != MissionState::MISSION_STATE_COMPLETE_ACTIVE) { if (m_State != eMissionState::ACTIVE && m_State != eMissionState::COMPLETE_ACTIVE) {
// If we are accepting a mission here there is no point to giving it a unique ID since we just complete it immediately. // If we are accepting a mission here there is no point to giving it a unique ID since we just complete it immediately.
Accept(); Accept();
} }
@ -295,13 +299,13 @@ void Mission::Complete(const bool yieldRewards) {
task->Complete(); task->Complete();
} }
SetMissionState(MissionState::MISSION_STATE_REWARDING, true); SetMissionState(eMissionState::REWARDING, true);
if (yieldRewards) { if (yieldRewards) {
YieldRewards(); YieldRewards();
} }
SetMissionState(MissionState::MISSION_STATE_COMPLETE); SetMissionState(eMissionState::COMPLETE);
m_Completions++; m_Completions++;
@ -320,11 +324,11 @@ void Mission::Complete(const bool yieldRewards) {
auto* missionComponent = entity->GetComponent<MissionComponent>(); auto* missionComponent = entity->GetComponent<MissionComponent>();
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_MISSION_COMPLETE, info->id); missionComponent->Progress(eMissionTaskType::META, info->id);
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_RACING, info->id, (LWOOBJID)RacingTaskParam::RACING_TASK_PARAM_COMPLETE_ANY_RACING_TASK); missionComponent->Progress(eMissionTaskType::RACING, info->id, (LWOOBJID)eRacingTaskParam::COMPLETE_ANY_RACING_TASK);
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_RACING, info->id, (LWOOBJID)RacingTaskParam::RACING_TASK_PARAM_COMPLETE_TRACK_TASKS); missionComponent->Progress(eMissionTaskType::RACING, info->id, (LWOOBJID)eRacingTaskParam::COMPLETE_TRACK_TASKS);
auto* missionEmailTable = CDClientManager::Instance()->GetTable<CDMissionEmailTable>("MissionEmail"); auto* missionEmailTable = CDClientManager::Instance()->GetTable<CDMissionEmailTable>("MissionEmail");
@ -371,7 +375,7 @@ void Mission::Catchup() {
for (auto* task : m_Tasks) { for (auto* task : m_Tasks) {
const auto type = task->GetType(); const auto type = task->GetType();
if (type == MissionTaskType::MISSION_TASK_TYPE_ITEM_COLLECTION) { if (type == eMissionTaskType::GATHER) {
for (auto target : task->GetAllTargets()) { for (auto target : task->GetAllTargets()) {
const auto count = inventory->GetLotCountNonTransfer(target); const auto count = inventory->GetLotCountNonTransfer(target);
@ -381,7 +385,7 @@ void Mission::Catchup() {
} }
} }
if (type == MissionTaskType::MISSION_TASK_TYPE_PLAYER_FLAG) { if (type == eMissionTaskType::PLAYER_FLAG) {
for (auto target : task->GetAllTargets()) { for (auto target : task->GetAllTargets()) {
const auto flag = GetUser()->GetLastUsedChar()->GetPlayerFlag(target); const auto flag = GetUser()->GetLastUsedChar()->GetPlayerFlag(target);
@ -416,7 +420,7 @@ void Mission::YieldRewards() {
// Remove mission items // Remove mission items
for (auto* task : m_Tasks) { for (auto* task : m_Tasks) {
if (task->GetType() != MissionTaskType::MISSION_TASK_TYPE_ITEM_COLLECTION) { if (task->GetType() != eMissionTaskType::GATHER) {
continue; continue;
} }
@ -429,7 +433,7 @@ void Mission::YieldRewards() {
inventoryComponent->RemoveItem(target, task->GetClientInfo().targetValue, eInventoryType::ITEMS); inventoryComponent->RemoveItem(target, task->GetClientInfo().targetValue, eInventoryType::ITEMS);
inventoryComponent->RemoveItem(target, task->GetClientInfo().targetValue, eInventoryType::QUEST); inventoryComponent->RemoveItem(target, task->GetClientInfo().targetValue, eInventoryType::QUEST);
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_ITEM_COLLECTION, target, LWOOBJID_EMPTY, "", -task->GetClientInfo().targetValue); missionComponent->Progress(eMissionTaskType::GATHER, target, LWOOBJID_EMPTY, "", -task->GetClientInfo().targetValue);
} }
} }
} }
@ -525,7 +529,7 @@ void Mission::YieldRewards() {
} }
if (info->reward_reputation > 0) { if (info->reward_reputation > 0) {
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_EARN_REPUTATION, 0, 0L, "", info->reward_reputation); missionComponent->Progress(eMissionTaskType::EARN_REPUTATION, 0, 0L, "", info->reward_reputation);
auto character = entity->GetComponent<CharacterComponent>(); auto character = entity->GetComponent<CharacterComponent>();
if (character) { if (character) {
character->SetReputation(character->GetReputation() + info->reward_reputation); character->SetReputation(character->GetReputation() + info->reward_reputation);
@ -560,7 +564,7 @@ void Mission::YieldRewards() {
} }
} }
void Mission::Progress(MissionTaskType type, int32_t value, LWOOBJID associate, const std::string& targets, int32_t count) { void Mission::Progress(eMissionTaskType type, int32_t value, LWOOBJID associate, const std::string& targets, int32_t count) {
const auto isRemoval = count < 0; const auto isRemoval = count < 0;
if (isRemoval && (IsComplete() || IsAchievement())) { if (isRemoval && (IsComplete() || IsAchievement())) {
@ -584,7 +588,7 @@ void Mission::Progress(MissionTaskType type, int32_t value, LWOOBJID associate,
} }
} }
void Mission::SetMissionState(const MissionState state, const bool sendingRewards) { void Mission::SetMissionState(const eMissionState state, const bool sendingRewards) {
this->m_State = state; this->m_State = state;
auto* entity = GetAssociate(); auto* entity = GetAssociate();
@ -596,7 +600,7 @@ void Mission::SetMissionState(const MissionState state, const bool sendingReward
GameMessages::SendNotifyMission(entity, entity->GetParentUser()->GetSystemAddress(), info->id, static_cast<int>(state), sendingRewards); GameMessages::SendNotifyMission(entity, entity->GetParentUser()->GetSystemAddress(), info->id, static_cast<int>(state), sendingRewards);
} }
void Mission::SetMissionTypeState(MissionLockState state, const std::string& type, const std::string& subType) { void Mission::SetMissionTypeState(eMissionLockState state, const std::string& type, const std::string& subType) {
// TODO // TODO
} }

View File

@ -10,13 +10,12 @@
#include "MissionTask.h" #include "MissionTask.h"
#include "dCommonVars.h" #include "dCommonVars.h"
#include "Entity.h" #include "Entity.h"
#include "MissionState.h"
#include "MissionLockState.h"
namespace tinyxml2 { namespace tinyxml2 {
class XMLElement; class XMLElement;
}; };
enum class eMissionState : int;
enum class eMissionLockState : int;
class MissionComponent; class MissionComponent;
/** /**
@ -53,7 +52,7 @@ public:
* Returns the current state of this mission * Returns the current state of this mission
* @return the current state of this mission * @return the current state of this mission
*/ */
MissionState GetMissionState() const; eMissionState GetMissionState() const;
/** /**
* Returns the database information that represents to this mission. * Returns the database information that represents to this mission.
@ -102,12 +101,12 @@ public:
* @param state the mission state to set * @param state the mission state to set
* @param sendingRewards a flag indicating to the client that rewards wil lfollow * @param sendingRewards a flag indicating to the client that rewards wil lfollow
*/ */
void SetMissionState(MissionState state, bool sendingRewards = false); void SetMissionState(eMissionState state, bool sendingRewards = false);
/** /**
* Currently unimplemented * Currently unimplemented
*/ */
void SetMissionTypeState(MissionLockState state, const std::string& type, const std::string& subType); void SetMissionTypeState(eMissionLockState state, const std::string& type, const std::string& subType);
/** /**
* Returns whether this mission is an achievement * Returns whether this mission is an achievement
@ -208,7 +207,7 @@ public:
* @param targets optional multiple targets that need to be met for progression * @param targets optional multiple targets that need to be met for progression
* @param count optional count to progress with * @param count optional count to progress with
*/ */
void Progress(MissionTaskType type, int32_t value, LWOOBJID associate = 0, const std::string& targets = "", int32_t count = 1); void Progress(eMissionTaskType type, int32_t value, LWOOBJID associate = 0, const std::string& targets = "", int32_t count = 1);
/** /**
* Returns if the mission ID that's given belongs to an existing mission * Returns if the mission ID that's given belongs to an existing mission
@ -251,7 +250,7 @@ private:
/** /**
* The current state this mission is in * The current state this mission is in
*/ */
MissionState m_State; eMissionState m_State;
/** /**
* The number of times the entity has completed this mission * The number of times the entity has completed this mission

View File

@ -106,8 +106,8 @@ bool PrerequisiteExpression::Execute(const std::unordered_map<uint32_t, Mission*
if (this->sub != 0) { if (this->sub != 0) {
// Special case for one Wisp Lee repeatable mission. // Special case for one Wisp Lee repeatable mission.
a = mission->GetClientInfo().id == 1883 ? a = mission->GetClientInfo().id == 1883 ?
mission->GetMissionState() == static_cast<MissionState>(this->sub) : mission->GetMissionState() == static_cast<eMissionState>(this->sub) :
mission->GetMissionState() >= static_cast<MissionState>(this->sub); mission->GetMissionState() >= static_cast<eMissionState>(this->sub);
} else if (mission->IsComplete()) { } else if (mission->IsComplete()) {
a = true; a = true;
} }

View File

@ -13,6 +13,7 @@
#include "dZoneManager.h" #include "dZoneManager.h"
#include "InventoryComponent.h" #include "InventoryComponent.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "eMissionTaskType.h"
MissionTask::MissionTask(Mission* mission, CDMissionTasks* info, uint32_t mask) { MissionTask::MissionTask(Mission* mission, CDMissionTasks* info, uint32_t mask) {
this->info = info; this->info = info;
@ -42,8 +43,8 @@ MissionTask::MissionTask(Mission* mission, CDMissionTasks* info, uint32_t mask)
} }
MissionTaskType MissionTask::GetType() const { eMissionTaskType MissionTask::GetType() const {
return static_cast<MissionTaskType>(info->taskType); return static_cast<eMissionTaskType>(info->taskType);
} }
@ -187,7 +188,7 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
const auto type = GetType(); const auto type = GetType();
if (count < 0) { if (count < 0) {
if (mission->IsMission() && type == MissionTaskType::MISSION_TASK_TYPE_ITEM_COLLECTION && InAllTargets(value)) { if (mission->IsMission() && type == eMissionTaskType::GATHER && InAllTargets(value)) {
if (parameters.size() > 0 && (parameters[0] & 1) != 0) { if (parameters.size() > 0 && (parameters[0] & 1) != 0) {
return; return;
} }
@ -218,10 +219,10 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
std::vector<LDFBaseData*> settings; std::vector<LDFBaseData*> settings;
switch (type) { switch (type) {
case MissionTaskType::MISSION_TASK_TYPE_UNKNOWN: case eMissionTaskType::UNKNOWN:
break; break;
case MissionTaskType::MISSION_TASK_TYPE_ACTIVITY: case eMissionTaskType::ACTIVITY:
{ {
if (InAllTargets(value)) { if (InAllTargets(value)) {
AddProgress(count); AddProgress(count);
@ -256,8 +257,8 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
break; break;
} }
case MissionTaskType::MISSION_TASK_TYPE_FOOD: case eMissionTaskType::USE_ITEM:
case MissionTaskType::MISSION_TASK_TYPE_MISSION_INTERACTION: case eMissionTaskType::TALK_TO_NPC:
{ {
if (GetTarget() != value) break; if (GetTarget() != value) break;
@ -266,7 +267,7 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
break; break;
} }
case MissionTaskType::MISSION_TASK_TYPE_EMOTE: case eMissionTaskType::EMOTE:
{ {
if (!InParameters(value)) break; if (!InParameters(value)) break;
@ -287,7 +288,7 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
break; break;
} }
case MissionTaskType::MISSION_TASK_TYPE_SKILL: case eMissionTaskType::USE_SKILL:
{ {
// This is a complicated check because for some missions we need to check for the associate being in the parameters instead of the value being in the parameters. // This is a complicated check because for some missions we need to check for the associate being in the parameters instead of the value being in the parameters.
if (associate == LWOOBJID_EMPTY && GetAllTargets().size() == 1 && GetAllTargets()[0] == -1) { if (associate == LWOOBJID_EMPTY && GetAllTargets().size() == 1 && GetAllTargets()[0] == -1) {
@ -298,7 +299,7 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
break; break;
} }
case MissionTaskType::MISSION_TASK_TYPE_MINIGAME: case eMissionTaskType::PERFORM_ACTIVITY:
{ {
auto* minigameManager = EntityManager::Instance()->GetEntity(associate); auto* minigameManager = EntityManager::Instance()->GetEntity(associate);
if (minigameManager == nullptr) if (minigameManager == nullptr)
@ -327,7 +328,7 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
break; break;
} }
case MissionTaskType::MISSION_TASK_TYPE_VISIT_PROPERTY: case eMissionTaskType::VISIT_PROPERTY:
{ {
if (!InAllTargets(value)) break; if (!InAllTargets(value)) break;
@ -340,7 +341,7 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
break; break;
} }
case MissionTaskType::MISSION_TASK_TYPE_ENVIRONMENT: case eMissionTaskType::COLLECTION:
{ {
if (!InAllTargets(value)) break; if (!InAllTargets(value)) break;
@ -375,7 +376,7 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
break; break;
} }
case MissionTaskType::MISSION_TASK_TYPE_LOCATION: case eMissionTaskType::EXPLORE:
{ {
if (info->targetGroup != targets) break; if (info->targetGroup != targets) break;
@ -384,9 +385,9 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
break; break;
} }
case MissionTaskType::MISSION_TASK_TYPE_RACING: case eMissionTaskType::RACING:
{ {
// The meaning of associate can be found in RacingTaskParam.h // The meaning of associate can be found in eRacingTaskParam.h
if (parameters.empty()) break; if (parameters.empty()) break;
if (!InAllTargets(dZoneManager::Instance()->GetZone()->GetWorldID()) && !(parameters[0] == 4 || parameters[0] == 5) && !InAllTargets(value)) break; if (!InAllTargets(dZoneManager::Instance()->GetZone()->GetWorldID()) && !(parameters[0] == 4 || parameters[0] == 5) && !InAllTargets(value)) break;
@ -426,15 +427,15 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
break; break;
} }
case MissionTaskType::MISSION_TASK_TYPE_PET_TAMING: case eMissionTaskType::PET_TAMING:
case MissionTaskType::MISSION_TASK_TYPE_SCRIPT: case eMissionTaskType::SCRIPT:
case MissionTaskType::MISSION_TASK_TYPE_NON_MISSION_INTERACTION: case eMissionTaskType::INTERACT:
case MissionTaskType::MISSION_TASK_TYPE_MISSION_COMPLETE: case eMissionTaskType::META:
case MissionTaskType::MISSION_TASK_TYPE_POWERUP: case eMissionTaskType::POWERUP:
case MissionTaskType::MISSION_TASK_TYPE_SMASH: case eMissionTaskType::SMASH:
case MissionTaskType::MISSION_TASK_TYPE_ITEM_COLLECTION: case eMissionTaskType::GATHER:
case MissionTaskType::MISSION_TASK_TYPE_PLAYER_FLAG: case eMissionTaskType::PLAYER_FLAG:
case MissionTaskType::MISSION_TASK_TYPE_EARN_REPUTATION: case eMissionTaskType::EARN_REPUTATION:
{ {
if (!InAllTargets(value)) break; if (!InAllTargets(value)) break;
@ -442,7 +443,7 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
break; break;
} }
case MissionTaskType::MISSION_TASK_TYPE_PLACE_MODEL: case eMissionTaskType::PLACE_MODEL:
{ {
AddProgress(count); AddProgress(count);
break; break;

View File

@ -4,9 +4,9 @@
#define MISSIONTASK_H #define MISSIONTASK_H
#include "CDMissionTasksTable.h" #include "CDMissionTasksTable.h"
#include "MissionTaskType.h"
#include "dCommonVars.h" #include "dCommonVars.h"
enum class eMissionTaskType : int;
class Mission; class Mission;
/** /**
@ -57,7 +57,7 @@ public:
* Returns the type of this task * Returns the type of this task
* @return the type of this task * @return the type of this task
*/ */
MissionTaskType GetType() const; eMissionTaskType GetType() const;
/** /**
* Returns the value that should be progressed to, to complete the mission (the target value) * Returns the value that should be progressed to, to complete the mission (the target value)

View File

@ -13,6 +13,8 @@
#include "GeneralUtils.h" #include "GeneralUtils.h"
#include "InventoryComponent.h" #include "InventoryComponent.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "eMissionState.h"
LootGenerator::LootGenerator() { LootGenerator::LootGenerator() {
CDLootTableTable* lootTableTable = CDClientManager::Instance()->GetTable<CDLootTableTable>("LootTable"); CDLootTableTable* lootTableTable = CDClientManager::Instance()->GetTable<CDLootTableTable>("LootTable");
@ -186,13 +188,13 @@ std::unordered_map<LOT, int32_t> LootGenerator::RollLootMatrix(Entity* player, u
// convert faction token proxy // convert faction token proxy
if (drop.itemID == 13763) { if (drop.itemID == 13763) {
if (missionComponent->GetMissionState(545) == MissionState::MISSION_STATE_COMPLETE) if (missionComponent->GetMissionState(545) == eMissionState::COMPLETE)
drop.itemID = 8318; // "Assembly Token" drop.itemID = 8318; // "Assembly Token"
else if (missionComponent->GetMissionState(556) == MissionState::MISSION_STATE_COMPLETE) else if (missionComponent->GetMissionState(556) == eMissionState::COMPLETE)
drop.itemID = 8321; // "Venture League Token" drop.itemID = 8321; // "Venture League Token"
else if (missionComponent->GetMissionState(567) == MissionState::MISSION_STATE_COMPLETE) else if (missionComponent->GetMissionState(567) == eMissionState::COMPLETE)
drop.itemID = 8319; // "Sentinels Token" drop.itemID = 8319; // "Sentinels Token"
else if (missionComponent->GetMissionState(578) == MissionState::MISSION_STATE_COMPLETE) else if (missionComponent->GetMissionState(578) == eMissionState::COMPLETE)
drop.itemID = 8320; // "Paradox Token" drop.itemID = 8320; // "Paradox Token"
} }

View File

@ -24,6 +24,7 @@
#include "Character.h" #include "Character.h"
#include "dZoneManager.h" #include "dZoneManager.h"
#include "WorldConfig.h" #include "WorldConfig.h"
#include "eMissionTaskType.h"
void Mail::SendMail(const Entity* recipient, const std::string& subject, const std::string& body, const LOT attachment, void Mail::SendMail(const Entity* recipient, const std::string& subject, const std::string& body, const LOT attachment,
const uint16_t attachmentCount) { const uint16_t attachmentCount) {
@ -165,7 +166,7 @@ void Mail::HandleSendMail(RakNet::BitStream* packet, const SystemAddress& sysAdd
if (!character) return; if (!character) return;
if (character->HasPermission(PermissionMap::RestrictedMailAccess)) { if (character->HasPermission(ePermissionMap::RestrictedMailAccess)) {
// Send a message to the player // Send a message to the player
ChatPackets::SendSystemMessage( ChatPackets::SendSystemMessage(
sysAddr, sysAddr,
@ -268,7 +269,7 @@ void Mail::HandleSendMail(RakNet::BitStream* packet, const SystemAddress& sysAdd
auto* missionCompoent = entity->GetComponent<MissionComponent>(); auto* missionCompoent = entity->GetComponent<MissionComponent>();
if (missionCompoent != nullptr) { if (missionCompoent != nullptr) {
missionCompoent->Progress(MissionTaskType::MISSION_TASK_TYPE_ITEM_COLLECTION, itemLOT, LWOOBJID_EMPTY, "", -attachmentCount); missionCompoent->Progress(eMissionTaskType::GATHER, itemLOT, LWOOBJID_EMPTY, "", -attachmentCount);
} }
} }

View File

@ -12,7 +12,7 @@
#include "LevelProgressionComponent.h" #include "LevelProgressionComponent.h"
#include "DestroyableComponent.h" #include "DestroyableComponent.h"
#include "GameMessages.h" #include "GameMessages.h"
#include "eMissionState.h"
std::map<uint32_t, Precondition*> Preconditions::cache = {}; std::map<uint32_t, Precondition*> Preconditions::cache = {};
@ -142,19 +142,19 @@ bool Precondition::CheckValue(Entity* player, const uint32_t value, bool evaluat
case PreconditionType::HasAchievement: case PreconditionType::HasAchievement:
mission = missionComponent->GetMission(value); mission = missionComponent->GetMission(value);
return mission == nullptr || mission->GetMissionState() >= MissionState::MISSION_STATE_COMPLETE; return mission == nullptr || mission->GetMissionState() >= eMissionState::COMPLETE;
case PreconditionType::MissionAvailable: case PreconditionType::MissionAvailable:
mission = missionComponent->GetMission(value); mission = missionComponent->GetMission(value);
return mission == nullptr || mission->GetMissionState() >= MissionState::MISSION_STATE_AVAILABLE; return mission == nullptr || mission->GetMissionState() >= eMissionState::AVAILABLE;
case PreconditionType::OnMission: case PreconditionType::OnMission:
mission = missionComponent->GetMission(value); mission = missionComponent->GetMission(value);
return mission == nullptr || mission->GetMissionState() >= MissionState::MISSION_STATE_ACTIVE; return mission == nullptr || mission->GetMissionState() >= eMissionState::ACTIVE;
case PreconditionType::MissionComplete: case PreconditionType::MissionComplete:
mission = missionComponent->GetMission(value); mission = missionComponent->GetMission(value);
return mission == nullptr ? false : mission->GetMissionState() >= MissionState::MISSION_STATE_COMPLETE; return mission == nullptr ? false : mission->GetMissionState() >= eMissionState::COMPLETE;
case PreconditionType::PetDeployed: case PreconditionType::PetDeployed:
return false; // TODO return false; // TODO
case PreconditionType::HasFlag: case PreconditionType::HasFlag:

View File

@ -72,6 +72,7 @@
#include "AMFFormat.h" #include "AMFFormat.h"
#include "MovingPlatformComponent.h" #include "MovingPlatformComponent.h"
#include "dMessageIdentifiers.h" #include "dMessageIdentifiers.h"
#include "eMissionState.h"
void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entity* entity, const SystemAddress& sysAddr) { void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entity* entity, const SystemAddress& sysAddr) {
std::string chatCommand; std::string chatCommand;
@ -685,7 +686,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
return; return;
} }
mission->SetMissionState(MissionState::MISSION_STATE_ACTIVE); mission->SetMissionState(eMissionState::ACTIVE);
return; return;
} }

View File

@ -268,7 +268,7 @@ void ClientPackets::HandleChatModerationRequest(const SystemAddress& sysAddr, Pa
// Check if the player has restricted chat access // Check if the player has restricted chat access
auto* character = entity->GetCharacter(); auto* character = entity->GetCharacter();
if (character->HasPermission(PermissionMap::RestrictedChatAccess)) { if (character->HasPermission(ePermissionMap::RestrictedChatAccess)) {
// Send a message to the player // Send a message to the player
ChatPackets::SendSystemMessage( ChatPackets::SendSystemMessage(
sysAddr, sysAddr,

View File

@ -2,7 +2,8 @@
#include "EntityManager.h" #include "EntityManager.h"
#include "RenderComponent.h" #include "RenderComponent.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "MissionTaskType.h" #include "eMissionTaskType.h"
#include "eMissionState.h"
#include "Loot.h" #include "Loot.h"
void BootyDigServer::OnStartup(Entity* self) { void BootyDigServer::OnStartup(Entity* self) {
@ -37,8 +38,8 @@ BootyDigServer::OnFireEventServerSide(Entity* self, Entity* sender, std::string
auto* missionComponent = player->GetComponent<MissionComponent>(); auto* missionComponent = player->GetComponent<MissionComponent>();
if (missionComponent != nullptr) { if (missionComponent != nullptr) {
auto* mission = missionComponent->GetMission(1881); auto* mission = missionComponent->GetMission(1881);
if (mission != nullptr && (mission->GetMissionState() == MissionState::MISSION_STATE_ACTIVE || mission->GetMissionState() == MissionState::MISSION_STATE_COMPLETE_ACTIVE)) { if (mission != nullptr && (mission->GetMissionState() == eMissionState::ACTIVE || mission->GetMissionState() == eMissionState::COMPLETE_ACTIVE)) {
mission->Progress(MissionTaskType::MISSION_TASK_TYPE_SCRIPT, self->GetLOT()); mission->Progress(eMissionTaskType::SCRIPT, self->GetLOT());
auto* renderComponent = self->GetComponent<RenderComponent>(); auto* renderComponent = self->GetComponent<RenderComponent>();
if (renderComponent != nullptr) if (renderComponent != nullptr)

View File

@ -3,6 +3,7 @@
#include "GeneralUtils.h" #include "GeneralUtils.h"
#include "EntityManager.h" #include "EntityManager.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "eMissionTaskType.h"
void MaestromExtracticatorServer::OnStartup(Entity* self) { void MaestromExtracticatorServer::OnStartup(Entity* self) {
//self:SetNetworkVar("current_anim", failAnim) //self:SetNetworkVar("current_anim", failAnim)
@ -24,7 +25,7 @@ void MaestromExtracticatorServer::OnFireEventServerSide(Entity* self, Entity* se
auto missionComponent = player->GetComponent<MissionComponent>(); auto missionComponent = player->GetComponent<MissionComponent>();
if (missionComponent == nullptr) return; if (missionComponent == nullptr) return;
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_SMASH, 14718); missionComponent->Progress(eMissionTaskType::SMASH, 14718);
CollectSample(self, sender->GetObjectID()); CollectSample(self, sender->GetObjectID());
sender->ScheduleKillAfterUpdate(); sender->ScheduleKillAfterUpdate();
} }

View File

@ -3,6 +3,8 @@
#include "ScriptedActivityComponent.h" #include "ScriptedActivityComponent.h"
#include "GameMessages.h" #include "GameMessages.h"
#include "LeaderboardManager.h" #include "LeaderboardManager.h"
#include "eMissionTaskType.h"
#include "eMissionState.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include <ctime> #include <ctime>
@ -89,7 +91,7 @@ void NpcAgCourseStarter::OnFireEventServerSide(Entity* self, Entity* sender, std
auto* missionComponent = sender->GetComponent<MissionComponent>(); auto* missionComponent = sender->GetComponent<MissionComponent>();
if (missionComponent != nullptr) { if (missionComponent != nullptr) {
missionComponent->ForceProgressTaskType(1884, 1, 1, false); missionComponent->ForceProgressTaskType(1884, 1, 1, false);
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_MINIGAME, -finish, self->GetObjectID(), missionComponent->Progress(eMissionTaskType::PERFORM_ACTIVITY, -finish, self->GetObjectID(),
"performact_time"); "performact_time");
} }

View File

@ -1,8 +1,8 @@
#include "NpcCowboyServer.h" #include "NpcCowboyServer.h"
#include "MissionState.h" #include "eMissionState.h"
#include "InventoryComponent.h" #include "InventoryComponent.h"
void NpcCowboyServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) { void NpcCowboyServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
if (missionID != 1880) { if (missionID != 1880) {
return; return;
} }
@ -13,14 +13,14 @@ void NpcCowboyServer::OnMissionDialogueOK(Entity* self, Entity* target, int miss
return; return;
} }
if (missionState == MissionState::MISSION_STATE_COMPLETE_ACTIVE || if (missionState == eMissionState::COMPLETE_ACTIVE ||
missionState == MissionState::MISSION_STATE_ACTIVE || missionState == eMissionState::ACTIVE ||
missionState == MissionState::MISSION_STATE_AVAILABLE || missionState == eMissionState::AVAILABLE ||
missionState == MissionState::MISSION_STATE_COMPLETE_AVAILABLE) { missionState == eMissionState::COMPLETE_AVAILABLE) {
if (inventoryComponent->GetLotCount(14378) == 0) { if (inventoryComponent->GetLotCount(14378) == 0) {
inventoryComponent->AddItem(14378, 1, eLootSourceType::LOOT_SOURCE_NONE); inventoryComponent->AddItem(14378, 1, eLootSourceType::LOOT_SOURCE_NONE);
} }
} else if (missionState == MissionState::MISSION_STATE_READY_TO_COMPLETE || missionState == MissionState::MISSION_STATE_COMPLETE_READY_TO_COMPLETE) { } else if (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE) {
inventoryComponent->RemoveItem(14378, 1); inventoryComponent->RemoveItem(14378, 1);
} }
} }

View File

@ -3,5 +3,5 @@
class NpcCowboyServer : public CppScripts::Script class NpcCowboyServer : public CppScripts::Script
{ {
void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) override; void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) override;
}; };

View File

@ -1,7 +1,7 @@
#include "NpcEpsilonServer.h" #include "NpcEpsilonServer.h"
#include "GameMessages.h" #include "GameMessages.h"
void NpcEpsilonServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) { void NpcEpsilonServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
//If we are completing the Nexus Force join mission, play the celebration for it: //If we are completing the Nexus Force join mission, play the celebration for it:
if (missionID == 1851) { if (missionID == 1851) {

View File

@ -2,6 +2,6 @@
#include "CppScripts.h" #include "CppScripts.h"
class NpcEpsilonServer : public CppScripts::Script { class NpcEpsilonServer : public CppScripts::Script {
void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState); void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState);
}; };

View File

@ -3,24 +3,25 @@
#include "InventoryComponent.h" #include "InventoryComponent.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "Item.h" #include "Item.h"
#include "eMissionState.h"
void NpcNjAssistantServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) { void NpcNjAssistantServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
if (missionID != mailMission) return; if (missionID != mailMission) return;
if (missionState == MissionState::MISSION_STATE_COMPLETE || missionState == MissionState::MISSION_STATE_READY_TO_COMPLETE) { if (missionState == eMissionState::COMPLETE || missionState == eMissionState::READY_TO_COMPLETE) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"switch", 0, 0, LWOOBJID_EMPTY, "", target->GetSystemAddress()); GameMessages::SendNotifyClientObject(self->GetObjectID(), u"switch", 0, 0, LWOOBJID_EMPTY, "", target->GetSystemAddress());
auto* inv = static_cast<InventoryComponent*>(target->GetComponent(COMPONENT_TYPE_INVENTORY)); auto* inv = static_cast<InventoryComponent*>(target->GetComponent(COMPONENT_TYPE_INVENTORY));
// If we are ready to complete our missions, we take the kit from you: // If we are ready to complete our missions, we take the kit from you:
if (inv && missionState == MissionState::MISSION_STATE_READY_TO_COMPLETE) { if (inv && missionState == eMissionState::READY_TO_COMPLETE) {
auto* id = inv->FindItemByLot(14397); //the kit's lot auto* id = inv->FindItemByLot(14397); //the kit's lot
if (id != nullptr) { if (id != nullptr) {
inv->RemoveItem(id->GetLot(), id->GetCount()); inv->RemoveItem(id->GetLot(), id->GetCount());
} }
} }
} else if (missionState == MissionState::MISSION_STATE_AVAILABLE) { } else if (missionState == eMissionState::AVAILABLE) {
auto* missionComponent = static_cast<MissionComponent*>(target->GetComponent(COMPONENT_TYPE_MISSION)); auto* missionComponent = static_cast<MissionComponent*>(target->GetComponent(COMPONENT_TYPE_MISSION));
missionComponent->CompleteMission(mailAchievement, true); missionComponent->CompleteMission(mailAchievement, true);
} }

View File

@ -2,7 +2,7 @@
#include "CppScripts.h" #include "CppScripts.h"
class NpcNjAssistantServer : public CppScripts::Script { class NpcNjAssistantServer : public CppScripts::Script {
void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState); void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState);
private: private:
int mailMission = 1728; //mission to get the item out of your mailbox int mailMission = 1728; //mission to get the item out of your mailbox

View File

@ -1,17 +1,17 @@
#include "NpcPirateServer.h" #include "NpcPirateServer.h"
#include "MissionState.h" #include "eMissionState.h"
#include "InventoryComponent.h" #include "InventoryComponent.h"
void NpcPirateServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) { void NpcPirateServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
auto* inventory = target->GetComponent<InventoryComponent>(); auto* inventory = target->GetComponent<InventoryComponent>();
if (inventory != nullptr && missionID == 1881) { if (inventory != nullptr && missionID == 1881) {
auto* luckyShovel = inventory->FindItemByLot(14591); auto* luckyShovel = inventory->FindItemByLot(14591);
// Add or remove the lucky shovel based on whether the mission was completed or started // Add or remove the lucky shovel based on whether the mission was completed or started
if ((missionState == MissionState::MISSION_STATE_AVAILABLE || missionState == MissionState::MISSION_STATE_COMPLETE_AVAILABLE) if ((missionState == eMissionState::AVAILABLE || missionState == eMissionState::COMPLETE_AVAILABLE)
&& luckyShovel == nullptr) { && luckyShovel == nullptr) {
inventory->AddItem(14591, 1, eLootSourceType::LOOT_SOURCE_NONE); inventory->AddItem(14591, 1, eLootSourceType::LOOT_SOURCE_NONE);
} else if (missionState == MissionState::MISSION_STATE_READY_TO_COMPLETE || missionState == MissionState::MISSION_STATE_COMPLETE_READY_TO_COMPLETE) { } else if (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE) {
inventory->RemoveItem(14591, 1); inventory->RemoveItem(14591, 1);
} }
} }

View File

@ -2,5 +2,5 @@
#include "CppScripts.h" #include "CppScripts.h"
class NpcPirateServer : public CppScripts::Script { class NpcPirateServer : public CppScripts::Script {
void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) override; void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) override;
}; };

View File

@ -3,9 +3,9 @@
#include "EntityManager.h" #include "EntityManager.h"
#include "Entity.h" #include "Entity.h"
#include "GameMessages.h" #include "GameMessages.h"
#include "MissionState.h" #include "eMissionState.h"
void NpcWispServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) { void NpcWispServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
if (missionID != 1849 && missionID != 1883) if (missionID != 1849 && missionID != 1883)
return; return;
@ -17,16 +17,16 @@ void NpcWispServer::OnMissionDialogueOK(Entity* self, Entity* target, int missio
auto* maelstromVacuum = inventory->FindItemByLot(maelstromVacuumLot); auto* maelstromVacuum = inventory->FindItemByLot(maelstromVacuumLot);
// For the daily we add the maelstrom vacuum if the player doesn't have it yet // For the daily we add the maelstrom vacuum if the player doesn't have it yet
if (missionID == 1883 && (missionState == MissionState::MISSION_STATE_AVAILABLE || missionState == MissionState::MISSION_STATE_COMPLETE_AVAILABLE) if (missionID == 1883 && (missionState == eMissionState::AVAILABLE || missionState == eMissionState::COMPLETE_AVAILABLE)
&& maelstromVacuum == nullptr) { && maelstromVacuum == nullptr) {
inventory->AddItem(maelstromVacuumLot, 1, eLootSourceType::LOOT_SOURCE_NONE); inventory->AddItem(maelstromVacuumLot, 1, eLootSourceType::LOOT_SOURCE_NONE);
} else if (missionState == MissionState::MISSION_STATE_READY_TO_COMPLETE || missionState == MissionState::MISSION_STATE_COMPLETE_READY_TO_COMPLETE) { } else if (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE) {
inventory->RemoveItem(maelstromVacuumLot, 1); inventory->RemoveItem(maelstromVacuumLot, 1);
} }
// Next up hide or show the samples based on the mission state // Next up hide or show the samples based on the mission state
auto visible = 1; auto visible = 1;
if (missionState == MissionState::MISSION_STATE_READY_TO_COMPLETE || missionState == MissionState::MISSION_STATE_COMPLETE_READY_TO_COMPLETE) { if (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE) {
visible = 0; visible = 0;
} }

View File

@ -2,5 +2,5 @@
#include "CppScripts.h" #include "CppScripts.h"
class NpcWispServer : public CppScripts::Script { class NpcWispServer : public CppScripts::Script {
void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState); void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState);
}; };

View File

@ -1,7 +1,7 @@
#include "RemoveRentalGear.h" #include "RemoveRentalGear.h"
#include "InventoryComponent.h" #include "InventoryComponent.h"
#include "Item.h" #include "Item.h"
#include "MissionState.h" #include "eMissionState.h"
#include "Character.h" #include "Character.h"
/* /*
@ -17,10 +17,10 @@
-------------------------------------------------------------- --------------------------------------------------------------
*/ */
void RemoveRentalGear::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) { void RemoveRentalGear::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
if (missionID != defaultMission && missionID != 313) return; if (missionID != defaultMission && missionID != 313) return;
if (missionState == MissionState::MISSION_STATE_COMPLETE || missionState == MissionState::MISSION_STATE_READY_TO_COMPLETE) { if (missionState == eMissionState::COMPLETE || missionState == eMissionState::READY_TO_COMPLETE) {
auto inv = static_cast<InventoryComponent*>(target->GetComponent(COMPONENT_TYPE_INVENTORY)); auto inv = static_cast<InventoryComponent*>(target->GetComponent(COMPONENT_TYPE_INVENTORY));
if (!inv) return; if (!inv) return;

View File

@ -2,7 +2,7 @@
#include "CppScripts.h" #include "CppScripts.h"
class RemoveRentalGear : public CppScripts::Script { class RemoveRentalGear : public CppScripts::Script {
void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState); void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState);
private: private:
int defaultMission = 768; //mission to remove gearSets on completion int defaultMission = 768; //mission to remove gearSets on completion

View File

@ -3,6 +3,7 @@
#include "RebuildComponent.h" #include "RebuildComponent.h"
#include "InventoryComponent.h" #include "InventoryComponent.h"
#include "dZoneManager.h" #include "dZoneManager.h"
#include "eMissionState.h"
void AmDropshipComputer::OnStartup(Entity* self) { void AmDropshipComputer::OnStartup(Entity* self) {
self->AddTimer("reset", 45.0f); self->AddTimer("reset", 45.0f);
@ -22,7 +23,7 @@ void AmDropshipComputer::OnUse(Entity* self, Entity* user) {
return; return;
} }
if (inventoryComponent->GetLotCount(m_NexusTalonDataCard) != 0 || missionComponent->GetMission(979)->GetMissionState() == MissionState::MISSION_STATE_COMPLETE) { if (inventoryComponent->GetLotCount(m_NexusTalonDataCard) != 0 || missionComponent->GetMission(979)->GetMissionState() == eMissionState::COMPLETE) {
return; return;
} }

View File

@ -1,9 +1,9 @@
#include "FvFong.h" #include "FvFong.h"
#include "Darkitect.h" #include "Darkitect.h"
#include "MissionState.h" #include "eMissionState.h"
void FvFong::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) { void FvFong::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
if (missionID == 734 && missionState == MissionState::MISSION_STATE_READY_TO_COMPLETE) { if (missionID == 734 && missionState == eMissionState::READY_TO_COMPLETE) {
Darkitect Baron; Darkitect Baron;
Baron.Reveal(self, target); Baron.Reveal(self, target);
} }

View File

@ -4,5 +4,5 @@
class FvFong : public CppScripts::Script class FvFong : public CppScripts::Script
{ {
public: public:
void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) override; void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) override;
}; };

View File

@ -4,6 +4,7 @@
#include "EntityManager.h" #include "EntityManager.h"
#include "GameMessages.h" #include "GameMessages.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "eMissionState.h"
#include "InventoryComponent.h" #include "InventoryComponent.h"
int32_t ImgBrickConsoleQB::ResetBricks = 30; int32_t ImgBrickConsoleQB::ResetBricks = 30;
@ -71,13 +72,13 @@ void ImgBrickConsoleQB::OnUse(Entity* self, Entity* user) {
auto* inventoryComponent = player->GetComponent<InventoryComponent>(); auto* inventoryComponent = player->GetComponent<InventoryComponent>();
if (missionComponent != nullptr && inventoryComponent != nullptr) { if (missionComponent != nullptr && inventoryComponent != nullptr) {
if (missionComponent->GetMissionState(1302) == MissionState::MISSION_STATE_ACTIVE) { if (missionComponent->GetMissionState(1302) == eMissionState::ACTIVE) {
inventoryComponent->RemoveItem(13074, 1); inventoryComponent->RemoveItem(13074, 1);
missionComponent->ForceProgressTaskType(1302, 1, 1); missionComponent->ForceProgressTaskType(1302, 1, 1);
} }
if (missionComponent->GetMissionState(1926) == MissionState::MISSION_STATE_ACTIVE) { if (missionComponent->GetMissionState(1926) == eMissionState::ACTIVE) {
inventoryComponent->RemoveItem(14472, 1); inventoryComponent->RemoveItem(14472, 1);
missionComponent->ForceProgressTaskType(1926, 1, 1); missionComponent->ForceProgressTaskType(1926, 1, 1);

View File

@ -3,6 +3,7 @@
#include "EntityManager.h" #include "EntityManager.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "RenderComponent.h" #include "RenderComponent.h"
#include "eMissionTaskType.h"
void GfTikiTorch::OnStartup(Entity* self) { void GfTikiTorch::OnStartup(Entity* self) {
LightTorch(self); LightTorch(self);
@ -65,7 +66,7 @@ void GfTikiTorch::OnSkillEventFired(Entity* self, Entity* caster, const std::str
auto* casterMissionComponent = caster->GetComponent<MissionComponent>(); auto* casterMissionComponent = caster->GetComponent<MissionComponent>();
if (casterMissionComponent != nullptr) { if (casterMissionComponent != nullptr) {
for (const auto missionID : m_missions) { for (const auto missionID : m_missions) {
casterMissionComponent->ForceProgressTaskType(missionID, static_cast<uint32_t>(MissionTaskType::MISSION_TASK_TYPE_SCRIPT), 1); casterMissionComponent->ForceProgressTaskType(missionID, static_cast<uint32_t>(eMissionTaskType::SCRIPT), 1);
} }
} }

View File

@ -3,6 +3,7 @@
#include "GameMessages.h" #include "GameMessages.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "SkillComponent.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. //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. //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 (missionComponent != nullptr) {
if (missionID != 0) { if (missionID != 0) {
missionComponent->ForceProgressValue(missionID, missionComponent->ForceProgressValue(missionID,
static_cast<uint32_t>(MissionTaskType::MISSION_TASK_TYPE_SCRIPT), static_cast<uint32_t>(eMissionTaskType::SCRIPT),
self->GetLOT(), false); self->GetLOT(), false);
} }
if (!achievementIDs.empty()) { if (!achievementIDs.empty()) {
for (const auto& achievementID : GeneralUtils::SplitString(achievementIDs, u'_')) { for (const auto& achievementID : GeneralUtils::SplitString(achievementIDs, u'_')) {
missionComponent->ForceProgressValue(std::stoi(GeneralUtils::UTF16ToWTF8(achievementID)), missionComponent->ForceProgressValue(std::stoi(GeneralUtils::UTF16ToWTF8(achievementID)),
static_cast<uint32_t>(MissionTaskType::MISSION_TASK_TYPE_SCRIPT), static_cast<uint32_t>(eMissionTaskType::SCRIPT),
self->GetLOT()); self->GetLOT());
} }
} }

View File

@ -1,5 +1,7 @@
#include "GrowingFlower.h" #include "GrowingFlower.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "eMissionTaskType.h"
#include "eMissionState.h"
#include "Loot.h" #include "Loot.h"
void GrowingFlower::OnSkillEventFired(Entity* self, Entity* target, const std::string& message) { 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>(); auto* missionComponent = target->GetComponent<MissionComponent>();
if (missionComponent != nullptr) { if (missionComponent != nullptr) {
for (const auto mission : achievementIDs) 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) if (mission1 && missionComponent->GetMissionState(mission1) == eMissionState::ACTIVE)
missionComponent->ForceProgressTaskType(mission1, static_cast<uint32_t>(MissionTaskType::MISSION_TASK_TYPE_SCRIPT), 1); missionComponent->ForceProgressTaskType(mission1, static_cast<uint32_t>(eMissionTaskType::SCRIPT), 1);
if (mission2 && missionComponent->GetMissionState(mission2) == MissionState::MISSION_STATE_ACTIVE) if (mission2 && missionComponent->GetMissionState(mission2) == eMissionState::ACTIVE)
missionComponent->ForceProgressTaskType(mission2, static_cast<uint32_t>(MissionTaskType::MISSION_TASK_TYPE_SCRIPT), 1); missionComponent->ForceProgressTaskType(mission2, static_cast<uint32_t>(eMissionTaskType::SCRIPT), 1);
} }
} }
} }

View File

@ -1,6 +1,8 @@
#include "ImaginationBackpackHealServer.h" #include "ImaginationBackpackHealServer.h"
#include "GameMessages.h" #include "GameMessages.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "eMissionTaskType.h"
#include "eMissionState.h"
void ImaginationBackpackHealServer::OnSkillEventFired(Entity* self, Entity* caster, const std::string& message) { void ImaginationBackpackHealServer::OnSkillEventFired(Entity* self, Entity* caster, const std::string& message) {
if (message == "CastImaginationBackpack") { if (message == "CastImaginationBackpack") {
@ -11,8 +13,8 @@ void ImaginationBackpackHealServer::OnSkillEventFired(Entity* self, Entity* cast
return; return;
auto* missionComponent = caster->GetComponent<MissionComponent>(); auto* missionComponent = caster->GetComponent<MissionComponent>();
if (missionComponent != nullptr && missionComponent->GetMissionState(healMission) == MissionState::MISSION_STATE_ACTIVE) { if (missionComponent != nullptr && missionComponent->GetMissionState(healMission) == eMissionState::ACTIVE) {
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_SCRIPT, self->GetLOT()); missionComponent->Progress(eMissionTaskType::SCRIPT, self->GetLOT());
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"ClearMaelstrom", 0, 0, GameMessages::SendNotifyClientObject(self->GetObjectID(), u"ClearMaelstrom", 0, 0,
caster->GetObjectID(), "", caster->GetSystemAddress()); caster->GetObjectID(), "", caster->GetSystemAddress());
} }

View File

@ -5,6 +5,7 @@
#include "Character.h" #include "Character.h"
#include "PetComponent.h" #include "PetComponent.h"
#include "User.h" #include "User.h"
#include "eMissionState.h"
std::vector<LWOOBJID> PetDigServer::treasures{}; std::vector<LWOOBJID> PetDigServer::treasures{};
@ -163,13 +164,13 @@ void PetDigServer::ProgressPetDigMissions(const Entity* owner, const Entity* che
if (missionComponent != nullptr) { if (missionComponent != nullptr) {
// Can You Dig It progress // Can You Dig It progress
const auto digMissionState = missionComponent->GetMissionState(843); const auto digMissionState = missionComponent->GetMissionState(843);
if (digMissionState == MissionState::MISSION_STATE_ACTIVE) { if (digMissionState == eMissionState::ACTIVE) {
missionComponent->ForceProgress(843, 1216, 1); missionComponent->ForceProgress(843, 1216, 1);
} }
// Pet Excavator progress // Pet Excavator progress
const auto excavatorMissionState = missionComponent->GetMissionState(505); const auto excavatorMissionState = missionComponent->GetMissionState(505);
if (excavatorMissionState == MissionState::MISSION_STATE_ACTIVE) { if (excavatorMissionState == eMissionState::ACTIVE) {
if (chest->HasVar(u"PetDig")) { if (chest->HasVar(u"PetDig")) {
int32_t playerFlag = 1260 + chest->GetVarAs<int32_t>(u"PetDig"); int32_t playerFlag = 1260 + chest->GetVarAs<int32_t>(u"PetDig");
Character* player = owner->GetCharacter(); 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 // Some treasures require a mission to be active
if (digInfo.requiredMission >= 0) { if (digInfo.requiredMission >= 0) {
auto* missionComponent = owner->GetComponent<MissionComponent>(); 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; return;
} }
} }

View File

@ -2,6 +2,7 @@
#include "GameMessages.h" #include "GameMessages.h"
#include "EntityManager.h" #include "EntityManager.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "eMissionState.h"
void PropertyDevice::OnStartup(Entity* self) { void PropertyDevice::OnStartup(Entity* self) {
auto* zoneControl = EntityManager::Instance()->GetZoneControlEntity(); auto* zoneControl = EntityManager::Instance()->GetZoneControlEntity();
@ -17,7 +18,7 @@ void PropertyDevice::OnRebuildComplete(Entity* self, Entity* target) {
auto* missionComponent = target->GetComponent<MissionComponent>(); auto* missionComponent = target->GetComponent<MissionComponent>();
if (missionComponent != nullptr) { 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"); GameMessages::SendPlayFXEffect(self->GetObjectID(), 641, u"create", "callhome");
missionComponent->ForceProgress(m_PropertyMissionID, 1793, self->GetLOT()); missionComponent->ForceProgress(m_PropertyMissionID, 1793, self->GetLOT());
} }

View File

@ -3,6 +3,7 @@
#include "Entity.h" #include "Entity.h"
#include "GameMessages.h" #include "GameMessages.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "eMissionState.h"
void TouchMissionUpdateServer::OnStartup(Entity* self) { void TouchMissionUpdateServer::OnStartup(Entity* self) {
self->SetProximityRadius(20, "touchCheck"); // Those does not have a collider for some reason? 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(); const auto state = mission->GetMissionState();
if (state >= MissionState::MISSION_STATE_COMPLETE || mission->GetCompletions() > 1) { if (state >= eMissionState::COMPLETE || mission->GetCompletions() > 1) {
return; return;
} }

View File

@ -2,6 +2,8 @@
#include "GameMessages.h" #include "GameMessages.h"
#include "EntityManager.h" #include "EntityManager.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "eMissionTaskType.h"
#include "eMissionState.h"
void NtAssemblyTubeServer::OnStartup(Entity* self) { void NtAssemblyTubeServer::OnStartup(Entity* self) {
self->SetProximityRadius(5, "teleport"); self->SetProximityRadius(5, "teleport");
@ -22,7 +24,7 @@ void NtAssemblyTubeServer::OnProximityUpdate(Entity* self, Entity* entering, std
auto* missionComponent = player->GetComponent<MissionComponent>(); auto* missionComponent = player->GetComponent<MissionComponent>();
if (missionComponent != nullptr) { if (missionComponent != nullptr) {
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_SCRIPT, self->GetLOT()); missionComponent->Progress(eMissionTaskType::SCRIPT, self->GetLOT());
} }
} }

View File

@ -1,6 +1,7 @@
#include "NtDukeServer.h" #include "NtDukeServer.h"
#include "InventoryComponent.h" #include "InventoryComponent.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "eMissionState.h"
void NtDukeServer::SetVariables(Entity* self) { void NtDukeServer::SetVariables(Entity* self) {
self->SetVar<float_t>(m_SpyProximityVariable, 35.0f); self->SetVar<float_t>(m_SpyProximityVariable, 35.0f);
@ -19,7 +20,7 @@ void NtDukeServer::SetVariables(Entity* self) {
self->SetVar<std::vector<LWOOBJID>>(m_SpyCinematicObjectsVariable, { self->GetObjectID() }); self->SetVar<std::vector<LWOOBJID>>(m_SpyCinematicObjectsVariable, { self->GetObjectID() });
} }
void NtDukeServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) { void NtDukeServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
// Handles adding and removing the sword for the Crux Prime Sword mission // Handles adding and removing the sword for the Crux Prime Sword mission
auto* missionComponent = target->GetComponent<MissionComponent>(); auto* missionComponent = target->GetComponent<MissionComponent>();
@ -29,9 +30,9 @@ void NtDukeServer::OnMissionDialogueOK(Entity* self, Entity* target, int mission
auto state = missionComponent->GetMissionState(m_SwordMissionID); auto state = missionComponent->GetMissionState(m_SwordMissionID);
auto lotCount = inventoryComponent->GetLotCount(m_SwordLot); auto lotCount = inventoryComponent->GetLotCount(m_SwordLot);
if ((state == MissionState::MISSION_STATE_AVAILABLE || state == MissionState::MISSION_STATE_ACTIVE) && lotCount < 1) { if ((state == eMissionState::AVAILABLE || state == eMissionState::ACTIVE) && lotCount < 1) {
inventoryComponent->AddItem(m_SwordLot, 1, eLootSourceType::LOOT_SOURCE_NONE); inventoryComponent->AddItem(m_SwordLot, 1, eLootSourceType::LOOT_SOURCE_NONE);
} else if (state == MissionState::MISSION_STATE_READY_TO_COMPLETE) { } else if (state == eMissionState::READY_TO_COMPLETE) {
inventoryComponent->RemoveItem(m_SwordLot, lotCount); inventoryComponent->RemoveItem(m_SwordLot, lotCount);
} }
} }

View File

@ -3,7 +3,7 @@
class NtDukeServer : public NtFactionSpyServer { class NtDukeServer : public NtFactionSpyServer {
void SetVariables(Entity* self) override; void SetVariables(Entity* self) override;
void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) override; void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) override;
const uint32_t m_SwordMissionID = 1448; const uint32_t m_SwordMissionID = 1448;
const LOT m_SwordLot = 13777; const LOT m_SwordLot = 13777;
}; };

View File

@ -3,6 +3,7 @@
#include "MissionComponent.h" #include "MissionComponent.h"
#include "EntityManager.h" #include "EntityManager.h"
#include "Character.h" #include "Character.h"
#include "eMissionState.h"
void NtParadoxPanelServer::OnUse(Entity* self, Entity* user) { void NtParadoxPanelServer::OnUse(Entity* self, Entity* user) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"bActive", 1, 0, user->GetObjectID(), "", user->GetSystemAddress()); GameMessages::SendNotifyClientObject(self->GetObjectID(), u"bActive", 1, 0, user->GetObjectID(), "", user->GetSystemAddress());
@ -16,7 +17,7 @@ void NtParadoxPanelServer::OnUse(Entity* self, Entity* user) {
const auto playerID = user->GetObjectID(); const auto playerID = user->GetObjectID();
for (const auto mission : tPlayerOnMissions) { for (const auto mission : tPlayerOnMissions) {
if (missionComponent->GetMissionState(mission) != MissionState::MISSION_STATE_ACTIVE) { if (missionComponent->GetMissionState(mission) != eMissionState::ACTIVE) {
continue; continue;
} }

View File

@ -2,6 +2,7 @@
#include "GameMessages.h" #include "GameMessages.h"
#include "EntityManager.h" #include "EntityManager.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "eMissionTaskType.h"
void NtParadoxTeleServer::OnStartup(Entity* self) { void NtParadoxTeleServer::OnStartup(Entity* self) {
self->SetProximityRadius(5, "teleport"); self->SetProximityRadius(5, "teleport");
@ -44,7 +45,7 @@ void NtParadoxTeleServer::OnProximityUpdate(Entity* self, Entity* entering, std:
auto* missionComponent = player->GetComponent<MissionComponent>(); auto* missionComponent = player->GetComponent<MissionComponent>();
if (missionComponent != nullptr) { if (missionComponent != nullptr) {
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_SCRIPT, self->GetLOT()); missionComponent->Progress(eMissionTaskType::SCRIPT, self->GetLOT());
} }
} }

View File

@ -2,6 +2,7 @@
#include "PhantomPhysicsComponent.h" #include "PhantomPhysicsComponent.h"
#include "EntityManager.h" #include "EntityManager.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "eMissionTaskType.h"
void NtSentinelWalkwayServer::OnStartup(Entity* self) { void NtSentinelWalkwayServer::OnStartup(Entity* self) {
auto* phantomPhysicsComponent = self->GetComponent<PhantomPhysicsComponent>(); auto* phantomPhysicsComponent = self->GetComponent<PhantomPhysicsComponent>();
@ -38,6 +39,6 @@ void NtSentinelWalkwayServer::OnProximityUpdate(Entity* self, Entity* entering,
auto* missionComponent = player->GetComponent<MissionComponent>(); auto* missionComponent = player->GetComponent<MissionComponent>();
if (missionComponent != nullptr) { if (missionComponent != nullptr) {
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_SCRIPT, self->GetLOT()); missionComponent->Progress(eMissionTaskType::SCRIPT, self->GetLOT());
} }
} }

View File

@ -1,11 +1,11 @@
#include "NtVandaServer.h" #include "NtVandaServer.h"
#include "InventoryComponent.h" #include "InventoryComponent.h"
#include "MissionState.h" #include "eMissionState.h"
void NtVandaServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) { void NtVandaServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
// Removes the alien parts after completing the mission // Removes the alien parts after completing the mission
if (missionID == m_AlienPartMissionID && missionState == MissionState::MISSION_STATE_READY_TO_COMPLETE) { if (missionID == m_AlienPartMissionID && missionState == eMissionState::READY_TO_COMPLETE) {
auto* inventoryComponent = target->GetComponent<InventoryComponent>(); auto* inventoryComponent = target->GetComponent<InventoryComponent>();
for (const auto& alienPartLot : m_AlienPartLots) { for (const auto& alienPartLot : m_AlienPartLots) {
inventoryComponent->RemoveItem(alienPartLot, 1); inventoryComponent->RemoveItem(alienPartLot, 1);

View File

@ -2,7 +2,7 @@
#include "CppScripts.h" #include "CppScripts.h"
class NtVandaServer : public CppScripts::Script { class NtVandaServer : public CppScripts::Script {
void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) override; void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) override;
const uint32_t m_AlienPartMissionID = 1183; const uint32_t m_AlienPartMissionID = 1183;
const std::vector<LOT> m_AlienPartLots = { 12479, 12480, 12481 }; const std::vector<LOT> m_AlienPartLots = { 12479, 12480, 12481 };
}; };

View File

@ -1,6 +1,7 @@
#include "NtVentureSpeedPadServer.h" #include "NtVentureSpeedPadServer.h"
#include "SkillComponent.h" #include "SkillComponent.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "eMissionTaskType.h"
void NtVentureSpeedPadServer::OnStartup(Entity* self) { void NtVentureSpeedPadServer::OnStartup(Entity* self) {
self->SetProximityRadius(3, "speedboost"); self->SetProximityRadius(3, "speedboost");
@ -17,7 +18,7 @@ void NtVentureSpeedPadServer::OnProximityUpdate(Entity* self, Entity* entering,
auto* missionComponent = player->GetComponent<MissionComponent>(); auto* missionComponent = player->GetComponent<MissionComponent>();
if (missionComponent != nullptr) { if (missionComponent != nullptr) {
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_SCRIPT, self->GetLOT()); missionComponent->Progress(eMissionTaskType::SCRIPT, self->GetLOT());
} }
auto* skillComponent = player->GetComponent<SkillComponent>(); auto* skillComponent = player->GetComponent<SkillComponent>();

View File

@ -2,6 +2,7 @@
#include "InventoryComponent.h" #include "InventoryComponent.h"
#include "GameMessages.h" #include "GameMessages.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "eMissionState.h"
void SpawnGryphonServer::SetVariables(Entity* self) { void SpawnGryphonServer::SetVariables(Entity* self) {
self->SetVar<LOT>(u"petLOT", 12433); self->SetVar<LOT>(u"petLOT", 12433);
@ -17,7 +18,7 @@ void SpawnGryphonServer::OnUse(Entity* self, Entity* user) {
// Little extra for handling the case of the egg being placed the first time // Little extra for handling the case of the egg being placed the first time
if (missionComponent != nullptr && inventoryComponent != nullptr if (missionComponent != nullptr && inventoryComponent != nullptr
&& missionComponent->GetMissionState(1391) == MissionState::MISSION_STATE_ACTIVE) { && missionComponent->GetMissionState(1391) == eMissionState::ACTIVE) {
inventoryComponent->RemoveItem(12483, inventoryComponent->GetLotCount(12483)); inventoryComponent->RemoveItem(12483, inventoryComponent->GetLotCount(12483));
GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID()); GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID());
return; return;

View File

@ -6,6 +6,7 @@
#include "dZoneManager.h" #include "dZoneManager.h"
#include "RenderComponent.h" #include "RenderComponent.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "eMissionState.h"
void ZoneAgProperty::SetGameVariables(Entity* self) { void ZoneAgProperty::SetGameVariables(Entity* self) {
self->SetVar<std::string>(GuardGroup, "Guard"); self->SetVar<std::string>(GuardGroup, "Guard");
@ -80,7 +81,7 @@ void ZoneAgProperty::PropGuardCheck(Entity* self, Entity* player) {
const auto state = missionComponent->GetMissionState(self->GetVar<uint32_t>(guardMissionFlag)); const auto state = missionComponent->GetMissionState(self->GetVar<uint32_t>(guardMissionFlag));
const auto firstState = missionComponent->GetMissionState(self->GetVar<uint32_t>(guardFirstMissionFlag)); const auto firstState = missionComponent->GetMissionState(self->GetVar<uint32_t>(guardFirstMissionFlag));
if (firstState < MissionState::MISSION_STATE_COMPLETE || (state != MissionState::MISSION_STATE_COMPLETE && state != MissionState::MISSION_STATE_COMPLETE_READY_TO_COMPLETE)) if (firstState < eMissionState::COMPLETE || (state != eMissionState::COMPLETE && state != eMissionState::COMPLETE_READY_TO_COMPLETE))
ActivateSpawner(self->GetVar<std::string>(PropertyMGSpawner)); ActivateSpawner(self->GetVar<std::string>(PropertyMGSpawner));
} }
@ -304,13 +305,13 @@ void ZoneAgProperty::OnZonePropertyModelPlaced(Entity* self, Entity* player) {
if (!character->GetPlayerFlag(101)) { if (!character->GetPlayerFlag(101)) {
BaseZonePropertyModelPlaced(self, player); BaseZonePropertyModelPlaced(self, player);
character->SetPlayerFlag(101, true); character->SetPlayerFlag(101, true);
if (missionComponent->GetMissionState(871) == MissionState::MISSION_STATE_ACTIVE) { if (missionComponent->GetMissionState(871) == eMissionState::ACTIVE) {
self->SetNetworkVar<std::u16string>(u"Tooltip", u"AnotherModel"); self->SetNetworkVar<std::u16string>(u"Tooltip", u"AnotherModel");
} }
} else if (!character->GetPlayerFlag(102)) { } else if (!character->GetPlayerFlag(102)) {
character->SetPlayerFlag(102, true); character->SetPlayerFlag(102, true);
if (missionComponent->GetMissionState(871) == MissionState::MISSION_STATE_ACTIVE) { if (missionComponent->GetMissionState(871) == eMissionState::ACTIVE) {
self->SetNetworkVar<std::u16string>(u"Tooltip", u"TwoMoreModels"); self->SetNetworkVar<std::u16string>(u"Tooltip", u"TwoMoreModels");
} }
@ -331,7 +332,7 @@ void ZoneAgProperty::OnZonePropertyModelPickedUp(Entity* self, Entity* player) {
if (!character->GetPlayerFlag(109)) { if (!character->GetPlayerFlag(109)) {
character->SetPlayerFlag(109, true); character->SetPlayerFlag(109, true);
if (missionComponent->GetMissionState(891) == MissionState::MISSION_STATE_ACTIVE && !character->GetPlayerFlag(110)) { if (missionComponent->GetMissionState(891) == eMissionState::ACTIVE && !character->GetPlayerFlag(110)) {
self->SetNetworkVar<std::u16string>(u"Tooltip", u"Rotate"); self->SetNetworkVar<std::u16string>(u"Tooltip", u"Rotate");
} }
} }
@ -353,7 +354,7 @@ void ZoneAgProperty::OnZonePropertyModelRotated(Entity* self, Entity* player) {
if (!character->GetPlayerFlag(110)) { if (!character->GetPlayerFlag(110)) {
character->SetPlayerFlag(110, true); character->SetPlayerFlag(110, true);
if (missionComponent->GetMissionState(891) == MissionState::MISSION_STATE_ACTIVE) { if (missionComponent->GetMissionState(891) == eMissionState::ACTIVE) {
self->SetNetworkVar<std::u16string>(u"Tooltip", u"PlaceModel"); self->SetNetworkVar<std::u16string>(u"Tooltip", u"PlaceModel");
self->SetVar<std::string>(u"tutorial", "place_model"); self->SetVar<std::string>(u"tutorial", "place_model");
} }

View File

@ -1,5 +1,6 @@
#include "SsModularBuildServer.h" #include "SsModularBuildServer.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "eMissionState.h"
void SsModularBuildServer::OnModularBuildExit(Entity* self, Entity* player, bool bCompleted, std::vector<LOT> modules) { void SsModularBuildServer::OnModularBuildExit(Entity* self, Entity* player, bool bCompleted, std::vector<LOT> modules) {
int missionNum = 1732; int missionNum = 1732;
@ -8,7 +9,7 @@ void SsModularBuildServer::OnModularBuildExit(Entity* self, Entity* player, bool
MissionComponent* mission = static_cast<MissionComponent*>(player->GetComponent(COMPONENT_TYPE_MISSION)); MissionComponent* mission = static_cast<MissionComponent*>(player->GetComponent(COMPONENT_TYPE_MISSION));
Mission* rocketMission = mission->GetMission(missionNum); Mission* rocketMission = mission->GetMission(missionNum);
if (rocketMission->GetMissionState() == MissionState::MISSION_STATE_ACTIVE) { if (rocketMission->GetMissionState() == eMissionState::ACTIVE) {
mission->ForceProgress(missionNum, 2478, 1); mission->ForceProgress(missionNum, 2478, 1);
} }
} }

View File

@ -3,10 +3,11 @@
#include "EntityManager.h" #include "EntityManager.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "GameMessages.h" #include "GameMessages.h"
#include "eMissionState.h"
void VeBricksampleServer::OnUse(Entity* self, Entity* user) { void VeBricksampleServer::OnUse(Entity* self, Entity* user) {
auto* missionComponent = user->GetComponent<MissionComponent>(); auto* missionComponent = user->GetComponent<MissionComponent>();
if (missionComponent != nullptr && missionComponent->GetMissionState(1183) == MissionState::MISSION_STATE_ACTIVE) { if (missionComponent != nullptr && missionComponent->GetMissionState(1183) == eMissionState::ACTIVE) {
const auto loot = self->GetVar<int32_t>(m_LootVariable); const auto loot = self->GetVar<int32_t>(m_LootVariable);
auto* inventoryComponent = user->GetComponent<InventoryComponent>(); auto* inventoryComponent = user->GetComponent<InventoryComponent>();

View File

@ -2,17 +2,17 @@
#include "Character.h" #include "Character.h"
#include "EntityManager.h" #include "EntityManager.h"
#include "GameMessages.h" #include "GameMessages.h"
#include "MissionState.h" #include "eMissionState.h"
#include "Entity.h" #include "Entity.h"
void VeEpsilonServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) { void VeEpsilonServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
auto* character = target->GetCharacter(); auto* character = target->GetCharacter();
if (character == nullptr) if (character == nullptr)
return; return;
// Resets the player flags that track which consoles they've used // Resets the player flags that track which consoles they've used
if ((missionID == m_ConsoleMissionID || missionID == m_ConsoleRepeatMissionID) if ((missionID == m_ConsoleMissionID || missionID == m_ConsoleRepeatMissionID)
&& (missionState == MissionState::MISSION_STATE_AVAILABLE || missionState == MissionState::MISSION_STATE_COMPLETE_AVAILABLE)) { && (missionState == eMissionState::AVAILABLE || missionState == eMissionState::COMPLETE_AVAILABLE)) {
for (auto i = 0; i < 10; i++) { for (auto i = 0; i < 10; i++) {
character->SetPlayerFlag(m_ConsoleBaseFlag + i, false); character->SetPlayerFlag(m_ConsoleBaseFlag + i, false);

View File

@ -2,7 +2,7 @@
#include "CppScripts.h" #include "CppScripts.h"
class VeEpsilonServer : public CppScripts::Script { class VeEpsilonServer : public CppScripts::Script {
void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) override; void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) override;
const uint32_t m_ConsoleMissionID = 1220; const uint32_t m_ConsoleMissionID = 1220;
const uint32_t m_ConsoleRepeatMissionID = 1225; const uint32_t m_ConsoleRepeatMissionID = 1225;
const uint32_t m_ConsoleBaseFlag = 1010; const uint32_t m_ConsoleBaseFlag = 1010;

View File

@ -1,6 +1,7 @@
#include "NjColeNPC.h" #include "NjColeNPC.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "InventoryComponent.h" #include "InventoryComponent.h"
#include "eMissionState.h"
void NjColeNPC::OnEmoteReceived(Entity* self, int32_t emote, Entity* target) { void NjColeNPC::OnEmoteReceived(Entity* self, int32_t emote, Entity* target) {
if (emote != 393) { if (emote != 393) {
@ -26,10 +27,10 @@ void NjColeNPC::OnEmoteReceived(Entity* self, int32_t emote, Entity* target) {
missionComponent->ForceProgressTaskType(1818, 1, 1); missionComponent->ForceProgressTaskType(1818, 1, 1);
} }
void NjColeNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) { void NjColeNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
NjNPCMissionSpinjitzuServer::OnMissionDialogueOK(self, target, missionID, missionState); NjNPCMissionSpinjitzuServer::OnMissionDialogueOK(self, target, missionID, missionState);
if (missionID == 1818 && missionState >= MissionState::MISSION_STATE_READY_TO_COMPLETE) { if (missionID == 1818 && missionState >= eMissionState::READY_TO_COMPLETE) {
auto* missionComponent = target->GetComponent<MissionComponent>(); auto* missionComponent = target->GetComponent<MissionComponent>();
auto* inventoryComponent = target->GetComponent<InventoryComponent>(); auto* inventoryComponent = target->GetComponent<InventoryComponent>();

View File

@ -3,5 +3,5 @@
class NjColeNPC : public NjNPCMissionSpinjitzuServer { class NjColeNPC : public NjNPCMissionSpinjitzuServer {
void OnEmoteReceived(Entity* self, int32_t emote, Entity* target) override; void OnEmoteReceived(Entity* self, int32_t emote, Entity* target) override;
void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) override; void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) override;
}; };

View File

@ -1,6 +1,6 @@
#include "NjJayMissionItems.h" #include "NjJayMissionItems.h"
void NjJayMissionItems::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) { void NjJayMissionItems::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
NjNPCMissionSpinjitzuServer::OnMissionDialogueOK(self, target, missionID, missionState); NjNPCMissionSpinjitzuServer::OnMissionDialogueOK(self, target, missionID, missionState);
NPCAddRemoveItem::OnMissionDialogueOK(self, target, missionID, missionState); NPCAddRemoveItem::OnMissionDialogueOK(self, target, missionID, missionState);
} }

View File

@ -5,6 +5,6 @@
#include <map> #include <map>
class NjJayMissionItems : public NjNPCMissionSpinjitzuServer, NPCAddRemoveItem { class NjJayMissionItems : public NjNPCMissionSpinjitzuServer, NPCAddRemoveItem {
void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) override; void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) override;
std::map<uint32_t, std::vector<ItemSetting>> GetSettings() override; std::map<uint32_t, std::vector<ItemSetting>> GetSettings() override;
}; };

View File

@ -1,13 +1,12 @@
#include "NjNPCMissionSpinjitzuServer.h" #include "NjNPCMissionSpinjitzuServer.h"
#include "Character.h" #include "Character.h"
#include "EntityManager.h" #include "EntityManager.h"
#include "MissionState.h" #include "eMissionState.h"
void NjNPCMissionSpinjitzuServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, void NjNPCMissionSpinjitzuServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
MissionState missionState) {
const auto& element = self->GetVar<std::u16string>(ElementVariable); const auto& element = self->GetVar<std::u16string>(ElementVariable);
if (missionID == ElementMissions.at(element) && missionState >= MissionState::MISSION_STATE_READY_TO_COMPLETE) { if (missionID == ElementMissions.at(element) && missionState >= eMissionState::READY_TO_COMPLETE) {
const auto targetID = target->GetObjectID(); const auto targetID = target->GetObjectID();

View File

@ -18,7 +18,7 @@ static std::map<std::u16string, uint32_t> ElementMissions = {
class NjNPCMissionSpinjitzuServer : public CppScripts::Script { class NjNPCMissionSpinjitzuServer : public CppScripts::Script {
public: public:
void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) override; void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) override;
private: private:
const std::u16string ElementVariable = u"element"; const std::u16string ElementVariable = u"element";
}; };

Some files were not shown because too many files have changed in this diff Show More