Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove scripts for patches where content is not available. #2542

Open
wants to merge 5 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/game/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,22 @@ set (game_SRCS

)

# Retrieve the value of SUPPORTED_CLIENT_BUILD from the CMake cache
set(SUPPORTED_CLIENT_BUILD "${SUPPORTED_CLIENT_BUILD}" CACHE STRING "Client version the core will support")

# Extract major patch
string(REGEX MATCH "1_([0-9]+)_" PATCH_NUMBER "${SUPPORTED_CLIENT_BUILD}")

set(PATCH_NUMBER ${CMAKE_MATCH_1})

# Remove Arathi Basin script if the client build is below patch 1.7
if(${PATCH_NUMBER} LESS 7)
list(REMOVE_ITEM game_SRCS
Battlegrounds/BattleGroundAB.h
Battlegrounds/BattleGroundAB.cpp
)
endif()

if((${CMAKE_VERSION} VERSION_LESS "3.16") OR USE_PCH_OLD)
list(APPEND game_SRCS
pchdef.cpp
Expand Down
6 changes: 4 additions & 2 deletions src/game/Chat/Chat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ ChatCommand * ChatHandler::getCommandTable()
{ "remove", SEC_BASIC_ADMIN, false, &ChatHandler::HandleGoldRemoval, "", nullptr },
{ nullptr, 0, false, nullptr, "", nullptr }
};

#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_9_4
static ChatCommand warEffortCommandTable[] =
{
{ "info", SEC_DEVELOPER, true, &ChatHandler::HandleWarEffortInfoCommand, "", nullptr },
Expand All @@ -1167,7 +1167,7 @@ ChatCommand * ChatHandler::getCommandTable()
{ "setresource", SEC_DEVELOPER, true, &ChatHandler::HandleWarEffortSetResource, "", nullptr },
{ nullptr, 0, false, nullptr, "", nullptr }
};

#endif
static ChatCommand commandTable[] =
{
{ "account", SEC_PLAYER, true, nullptr, "", accountCommandTable },
Expand Down Expand Up @@ -1298,7 +1298,9 @@ ChatCommand * ChatHandler::getCommandTable()
{ "spamer", SEC_MODERATOR, true, nullptr, "", spamerCommandTable },
{ "antispam", SEC_TICKETMASTER, true, nullptr, "", AntiSpamCommandTable },
{ "gold", SEC_BASIC_ADMIN, true, nullptr, "", goldCommandTable },
#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_9_4
{ "wareffort", SEC_DEVELOPER, true, nullptr, "", warEffortCommandTable },
#endif
{ nullptr, 0, false, nullptr, "", nullptr }
};

Expand Down
44 changes: 34 additions & 10 deletions src/game/HardcodedEvents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ void ElementalInvasion::ResetThings()
}
}

#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_8_4
/*
* Dragons of Nightmare
*/
Expand Down Expand Up @@ -318,7 +319,9 @@ void DragonsOfNightmare::PermutateDragons()
sObjectMgr.SetSavedVariable(VAR_PERM_3, permutation[2], true);
sObjectMgr.SetSavedVariable(VAR_PERM_4, permutation[3], true);
}
#endif

#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_6_1
/*
* Darkmoon Faire
*/
Expand Down Expand Up @@ -382,7 +385,9 @@ DarkmoonState DarkmoonFaire::GetDarkmoonState()

return DARKMOON_NONE;
}
#endif

#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_8_4
/*
* Fireworks Show
*/
Expand Down Expand Up @@ -489,6 +494,12 @@ bool ToastingGoblets::ShouldEnable() const

return timeinfo->tm_min >= 10 && timeinfo->tm_min <= 20;
}
#endif

#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_11_2
/*
* Scourge Invasion
*/

ScourgeInvasionEvent::ScourgeInvasionEvent()
:WorldEvent(GAME_EVENT_SCOURGE_INVASION),
Expand Down Expand Up @@ -1251,7 +1262,9 @@ void ScourgeInvasionEvent::UpdateWorldState()
pl->SendUpdateWorldState(WS_SI_WINTERSPRING_REMAINING, REMAINING_WINTERSPRING);
}
}
#endif

#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_9_4
/*
world_event_wareffort
The Gates of Ahn'Qiraj War Effort. Automatic transition from collection through
Expand Down Expand Up @@ -1668,19 +1681,30 @@ void WarEffortEvent::UpdateHiveColossusEvents()
sGameEventMgr.StartEvent(event, true);
}
}

/*
*
*/
#endif

void GameEventMgr::LoadHardcodedEvents(HardcodedEventList& eventList)
{
auto invasion = new ElementalInvasion();
auto nightmare = new DragonsOfNightmare();
auto darkmoon = new DarkmoonFaire();
auto fireworks = new FireworksShow();
auto goblets = new ToastingGoblets();
auto scourge_invasion = new ScourgeInvasionEvent();
auto war_effort = new WarEffortEvent();
eventList = { invasion, nightmare, darkmoon, fireworks, goblets, scourge_invasion, war_effort };
}
eventList.emplace_back(new ElementalInvasion());

#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_6_1
eventList.emplace_back(new DarkmoonFaire());
#endif

#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_8_4
eventList.emplace_back(new DragonsOfNightmare());
eventList.emplace_back(new FireworksShow());
eventList.emplace_back(new ToastingGoblets());
#endif

#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_9_4
eventList.emplace_back(new WarEffortEvent());
#endif

#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_11_2
eventList.emplace_back(new ScourgeInvasionEvent());
#endif
}
3 changes: 3 additions & 0 deletions src/game/HardcodedEvents.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ enum WarEffortEnums
WAR_EFFORT_REGAL_REWARD = 0x04
};

#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_9_4

struct WarEffortEvent : WorldEvent
{
WarEffortEvent();
Expand All @@ -324,3 +326,4 @@ struct WarEffortEvent : WorldEvent
void DisableAndStopEvent(uint16 event_id);
void UpdateHiveColossusEvents();
};
#endif
3 changes: 2 additions & 1 deletion src/game/Objects/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8715,12 +8715,13 @@ void Player::SendInitWorldStates(uint32 zoneid) const
break;
}

#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_9_4
// Ahn'Qiraj War Effort
if (sGameEventMgr.IsActiveEvent(EVENT_WAR_EFFORT))
{
count += BuildWarEffortWorldStates(data);
}

#endif
data << uint32(0) << uint32(0); // [-ZERO] Add terminator to prevent repeating audio bug.
data.put<uint16>(count_pos, count); // set actual world state amount
GetSession()->SendPacket(&data);
Expand Down
1 change: 0 additions & 1 deletion src/game/SharedDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,6 @@ enum HolidayIds
HOLIDAY_BREWFEST = 372,
HOLIDAY_DARKMOON_FAIRE_ELWYNN = 374,
HOLIDAY_DARKMOON_FAIRE_THUNDER = 375,
HOLIDAY_DARKMOON_FAIRE_SHATTRATH = 376,
};

// Values based on QuestSort.dbc
Expand Down
115 changes: 115 additions & 0 deletions src/scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,121 @@ set (SCRIPTS_SRCS

)

# Retrieve the value of SUPPORTED_CLIENT_BUILD from the CMake cache
set(SUPPORTED_CLIENT_BUILD "${SUPPORTED_CLIENT_BUILD}" CACHE STRING "Client version the core will support")

# Extract major patch
string(REGEX MATCH "1_([0-9]+)_" PATCH_NUMBER "${SUPPORTED_CLIENT_BUILD}")

set(PATCH_NUMBER ${CMAKE_MATCH_1})

# Remove Naxxramas scripts if the client build is below patch 1.11
if(${PATCH_NUMBER} LESS 11)
list(REMOVE_ITEM SCRIPTS_SRCS
eastern_kingdoms/eastern_plaguelands/naxxramas/naxxramas.h
eastern_kingdoms/eastern_plaguelands/naxxramas/boss_anubrekhan.cpp
eastern_kingdoms/eastern_plaguelands/naxxramas/boss_faerlina.cpp
eastern_kingdoms/eastern_plaguelands/naxxramas/boss_four_horsemen.cpp
eastern_kingdoms/eastern_plaguelands/naxxramas/boss_gluth.cpp
eastern_kingdoms/eastern_plaguelands/naxxramas/boss_gothik.cpp
eastern_kingdoms/eastern_plaguelands/naxxramas/boss_grobbulus.cpp
eastern_kingdoms/eastern_plaguelands/naxxramas/boss_heigan.cpp
eastern_kingdoms/eastern_plaguelands/naxxramas/boss_kelthuzad.cpp
eastern_kingdoms/eastern_plaguelands/naxxramas/boss_loatheb.cpp
eastern_kingdoms/eastern_plaguelands/naxxramas/boss_maexxna.cpp
eastern_kingdoms/eastern_plaguelands/naxxramas/boss_noth.cpp
eastern_kingdoms/eastern_plaguelands/naxxramas/boss_patchwerk.cpp
eastern_kingdoms/eastern_plaguelands/naxxramas/boss_razuvious.cpp
eastern_kingdoms/eastern_plaguelands/naxxramas/boss_sapphiron.cpp
eastern_kingdoms/eastern_plaguelands/naxxramas/boss_thaddius.cpp
eastern_kingdoms/eastern_plaguelands/naxxramas/instance_naxxramas.cpp
world/scourge_invasion.cpp
world/scourge_invasion.h
)
endif()

# Remove Ahn'Qiraj and Omen scripts if the client build is below patch 1.9
if(${PATCH_NUMBER} LESS 9)
list(REMOVE_ITEM SCRIPTS_SRCS
kalimdor/silithus/ruins_of_ahnqiraj/ruins_of_ahnqiraj.h
kalimdor/silithus/temple_of_ahnqiraj/temple_of_ahnqiraj.h
kalimdor/silithus/ruins_of_ahnqiraj/boss_ayamiss.cpp
kalimdor/silithus/ruins_of_ahnqiraj/boss_buru.cpp
kalimdor/silithus/ruins_of_ahnqiraj/boss_kurinnaxx.cpp
kalimdor/silithus/ruins_of_ahnqiraj/boss_moam.cpp
kalimdor/silithus/ruins_of_ahnqiraj/boss_ossirian.cpp
kalimdor/silithus/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp
kalimdor/silithus/ruins_of_ahnqiraj/npc_sandstalker.cpp
kalimdor/silithus/ruins_of_ahnqiraj/ruins_of_ahnqiraj.cpp
kalimdor/silithus/temple_of_ahnqiraj/boss_bug_trio.cpp
kalimdor/silithus/temple_of_ahnqiraj/boss_cthun.cpp
kalimdor/silithus/temple_of_ahnqiraj/boss_fankriss.cpp
kalimdor/silithus/temple_of_ahnqiraj/boss_huhuran.cpp
kalimdor/silithus/temple_of_ahnqiraj/boss_ouro.cpp
kalimdor/silithus/temple_of_ahnqiraj/boss_sartura.cpp
kalimdor/silithus/temple_of_ahnqiraj/boss_skeram.cpp
kalimdor/silithus/temple_of_ahnqiraj/boss_twinemperors.cpp
kalimdor/silithus/temple_of_ahnqiraj/boss_viscidus.cpp
kalimdor/silithus/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp
kalimdor/silithus/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp
world/world_event_wareffort.cpp
world/world_event_wareffort.h
kalimdor/moonglade/boss_omen.h
kalimdor/moonglade/boss_omen.cpp
)
endif()

# Remove Dragons of Nightmare scripts if the client build is below patch 1.8
if(${PATCH_NUMBER} LESS 8)
list(REMOVE_ITEM SCRIPTS_SRCS
world/dragons_of_nightmare/boss_dragon_of_nightmare.h
world/dragons_of_nightmare/boss_dragon_of_nightmare.cpp
world/dragons_of_nightmare/boss_emeriss.cpp
world/dragons_of_nightmare/boss_lethon.cpp
world/dragons_of_nightmare/boss_taerar.cpp
world/dragons_of_nightmare/boss_ysondre.cpp
)
endif()

# Remove Zul'Gurub scripts if the client build is below patch 1.7
if(${PATCH_NUMBER} LESS 7)
list(REMOVE_ITEM SCRIPTS_SRCS
eastern_kingdoms/stranglethorn_vale/zulgurub/zulgurub.h
eastern_kingdoms/stranglethorn_vale/zulgurub/boss_arlokk.cpp
eastern_kingdoms/stranglethorn_vale/zulgurub/boss_gahzranka.cpp
eastern_kingdoms/stranglethorn_vale/zulgurub/boss_grilek.cpp
eastern_kingdoms/stranglethorn_vale/zulgurub/boss_hakkar.cpp
eastern_kingdoms/stranglethorn_vale/zulgurub/boss_hazzarah.cpp
eastern_kingdoms/stranglethorn_vale/zulgurub/boss_jeklik.cpp
eastern_kingdoms/stranglethorn_vale/zulgurub/boss_jindo.cpp
eastern_kingdoms/stranglethorn_vale/zulgurub/boss_mandokir.cpp
eastern_kingdoms/stranglethorn_vale/zulgurub/boss_marli.cpp
eastern_kingdoms/stranglethorn_vale/zulgurub/boss_renataki.cpp
eastern_kingdoms/stranglethorn_vale/zulgurub/boss_thekal.cpp
eastern_kingdoms/stranglethorn_vale/zulgurub/boss_venoxis.cpp
eastern_kingdoms/stranglethorn_vale/zulgurub/boss_wushoolay.cpp
eastern_kingdoms/stranglethorn_vale/zulgurub/instance_zulgurub.cpp
eastern_kingdoms/stranglethorn_vale/zulgurub/zulgurub_trash.cpp
)
endif()

# Remove Blackwing scripts if the client build is below patch 1.6
if(${PATCH_NUMBER} LESS 6)
list(REMOVE_ITEM SCRIPTS_SRCS
eastern_kingdoms/burning_steppes/blackwing_lair/blackwing_lair.h
eastern_kingdoms/burning_steppes/blackwing_lair/boss_broodlord_lashlayer.cpp
eastern_kingdoms/burning_steppes/blackwing_lair/boss_chromaggus.cpp
eastern_kingdoms/burning_steppes/blackwing_lair/boss_ebonroc.cpp
eastern_kingdoms/burning_steppes/blackwing_lair/boss_firemaw.cpp
eastern_kingdoms/burning_steppes/blackwing_lair/boss_flamegor.cpp
eastern_kingdoms/burning_steppes/blackwing_lair/boss_nefarian.cpp
eastern_kingdoms/burning_steppes/blackwing_lair/boss_razorgore.cpp
eastern_kingdoms/burning_steppes/blackwing_lair/boss_vaelastrasz.cpp
eastern_kingdoms/burning_steppes/blackwing_lair/boss_victor_nefarius.cpp
eastern_kingdoms/burning_steppes/blackwing_lair/instance_blackwing_lair.cpp
)
endif()

if((${CMAKE_VERSION} VERSION_LESS "3.16") OR USE_PCH_OLD)
list(APPEND SCRIPTS_SRCS
PrecompiledHeaders/scriptPCH.cpp
Expand Down
Loading