mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Conditions: partially revert 723c253, replacing CONDITION_WINTERGRASP_HORDE with a ConditionScript.
This commit is contained in:
3
sql/updates/world/3.3.5/2016_10_04_03_world.sql
Normal file
3
sql/updates/world/3.3.5/2016_10_04_03_world.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
--
|
||||
UPDATE `conditions` SET `ConditionTypeOrReference`=32, `ConditionValue1`=0x90, `ScriptName`="condition_is_wintergrasp_horde" WHERE `ConditionTypeOrReference`=48 AND `NegativeCondition`=0;
|
||||
UPDATE `conditions` SET `ConditionTypeOrReference`=32, `ConditionValue1`=0x90, `NegativeCondition`=0, `ScriptName`="condition_is_wintergrasp_alliance" WHERE `ConditionTypeOrReference`=48 AND `NegativeCondition`=1;
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include "ConditionMgr.h"
|
||||
#include "AchievementMgr.h"
|
||||
#include "BattlefieldMgr.h"
|
||||
#include "GameEventMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "ObjectMgr.h"
|
||||
@@ -110,8 +109,7 @@ ConditionMgr::ConditionTypeInfo const ConditionMgr::StaticConditionTypeData[COND
|
||||
{ "Charmed", false, false, false },
|
||||
{ "Pet type", true, false, false },
|
||||
{ "On Taxi", false, false, false },
|
||||
{ "Quest state mask", true, true, false },
|
||||
{ "Wintergrasp is horde",false, false, false }
|
||||
{ "Quest state mask", true, true, false }
|
||||
};
|
||||
|
||||
// Checks if object meets the condition
|
||||
@@ -496,16 +494,6 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_WINTERGRASP_HORDE:
|
||||
{
|
||||
condMeets = false;
|
||||
if (object->GetTypeId() == TYPEID_PLAYER)
|
||||
if (Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG))
|
||||
if (wintergrasp->IsEnabled())
|
||||
if (wintergrasp->GetDefenderTeam() == TEAM_HORDE)
|
||||
condMeets = true;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
condMeets = false;
|
||||
break;
|
||||
@@ -694,9 +682,6 @@ uint32 Condition::GetSearcherTypeMaskForCondition() const
|
||||
case CONDITION_QUESTSTATE:
|
||||
mask |= GRID_MAP_TYPE_MASK_PLAYER;
|
||||
break;
|
||||
case CONDITION_WINTERGRASP_HORDE:
|
||||
mask |= GRID_MAP_TYPE_MASK_PLAYER;
|
||||
break;
|
||||
default:
|
||||
ASSERT(false && "Condition::GetSearcherTypeMaskForCondition - missing condition handling!");
|
||||
break;
|
||||
@@ -2237,7 +2222,6 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const
|
||||
case CONDITION_IN_WATER:
|
||||
case CONDITION_CHARMED:
|
||||
case CONDITION_TAXI:
|
||||
case CONDITION_WINTERGRASP_HORDE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -78,8 +78,7 @@ enum ConditionTypes
|
||||
CONDITION_PET_TYPE = 45, // mask 0 0 true if player has a pet of given type(s)
|
||||
CONDITION_TAXI = 46, // 0 0 0 true if player is on taxi
|
||||
CONDITION_QUESTSTATE = 47, // quest_id state_mask 0 true if player is in any of the provided quest states for the quest (1 = not taken, 2 = completed, 8 = in progress, 32 = failed, 64 = rewarded)
|
||||
CONDITION_WINTERGRASP_HORDE = 48, // 0 0 0 true if Wintergrasp is enabled and held by horde
|
||||
CONDITION_MAX = 49 // MAX
|
||||
CONDITION_MAX = 48 // MAX
|
||||
};
|
||||
|
||||
/*! Documentation on implementing a new ConditionSourceType:
|
||||
|
||||
@@ -628,6 +628,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();
|
||||
@@ -640,4 +668,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