mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-30 05:43:12 +01:00
Core/Conditions: implement CONDITION_WINTERGRASP_HORDE to check if Wintergrasp is held by Horde.
Use negative condition to check if it is held by Alliance instead. Use this condition to fix availability of the Wintergrasp item-gathering weekly quests. (cherry picked from commit723c253f8f) Make travis happy and fix codestyle for previous commit. (cherry picked from commit7267a41418) Core/Conditions: partially revert723c253, replacing CONDITION_WINTERGRASP_HORDE with a ConditionScript. (cherry picked from commitfd620ca7d6) Update 2016_10_04_03_world.sql (cherry picked from commit4891db4a4f)
This commit is contained in:
@@ -629,6 +629,34 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class condition_is_wintergrasp_horde : public ConditionScript
|
||||
{
|
||||
public:
|
||||
condition_is_wintergrasp_horde() : ConditionScript("condition_is_wintergrasp_horde") { }
|
||||
|
||||
bool OnConditionCheck(Condition const* /* condition */, ConditionSourceInfo& /* sourceInfo */)
|
||||
{
|
||||
Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
|
||||
if (wintergrasp->IsEnabled() && wintergrasp->GetDefenderTeam() == TEAM_HORDE)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class condition_is_wintergrasp_alliance : public ConditionScript
|
||||
{
|
||||
public:
|
||||
condition_is_wintergrasp_alliance() : ConditionScript("condition_is_wintergrasp_alliance") { }
|
||||
|
||||
bool OnConditionCheck(Condition const* /* condition */, ConditionSourceInfo& /* sourceInfo */)
|
||||
{
|
||||
Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
|
||||
if (wintergrasp->IsEnabled() && wintergrasp->GetDefenderTeam() == TEAM_ALLIANCE)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_wintergrasp()
|
||||
{
|
||||
new npc_wg_queue();
|
||||
@@ -641,4 +669,6 @@ void AddSC_wintergrasp()
|
||||
new achievement_wg_didnt_stand_a_chance();
|
||||
new spell_wintergrasp_defender_teleport();
|
||||
new spell_wintergrasp_defender_teleport_trigger();
|
||||
new condition_is_wintergrasp_horde();
|
||||
new condition_is_wintergrasp_alliance();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user