From 6aa90ad5b2dc536f4ab97814d9532092560747bf Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Tue, 2 May 2023 17:39:21 -0500 Subject: [PATCH] Breakout rest of the enums from dCommonVars and clean it up (#1061) * Breakout rest of the enums from dcommonvars so we don't have to deal with merge conflicts ePlayerFlags is not a scoped enum, yet, due to it's complexity * address feedback * make player flag types consistent * fix typo --- dCommon/Brick.h | 11 + dCommon/dEnums/dCommonVars.h | 398 ------------------ dCommon/dEnums/eBuildType.h | 12 + dCommon/dEnums/eCharacterCreationResponse.h | 14 + dCommon/dEnums/eCinematicEvent.h | 12 + dCommon/dEnums/eControlScheme.h | 18 + dCommon/dEnums/eCyclingMode.h | 11 + dCommon/dEnums/eGameActivity.h | 15 + dCommon/dEnums/eKillType.h | 11 + dCommon/dEnums/eLoginResponse.h | 24 ++ dCommon/dEnums/eLootSourceType.h | 31 ++ dCommon/dEnums/eMatchUpdate.h | 17 + dCommon/dEnums/eObjectWorldState.h | 12 + dCommon/dEnums/ePetTamingNotifyType.h | 15 + dCommon/dEnums/ePlayerFlag.h | 172 ++++++++ dCommon/dEnums/eQuickBuildFailReason.h | 13 + dCommon/dEnums/eRebuildState.h | 15 + dCommon/dEnums/eRenameResponse.h | 15 + dCommon/dEnums/eReplicaPacketType.h | 12 + dCommon/dEnums/eStateChangeType.h | 11 + dCommon/dEnums/eTerminateType.h | 12 + dCommon/dEnums/eUseItemResponse.h | 12 + dGame/Character.cpp | 19 +- dGame/Character.h | 5 +- dGame/Entity.cpp | 11 +- dGame/Entity.h | 3 + dGame/EntityManager.cpp | 13 +- dGame/TradingManager.cpp | 8 +- dGame/UserManager.cpp | 22 +- dGame/dBehaviors/ImmunityBehavior.cpp | 1 + dGame/dComponents/BaseCombatAIComponent.cpp | 4 +- dGame/dComponents/CharacterComponent.cpp | 3 +- dGame/dComponents/CharacterComponent.h | 8 +- .../ControllablePhysicsComponent.cpp | 1 + .../ControllablePhysicsComponent.h | 1 + dGame/dComponents/DestroyableComponent.cpp | 14 +- dGame/dComponents/DestroyableComponent.h | 1 + dGame/dComponents/InventoryComponent.cpp | 8 +- dGame/dComponents/InventoryComponent.h | 3 +- .../dComponents/LevelProgressionComponent.cpp | 2 +- dGame/dComponents/PetComponent.cpp | 32 +- dGame/dComponents/PetComponent.h | 2 +- dGame/dComponents/PossessorComponent.cpp | 4 +- .../PropertyManagementComponent.cpp | 8 +- dGame/dComponents/RacingControlComponent.cpp | 4 +- dGame/dComponents/RailActivatorComponent.cpp | 3 +- dGame/dComponents/RebuildComponent.cpp | 59 +-- dGame/dComponents/RebuildComponent.h | 6 +- .../RocketLaunchpadControlComponent.cpp | 3 +- .../dComponents/ScriptedActivityComponent.cpp | 17 +- dGame/dComponents/SwitchComponent.cpp | 2 +- dGame/dGameMessages/GameMessages.cpp | 84 ++-- dGame/dGameMessages/GameMessages.h | 34 +- dGame/dInventory/Item.cpp | 9 +- dGame/dInventory/Item.h | 7 +- dGame/dMission/Mission.cpp | 12 +- dGame/dUtilities/Loot.cpp | 4 +- dGame/dUtilities/Loot.h | 4 +- dGame/dUtilities/Mail.cpp | 4 +- dGame/dUtilities/SlashCommandHandler.cpp | 25 +- dNet/AuthPackets.cpp | 21 +- dNet/AuthPackets.h | 1 + dNet/WorldPackets.cpp | 3 +- dNet/WorldPackets.h | 4 +- .../02_server/Enemy/General/BaseEnemyApe.cpp | 3 +- .../02_server/Equipment/BootyDigServer.cpp | 4 +- .../02_server/Map/AG/AgCagedBricksServer.cpp | 3 +- dScripts/02_server/Map/AG/NpcCowboyServer.cpp | 2 +- dScripts/02_server/Map/AG/NpcPirateServer.cpp | 2 +- dScripts/02_server/Map/AG/NpcWispServer.cpp | 2 +- .../02_server/Map/AG/RemoveRentalGear.cpp | 3 +- dScripts/02_server/Map/AG/RemoveRentalGear.h | 1 - dScripts/02_server/Map/AM/AmBlueX.cpp | 2 +- dScripts/02_server/Map/AM/AmBridge.cpp | 2 +- dScripts/02_server/Map/AM/AmDrawBridge.cpp | 3 +- .../02_server/Map/AM/AmDropshipComputer.cpp | 8 +- .../Map/AM/AmShieldGeneratorQuickbuild.cpp | 2 +- dScripts/02_server/Map/AM/AmSkullkinDrill.cpp | 5 +- dScripts/02_server/Map/AM/AmTeapotServer.cpp | 3 +- .../02_server/Map/FV/ImgBrickConsoleQB.cpp | 19 +- .../Map/FV/Racing/RaceMaelstromGeiser.cpp | 2 +- .../02_server/Map/GF/GfCaptainsCannon.cpp | 4 +- dScripts/02_server/Map/GF/GfTikiTorch.cpp | 3 +- dScripts/02_server/Map/GF/MastTeleport.cpp | 1 + .../Ninjago/NjRailActivatorsServer.cpp | 2 +- .../Map/General/Ninjago/NjRailPostServer.cpp | 4 +- .../Ninjago/NjhubLavaPlayerDeathTrigger.cpp | 2 +- .../02_server/Map/General/PetDigServer.cpp | 6 +- .../Map/General/PropertyPlatform.cpp | 2 +- .../Map/General/TokenConsoleServer.cpp | 12 +- .../Map/General/WishingWellServer.cpp | 1 + .../02_server/Map/NS/NsTokenConsoleServer.cpp | 18 +- .../02_server/Map/NT/NtAssemblyTubeServer.cpp | 1 + .../02_server/Map/NT/NtDirtCloudServer.cpp | 2 +- dScripts/02_server/Map/NT/NtDukeServer.cpp | 5 +- dScripts/02_server/Map/NT/NtHaelServer.cpp | 3 +- .../Map/NT/NtImagimeterVisibility.cpp | 3 +- .../02_server/Map/NT/NtOverbuildServer.cpp | 3 +- .../02_server/Map/NT/NtParadoxPanelServer.cpp | 2 + .../02_server/Map/NT/NtParadoxTeleServer.cpp | 1 + .../Map/NT/NtVentureCannonServer.cpp | 4 +- .../02_server/Map/PR/SpawnGryphonServer.cpp | 3 +- .../Map/Property/AG_Small/ZoneAgProperty.cpp | 2 +- .../Map/Property/NS_Med/ZoneNsMedProperty.cpp | 4 +- .../02_server/Map/VE/VeBricksampleServer.cpp | 2 +- dScripts/02_server/Map/VE/VeEpsilonServer.h | 2 +- .../02_server/Map/VE/VeMissionConsole.cpp | 7 +- .../Map/njhub/CatapultBaseServer.cpp | 2 +- .../02_server/Map/njhub/CavePrisonCage.cpp | 2 +- .../Map/njhub/ImaginationShrineServer.cpp | 2 +- dScripts/02_server/Map/njhub/NjColeNPC.cpp | 2 +- .../Map/njhub/NjDragonEmblemChestServer.cpp | 3 +- .../Map/njhub/NjGarmadonCelebration.cpp | 5 +- .../Map/njhub/NjNPCMissionSpinjitzuServer.h | 11 +- .../Map/njhub/NjScrollChestServer.cpp | 2 +- dScripts/02_server/Map/njhub/NjWuNPC.cpp | 5 +- .../boss_instance/NjMonastryBossInstance.cpp | 8 +- dScripts/02_server/Pets/DamagingPets.cpp | 11 +- dScripts/02_server/Pets/DamagingPets.h | 2 +- dScripts/02_server/Pets/PetFromDigServer.cpp | 13 +- dScripts/02_server/Pets/PetFromDigServer.h | 2 +- .../02_server/Pets/PetFromObjectServer.cpp | 15 +- dScripts/02_server/Pets/PetFromObjectServer.h | 2 +- dScripts/BaseConsoleTeleportServer.cpp | 6 +- dScripts/BasePropertyServer.cpp | 6 +- dScripts/ChooseYourDestinationNsToNt.cpp | 3 +- dScripts/CppScripts.h | 4 +- .../EquipmentScripts/PersonalFortress.cpp | 1 + dScripts/EquipmentScripts/StunImmunity.cpp | 1 + dScripts/NPCAddRemoveItem.cpp | 2 +- dScripts/NtFactionSpyServer.cpp | 6 +- dScripts/NtFactionSpyServer.h | 2 +- dScripts/SpawnPetBaseServer.cpp | 3 +- dScripts/ai/ACT/ActMine.cpp | 2 +- dScripts/ai/ACT/ActVehicleDeathTrigger.cpp | 2 +- .../ai/ACT/FootRace/BaseFootRaceManager.cpp | 2 +- dScripts/ai/AG/AgPicnicBlanket.cpp | 3 +- dScripts/ai/AG/AgQbElevator.cpp | 2 +- dScripts/ai/AG/AgShipPlayerShockServer.cpp | 1 + dScripts/ai/FV/ActNinjaTurret.cpp | 5 +- dScripts/ai/FV/ActParadoxPipeFix.cpp | 4 +- dScripts/ai/FV/FvBrickPuzzleServer.cpp | 4 +- dScripts/ai/FV/FvConsoleLeftQuickbuild.cpp | 8 +- dScripts/ai/FV/FvConsoleRightQuickbuild.cpp | 8 +- dScripts/ai/FV/FvDragonSmashingGolemQb.cpp | 3 +- dScripts/ai/FV/FvFacilityBrick.cpp | 2 +- dScripts/ai/FV/FvPandaServer.cpp | 11 +- dScripts/ai/FV/FvPandaServer.h | 2 +- ...nceExitTransferPlayerToLastNonInstance.cpp | 1 + dScripts/ai/GENERAL/LegoDieRoll.cpp | 2 +- dScripts/ai/GF/GfJailWalls.cpp | 3 +- dScripts/ai/GF/PetDigBuild.cpp | 2 +- dScripts/ai/GF/PirateRep.cpp | 3 +- .../ai/MINIGAME/SG_GF/SERVER/SGCannon.cpp | 5 +- dScripts/ai/NS/NsConcertInstrument.cpp | 8 +- dScripts/ai/NS/NsConcertQuickBuild.cpp | 2 +- dScripts/ai/NS/NsGetFactionMissionServer.cpp | 5 +- dScripts/ai/SPEC/SpecialCoinSpawner.cpp | 2 +- dScripts/client/ai/PR/CrabServer.cpp | 13 +- dScripts/client/ai/PR/CrabServer.h | 2 +- .../DestroyableComponentTests.cpp | 1 + 161 files changed, 960 insertions(+), 776 deletions(-) create mode 100644 dCommon/Brick.h create mode 100644 dCommon/dEnums/eBuildType.h create mode 100644 dCommon/dEnums/eCharacterCreationResponse.h create mode 100644 dCommon/dEnums/eCinematicEvent.h create mode 100644 dCommon/dEnums/eControlScheme.h create mode 100644 dCommon/dEnums/eCyclingMode.h create mode 100644 dCommon/dEnums/eGameActivity.h create mode 100644 dCommon/dEnums/eKillType.h create mode 100644 dCommon/dEnums/eLoginResponse.h create mode 100644 dCommon/dEnums/eLootSourceType.h create mode 100644 dCommon/dEnums/eMatchUpdate.h create mode 100644 dCommon/dEnums/eObjectWorldState.h create mode 100644 dCommon/dEnums/ePetTamingNotifyType.h create mode 100644 dCommon/dEnums/ePlayerFlag.h create mode 100644 dCommon/dEnums/eQuickBuildFailReason.h create mode 100644 dCommon/dEnums/eRebuildState.h create mode 100644 dCommon/dEnums/eRenameResponse.h create mode 100644 dCommon/dEnums/eReplicaPacketType.h create mode 100644 dCommon/dEnums/eStateChangeType.h create mode 100644 dCommon/dEnums/eTerminateType.h create mode 100644 dCommon/dEnums/eUseItemResponse.h diff --git a/dCommon/Brick.h b/dCommon/Brick.h new file mode 100644 index 00000000..e8bd747e --- /dev/null +++ b/dCommon/Brick.h @@ -0,0 +1,11 @@ +#ifndef __BRICK__H__ +#define __BRICK__H__ + +#include + +struct Brick { + uint32_t designerID; + uint32_t materialID; +}; + +#endif //!__BRICK__H__ diff --git a/dCommon/dEnums/dCommonVars.h b/dCommon/dEnums/dCommonVars.h index ff8ec836..26201c3d 100644 --- a/dCommon/dEnums/dCommonVars.h +++ b/dCommon/dEnums/dCommonVars.h @@ -10,8 +10,6 @@ #pragma warning (disable:4251) //Disables SQL warnings -typedef int RESTICKET; - // These are the same define, but they mean two different things in different contexts // so a different define to distinguish what calculation is happening will help clarity. #define FRAMES_TO_MS(x) 1000 / x @@ -45,23 +43,16 @@ typedef uint16_t LWOINSTANCEID; //!< Used for Instance IDs typedef uint32_t PROPERTYCLONELIST; //!< Used for Property Clone IDs typedef uint32_t StripId; -typedef int32_t PetTamingPiece; //!< Pet Taming Pieces - const LWOOBJID LWOOBJID_EMPTY = 0; //!< An empty object ID const LOT LOT_NULL = -1; //!< A null LOT const int32_t LOOTTYPE_NONE = 0; //!< No loot type available const float SECONDARY_PRIORITY = 1.0f; //!< Secondary Priority -const uint32_t INVENTORY_INVALID = -1; //!< Invalid Inventory -const uint32_t INVENTORY_DEFAULT = -1; //!< Default Inventory -const uint32_t StatusChangeInfo = 0; //!< Status Change Info (???) const uint32_t INVENTORY_MAX = 9999999; //!< The Maximum Inventory Size const uint32_t LWOCLONEID_INVALID = -1; //!< Invalid LWOCLONEID const uint16_t LWOINSTANCEID_INVALID = -1; //!< Invalid LWOINSTANCEID const uint16_t LWOMAPID_INVALID = -1; //!< Invalid LWOMAPID const uint64_t LWOZONEID_INVALID = 0; //!< Invalid LWOZONEID -typedef std::set TSetObjID; - const float PI = 3.14159f; //============ STRUCTS ============== @@ -164,393 +155,4 @@ public: } }; -struct Brick { - uint32_t designerID; - uint32_t materialID; -}; - -//This union is used by the behavior system -union suchar { - unsigned char usigned; - char svalue; -}; - -//=========== LU ENUMS ============ - -//! An enum for MatchUpdate types -enum eMatchUpdate : int { - MATCH_UPDATE_PLAYER_JOINED = 0, - MATCH_UPDATE_PLAYER_LEFT = 1, - MATCH_UPDATE_TIME = 3, - MATCH_UPDATE_TIME_START_DELAY = 4, - MATCH_UPDATE_PLAYER_READY = 5, - MATCH_UPDATE_PLAYER_UNREADY = 6 -}; - -//! An enum for camera cycling modes -enum eCyclingMode : uint32_t { - ALLOW_CYCLE_TEAMMATES, - DISALLOW_CYCLING -}; - -enum eCinematicEvent : uint32_t { - STARTED, - WAYPOINT, - ENDED, -}; - -//! An enum for character creation responses -enum eCreationResponse : uint8_t { - CREATION_RESPONSE_SUCCESS = 0, //!< The creation was successful - CREATION_RESPONSE_OBJECT_ID_UNAVAILABLE, //!< The Object ID can't be used - CREATION_RESPONSE_NAME_NOT_ALLOWED, //!< The name is not allowed - CREATION_RESPONSE_PREDEFINED_NAME_IN_USE, //!< The predefined name is already in use - CREATION_RESPONSE_CUSTOM_NAME_IN_USE //!< The custom name is already in use -}; - -//! An enum for login responses -enum eLoginResponse : uint8_t { - LOGIN_RESPONSE_GENERAL_FAILED = 0, - LOGIN_RESPONSE_SUCCESS = 1, - LOGIN_RESPONSE_BANNED = 2, - LOGIN_RESPONSE_PERMISSIONS_NOT_HIGH_ENOUGH = 5, - LOGIN_RESPONSE_WRONG_PASS_OR_USER = 6, - LOGIN_RESPONSE_ACCOUNT_LOCKED = 7 -}; - -//! An enum for character rename responses -enum eRenameResponse : uint8_t { - RENAME_RESPONSE_SUCCESS = 0, //!< The renaming was successful - RENAME_RESPONSE_UNKNOWN_ERROR, //!< There was an unknown error - RENAME_RESPONSE_NAME_UNAVAILABLE, //!< The name is unavailable - RENAME_RESPONSE_NAME_IN_USE //!< The name is already in use -}; - -//! A replica packet type -enum eReplicaPacketType { - PACKET_TYPE_CONSTRUCTION, //!< A construction packet - PACKET_TYPE_SERIALIZATION, //!< A serialization packet - PACKET_TYPE_DESTRUCTION //!< A destruction packet -}; - -//! The Behavior Types for use with the AI system -enum eCombatBehaviorTypes : uint32_t { - PASSIVE = 0, //!< The object is passive - AGGRESSIVE = 1, //!< The object is aggressive - PASSIVE_TURRET = 2, //!< The object is a passive turret - AGGRESSIVE_TURRET = 3 //!< The object is an aggressive turret -}; - -//! The Combat Role Type for use with the AI system -enum eCombatRoleType : uint32_t { - MELEE = 0, //!< Used for melee attacks - RANGED = 1, //!< Used for range attacks - SUPPORT = 2 //!< Used for support -}; - -//! The kill types for the Die packet -enum eKillType : uint32_t { - VIOLENT, - SILENT -}; - -//! The various world states used throughout the server -enum eObjectWorldState { - WORLDSTATE_INWORLD, //!< Probably used when the object is in the world - WORLDSTATE_ATTACHED, //!< Probably used when the object is attached to another object - WORLDSTATE_INVENTORY //!< Probably used when the object is in an inventory -}; - -//! The trigger stats (???) -enum eTriggerStat { - INVALID_STAT, //!< ??? - HEALTH, //!< Probably used for health - ARMOR, //!< Probably used for armor - IMAGINATION //!< Probably used for imagination -}; - -//! The trigger operations (???) -enum eTriggerOperator { - INVALID_OPER, //!< ??? - EQUAL, //!< ??? - NOT_EQUAL, //!< ??? - GREATER, //!< ??? - GREATER_EQUAL, //!< ??? - LESS, //!< ??? - LESS_EQUAL //!< ??? -}; - -//! The various build types -enum eBuildType { - BUILD_NOWHERE, //!< Used if something can't be built anywhere - BUILD_IN_WORLD, //!< Used if something can be built in the world - BUILD_ON_PROPERTY //!< Used if something can be build on a property -}; - -//! Quickbuild fail reasons -enum eFailReason : uint32_t { - REASON_NOT_GIVEN, - REASON_OUT_OF_IMAGINATION, - REASON_CANCELED_EARLY, - REASON_BUILD_ENDED -}; - -//! Terminate interaction type -enum eTerminateType : uint32_t { - RANGE, - USER, - FROM_INTERACTION -}; - -//! The combat state -enum eCombatState { - IDLE, //!< The AI is in an idle state - AGGRO, //!< The AI is in an aggressive state - TETHER, //!< The AI is being redrawn back to tether point - SPAWN, //!< The AI is spawning - DEAD //!< The AI is dead -}; - -enum eControlSceme { - SCHEME_A, - SCHEME_D, - SCHEME_GAMEPAD, - SCHEME_E, - SCHEME_FPS, - SCHEME_DRIVING, - SCHEME_TAMING, - SCHEME_MODULAR_BUILD, - SCHEME_WEAR_A_ROBOT //== freecam? -}; - -enum class eStateChangeType : uint32_t { - PUSH, - POP -}; - -enum eNotifyType { - NOTIFY_TYPE_SUCCESS, - NOTIFY_TYPE_QUIT, - NOTIFY_TYPE_FAILED, - NOTIFY_TYPE_BEGIN, - NOTIFY_TYPE_READY, - NOTIFY_TYPE_NAMINGPET -}; - - -enum class UseItemResponse : uint32_t { - NoImaginationForPet = 1, - FailedPrecondition, - MountsNotAllowed -}; - -enum eRebuildState : uint32_t { - REBUILD_OPEN, - REBUILD_COMPLETED = 2, - REBUILD_RESETTING = 4, - REBUILD_BUILDING, - REBUILD_INCOMPLETE -}; - -/** - * The loot source's type. - */ -enum eLootSourceType : int32_t { - LOOT_SOURCE_NONE = 0, - LOOT_SOURCE_CHEST, - LOOT_SOURCE_MISSION, - LOOT_SOURCE_MAIL, - LOOT_SOURCE_CURRENCY, - LOOT_SOURCE_ACHIEVEMENT, - LOOT_SOURCE_TRADE, - LOOT_SOURCE_QUICKBUILD, - LOOT_SOURCE_DELETION, - LOOT_SOURCE_VENDOR, - LOOT_SOURCE_ACTIVITY, - LOOT_SOURCE_PICKUP, - LOOT_SOURCE_BRICK, - LOOT_SOURCE_PROPERTY, - LOOT_SOURCE_MODERATION, - LOOT_SOURCE_EXHIBIT, - LOOT_SOURCE_INVENTORY, - LOOT_SOURCE_CLAIMCODE, - LOOT_SOURCE_CONSUMPTION, - LOOT_SOURCE_CRAFTING, - LOOT_SOURCE_LEVEL_REWARD, - LOOT_SOURCE_RELOCATE -}; - -enum eGameActivities : uint32_t { - ACTIVITY_NONE, - ACTIVITY_QUICKBUILDING, - ACTIVITY_SHOOTING_GALLERY, - ACTIVITY_RACING, - ACTIVITY_PINBALL, - ACTIVITY_PET_TAMING -}; - -enum ePlayerFlags { - BTARR_TESTING = 0, - PLAYER_HAS_ENTERED_PET_RANCH = 1, - MINIMAP_UNLOCKED = 2, - ACTIVITY_REBUILDING_FAIL_TIME = 3, - ACTIVITY_REBUILDING_FAIL_RANGE = 4, - ACTIVITY_SHOOTING_GALLERY_HELP = 5, - HELP_WALKING_CONTROLS = 6, - FIRST_SMASHABLE = 7, - FIRST_IMAGINATION_PICKUP = 8, - FIRST_DAMAGE = 9, - FIRST_ITEM = 10, - FIRST_BRICK = 11, - FIRST_CONSUMABLE = 12, - FIRST_EQUIPPABLE = 13, - CHAT_HELP = 14, - FIRST_PET_TAMING_MINIGAME = 15, - FIRST_PET_ON_SWITCH = 16, - FIRST_PET_JUMPED_ON_SWITCH = 17, - FIRST_PET_FOUND_TREASURE = 18, - FIRST_PET_DUG_TREASURE = 19, - FIRST_PET_OWNER_ON_PET_BOUNCER = 20, - FIRST_PET_DESPAWN_NO_IMAGINATION = 21, - FIRST_PET_SELECTED_ENOUGH_BRICKS = 22, - FIRST_EMOTE_UNLOCKED = 23, - GF_PIRATE_REP = 24, - AG_BOB_CINEMATIC_EVENT = 25, - HELP_JUMPING_CONTROLS = 26, - HELP_DOUBLE_JUMP_CONTROLS = 27, - HELP_CAMERA_CONTROLS = 28, - HELP_ROTATE_CONTROLS = 29, - HELP_SMASH = 30, - MONUMENT_INTRO_MUSIC_PLAYED = 31, - BEGINNING_ZONE_SUMMARY_DISPLAYED = 32, - AG_FINISH_LINE_BUILT = 33, - AG_BOSS_AREA_FOUND = 34, - AG_LANDED_IN_BATTLEFIELD = 35, - GF_PLAYER_HAS_BEEN_TO_THE_RAVINE = 36, - MODULAR_BUILD_STARTED = 37, - MODULAR_BUILD_FINISHED_CLICK_BUTTON = 38, - THINKING_HAT_RECEIVED_GO_TO_MODULAR_BUILD_AREA = 39, - BUILD_AREA_ENTERED_MOD_NOT_ACTIVATED_PUT_ON_HAT = 40, - HAT_ON_INSIDE_OF_MOD_BUILD_EQUIP_A_MODULE_FROM_LEG = 41, - MODULE_EQUIPPED_PLACE_ON_GLOWING_BLUE_SPOT = 42, - FIRST_MODULE_PLACED_CORRECTLY_NOW_DO_THE_REST = 43, - ROCKET_COMPLETE_NOW_LAUNCH_FROM_PAD = 44, - JOINED_A_FACTION = 45, - VENTURE_FACTION = 46, - ASSEMBLY_FACTION = 47, - PARADOX_FACTION = 48, - SENTINEL_FACTION = 49, - LUP_WORLD_ACCESS = 50, - AG_FIRST_FLAG_COLLECTED = 51, - TOOLTIP_TALK_TO_SKYLAND_TO_GET_HAT = 52, - MODULAR_BUILD_PLAYER_PLACES_FIRST_MODEL_IN_SCRATCH = 53, - MODULAR_BUILD_FIRST_ARROW_DISPLAY_FOR_MODULE = 54, - AG_BEACON_QB_SO_THE_PLAYER_CAN_ALWAYS_BUILD_THEM = 55, - GF_PET_DIG_FLAG_1 = 56, - GF_PET_DIG_FLAG_2 = 57, - GF_PET_DIG_FLAG_3 = 58, - SUPPRESS_SPACESHIP_CINEMATIC_FLYTHROUGH = 59, - GF_PLAYER_FALL_DEATH = 60, - GF_PLAYER_CAN_GET_FLAG_1 = 61, - GF_PLAYER_CAN_GET_FLAG_2 = 62, - GF_PLAYER_CAN_GET_FLAG_3 = 63, - ENTER_BBB_FROM_PROPERTY_EDIT_CONFIRMATION_DIALOG = 64, - AG_FIRST_COMBAT_COMPLETE = 65, - AG_COMPLETE_BOB_MISSION = 66, - IS_NEWS_SCREEN_VISIBLE = 114, - NJ_GARMADON_CINEMATIC_SEEN = 125, - ELEPHANT_PET_3050 = 801, - CAT_PET_3054 = 802, - TRICERATOPS_PET_3195 = 803, - TERRIER_PET_3254 = 804, - SKUNK_PET_3261 = 805, - LION_PET_3520 = 806, - BUNNY_PET_3672 = 807, - CROCODILE_PET_3994 = 808, - DOBERMAN_PET_5635 = 809, - BUFFALO_PET_5636 = 810, - ROBOT_DOG_PET_5637 = 811, - EUROPEAN_DRAGON_PET_5639 = 812, - TORTOISE_PET_5640 = 813, - ASIAN_DRAGON_PET_5641 = 814, - MANTIS_PET_5642 = 815, - PANDA_PET_5643 = 816, - WARTHOG_PET_6720 = 817, - GOAT_PET_7638 = 818, - CRAB_PET_7694 = 819, - AG_SPACE_SHIP_BINOC_AT_LAUNCH = 1001, - AG_SPACE_SHIP_BINOC_AT_LAUNCH_PLATFORM = 1002, - AG_SPACE_SHIP_BINOC_ON_PLATFORM_TO_LEFT_OF_START = 1003, - AG_SPACE_SHIP_BINOC_ON_PLATFORM_TO_RIGHT_OF_START = 1004, - AG_SPACE_SHIP_BINOC_AT_BOB = 1005, - AG_BATTLE_BINOC_FOR_TRICERETOPS = 1101, - AG_BATTLE_BINOC_AT_PARADOX = 1102, - AG_BATTLE_BINOC_AT_MISSION_GIVER = 1103, - AG_BATTLE_BINOC_AT_BECK = 1104, - AG_MONUMENT_BINOC_INTRO = 1105, - AG_MONUMENT_BINOC_OUTRO = 1106, - AG_LAUNCH_BINOC_INTRO = 1107, - AG_LAUNCH_BINOC_BISON = 1108, - AG_LAUNCH_BINOC_SHARK = 1109, - NS_BINOC_CONCERT_TRANSITION = 1201, - NS_BINOC_RACE_PLACE_TRANSITION = 1202, - NS_BINOC_BRICK_ANNEX_TRANSITION = 1203, - NS_BINOC_GF_LAUNCH = 1204, - NS_BINOC_FV_LAUNCH = 1205, - NS_BINOC_BRICK_ANNEX_WATER = 1206, - NS_BINOC_AG_LAUNCH_AT_RACE_PLACE = 1207, - NS_BINOC_AG_LAUNCH_AT_BRICK_ANNEX = 1208, - NS_BINOC_AG_LAUNCH_AT_PLAZA = 1209, - NS_BINOC_TBA = 1210, - NS_FLAG_COLLECTABLE_1_BY_JONNY_THUNDER = 1211, - NS_FLAG_COLLECTABLE_2_UNDER_CONCERT_BRIDGE = 1212, - NS_FLAG_COLLECTABLE_3_BY_FV_LAUNCH = 1213, - NS_FLAG_COLLECTABLE_4_IN_PLAZA_BEHIND_BUILDING = 1214, - NS_FLAG_COLLECTABLE_5_BY_GF_LAUNCH = 1215, - NS_FLAG_COLLECTABLE_6_BY_DUCK_SG = 1216, - NS_FLAG_COLLECTABLE_7_BY_LUP_LAUNCH = 1217, - NS_FLAG_COLLECTABLE_8_BY_NT_LUANCH = 1218, - NS_FLAG_COLLECTABLE_9_BY_RACE_BUILD = 1219, - NS_FLAG_COLLECTABLE_10_ON_AG_LAUNCH_PATH = 1220, - PR_BINOC_AT_LAUNCH_PAD = 1251, - PR_BINOC_AT_BEGINNING_OF_ISLAND_B = 1252, - PR_BINOC_AT_FIRST_PET_BOUNCER = 1253, - PR_BINOC_ON_BY_CROWS_NEST = 1254, - PR_PET_DIG_AT_BEGINNING_OF_ISLAND_B = 1261, - PR_PET_DIG_AT_THE_LOCATION_OF_OLD_BOUNCE_BACK = 1262, - PR_PET_DIG_UNDER_QB_BRIDGE = 1263, - PR_PET_DIG_BACK_SIDE_BY_PARTNER_BOUNCE = 1264, - PR_PET_DIG_BY_LAUNCH_PAD = 1265, - PR_PET_DIG_BY_FIRST_PET_BOUNCER = 1266, - GF_BINOC_ON_LANDING_PAD = 1301, - GF_BINOC_AT_RAVINE_START = 1302, - GF_BINOC_ON_TOP_OF_RAVINE_HEAD = 1303, - GF_BINOC_AT_TURTLE_AREA = 1304, - GF_BINOC_IN_TUNNEL_TO_ELEPHANTS = 1305, - GF_BINOC_IN_ELEPHANTS_AREA = 1306, - GF_BINOC_IN_RACING_AREA = 1307, - GF_BINOC_IN_CROC_AREA = 1308, - GF_BINOC_IN_JAIL_AREA = 1309, - GF_BINOC_TELESCOPE_NEXT_TO_CAPTAIN_JACK = 1310, - NT_PLINTH_REBUILD = 1919, - NT_FACTION_SPY_DUKE = 1974, - NT_FACTION_SPY_OVERBUILD = 1976, - NT_FACTION_SPY_HAEL = 1977, - NJ_EARTH_SPINJITZU = 2030, - NJ_LIGHTNING_SPINJITZU = 2031, - NJ_ICE_SPINJITZU = 2032, - NJ_FIRE_SPINJITZU = 2033, - NJ_WU_SHOW_DAILY_CHEST = 2099 -}; - -//======== FUNC =========== - -template -inline T const& clamp(const T& val, const T& low, const T& high) { - if (val < low) return low; - else if (val > high) return high; - - return val; -} - #endif //!__DCOMMONVARS__H__ diff --git a/dCommon/dEnums/eBuildType.h b/dCommon/dEnums/eBuildType.h new file mode 100644 index 00000000..f28f43cc --- /dev/null +++ b/dCommon/dEnums/eBuildType.h @@ -0,0 +1,12 @@ +#ifndef __EBUILDTYPE__H__ +#define __EBUILDTYPE__H__ + +#include + +enum class eBuildType :uint32_t { + NOWHERE, + IN_WORLD, + ON_PROPERTY +}; + +#endif //!__EBUILDTYPE__H__ diff --git a/dCommon/dEnums/eCharacterCreationResponse.h b/dCommon/dEnums/eCharacterCreationResponse.h new file mode 100644 index 00000000..da1ec0f2 --- /dev/null +++ b/dCommon/dEnums/eCharacterCreationResponse.h @@ -0,0 +1,14 @@ +#ifndef __ECHARACTERCREATIONRESPONSE__H__ +#define __ECHARACTERCREATIONRESPONSE__H__ + +#include + +enum class eCharacterCreationResponse : uint8_t { + SUCCESS = 0, + OBJECT_ID_UNAVAILABLE, + NAME_NOT_ALLOWED, + PREDEFINED_NAME_IN_USE, + CUSTOM_NAME_IN_USE +}; + +#endif //!__ECHARACTERCREATIONRESPONSE__H__ diff --git a/dCommon/dEnums/eCinematicEvent.h b/dCommon/dEnums/eCinematicEvent.h new file mode 100644 index 00000000..7fb82ca7 --- /dev/null +++ b/dCommon/dEnums/eCinematicEvent.h @@ -0,0 +1,12 @@ +#ifndef __ECINEMATICEVENT__H__ +#define __ECINEMATICEVENT__H__ + +#include + +enum class eCinematicEvent : uint32_t { + STARTED, + WAYPOINT, + ENDED, +}; + +#endif //!__ECINEMATICEVENT__H__ diff --git a/dCommon/dEnums/eControlScheme.h b/dCommon/dEnums/eControlScheme.h new file mode 100644 index 00000000..f7585ebb --- /dev/null +++ b/dCommon/dEnums/eControlScheme.h @@ -0,0 +1,18 @@ +#ifndef __ECONTROLSCHEME__H__ +#define __ECONTROLSCHEME__H__ + +#include + +enum class eControlScheme : uint32_t { + SCHEME_A, + SCHEME_D, + SCHEME_GAMEPAD, + SCHEME_E, + SCHEME_FPS, + SCHEME_DRIVING, + SCHEME_TAMING, + SCHEME_MODULAR_BUILD, + SCHEME_WEAR_A_ROBOT //== freecam? +}; + +#endif //!__ECONTROLSCHEME__H__ diff --git a/dCommon/dEnums/eCyclingMode.h b/dCommon/dEnums/eCyclingMode.h new file mode 100644 index 00000000..b5e3248b --- /dev/null +++ b/dCommon/dEnums/eCyclingMode.h @@ -0,0 +1,11 @@ +#ifndef __ECYCLINGMODE__H__ +#define __ECYCLINGMODE__H__ + +#include + +enum class eCyclingMode : uint32_t { + ALLOW_CYCLE_TEAMMATES, + DISALLOW_CYCLING +}; + +#endif //!__ECYCLINGMODE__H__ diff --git a/dCommon/dEnums/eGameActivity.h b/dCommon/dEnums/eGameActivity.h new file mode 100644 index 00000000..16b75380 --- /dev/null +++ b/dCommon/dEnums/eGameActivity.h @@ -0,0 +1,15 @@ +#ifndef __EGAMEACTIVITY__H__ +#define __EGAMEACTIVITY__H__ + +#include + +enum class eGameActivity : uint32_t { + NONE, + QUICKBUILDING, + SHOOTING_GALLERY, + RACING, + PINBALL, + PET_TAMING +}; + +#endif //!__EGAMEACTIVITY__H__ diff --git a/dCommon/dEnums/eKillType.h b/dCommon/dEnums/eKillType.h new file mode 100644 index 00000000..fe3908c8 --- /dev/null +++ b/dCommon/dEnums/eKillType.h @@ -0,0 +1,11 @@ +#ifndef __EKILLTYPE__H__ +#define __EKILLTYPE__H__ + +#include + +enum class eKillType : uint32_t { + VIOLENT, + SILENT +}; + +#endif //!__EKILLTYPE__H__ diff --git a/dCommon/dEnums/eLoginResponse.h b/dCommon/dEnums/eLoginResponse.h new file mode 100644 index 00000000..01bba3d5 --- /dev/null +++ b/dCommon/dEnums/eLoginResponse.h @@ -0,0 +1,24 @@ +#ifndef __ELOGINRESPONSE__H__ +#define __ELOGINRESPONSE__H__ + +#include + +enum class eLoginResponse : uint8_t { + GENERAL_FAILED = 0, + SUCCESS, + BANNED, + // Unused 3 + // Unused 4 + PERMISSIONS_NOT_HIGH_ENOUGH = 5, + INVALID_USER, + ACCOUNT_LOCKED, + WRONG_PASS, + ACCOUNT_ACTIVATION_PENDING, + ACCOUNT_DISABLED, + GAME_TIME_EXPIRED, + FREE_TRIAL_ENDED, + PLAY_SCHEDULE_TIME_UP, + ACCOUNT_NOT_ACTIVATED +}; + +#endif //!__ELOGINRESPONSE__H__ diff --git a/dCommon/dEnums/eLootSourceType.h b/dCommon/dEnums/eLootSourceType.h new file mode 100644 index 00000000..b8ecca4a --- /dev/null +++ b/dCommon/dEnums/eLootSourceType.h @@ -0,0 +1,31 @@ +#ifndef __ELOOTSOURCETYPE__H__ +#define __ELOOTSOURCETYPE__H__ + +#include + +enum class eLootSourceType : uint32_t { + NONE = 0, + CHEST, + MISSION, + MAIL, + CURRENCY, + ACHIEVEMENT, + TRADE, + QUICKBUILD, + DELETION, + VENDOR, + ACTIVITY, + PICKUP, + BRICK, + PROPERTY, + MODERATION, + EXHIBIT, + INVENTORY, + CLAIMCODE, + CONSUMPTION, + CRAFTING, + LEVEL_REWARD, + RELOCATE +}; + +#endif //!__ELOOTSOURCETYPE__H__ diff --git a/dCommon/dEnums/eMatchUpdate.h b/dCommon/dEnums/eMatchUpdate.h new file mode 100644 index 00000000..a42eecd3 --- /dev/null +++ b/dCommon/dEnums/eMatchUpdate.h @@ -0,0 +1,17 @@ +#ifndef __EMATCHUPDATE__H__ +#define __EMATCHUPDATE__H__ + +#include + +enum class eMatchUpdate : int32_t { + PLAYER_ADDED = 0, + PLAYER_REMOVED, + PHASE_CREATED, + PHASE_WAIT_READY, + PHASE_WAIT_START, + PLAYER_READY, + PLAYER_NOT_READY, + PLAYER_UPDATE +}; + +#endif //!__EMATCHUPDATE__H__ diff --git a/dCommon/dEnums/eObjectWorldState.h b/dCommon/dEnums/eObjectWorldState.h new file mode 100644 index 00000000..9735a072 --- /dev/null +++ b/dCommon/dEnums/eObjectWorldState.h @@ -0,0 +1,12 @@ +#ifndef __EOBJECTWORLDSTATE__H__ +#define __EOBJECTWORLDSTATE__H__ + +#include + +enum class eObjectWorldState : uint32_t { + INWORLD, + ATTACHED, + INVENTORY +}; + +#endif //!__EOBJECTWORLDSTATE__H__ diff --git a/dCommon/dEnums/ePetTamingNotifyType.h b/dCommon/dEnums/ePetTamingNotifyType.h new file mode 100644 index 00000000..564e932f --- /dev/null +++ b/dCommon/dEnums/ePetTamingNotifyType.h @@ -0,0 +1,15 @@ +#ifndef __EPETTAMINGNOTIFYTYPE__H__ +#define __EPETTAMINGNOTIFYTYPE__H__ + +#include + +enum class ePetTamingNotifyType : uint32_t { + SUCCESS, + QUIT, + FAILED, + BEGIN, + READY, + NAMINGPET +}; + +#endif //!__EPETTAMINGNOTIFYTYPE__H__ diff --git a/dCommon/dEnums/ePlayerFlag.h b/dCommon/dEnums/ePlayerFlag.h new file mode 100644 index 00000000..fefdfb67 --- /dev/null +++ b/dCommon/dEnums/ePlayerFlag.h @@ -0,0 +1,172 @@ +#ifndef __EPLAYERFLAG__H__ +#define __EPLAYERFLAG__H__ + +#include + +enum ePlayerFlag : int32_t { + BTARR_TESTING = 0, + PLAYER_HAS_ENTERED_PET_RANCH = 1, + MINIMAP_UNLOCKED = 2, + ACTIVITY_REBUILDING_FAIL_TIME = 3, + ACTIVITY_REBUILDING_FAIL_RANGE = 4, + ACTIVITY_SHOOTING_GALLERY_HELP = 5, + HELP_WALKING_CONTROLS = 6, + FIRST_SMASHABLE = 7, + FIRST_IMAGINATION_PICKUP = 8, + FIRST_DAMAGE = 9, + FIRST_ITEM = 10, + FIRST_BRICK = 11, + FIRST_CONSUMABLE = 12, + FIRST_EQUIPPABLE = 13, + CHAT_HELP = 14, + FIRST_PET_TAMING_MINIGAME = 15, + FIRST_PET_ON_SWITCH = 16, + FIRST_PET_JUMPED_ON_SWITCH = 17, + FIRST_PET_FOUND_TREASURE = 18, + FIRST_PET_DUG_TREASURE = 19, + FIRST_PET_OWNER_ON_PET_BOUNCER = 20, + FIRST_PET_DESPAWN_NO_IMAGINATION = 21, + FIRST_PET_SELECTED_ENOUGH_BRICKS = 22, + FIRST_EMOTE_UNLOCKED = 23, + GF_PIRATE_REP = 24, + AG_BOB_CINEMATIC_EVENT = 25, + HELP_JUMPING_CONTROLS = 26, + HELP_DOUBLE_JUMP_CONTROLS = 27, + HELP_CAMERA_CONTROLS = 28, + HELP_ROTATE_CONTROLS = 29, + HELP_SMASH = 30, + MONUMENT_INTRO_MUSIC_PLAYED = 31, + BEGINNING_ZONE_SUMMARY_DISPLAYED = 32, + AG_FINISH_LINE_BUILT = 33, + AG_BOSS_AREA_FOUND = 34, + AG_LANDED_IN_BATTLEFIELD = 35, + GF_PLAYER_HAS_BEEN_TO_THE_RAVINE = 36, + MODULAR_BUILD_STARTED = 37, + MODULAR_BUILD_FINISHED_CLICK_BUTTON = 38, + THINKING_HAT_RECEIVED_GO_TO_MODULAR_BUILD_AREA = 39, + BUILD_AREA_ENTERED_MOD_NOT_ACTIVATED_PUT_ON_HAT = 40, + HAT_ON_INSIDE_OF_MOD_BUILD_EQUIP_A_MODULE_FROM_LEG = 41, + MODULE_EQUIPPED_PLACE_ON_GLOWING_BLUE_SPOT = 42, + FIRST_MODULE_PLACED_CORRECTLY_NOW_DO_THE_REST = 43, + ROCKET_COMPLETE_NOW_LAUNCH_FROM_PAD = 44, + JOINED_A_FACTION = 45, + VENTURE_FACTION = 46, + ASSEMBLY_FACTION = 47, + PARADOX_FACTION = 48, + SENTINEL_FACTION = 49, + LUP_WORLD_ACCESS = 50, + AG_FIRST_FLAG_COLLECTED = 51, + TOOLTIP_TALK_TO_SKYLAND_TO_GET_HAT = 52, + MODULAR_BUILD_PLAYER_PLACES_FIRST_MODEL_IN_SCRATCH = 53, + MODULAR_BUILD_FIRST_ARROW_DISPLAY_FOR_MODULE = 54, + AG_BEACON_QB_SO_THE_PLAYER_CAN_ALWAYS_BUILD_THEM = 55, + GF_PET_DIG_FLAG_1 = 56, + GF_PET_DIG_FLAG_2 = 57, + GF_PET_DIG_FLAG_3 = 58, + SUPPRESS_SPACESHIP_CINEMATIC_FLYTHROUGH = 59, + GF_PLAYER_FALL_DEATH = 60, + GF_PLAYER_CAN_GET_FLAG_1 = 61, + GF_PLAYER_CAN_GET_FLAG_2 = 62, + GF_PLAYER_CAN_GET_FLAG_3 = 63, + ENTER_BBB_FROM_PROPERTY_EDIT_CONFIRMATION_DIALOG = 64, + AG_FIRST_COMBAT_COMPLETE = 65, + AG_COMPLETE_BOB_MISSION = 66, + FIRST_MANUAL_PET_HIBERNATE = 69, + CAGED_SPIDER = 74, + IS_NEWS_SCREEN_VISIBLE = 114, + NJ_GARMADON_CINEMATIC_SEEN = 125, + EQUPPED_TRIAL_FACTION_GEAR = 126, + ELEPHANT_PET_3050 = 801, + CAT_PET_3054 = 803, + TRICERATOPS_PET_3195 = 806, + TERRIER_PET_3254 = 807, + SKUNK_PET_3261 = 811, + BUNNY_PET_3672 = 813, + CROCODILE_PET_3994 = 814, + DOBERMAN_PET_5635 = 815, + BUFFALO_PET_5636 = 816, + ROBOT_DOG_PET_5637 = 818, + RED_DRAGON_PET_5639 = 819, + TORTOISE_PET_5640 = 820, + GREEN_DRAGON_PET_5641 = 821, + PANDA_PET_5643 = 822, + MANTIS_PET_5642 = 823, + WARTHOG_PET_6720 = 824, + LION_PET_3520 = 825, + GOAT_PET_7638 = 818, + CRAB_PET_7694 = 827, + REINDEER_PET_12294 = 829, + STEGOSAURUS_PET_12431 = 830, + SABER_CAT_PET_12432 = 831, + GRYPHON_PET_12433 = 832, + ALINE_PET_12334 = 833, + UNKNOWN_PET = 834, + EARTH_DRAGON_PET_16210 = 836, + SKELETON_DRAGON_PET_13067 = 838, + AG_SPACE_SHIP_BINOC_AT_LAUNCH = 1001, + AG_SPACE_SHIP_BINOC_AT_LAUNCH_PLATFORM = 1002, + AG_SPACE_SHIP_BINOC_ON_PLATFORM_TO_LEFT_OF_START = 1003, + AG_SPACE_SHIP_BINOC_ON_PLATFORM_TO_RIGHT_OF_START = 1004, + AG_SPACE_SHIP_BINOC_AT_BOB = 1005, + AG_BATTLE_BINOC_FOR_TRICERETOPS = 1101, + AG_BATTLE_BINOC_AT_PARADOX = 1102, + AG_BATTLE_BINOC_AT_MISSION_GIVER = 1103, + AG_BATTLE_BINOC_AT_BECK = 1104, + AG_MONUMENT_BINOC_INTRO = 1105, + AG_MONUMENT_BINOC_OUTRO = 1106, + AG_LAUNCH_BINOC_INTRO = 1107, + AG_LAUNCH_BINOC_BISON = 1108, + AG_LAUNCH_BINOC_SHARK = 1109, + NS_BINOC_CONCERT_TRANSITION = 1201, + NS_BINOC_RACE_PLACE_TRANSITION = 1202, + NS_BINOC_BRICK_ANNEX_TRANSITION = 1203, + NS_BINOC_GF_LAUNCH = 1204, + NS_BINOC_FV_LAUNCH = 1205, + NS_BINOC_BRICK_ANNEX_WATER = 1206, + NS_BINOC_AG_LAUNCH_AT_RACE_PLACE = 1207, + NS_BINOC_AG_LAUNCH_AT_BRICK_ANNEX = 1208, + NS_BINOC_AG_LAUNCH_AT_PLAZA = 1209, + NS_BINOC_TBA = 1210, + NS_FLAG_COLLECTABLE_1_BY_JONNY_THUNDER = 1211, + NS_FLAG_COLLECTABLE_2_UNDER_CONCERT_BRIDGE = 1212, + NS_FLAG_COLLECTABLE_3_BY_FV_LAUNCH = 1213, + NS_FLAG_COLLECTABLE_4_IN_PLAZA_BEHIND_BUILDING = 1214, + NS_FLAG_COLLECTABLE_5_BY_GF_LAUNCH = 1215, + NS_FLAG_COLLECTABLE_6_BY_DUCK_SG = 1216, + NS_FLAG_COLLECTABLE_7_BY_LUP_LAUNCH = 1217, + NS_FLAG_COLLECTABLE_8_BY_NT_LUANCH = 1218, + NS_FLAG_COLLECTABLE_9_BY_RACE_BUILD = 1219, + NS_FLAG_COLLECTABLE_10_ON_AG_LAUNCH_PATH = 1220, + PR_BINOC_AT_LAUNCH_PAD = 1251, + PR_BINOC_AT_BEGINNING_OF_ISLAND_B = 1252, + PR_BINOC_AT_FIRST_PET_BOUNCER = 1253, + PR_BINOC_ON_BY_CROWS_NEST = 1254, + PR_PET_DIG_AT_BEGINNING_OF_ISLAND_B = 1261, + PR_PET_DIG_AT_THE_LOCATION_OF_OLD_BOUNCE_BACK = 1262, + PR_PET_DIG_UNDER_QB_BRIDGE = 1263, + PR_PET_DIG_BACK_SIDE_BY_PARTNER_BOUNCE = 1264, + PR_PET_DIG_BY_LAUNCH_PAD = 1265, + PR_PET_DIG_BY_FIRST_PET_BOUNCER = 1266, + GF_BINOC_ON_LANDING_PAD = 1301, + GF_BINOC_AT_RAVINE_START = 1302, + GF_BINOC_ON_TOP_OF_RAVINE_HEAD = 1303, + GF_BINOC_AT_TURTLE_AREA = 1304, + GF_BINOC_IN_TUNNEL_TO_ELEPHANTS = 1305, + GF_BINOC_IN_ELEPHANTS_AREA = 1306, + GF_BINOC_IN_RACING_AREA = 1307, + GF_BINOC_IN_CROC_AREA = 1308, + GF_BINOC_IN_JAIL_AREA = 1309, + GF_BINOC_TELESCOPE_NEXT_TO_CAPTAIN_JACK = 1310, + NT_HEART_OF_DARKNESS = 1911, + NT_PLINTH_REBUILD = 1919, + NT_FACTION_SPY_DUKE = 1974, + NT_FACTION_SPY_OVERBUILD = 1976, + NT_FACTION_SPY_HAEL = 1977, + NJ_EARTH_SPINJITZU = 2030, + NJ_LIGHTNING_SPINJITZU = 2031, + NJ_ICE_SPINJITZU = 2032, + NJ_FIRE_SPINJITZU = 2033, + NJ_WU_SHOW_DAILY_CHEST = 2099 +}; + +#endif //!__EPLAYERFLAG__H__ diff --git a/dCommon/dEnums/eQuickBuildFailReason.h b/dCommon/dEnums/eQuickBuildFailReason.h new file mode 100644 index 00000000..a6144bd5 --- /dev/null +++ b/dCommon/dEnums/eQuickBuildFailReason.h @@ -0,0 +1,13 @@ +#ifndef __EQUICKBUILDFAILREASON__H__ +#define __EQUICKBUILDFAILREASON__H__ + +#include + +enum class eQuickBuildFailReason : uint32_t { + NOT_GIVEN, + OUT_OF_IMAGINATION, + CANCELED_EARLY, + BUILD_ENDED +}; + +#endif //!__EQUICKBUILDFAILREASON__H__ diff --git a/dCommon/dEnums/eRebuildState.h b/dCommon/dEnums/eRebuildState.h new file mode 100644 index 00000000..497bcb77 --- /dev/null +++ b/dCommon/dEnums/eRebuildState.h @@ -0,0 +1,15 @@ +#ifndef __EREBUILDSTATE__H__ +#define __EREBUILDSTATE__H__ + +#include + +enum class eRebuildState : uint32_t { + OPEN, + COMPLETED = 2, + RESETTING = 4, + BUILDING, + INCOMPLETE +}; + + +#endif //!__EREBUILDSTATE__H__ diff --git a/dCommon/dEnums/eRenameResponse.h b/dCommon/dEnums/eRenameResponse.h new file mode 100644 index 00000000..2298e922 --- /dev/null +++ b/dCommon/dEnums/eRenameResponse.h @@ -0,0 +1,15 @@ +#ifndef __ERENAMERESPONSE__H__ +#define __ERENAMERESPONSE__H__ + +#include + +//! An enum for character rename responses +enum class eRenameResponse : uint8_t { + SUCCESS = 0, + UNKNOWN_ERROR, + NAME_UNAVAILABLE, + NAME_IN_USE +}; + + +#endif //!__ERENAMERESPONSE__H__ diff --git a/dCommon/dEnums/eReplicaPacketType.h b/dCommon/dEnums/eReplicaPacketType.h new file mode 100644 index 00000000..2650fb30 --- /dev/null +++ b/dCommon/dEnums/eReplicaPacketType.h @@ -0,0 +1,12 @@ +#ifndef __EREPLICAPACKETTYPE__H__ +#define __EREPLICAPACKETTYPE__H__ + +#include + +enum class eReplicaPacketType : uint8_t { + CONSTRUCTION, + SERIALIZATION, + DESTRUCTION +}; + +#endif //!__EREPLICAPACKETTYPE__H__ diff --git a/dCommon/dEnums/eStateChangeType.h b/dCommon/dEnums/eStateChangeType.h new file mode 100644 index 00000000..e187e265 --- /dev/null +++ b/dCommon/dEnums/eStateChangeType.h @@ -0,0 +1,11 @@ +#ifndef __ESTATECHANGETYPE__H__ +#define __ESTATECHANGETYPE__H__ + +#include + +enum class eStateChangeType : uint32_t { + PUSH, + POP +}; + +#endif //!__ESTATECHANGETYPE__H__ diff --git a/dCommon/dEnums/eTerminateType.h b/dCommon/dEnums/eTerminateType.h new file mode 100644 index 00000000..189734f8 --- /dev/null +++ b/dCommon/dEnums/eTerminateType.h @@ -0,0 +1,12 @@ +#ifndef __ETERMINATETYPE__H__ +#define __ETERMINATETYPE__H__ + +#include + +enum class eTerminateType : uint32_t { + RANGE, + USER, + FROM_INTERACTION +}; + +#endif //!__ETERMINATETYPE__H__ diff --git a/dCommon/dEnums/eUseItemResponse.h b/dCommon/dEnums/eUseItemResponse.h new file mode 100644 index 00000000..ba0ece7f --- /dev/null +++ b/dCommon/dEnums/eUseItemResponse.h @@ -0,0 +1,12 @@ +#ifndef __EUSEITEMRESPONSE__H__ +#define __EUSEITEMRESPONSE__H__ + +#include + +enum class eUseItemResponse : uint32_t { + NoImaginationForPet = 1, + FailedPrecondition, + MountsNotAllowed +}; + +#endif //!__EUSEITEMRESPONSE__H__ diff --git a/dGame/Character.cpp b/dGame/Character.cpp index 98d6d0a9..e565ed4f 100644 --- a/dGame/Character.cpp +++ b/dGame/Character.cpp @@ -20,6 +20,7 @@ #include "eMissionState.h" #include "eObjectBits.h" #include "eGameMasterLevel.h" +#include "ePlayerFlag.h" Character::Character(uint32_t id, User* parentUser) { //First load the name, etc: @@ -362,9 +363,9 @@ void Character::SaveXMLToDatabase() { } // Prevents the news feed from showing up on world transfers - if (GetPlayerFlag(ePlayerFlags::IS_NEWS_SCREEN_VISIBLE)) { + if (GetPlayerFlag(ePlayerFlag::IS_NEWS_SCREEN_VISIBLE)) { auto* s = m_Doc->NewElement("s"); - s->SetAttribute("si", ePlayerFlags::IS_NEWS_SCREEN_VISIBLE); + s->SetAttribute("si", ePlayerFlag::IS_NEWS_SCREEN_VISIBLE); flags->LinkEndChild(s); } @@ -417,7 +418,7 @@ void Character::WriteToDatabase() { delete printer; } -void Character::SetPlayerFlag(const uint32_t flagId, const bool value) { +void Character::SetPlayerFlag(const int32_t flagId, const bool value) { // If the flag is already set, we don't have to recalculate it if (GetPlayerFlag(flagId) == value) return; @@ -464,7 +465,7 @@ void Character::SetPlayerFlag(const uint32_t flagId, const bool value) { GameMessages::SendNotifyClientFlagChange(m_ObjectID, flagId, value, m_ParentUser->GetSystemAddress()); } -bool Character::GetPlayerFlag(const uint32_t flagId) const { +bool Character::GetPlayerFlag(const int32_t flagId) const { // Calculate the index first const auto flagIndex = uint32_t(std::floor(flagId / 64)); @@ -481,8 +482,8 @@ bool Character::GetPlayerFlag(const uint32_t flagId) const { void Character::SetRetroactiveFlags() { // Retroactive check for if player has joined a faction to set their 'joined a faction' flag to true. - if (GetPlayerFlag(ePlayerFlags::VENTURE_FACTION) || GetPlayerFlag(ePlayerFlags::ASSEMBLY_FACTION) || GetPlayerFlag(ePlayerFlags::PARADOX_FACTION) || GetPlayerFlag(ePlayerFlags::SENTINEL_FACTION)) { - SetPlayerFlag(ePlayerFlags::JOINED_A_FACTION, true); + if (GetPlayerFlag(ePlayerFlag::VENTURE_FACTION) || GetPlayerFlag(ePlayerFlag::ASSEMBLY_FACTION) || GetPlayerFlag(ePlayerFlag::PARADOX_FACTION) || GetPlayerFlag(ePlayerFlag::SENTINEL_FACTION)) { + SetPlayerFlag(ePlayerFlag::JOINED_A_FACTION, true); } } @@ -542,7 +543,7 @@ void Character::OnZoneLoad() { if (missionComponent != nullptr) { // Fix the monument race flag if (missionComponent->GetMissionState(319) >= eMissionState::READY_TO_COMPLETE) { - SetPlayerFlag(33, true); + SetPlayerFlag(ePlayerFlag::AG_FINISH_LINE_BUILT, true); } } @@ -558,7 +559,7 @@ void Character::OnZoneLoad() { */ if (HasPermission(ePermissionMap::Old)) { if (GetCoins() > 1000000) { - SetCoins(1000000, eLootSourceType::LOOT_SOURCE_NONE); + SetCoins(1000000, eLootSourceType::NONE); } } @@ -636,7 +637,7 @@ void Character::SetBillboardVisible(bool visible) { // The GameMessage we send for turning the nameplate off just deletes the BillboardSubcomponent from the parent component. // Because that same message does not allow for custom parameters, we need to create the BillboardSubcomponent a different way - // This workaround involves sending an unrelated GameMessage that does not apply to player entites, + // This workaround involves sending an unrelated GameMessage that does not apply to player entites, // but forces the client to create the necessary SubComponent that controls the billboard. GameMessages::SendShowBillboardInteractIcon(UNASSIGNED_SYSTEM_ADDRESS, m_OurEntity->GetObjectID()); diff --git a/dGame/Character.h b/dGame/Character.h index 2f0abba5..3759f206 100644 --- a/dGame/Character.h +++ b/dGame/Character.h @@ -16,6 +16,7 @@ struct Packet; class Entity; enum class ePermissionMap : uint64_t; enum class eGameMasterLevel : uint8_t; +enum class eLootSourceType : uint32_t; /** * Meta information about a character, like their name and style @@ -414,14 +415,14 @@ public: * @param flagId the ID of the flag to set * @param value the value to set for the flag */ - void SetPlayerFlag(uint32_t flagId, bool value); + void SetPlayerFlag(int32_t flagId, bool value); /** * Gets the value for a certain character flag * @param flagId the ID of the flag to get a value for * @return the value of the flag given the ID (the default is false, obviously) */ - bool GetPlayerFlag(uint32_t flagId) const; + bool GetPlayerFlag(int32_t flagId) const; /** * Notifies the character that they're now muted diff --git a/dGame/Entity.cpp b/dGame/Entity.cpp index 55e1b1ca..b9fc79fb 100644 --- a/dGame/Entity.cpp +++ b/dGame/Entity.cpp @@ -73,6 +73,7 @@ #include "TriggerComponent.h" #include "eGameMasterLevel.h" #include "eReplicaComponentType.h" +#include "eReplicaPacketType.h" // Table includes #include "CDComponentsRegistryTable.h" @@ -876,7 +877,7 @@ void Entity::SetGMLevel(eGameMasterLevel value) { } void Entity::WriteBaseReplicaData(RakNet::BitStream* outBitStream, eReplicaPacketType packetType) { - if (packetType == PACKET_TYPE_CONSTRUCTION) { + if (packetType == eReplicaPacketType::CONSTRUCTION) { outBitStream->Write(m_ObjectID); outBitStream->Write(m_TemplateID); @@ -978,8 +979,8 @@ void Entity::WriteBaseReplicaData(RakNet::BitStream* outBitStream, eReplicaPacke } // Only serialize parent / child info should the info be dirty (changed) or if this is the construction of the entity. - outBitStream->Write(m_IsParentChildDirty || packetType == PACKET_TYPE_CONSTRUCTION); - if (m_IsParentChildDirty || packetType == PACKET_TYPE_CONSTRUCTION) { + outBitStream->Write(m_IsParentChildDirty || packetType == eReplicaPacketType::CONSTRUCTION); + if (m_IsParentChildDirty || packetType == eReplicaPacketType::CONSTRUCTION) { m_IsParentChildDirty = false; outBitStream->Write(m_ParentEntity != nullptr); if (m_ParentEntity) { @@ -1004,7 +1005,7 @@ void Entity::WriteComponents(RakNet::BitStream* outBitStream, eReplicaPacketType bool destroyableSerialized = false; bool bIsInitialUpdate = false; - if (packetType == PACKET_TYPE_CONSTRUCTION) bIsInitialUpdate = true; + if (packetType == eReplicaPacketType::CONSTRUCTION) bIsInitialUpdate = true; unsigned int flags = 0; PossessableComponent* possessableComponent; @@ -1624,7 +1625,7 @@ void Entity::PickupItem(const LWOOBJID& objectID) { } } } else { - inv->AddItem(p.second.lot, p.second.count, eLootSourceType::LOOT_SOURCE_PICKUP, eInventoryType::INVALID, {}, LWOOBJID_EMPTY, true, false, LWOOBJID_EMPTY, eInventoryType::INVALID, 1); + inv->AddItem(p.second.lot, p.second.count, eLootSourceType::PICKUP, eInventoryType::INVALID, {}, LWOOBJID_EMPTY, true, false, LWOOBJID_EMPTY, eInventoryType::INVALID, 1); } } } diff --git a/dGame/Entity.h b/dGame/Entity.h index f8abff31..b980b179 100644 --- a/dGame/Entity.h +++ b/dGame/Entity.h @@ -10,6 +10,7 @@ #include "NiPoint3.h" #include "NiQuaternion.h" #include "LDFFormat.h" +#include "eKillType.h" namespace Loot { class Info; @@ -33,6 +34,8 @@ class EntityCallbackTimer; enum class eTriggerEventType; enum class eGameMasterLevel : uint8_t; enum class eReplicaComponentType : uint32_t; +enum class eReplicaPacketType : uint8_t; +enum class eCinematicEvent : uint32_t; namespace CppScripts { class Script; diff --git a/dGame/EntityManager.cpp b/dGame/EntityManager.cpp index dc9a43f3..1a77d365 100644 --- a/dGame/EntityManager.cpp +++ b/dGame/EntityManager.cpp @@ -23,6 +23,7 @@ #include "eObjectBits.h" #include "eGameMasterLevel.h" #include "eReplicaComponentType.h" +#include "eReplicaPacketType.h" EntityManager* EntityManager::m_Address = nullptr; @@ -197,8 +198,8 @@ void EntityManager::UpdateEntities(const float deltaTime) { stream.Write(static_cast(ID_REPLICA_MANAGER_SERIALIZE)); stream.Write(static_cast(entity->GetNetworkId())); - entity->WriteBaseReplicaData(&stream, PACKET_TYPE_SERIALIZATION); - entity->WriteComponents(&stream, PACKET_TYPE_SERIALIZATION); + entity->WriteBaseReplicaData(&stream, eReplicaPacketType::SERIALIZATION); + entity->WriteComponents(&stream, eReplicaPacketType::SERIALIZATION); if (entity->GetIsGhostingCandidate()) { for (auto* player : Player::GetAllPlayers()) { @@ -218,9 +219,9 @@ void EntityManager::UpdateEntities(const float deltaTime) { if (!entity) continue; if (entity->GetScheduledKiller()) { - entity->Smash(entity->GetScheduledKiller()->GetObjectID(), SILENT); + entity->Smash(entity->GetScheduledKiller()->GetObjectID(), eKillType::SILENT); } else { - entity->Smash(LWOOBJID_EMPTY, SILENT); + entity->Smash(LWOOBJID_EMPTY, eKillType::SILENT); } } m_EntitiesToKill.clear(); @@ -352,8 +353,8 @@ void EntityManager::ConstructEntity(Entity* entity, const SystemAddress& sysAddr stream.Write(true); stream.Write(static_cast(entity->GetNetworkId())); - entity->WriteBaseReplicaData(&stream, PACKET_TYPE_CONSTRUCTION); - entity->WriteComponents(&stream, PACKET_TYPE_CONSTRUCTION); + entity->WriteBaseReplicaData(&stream, eReplicaPacketType::CONSTRUCTION); + entity->WriteComponents(&stream, eReplicaPacketType::CONSTRUCTION); if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) { if (skipChecks) { diff --git a/dGame/TradingManager.cpp b/dGame/TradingManager.cpp index e1eac422..281c003d 100644 --- a/dGame/TradingManager.cpp +++ b/dGame/TradingManager.cpp @@ -156,21 +156,21 @@ void Trade::Complete() { } // Now actually do the trade. - characterA->SetCoins(characterA->GetCoins() - m_CoinsA + m_CoinsB, eLootSourceType::LOOT_SOURCE_TRADE); - characterB->SetCoins(characterB->GetCoins() - m_CoinsB + m_CoinsA, eLootSourceType::LOOT_SOURCE_TRADE); + characterA->SetCoins(characterA->GetCoins() - m_CoinsA + m_CoinsB, eLootSourceType::TRADE); + characterB->SetCoins(characterB->GetCoins() - m_CoinsB + m_CoinsA, eLootSourceType::TRADE); for (const auto& tradeItem : m_ItemsA) { auto* itemToRemove = inventoryA->FindItemById(tradeItem.itemId); if (itemToRemove) itemToRemove->SetCount(itemToRemove->GetCount() - 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::TRADE); } for (const auto& tradeItem : m_ItemsB) { auto* itemToRemove = inventoryB->FindItemById(tradeItem.itemId); if (itemToRemove) itemToRemove->SetCount(itemToRemove->GetCount() - 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::TRADE); } characterA->SaveXMLToDatabase(); diff --git a/dGame/UserManager.cpp b/dGame/UserManager.cpp index 0e52bc52..d57caa67 100644 --- a/dGame/UserManager.cpp +++ b/dGame/UserManager.cpp @@ -25,6 +25,8 @@ #include "dMessageIdentifiers.h" #include "eObjectBits.h" #include "eGameMasterLevel.h" +#include "eCharacterCreationResponse.h" +#include "eRenameResponse.h" UserManager* UserManager::m_Address = nullptr; @@ -269,13 +271,13 @@ void UserManager::CreateCharacter(const SystemAddress& sysAddr, Packet* packet) if (name != "" && !UserManager::IsNameAvailable(name)) { Game::logger->Log("UserManager", "AccountID: %i chose unavailable name: %s", u->GetAccountID(), name.c_str()); - WorldPackets::SendCharacterCreationResponse(sysAddr, CREATION_RESPONSE_CUSTOM_NAME_IN_USE); + WorldPackets::SendCharacterCreationResponse(sysAddr, eCharacterCreationResponse::CUSTOM_NAME_IN_USE); return; } if (!IsNameAvailable(predefinedName)) { Game::logger->Log("UserManager", "AccountID: %i chose unavailable predefined name: %s", u->GetAccountID(), predefinedName.c_str()); - WorldPackets::SendCharacterCreationResponse(sysAddr, CREATION_RESPONSE_PREDEFINED_NAME_IN_USE); + WorldPackets::SendCharacterCreationResponse(sysAddr, eCharacterCreationResponse::PREDEFINED_NAME_IN_USE); return; } @@ -294,7 +296,7 @@ void UserManager::CreateCharacter(const SystemAddress& sysAddr, Packet* packet) if (overlapResult->next()) { Game::logger->Log("UserManager", "Character object id unavailable, check objectidtracker!"); - WorldPackets::SendCharacterCreationResponse(sysAddr, CREATION_RESPONSE_OBJECT_ID_UNAVAILABLE); + WorldPackets::SendCharacterCreationResponse(sysAddr, eCharacterCreationResponse::OBJECT_ID_UNAVAILABLE); return; } @@ -370,7 +372,7 @@ void UserManager::CreateCharacter(const SystemAddress& sysAddr, Packet* packet) stmt->execute(); delete stmt; - WorldPackets::SendCharacterCreationResponse(sysAddr, CREATION_RESPONSE_SUCCESS); + WorldPackets::SendCharacterCreationResponse(sysAddr, eCharacterCreationResponse::SUCCESS); UserManager::RequestCharacterList(sysAddr); }); }); @@ -500,10 +502,10 @@ void UserManager::RenameCharacter(const SystemAddress& sysAddr, Packet* packet) if (!hasCharacter || !character) { Game::logger->Log("UserManager", "User %i tried to rename a character that it does not own!", u->GetAccountID()); - WorldPackets::SendCharacterRenameResponse(sysAddr, RENAME_RESPONSE_UNKNOWN_ERROR); + WorldPackets::SendCharacterRenameResponse(sysAddr, eRenameResponse::UNKNOWN_ERROR); } else if (hasCharacter && character) { if (newName == character->GetName()) { - WorldPackets::SendCharacterRenameResponse(sysAddr, RENAME_RESPONSE_NAME_UNAVAILABLE); + WorldPackets::SendCharacterRenameResponse(sysAddr, eRenameResponse::NAME_UNAVAILABLE); return; } @@ -517,7 +519,7 @@ void UserManager::RenameCharacter(const SystemAddress& sysAddr, Packet* packet) delete stmt; Game::logger->Log("UserManager", "Character %s now known as %s", character->GetName().c_str(), newName.c_str()); - WorldPackets::SendCharacterRenameResponse(sysAddr, RENAME_RESPONSE_SUCCESS); + WorldPackets::SendCharacterRenameResponse(sysAddr, eRenameResponse::SUCCESS); UserManager::RequestCharacterList(sysAddr); } else { sql::PreparedStatement* stmt = Database::CreatePreppedStmt("UPDATE charinfo SET pending_name=?, needs_rename=0, last_login=? WHERE id=? LIMIT 1"); @@ -528,15 +530,15 @@ void UserManager::RenameCharacter(const SystemAddress& sysAddr, Packet* packet) delete stmt; Game::logger->Log("UserManager", "Character %s has been renamed to %s and is pending approval by a moderator.", character->GetName().c_str(), newName.c_str()); - WorldPackets::SendCharacterRenameResponse(sysAddr, RENAME_RESPONSE_SUCCESS); + WorldPackets::SendCharacterRenameResponse(sysAddr, eRenameResponse::SUCCESS); UserManager::RequestCharacterList(sysAddr); } } else { - WorldPackets::SendCharacterRenameResponse(sysAddr, RENAME_RESPONSE_NAME_IN_USE); + WorldPackets::SendCharacterRenameResponse(sysAddr, eRenameResponse::NAME_IN_USE); } } else { Game::logger->Log("UserManager", "Unknown error occurred when renaming character, either hasCharacter or character variable != true."); - WorldPackets::SendCharacterRenameResponse(sysAddr, RENAME_RESPONSE_UNKNOWN_ERROR); + WorldPackets::SendCharacterRenameResponse(sysAddr, eRenameResponse::UNKNOWN_ERROR); } } diff --git a/dGame/dBehaviors/ImmunityBehavior.cpp b/dGame/dBehaviors/ImmunityBehavior.cpp index f4a41c52..a5dd4c85 100644 --- a/dGame/dBehaviors/ImmunityBehavior.cpp +++ b/dGame/dBehaviors/ImmunityBehavior.cpp @@ -7,6 +7,7 @@ #include "dLogger.h" #include "DestroyableComponent.h" #include "ControllablePhysicsComponent.h" +#include "eStateChangeType.h" void ImmunityBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream, const BehaviorBranchContext branch) { auto* target = EntityManager::Instance()->GetEntity(branch.target); diff --git a/dGame/dComponents/BaseCombatAIComponent.cpp b/dGame/dComponents/BaseCombatAIComponent.cpp index 64c739f5..cccaad23 100644 --- a/dGame/dComponents/BaseCombatAIComponent.cpp +++ b/dGame/dComponents/BaseCombatAIComponent.cpp @@ -248,7 +248,7 @@ void BaseCombatAIComponent::CalculateCombat(const float deltaTime) { if (rebuild != nullptr) { const auto state = rebuild->GetState(); - if (state != REBUILD_COMPLETED) { + if (state != eRebuildState::COMPLETED) { return; } } @@ -566,7 +566,7 @@ bool BaseCombatAIComponent::IsEnemy(LWOOBJID target) const { if (quickbuild != nullptr) { const auto state = quickbuild->GetState(); - if (state != REBUILD_COMPLETED) { + if (state != eRebuildState::COMPLETED) { return false; } } diff --git a/dGame/dComponents/CharacterComponent.cpp b/dGame/dComponents/CharacterComponent.cpp index 6394cc32..82ad5507 100644 --- a/dGame/dComponents/CharacterComponent.cpp +++ b/dGame/dComponents/CharacterComponent.cpp @@ -15,6 +15,7 @@ #include "Item.h" #include "AMFFormat.h" #include "eGameMasterLevel.h" +#include "eGameActivity.h" CharacterComponent::CharacterComponent(Entity* parent, Character* character) : Component(parent) { m_Character = character; @@ -35,7 +36,7 @@ CharacterComponent::CharacterComponent(Entity* parent, Character* character) : C m_EditorLevel = m_GMLevel; m_Reputation = 0; - m_CurrentActivity = 0; + m_CurrentActivity = eGameActivity::NONE; m_CountryCode = 0; m_LastUpdateTimestamp = std::time(nullptr); } diff --git a/dGame/dComponents/CharacterComponent.h b/dGame/dComponents/CharacterComponent.h index 0e047494..e5ca6da5 100644 --- a/dGame/dComponents/CharacterComponent.h +++ b/dGame/dComponents/CharacterComponent.h @@ -11,6 +11,8 @@ #include "tinyxml2.h" #include "eReplicaComponentType.h" +enum class eGameActivity : uint32_t; + /** * The statistics that can be achieved per zone */ @@ -112,13 +114,13 @@ public: * Gets the current activity that the character is partaking in, see ScriptedActivityComponent for more details * @return the current activity that the character is partaking in */ - const uint32_t GetCurrentActivity() const { return m_CurrentActivity; } + const eGameActivity GetCurrentActivity() const { return m_CurrentActivity; } /** * Set the current activity of the character, see ScriptedActivityComponent for more details * @param currentActivity the activity to set */ - void SetCurrentActivity(uint32_t currentActivity) { m_CurrentActivity = currentActivity; m_DirtyCurrentActivity = true; } + void SetCurrentActivity(eGameActivity currentActivity) { m_CurrentActivity = currentActivity; m_DirtyCurrentActivity = true; } /** * Gets if the entity is currently racing @@ -353,7 +355,7 @@ private: /** * The ID of the curently active activity */ - int m_CurrentActivity; + eGameActivity m_CurrentActivity; /** * Whether the social info has been changed diff --git a/dGame/dComponents/ControllablePhysicsComponent.cpp b/dGame/dComponents/ControllablePhysicsComponent.cpp index 6a6d69ce..1b8627a7 100644 --- a/dGame/dComponents/ControllablePhysicsComponent.cpp +++ b/dGame/dComponents/ControllablePhysicsComponent.cpp @@ -13,6 +13,7 @@ #include "Character.h" #include "dZoneManager.h" #include "LevelProgressionComponent.h" +#include "eStateChangeType.h" ControllablePhysicsComponent::ControllablePhysicsComponent(Entity* entity) : Component(entity) { m_Position = {}; diff --git a/dGame/dComponents/ControllablePhysicsComponent.h b/dGame/dComponents/ControllablePhysicsComponent.h index a7359a26..d6088718 100644 --- a/dGame/dComponents/ControllablePhysicsComponent.h +++ b/dGame/dComponents/ControllablePhysicsComponent.h @@ -14,6 +14,7 @@ class Entity; class dpEntity; +enum class eStateChangeType : uint32_t; /** * Handles the movement of controllable Entities, e.g. enemies and players diff --git a/dGame/dComponents/DestroyableComponent.cpp b/dGame/dComponents/DestroyableComponent.cpp index c2d72941..7e7d44aa 100644 --- a/dGame/dComponents/DestroyableComponent.cpp +++ b/dGame/dComponents/DestroyableComponent.cpp @@ -33,6 +33,8 @@ #include "dZoneManager.h" #include "WorldConfig.h" #include "eMissionTaskType.h" +#include "eStateChangeType.h" +#include "eGameActivity.h" #include "CDComponentsRegistryTable.h" @@ -468,7 +470,7 @@ bool DestroyableComponent::IsKnockbackImmune() const { auto* characterComponent = m_Parent->GetComponent(); auto* inventoryComponent = m_Parent->GetComponent(); - if (characterComponent != nullptr && inventoryComponent != nullptr && characterComponent->GetCurrentActivity() == eGameActivities::ACTIVITY_QUICKBUILDING) { + if (characterComponent != nullptr && inventoryComponent != nullptr && characterComponent->GetCurrentActivity() == eGameActivity::QUICKBUILDING) { const auto hasPassive = inventoryComponent->HasAnyPassive({ eItemSetPassiveAbilityID::EngineerRank2, eItemSetPassiveAbilityID::EngineerRank3, eItemSetPassiveAbilityID::SummonerRank2, eItemSetPassiveAbilityID::SummonerRank3, @@ -514,7 +516,7 @@ bool DestroyableComponent::CheckValidity(const LWOOBJID target, const bool ignor if (targetQuickbuild != nullptr) { const auto state = targetQuickbuild->GetState(); - if (state != REBUILD_COMPLETED) { + if (state != eRebuildState::COMPLETED) { return false; } } @@ -803,7 +805,7 @@ void DestroyableComponent::Smash(const LWOOBJID source, const eKillType killType coinsTotal -= coinsToLose; LootGenerator::Instance().DropLoot(m_Parent, m_Parent, -1, coinsToLose, coinsToLose); - character->SetCoins(coinsTotal, eLootSourceType::LOOT_SOURCE_PICKUP); + character->SetCoins(coinsTotal, eLootSourceType::PICKUP); } } @@ -992,7 +994,7 @@ void DestroyableComponent::DoHardcoreModeDrops(const LWOOBJID source){ auto uscoreToLose = uscore * (EntityManager::Instance()->GetHardcoreLoseUscoreOnDeathPercent() / 100); character->SetUScore(uscore - uscoreToLose); - GameMessages::SendModifyLEGOScore(m_Parent, m_Parent->GetSystemAddress(), -uscoreToLose, eLootSourceType::LOOT_SOURCE_MISSION); + GameMessages::SendModifyLEGOScore(m_Parent, m_Parent->GetSystemAddress(), -uscoreToLose, eLootSourceType::MISSION); if (EntityManager::Instance()->GetHardcoreDropinventoryOnDeath()) { //drop all items from inventory: @@ -1023,7 +1025,7 @@ void DestroyableComponent::DoHardcoreModeDrops(const LWOOBJID source){ auto coins = chars->GetCoins(); //lose all coins: - chars->SetCoins(0, eLootSourceType::LOOT_SOURCE_NONE); + chars->SetCoins(0, eLootSourceType::NONE); //drop all coins: GameMessages::SendDropClientLoot(m_Parent, source, LOT_NULL, coins, m_Parent->GetPosition()); @@ -1047,7 +1049,7 @@ void DestroyableComponent::DoHardcoreModeDrops(const LWOOBJID source){ int uscore = maxHealth * EntityManager::Instance()->GetHardcoreUscoreEnemiesMultiplier(); playerStats->SetUScore(playerStats->GetUScore() + uscore); - GameMessages::SendModifyLEGOScore(player, player->GetSystemAddress(), uscore, eLootSourceType::LOOT_SOURCE_MISSION); + GameMessages::SendModifyLEGOScore(player, player->GetSystemAddress(), uscore, eLootSourceType::MISSION); EntityManager::Instance()->SerializeEntity(m_Parent); } diff --git a/dGame/dComponents/DestroyableComponent.h b/dGame/dComponents/DestroyableComponent.h index 47be96a0..66c8374d 100644 --- a/dGame/dComponents/DestroyableComponent.h +++ b/dGame/dComponents/DestroyableComponent.h @@ -11,6 +11,7 @@ namespace CppScripts { class Script; }; //! namespace CppScripts +enum class eStateChangeType : uint32_t; /** * Represents the stats of an entity, for example its health, imagination and armor. Also handles factions, which diff --git a/dGame/dComponents/InventoryComponent.cpp b/dGame/dComponents/InventoryComponent.cpp index dc8fdbdc..907356ce 100644 --- a/dGame/dComponents/InventoryComponent.cpp +++ b/dGame/dComponents/InventoryComponent.cpp @@ -29,6 +29,8 @@ #include "eUnequippableActiveType.h" #include "CppScripts.h" #include "eMissionTaskType.h" +#include "eStateChangeType.h" +#include "eUseItemResponse.h" #include "CDComponentsRegistryTable.h" #include "CDInventoryComponentTable.h" @@ -356,7 +358,7 @@ void InventoryComponent::MoveItemToInventory(Item* item, const eInventoryType in left -= delta; - AddItem(lot, delta, eLootSourceType::LOOT_SOURCE_NONE, inventory, {}, LWOOBJID_EMPTY, showFlyingLot, isModMoveAndEquip, LWOOBJID_EMPTY, origin->GetType(), 0, false, preferredSlot); + AddItem(lot, delta, eLootSourceType::NONE, inventory, {}, LWOOBJID_EMPTY, showFlyingLot, isModMoveAndEquip, LWOOBJID_EMPTY, origin->GetType(), 0, false, preferredSlot); item->SetCount(item->GetCount() - delta, false, false); @@ -371,7 +373,7 @@ void InventoryComponent::MoveItemToInventory(Item* item, const eInventoryType in const auto delta = std::min(item->GetCount(), count); - AddItem(lot, delta, eLootSourceType::LOOT_SOURCE_NONE, inventory, config, LWOOBJID_EMPTY, showFlyingLot, isModMoveAndEquip, subkey, origin->GetType(), 0, item->GetBound(), preferredSlot); + AddItem(lot, delta, eLootSourceType::NONE, inventory, config, LWOOBJID_EMPTY, showFlyingLot, isModMoveAndEquip, subkey, origin->GetType(), 0, item->GetBound(), preferredSlot); item->SetCount(item->GetCount() - delta, false, false); } @@ -1247,7 +1249,7 @@ void InventoryComponent::SpawnPet(Item* item) { auto destroyableComponent = m_Parent->GetComponent(); if (Game::config->GetValue("pets_take_imagination") == "1" && destroyableComponent && destroyableComponent->GetImagination() <= 0) { - GameMessages::SendUseItemRequirementsResponse(m_Parent->GetObjectID(), m_Parent->GetSystemAddress(), UseItemResponse::NoImaginationForPet); + GameMessages::SendUseItemRequirementsResponse(m_Parent->GetObjectID(), m_Parent->GetSystemAddress(), eUseItemResponse::NoImaginationForPet); return; } diff --git a/dGame/dComponents/InventoryComponent.h b/dGame/dComponents/InventoryComponent.h index d695737c..801f9f51 100644 --- a/dGame/dComponents/InventoryComponent.h +++ b/dGame/dComponents/InventoryComponent.h @@ -21,6 +21,7 @@ #include "PossessorComponent.h" #include "eInventoryType.h" #include "eReplicaComponentType.h" +#include "eLootSourceType.h" class Entity; class ItemSet; @@ -99,7 +100,7 @@ public: void AddItem( LOT lot, uint32_t count, - eLootSourceType lootSourceType = eLootSourceType::LOOT_SOURCE_NONE, + eLootSourceType lootSourceType = eLootSourceType::NONE, eInventoryType inventoryType = INVALID, const std::vector& config = {}, LWOOBJID parent = LWOOBJID_EMPTY, diff --git a/dGame/dComponents/LevelProgressionComponent.cpp b/dGame/dComponents/LevelProgressionComponent.cpp index 814a7a86..8163e736 100644 --- a/dGame/dComponents/LevelProgressionComponent.cpp +++ b/dGame/dComponents/LevelProgressionComponent.cpp @@ -59,7 +59,7 @@ void LevelProgressionComponent::HandleLevelUp() { for (auto* reward : rewards) { switch (reward->rewardType) { case 0: - inventoryComponent->AddItem(reward->value, reward->count, eLootSourceType::LOOT_SOURCE_LEVEL_REWARD); + inventoryComponent->AddItem(reward->value, reward->count, eLootSourceType::LEVEL_REWARD); break; case 4: { diff --git a/dGame/dComponents/PetComponent.cpp b/dGame/dComponents/PetComponent.cpp index 2dfaad27..774aa92b 100644 --- a/dGame/dComponents/PetComponent.cpp +++ b/dGame/dComponents/PetComponent.cpp @@ -15,6 +15,10 @@ #include "PetDigServer.h" #include "../dWorldServer/ObjectIDManager.h" #include "eUnequippableActiveType.h" +#include "eTerminateType.h" +#include "ePetTamingNotifyType.h" +#include "eUseItemResponse.h" +#include "ePlayerFlag.h" #include "Game.h" #include "dConfig.h" @@ -33,7 +37,7 @@ std::unordered_map PetComponent::activePets{}; * Maps all the pet lots to a flag indicating that the player has caught it. All basic pets have been guessed by ObjID * while the faction ones could be checked using their respective missions. */ -std::map PetComponent::petFlags = { +std::map PetComponent::petFlags = { { 3050, 801 }, // Elephant { 3054, 803 }, // Cat { 3195, 806 }, // Triceratops @@ -285,7 +289,7 @@ void PetComponent::OnUse(Entity* originator) { m_Parent->GetObjectID(), LWOOBJID_EMPTY, true, - NOTIFY_TYPE_BEGIN, + ePetTamingNotifyType::BEGIN, petPosition, position, rotation, @@ -297,7 +301,7 @@ void PetComponent::OnUse(Entity* originator) { LWOOBJID_EMPTY, originator->GetObjectID(), true, - NOTIFY_TYPE_BEGIN, + ePetTamingNotifyType::BEGIN, petPosition, position, rotation, @@ -313,7 +317,7 @@ void PetComponent::OnUse(Entity* originator) { // Notify the start of a pet taming minigame for (CppScripts::Script* script : CppScripts::GetEntityScripts(m_Parent)) { - script->OnNotifyPetTamingMinigame(m_Parent, originator, NOTIFY_TYPE_BEGIN); + script->OnNotifyPetTamingMinigame(m_Parent, originator, ePetTamingNotifyType::BEGIN); } } @@ -566,7 +570,7 @@ void PetComponent::NotifyTamingBuildSuccess(NiPoint3 position) { GameMessages::SendRegisterPetDBID(m_Tamer, petSubKey, tamer->GetSystemAddress()); - inventoryComponent->AddItem(m_Parent->GetLOT(), 1, eLootSourceType::LOOT_SOURCE_ACTIVITY, eInventoryType::MODELS, {}, LWOOBJID_EMPTY, true, false, petSubKey); + inventoryComponent->AddItem(m_Parent->GetLOT(), 1, eLootSourceType::ACTIVITY, eInventoryType::MODELS, {}, LWOOBJID_EMPTY, true, false, petSubKey); auto* item = inventoryComponent->FindItemBySubKey(petSubKey, MODELS); if (item == nullptr) { @@ -590,7 +594,7 @@ void PetComponent::NotifyTamingBuildSuccess(NiPoint3 position) { LWOOBJID_EMPTY, LWOOBJID_EMPTY, false, - NOTIFY_TYPE_NAMINGPET, + ePetTamingNotifyType::NAMINGPET, NiPoint3::ZERO, NiPoint3::ZERO, NiQuaternion::IDENTITY, @@ -670,7 +674,7 @@ void PetComponent::RequestSetPetName(std::u16string name) { m_Parent->GetObjectID(), m_Tamer, false, - NOTIFY_TYPE_SUCCESS, + ePetTamingNotifyType::SUCCESS, NiPoint3::ZERO, NiPoint3::ZERO, NiQuaternion::IDENTITY, @@ -691,7 +695,7 @@ void PetComponent::RequestSetPetName(std::u16string name) { // Notify the end of a pet taming minigame for (CppScripts::Script* script : CppScripts::GetEntityScripts(m_Parent)) { - script->OnNotifyPetTamingMinigame(m_Parent, tamer, NOTIFY_TYPE_SUCCESS); + script->OnNotifyPetTamingMinigame(m_Parent, tamer, ePetTamingNotifyType::SUCCESS); } } @@ -711,7 +715,7 @@ void PetComponent::ClientExitTamingMinigame(bool voluntaryExit) { m_Parent->GetObjectID(), m_Tamer, false, - NOTIFY_TYPE_QUIT, + ePetTamingNotifyType::QUIT, NiPoint3::ZERO, NiPoint3::ZERO, NiQuaternion::IDENTITY, @@ -732,7 +736,7 @@ void PetComponent::ClientExitTamingMinigame(bool voluntaryExit) { // Notify the end of a pet taming minigame for (CppScripts::Script* script : CppScripts::GetEntityScripts(m_Parent)) { - script->OnNotifyPetTamingMinigame(m_Parent, tamer, NOTIFY_TYPE_QUIT); + script->OnNotifyPetTamingMinigame(m_Parent, tamer, ePetTamingNotifyType::QUIT); } } @@ -762,7 +766,7 @@ void PetComponent::ClientFailTamingMinigame() { m_Parent->GetObjectID(), m_Tamer, false, - NOTIFY_TYPE_FAILED, + ePetTamingNotifyType::FAILED, NiPoint3::ZERO, NiPoint3::ZERO, NiQuaternion::IDENTITY, @@ -783,7 +787,7 @@ void PetComponent::ClientFailTamingMinigame() { // Notify the end of a pet taming minigame for (CppScripts::Script* script : CppScripts::GetEntityScripts(m_Parent)) { - script->OnNotifyPetTamingMinigame(m_Parent, tamer, NOTIFY_TYPE_FAILED); + script->OnNotifyPetTamingMinigame(m_Parent, tamer, ePetTamingNotifyType::FAILED); } } @@ -884,7 +888,7 @@ void PetComponent::Activate(Item* item, bool registerPet, bool fromTaming) { EntityManager::Instance()->SerializeEntity(m_Parent); - owner->GetCharacter()->SetPlayerFlag(69, true); + owner->GetCharacter()->SetPlayerFlag(ePlayerFlag::FIRST_MANUAL_PET_HIBERNATE, true); if (registerPet) { GameMessages::SendAddPetToPlayer(m_Owner, 0, GeneralUtils::UTF8ToUTF16(m_Name), m_DatabaseId, m_Parent->GetLOT(), owner->GetSystemAddress()); @@ -928,7 +932,7 @@ void PetComponent::AddDrainImaginationTimer(Item* item, bool fromTaming) { auto playerEntity = playerDestroyableComponent->GetParent(); if (!playerEntity) return; - GameMessages::SendUseItemRequirementsResponse(playerEntity->GetObjectID(), playerEntity->GetSystemAddress(), UseItemResponse::NoImaginationForPet); + GameMessages::SendUseItemRequirementsResponse(playerEntity->GetObjectID(), playerEntity->GetSystemAddress(), eUseItemResponse::NoImaginationForPet); } this->AddDrainImaginationTimer(item); diff --git a/dGame/dComponents/PetComponent.h b/dGame/dComponents/PetComponent.h index e3c1556b..b3d089a9 100644 --- a/dGame/dComponents/PetComponent.h +++ b/dGame/dComponents/PetComponent.h @@ -263,7 +263,7 @@ private: /** * Flags that indicate that a player has tamed a pet, indexed by the LOT of the pet */ - static std::map petFlags; + static std::map petFlags; /** * The ID of the component in the pet component table diff --git a/dGame/dComponents/PossessorComponent.cpp b/dGame/dComponents/PossessorComponent.cpp index 69046c3b..387b3479 100644 --- a/dGame/dComponents/PossessorComponent.cpp +++ b/dGame/dComponents/PossessorComponent.cpp @@ -4,6 +4,8 @@ #include "EntityManager.h" #include "GameMessages.h" #include "eUnequippableActiveType.h" +#include "eControlScheme.h" +#include "eStateChangeType.h" PossessorComponent::PossessorComponent(Entity* parent) : Component(parent) { m_Possessable = LWOOBJID_EMPTY; @@ -78,5 +80,5 @@ void PossessorComponent::Dismount(Entity* mount, bool forceDismount) { if (characterComponent) characterComponent->SetIsRacing(false); } // Make sure we don't have wacky controls - GameMessages::SendSetPlayerControlScheme(m_Parent, eControlSceme::SCHEME_A); + GameMessages::SendSetPlayerControlScheme(m_Parent, eControlScheme::SCHEME_A); } diff --git a/dGame/dComponents/PropertyManagementComponent.cpp b/dGame/dComponents/PropertyManagementComponent.cpp index 4b9e287f..c87d0744 100644 --- a/dGame/dComponents/PropertyManagementComponent.cpp +++ b/dGame/dComponents/PropertyManagementComponent.cpp @@ -476,7 +476,7 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet settings.push_back(propertyObjectID); settings.push_back(modelType); - inventoryComponent->AddItem(6662, 1, eLootSourceType::LOOT_SOURCE_DELETION, eInventoryType::MODELS_IN_BBB, settings, LWOOBJID_EMPTY, false, false, spawnerId); + inventoryComponent->AddItem(6662, 1, eLootSourceType::DELETION, eInventoryType::MODELS_IN_BBB, settings, LWOOBJID_EMPTY, false, false, spawnerId); auto* item = inventoryComponent->FindItemBySubKey(spawnerId); if (item == nullptr) { @@ -498,7 +498,7 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet if (spawner != nullptr) { dZoneManager::Instance()->RemoveSpawner(spawner->m_Info.spawnerID); } else { - model->Smash(SILENT); + model->Smash(LWOOBJID_EMPTY, eKillType::SILENT); } item->SetCount(0, true, false, false); @@ -506,7 +506,7 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet return; } - inventoryComponent->AddItem(model->GetLOT(), 1, eLootSourceType::LOOT_SOURCE_DELETION, INVALID, {}, LWOOBJID_EMPTY, false); + inventoryComponent->AddItem(model->GetLOT(), 1, eLootSourceType::DELETION, INVALID, {}, LWOOBJID_EMPTY, false); auto* item = inventoryComponent->FindItemByLot(model->GetLOT()); @@ -551,7 +551,7 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet if (spawner != nullptr) { dZoneManager::Instance()->RemoveSpawner(spawner->m_Info.spawnerID); } else { - model->Smash(SILENT); + model->Smash(LWOOBJID_EMPTY, eKillType::SILENT); } } diff --git a/dGame/dComponents/RacingControlComponent.cpp b/dGame/dComponents/RacingControlComponent.cpp index fe4f1faf..703ec7f3 100644 --- a/dGame/dComponents/RacingControlComponent.cpp +++ b/dGame/dComponents/RacingControlComponent.cpp @@ -311,7 +311,7 @@ void RacingControlComponent::OnRequestDie(Entity* player) { if (!racingPlayer.noSmashOnReload) { racingPlayer.smashedTimes++; GameMessages::SendDie(vehicle, vehicle->GetObjectID(), LWOOBJID_EMPTY, true, - VIOLENT, u"", 0, 0, 90.0f, false, true, 0); + eKillType::VIOLENT, u"", 0, 0, 90.0f, false, true, 0); auto* destroyableComponent = vehicle->GetComponent(); uint32_t respawnImagination = 0; @@ -765,7 +765,7 @@ void RacingControlComponent::Update(float deltaTime) { // be smashed by death plane if (vehiclePosition.y < -500) { GameMessages::SendDie(vehicle, m_Parent->GetObjectID(), - LWOOBJID_EMPTY, true, VIOLENT, u"", 0, 0, 0, + LWOOBJID_EMPTY, true, eKillType::VIOLENT, u"", 0, 0, 0, true, false, 0); OnRequestDie(playerEntity); diff --git a/dGame/dComponents/RailActivatorComponent.cpp b/dGame/dComponents/RailActivatorComponent.cpp index 49fc105d..e4091046 100644 --- a/dGame/dComponents/RailActivatorComponent.cpp +++ b/dGame/dComponents/RailActivatorComponent.cpp @@ -7,6 +7,7 @@ #include "RebuildComponent.h" #include "Game.h" #include "dLogger.h" +#include "eStateChangeType.h" RailActivatorComponent::RailActivatorComponent(Entity* parent, int32_t componentID) : Component(parent) { m_ComponentID = componentID; @@ -41,7 +42,7 @@ RailActivatorComponent::~RailActivatorComponent() = default; void RailActivatorComponent::OnUse(Entity* originator) { auto* rebuildComponent = m_Parent->GetComponent(); - if (rebuildComponent != nullptr && rebuildComponent->GetState() != REBUILD_COMPLETED) + if (rebuildComponent != nullptr && rebuildComponent->GetState() != eRebuildState::COMPLETED) return; if (rebuildComponent != nullptr) { diff --git a/dGame/dComponents/RebuildComponent.cpp b/dGame/dComponents/RebuildComponent.cpp index e3c885dd..fcf2738c 100644 --- a/dGame/dComponents/RebuildComponent.cpp +++ b/dGame/dComponents/RebuildComponent.cpp @@ -9,6 +9,9 @@ #include "MissionComponent.h" #include "eMissionTaskType.h" #include "eTriggerEventType.h" +#include "eQuickBuildFailReason.h" +#include "eTerminateType.h" +#include "eGameActivity.h" #include "dServer.h" #include "PacketUtils.h" @@ -47,7 +50,7 @@ RebuildComponent::~RebuildComponent() { Entity* builder = GetBuilder(); if (builder) { - CancelRebuild(builder, eFailReason::REASON_BUILD_ENDED, true); + CancelRebuild(builder, eQuickBuildFailReason::BUILD_ENDED, true); } DespawnActivator(); @@ -66,7 +69,7 @@ void RebuildComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitia // If build state is completed and we've already serialized once in the completed state, // don't serializing this component anymore as this will cause the build to jump again. // If state changes, serialization will begin again. - if (!m_StateDirty && m_State == REBUILD_COMPLETED) { + if (!m_StateDirty && m_State == eRebuildState::COMPLETED) { outBitStream->Write0(); outBitStream->Write0(); return; @@ -90,7 +93,7 @@ void RebuildComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitia outBitStream->Write1(); - outBitStream->Write(m_State); + outBitStream->Write(m_State); outBitStream->Write(m_ShowResetEffect); outBitStream->Write(m_Activator != nullptr); @@ -120,7 +123,7 @@ void RebuildComponent::Update(float deltaTime) { }*/ switch (m_State) { - case REBUILD_OPEN: { + case eRebuildState::OPEN: { SpawnActivator(); m_TimeBeforeDrain = 0; @@ -150,7 +153,7 @@ void RebuildComponent::Update(float deltaTime) { break; } - case REBUILD_COMPLETED: { + case eRebuildState::COMPLETED: { m_Timer += deltaTime; // For reset times < 0 this has to be handled manually @@ -172,7 +175,7 @@ void RebuildComponent::Update(float deltaTime) { } break; } - case REBUILD_BUILDING: + case eRebuildState::BUILDING: { Entity* builder = GetBuilder(); @@ -201,7 +204,7 @@ void RebuildComponent::Update(float deltaTime) { ++m_DrainedImagination; if (newImagination == 0 && m_DrainedImagination < m_TakeImagination) { - CancelRebuild(builder, eFailReason::REASON_OUT_OF_IMAGINATION, true); + CancelRebuild(builder, eQuickBuildFailReason::OUT_OF_IMAGINATION, true); break; } @@ -213,7 +216,7 @@ void RebuildComponent::Update(float deltaTime) { break; } - case REBUILD_INCOMPLETE: { + case eRebuildState::INCOMPLETE: { m_TimerIncomplete += deltaTime; // For reset times < 0 this has to be handled manually @@ -234,12 +237,12 @@ void RebuildComponent::Update(float deltaTime) { } break; } - case REBUILD_RESETTING: break; + case eRebuildState::RESETTING: break; } } void RebuildComponent::OnUse(Entity* originator) { - if (GetBuilder() != nullptr || m_State == REBUILD_COMPLETED) { + if (GetBuilder() != nullptr || m_State == eRebuildState::COMPLETED) { return; } @@ -393,18 +396,18 @@ void RebuildComponent::SetRepositionPlayer(bool value) { } void RebuildComponent::StartRebuild(Entity* user) { - if (m_State == eRebuildState::REBUILD_OPEN || m_State == eRebuildState::REBUILD_COMPLETED || m_State == eRebuildState::REBUILD_INCOMPLETE) { + if (m_State == eRebuildState::OPEN || m_State == eRebuildState::COMPLETED || m_State == eRebuildState::INCOMPLETE) { m_Builder = user->GetObjectID(); auto* character = user->GetComponent(); - character->SetCurrentActivity(eGameActivities::ACTIVITY_QUICKBUILDING); + character->SetCurrentActivity(eGameActivity::QUICKBUILDING); EntityManager::Instance()->SerializeEntity(user); - GameMessages::SendRebuildNotifyState(m_Parent, m_State, eRebuildState::REBUILD_BUILDING, user->GetObjectID()); - GameMessages::SendEnableRebuild(m_Parent, true, false, false, eFailReason::REASON_NOT_GIVEN, 0.0f, user->GetObjectID()); + GameMessages::SendRebuildNotifyState(m_Parent, m_State, eRebuildState::BUILDING, user->GetObjectID()); + GameMessages::SendEnableRebuild(m_Parent, true, false, false, eQuickBuildFailReason::NOT_GIVEN, 0.0f, user->GetObjectID()); - m_State = eRebuildState::REBUILD_BUILDING; + m_State = eRebuildState::BUILDING; m_StateDirty = true; EntityManager::Instance()->SerializeEntity(m_Parent); @@ -432,7 +435,7 @@ void RebuildComponent::CompleteRebuild(Entity* user) { auto* characterComponent = user->GetComponent(); if (characterComponent != nullptr) { - characterComponent->SetCurrentActivity(eGameActivities::ACTIVITY_NONE); + characterComponent->SetCurrentActivity(eGameActivity::NONE); characterComponent->TrackRebuildComplete(); } else { Game::logger->Log("RebuildComponent", "Some user tried to finish the rebuild but they didn't have a character somehow."); @@ -441,13 +444,13 @@ void RebuildComponent::CompleteRebuild(Entity* user) { EntityManager::Instance()->SerializeEntity(user); - GameMessages::SendRebuildNotifyState(m_Parent, m_State, eRebuildState::REBUILD_COMPLETED, user->GetObjectID()); + GameMessages::SendRebuildNotifyState(m_Parent, m_State, eRebuildState::COMPLETED, user->GetObjectID()); GameMessages::SendPlayFXEffect(m_Parent, 507, u"create", "BrickFadeUpVisCompleteEffect", LWOOBJID_EMPTY, 0.4f, 1.0f, true); - GameMessages::SendEnableRebuild(m_Parent, false, false, true, eFailReason::REASON_NOT_GIVEN, m_ResetTime, user->GetObjectID()); + GameMessages::SendEnableRebuild(m_Parent, false, false, true, eQuickBuildFailReason::NOT_GIVEN, m_ResetTime, user->GetObjectID()); GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, m_Parent->GetObjectID()); - m_State = eRebuildState::REBUILD_COMPLETED; + m_State = eRebuildState::COMPLETED; m_StateDirty = true; m_Timer = 0.0f; m_DrainedImagination = 0; @@ -520,17 +523,17 @@ void RebuildComponent::CompleteRebuild(Entity* user) { void RebuildComponent::ResetRebuild(bool failed) { Entity* builder = GetBuilder(); - if (m_State == eRebuildState::REBUILD_BUILDING && builder) { - GameMessages::SendEnableRebuild(m_Parent, false, false, failed, eFailReason::REASON_NOT_GIVEN, m_ResetTime, builder->GetObjectID()); + if (m_State == eRebuildState::BUILDING && builder) { + GameMessages::SendEnableRebuild(m_Parent, false, false, failed, eQuickBuildFailReason::NOT_GIVEN, m_ResetTime, builder->GetObjectID()); if (failed) { GameMessages::SendPlayAnimation(builder, u"rebuild-fail"); } } - GameMessages::SendRebuildNotifyState(m_Parent, m_State, eRebuildState::REBUILD_RESETTING, LWOOBJID_EMPTY); + GameMessages::SendRebuildNotifyState(m_Parent, m_State, eRebuildState::RESETTING, LWOOBJID_EMPTY); - m_State = eRebuildState::REBUILD_RESETTING; + m_State = eRebuildState::RESETTING; m_StateDirty = true; m_Timer = 0.0f; m_TimerIncomplete = 0.0f; @@ -552,15 +555,15 @@ void RebuildComponent::ResetRebuild(bool failed) { } } -void RebuildComponent::CancelRebuild(Entity* entity, eFailReason failReason, bool skipChecks) { - if (m_State != eRebuildState::REBUILD_COMPLETED || skipChecks) { +void RebuildComponent::CancelRebuild(Entity* entity, eQuickBuildFailReason failReason, bool skipChecks) { + if (m_State != eRebuildState::COMPLETED || skipChecks) { m_Builder = LWOOBJID_EMPTY; const auto entityID = entity != nullptr ? entity->GetObjectID() : LWOOBJID_EMPTY; // Notify the client that a state has changed - GameMessages::SendRebuildNotifyState(m_Parent, m_State, eRebuildState::REBUILD_INCOMPLETE, entityID); + GameMessages::SendRebuildNotifyState(m_Parent, m_State, eRebuildState::INCOMPLETE, entityID); GameMessages::SendEnableRebuild(m_Parent, false, true, false, failReason, m_Timer, entityID); // Now terminate any interaction with the rebuild @@ -568,7 +571,7 @@ void RebuildComponent::CancelRebuild(Entity* entity, eFailReason failReason, boo GameMessages::SendTerminateInteraction(m_Parent->GetObjectID(), eTerminateType::FROM_INTERACTION, m_Parent->GetObjectID()); // Now update the component itself - m_State = eRebuildState::REBUILD_INCOMPLETE; + m_State = eRebuildState::INCOMPLETE; m_StateDirty = true; // Notify scripts and possible subscribers @@ -586,7 +589,7 @@ void RebuildComponent::CancelRebuild(Entity* entity, eFailReason failReason, boo CharacterComponent* characterComponent = entity->GetComponent(); if (characterComponent) { - characterComponent->SetCurrentActivity(eGameActivities::ACTIVITY_NONE); + characterComponent->SetCurrentActivity(eGameActivity::NONE); EntityManager::Instance()->SerializeEntity(entity); } } diff --git a/dGame/dComponents/RebuildComponent.h b/dGame/dComponents/RebuildComponent.h index a8e11e4c..09dd0465 100644 --- a/dGame/dComponents/RebuildComponent.h +++ b/dGame/dComponents/RebuildComponent.h @@ -10,8 +10,10 @@ #include "Preconditions.h" #include "Component.h" #include "eReplicaComponentType.h" +#include "eRebuildState.h" class Entity; +enum class eQuickBuildFailReason : uint32_t; /** * Component that handles entities that can be built into other entities using the quick build mechanic. Generally @@ -215,7 +217,7 @@ public: * @param failReason the reason the rebuild was cancelled * @param skipChecks whether or not to skip the check for the rebuild not being completed */ - void CancelRebuild(Entity* builder, eFailReason failReason, bool skipChecks = false); + void CancelRebuild(Entity* builder, eQuickBuildFailReason failReason, bool skipChecks = false); private: /** * Whether or not the quickbuild state has been changed since we last serialized it. @@ -225,7 +227,7 @@ private: /** * The state the rebuild is currently in */ - eRebuildState m_State = eRebuildState::REBUILD_OPEN; + eRebuildState m_State = eRebuildState::OPEN; /** * The time that has passed since initiating the rebuild diff --git a/dGame/dComponents/RocketLaunchpadControlComponent.cpp b/dGame/dComponents/RocketLaunchpadControlComponent.cpp index 4f248a40..6cc5e2bc 100644 --- a/dGame/dComponents/RocketLaunchpadControlComponent.cpp +++ b/dGame/dComponents/RocketLaunchpadControlComponent.cpp @@ -17,6 +17,7 @@ #include "dServer.h" #include "dMessageIdentifiers.h" #include "PacketUtils.h" +#include "eObjectWorldState.h" RocketLaunchpadControlComponent::RocketLaunchpadControlComponent(Entity* parent, int rocketId) : Component(parent) { auto query = CDClientDatabase::CreatePreppedStmt( @@ -77,7 +78,7 @@ void RocketLaunchpadControlComponent::Launch(Entity* originator, LWOMAPID mapId, GameMessages::SendFireEventClientSide(m_Parent->GetObjectID(), originator->GetSystemAddress(), u"RocketEquipped", rocket->GetId(), cloneId, -1, originator->GetObjectID()); - GameMessages::SendChangeObjectWorldState(rocket->GetId(), WORLDSTATE_ATTACHED, UNASSIGNED_SYSTEM_ADDRESS); + GameMessages::SendChangeObjectWorldState(rocket->GetId(), eObjectWorldState::ATTACHED, UNASSIGNED_SYSTEM_ADDRESS); EntityManager::Instance()->SerializeEntity(originator); } diff --git a/dGame/dComponents/ScriptedActivityComponent.cpp b/dGame/dComponents/ScriptedActivityComponent.cpp index 1bc8c01f..f998d686 100644 --- a/dGame/dComponents/ScriptedActivityComponent.cpp +++ b/dGame/dComponents/ScriptedActivityComponent.cpp @@ -21,6 +21,7 @@ #include "dMessageIdentifiers.h" #include "Loot.h" #include "eMissionTaskType.h" +#include "eMatchUpdate.h" #include "CDCurrencyTableTable.h" #include "CDActivityRewardsTable.h" @@ -167,9 +168,9 @@ void ScriptedActivityComponent::PlayerJoinLobby(Entity* player) { } std::string matchUpdate = "player=9:" + std::to_string(entity->GetObjectID()) + "\nplayerName=0:" + entity->GetCharacter()->GetName(); - GameMessages::SendMatchUpdate(player, player->GetSystemAddress(), matchUpdate, eMatchUpdate::MATCH_UPDATE_PLAYER_JOINED); + GameMessages::SendMatchUpdate(player, player->GetSystemAddress(), matchUpdate, eMatchUpdate::PLAYER_ADDED); PlayerReady(entity, joinedPlayer->ready); - GameMessages::SendMatchUpdate(entity, entity->GetSystemAddress(), matchUpdateJoined, eMatchUpdate::MATCH_UPDATE_PLAYER_JOINED); + GameMessages::SendMatchUpdate(entity, entity->GetSystemAddress(), matchUpdateJoined, eMatchUpdate::PLAYER_ADDED); } } } @@ -185,7 +186,7 @@ void ScriptedActivityComponent::PlayerJoinLobby(Entity* player) { if (m_ActivityInfo.maxTeamSize != 1 && playerLobby->players.size() >= m_ActivityInfo.minTeamSize || m_ActivityInfo.maxTeamSize == 1 && playerLobby->players.size() >= m_ActivityInfo.minTeams) { // Update the joining player on the match timer std::string matchTimerUpdate = "time=3:" + std::to_string(playerLobby->timer); - GameMessages::SendMatchUpdate(player, player->GetSystemAddress(), matchTimerUpdate, eMatchUpdate::MATCH_UPDATE_TIME); + GameMessages::SendMatchUpdate(player, player->GetSystemAddress(), matchTimerUpdate, eMatchUpdate::PHASE_WAIT_READY); } } @@ -201,7 +202,7 @@ void ScriptedActivityComponent::PlayerLeave(LWOOBJID playerID) { if (entity == nullptr) continue; - GameMessages::SendMatchUpdate(entity, entity->GetSystemAddress(), matchUpdateLeft, eMatchUpdate::MATCH_UPDATE_PLAYER_LEFT); + GameMessages::SendMatchUpdate(entity, entity->GetSystemAddress(), matchUpdateLeft, eMatchUpdate::PLAYER_REMOVED); } delete lobby->players[i]; @@ -242,7 +243,7 @@ void ScriptedActivityComponent::Update(float deltaTime) { continue; std::string matchTimerUpdate = "time=3:" + std::to_string(lobby->timer); - GameMessages::SendMatchUpdate(entity, entity->GetSystemAddress(), matchTimerUpdate, eMatchUpdate::MATCH_UPDATE_TIME); + GameMessages::SendMatchUpdate(entity, entity->GetSystemAddress(), matchTimerUpdate, eMatchUpdate::PHASE_WAIT_READY); } } @@ -267,7 +268,7 @@ void ScriptedActivityComponent::Update(float deltaTime) { if (entity == nullptr) continue; - GameMessages::SendMatchUpdate(entity, entity->GetSystemAddress(), matchTimerUpdate, eMatchUpdate::MATCH_UPDATE_TIME_START_DELAY); + GameMessages::SendMatchUpdate(entity, entity->GetSystemAddress(), matchTimerUpdate, eMatchUpdate::PHASE_WAIT_START); } } @@ -375,8 +376,8 @@ void ScriptedActivityComponent::PlayerReady(Entity* player, bool bReady) { // Update players in lobby on player being ready std::string matchReadyUpdate = "player=9:" + std::to_string(player->GetObjectID()); - eMatchUpdate readyStatus = eMatchUpdate::MATCH_UPDATE_PLAYER_READY; - if (!bReady) readyStatus = eMatchUpdate::MATCH_UPDATE_PLAYER_UNREADY; + eMatchUpdate readyStatus = eMatchUpdate::PLAYER_READY; + if (!bReady) readyStatus = eMatchUpdate::PLAYER_NOT_READY; for (LobbyPlayer* otherPlayer : lobby->players) { auto* entity = otherPlayer->GetEntity(); if (entity == nullptr) diff --git a/dGame/dComponents/SwitchComponent.cpp b/dGame/dComponents/SwitchComponent.cpp index 392d885a..c59559c2 100644 --- a/dGame/dComponents/SwitchComponent.cpp +++ b/dGame/dComponents/SwitchComponent.cpp @@ -39,7 +39,7 @@ bool SwitchComponent::GetActive() const { void SwitchComponent::EntityEnter(Entity* entity) { if (!m_Active) { if (m_Rebuild) { - if (m_Rebuild->GetState() != eRebuildState::REBUILD_COMPLETED) return; + if (m_Rebuild->GetState() != eRebuildState::COMPLETED) return; } m_Active = true; if (!m_Parent) return; diff --git a/dGame/dGameMessages/GameMessages.cpp b/dGame/dGameMessages/GameMessages.cpp index f5cbc811..4d5a378c 100644 --- a/dGame/dGameMessages/GameMessages.cpp +++ b/dGame/dGameMessages/GameMessages.cpp @@ -36,6 +36,12 @@ #include "eMissionState.h" #include "eObjectBits.h" #include "eTriggerEventType.h" +#include "eMatchUpdate.h" +#include "eCyclingMode.h" +#include "eCinematicEvent.h" +#include "eQuickBuildFailReason.h" +#include "eControlScheme.h" +#include "eStateChangeType.h" #include #include @@ -294,9 +300,9 @@ void GameMessages::SendPlayerSetCameraCyclingMode(const LWOOBJID& objectID, cons bitStream.Write(bAllowCyclingWhileDeadOnly); - bitStream.Write(cyclingMode != ALLOW_CYCLE_TEAMMATES); - if (cyclingMode != ALLOW_CYCLE_TEAMMATES) { - bitStream.Write(cyclingMode); + bitStream.Write(cyclingMode != eCyclingMode::ALLOW_CYCLE_TEAMMATES); + if (cyclingMode != eCyclingMode::ALLOW_CYCLE_TEAMMATES) { + bitStream.Write(cyclingMode); } SEND_PACKET; @@ -440,8 +446,8 @@ void GameMessages::SendAddItemToInventoryClientSync(Entity* entity, const System bitStream.Write(item->GetInfo().isBOE); bitStream.Write(item->GetInfo().isBOP); - bitStream.Write(lootSourceType != eLootSourceType::LOOT_SOURCE_NONE); // Loot source - if (lootSourceType != eLootSourceType::LOOT_SOURCE_NONE) bitStream.Write(lootSourceType); + bitStream.Write(lootSourceType != eLootSourceType::NONE); // Loot source + if (lootSourceType != eLootSourceType::NONE) bitStream.Write(lootSourceType); LWONameValue extraInfo; auto config = item->GetConfig(); @@ -489,7 +495,7 @@ void GameMessages::SendAddItemToInventoryClientSync(Entity* entity, const System SEND_PACKET; } -void GameMessages::SendNotifyClientFlagChange(const LWOOBJID& objectID, int iFlagID, bool bFlag, const SystemAddress& sysAddr) { +void GameMessages::SendNotifyClientFlagChange(const LWOOBJID& objectID, uint32_t iFlagID, bool bFlag, const SystemAddress& sysAddr) { CBITSTREAM; CMSGHEADER; @@ -501,7 +507,7 @@ void GameMessages::SendNotifyClientFlagChange(const LWOOBJID& objectID, int iFla SEND_PACKET; } -void GameMessages::SendChangeObjectWorldState(const LWOOBJID& objectID, int state, const SystemAddress& sysAddr) { +void GameMessages::SendChangeObjectWorldState(const LWOOBJID& objectID, eObjectWorldState state, const SystemAddress& sysAddr) { CBITSTREAM; CMSGHEADER; @@ -582,8 +588,8 @@ void GameMessages::SendModifyLEGOScore(Entity* entity, const SystemAddress& sysA bitStream.Write((uint16_t)GAME_MSG_MODIFY_LEGO_SCORE); bitStream.Write(score); - bitStream.Write(sourceType != eLootSourceType::LOOT_SOURCE_NONE); - if (sourceType != eLootSourceType::LOOT_SOURCE_NONE) bitStream.Write(sourceType); + bitStream.Write(sourceType != eLootSourceType::NONE); + if (sourceType != eLootSourceType::NONE) bitStream.Write(sourceType); SEND_PACKET; } @@ -743,14 +749,14 @@ void GameMessages::SendSetCurrency(Entity* entity, int64_t currency, int lootTyp bitStream.Write(sourceTradeID != LWOOBJID_EMPTY); if (sourceTradeID != LWOOBJID_EMPTY) bitStream.Write(sourceTradeID); - bitStream.Write(sourceType != LOOTTYPE_NONE); - if (sourceType != LOOTTYPE_NONE) bitStream.Write(sourceType); + bitStream.Write(sourceType != eLootSourceType::NONE); + if (sourceType != eLootSourceType::NONE) bitStream.Write(sourceType); SystemAddress sysAddr = entity->GetSystemAddress(); SEND_PACKET; } -void GameMessages::SendRebuildNotifyState(Entity* entity, int prevState, int state, const LWOOBJID& playerID) { +void GameMessages::SendRebuildNotifyState(Entity* entity, eRebuildState prevState, eRebuildState state, const LWOOBJID& playerID) { CBITSTREAM; CMSGHEADER; @@ -764,7 +770,7 @@ void GameMessages::SendRebuildNotifyState(Entity* entity, int prevState, int sta SEND_PACKET_BROADCAST; } -void GameMessages::SendEnableRebuild(Entity* entity, bool enable, bool fail, bool success, int failReason, float duration, const LWOOBJID& playerID) { +void GameMessages::SendEnableRebuild(Entity* entity, bool enable, bool fail, bool success, eQuickBuildFailReason failReason, float duration, const LWOOBJID& playerID) { CBITSTREAM; CMSGHEADER; @@ -775,8 +781,8 @@ void GameMessages::SendEnableRebuild(Entity* entity, bool enable, bool fail, boo bitStream.Write(fail); bitStream.Write(success); - bitStream.Write(failReason != eFailReason::REASON_NOT_GIVEN); - if (failReason != eFailReason::REASON_NOT_GIVEN) bitStream.Write(failReason); + bitStream.Write(failReason != eQuickBuildFailReason::NOT_GIVEN); + if (failReason != eQuickBuildFailReason::NOT_GIVEN) bitStream.Write(failReason); bitStream.Write(duration); bitStream.Write(playerID); @@ -843,8 +849,8 @@ void GameMessages::SendDie(Entity* entity, const LWOOBJID& killerID, const LWOOB bitStream.Write(directionRelative_AngleY); bitStream.Write(directionRelative_Force); - bitStream.Write(killType != VIOLENT); - if (killType != VIOLENT) bitStream.Write(killType); + bitStream.Write(killType != eKillType::VIOLENT); + if (killType != eKillType::VIOLENT) bitStream.Write(killType); bitStream.Write(killerID); @@ -1104,7 +1110,7 @@ void GameMessages::SendDropClientLoot(Entity* entity, const LWOOBJID& sourceID, SEND_PACKET; } -void GameMessages::SendSetPlayerControlScheme(Entity* entity, eControlSceme controlScheme) { +void GameMessages::SendSetPlayerControlScheme(Entity* entity, eControlScheme controlScheme) { CBITSTREAM; CMSGHEADER; @@ -1117,8 +1123,8 @@ void GameMessages::SendSetPlayerControlScheme(Entity* entity, eControlSceme cont bitStream.Write(bDelayCamSwitchIfInCinematic); bitStream.Write(bSwitchCam); - bitStream.Write(controlScheme != SCHEME_A); - if (controlScheme != SCHEME_A) bitStream.Write(controlScheme); + bitStream.Write(controlScheme != eControlScheme::SCHEME_A); + if (controlScheme != eControlScheme::SCHEME_A) bitStream.Write(controlScheme); SystemAddress sysAddr = entity->GetSystemAddress(); SEND_PACKET; @@ -1376,7 +1382,7 @@ void GameMessages::SendUseItemResult(Entity* entity, LOT templateID, bool useIte SEND_PACKET; } -void GameMessages::SendUseItemRequirementsResponse(LWOOBJID objectID, const SystemAddress& sysAddr, UseItemResponse itemResponse) { +void GameMessages::SendUseItemRequirementsResponse(LWOOBJID objectID, const SystemAddress& sysAddr, eUseItemResponse itemResponse) { CBITSTREAM; CMSGHEADER; @@ -1449,7 +1455,7 @@ void GameMessages::SendMatchResponse(Entity* entity, const SystemAddress& sysAdd SEND_PACKET; } -void GameMessages::SendMatchUpdate(Entity* entity, const SystemAddress& sysAddr, std::string data, int type) { +void GameMessages::SendMatchUpdate(Entity* entity, const SystemAddress& sysAddr, std::string data, eMatchUpdate type) { CBITSTREAM; CMSGHEADER; @@ -2879,7 +2885,7 @@ void GameMessages::SendEndCinematic(LWOOBJID objectId, std::u16string pathName, void GameMessages::HandleCinematicUpdate(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) { eCinematicEvent event; if (!inStream->ReadBit()) { - event = STARTED; + event = eCinematicEvent::STARTED; } else { inStream->Read(event); } @@ -3425,7 +3431,7 @@ void GameMessages::HandleClientTradeUpdate(RakNet::BitStream* inStream, Entity* //Pets: -void GameMessages::SendNotifyPetTamingMinigame(LWOOBJID objectId, LWOOBJID petId, LWOOBJID playerTamingId, bool bForceTeleport, uint32_t notifyType, NiPoint3 petsDestPos, NiPoint3 telePos, NiQuaternion teleRot, const SystemAddress& sysAddr) { +void GameMessages::SendNotifyPetTamingMinigame(LWOOBJID objectId, LWOOBJID petId, LWOOBJID playerTamingId, bool bForceTeleport, ePetTamingNotifyType notifyType, NiPoint3 petsDestPos, NiPoint3 telePos, NiQuaternion teleRot, const SystemAddress& sysAddr) { CBITSTREAM; CMSGHEADER; @@ -4141,7 +4147,7 @@ void GameMessages::HandleRequestDie(RakNet::BitStream* inStream, Entity* entity, float directionRelativeAngleXZ; float directionRelativeAngleY; float directionRelativeForce; - int32_t killType = VIOLENT; + eKillType killType = eKillType::VIOLENT; LWOOBJID killerID; LWOOBJID lootOwnerID = LWOOBJID_EMPTY; @@ -4415,7 +4421,7 @@ void GameMessages::SendVehicleStopBoost(Entity* targetEntity, const SystemAddres bitStream.Write(targetEntity->GetObjectID()); bitStream.Write(GAME_MSG::GAME_MSG_VEHICLE_STOP_BOOST); - + bitStream.Write(affectPassive); SEND_PACKET_BROADCAST; @@ -4427,7 +4433,7 @@ void GameMessages::SendSetResurrectRestoreValues(Entity* targetEntity, int32_t a bitStream.Write(targetEntity->GetObjectID()); bitStream.Write(GAME_MSG::GAME_MSG_SET_RESURRECT_RESTORE_VALUES); - + bitStream.Write(armorRestore != -1); if (armorRestore != -1) bitStream.Write(armorRestore); @@ -4766,7 +4772,7 @@ void GameMessages::HandleBuyFromVendor(RakNet::BitStream* inStream, Entity* enti inv->RemoveItem(tokenId, altCurrencyCost); - inv->AddItem(item, count, eLootSourceType::LOOT_SOURCE_VENDOR); + inv->AddItem(item, count, eLootSourceType::VENDOR); } else { float buyScalar = vend->GetBuyScalar(); @@ -4786,8 +4792,8 @@ void GameMessages::HandleBuyFromVendor(RakNet::BitStream* inStream, Entity* enti inv->RemoveItem(itemComp.currencyLOT, altCurrencyCost); } - character->SetCoins(character->GetCoins() - (coinCost), eLootSourceType::LOOT_SOURCE_VENDOR); - inv->AddItem(item, count, eLootSourceType::LOOT_SOURCE_VENDOR); + character->SetCoins(character->GetCoins() - (coinCost), eLootSourceType::VENDOR); + inv->AddItem(item, count, eLootSourceType::VENDOR); } GameMessages::SendVendorTransactionResult(entity, sysAddr); @@ -4829,12 +4835,12 @@ void GameMessages::HandleSellToVendor(RakNet::BitStream* inStream, Entity* entit float sellScalar = vend->GetSellScalar(); if (Inventory::IsValidItem(itemComp.currencyLOT)) { const auto altCurrency = static_cast(itemComp.altCurrencyCost * sellScalar) * count; - inv->AddItem(itemComp.currencyLOT, std::floor(altCurrency), eLootSourceType::LOOT_SOURCE_VENDOR); // Return alt currencies like faction tokens. + inv->AddItem(itemComp.currencyLOT, std::floor(altCurrency), eLootSourceType::VENDOR); // Return alt currencies like faction tokens. } //inv->RemoveItem(count, -1, iObjID); inv->MoveItemToInventory(item, eInventoryType::VENDOR_BUYBACK, count, true, false, true); - character->SetCoins(std::floor(character->GetCoins() + (static_cast(itemComp.baseValue * sellScalar) * count)), eLootSourceType::LOOT_SOURCE_VENDOR); + character->SetCoins(std::floor(character->GetCoins() + (static_cast(itemComp.baseValue * sellScalar) * count)), eLootSourceType::VENDOR); //EntityManager::Instance()->SerializeEntity(player); // so inventory updates GameMessages::SendVendorTransactionResult(entity, sysAddr); } @@ -4893,7 +4899,7 @@ void GameMessages::HandleBuybackFromVendor(RakNet::BitStream* inStream, Entity* //inv->RemoveItem(count, -1, iObjID); inv->MoveItemToInventory(item, Inventory::FindInventoryTypeForLot(item->GetLot()), count, true, false); - character->SetCoins(character->GetCoins() - cost, eLootSourceType::LOOT_SOURCE_VENDOR); + character->SetCoins(character->GetCoins() - cost, eLootSourceType::VENDOR); //EntityManager::Instance()->SerializeEntity(player); // so inventory updates GameMessages::SendVendorTransactionResult(entity, sysAddr); } @@ -5015,7 +5021,7 @@ void GameMessages::HandleRebuildCancel(RakNet::BitStream* inStream, Entity* enti RebuildComponent* rebComp = static_cast(entity->GetComponent(eReplicaComponentType::QUICK_BUILD)); if (!rebComp) return; - rebComp->CancelRebuild(EntityManager::Instance()->GetEntity(userID), eFailReason::REASON_CANCELED_EARLY); + rebComp->CancelRebuild(EntityManager::Instance()->GetEntity(userID), eQuickBuildFailReason::CANCELED_EARLY); } void GameMessages::HandleRequestUse(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) { @@ -5135,12 +5141,12 @@ void GameMessages::HandleModularBuildConvertModel(RakNet::BitStream* inStream, E item->Disassemble(TEMP_MODELS); - item->SetCount(item->GetCount() - 1, false, false, true, eLootSourceType::LOOT_SOURCE_QUICKBUILD); + item->SetCount(item->GetCount() - 1, false, false, true, eLootSourceType::QUICKBUILD); } void GameMessages::HandleSetFlag(RakNet::BitStream* inStream, Entity* entity) { bool bFlag{}; - int iFlagID{}; + int32_t iFlagID{}; inStream->Read(bFlag); inStream->Read(iFlagID); @@ -5301,7 +5307,7 @@ void GameMessages::HandlePickupCurrency(RakNet::BitStream* inStream, Entity* ent auto* ch = entity->GetCharacter(); if (entity->CanPickupCoins(currency)) { - ch->SetCoins(ch->GetCoins() + currency, eLootSourceType::LOOT_SOURCE_PICKUP); + ch->SetCoins(ch->GetCoins() + currency, eLootSourceType::PICKUP); } } @@ -5615,9 +5621,9 @@ void GameMessages::HandleModularBuildFinish(RakNet::BitStream* inStream, Entity* config.push_back(moduleAssembly); if (count == 3) { - inv->AddItem(6416, 1, eLootSourceType::LOOT_SOURCE_QUICKBUILD, eInventoryType::MODELS, config); + inv->AddItem(6416, 1, eLootSourceType::QUICKBUILD, eInventoryType::MODELS, config); } else if (count == 7) { - inv->AddItem(8092, 1, eLootSourceType::LOOT_SOURCE_QUICKBUILD, eInventoryType::MODELS, config); + inv->AddItem(8092, 1, eLootSourceType::QUICKBUILD, eInventoryType::MODELS, config); } auto* missionComponent = character->GetComponent(); diff --git a/dGame/dGameMessages/GameMessages.h b/dGame/dGameMessages/GameMessages.h index 68f4542f..ce24a105 100644 --- a/dGame/dGameMessages/GameMessages.h +++ b/dGame/dGameMessages/GameMessages.h @@ -8,6 +8,9 @@ #include "eMovementPlatformState.h" #include "NiPoint3.h" #include "eEndBehavior.h" +#include "eCyclingMode.h" +#include "eLootSourceType.h" +#include "Brick.h" class AMFValue; class Entity; @@ -23,6 +26,16 @@ enum class eAnimationFlags : uint32_t; enum class eUnequippableActiveType; enum eInventoryType : uint32_t; enum class eGameMasterLevel : uint8_t; +enum class eMatchUpdate : int32_t; +enum class eKillType : uint32_t; +enum class eObjectWorldState : uint32_t; +enum class eTerminateType : uint32_t; +enum class eControlScheme : uint32_t; +enum class eStateChangeType : uint32_t; +enum class ePetTamingNotifyType : uint32_t; +enum class eUseItemResponse : uint32_t; +enum class eQuickBuildFailReason : uint32_t; +enum class eRebuildState : uint32_t; namespace GameMessages { class PropertyDataMessage; @@ -51,8 +64,7 @@ namespace GameMessages { int targetTYPE = 0 ); - void SendPlayerSetCameraCyclingMode(const LWOOBJID& objectID, const SystemAddress& sysAddr, - bool bAllowCyclingWhileDeadOnly = true, eCyclingMode cyclingMode = ALLOW_CYCLE_TEAMMATES); + void SendPlayerSetCameraCyclingMode(const LWOOBJID& objectID, const SystemAddress& sysAddr, bool bAllowCyclingWhileDeadOnly = true, eCyclingMode cyclingMode = eCyclingMode::ALLOW_CYCLE_TEAMMATES); void SendPlayNDAudioEmitter(Entity* entity, const SystemAddress& sysAddr, std::string audioGUID); @@ -66,9 +78,9 @@ namespace GameMessages { void SendGMLevelBroadcast(const LWOOBJID& objectID, eGameMasterLevel level); void SendChatModeUpdate(const LWOOBJID& objectID, eGameMasterLevel level); - void SendAddItemToInventoryClientSync(Entity* entity, const SystemAddress& sysAddr, Item* item, const LWOOBJID& objectID, bool showFlyingLoot, int itemCount, LWOOBJID subKey = LWOOBJID_EMPTY, eLootSourceType lootSourceType = eLootSourceType::LOOT_SOURCE_NONE); - void SendNotifyClientFlagChange(const LWOOBJID& objectID, int iFlagID, bool bFlag, const SystemAddress& sysAddr); - void SendChangeObjectWorldState(const LWOOBJID& objectID, int state, const SystemAddress& sysAddr); + void SendAddItemToInventoryClientSync(Entity* entity, const SystemAddress& sysAddr, Item* item, const LWOOBJID& objectID, bool showFlyingLoot, int itemCount, LWOOBJID subKey = LWOOBJID_EMPTY, eLootSourceType lootSourceType = eLootSourceType::NONE); + void SendNotifyClientFlagChange(const LWOOBJID& objectID, uint32_t iFlagID, bool bFlag, const SystemAddress& sysAddr); + void SendChangeObjectWorldState(const LWOOBJID& objectID, eObjectWorldState state, const SystemAddress& sysAddr); void SendOfferMission(const LWOOBJID& entity, const SystemAddress& sysAddr, int32_t missionID, const LWOOBJID& offererID); void SendNotifyMission(Entity* entity, const SystemAddress& sysAddr, int missionID, int missionState, bool sendingRewards); @@ -86,8 +98,8 @@ namespace GameMessages { void SendBroadcastTextToChatbox(Entity* entity, const SystemAddress& sysAddr, const std::u16string& attrs, const std::u16string& wsText); void SendSetCurrency(Entity* entity, int64_t currency, int lootType, const LWOOBJID& sourceID, const LOT& sourceLOT, int sourceTradeID, bool overrideCurrent, eLootSourceType sourceType); - void SendRebuildNotifyState(Entity* entity, int prevState, int state, const LWOOBJID& playerID); - void SendEnableRebuild(Entity* entity, bool enable, bool fail, bool success, int failReason, float duration, const LWOOBJID& playerID); + void SendRebuildNotifyState(Entity* entity, eRebuildState prevState, eRebuildState state, const LWOOBJID& playerID); + void SendEnableRebuild(Entity* entity, bool enable, bool fail, bool success, eQuickBuildFailReason failReason, float duration, const LWOOBJID& playerID); void AddActivityOwner(Entity* entity, LWOOBJID& ownerID); void SendTerminateInteraction(const LWOOBJID& objectID, eTerminateType type, const LWOOBJID& terminator); @@ -104,7 +116,7 @@ namespace GameMessages { void SendSetNetworkScriptVar(Entity* entity, const SystemAddress& sysAddr, std::string data); void SendDropClientLoot(Entity* entity, const LWOOBJID& sourceID, LOT item, int currency, NiPoint3 spawnPos = NiPoint3::ZERO, int count = 1); - void SendSetPlayerControlScheme(Entity* entity, eControlSceme controlScheme); + void SendSetPlayerControlScheme(Entity* entity, eControlScheme controlScheme); void SendPlayerReachedRespawnCheckpoint(Entity* entity, const NiPoint3& position, const NiQuaternion& rotation); void SendAddSkill(Entity* entity, TSkillID skillID, int slotID); @@ -123,7 +135,7 @@ namespace GameMessages { void SendMoveInventoryBatch(Entity* entity, uint32_t stackCount, int srcInv, int dstInv, const LWOOBJID& iObjID); void SendMatchResponse(Entity* entity, const SystemAddress& sysAddr, int response); - void SendMatchUpdate(Entity* entity, const SystemAddress& sysAddr, std::string data, int type); + void SendMatchUpdate(Entity* entity, const SystemAddress& sysAddr, std::string data, eMatchUpdate type); void HandleUnUseModel(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr); void SendStartCelebrationEffect(Entity* entity, const SystemAddress& sysAddr, int celebrationID); @@ -350,7 +362,7 @@ namespace GameMessages { void HandleClientTradeUpdate(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr); //Pets: - void SendNotifyPetTamingMinigame(LWOOBJID objectId, LWOOBJID petId, LWOOBJID playerTamingId, bool bForceTeleport, uint32_t notifyType, NiPoint3 petsDestPos, NiPoint3 telePos, NiQuaternion teleRot, const SystemAddress& sysAddr); + void SendNotifyPetTamingMinigame(LWOOBJID objectId, LWOOBJID petId, LWOOBJID playerTamingId, bool bForceTeleport, ePetTamingNotifyType notifyType, NiPoint3 petsDestPos, NiPoint3 telePos, NiQuaternion teleRot, const SystemAddress& sysAddr); void SendNotifyPetTamingPuzzleSelected(LWOOBJID objectId, std::vector& bricks, const SystemAddress& sysAddr); @@ -520,7 +532,7 @@ namespace GameMessages { void SendActivityPause(LWOOBJID objectId, bool pause = false, const SystemAddress& sysAddr = UNASSIGNED_SYSTEM_ADDRESS); void SendStartActivityTime(LWOOBJID objectId, float_t startTime, const SystemAddress& sysAddr = UNASSIGNED_SYSTEM_ADDRESS); void SendRequestActivityEnter(LWOOBJID objectId, const SystemAddress& sysAddr, bool bStart, LWOOBJID userID); - void SendUseItemRequirementsResponse(LWOOBJID objectID, const SystemAddress& sysAddr, UseItemResponse itemResponse); + void SendUseItemRequirementsResponse(LWOOBJID objectID, const SystemAddress& sysAddr, eUseItemResponse itemResponse); // SG: diff --git a/dGame/dInventory/Item.cpp b/dGame/dInventory/Item.cpp index 62dffa12..83ac8869 100644 --- a/dGame/dInventory/Item.cpp +++ b/dGame/dInventory/Item.cpp @@ -18,6 +18,7 @@ #include "Loot.h" #include "eObjectBits.h" #include "eReplicaComponentType.h" +#include "eUseItemResponse.h" #include "CDBrickIDTableTable.h" #include "CDObjectSkillsTable.h" @@ -330,7 +331,7 @@ void Item::UseNonEquip(Item* item) { } } if (playerInventoryComponent->HasSpaceForLoot(rolledLoot)) { - LootGenerator::Instance().GiveLoot(playerInventoryComponent->GetParent(), rolledLoot, eLootSourceType::LOOT_SOURCE_CONSUMPTION); + LootGenerator::Instance().GiveLoot(playerInventoryComponent->GetParent(), rolledLoot, eLootSourceType::CONSUMPTION); item->SetCount(item->GetCount() - 1); } else { success = false; @@ -339,7 +340,7 @@ void Item::UseNonEquip(Item* item) { GameMessages::SendUseItemRequirementsResponse( playerInventoryComponent->GetParent()->GetObjectID(), playerInventoryComponent->GetParent()->GetSystemAddress(), - UseItemResponse::FailedPrecondition + eUseItemResponse::FailedPrecondition ); success = false; } @@ -379,7 +380,7 @@ void Item::Disassemble(const eInventoryType inventoryType) { } for (const auto mod : modArray) { - inventory->GetComponent()->AddItem(mod, 1, eLootSourceType::LOOT_SOURCE_DELETION, inventoryType); + inventory->GetComponent()->AddItem(mod, 1, eLootSourceType::DELETION, inventoryType); } } } @@ -477,7 +478,7 @@ void Item::DisassembleModel() { continue; } - GetInventory()->GetComponent()->AddItem(brickID[0].NDObjectID, 1, eLootSourceType::LOOT_SOURCE_DELETION); + GetInventory()->GetComponent()->AddItem(brickID[0].NDObjectID, 1, eLootSourceType::DELETION); } } diff --git a/dGame/dInventory/Item.h b/dGame/dInventory/Item.h index 6993a0ba..be2359ef 100644 --- a/dGame/dInventory/Item.h +++ b/dGame/dInventory/Item.h @@ -7,6 +7,7 @@ #include "dLogger.h" #include "Preconditions.h" #include "eInventoryType.h" +#include "eLootSourceType.h" /** * An item that can be stored in an inventory and optionally consumed or equipped @@ -38,7 +39,7 @@ public: const std::vector& config, LWOOBJID parent, LWOOBJID subKey, - eLootSourceType lootSourceType = eLootSourceType::LOOT_SOURCE_NONE + eLootSourceType lootSourceType = eLootSourceType::NONE ); /** @@ -65,7 +66,7 @@ public: bool isModMoveAndEquip = false, LWOOBJID subKey = LWOOBJID_EMPTY, bool bound = false, - eLootSourceType lootSourceType = eLootSourceType::LOOT_SOURCE_NONE + eLootSourceType lootSourceType = eLootSourceType::NONE ); ~Item(); @@ -89,7 +90,7 @@ public: * @param disassemble if items were removed, this returns all the sub parts of the item individually if it had assembly part lots * @param showFlyingLoot shows flying loot to the client, if not silent */ - void SetCount(uint32_t value, bool silent = false, bool disassemble = true, bool showFlyingLoot = true, eLootSourceType lootSourceType = eLootSourceType::LOOT_SOURCE_NONE); + void SetCount(uint32_t value, bool silent = false, bool disassemble = true, bool showFlyingLoot = true, eLootSourceType lootSourceType = eLootSourceType::NONE); /** * Returns the number of items this item represents (e.g. for stacks) diff --git a/dGame/dMission/Mission.cpp b/dGame/dMission/Mission.cpp index 9cfdaaa7..32a930e4 100644 --- a/dGame/dMission/Mission.cpp +++ b/dGame/dMission/Mission.cpp @@ -388,7 +388,7 @@ void Mission::Catchup() { } if (type == eMissionTaskType::PLAYER_FLAG) { - for (auto target : task->GetAllTargets()) { + for (int32_t target : task->GetAllTargets()) { const auto flag = GetUser()->GetLastUsedChar()->GetPlayerFlag(target); if (!flag) { @@ -442,7 +442,7 @@ void Mission::YieldRewards() { int32_t coinsToSend = 0; if (info->LegoScore > 0) { - eLootSourceType lootSource = info->isMission ? eLootSourceType::LOOT_SOURCE_MISSION : eLootSourceType::LOOT_SOURCE_ACHIEVEMENT; + eLootSourceType lootSource = info->isMission ? eLootSourceType::MISSION : eLootSourceType::ACHIEVEMENT; if (levelComponent->GetLevel() >= dZoneManager::Instance()->GetWorldConfig()->levelCap) { // Since the character is at the level cap we reward them with coins instead of UScore. coinsToSend += info->LegoScore * dZoneManager::Instance()->GetWorldConfig()->levelCapCurrencyConversion; @@ -475,11 +475,11 @@ void Mission::YieldRewards() { count = 0; } - inventoryComponent->AddItem(pair.first, count, IsMission() ? eLootSourceType::LOOT_SOURCE_MISSION : eLootSourceType::LOOT_SOURCE_ACHIEVEMENT); + inventoryComponent->AddItem(pair.first, count, IsMission() ? eLootSourceType::MISSION : eLootSourceType::ACHIEVEMENT); } if (info->reward_currency_repeatable > 0 || coinsToSend > 0) { - eLootSourceType lootSource = info->isMission ? eLootSourceType::LOOT_SOURCE_MISSION : eLootSourceType::LOOT_SOURCE_ACHIEVEMENT; + eLootSourceType lootSource = info->isMission ? eLootSourceType::MISSION : eLootSourceType::ACHIEVEMENT; character->SetCoins(character->GetCoins() + info->reward_currency_repeatable + coinsToSend, lootSource); } @@ -508,11 +508,11 @@ void Mission::YieldRewards() { count = 0; } - inventoryComponent->AddItem(pair.first, count, IsMission() ? eLootSourceType::LOOT_SOURCE_MISSION : eLootSourceType::LOOT_SOURCE_ACHIEVEMENT); + inventoryComponent->AddItem(pair.first, count, IsMission() ? eLootSourceType::MISSION : eLootSourceType::ACHIEVEMENT); } if (info->reward_currency > 0 || coinsToSend > 0) { - eLootSourceType lootSource = info->isMission ? eLootSourceType::LOOT_SOURCE_MISSION : eLootSourceType::LOOT_SOURCE_ACHIEVEMENT; + eLootSourceType lootSource = info->isMission ? eLootSourceType::MISSION : eLootSourceType::ACHIEVEMENT; character->SetCoins(character->GetCoins() + info->reward_currency + coinsToSend, lootSource); } diff --git a/dGame/dUtilities/Loot.cpp b/dGame/dUtilities/Loot.cpp index da0f2487..c788c016 100644 --- a/dGame/dUtilities/Loot.cpp +++ b/dGame/dUtilities/Loot.cpp @@ -318,13 +318,13 @@ void LootGenerator::GiveActivityLoot(Entity* player, Entity* source, uint32_t ac maxCoins = currencyTable[0].maxvalue; } - GiveLoot(player, selectedReward->LootMatrixIndex, eLootSourceType::LOOT_SOURCE_ACTIVITY); + GiveLoot(player, selectedReward->LootMatrixIndex, eLootSourceType::ACTIVITY); uint32_t coins = (int)(minCoins + GeneralUtils::GenerateRandomNumber(0, 1) * (maxCoins - minCoins)); auto* character = player->GetCharacter(); - character->SetCoins(character->GetCoins() + coins, eLootSourceType::LOOT_SOURCE_ACTIVITY); + character->SetCoins(character->GetCoins() + coins, eLootSourceType::ACTIVITY); } void LootGenerator::DropLoot(Entity* player, Entity* killedObject, uint32_t matrixIndex, uint32_t minCoins, uint32_t maxCoins) { diff --git a/dGame/dUtilities/Loot.h b/dGame/dUtilities/Loot.h index 7ecc22b8..a1c52b63 100644 --- a/dGame/dUtilities/Loot.h +++ b/dGame/dUtilities/Loot.h @@ -47,8 +47,8 @@ public: std::unordered_map RollLootMatrix(Entity* player, uint32_t matrixIndex); std::unordered_map RollLootMatrix(uint32_t matrixIndex); - void GiveLoot(Entity* player, uint32_t matrixIndex, eLootSourceType lootSourceType = eLootSourceType::LOOT_SOURCE_NONE); - void GiveLoot(Entity* player, std::unordered_map& result, eLootSourceType lootSourceType = eLootSourceType::LOOT_SOURCE_NONE); + void GiveLoot(Entity* player, uint32_t matrixIndex, eLootSourceType lootSourceType = eLootSourceType::NONE); + void GiveLoot(Entity* player, std::unordered_map& result, eLootSourceType lootSourceType = eLootSourceType::NONE); void GiveActivityLoot(Entity* player, Entity* source, uint32_t activityID, int32_t rating = 0); void DropLoot(Entity* player, Entity* killedObject, uint32_t matrixIndex, uint32_t minCoins, uint32_t maxCoins); void DropLoot(Entity* player, Entity* killedObject, std::unordered_map& result, uint32_t minCoins, uint32_t maxCoins); diff --git a/dGame/dUtilities/Mail.cpp b/dGame/dUtilities/Mail.cpp index 5cd11ea4..1d3e0f60 100644 --- a/dGame/dUtilities/Mail.cpp +++ b/dGame/dUtilities/Mail.cpp @@ -259,7 +259,7 @@ void Mail::HandleSendMail(RakNet::BitStream* packet, const SystemAddress& sysAdd } Mail::SendSendResponse(sysAddr, Mail::MailSendResponse::Success); - entity->GetCharacter()->SetCoins(entity->GetCharacter()->GetCoins() - mailCost, eLootSourceType::LOOT_SOURCE_MAIL); + entity->GetCharacter()->SetCoins(entity->GetCharacter()->GetCoins() - mailCost, eLootSourceType::MAIL); Game::logger->Log("Mail", "Seeing if we need to remove item with ID/count/LOT: %i %i %i", itemID, attachmentCount, itemLOT); @@ -359,7 +359,7 @@ void Mail::HandleAttachmentCollect(RakNet::BitStream* packet, const SystemAddres auto inv = static_cast(player->GetComponent(eReplicaComponentType::INVENTORY)); if (!inv) return; - inv->AddItem(attachmentLOT, attachmentCount, eLootSourceType::LOOT_SOURCE_MAIL); + inv->AddItem(attachmentLOT, attachmentCount, eLootSourceType::MAIL); Mail::SendAttachmentRemoveConfirm(sysAddr, mailID); diff --git a/dGame/dUtilities/SlashCommandHandler.cpp b/dGame/dUtilities/SlashCommandHandler.cpp index 9c1bc611..66e9bc9b 100644 --- a/dGame/dUtilities/SlashCommandHandler.cpp +++ b/dGame/dUtilities/SlashCommandHandler.cpp @@ -78,6 +78,7 @@ #include "eObjectBits.h" #include "eGameMasterLevel.h" #include "eReplicaComponentType.h" +#include "eControlScheme.h" #include "CDObjectsTable.h" #include "CDZoneTableTable.h" @@ -497,7 +498,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit const auto state = !entity->GetVar(u"freecam"); entity->SetVar(u"freecam", state); - GameMessages::SendSetPlayerControlScheme(entity, static_cast(state ? 9 : 1)); + GameMessages::SendSetPlayerControlScheme(entity, static_cast(state ? 9 : 1)); ChatPackets::SendSystemMessage(sysAddr, u"Toggled freecam."); return; @@ -511,7 +512,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit return; } - GameMessages::SendSetPlayerControlScheme(entity, static_cast(scheme)); + GameMessages::SendSetPlayerControlScheme(entity, static_cast(scheme)); ChatPackets::SendSystemMessage(sysAddr, u"Switched control scheme."); return; @@ -653,7 +654,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit } if (chatCommand == "setflag" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() == 1) { - uint32_t flagId; + int32_t flagId; if (!GeneralUtils::TryParse(args[0], flagId)) { ChatPackets::SendSystemMessage(sysAddr, u"Invalid flag id."); @@ -664,7 +665,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit } if (chatCommand == "setflag" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() == 2) { - uint32_t flagId; + int32_t flagId; std::string onOffFlag = args[0]; if (!GeneralUtils::TryParse(args[1], flagId)) { ChatPackets::SendSystemMessage(sysAddr, u"Invalid flag id."); @@ -677,7 +678,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit entity->GetCharacter()->SetPlayerFlag(flagId, onOffFlag == "on"); } if (chatCommand == "clearflag" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() == 1) { - uint32_t flagId; + int32_t flagId; if (!GeneralUtils::TryParse(args[0], flagId)) { ChatPackets::SendSystemMessage(sysAddr, u"Invalid flag id."); @@ -793,7 +794,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit InventoryComponent* inventory = static_cast(entity->GetComponent(eReplicaComponentType::INVENTORY)); - inventory->AddItem(itemLOT, 1, eLootSourceType::LOOT_SOURCE_MODERATION); + inventory->AddItem(itemLOT, 1, eLootSourceType::MODERATION); } else if (args.size() == 2) { uint32_t itemLOT; @@ -811,7 +812,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit InventoryComponent* inventory = static_cast(entity->GetComponent(eReplicaComponentType::INVENTORY)); - inventory->AddItem(itemLOT, count, eLootSourceType::LOOT_SOURCE_MODERATION); + inventory->AddItem(itemLOT, count, eLootSourceType::MODERATION); } else { ChatPackets::SendSystemMessage(sysAddr, u"Correct usage: /gmadditem "); } @@ -1346,9 +1347,9 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit CharacterComponent* character = entity->GetComponent(); if (character) character->SetUScore(character->GetUScore() + uscore); - // LOOT_SOURCE_MODERATION should work but it doesn't. Relog to see uscore changes + // MODERATION should work but it doesn't. Relog to see uscore changes - eLootSourceType lootType = eLootSourceType::LOOT_SOURCE_MODERATION; + eLootSourceType lootType = eLootSourceType::MODERATION; int32_t type; if (args.size() >= 2 && GeneralUtils::TryParse(args[1], type)) { @@ -1466,7 +1467,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit } auto* ch = entity->GetCharacter(); - ch->SetCoins(ch->GetCoins() + money, eLootSourceType::LOOT_SOURCE_MODERATION); + ch->SetCoins(ch->GetCoins() + money, eLootSourceType::MODERATION); } if ((chatCommand == "setcurrency") && args.size() == 1 && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) { @@ -1478,7 +1479,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit } auto* ch = entity->GetCharacter(); - ch->SetCoins(money, eLootSourceType::LOOT_SOURCE_MODERATION); + ch->SetCoins(money, eLootSourceType::MODERATION); } // Allow for this on even while not a GM, as it sometimes toggles incorrrectly. @@ -1727,7 +1728,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit std::vector data{}; data.push_back(new LDFData(u"reforgedLOT", reforgedItem)); - inventoryComponent->AddItem(baseItem, 1, eLootSourceType::LOOT_SOURCE_MODERATION, eInventoryType::INVALID, data); + inventoryComponent->AddItem(baseItem, 1, eLootSourceType::MODERATION, eInventoryType::INVALID, data); } if (chatCommand == "crash" && entity->GetGMLevel() >= eGameMasterLevel::OPERATOR) { diff --git a/dNet/AuthPackets.cpp b/dNet/AuthPackets.cpp index 4e7cb0a6..eae23394 100644 --- a/dNet/AuthPackets.cpp +++ b/dNet/AuthPackets.cpp @@ -22,6 +22,7 @@ #include "Game.h" #include "dConfig.h" #include "eServerDisconnectIdentifiers.h" +#include "eLoginResponse.h" void AuthPackets::HandleHandshake(dServer* server, Packet* packet) { RakNet::BitStream inStream(packet->data, packet->length, false); @@ -61,7 +62,7 @@ void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) { if (res->rowsCount() == 0) { server->GetLogger()->Log("AuthPackets", "No user found!"); - AuthPackets::SendLoginResponse(server, packet->systemAddress, LOGIN_RESPONSE_WRONG_PASS_OR_USER, "", "", 2001, username); + AuthPackets::SendLoginResponse(server, packet->systemAddress, eLoginResponse::INVALID_USER, "", "", 2001, username); return; } @@ -85,14 +86,14 @@ void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) { //If we aren't running in live mode, then only GMs are allowed to enter: const auto& closedToNonDevs = Game::config->GetValue("closed_to_non_devs"); if (closedToNonDevs.size() > 0 && bool(std::stoi(closedToNonDevs)) && sqlGmLevel == 0) { - AuthPackets::SendLoginResponse(server, packet->systemAddress, eLoginResponse::LOGIN_RESPONSE_PERMISSIONS_NOT_HIGH_ENOUGH, "The server is currently only open to developers.", "", 2001, username); + AuthPackets::SendLoginResponse(server, packet->systemAddress, eLoginResponse::PERMISSIONS_NOT_HIGH_ENOUGH, "The server is currently only open to developers.", "", 2001, username); return; } if (Game::config->GetValue("dont_use_keys") != "1") { //Check to see if we have a play key: if (sqlPlayKey == 0 && sqlGmLevel == 0) { - AuthPackets::SendLoginResponse(server, packet->systemAddress, LOGIN_RESPONSE_PERMISSIONS_NOT_HIGH_ENOUGH, "Your account doesn't have a play key associated with it!", "", 2001, username); + AuthPackets::SendLoginResponse(server, packet->systemAddress, eLoginResponse::PERMISSIONS_NOT_HIGH_ENOUGH, "Your account doesn't have a play key associated with it!", "", 2001, username); server->GetLogger()->Log("AuthPackets", "User %s tried to log in, but they don't have a play key.", username.c_str()); return; } @@ -104,7 +105,7 @@ void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) { bool isKeyActive = false; if (keyRes->rowsCount() == 0 && sqlGmLevel == 0) { - AuthPackets::SendLoginResponse(server, packet->systemAddress, LOGIN_RESPONSE_PERMISSIONS_NOT_HIGH_ENOUGH, "Your account doesn't have a play key associated with it!", "", 2001, username); + AuthPackets::SendLoginResponse(server, packet->systemAddress, eLoginResponse::PERMISSIONS_NOT_HIGH_ENOUGH, "Your account doesn't have a play key associated with it!", "", 2001, username); return; } @@ -113,18 +114,18 @@ void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) { } if (!isKeyActive && sqlGmLevel == 0) { - AuthPackets::SendLoginResponse(server, packet->systemAddress, LOGIN_RESPONSE_PERMISSIONS_NOT_HIGH_ENOUGH, "Your play key has been disabled.", "", 2001, username); + AuthPackets::SendLoginResponse(server, packet->systemAddress, eLoginResponse::PERMISSIONS_NOT_HIGH_ENOUGH, "Your play key has been disabled.", "", 2001, username); server->GetLogger()->Log("AuthPackets", "User %s tried to log in, but their play key was disabled", username.c_str()); return; } } if (sqlBanned) { - AuthPackets::SendLoginResponse(server, packet->systemAddress, LOGIN_RESPONSE_BANNED, "", "", 2001, username); return; + AuthPackets::SendLoginResponse(server, packet->systemAddress, eLoginResponse::BANNED, "", "", 2001, username); return; } if (sqlLocked) { - AuthPackets::SendLoginResponse(server, packet->systemAddress, LOGIN_RESPONSE_ACCOUNT_LOCKED, "", "", 2001, username); return; + AuthPackets::SendLoginResponse(server, packet->systemAddress, eLoginResponse::ACCOUNT_LOCKED, "", "", 2001, username); return; } /* @@ -170,18 +171,18 @@ void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) { } if (!loginSuccess) { - AuthPackets::SendLoginResponse(server, packet->systemAddress, LOGIN_RESPONSE_WRONG_PASS_OR_USER, "", "", 2001, username); + AuthPackets::SendLoginResponse(server, packet->systemAddress, eLoginResponse::WRONG_PASS, "", "", 2001, username); server->GetLogger()->Log("AuthPackets", "Wrong password used"); } else { SystemAddress system = packet->systemAddress; //Copy the sysAddr before the Packet gets destroyed from main if (!server->GetIsConnectedToMaster()) { - AuthPackets::SendLoginResponse(server, system, LOGIN_RESPONSE_GENERAL_FAILED, "", "", 0, username); + AuthPackets::SendLoginResponse(server, system, eLoginResponse::GENERAL_FAILED, "", "", 0, username); return; } ZoneInstanceManager::Instance()->RequestZoneTransfer(server, 0, 0, false, [system, server, username](bool mythranShift, uint32_t zoneID, uint32_t zoneInstance, uint32_t zoneClone, std::string zoneIP, uint16_t zonePort) { - AuthPackets::SendLoginResponse(server, system, LOGIN_RESPONSE_SUCCESS, "", zoneIP, zonePort, username); + AuthPackets::SendLoginResponse(server, system, eLoginResponse::SUCCESS, "", zoneIP, zonePort, username); }); } } diff --git a/dNet/AuthPackets.h b/dNet/AuthPackets.h index 378a5862..0f004ca4 100644 --- a/dNet/AuthPackets.h +++ b/dNet/AuthPackets.h @@ -6,6 +6,7 @@ #include "dNetCommon.h" enum class ServerType : uint32_t; +enum class eLoginResponse : uint8_t; class dServer; namespace AuthPackets { diff --git a/dNet/WorldPackets.cpp b/dNet/WorldPackets.cpp index febb6bc1..3be4fb4d 100644 --- a/dNet/WorldPackets.cpp +++ b/dNet/WorldPackets.cpp @@ -15,7 +15,6 @@ #include "CharacterComponent.h" #include "ZCompression.h" - void WorldPackets::SendLoadStaticZone(const SystemAddress& sysAddr, float x, float y, float z, uint32_t checksum) { RakNet::BitStream bitStream; PacketUtils::WriteHeader(bitStream, CLIENT, MSG_CLIENT_LOAD_STATIC_ZONE); @@ -89,7 +88,7 @@ void WorldPackets::SendCharacterList(const SystemAddress& sysAddr, User* user) { SEND_PACKET; } -void WorldPackets::SendCharacterCreationResponse(const SystemAddress& sysAddr, eCreationResponse response) { +void WorldPackets::SendCharacterCreationResponse(const SystemAddress& sysAddr, eCharacterCreationResponse response) { RakNet::BitStream bitStream; PacketUtils::WriteHeader(bitStream, CLIENT, MSG_CLIENT_CHARACTER_CREATE_RESPONSE); bitStream.Write(response); diff --git a/dNet/WorldPackets.h b/dNet/WorldPackets.h index ec20ac22..ea8186c7 100644 --- a/dNet/WorldPackets.h +++ b/dNet/WorldPackets.h @@ -9,11 +9,13 @@ class User; struct SystemAddress; enum class eGameMasterLevel : uint8_t; +enum class eCharacterCreationResponse : uint8_t; +enum class eRenameResponse : uint8_t; namespace WorldPackets { void SendLoadStaticZone(const SystemAddress& sysAddr, float x, float y, float z, uint32_t checksum); void SendCharacterList(const SystemAddress& sysAddr, User* user); - void SendCharacterCreationResponse(const SystemAddress& sysAddr, eCreationResponse response); + void SendCharacterCreationResponse(const SystemAddress& sysAddr, eCharacterCreationResponse response); void SendCharacterRenameResponse(const SystemAddress& sysAddr, eRenameResponse response); void SendCharacterDeleteResponse(const SystemAddress& sysAddr, bool response); void SendTransferToWorld(const SystemAddress& sysAddr, const std::string& serverIP, uint32_t serverPort, bool mythranShift); diff --git a/dScripts/02_server/Enemy/General/BaseEnemyApe.cpp b/dScripts/02_server/Enemy/General/BaseEnemyApe.cpp index ea3ce9b8..e9863b17 100644 --- a/dScripts/02_server/Enemy/General/BaseEnemyApe.cpp +++ b/dScripts/02_server/Enemy/General/BaseEnemyApe.cpp @@ -6,6 +6,7 @@ #include "EntityInfo.h" #include "SkillComponent.h" #include "eAninmationFlags.h" +#include "eStateChangeType.h" void BaseEnemyApe::OnStartup(Entity* self) { self->SetVar(u"timesStunned", 2); @@ -15,7 +16,7 @@ void BaseEnemyApe::OnStartup(Entity* self) { void BaseEnemyApe::OnDie(Entity* self, Entity* killer) { auto* anchor = EntityManager::Instance()->GetEntity(self->GetVar(u"QB")); if (anchor != nullptr && !anchor->GetIsDead()) { - anchor->Smash(self->GetObjectID(), SILENT); + anchor->Smash(self->GetObjectID(), eKillType::SILENT); } } diff --git a/dScripts/02_server/Equipment/BootyDigServer.cpp b/dScripts/02_server/Equipment/BootyDigServer.cpp index 375bc4e5..190c232b 100644 --- a/dScripts/02_server/Equipment/BootyDigServer.cpp +++ b/dScripts/02_server/Equipment/BootyDigServer.cpp @@ -30,7 +30,7 @@ BootyDigServer::OnFireEventServerSide(Entity* self, Entity* sender, std::string return; if (args == "ChestReady" && (propertyOwner == std::to_string(LWOOBJID_EMPTY) || player->GetVar(u"bootyDug"))) { - self->Smash(self->GetObjectID(), SILENT); + self->Smash(self->GetObjectID(), eKillType::SILENT); } else if (args == "ChestOpened") { // Make sure players only dig up one booty per instance player->SetVar(u"bootyDug", true); @@ -49,6 +49,6 @@ BootyDigServer::OnFireEventServerSide(Entity* self, Entity* sender, std::string } } } else if (args == "ChestDead") { - self->Smash(player->GetObjectID(), SILENT); + self->Smash(player->GetObjectID(), eKillType::SILENT); } } diff --git a/dScripts/02_server/Map/AG/AgCagedBricksServer.cpp b/dScripts/02_server/Map/AG/AgCagedBricksServer.cpp index 3c400e5d..13c9c04b 100644 --- a/dScripts/02_server/Map/AG/AgCagedBricksServer.cpp +++ b/dScripts/02_server/Map/AG/AgCagedBricksServer.cpp @@ -4,6 +4,7 @@ #include "Character.h" #include "EntityManager.h" #include "eReplicaComponentType.h" +#include "ePlayerFlag.h" void AgCagedBricksServer::OnUse(Entity* self, Entity* user) { //Tell the client to spawn the baby spiderling: @@ -17,7 +18,7 @@ void AgCagedBricksServer::OnUse(Entity* self, Entity* user) { if (!character) return; - character->SetPlayerFlag(74, true); + character->SetPlayerFlag(ePlayerFlag::CAGED_SPIDER, true); //Remove the maelstrom cube: auto inv = static_cast(user->GetComponent(eReplicaComponentType::INVENTORY)); diff --git a/dScripts/02_server/Map/AG/NpcCowboyServer.cpp b/dScripts/02_server/Map/AG/NpcCowboyServer.cpp index c5a0e8f9..6dd212a4 100644 --- a/dScripts/02_server/Map/AG/NpcCowboyServer.cpp +++ b/dScripts/02_server/Map/AG/NpcCowboyServer.cpp @@ -18,7 +18,7 @@ void NpcCowboyServer::OnMissionDialogueOK(Entity* self, Entity* target, int miss missionState == eMissionState::AVAILABLE || missionState == eMissionState::COMPLETE_AVAILABLE) { if (inventoryComponent->GetLotCount(14378) == 0) { - inventoryComponent->AddItem(14378, 1, eLootSourceType::LOOT_SOURCE_NONE); + inventoryComponent->AddItem(14378, 1, eLootSourceType::NONE); } } else if (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE) { inventoryComponent->RemoveItem(14378, 1); diff --git a/dScripts/02_server/Map/AG/NpcPirateServer.cpp b/dScripts/02_server/Map/AG/NpcPirateServer.cpp index 6e7e696c..cad0d64c 100644 --- a/dScripts/02_server/Map/AG/NpcPirateServer.cpp +++ b/dScripts/02_server/Map/AG/NpcPirateServer.cpp @@ -10,7 +10,7 @@ void NpcPirateServer::OnMissionDialogueOK(Entity* self, Entity* target, int miss // Add or remove the lucky shovel based on whether the mission was completed or started if ((missionState == eMissionState::AVAILABLE || missionState == eMissionState::COMPLETE_AVAILABLE) && luckyShovel == nullptr) { - inventory->AddItem(14591, 1, eLootSourceType::LOOT_SOURCE_NONE); + inventory->AddItem(14591, 1, eLootSourceType::NONE); } else if (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE) { inventory->RemoveItem(14591, 1); } diff --git a/dScripts/02_server/Map/AG/NpcWispServer.cpp b/dScripts/02_server/Map/AG/NpcWispServer.cpp index 99345973..84196c8c 100644 --- a/dScripts/02_server/Map/AG/NpcWispServer.cpp +++ b/dScripts/02_server/Map/AG/NpcWispServer.cpp @@ -19,7 +19,7 @@ void NpcWispServer::OnMissionDialogueOK(Entity* self, Entity* target, int missio // For the daily we add the maelstrom vacuum if the player doesn't have it yet if (missionID == 1883 && (missionState == eMissionState::AVAILABLE || missionState == eMissionState::COMPLETE_AVAILABLE) && maelstromVacuum == nullptr) { - inventory->AddItem(maelstromVacuumLot, 1, eLootSourceType::LOOT_SOURCE_NONE); + inventory->AddItem(maelstromVacuumLot, 1, eLootSourceType::NONE); } else if (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE) { inventory->RemoveItem(maelstromVacuumLot, 1); } diff --git a/dScripts/02_server/Map/AG/RemoveRentalGear.cpp b/dScripts/02_server/Map/AG/RemoveRentalGear.cpp index 18177e57..f9bdf1ce 100644 --- a/dScripts/02_server/Map/AG/RemoveRentalGear.cpp +++ b/dScripts/02_server/Map/AG/RemoveRentalGear.cpp @@ -4,6 +4,7 @@ #include "eMissionState.h" #include "Character.h" #include "eReplicaComponentType.h" +#include "ePlayerFlag.h" /* -------------------------------------------------------------- @@ -36,6 +37,6 @@ void RemoveRentalGear::OnMissionDialogueOK(Entity* self, Entity* target, int mis //reset the equipment flag auto character = target->GetCharacter(); - if (character) character->SetPlayerFlag(equipFlag, false); + if (character) character->SetPlayerFlag(ePlayerFlag::EQUPPED_TRIAL_FACTION_GEAR, false); } } diff --git a/dScripts/02_server/Map/AG/RemoveRentalGear.h b/dScripts/02_server/Map/AG/RemoveRentalGear.h index cc33b5f6..cf9002d7 100644 --- a/dScripts/02_server/Map/AG/RemoveRentalGear.h +++ b/dScripts/02_server/Map/AG/RemoveRentalGear.h @@ -7,6 +7,5 @@ class RemoveRentalGear : public CppScripts::Script { private: int defaultMission = 768; //mission to remove gearSets on completion std::vector gearSets = { 14359,14321,14353,14315 }; //inventory items to remove - int equipFlag = 126; //Set upon wearing trial faction armor for the first time in a session }; diff --git a/dScripts/02_server/Map/AM/AmBlueX.cpp b/dScripts/02_server/Map/AM/AmBlueX.cpp index 8e32694c..312cdc47 100644 --- a/dScripts/02_server/Map/AM/AmBlueX.cpp +++ b/dScripts/02_server/Map/AM/AmBlueX.cpp @@ -18,7 +18,7 @@ void AmBlueX::OnSkillEventFired(Entity* self, Entity* caster, const std::string& auto* character = caster->GetCharacter(); if (character != nullptr) { - character->SetPlayerFlag(self->GetVar(m_FlagVariable), true); + character->SetPlayerFlag(self->GetVar(m_FlagVariable), true); } EntityInfo info{}; diff --git a/dScripts/02_server/Map/AM/AmBridge.cpp b/dScripts/02_server/Map/AM/AmBridge.cpp index 88f30642..719ca058 100644 --- a/dScripts/02_server/Map/AM/AmBridge.cpp +++ b/dScripts/02_server/Map/AM/AmBridge.cpp @@ -24,5 +24,5 @@ void AmBridge::OnTimerDone(Entity* self, std::string timerName) { return; } - self->Smash(self->GetObjectID(), VIOLENT); + self->Smash(self->GetObjectID(), eKillType::VIOLENT); } diff --git a/dScripts/02_server/Map/AM/AmDrawBridge.cpp b/dScripts/02_server/Map/AM/AmDrawBridge.cpp index 20636b13..3c4dcce6 100644 --- a/dScripts/02_server/Map/AM/AmDrawBridge.cpp +++ b/dScripts/02_server/Map/AM/AmDrawBridge.cpp @@ -2,6 +2,7 @@ #include "EntityManager.h" #include "GameMessages.h" #include "SimplePhysicsComponent.h" +#include "eTerminateType.h" void AmDrawBridge::OnStartup(Entity* self) { self->SetNetworkVar(u"InUse", false); @@ -25,7 +26,7 @@ void AmDrawBridge::OnUse(Entity* self, Entity* user) { auto* player = user; - GameMessages::SendTerminateInteraction(player->GetObjectID(), FROM_INTERACTION, self->GetObjectID()); + GameMessages::SendTerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()); } void AmDrawBridge::OnTimerDone(Entity* self, std::string timerName) { diff --git a/dScripts/02_server/Map/AM/AmDropshipComputer.cpp b/dScripts/02_server/Map/AM/AmDropshipComputer.cpp index 15ca7267..f23fa93f 100644 --- a/dScripts/02_server/Map/AM/AmDropshipComputer.cpp +++ b/dScripts/02_server/Map/AM/AmDropshipComputer.cpp @@ -12,7 +12,7 @@ void AmDropshipComputer::OnStartup(Entity* self) { void AmDropshipComputer::OnUse(Entity* self, Entity* user) { auto* rebuildComponent = self->GetComponent(); - if (rebuildComponent == nullptr || rebuildComponent->GetState() != REBUILD_COMPLETED) { + if (rebuildComponent == nullptr || rebuildComponent->GetState() != eRebuildState::COMPLETED) { return; } @@ -27,7 +27,7 @@ void AmDropshipComputer::OnUse(Entity* self, Entity* user) { return; } - inventoryComponent->AddItem(m_NexusTalonDataCard, 1, eLootSourceType::LOOT_SOURCE_NONE); + inventoryComponent->AddItem(m_NexusTalonDataCard, 1, eLootSourceType::NONE); } void AmDropshipComputer::OnDie(Entity* self, Entity* killer) { @@ -76,7 +76,7 @@ void AmDropshipComputer::OnTimerDone(Entity* self, std::string timerName) { return; } - if (timerName == "reset" && rebuildComponent->GetState() == REBUILD_OPEN) { - self->Smash(self->GetObjectID(), SILENT); + if (timerName == "reset" && rebuildComponent->GetState() == eRebuildState::OPEN) { + self->Smash(self->GetObjectID(), eKillType::SILENT); } } diff --git a/dScripts/02_server/Map/AM/AmShieldGeneratorQuickbuild.cpp b/dScripts/02_server/Map/AM/AmShieldGeneratorQuickbuild.cpp index 3188db33..381c13bc 100644 --- a/dScripts/02_server/Map/AM/AmShieldGeneratorQuickbuild.cpp +++ b/dScripts/02_server/Map/AM/AmShieldGeneratorQuickbuild.cpp @@ -176,7 +176,7 @@ void AmShieldGeneratorQuickbuild::BuffPlayers(Entity* self) { void AmShieldGeneratorQuickbuild::EnemyEnteredShield(Entity* self, Entity* intruder) { auto* rebuildComponent = self->GetComponent(); - if (rebuildComponent == nullptr || rebuildComponent->GetState() != REBUILD_COMPLETED) { + if (rebuildComponent == nullptr || rebuildComponent->GetState() != eRebuildState::COMPLETED) { return; } diff --git a/dScripts/02_server/Map/AM/AmSkullkinDrill.cpp b/dScripts/02_server/Map/AM/AmSkullkinDrill.cpp index da1954d6..d26218a2 100644 --- a/dScripts/02_server/Map/AM/AmSkullkinDrill.cpp +++ b/dScripts/02_server/Map/AM/AmSkullkinDrill.cpp @@ -5,6 +5,7 @@ #include "ProximityMonitorComponent.h" #include "MissionComponent.h" #include "EntityInfo.h" +#include "eStateChangeType.h" void AmSkullkinDrill::OnStartup(Entity* self) { self->SetNetworkVar(u"bIsInUse", false); @@ -246,7 +247,7 @@ void AmSkullkinDrill::OnHitOrHealResult(Entity* self, Entity* attacker, int32_t } } - self->Smash(attacker->GetObjectID(), SILENT); + self->Smash(attacker->GetObjectID(), eKillType::SILENT); self->CancelAllTimers(); @@ -264,7 +265,7 @@ void AmSkullkinDrill::OnTimerDone(Entity* self, std::string timerName) { auto* child = EntityManager::Instance()->GetEntity(childID); if (child != nullptr) { - child->Smash(self->GetObjectID(), SILENT); + child->Smash(self->GetObjectID(), eKillType::SILENT); } self->SetNetworkVar(u"bIsInUse", false); diff --git a/dScripts/02_server/Map/AM/AmTeapotServer.cpp b/dScripts/02_server/Map/AM/AmTeapotServer.cpp index 1f47cb1a..93f05326 100644 --- a/dScripts/02_server/Map/AM/AmTeapotServer.cpp +++ b/dScripts/02_server/Map/AM/AmTeapotServer.cpp @@ -2,6 +2,7 @@ #include "InventoryComponent.h" #include "GameMessages.h" #include "Item.h" +#include "eTerminateType.h" void AmTeapotServer::OnUse(Entity* self, Entity* user) { auto* inventoryComponent = user->GetComponent(); @@ -18,5 +19,5 @@ void AmTeapotServer::OnUse(Entity* self, Entity* user) { blueFlowerItem->SetCount(blueFlowerItem->GetCount() - 10); inventoryComponent->AddItem(WU_S_IMAGINATION_TEA, 1); } - GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID()); + GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()); } diff --git a/dScripts/02_server/Map/FV/ImgBrickConsoleQB.cpp b/dScripts/02_server/Map/FV/ImgBrickConsoleQB.cpp index 9c7b858f..7d86cc73 100644 --- a/dScripts/02_server/Map/FV/ImgBrickConsoleQB.cpp +++ b/dScripts/02_server/Map/FV/ImgBrickConsoleQB.cpp @@ -6,6 +6,7 @@ #include "MissionComponent.h" #include "eMissionState.h" #include "InventoryComponent.h" +#include "eTerminateType.h" int32_t ImgBrickConsoleQB::ResetBricks = 30; int32_t ImgBrickConsoleQB::ResetConsole = 60; @@ -20,7 +21,7 @@ void ImgBrickConsoleQB::OnStartup(Entity* self) { void ImgBrickConsoleQB::OnUse(Entity* self, Entity* user) { auto* rebuildComponent = self->GetComponent(); - if (rebuildComponent->GetState() == REBUILD_COMPLETED) { + if (rebuildComponent->GetState() == eRebuildState::COMPLETED) { if (!self->GetNetworkVar(u"used")) { const auto consoles = EntityManager::Instance()->GetEntitiesInGroup("Console"); @@ -29,7 +30,7 @@ void ImgBrickConsoleQB::OnUse(Entity* self, Entity* user) { for (auto* console : consoles) { auto* consoleRebuildComponent = console->GetComponent(); - if (consoleRebuildComponent->GetState() != REBUILD_COMPLETED) { + if (consoleRebuildComponent->GetState() != eRebuildState::COMPLETED) { continue; } @@ -87,7 +88,7 @@ void ImgBrickConsoleQB::OnUse(Entity* self, Entity* user) { self->SetNetworkVar(u"used", true); - GameMessages::SendTerminateInteraction(player->GetObjectID(), FROM_INTERACTION, self->GetObjectID()); + GameMessages::SendTerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()); } } @@ -113,7 +114,7 @@ void ImgBrickConsoleQB::SmashCanister(Entity* self) { const auto canisters = EntityManager::Instance()->GetEntitiesInGroup("Canister"); for (auto* canister : canisters) { - canister->Smash(canister->GetObjectID(), VIOLENT); + canister->Smash(canister->GetObjectID(), eKillType::VIOLENT); } const auto canister = dZoneManager::Instance()->GetSpawnersByName("BrickCanister"); @@ -146,7 +147,7 @@ void ImgBrickConsoleQB::OnRebuildComplete(Entity* self, Entity* target) { for (auto* console : consoles) { auto* consoleRebuildComponent = console->GetComponent(); - if (consoleRebuildComponent->GetState() != REBUILD_COMPLETED) { + if (consoleRebuildComponent->GetState() != eRebuildState::COMPLETED) { continue; } @@ -167,7 +168,7 @@ void ImgBrickConsoleQB::OnDie(Entity* self, Entity* killer) { auto* rebuildComponent = self->GetComponent(); - if (rebuildComponent->GetState() == REBUILD_COMPLETED) { + if (rebuildComponent->GetState() == eRebuildState::COMPLETED) { auto offFX = 0; const auto location = GeneralUtils::UTF16ToWTF8(self->GetVar(u"console")); @@ -228,14 +229,14 @@ void ImgBrickConsoleQB::OnTimerDone(Entity* self, std::string timerName) { if (timerName == "reset") { auto* rebuildComponent = self->GetComponent(); - if (rebuildComponent->GetState() == REBUILD_OPEN) { - self->Smash(self->GetObjectID(), SILENT); + if (rebuildComponent->GetState() == eRebuildState::OPEN) { + self->Smash(self->GetObjectID(), eKillType::SILENT); } } else if (timerName == "Die") { const auto consoles = EntityManager::Instance()->GetEntitiesInGroup("Console"); for (auto* console : consoles) { - console->Smash(console->GetObjectID(), VIOLENT); + console->Smash(console->GetObjectID(), eKillType::VIOLENT); } } } diff --git a/dScripts/02_server/Map/FV/Racing/RaceMaelstromGeiser.cpp b/dScripts/02_server/Map/FV/Racing/RaceMaelstromGeiser.cpp index b737d449..155be92b 100644 --- a/dScripts/02_server/Map/FV/Racing/RaceMaelstromGeiser.cpp +++ b/dScripts/02_server/Map/FV/Racing/RaceMaelstromGeiser.cpp @@ -55,7 +55,7 @@ void RaceMaelstromGeiser::OnProximityUpdate(Entity* self, Entity* entering, std: } - GameMessages::SendDie(vehicle, self->GetObjectID(), LWOOBJID_EMPTY, true, VIOLENT, u"", 0, 0, 0, true, false, 0); + GameMessages::SendDie(vehicle, self->GetObjectID(), LWOOBJID_EMPTY, true, eKillType::VIOLENT, u"", 0, 0, 0, true, false, 0); auto* zoneController = dZoneManager::Instance()->GetZoneControlObject(); diff --git a/dScripts/02_server/Map/GF/GfCaptainsCannon.cpp b/dScripts/02_server/Map/GF/GfCaptainsCannon.cpp index eeabeef6..13e2e4e5 100644 --- a/dScripts/02_server/Map/GF/GfCaptainsCannon.cpp +++ b/dScripts/02_server/Map/GF/GfCaptainsCannon.cpp @@ -2,6 +2,8 @@ #include "GameMessages.h" #include "EntityManager.h" #include "MissionComponent.h" +#include "eTerminateType.h" +#include "eStateChangeType.h" void GfCaptainsCannon::OnUse(Entity* self, Entity* user) { if (self->GetVar(u"bIsInUse")) { @@ -78,6 +80,6 @@ void GfCaptainsCannon::OnTimerDone(Entity* self, std::string timerName) { missionComponent->ForceProgress(601, 910, 1); } - GameMessages::SendTerminateInteraction(playerId, FROM_INTERACTION, self->GetObjectID()); + GameMessages::SendTerminateInteraction(playerId, eTerminateType::FROM_INTERACTION, self->GetObjectID()); } } diff --git a/dScripts/02_server/Map/GF/GfTikiTorch.cpp b/dScripts/02_server/Map/GF/GfTikiTorch.cpp index 22420679..8528192f 100644 --- a/dScripts/02_server/Map/GF/GfTikiTorch.cpp +++ b/dScripts/02_server/Map/GF/GfTikiTorch.cpp @@ -5,6 +5,7 @@ #include "RenderComponent.h" #include "eMissionTaskType.h" #include "eReplicaComponentType.h" +#include "eTerminateType.h" void GfTikiTorch::OnStartup(Entity* self) { LightTorch(self); @@ -33,7 +34,7 @@ void GfTikiTorch::OnTimerDone(Entity* self, std::string timerName) { Entity* player = EntityManager::Instance()->GetEntity(self->GetI64(u"userID")); if (player != nullptr && player->GetCharacter()) { - GameMessages::SendTerminateInteraction(player->GetObjectID(), FROM_INTERACTION, self->GetObjectID()); + GameMessages::SendTerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()); } self->SetBoolean(u"isInUse", false); diff --git a/dScripts/02_server/Map/GF/MastTeleport.cpp b/dScripts/02_server/Map/GF/MastTeleport.cpp index 8b8453b9..97b126b4 100644 --- a/dScripts/02_server/Map/GF/MastTeleport.cpp +++ b/dScripts/02_server/Map/GF/MastTeleport.cpp @@ -4,6 +4,7 @@ #include "Preconditions.h" #include "eEndBehavior.h" #include "DestroyableComponent.h" +#include "eStateChangeType.h" #ifdef _WIN32 #define _USE_MATH_DEFINES diff --git a/dScripts/02_server/Map/General/Ninjago/NjRailActivatorsServer.cpp b/dScripts/02_server/Map/General/Ninjago/NjRailActivatorsServer.cpp index a07de24a..5ca726af 100644 --- a/dScripts/02_server/Map/General/Ninjago/NjRailActivatorsServer.cpp +++ b/dScripts/02_server/Map/General/Ninjago/NjRailActivatorsServer.cpp @@ -7,7 +7,7 @@ void NjRailActivatorsServer::OnUse(Entity* self, Entity* user) { auto* rebuildComponent = self->GetComponent(); // Only allow use if this is not a quick build or the quick build is built - if (rebuildComponent == nullptr || rebuildComponent->GetState() == REBUILD_COMPLETED) { + if (rebuildComponent == nullptr || rebuildComponent->GetState() == eRebuildState::COMPLETED) { auto* character = user->GetCharacter(); if (character != nullptr) { character->SetPlayerFlag(flag, true); diff --git a/dScripts/02_server/Map/General/Ninjago/NjRailPostServer.cpp b/dScripts/02_server/Map/General/Ninjago/NjRailPostServer.cpp index 23389a98..2c435705 100644 --- a/dScripts/02_server/Map/General/Ninjago/NjRailPostServer.cpp +++ b/dScripts/02_server/Map/General/Ninjago/NjRailPostServer.cpp @@ -19,7 +19,7 @@ void NjRailPostServer::OnNotifyObject(Entity* self, Entity* sender, const std::s } void NjRailPostServer::OnRebuildNotifyState(Entity* self, eRebuildState state) { - if (state == REBUILD_COMPLETED) { + if (state == eRebuildState::COMPLETED) { auto* relatedRail = GetRelatedRail(self); if (relatedRail == nullptr) return; @@ -30,7 +30,7 @@ void NjRailPostServer::OnRebuildNotifyState(Entity* self, eRebuildState state) { return; self->SetNetworkVar(NetworkNotActiveVariable, false); - } else if (state == REBUILD_RESETTING) { + } else if (state == eRebuildState::RESETTING) { auto* relatedRail = GetRelatedRail(self); if (relatedRail == nullptr) return; diff --git a/dScripts/02_server/Map/General/Ninjago/NjhubLavaPlayerDeathTrigger.cpp b/dScripts/02_server/Map/General/Ninjago/NjhubLavaPlayerDeathTrigger.cpp index c065f84a..e2b889ef 100644 --- a/dScripts/02_server/Map/General/Ninjago/NjhubLavaPlayerDeathTrigger.cpp +++ b/dScripts/02_server/Map/General/Ninjago/NjhubLavaPlayerDeathTrigger.cpp @@ -5,5 +5,5 @@ void NjhubLavaPlayerDeathTrigger::OnCollisionPhantom(Entity* self, Entity* targe if (!target->IsPlayer()) return; - target->Smash(self->GetObjectID(), VIOLENT, u"drown"); + target->Smash(self->GetObjectID(), eKillType::VIOLENT, u"drown"); } diff --git a/dScripts/02_server/Map/General/PetDigServer.cpp b/dScripts/02_server/Map/General/PetDigServer.cpp index 81d70faf..8c819a8d 100644 --- a/dScripts/02_server/Map/General/PetDigServer.cpp +++ b/dScripts/02_server/Map/General/PetDigServer.cpp @@ -97,7 +97,7 @@ void PetDigServer::OnDie(Entity* self, Entity* killer) { // Handles smashing leftovers (edge case for the AG X) auto* xObject = EntityManager::Instance()->GetEntity(self->GetVar(u"X")); if (xObject != nullptr) { - xObject->Smash(xObject->GetObjectID(), VIOLENT); + xObject->Smash(xObject->GetObjectID(), eKillType::VIOLENT); } } @@ -112,7 +112,7 @@ void PetDigServer::HandleXBuildDig(const Entity* self, Entity* owner, Entity* pe auto* player = playerEntity->GetCharacter(); const auto groupID = self->GetVar(u"groupID"); - auto playerFlag = 0; + int32_t playerFlag = 0; // The flag that the player dug up if (groupID == u"Flag1") { @@ -136,7 +136,7 @@ void PetDigServer::HandleXBuildDig(const Entity* self, Entity* owner, Entity* pe auto* xObject = EntityManager::Instance()->GetEntity(self->GetVar(u"X")); if (xObject != nullptr) { - xObject->Smash(xObject->GetObjectID(), VIOLENT); + xObject->Smash(xObject->GetObjectID(), eKillType::VIOLENT); } } diff --git a/dScripts/02_server/Map/General/PropertyPlatform.cpp b/dScripts/02_server/Map/General/PropertyPlatform.cpp index 902b9646..7016db94 100644 --- a/dScripts/02_server/Map/General/PropertyPlatform.cpp +++ b/dScripts/02_server/Map/General/PropertyPlatform.cpp @@ -15,7 +15,7 @@ void PropertyPlatform::OnRebuildComplete(Entity* self, Entity* target) { void PropertyPlatform::OnUse(Entity* self, Entity* user) { auto* rebuildComponent = self->GetComponent(); - if (rebuildComponent != nullptr && rebuildComponent->GetState() == REBUILD_COMPLETED) { + if (rebuildComponent != nullptr && rebuildComponent->GetState() == eRebuildState::COMPLETED) { // auto* movingPlatform = self->GetComponent(); // if (movingPlatform != nullptr) { // movingPlatform->GotoWaypoint(1); diff --git a/dScripts/02_server/Map/General/TokenConsoleServer.cpp b/dScripts/02_server/Map/General/TokenConsoleServer.cpp index 5212a9b5..e13011cb 100644 --- a/dScripts/02_server/Map/General/TokenConsoleServer.cpp +++ b/dScripts/02_server/Map/General/TokenConsoleServer.cpp @@ -3,6 +3,8 @@ #include "GameMessages.h" #include "Character.h" #include "eReplicaComponentType.h" +#include "eTerminateType.h" +#include "ePlayerFlag.h" //2021-05-03 - max - added script, omitted some parts related to inheritance in lua which we don't need @@ -22,15 +24,15 @@ void TokenConsoleServer::OnUse(Entity* self, Entity* user) { if (!character) return; // At this point the player has to be in a faction. LOT tokenLOT = 0; - if (character->GetPlayerFlag(ePlayerFlags::VENTURE_FACTION)) //venture + if (character->GetPlayerFlag(ePlayerFlag::VENTURE_FACTION)) //venture tokenLOT = 8321; - else if (character->GetPlayerFlag(ePlayerFlags::ASSEMBLY_FACTION)) //assembly + else if (character->GetPlayerFlag(ePlayerFlag::ASSEMBLY_FACTION)) //assembly tokenLOT = 8318; - else if (character->GetPlayerFlag(ePlayerFlags::PARADOX_FACTION)) //paradox + else if (character->GetPlayerFlag(ePlayerFlag::PARADOX_FACTION)) //paradox tokenLOT = 8320; - else if (character->GetPlayerFlag(ePlayerFlags::SENTINEL_FACTION)) //sentinel + else if (character->GetPlayerFlag(ePlayerFlag::SENTINEL_FACTION)) //sentinel tokenLOT = 8319; - inv->AddItem(tokenLOT, tokensToGive, eLootSourceType::LOOT_SOURCE_NONE); + inv->AddItem(tokenLOT, tokensToGive, eLootSourceType::NONE); } GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()); diff --git a/dScripts/02_server/Map/General/WishingWellServer.cpp b/dScripts/02_server/Map/General/WishingWellServer.cpp index fa3e13e0..58ce1c72 100644 --- a/dScripts/02_server/Map/General/WishingWellServer.cpp +++ b/dScripts/02_server/Map/General/WishingWellServer.cpp @@ -3,6 +3,7 @@ #include "GameMessages.h" #include "Loot.h" #include "EntityManager.h" +#include "eTerminateType.h" void WishingWellServer::OnStartup(Entity* self) { } diff --git a/dScripts/02_server/Map/NS/NsTokenConsoleServer.cpp b/dScripts/02_server/Map/NS/NsTokenConsoleServer.cpp index a62c165c..326842d2 100644 --- a/dScripts/02_server/Map/NS/NsTokenConsoleServer.cpp +++ b/dScripts/02_server/Map/NS/NsTokenConsoleServer.cpp @@ -4,6 +4,8 @@ #include "Character.h" #include "MissionComponent.h" #include "RebuildComponent.h" +#include "eTerminateType.h" +#include "ePlayerFlag.h" void NsTokenConsoleServer::OnStartup(Entity* self) { @@ -16,7 +18,7 @@ void NsTokenConsoleServer::OnUse(Entity* self, Entity* user) { return; } - if (rebuildComponent->GetState() != REBUILD_COMPLETED) { + if (rebuildComponent->GetState() != eRebuildState::COMPLETED) { return; } @@ -42,20 +44,18 @@ void NsTokenConsoleServer::OnUse(Entity* self, Entity* user) { // Player must be in faction to interact with this entity. LOT tokenLOT = 0; - - if (character->GetPlayerFlag(46)) { + if (character->GetPlayerFlag(ePlayerFlag::VENTURE_FACTION)) //venture tokenLOT = 8321; - } else if (character->GetPlayerFlag(47)) { + else if (character->GetPlayerFlag(ePlayerFlag::ASSEMBLY_FACTION)) //assembly tokenLOT = 8318; - } else if (character->GetPlayerFlag(48)) { + else if (character->GetPlayerFlag(ePlayerFlag::PARADOX_FACTION)) //paradox tokenLOT = 8320; - } else if (character->GetPlayerFlag(49)) { + else if (character->GetPlayerFlag(ePlayerFlag::SENTINEL_FACTION)) //sentinel tokenLOT = 8319; - } - inventoryComponent->AddItem(tokenLOT, 5, eLootSourceType::LOOT_SOURCE_NONE); + inventoryComponent->AddItem(tokenLOT, 5, eLootSourceType::NONE); missionComponent->ForceProgressTaskType(863, 1, 1, false); - GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID()); + GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()); } diff --git a/dScripts/02_server/Map/NT/NtAssemblyTubeServer.cpp b/dScripts/02_server/Map/NT/NtAssemblyTubeServer.cpp index 74f9bd16..5f1619ab 100644 --- a/dScripts/02_server/Map/NT/NtAssemblyTubeServer.cpp +++ b/dScripts/02_server/Map/NT/NtAssemblyTubeServer.cpp @@ -5,6 +5,7 @@ #include "eMissionTaskType.h" #include "eMissionState.h" #include "eEndBehavior.h" +#include "eStateChangeType.h" void NtAssemblyTubeServer::OnStartup(Entity* self) { self->SetProximityRadius(5, "teleport"); diff --git a/dScripts/02_server/Map/NT/NtDirtCloudServer.cpp b/dScripts/02_server/Map/NT/NtDirtCloudServer.cpp index a9a70c5c..92175dea 100644 --- a/dScripts/02_server/Map/NT/NtDirtCloudServer.cpp +++ b/dScripts/02_server/Map/NT/NtDirtCloudServer.cpp @@ -42,5 +42,5 @@ void NtDirtCloudServer::OnSkillEventFired(Entity* self, Entity* caster, const st self->SetVar(u"CloudOn", false); - self->Smash(self->GetObjectID(), VIOLENT); + self->Smash(self->GetObjectID(), eKillType::VIOLENT); } diff --git a/dScripts/02_server/Map/NT/NtDukeServer.cpp b/dScripts/02_server/Map/NT/NtDukeServer.cpp index d48d50c7..07d17e96 100644 --- a/dScripts/02_server/Map/NT/NtDukeServer.cpp +++ b/dScripts/02_server/Map/NT/NtDukeServer.cpp @@ -2,12 +2,13 @@ #include "InventoryComponent.h" #include "MissionComponent.h" #include "eMissionState.h" +#include "ePlayerFlag.h" void NtDukeServer::SetVariables(Entity* self) { self->SetVar(m_SpyProximityVariable, 35.0f); self->SetVar(m_SpyDataVariable, { - NT_FACTION_SPY_DUKE, 13548, 1319 + ePlayerFlag::NT_FACTION_SPY_DUKE, 13548, 1319 }); self->SetVar>(m_SpyDialogueTableVariable, { @@ -31,7 +32,7 @@ void NtDukeServer::OnMissionDialogueOK(Entity* self, Entity* target, int mission auto lotCount = inventoryComponent->GetLotCount(m_SwordLot); if ((state == eMissionState::AVAILABLE || state == eMissionState::ACTIVE) && lotCount < 1) { - inventoryComponent->AddItem(m_SwordLot, 1, eLootSourceType::LOOT_SOURCE_NONE); + inventoryComponent->AddItem(m_SwordLot, 1, eLootSourceType::NONE); } else if (state == eMissionState::READY_TO_COMPLETE) { inventoryComponent->RemoveItem(m_SwordLot, lotCount); } diff --git a/dScripts/02_server/Map/NT/NtHaelServer.cpp b/dScripts/02_server/Map/NT/NtHaelServer.cpp index fbad421f..c726ae58 100644 --- a/dScripts/02_server/Map/NT/NtHaelServer.cpp +++ b/dScripts/02_server/Map/NT/NtHaelServer.cpp @@ -1,11 +1,12 @@ #include "NtHaelServer.h" #include "Entity.h" +#include "ePlayerFlag.h" void NtHaelServer::SetVariables(Entity* self) { self->SetVar(m_SpyProximityVariable, 25.0f); self->SetVar(m_SpyDataVariable, { - NT_FACTION_SPY_HAEL, 13892, 1321 + ePlayerFlag::NT_FACTION_SPY_HAEL, 13892, 1321 }); self->SetVar>(m_SpyDialogueTableVariable, { diff --git a/dScripts/02_server/Map/NT/NtImagimeterVisibility.cpp b/dScripts/02_server/Map/NT/NtImagimeterVisibility.cpp index c0f9bf51..64493d78 100644 --- a/dScripts/02_server/Map/NT/NtImagimeterVisibility.cpp +++ b/dScripts/02_server/Map/NT/NtImagimeterVisibility.cpp @@ -2,10 +2,11 @@ #include "GameMessages.h" #include "Entity.h" #include "Character.h" +#include "ePlayerFlag.h" void NTImagimeterVisibility::OnRebuildComplete(Entity* self, Entity* target) { auto* character = target->GetCharacter(); - if (character) character->SetPlayerFlag(ePlayerFlags::NT_PLINTH_REBUILD, true); + if (character) character->SetPlayerFlag(ePlayerFlag::NT_PLINTH_REBUILD, true); GameMessages::SendNotifyClientObject(self->GetObjectID(), u"PlinthBuilt", 0, 0, LWOOBJID_EMPTY, "", target->GetSystemAddress()); } diff --git a/dScripts/02_server/Map/NT/NtOverbuildServer.cpp b/dScripts/02_server/Map/NT/NtOverbuildServer.cpp index 8411e55b..f8520d87 100644 --- a/dScripts/02_server/Map/NT/NtOverbuildServer.cpp +++ b/dScripts/02_server/Map/NT/NtOverbuildServer.cpp @@ -1,11 +1,12 @@ #include "NtOverbuildServer.h" #include "EntityManager.h" +#include "ePlayerFlag.h" void NtOverbuildServer::SetVariables(Entity* self) { self->SetVar(m_SpyProximityVariable, 30.0f); self->SetVar(m_SpyDataVariable, { - NT_FACTION_SPY_OVERBUILD, 13891, 1320 + ePlayerFlag::NT_FACTION_SPY_OVERBUILD, 13891, 1320 }); self->SetVar>(m_SpyDialogueTableVariable, { diff --git a/dScripts/02_server/Map/NT/NtParadoxPanelServer.cpp b/dScripts/02_server/Map/NT/NtParadoxPanelServer.cpp index 0cb0bec4..23d336a7 100644 --- a/dScripts/02_server/Map/NT/NtParadoxPanelServer.cpp +++ b/dScripts/02_server/Map/NT/NtParadoxPanelServer.cpp @@ -4,6 +4,8 @@ #include "EntityManager.h" #include "Character.h" #include "eMissionState.h" +#include "eTerminateType.h" +#include "eStateChangeType.h" void NtParadoxPanelServer::OnUse(Entity* self, Entity* user) { GameMessages::SendNotifyClientObject(self->GetObjectID(), u"bActive", 1, 0, user->GetObjectID(), "", user->GetSystemAddress()); diff --git a/dScripts/02_server/Map/NT/NtParadoxTeleServer.cpp b/dScripts/02_server/Map/NT/NtParadoxTeleServer.cpp index 8b4f19fe..b19c8c0b 100644 --- a/dScripts/02_server/Map/NT/NtParadoxTeleServer.cpp +++ b/dScripts/02_server/Map/NT/NtParadoxTeleServer.cpp @@ -3,6 +3,7 @@ #include "EntityManager.h" #include "MissionComponent.h" #include "eMissionTaskType.h" +#include "eStateChangeType.h" void NtParadoxTeleServer::OnStartup(Entity* self) { self->SetProximityRadius(5, "teleport"); diff --git a/dScripts/02_server/Map/NT/NtVentureCannonServer.cpp b/dScripts/02_server/Map/NT/NtVentureCannonServer.cpp index 874d8aa1..38f929a1 100644 --- a/dScripts/02_server/Map/NT/NtVentureCannonServer.cpp +++ b/dScripts/02_server/Map/NT/NtVentureCannonServer.cpp @@ -2,6 +2,8 @@ #include "GameMessages.h" #include "EntityManager.h" #include "eEndBehavior.h" +#include "eTerminateType.h" +#include "eStateChangeType.h" void NtVentureCannonServer::OnUse(Entity* self, Entity* user) { auto* player = user; @@ -99,7 +101,7 @@ void NtVentureCannonServer::UnlockCannonPlayer(Entity* self, Entity* player) { self->SetNetworkVar(u"bIsInUse", false); - GameMessages::SendTerminateInteraction(player->GetObjectID(), FROM_INTERACTION, self->GetObjectID()); + GameMessages::SendTerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()); } void NtVentureCannonServer::FirePlayer(Entity* self, Entity* player) { diff --git a/dScripts/02_server/Map/PR/SpawnGryphonServer.cpp b/dScripts/02_server/Map/PR/SpawnGryphonServer.cpp index 2b7e3904..cf635fe4 100644 --- a/dScripts/02_server/Map/PR/SpawnGryphonServer.cpp +++ b/dScripts/02_server/Map/PR/SpawnGryphonServer.cpp @@ -3,6 +3,7 @@ #include "GameMessages.h" #include "MissionComponent.h" #include "eMissionState.h" +#include "eTerminateType.h" void SpawnGryphonServer::SetVariables(Entity* self) { self->SetVar(u"petLOT", 12433); @@ -20,7 +21,7 @@ void SpawnGryphonServer::OnUse(Entity* self, Entity* user) { if (missionComponent != nullptr && inventoryComponent != nullptr && missionComponent->GetMissionState(1391) == eMissionState::ACTIVE) { inventoryComponent->RemoveItem(12483, inventoryComponent->GetLotCount(12483)); - GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID()); + GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()); return; } diff --git a/dScripts/02_server/Map/Property/AG_Small/ZoneAgProperty.cpp b/dScripts/02_server/Map/Property/AG_Small/ZoneAgProperty.cpp index 215e22c2..635eb8b3 100644 --- a/dScripts/02_server/Map/Property/AG_Small/ZoneAgProperty.cpp +++ b/dScripts/02_server/Map/Property/AG_Small/ZoneAgProperty.cpp @@ -413,7 +413,7 @@ void ZoneAgProperty::BaseOnFireEventServerSide(Entity* self, Entity* sender, std if (player == nullptr) return; - player->GetCharacter()->SetPlayerFlag(self->GetVar(defeatedProperyFlag), true); + player->GetCharacter()->SetPlayerFlag(self->GetVar(defeatedProperyFlag), true); GameMessages::SendNotifyClientObject(self->GetObjectID(), u"PlayCinematic", 0, 0, LWOOBJID_EMPTY, destroyedCinematic, UNASSIGNED_SYSTEM_ADDRESS); diff --git a/dScripts/02_server/Map/Property/NS_Med/ZoneNsMedProperty.cpp b/dScripts/02_server/Map/Property/NS_Med/ZoneNsMedProperty.cpp index 30e597ee..55bde71c 100644 --- a/dScripts/02_server/Map/Property/NS_Med/ZoneNsMedProperty.cpp +++ b/dScripts/02_server/Map/Property/NS_Med/ZoneNsMedProperty.cpp @@ -29,8 +29,8 @@ void ZoneNsMedProperty::SetGameVariables(Entity* self) { self->SetVar>(AmbientFXSpawner, { "Rockets" }); self->SetVar>(BehaviorObjsSpawner, { }); - self->SetVar(defeatedProperyFlag, 122); - self->SetVar(placedModelFlag, 123); + self->SetVar(defeatedProperyFlag, 122); + self->SetVar(placedModelFlag, 123); self->SetVar(guardMissionFlag, 1322); self->SetVar(brickLinkMissionIDFlag, 1294); self->SetVar(passwordFlag, "s3kratK1ttN"); diff --git a/dScripts/02_server/Map/VE/VeBricksampleServer.cpp b/dScripts/02_server/Map/VE/VeBricksampleServer.cpp index 36306d07..0ead6a87 100644 --- a/dScripts/02_server/Map/VE/VeBricksampleServer.cpp +++ b/dScripts/02_server/Map/VE/VeBricksampleServer.cpp @@ -12,7 +12,7 @@ void VeBricksampleServer::OnUse(Entity* self, Entity* user) { auto* inventoryComponent = user->GetComponent(); if (loot && inventoryComponent != nullptr && inventoryComponent->GetLotCount(loot) == 0) { - inventoryComponent->AddItem(loot, 1, eLootSourceType::LOOT_SOURCE_ACTIVITY); + inventoryComponent->AddItem(loot, 1, eLootSourceType::ACTIVITY); for (auto* brickEntity : EntityManager::Instance()->GetEntitiesInGroup("Bricks")) { GameMessages::SendNotifyClientObject(brickEntity->GetObjectID(), u"Pickedup"); diff --git a/dScripts/02_server/Map/VE/VeEpsilonServer.h b/dScripts/02_server/Map/VE/VeEpsilonServer.h index 971cd93e..d5a53f9e 100644 --- a/dScripts/02_server/Map/VE/VeEpsilonServer.h +++ b/dScripts/02_server/Map/VE/VeEpsilonServer.h @@ -5,6 +5,6 @@ class VeEpsilonServer : public CppScripts::Script { void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) override; const uint32_t m_ConsoleMissionID = 1220; const uint32_t m_ConsoleRepeatMissionID = 1225; - const uint32_t m_ConsoleBaseFlag = 1010; + const int32_t m_ConsoleBaseFlag = 1010; const std::string m_ConsoleGroup = "Consoles"; }; diff --git a/dScripts/02_server/Map/VE/VeMissionConsole.cpp b/dScripts/02_server/Map/VE/VeMissionConsole.cpp index 534f8c06..35061bdf 100644 --- a/dScripts/02_server/Map/VE/VeMissionConsole.cpp +++ b/dScripts/02_server/Map/VE/VeMissionConsole.cpp @@ -3,18 +3,19 @@ #include "Character.h" #include "GameMessages.h" #include "Loot.h" +#include "eTerminateType.h" void VeMissionConsole::OnUse(Entity* self, Entity* user) { LootGenerator::Instance().DropActivityLoot(user, self, 12551); auto* inventoryComponent = user->GetComponent(); if (inventoryComponent != nullptr) { - inventoryComponent->AddItem(12547, 1, eLootSourceType::LOOT_SOURCE_ACTIVITY); // Add the panel required for pickup + inventoryComponent->AddItem(12547, 1, eLootSourceType::ACTIVITY); // Add the panel required for pickup } // The flag to set is 101 const auto flagNumber = self->GetVar(m_NumberVariable); - const auto flag = std::stoi("101" + GeneralUtils::UTF16ToWTF8(flagNumber)); + const int32_t flag = std::stoi("101" + GeneralUtils::UTF16ToWTF8(flagNumber)); auto* character = user->GetCharacter(); if (character != nullptr) { @@ -22,5 +23,5 @@ void VeMissionConsole::OnUse(Entity* self, Entity* user) { } GameMessages::SendNotifyClientObject(self->GetObjectID(), u""); - GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID()); + GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()); } diff --git a/dScripts/02_server/Map/njhub/CatapultBaseServer.cpp b/dScripts/02_server/Map/njhub/CatapultBaseServer.cpp index fda103b0..2df32658 100644 --- a/dScripts/02_server/Map/njhub/CatapultBaseServer.cpp +++ b/dScripts/02_server/Map/njhub/CatapultBaseServer.cpp @@ -59,6 +59,6 @@ void CatapultBaseServer::OnTimerDone(Entity* self, std::string timerName) { // kill the bouncer GameMessages::SendNotifyClientObject(bouncer->GetObjectID(), u"TimeToDie"); - bouncer->Smash(self->GetObjectID(), VIOLENT); + bouncer->Smash(self->GetObjectID(), eKillType::VIOLENT); } } diff --git a/dScripts/02_server/Map/njhub/CavePrisonCage.cpp b/dScripts/02_server/Map/njhub/CavePrisonCage.cpp index 0df91884..60bd1b88 100644 --- a/dScripts/02_server/Map/njhub/CavePrisonCage.cpp +++ b/dScripts/02_server/Map/njhub/CavePrisonCage.cpp @@ -45,7 +45,7 @@ void CavePrisonCage::Setup(Entity* self, Spawner* spawner) { } void CavePrisonCage::OnRebuildNotifyState(Entity* self, eRebuildState state) { - if (state != eRebuildState::REBUILD_RESETTING) { + if (state != eRebuildState::RESETTING) { return; } diff --git a/dScripts/02_server/Map/njhub/ImaginationShrineServer.cpp b/dScripts/02_server/Map/njhub/ImaginationShrineServer.cpp index 267d0480..1fbfad98 100644 --- a/dScripts/02_server/Map/njhub/ImaginationShrineServer.cpp +++ b/dScripts/02_server/Map/njhub/ImaginationShrineServer.cpp @@ -9,7 +9,7 @@ void ImaginationShrineServer::OnUse(Entity* self, Entity* user) { return; } - if (rebuildComponent->GetState() == REBUILD_COMPLETED) { + if (rebuildComponent->GetState() == eRebuildState::COMPLETED) { // Use the shrine BaseUse(self, user); } diff --git a/dScripts/02_server/Map/njhub/NjColeNPC.cpp b/dScripts/02_server/Map/njhub/NjColeNPC.cpp index 672fdd95..b989f3ee 100644 --- a/dScripts/02_server/Map/njhub/NjColeNPC.cpp +++ b/dScripts/02_server/Map/njhub/NjColeNPC.cpp @@ -44,6 +44,6 @@ void NjColeNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, return; } - inventoryComponent->AddItem(16644, 1, eLootSourceType::LOOT_SOURCE_NONE); + inventoryComponent->AddItem(16644, 1, eLootSourceType::NONE); } } diff --git a/dScripts/02_server/Map/njhub/NjDragonEmblemChestServer.cpp b/dScripts/02_server/Map/njhub/NjDragonEmblemChestServer.cpp index be9fcbd9..931cfe56 100644 --- a/dScripts/02_server/Map/njhub/NjDragonEmblemChestServer.cpp +++ b/dScripts/02_server/Map/njhub/NjDragonEmblemChestServer.cpp @@ -4,11 +4,12 @@ #include "Loot.h" #include "Entity.h" #include "DestroyableComponent.h" +#include "ePlayerFlag.h" void NjDragonEmblemChestServer::OnUse(Entity* self, Entity* user) { auto* character = user->GetCharacter(); if (character != nullptr) { - character->SetPlayerFlag(NJ_WU_SHOW_DAILY_CHEST, false); + character->SetPlayerFlag(ePlayerFlag::NJ_WU_SHOW_DAILY_CHEST, false); } auto* destroyable = self->GetComponent(); diff --git a/dScripts/02_server/Map/njhub/NjGarmadonCelebration.cpp b/dScripts/02_server/Map/njhub/NjGarmadonCelebration.cpp index c223c55c..d3e54be1 100644 --- a/dScripts/02_server/Map/njhub/NjGarmadonCelebration.cpp +++ b/dScripts/02_server/Map/njhub/NjGarmadonCelebration.cpp @@ -1,6 +1,7 @@ #include "NjGarmadonCelebration.h" #include "Character.h" #include "GameMessages.h" +#include "ePlayerFlag.h" void NjGarmadonCelebration::OnCollisionPhantom(Entity* self, Entity* target) { auto* character = target->GetCharacter(); @@ -9,8 +10,8 @@ void NjGarmadonCelebration::OnCollisionPhantom(Entity* self, Entity* target) { return; } - if (!character->GetPlayerFlag(ePlayerFlags::NJ_GARMADON_CINEMATIC_SEEN)) { - character->SetPlayerFlag(ePlayerFlags::NJ_GARMADON_CINEMATIC_SEEN, true); + if (!character->GetPlayerFlag(ePlayerFlag::NJ_GARMADON_CINEMATIC_SEEN)) { + character->SetPlayerFlag(ePlayerFlag::NJ_GARMADON_CINEMATIC_SEEN, true); GameMessages::SendStartCelebrationEffect(target, target->GetSystemAddress(), GarmadonCelebrationID); } diff --git a/dScripts/02_server/Map/njhub/NjNPCMissionSpinjitzuServer.h b/dScripts/02_server/Map/njhub/NjNPCMissionSpinjitzuServer.h index 3c705925..116ecc93 100644 --- a/dScripts/02_server/Map/njhub/NjNPCMissionSpinjitzuServer.h +++ b/dScripts/02_server/Map/njhub/NjNPCMissionSpinjitzuServer.h @@ -1,12 +1,13 @@ #pragma once #include "CppScripts.h" #include +#include "ePlayerFlag.h" -static std::map ElementFlags = { - {u"earth", ePlayerFlags::NJ_EARTH_SPINJITZU}, - {u"lightning", ePlayerFlags::NJ_LIGHTNING_SPINJITZU}, - {u"ice", ePlayerFlags::NJ_ICE_SPINJITZU}, - {u"fire", ePlayerFlags::NJ_FIRE_SPINJITZU} +static std::map ElementFlags = { + {u"earth", ePlayerFlag::NJ_EARTH_SPINJITZU}, + {u"lightning", ePlayerFlag::NJ_LIGHTNING_SPINJITZU}, + {u"ice", ePlayerFlag::NJ_ICE_SPINJITZU}, + {u"fire", ePlayerFlag::NJ_FIRE_SPINJITZU} }; static std::map ElementMissions = { diff --git a/dScripts/02_server/Map/njhub/NjScrollChestServer.cpp b/dScripts/02_server/Map/njhub/NjScrollChestServer.cpp index 4e1350b4..7156b368 100644 --- a/dScripts/02_server/Map/njhub/NjScrollChestServer.cpp +++ b/dScripts/02_server/Map/njhub/NjScrollChestServer.cpp @@ -12,6 +12,6 @@ void NjScrollChestServer::OnUse(Entity* self, Entity* user) { playerInventory->RemoveItem(keyLOT, 1); // Reward the player with the item set - playerInventory->AddItem(rewardItemLOT, 1, eLootSourceType::LOOT_SOURCE_NONE); + playerInventory->AddItem(rewardItemLOT, 1, eLootSourceType::NONE); } } diff --git a/dScripts/02_server/Map/njhub/NjWuNPC.cpp b/dScripts/02_server/Map/njhub/NjWuNPC.cpp index 9efc623b..f4969074 100644 --- a/dScripts/02_server/Map/njhub/NjWuNPC.cpp +++ b/dScripts/02_server/Map/njhub/NjWuNPC.cpp @@ -4,6 +4,7 @@ #include "EntityManager.h" #include "GameMessages.h" #include "eMissionState.h" +#include "ePlayerFlag.h" void NjWuNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) { @@ -24,7 +25,7 @@ void NjWuNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, e missionComponent->AcceptMission(subMissionID); } - character->SetPlayerFlag(ePlayerFlags::NJ_WU_SHOW_DAILY_CHEST, false); + character->SetPlayerFlag(ePlayerFlag::NJ_WU_SHOW_DAILY_CHEST, false); // Hide the chest for (auto* chest : EntityManager::Instance()->GetEntitiesInGroup(m_DragonChestGroup)) { @@ -37,7 +38,7 @@ void NjWuNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, e case eMissionState::READY_TO_COMPLETE: case eMissionState::COMPLETE_READY_TO_COMPLETE: { - character->SetPlayerFlag(NJ_WU_SHOW_DAILY_CHEST, true); + character->SetPlayerFlag(ePlayerFlag::NJ_WU_SHOW_DAILY_CHEST, true); // Show the chest for (auto* chest : EntityManager::Instance()->GetEntitiesInGroup(m_DragonChestGroup)) { diff --git a/dScripts/02_server/Map/njhub/boss_instance/NjMonastryBossInstance.cpp b/dScripts/02_server/Map/njhub/boss_instance/NjMonastryBossInstance.cpp index dbab7365..4de7638f 100644 --- a/dScripts/02_server/Map/njhub/boss_instance/NjMonastryBossInstance.cpp +++ b/dScripts/02_server/Map/njhub/boss_instance/NjMonastryBossInstance.cpp @@ -225,21 +225,21 @@ void NjMonastryBossInstance::HandleCounterWeightSpawned(Entity* self, Entity* co rebuildComponent->AddRebuildStateCallback([this, self, counterWeight](eRebuildState state) { switch (state) { - case REBUILD_BUILDING: + case eRebuildState::BUILDING: GameMessages::SendNotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0, counterWeight->GetObjectID(), BaseCounterweightQB + std::to_string(self->GetVar(WaveNumberVariable)), UNASSIGNED_SYSTEM_ADDRESS); return; - case REBUILD_INCOMPLETE: + case eRebuildState::INCOMPLETE: GameMessages::SendNotifyClientObject(self->GetObjectID(), EndCinematicNotification, 0, 0, LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS); return; - case REBUILD_RESETTING: + case eRebuildState::RESETTING: ActivityTimerStart(self, SpawnCounterWeightTimer, 0.0f, 0.0f); return; - case REBUILD_COMPLETED: { + case eRebuildState::COMPLETED: { // TODO: Move the platform? // The counterweight is actually a moving platform and we should listen to the last waypoint event here diff --git a/dScripts/02_server/Pets/DamagingPets.cpp b/dScripts/02_server/Pets/DamagingPets.cpp index f7eada00..6fd8c560 100644 --- a/dScripts/02_server/Pets/DamagingPets.cpp +++ b/dScripts/02_server/Pets/DamagingPets.cpp @@ -3,6 +3,7 @@ #include "DestroyableComponent.h" #include "BaseCombatAIComponent.h" #include "RenderComponent.h" +#include "ePetTamingNotifyType.h" void DamagingPets::OnStartup(Entity* self) { @@ -33,15 +34,15 @@ void DamagingPets::OnPlayerLoaded(Entity* self, Entity* player) { }); } -void DamagingPets::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) { +void DamagingPets::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTamingNotifyType type) { switch (type) { - case NOTIFY_TYPE_SUCCESS: - case NOTIFY_TYPE_BEGIN: + case ePetTamingNotifyType::SUCCESS: + case ePetTamingNotifyType::BEGIN: self->CancelAllTimers(); ClearEffects(self); break; - case NOTIFY_TYPE_FAILED: - case NOTIFY_TYPE_QUIT: + case ePetTamingNotifyType::FAILED: + case ePetTamingNotifyType::QUIT: { self->SetNetworkVar(u"bIAmTamable", false); self->AddTimer("GoEvil", 1.0f); diff --git a/dScripts/02_server/Pets/DamagingPets.h b/dScripts/02_server/Pets/DamagingPets.h index 2ce0ddc1..303bff52 100644 --- a/dScripts/02_server/Pets/DamagingPets.h +++ b/dScripts/02_server/Pets/DamagingPets.h @@ -13,7 +13,7 @@ class DamagingPets : public CppScripts::Script { public: void OnStartup(Entity* self) override; void OnTimerDone(Entity* self, std::string message) override; - void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) override; + void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTamingNotifyType type) override; void OnSkillEventFired(Entity* self, Entity* target, const std::string& message) override; void OnPlayerLoaded(Entity* self, Entity* player) override; private: diff --git a/dScripts/02_server/Pets/PetFromDigServer.cpp b/dScripts/02_server/Pets/PetFromDigServer.cpp index 5aca7486..525f3e94 100644 --- a/dScripts/02_server/Pets/PetFromDigServer.cpp +++ b/dScripts/02_server/Pets/PetFromDigServer.cpp @@ -1,5 +1,6 @@ #include "PetFromDigServer.h" #include "PetComponent.h" +#include "ePetTamingNotifyType.h" void PetFromDigServer::OnStartup(Entity* self) { auto* petComponent = self->GetComponent(); @@ -24,16 +25,16 @@ void PetFromDigServer::OnTimerDone(Entity* self, std::string timerName) { if (petComponent == nullptr || petComponent->GetOwner() != nullptr) return; - self->Smash(self->GetObjectID(), SILENT); + self->Smash(self->GetObjectID(), eKillType::SILENT); } } -void PetFromDigServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) { - if (type == NOTIFY_TYPE_BEGIN) { +void PetFromDigServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTamingNotifyType type) { + if (type == ePetTamingNotifyType::BEGIN) { self->CancelTimer("killself"); - } else if (type == NOTIFY_TYPE_QUIT || type == NOTIFY_TYPE_FAILED) { - self->Smash(self->GetObjectID(), SILENT); - } else if (type == NOTIFY_TYPE_SUCCESS) { + } else if (type == ePetTamingNotifyType::QUIT || type == ePetTamingNotifyType::FAILED) { + self->Smash(self->GetObjectID(), eKillType::SILENT); + } else if (type == ePetTamingNotifyType::SUCCESS) { auto* petComponent = self->GetComponent(); if (petComponent == nullptr) return; diff --git a/dScripts/02_server/Pets/PetFromDigServer.h b/dScripts/02_server/Pets/PetFromDigServer.h index 3faf248d..aaf31728 100644 --- a/dScripts/02_server/Pets/PetFromDigServer.h +++ b/dScripts/02_server/Pets/PetFromDigServer.h @@ -6,5 +6,5 @@ class PetFromDigServer : public CppScripts::Script public: void OnStartup(Entity* self) override; void OnTimerDone(Entity* self, std::string timerName) override; - void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) override; + void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTamingNotifyType type) override; }; diff --git a/dScripts/02_server/Pets/PetFromObjectServer.cpp b/dScripts/02_server/Pets/PetFromObjectServer.cpp index 899b394a..0a78d7ec 100644 --- a/dScripts/02_server/Pets/PetFromObjectServer.cpp +++ b/dScripts/02_server/Pets/PetFromObjectServer.cpp @@ -1,5 +1,6 @@ #include "PetFromObjectServer.h" #include "PetComponent.h" +#include "ePetTamingNotifyType.h" void PetFromObjectServer::OnStartup(Entity* self) { self->SetNetworkVar(u"pettamer", std::to_string(self->GetVar(u"tamer"))); @@ -11,20 +12,20 @@ void PetFromObjectServer::OnTimerDone(Entity* self, std::string timerName) { const auto* petComponent = self->GetComponent(); if (petComponent == nullptr || petComponent->GetOwner() != nullptr) return; - self->Smash(self->GetObjectID(), SILENT); + self->Smash(self->GetObjectID(), eKillType::SILENT); } } -void PetFromObjectServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) { +void PetFromObjectServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTamingNotifyType type) { switch (type) { - case NOTIFY_TYPE_BEGIN: + case ePetTamingNotifyType::BEGIN: self->CancelAllTimers(); break; - case NOTIFY_TYPE_QUIT: - case NOTIFY_TYPE_FAILED: - self->Smash(self->GetObjectID(), SILENT); + case ePetTamingNotifyType::QUIT: + case ePetTamingNotifyType::FAILED: + self->Smash(self->GetObjectID(), eKillType::SILENT); break; - case NOTIFY_TYPE_SUCCESS: + case ePetTamingNotifyType::SUCCESS: // TODO: Remove from groups? GameMessages::SendNotifyClientObject(self->GetObjectID(), u"UpdateSuccessPicking", 0, 0, tamer->GetObjectID(), "", UNASSIGNED_SYSTEM_ADDRESS); diff --git a/dScripts/02_server/Pets/PetFromObjectServer.h b/dScripts/02_server/Pets/PetFromObjectServer.h index 1a7c244b..67cd5eb0 100644 --- a/dScripts/02_server/Pets/PetFromObjectServer.h +++ b/dScripts/02_server/Pets/PetFromObjectServer.h @@ -5,5 +5,5 @@ class PetFromObjectServer : public CppScripts::Script { public: void OnStartup(Entity* self) override; void OnTimerDone(Entity* self, std::string timerName) override; - void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) override; + void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTamingNotifyType type) override; }; diff --git a/dScripts/BaseConsoleTeleportServer.cpp b/dScripts/BaseConsoleTeleportServer.cpp index d0162e9c..4a059535 100644 --- a/dScripts/BaseConsoleTeleportServer.cpp +++ b/dScripts/BaseConsoleTeleportServer.cpp @@ -1,6 +1,8 @@ #include "BaseConsoleTeleportServer.h" #include "GameMessages.h" #include "Player.h" +#include "eTerminateType.h" +#include "eStateChangeType.h" void BaseConsoleTeleportServer::BaseOnUse(Entity* self, Entity* user) { auto* player = user; @@ -52,7 +54,7 @@ void BaseConsoleTeleportServer::BaseOnMessageBoxResponse(Entity* self, Entity* s GameMessages::SendDisplayZoneSummary(playerID, player->GetSystemAddress(), false, false, self->GetObjectID()); }); } else if (button == -1 || button == 0) { - GameMessages::SendTerminateInteraction(player->GetObjectID(), FROM_INTERACTION, player->GetObjectID()); + GameMessages::SendTerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, player->GetObjectID()); } } @@ -88,7 +90,7 @@ void BaseConsoleTeleportServer::TransferPlayer(Entity* self, Entity* player, int true, true, true, true, true, true, true ); - GameMessages::SendTerminateInteraction(player->GetObjectID(), FROM_INTERACTION, player->GetObjectID()); + GameMessages::SendTerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, player->GetObjectID()); const auto& teleportZone = self->GetVar(u"transferZoneID"); diff --git a/dScripts/BasePropertyServer.cpp b/dScripts/BasePropertyServer.cpp index a9f35e25..1522ef26 100644 --- a/dScripts/BasePropertyServer.cpp +++ b/dScripts/BasePropertyServer.cpp @@ -127,7 +127,7 @@ void BasePropertyServer::BasePlayerLoaded(Entity* self, Entity* player) { if (player->GetObjectID() != propertyOwner) return; } else { - const auto defeatedFlag = player->GetCharacter()->GetPlayerFlag(self->GetVar(defeatedProperyFlag)); + const auto defeatedFlag = player->GetCharacter()->GetPlayerFlag(self->GetVar(defeatedProperyFlag)); self->SetNetworkVar(UnclaimedVariable, true); self->SetVar(PlayerIDVariable, player->GetObjectID()); @@ -274,7 +274,7 @@ void BasePropertyServer::RequestDie(Entity* self, Entity* other) { if (destroyable == nullptr) return; - destroyable->Smash(other->GetObjectID(), SILENT); + destroyable->Smash(other->GetObjectID(), eKillType::SILENT); } void BasePropertyServer::ActivateSpawner(const std::string& spawnerName) { @@ -464,7 +464,7 @@ void BasePropertyServer::HandleOrbsTimer(Entity* self) { if (player != nullptr) { auto* character = player->GetCharacter(); if (character != nullptr) { - character->SetPlayerFlag(self->GetVar(defeatedProperyFlag), true); + character->SetPlayerFlag(self->GetVar(defeatedProperyFlag), true); } } diff --git a/dScripts/ChooseYourDestinationNsToNt.cpp b/dScripts/ChooseYourDestinationNsToNt.cpp index e50d70c5..f9ca0a79 100644 --- a/dScripts/ChooseYourDestinationNsToNt.cpp +++ b/dScripts/ChooseYourDestinationNsToNt.cpp @@ -1,6 +1,7 @@ #include "ChooseYourDestinationNsToNt.h" #include "Character.h" #include "GameMessages.h" +#include "eTerminateType.h" bool ChooseYourDestinationNsToNt::CheckChoice(Entity* self, Entity* player) { const auto choiceZoneID = self->GetVar(u"choiceZone"); @@ -59,6 +60,6 @@ void ChooseYourDestinationNsToNt::BaseChoiceBoxRespond(Entity* self, Entity* sen GameMessages::SendDisplayMessageBox(sender->GetObjectID(), true, self->GetObjectID(), u"TransferBox", 0, strText, u"", sender->GetSystemAddress()); } else { - GameMessages::SendTerminateInteraction(sender->GetObjectID(), FROM_INTERACTION, self->GetObjectID()); + GameMessages::SendTerminateInteraction(sender->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()); } } diff --git a/dScripts/CppScripts.h b/dScripts/CppScripts.h index 5c702a70..4bf3720f 100644 --- a/dScripts/CppScripts.h +++ b/dScripts/CppScripts.h @@ -8,6 +8,8 @@ class User; class Entity; class NiPoint3; enum class eMissionState : int32_t; +enum class ePetTamingNotifyType : uint32_t; +enum class eRebuildState : uint32_t; namespace CppScripts { /** @@ -269,7 +271,7 @@ namespace CppScripts { * * Equivalent to 'function onNotifyPetTamingMinigame(self, msg)' */ - virtual void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) {}; + virtual void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTamingNotifyType type) {}; /** * Invoked when a player responded to a message box. diff --git a/dScripts/EquipmentScripts/PersonalFortress.cpp b/dScripts/EquipmentScripts/PersonalFortress.cpp index f5062f9b..f1fe73ee 100644 --- a/dScripts/EquipmentScripts/PersonalFortress.cpp +++ b/dScripts/EquipmentScripts/PersonalFortress.cpp @@ -4,6 +4,7 @@ #include "DestroyableComponent.h" #include "ControllablePhysicsComponent.h" #include "EntityManager.h" +#include "eStateChangeType.h" void PersonalFortress::OnStartup(Entity* self) { auto* owner = self->GetOwner(); diff --git a/dScripts/EquipmentScripts/StunImmunity.cpp b/dScripts/EquipmentScripts/StunImmunity.cpp index f35fe261..0ec956f0 100644 --- a/dScripts/EquipmentScripts/StunImmunity.cpp +++ b/dScripts/EquipmentScripts/StunImmunity.cpp @@ -1,6 +1,7 @@ #include "StunImmunity.h" #include "DestroyableComponent.h" #include "ControllablePhysicsComponent.h" +#include "eStateChangeType.h" void StunImmunity::OnStartup(Entity* self) { auto* destroyableComponent = self->GetComponent(); diff --git a/dScripts/NPCAddRemoveItem.cpp b/dScripts/NPCAddRemoveItem.cpp index f1ef8c0d..13677072 100644 --- a/dScripts/NPCAddRemoveItem.cpp +++ b/dScripts/NPCAddRemoveItem.cpp @@ -12,7 +12,7 @@ void NPCAddRemoveItem::OnMissionDialogueOK(Entity* self, Entity* target, int mis for (const auto& itemSetting : missionSetting.second) { for (const auto& lot : itemSetting.items) { if (itemSetting.add && (missionState == eMissionState::AVAILABLE || missionState == eMissionState::COMPLETE_AVAILABLE)) { - inventory->AddItem(lot, 1, eLootSourceType::LOOT_SOURCE_NONE); + inventory->AddItem(lot, 1, eLootSourceType::NONE); } else if (itemSetting.remove && (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE)) { inventory->RemoveItem(lot, 1); } diff --git a/dScripts/NtFactionSpyServer.cpp b/dScripts/NtFactionSpyServer.cpp index dc62855a..a1161880 100644 --- a/dScripts/NtFactionSpyServer.cpp +++ b/dScripts/NtFactionSpyServer.cpp @@ -6,6 +6,8 @@ #include "MissionComponent.h" #include "eMissionState.h" #include "eReplicaComponentType.h" +#include "eCinematicEvent.h" +#include "ePlayerFlag.h" void NtFactionSpyServer::OnStartup(Entity* self) { SetVariables(self); @@ -77,14 +79,14 @@ void NtFactionSpyServer::OnCinematicUpdate(Entity* self, Entity* sender, eCinema // Make sure we're listening to the root we're interested in if (pathRoot == cinematicRoot) { - if (event == STARTED && pathIndex >= 0 && pathIndex < dialogueTable.size()) { + if (event == eCinematicEvent::STARTED && pathIndex >= 0 && pathIndex < dialogueTable.size()) { // If the cinematic started, show part of the conversation GameMessages::SendNotifyClientObject(self->GetObjectID(), m_SpyDialogueNotification, 0, 0, ParamObjectForConversationID(self, dialogueTable.at(pathIndex).conversationID), dialogueTable.at(pathIndex).token, sender->GetSystemAddress()); - } else if (event == ENDED && pathIndex >= dialogueTable.size() - 1) { + } else if (event == eCinematicEvent::ENDED && pathIndex >= dialogueTable.size() - 1) { auto spyData = self->GetVar(m_SpyDataVariable); auto* character = sender->GetCharacter(); if (character != nullptr) { diff --git a/dScripts/NtFactionSpyServer.h b/dScripts/NtFactionSpyServer.h index 67955dd4..4406859c 100644 --- a/dScripts/NtFactionSpyServer.h +++ b/dScripts/NtFactionSpyServer.h @@ -7,7 +7,7 @@ struct SpyDialogue { }; struct SpyData { - uint32_t flagID; + int32_t flagID; LOT itemID; uint32_t missionID; }; diff --git a/dScripts/SpawnPetBaseServer.cpp b/dScripts/SpawnPetBaseServer.cpp index d3c87288..75b46382 100644 --- a/dScripts/SpawnPetBaseServer.cpp +++ b/dScripts/SpawnPetBaseServer.cpp @@ -3,6 +3,7 @@ #include "EntityManager.h" #include "PetComponent.h" #include "EntityInfo.h" +#include "eTerminateType.h" void SpawnPetBaseServer::OnStartup(Entity* self) { SetVariables(self); @@ -43,7 +44,7 @@ void SpawnPetBaseServer::OnUse(Entity* self, Entity* user) { GameMessages::SendPlayCinematic(user->GetObjectID(), spawnCinematic, UNASSIGNED_SYSTEM_ADDRESS); } - GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID()); + GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()); } bool SpawnPetBaseServer::CheckNumberOfPets(Entity* self, Entity* user) { diff --git a/dScripts/ai/ACT/ActMine.cpp b/dScripts/ai/ACT/ActMine.cpp index 637bd805..9651e13d 100644 --- a/dScripts/ai/ACT/ActMine.cpp +++ b/dScripts/ai/ACT/ActMine.cpp @@ -9,7 +9,7 @@ void ActMine::OnStartup(Entity* self) { } void ActMine::OnRebuildNotifyState(Entity* self, eRebuildState state) { - if (state == eRebuildState::REBUILD_COMPLETED) { + if (state == eRebuildState::COMPLETED) { auto* rebuild = self->GetComponent(); if (rebuild) { auto* builder = rebuild->GetBuilder(); diff --git a/dScripts/ai/ACT/ActVehicleDeathTrigger.cpp b/dScripts/ai/ACT/ActVehicleDeathTrigger.cpp index 77a3b65a..76c0289e 100644 --- a/dScripts/ai/ACT/ActVehicleDeathTrigger.cpp +++ b/dScripts/ai/ACT/ActVehicleDeathTrigger.cpp @@ -40,7 +40,7 @@ void ActVehicleDeathTrigger::OnCollisionPhantom(Entity* self, Entity* target) { } - GameMessages::SendDie(vehicle, self->GetObjectID(), LWOOBJID_EMPTY, true, VIOLENT, u"", 0, 0, 0, true, false, 0); + GameMessages::SendDie(vehicle, self->GetObjectID(), LWOOBJID_EMPTY, true, eKillType::VIOLENT, u"", 0, 0, 0, true, false, 0); auto* zoneController = dZoneManager::Instance()->GetZoneControlObject(); diff --git a/dScripts/ai/ACT/FootRace/BaseFootRaceManager.cpp b/dScripts/ai/ACT/FootRace/BaseFootRaceManager.cpp index 699ee096..4d1ae5f5 100644 --- a/dScripts/ai/ACT/FootRace/BaseFootRaceManager.cpp +++ b/dScripts/ai/ACT/FootRace/BaseFootRaceManager.cpp @@ -37,7 +37,7 @@ void BaseFootRaceManager::OnFireEventServerSide(Entity* self, Entity* sender, st if (character != nullptr) { character->SetPlayerFlag(115, false); if (param2 != -1) // Certain footraces set a flag - character->SetPlayerFlag(param2, true); + character->SetPlayerFlag(static_cast(param2), true); } StopActivity(self, player->GetObjectID(), 0, param1); diff --git a/dScripts/ai/AG/AgPicnicBlanket.cpp b/dScripts/ai/AG/AgPicnicBlanket.cpp index d2a54d57..bec5577c 100644 --- a/dScripts/ai/AG/AgPicnicBlanket.cpp +++ b/dScripts/ai/AG/AgPicnicBlanket.cpp @@ -2,9 +2,10 @@ #include "Loot.h" #include "GameMessages.h" #include "Entity.h" +#include "eTerminateType.h" void AgPicnicBlanket::OnUse(Entity* self, Entity* user) { - GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID()); + GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()); if (self->GetVar(u"active")) return; self->SetVar(u"active", true); diff --git a/dScripts/ai/AG/AgQbElevator.cpp b/dScripts/ai/AG/AgQbElevator.cpp index f1ac7bb5..e1d78a21 100644 --- a/dScripts/ai/AG/AgQbElevator.cpp +++ b/dScripts/ai/AG/AgQbElevator.cpp @@ -49,7 +49,7 @@ void AgQbElevator::OnTimerDone(Entity* self, std::string timerName) { } else if (timerName == "startKillTimer") { killTimerStartup(self); } else if (timerName == "KillTimer") { - self->Smash(self->GetObjectID(), VIOLENT); + self->Smash(self->GetObjectID(), eKillType::VIOLENT); } } diff --git a/dScripts/ai/AG/AgShipPlayerShockServer.cpp b/dScripts/ai/AG/AgShipPlayerShockServer.cpp index 2bed8152..9e6c90d4 100644 --- a/dScripts/ai/AG/AgShipPlayerShockServer.cpp +++ b/dScripts/ai/AG/AgShipPlayerShockServer.cpp @@ -1,5 +1,6 @@ #include "AgShipPlayerShockServer.h" #include "GameMessages.h" +#include "eTerminateType.h" void AgShipPlayerShockServer::OnUse(Entity* self, Entity* user) { GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()); diff --git a/dScripts/ai/FV/ActNinjaTurret.cpp b/dScripts/ai/FV/ActNinjaTurret.cpp index 79e502b4..ea6e2278 100644 --- a/dScripts/ai/FV/ActNinjaTurret.cpp +++ b/dScripts/ai/FV/ActNinjaTurret.cpp @@ -1,9 +1,10 @@ #include "ActNinjaTurret.h" +#include "eRebuildState.h" void ActNinjaTurret::OnRebuildNotifyState(Entity* self, eRebuildState state) { - if (state == eRebuildState::REBUILD_COMPLETED) { + if (state == eRebuildState::COMPLETED) { self->SetVar(u"AmBuilt", true); - } else if (state == eRebuildState::REBUILD_RESETTING) { + } else if (state == eRebuildState::RESETTING) { self->SetVar(u"AmBuilt", false); } } diff --git a/dScripts/ai/FV/ActParadoxPipeFix.cpp b/dScripts/ai/FV/ActParadoxPipeFix.cpp index 517474a9..10a1e652 100644 --- a/dScripts/ai/FV/ActParadoxPipeFix.cpp +++ b/dScripts/ai/FV/ActParadoxPipeFix.cpp @@ -21,7 +21,7 @@ void ActParadoxPipeFix::OnRebuildComplete(Entity* self, Entity* target) { auto* rebuildComponent = object->GetComponent(); - if (rebuildComponent->GetState() == REBUILD_COMPLETED) { + if (rebuildComponent->GetState() == eRebuildState::COMPLETED) { indexCount++; } } @@ -52,7 +52,7 @@ void ActParadoxPipeFix::OnRebuildComplete(Entity* self, Entity* target) { } void ActParadoxPipeFix::OnRebuildNotifyState(Entity* self, eRebuildState state) { - if (state == REBUILD_RESETTING) { + if (state == eRebuildState::RESETTING) { const auto refinery = EntityManager::Instance()->GetEntitiesInGroup("Paradox"); if (!refinery.empty()) { diff --git a/dScripts/ai/FV/FvBrickPuzzleServer.cpp b/dScripts/ai/FV/FvBrickPuzzleServer.cpp index cea6146b..887b9a4d 100644 --- a/dScripts/ai/FV/FvBrickPuzzleServer.cpp +++ b/dScripts/ai/FV/FvBrickPuzzleServer.cpp @@ -61,8 +61,8 @@ void FvBrickPuzzleServer::OnTimerDone(Entity* self, std::string timerName) { if (timerName == "reset") { auto* rebuildComponent = self->GetComponent(); - if (rebuildComponent != nullptr && rebuildComponent->GetState() == REBUILD_OPEN) { - self->Smash(self->GetObjectID(), SILENT); + if (rebuildComponent != nullptr && rebuildComponent->GetState() == eRebuildState::OPEN) { + self->Smash(self->GetObjectID(), eKillType::SILENT); } } } diff --git a/dScripts/ai/FV/FvConsoleLeftQuickbuild.cpp b/dScripts/ai/FV/FvConsoleLeftQuickbuild.cpp index b998b9ec..3f495ed7 100644 --- a/dScripts/ai/FV/FvConsoleLeftQuickbuild.cpp +++ b/dScripts/ai/FV/FvConsoleLeftQuickbuild.cpp @@ -1,6 +1,8 @@ #include "FvConsoleLeftQuickbuild.h" #include "EntityManager.h" #include "GameMessages.h" +#include "eTerminateType.h" +#include "eRebuildState.h" void FvConsoleLeftQuickbuild::OnStartup(Entity* self) { self->SetVar(u"IAmBuilt", false); @@ -8,7 +10,7 @@ void FvConsoleLeftQuickbuild::OnStartup(Entity* self) { } void FvConsoleLeftQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState state) { - if (state == REBUILD_COMPLETED) { + if (state == eRebuildState::COMPLETED) { self->SetVar(u"IAmBuilt", true); const auto objects = EntityManager::Instance()->GetEntitiesInGroup("Facility"); @@ -16,7 +18,7 @@ void FvConsoleLeftQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState s if (!objects.empty()) { objects[0]->NotifyObject(self, "ConsoleLeftUp"); } - } else if (state == REBUILD_RESETTING) { + } else if (state == eRebuildState::RESETTING) { self->SetVar(u"IAmBuilt", false); self->SetVar(u"AmActive", false); @@ -43,5 +45,5 @@ void FvConsoleLeftQuickbuild::OnUse(Entity* self, Entity* user) { } } - GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID()); + GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()); } diff --git a/dScripts/ai/FV/FvConsoleRightQuickbuild.cpp b/dScripts/ai/FV/FvConsoleRightQuickbuild.cpp index ea047cd8..e03e4135 100644 --- a/dScripts/ai/FV/FvConsoleRightQuickbuild.cpp +++ b/dScripts/ai/FV/FvConsoleRightQuickbuild.cpp @@ -1,6 +1,8 @@ #include "FvConsoleRightQuickbuild.h" #include "EntityManager.h" #include "GameMessages.h" +#include "eTerminateType.h" +#include "eRebuildState.h" void FvConsoleRightQuickbuild::OnStartup(Entity* self) { self->SetVar(u"IAmBuilt", false); @@ -8,7 +10,7 @@ void FvConsoleRightQuickbuild::OnStartup(Entity* self) { } void FvConsoleRightQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState state) { - if (state == REBUILD_COMPLETED) { + if (state == eRebuildState::COMPLETED) { self->SetVar(u"IAmBuilt", true); const auto objects = EntityManager::Instance()->GetEntitiesInGroup("Facility"); @@ -16,7 +18,7 @@ void FvConsoleRightQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState if (!objects.empty()) { objects[0]->NotifyObject(self, "ConsoleRightUp"); } - } else if (state == REBUILD_RESETTING) { + } else if (state == eRebuildState::RESETTING) { self->SetVar(u"IAmBuilt", false); self->SetVar(u"AmActive", false); @@ -43,5 +45,5 @@ void FvConsoleRightQuickbuild::OnUse(Entity* self, Entity* user) { } } - GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID()); + GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID()); } diff --git a/dScripts/ai/FV/FvDragonSmashingGolemQb.cpp b/dScripts/ai/FV/FvDragonSmashingGolemQb.cpp index a9d38aa5..9cf7fa18 100644 --- a/dScripts/ai/FV/FvDragonSmashingGolemQb.cpp +++ b/dScripts/ai/FV/FvDragonSmashingGolemQb.cpp @@ -1,6 +1,7 @@ #include "FvDragonSmashingGolemQb.h" #include "GameMessages.h" #include "EntityManager.h" +#include "eRebuildState.h" void FvDragonSmashingGolemQb::OnStartup(Entity* self) { self->AddTimer("GolemBreakTimer", 10.5f); @@ -13,7 +14,7 @@ void FvDragonSmashingGolemQb::OnTimerDone(Entity* self, std::string timerName) { } void FvDragonSmashingGolemQb::OnRebuildNotifyState(Entity* self, eRebuildState state) { - if (state == eRebuildState::REBUILD_COMPLETED) { + if (state == eRebuildState::COMPLETED) { GameMessages::SendPlayAnimation(self, u"dragonsmash"); const auto dragonId = self->GetVar(u"Dragon"); diff --git a/dScripts/ai/FV/FvFacilityBrick.cpp b/dScripts/ai/FV/FvFacilityBrick.cpp index 1ae910e4..6ff12750 100644 --- a/dScripts/ai/FV/FvFacilityBrick.cpp +++ b/dScripts/ai/FV/FvFacilityBrick.cpp @@ -56,7 +56,7 @@ void FvFacilityBrick::OnNotifyObject(Entity* self, Entity* sender, const std::st object = EntityManager::Instance()->GetEntitiesInGroup("Canister")[0]; if (object != nullptr) { - object->Smash(self->GetObjectID(), SILENT); + object->Smash(self->GetObjectID(), eKillType::SILENT); } canisterSpawner->Reset(); diff --git a/dScripts/ai/FV/FvPandaServer.cpp b/dScripts/ai/FV/FvPandaServer.cpp index bea93a6c..f29f7f2e 100644 --- a/dScripts/ai/FV/FvPandaServer.cpp +++ b/dScripts/ai/FV/FvPandaServer.cpp @@ -1,6 +1,7 @@ #include "FvPandaServer.h" #include "PetComponent.h" #include "Character.h" +#include "ePetTamingNotifyType.h" void FvPandaServer::OnStartup(Entity* self) { const auto* petComponent = self->GetComponent(); @@ -10,12 +11,12 @@ void FvPandaServer::OnStartup(Entity* self) { } } -void FvPandaServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) { - if (type == NOTIFY_TYPE_BEGIN) { +void FvPandaServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTamingNotifyType type) { + if (type == ePetTamingNotifyType::BEGIN) { self->CancelAllTimers(); - } else if (type == NOTIFY_TYPE_QUIT || type == NOTIFY_TYPE_FAILED) { + } else if (type == ePetTamingNotifyType::QUIT || type == ePetTamingNotifyType::FAILED) { self->Smash(); - } else if (type == NOTIFY_TYPE_SUCCESS) { + } else if (type == ePetTamingNotifyType::SUCCESS) { // TODO: Remove from groups auto* character = tamer->GetCharacter(); @@ -29,7 +30,7 @@ void FvPandaServer::OnTimerDone(Entity* self, std::string timerName) { if (timerName == "killSelf") { const auto* petComponent = self->GetComponent(); if (petComponent != nullptr && petComponent->GetOwner() == nullptr) { - self->Smash(self->GetObjectID(), SILENT); + self->Smash(self->GetObjectID(), eKillType::SILENT); } } } diff --git a/dScripts/ai/FV/FvPandaServer.h b/dScripts/ai/FV/FvPandaServer.h index 4948fdf4..5db060a0 100644 --- a/dScripts/ai/FV/FvPandaServer.h +++ b/dScripts/ai/FV/FvPandaServer.h @@ -3,6 +3,6 @@ class FvPandaServer : public CppScripts::Script { void OnStartup(Entity* self) override; - void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) override; + void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTamingNotifyType type) override; void OnTimerDone(Entity* self, std::string timerName) override; }; diff --git a/dScripts/ai/GENERAL/InstanceExitTransferPlayerToLastNonInstance.cpp b/dScripts/ai/GENERAL/InstanceExitTransferPlayerToLastNonInstance.cpp index 4e42e7fb..de1c62e0 100644 --- a/dScripts/ai/GENERAL/InstanceExitTransferPlayerToLastNonInstance.cpp +++ b/dScripts/ai/GENERAL/InstanceExitTransferPlayerToLastNonInstance.cpp @@ -3,6 +3,7 @@ #include "Player.h" #include "Character.h" #include "dServer.h" +#include "eTerminateType.h" void InstanceExitTransferPlayerToLastNonInstance::OnUse(Entity* self, Entity* user) { auto transferText = self->GetVar(u"transferText"); diff --git a/dScripts/ai/GENERAL/LegoDieRoll.cpp b/dScripts/ai/GENERAL/LegoDieRoll.cpp index 89819271..18082065 100644 --- a/dScripts/ai/GENERAL/LegoDieRoll.cpp +++ b/dScripts/ai/GENERAL/LegoDieRoll.cpp @@ -11,7 +11,7 @@ void LegoDieRoll::OnStartup(Entity* self) { void LegoDieRoll::OnTimerDone(Entity* self, std::string timerName) { if (timerName == "DoneRolling") { - self->Smash(self->GetObjectID(), SILENT); + self->Smash(self->GetObjectID(), eKillType::SILENT); } else if (timerName == "ThrowDice") { int dieRoll = GeneralUtils::GenerateRandomNumber(1, 6); diff --git a/dScripts/ai/GF/GfJailWalls.cpp b/dScripts/ai/GF/GfJailWalls.cpp index 56710832..1835faa2 100644 --- a/dScripts/ai/GF/GfJailWalls.cpp +++ b/dScripts/ai/GF/GfJailWalls.cpp @@ -1,6 +1,7 @@ #include "GfJailWalls.h" #include "dZoneManager.h" #include "GeneralUtils.h" +#include "eRebuildState.h" void GfJailWalls::OnRebuildComplete(Entity* self, Entity* target) { const auto wall = GeneralUtils::UTF16ToWTF8(self->GetVar(u"Wall")); @@ -15,7 +16,7 @@ void GfJailWalls::OnRebuildComplete(Entity* self, Entity* target) { } void GfJailWalls::OnRebuildNotifyState(Entity* self, eRebuildState state) { - if (state != eRebuildState::REBUILD_RESETTING) return; + if (state != eRebuildState::RESETTING) return; const auto wall = GeneralUtils::UTF16ToWTF8(self->GetVar(u"Wall")); diff --git a/dScripts/ai/GF/PetDigBuild.cpp b/dScripts/ai/GF/PetDigBuild.cpp index 2c3da9fc..504a1199 100644 --- a/dScripts/ai/GF/PetDigBuild.cpp +++ b/dScripts/ai/GF/PetDigBuild.cpp @@ -46,6 +46,6 @@ void PetDigBuild::OnDie(Entity* self, Entity* killer) { // If the quick build expired and the treasure was not collected, hide the treasure if (!treasure->GetIsDead()) { - treasure->Smash(self->GetObjectID(), SILENT); + treasure->Smash(self->GetObjectID(), eKillType::SILENT); } } diff --git a/dScripts/ai/GF/PirateRep.cpp b/dScripts/ai/GF/PirateRep.cpp index ccfa7af6..33d6ab63 100644 --- a/dScripts/ai/GF/PirateRep.cpp +++ b/dScripts/ai/GF/PirateRep.cpp @@ -2,12 +2,13 @@ #include "Character.h" #include "eMissionState.h" #include "Entity.h" +#include "ePlayerFlag.h" void PirateRep::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) { if (missionID == m_PirateRepMissionID && missionState >= eMissionState::READY_TO_COMPLETE) { auto* character = target->GetCharacter(); if (character) { - character->SetPlayerFlag(ePlayerFlags::GF_PIRATE_REP, true); + character->SetPlayerFlag(ePlayerFlag::GF_PIRATE_REP, true); } } } diff --git a/dScripts/ai/MINIGAME/SG_GF/SERVER/SGCannon.cpp b/dScripts/ai/MINIGAME/SG_GF/SERVER/SGCannon.cpp index 703c6bbd..bdd7a506 100644 --- a/dScripts/ai/MINIGAME/SG_GF/SERVER/SGCannon.cpp +++ b/dScripts/ai/MINIGAME/SG_GF/SERVER/SGCannon.cpp @@ -15,6 +15,7 @@ #include "InventoryComponent.h" #include "eMissionTaskType.h" #include "eReplicaComponentType.h" +#include "eGameActivity.h" void SGCannon::OnStartup(Entity* self) { Game::logger->Log("SGCannon", "OnStartup"); @@ -102,7 +103,7 @@ void SGCannon::OnActivityStateChangeRequest(Entity* self, LWOOBJID senderID, int if (characterComponent != nullptr) { characterComponent->SetIsRacing(true); - characterComponent->SetCurrentActivity(2); + characterComponent->SetCurrentActivity(eGameActivity::SHOOTING_GALLERY); auto possessor = player->GetComponent(); if (possessor) { possessor->SetPossessable(self->GetObjectID()); @@ -570,7 +571,7 @@ void SGCannon::StopGame(Entity* self, bool cancel) { auto* inventory = player->GetComponent(); if (inventory != nullptr) { for (const auto rewardLot : self->GetVar>(RewardsVariable)) { - inventory->AddItem(rewardLot, 1, eLootSourceType::LOOT_SOURCE_ACTIVITY, eInventoryType::MODELS); + inventory->AddItem(rewardLot, 1, eLootSourceType::ACTIVITY, eInventoryType::MODELS); } } diff --git a/dScripts/ai/NS/NsConcertInstrument.cpp b/dScripts/ai/NS/NsConcertInstrument.cpp index c7478a05..7db1ca16 100644 --- a/dScripts/ai/NS/NsConcertInstrument.cpp +++ b/dScripts/ai/NS/NsConcertInstrument.cpp @@ -20,7 +20,7 @@ void NsConcertInstrument::OnStartup(Entity* self) { } void NsConcertInstrument::OnRebuildNotifyState(Entity* self, eRebuildState state) { - if (state == REBUILD_RESETTING || state == REBUILD_OPEN) { + if (state == eRebuildState::RESETTING || state == eRebuildState::OPEN) { self->SetVar(u"activePlayer", LWOOBJID_EMPTY); } } @@ -96,7 +96,7 @@ void NsConcertInstrument::OnTimerDone(Entity* self, std::string name) { if (rebuildComponent != nullptr) rebuildComponent->ResetRebuild(false); - self->Smash(self->GetObjectID(), VIOLENT); + self->Smash(self->GetObjectID(), eKillType::VIOLENT); self->SetVar(u"activePlayer", LWOOBJID_EMPTY); } else if (activePlayer != nullptr && name == "achievement") { auto* missionComponent = activePlayer->GetComponent(); @@ -199,7 +199,7 @@ void NsConcertInstrument::EquipInstruments(Entity* self, Entity* player) { // Equip the left hand instrument const auto leftInstrumentLot = instrumentLotLeft.find(GetInstrumentLot(self))->second; if (leftInstrumentLot != LOT_NULL) { - inventory->AddItem(leftInstrumentLot, 1, eLootSourceType::LOOT_SOURCE_NONE, TEMP_ITEMS, {}, LWOOBJID_EMPTY, false); + inventory->AddItem(leftInstrumentLot, 1, eLootSourceType::NONE, TEMP_ITEMS, {}, LWOOBJID_EMPTY, false); auto* leftInstrument = inventory->FindItemByLot(leftInstrumentLot, TEMP_ITEMS); leftInstrument->Equip(); } @@ -207,7 +207,7 @@ void NsConcertInstrument::EquipInstruments(Entity* self, Entity* player) { // Equip the right hand instrument const auto rightInstrumentLot = instrumentLotRight.find(GetInstrumentLot(self))->second; if (rightInstrumentLot != LOT_NULL) { - inventory->AddItem(rightInstrumentLot, 1, eLootSourceType::LOOT_SOURCE_NONE, TEMP_ITEMS, {}, LWOOBJID_EMPTY, false); + inventory->AddItem(rightInstrumentLot, 1, eLootSourceType::NONE, TEMP_ITEMS, {}, LWOOBJID_EMPTY, false); auto* rightInstrument = inventory->FindItemByLot(rightInstrumentLot, TEMP_ITEMS); rightInstrument->Equip(); } diff --git a/dScripts/ai/NS/NsConcertQuickBuild.cpp b/dScripts/ai/NS/NsConcertQuickBuild.cpp index fcec4dc7..4589ee6a 100644 --- a/dScripts/ai/NS/NsConcertQuickBuild.cpp +++ b/dScripts/ai/NS/NsConcertQuickBuild.cpp @@ -58,7 +58,7 @@ void NsConcertQuickBuild::OnStartup(Entity* self) { // Destroys the quick build after a while if it wasn't built self->AddCallbackTimer(resetActivatorTime, [self]() { self->SetNetworkVar(u"startEffect", -1.0f); - self->Smash(self->GetObjectID(), SILENT); + self->Smash(self->GetObjectID(), eKillType::SILENT); }); } diff --git a/dScripts/ai/NS/NsGetFactionMissionServer.cpp b/dScripts/ai/NS/NsGetFactionMissionServer.cpp index cfecb249..185bd344 100644 --- a/dScripts/ai/NS/NsGetFactionMissionServer.cpp +++ b/dScripts/ai/NS/NsGetFactionMissionServer.cpp @@ -3,6 +3,7 @@ #include "MissionComponent.h" #include "Character.h" #include "eReplicaComponentType.h" +#include "ePlayerFlag.h" void NsGetFactionMissionServer::OnRespondToMission(Entity* self, int missionID, Entity* player, int reward) { if (missionID != 474) return; @@ -10,7 +11,7 @@ void NsGetFactionMissionServer::OnRespondToMission(Entity* self, int missionID, if (reward != LOT_NULL) { std::vector factionMissions; int celebrationID = -1; - int flagID = -1; + int32_t flagID = -1; if (reward == 6980) { // Venture League @@ -41,7 +42,7 @@ void NsGetFactionMissionServer::OnRespondToMission(Entity* self, int missionID, } if (flagID != -1) { - player->GetCharacter()->SetPlayerFlag(ePlayerFlags::JOINED_A_FACTION, true); + player->GetCharacter()->SetPlayerFlag(ePlayerFlag::JOINED_A_FACTION, true); player->GetCharacter()->SetPlayerFlag(flagID, true); } diff --git a/dScripts/ai/SPEC/SpecialCoinSpawner.cpp b/dScripts/ai/SPEC/SpecialCoinSpawner.cpp index aed9e817..ff494845 100644 --- a/dScripts/ai/SPEC/SpecialCoinSpawner.cpp +++ b/dScripts/ai/SPEC/SpecialCoinSpawner.cpp @@ -11,6 +11,6 @@ void SpecialCoinSpawner::OnProximityUpdate(Entity* self, Entity* entering, const auto character = entering->GetCharacter(); if (!character) return; GameMessages::SendPlayFXEffect(self, -1, u"pickup", "", LWOOBJID_EMPTY, 1, 1, true); - character->SetCoins(character->GetCoins() + this->m_CurrencyDenomination, eLootSourceType::LOOT_SOURCE_CURRENCY); + character->SetCoins(character->GetCoins() + this->m_CurrencyDenomination, eLootSourceType::CURRENCY); self->Smash(entering->GetObjectID(), eKillType::SILENT); } diff --git a/dScripts/client/ai/PR/CrabServer.cpp b/dScripts/client/ai/PR/CrabServer.cpp index 890b8ed9..f30142ba 100644 --- a/dScripts/client/ai/PR/CrabServer.cpp +++ b/dScripts/client/ai/PR/CrabServer.cpp @@ -1,5 +1,6 @@ #include "CrabServer.h" #include "PetComponent.h" +#include "ePetTamingNotifyType.h" void CrabServer::OnStartup(Entity* self) { auto* petComponent = self->GetComponent(); @@ -23,16 +24,16 @@ void CrabServer::OnTimerDone(Entity* self, std::string timerName) { if (petComponent == nullptr || petComponent->GetOwner() != nullptr) return; - self->Smash(self->GetObjectID(), SILENT); + self->Smash(self->GetObjectID(), eKillType::SILENT); } } -void CrabServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) { - if (type == NOTIFY_TYPE_BEGIN) { +void CrabServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTamingNotifyType type) { + if (type == ePetTamingNotifyType::BEGIN) { self->CancelTimer("killself"); - } else if (type == NOTIFY_TYPE_QUIT || type == NOTIFY_TYPE_FAILED) { - self->Smash(self->GetObjectID(), SILENT); - } else if (type == NOTIFY_TYPE_SUCCESS) { + } else if (type == ePetTamingNotifyType::QUIT || type == ePetTamingNotifyType::FAILED) { + self->Smash(self->GetObjectID(), eKillType::SILENT); + } else if (type == ePetTamingNotifyType::SUCCESS) { auto* petComponent = self->GetComponent(); if (petComponent == nullptr) return; diff --git a/dScripts/client/ai/PR/CrabServer.h b/dScripts/client/ai/PR/CrabServer.h index 28533cb5..8c689dbd 100644 --- a/dScripts/client/ai/PR/CrabServer.h +++ b/dScripts/client/ai/PR/CrabServer.h @@ -6,5 +6,5 @@ class CrabServer : public CppScripts::Script public: void OnStartup(Entity* self) override; void OnTimerDone(Entity* self, std::string timerName) override; - void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) override; + void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTamingNotifyType type) override; }; diff --git a/tests/dGameTests/dComponentsTests/DestroyableComponentTests.cpp b/tests/dGameTests/dComponentsTests/DestroyableComponentTests.cpp index 7399456d..db9c033a 100644 --- a/tests/dGameTests/dComponentsTests/DestroyableComponentTests.cpp +++ b/tests/dGameTests/dComponentsTests/DestroyableComponentTests.cpp @@ -5,6 +5,7 @@ #include "DestroyableComponent.h" #include "Entity.h" #include "eReplicaComponentType.h" +#include "eStateChangeType.h" class DestroyableTest : public GameDependenciesTest { protected: