diff options
-rw-r--r-- | src/server/game/Garrison/Garrison.cpp | 12 | ||||
-rw-r--r-- | src/server/game/Garrison/Garrison.h | 102 |
2 files changed, 95 insertions, 19 deletions
diff --git a/src/server/game/Garrison/Garrison.cpp b/src/server/game/Garrison/Garrison.cpp index 2e14b55d30b..c2b5bd354d5 100644 --- a/src/server/game/Garrison/Garrison.cpp +++ b/src/server/game/Garrison/Garrison.cpp @@ -346,7 +346,7 @@ void Garrison::LearnBlueprint(uint32 garrBuildingId) if (!sGarrBuildingStore.LookupEntry(garrBuildingId)) learnBlueprintResult.Result = GARRISON_ERROR_INVALID_BUILDINGID; else if (_knownBuildings.count(garrBuildingId)) - learnBlueprintResult.Result = GARRISON_ERROR_BLUEPRINT_KNOWN; + learnBlueprintResult.Result = GARRISON_ERROR_BLUEPRINT_EXISTS; else _knownBuildings.insert(garrBuildingId); @@ -363,7 +363,7 @@ void Garrison::UnlearnBlueprint(uint32 garrBuildingId) if (!sGarrBuildingStore.LookupEntry(garrBuildingId)) unlearnBlueprintResult.Result = GARRISON_ERROR_INVALID_BUILDINGID; else if (!_knownBuildings.count(garrBuildingId)) - unlearnBlueprintResult.Result = GARRISON_ERROR_BLUEPRINT_NOT_KNOWN; + unlearnBlueprintResult.Result = GARRISON_ERROR_REQUIRES_BLUEPRINT; else _knownBuildings.erase(garrBuildingId); @@ -497,7 +497,7 @@ void Garrison::AddFollower(uint32 garrFollowerId) GarrFollowerEntry const* followerEntry = sGarrFollowerStore.LookupEntry(garrFollowerId); if (_followerIds.count(garrFollowerId) || !followerEntry) { - addFollowerResult.Result = GARRISON_GENERIC_UNKNOWN_ERROR; + addFollowerResult.Result = GARRISON_ERROR_FOLLOWER_EXISTS; _owner->SendDirectMessage(addFollowerResult.Write()); return; } @@ -609,7 +609,7 @@ GarrisonError Garrison::CheckBuildingPlacement(uint32 garrPlotInstanceId, uint32 GarrPlotInstanceEntry const* plotInstance = sGarrPlotInstanceStore.LookupEntry(garrPlotInstanceId); Plot const* plot = GetPlot(garrPlotInstanceId); if (!plotInstance || !plot) - return GARRISON_ERROR_INVALID_PLOT; + return GARRISON_ERROR_INVALID_PLOT_INSTANCEID; GarrBuildingEntry const* building = sGarrBuildingStore.LookupEntry(garrBuildingId); if (!building) @@ -625,7 +625,7 @@ GarrisonError Garrison::CheckBuildingPlacement(uint32 garrPlotInstanceId, uint32 if (building->Flags & GARRISON_BUILDING_FLAG_NEEDS_PLAN) { if (!_knownBuildings.count(garrBuildingId)) - return GARRISON_ERROR_BLUEPRINT_NOT_KNOWN; + return GARRISON_ERROR_REQUIRES_BLUEPRINT; } else // Building is built as a quest reward return GARRISON_ERROR_INVALID_BUILDINGID; @@ -661,7 +661,7 @@ GarrisonError Garrison::CheckBuildingRemoval(uint32 garrPlotInstanceId) const { Plot const* plot = GetPlot(garrPlotInstanceId); if (!plot) - return GARRISON_ERROR_INVALID_PLOT; + return GARRISON_ERROR_INVALID_PLOT_INSTANCEID; if (!plot->BuildingInfo.PacketInfo) return GARRISON_ERROR_NO_BUILDING; diff --git a/src/server/game/Garrison/Garrison.h b/src/server/game/Garrison/Garrison.h index 4052ad2f5de..6030d95dfe0 100644 --- a/src/server/game/Garrison/Garrison.h +++ b/src/server/game/Garrison/Garrison.h @@ -66,19 +66,95 @@ enum GarrisonAbilityFlags enum GarrisonError { - GARRISON_SUCCESS = 0, - GARRISON_ERROR_INVALID_PLOT = 1, - GARRISON_ERROR_INVALID_BUILDINGID = 2, - GARRISON_ERROR_INVALID_PLOT_BUILDING = 7, - GARRISON_ERROR_NO_BUILDING = 8, - GARRISON_ERROR_SPECIALIZATION_KNOWN = 19, - GARRISON_ERROR_BLUEPRINT_KNOWN = 21, - GARRISON_ERROR_BLUEPRINT_NOT_KNOWN = 22, - GARRISON_ERROR_BUILDING_EXISTS = 24, - GARRISON_ERROR_NOT_ENOUGH_CURRENCY = 46, - GARRISON_ERROR_NOT_ENOUGH_GOLD = 47, - - GARRISON_GENERIC_UNKNOWN_ERROR = 255 // custom value for packets whose handlers only check if error != 0 + GARRISON_SUCCESS = 0, + GARRISON_ERROR_NO_GARRISON = 1, + GARRISON_ERROR_GARRISON_EXISTS = 2, + GARRISON_ERROR_GARRISON_SAME_TYPE_EXISTS = 3, + GARRISON_ERROR_INVALID_GARRISON = 4, + GARRISON_ERROR_INVALID_GARRISON_LEVEL = 5, + GARRISON_ERROR_GARRISON_LEVEL_UNCHANGED = 6, + GARRISON_ERROR_NOT_IN_GARRISON = 7, + GARRISON_ERROR_NO_BUILDING = 8, + GARRISON_ERROR_BUILDING_EXISTS = 9, + GARRISON_ERROR_INVALID_PLOT_INSTANCEID = 10, + GARRISON_ERROR_INVALID_BUILDINGID = 11, + GARRISON_ERROR_INVALID_UPGRADE_LEVEL = 12, + GARRISON_ERROR_UPGRADE_LEVEL_EXCEEDS_GARRISON_LEVEL = 13, + GARRISON_ERROR_PLOTS_NOT_FULL = 14, + GARRISON_ERROR_INVALID_SITE_ID = 15, + GARRISON_ERROR_INVALID_PLOT_BUILDING = 16, + GARRISON_ERROR_INVALID_FACTION = 17, + GARRISON_ERROR_INVALID_SPECIALIZATION = 18, + GARRISON_ERROR_SPECIALIZATION_EXISTS = 19, + GARRISON_ERROR_SPECIALIZATION_ON_COOLDOWN = 20, + GARRISON_ERROR_BLUEPRINT_EXISTS = 21, + GARRISON_ERROR_REQUIRES_BLUEPRINT = 22, + GARRISON_ERROR_INVALID_DOODAD_SET_ID = 23, + GARRISON_ERROR_BUILDING_TYPE_EXISTS = 24, + GARRISON_ERROR_BUILDING_NOT_ACTIVE = 25, + GARRISON_ERROR_CONSTRUCTION_COMPLETE = 26, + GARRISON_ERROR_FOLLOWER_EXISTS = 27, + GARRISON_ERROR_INVALID_FOLLOWER = 28, + GARRISON_ERROR_FOLLOWER_ALREADY_ON_MISSION = 29, + GARRISON_ERROR_FOLLOWER_IN_BUILDING = 30, + GARRISON_ERROR_FOLLOWER_INVALID_FOR_BUILDING = 31, + GARRISON_ERROR_INVALID_FOLLOWER_LEVEL = 32, + GARRISON_ERROR_MISSION_EXISTS = 33, + GARRISON_ERROR_INVALID_MISSION = 34, + GARRISON_ERROR_INVALID_MISSION_TIME = 35, + GARRISON_ERROR_INVALID_MISSION_REWARD_INDEX = 36, + GARRISON_ERROR_MISSION_NOT_OFFERED = 37, + GARRISON_ERROR_ALREADY_ON_MISSION = 38, + GARRISON_ERROR_MISSION_SIZE_INVALID = 39, + GARRISON_ERROR_FOLLOWER_SOFT_CAP_EXCEEDED = 40, + GARRISON_ERROR_NOT_ON_MISSION = 41, + GARRISON_ERROR_ALREADY_COMPLETED_MISSION = 42, + GARRISON_ERROR_MISSION_NOT_COMPLETE = 43, + GARRISON_ERROR_MISSION_REWARDS_PENDING = 44, + GARRISON_ERROR_MISSION_EXPIRED = 45, + GARRISON_ERROR_NOT_ENOUGH_CURRENCY = 46, + GARRISON_ERROR_NOT_ENOUGH_GOLD = 47, + GARRISON_ERROR_BUILDING_MISSING = 48, + GARRISON_ERROR_NO_ARCHITECT = 49, + GARRISON_ERROR_ARCHITECT_NOT_AVAILABLE = 50, + GARRISON_ERROR_NO_MISSION_NPC = 51, + GARRISON_ERROR_MISSION_NPC_NOT_AVAILABLE = 52, + GARRISON_ERROR_INTERNAL_ERROR = 53, + GARRISON_ERROR_INVALID_STATIC_TABLE_VALUE = 54, + GARRISON_ERROR_INVALID_ITEM_LEVEL = 55, + GARRISON_ERROR_INVALID_AVAILABLE_RECRUIT = 56, + GARRISON_ERROR_FOLLOWER_ALREADY_RECRUITED = 57, + GARRISON_ERROR_RECRUITMENT_GENERATION_IN_PROGRESS = 58, + GARRISON_ERROR_RECRUITMENT_ON_COOLDOWN = 59, + GARRISON_ERROR_RECRUIT_BLOCKED_BY_GENERATION = 60, + GARRISON_ERROR_RECRUITMENT_NPC_NOT_AVAILABLE = 61, + GARRISON_ERROR_INVALID_FOLLOWER_QUALITY = 62, + GARRISON_ERROR_PROXY_NOT_OK = 63, + GARRISON_ERROR_RECALL_PORTAL_USED_LESS_THAN_24_HOURS_AGO = 64, + GARRISON_ERROR_ON_REMOVE_BUILDING_SPELL_FAILED = 65, + GARRISON_ERROR_OPERATION_NOT_SUPPORTED = 66, + GARRISON_ERROR_FOLLOWER_FATIGUED = 67, + GARRISON_ERROR_UPGRADE_CONDITION_FAILED = 68, + GARRISON_ERROR_FOLLOWER_INACTIVE = 69, + GARRISON_ERROR_FOLLOWER_ACTIVE = 70, + GARRISON_ERROR_FOLLOWER_ACTIVATION_UNAVAILABLE = 71, + GARRISON_ERROR_FOLLOWER_TYPE_MISMATCH = 72, + GARRISON_ERROR_INVALID_GARRISON_TYPE = 73, + GARRISON_ERROR_MISSION_START_CONDITION_FAILED = 74, + GARRISON_ERROR_INVALID_FOLLOWER_ABILITY = 75, + GARRISON_ERROR_INVALID_MISSION_BONUS_ABILITY = 76, + GARRISON_ERROR_HIGHER_BUILDING_TYPE_EXISTS = 77, + GARRISON_ERROR_AT_FOLLOWER_HARD_CAP = 78, + GARRISON_ERROR_FOLLOWER_CANNOT_GAIN_XP = 79, + GARRISON_ERROR_NO_OP = 80, + GARRISON_ERROR_AT_CLASS_SPEC_CAP = 81, + GARRISON_ERROR_MISSION_REQUIRES_100_TO_START = 82, + GARRISON_ERROR_MISSION_MISSING_REQUIRED_FOLLOWER = 83, + GARRISON_ERROR_INVALID_TALENT = 84, + GARRISON_ERROR_ALREADY_RESEARCHING_TALENT = 85, + GARRISON_ERROR_FAILED_CONDITION = 86, + GARRISON_ERROR_INVALID_TIER = 87, + GARRISON_ERROR_INVALID_CLASS = 88 }; enum GarrisonFollowerStatus |