* Rename: BattleGround -> Battleground.
--HG-- branch : trunk
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
#include "Util.h"
|
||||
#include "Spell.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "BattleGround.h"
|
||||
#include "Battleground.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
#include "Formulas.h"
|
||||
#include "GridNotifiers.h"
|
||||
@@ -1538,7 +1538,7 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const
|
||||
|
||||
// add HoTs to amount healed in bgs
|
||||
if (caster->GetTypeId() == TYPEID_PLAYER)
|
||||
if (BattleGround *bg = caster->ToPlayer()->GetBattleGround())
|
||||
if (Battleground *bg = caster->ToPlayer()->GetBattleground())
|
||||
bg->UpdatePlayerScore(caster->ToPlayer(), SCORE_HEALING_DONE, gain);
|
||||
|
||||
target->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, GetSpellProto());
|
||||
@@ -2781,8 +2781,8 @@ void AuraEffect::HandlePhase(AuraApplication const * aurApp, uint8 mode, bool ap
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
// drop flag at invisible in bg
|
||||
if (target->ToPlayer()->InBattleGround())
|
||||
if (BattleGround *bg = target->ToPlayer()->GetBattleGround())
|
||||
if (target->ToPlayer()->InBattleground())
|
||||
if (Battleground *bg = target->ToPlayer()->GetBattleground())
|
||||
bg->EventPlayerDroppedFlag(target->ToPlayer());
|
||||
|
||||
// GM-mode have mask 0xFFFFFFFF
|
||||
@@ -4232,9 +4232,9 @@ void AuraEffect::HandleAuraModEffectImmunity(AuraApplication const * aurApp, uin
|
||||
{
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (target->ToPlayer()->InBattleGround())
|
||||
if (target->ToPlayer()->InBattleground())
|
||||
{
|
||||
if (BattleGround *bg = target->ToPlayer()->GetBattleGround())
|
||||
if (Battleground *bg = target->ToPlayer()->GetBattleground())
|
||||
bg->EventPlayerDroppedFlag(target->ToPlayer());
|
||||
}
|
||||
else
|
||||
@@ -5687,7 +5687,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo
|
||||
case 2584: // Waiting to Resurrect
|
||||
// Waiting to resurrect spell cancel, we must remove player from resurrect queue
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
if (BattleGround *bg = target->ToPlayer()->GetBattleGround())
|
||||
if (Battleground *bg = target->ToPlayer()->GetBattleground())
|
||||
bg->RemovePlayerFromResurrectQueue(target->GetGUID());
|
||||
break;
|
||||
case 36730: // Flame Strike
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include "SharedDefines.h"
|
||||
#include "LootMgr.h"
|
||||
#include "VMapFactory.h"
|
||||
#include "BattleGround.h"
|
||||
#include "Battleground.h"
|
||||
#include "Util.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "Vehicle.h"
|
||||
@@ -4614,7 +4614,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
|
||||
// only allow triggered spells if at an ended battleground
|
||||
if (!m_IsTriggeredSpell && m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
if (BattleGround * bg = m_caster->ToPlayer()->GetBattleGround())
|
||||
if (Battleground * bg = m_caster->ToPlayer()->GetBattleground())
|
||||
if (bg->GetStatus() == STATUS_WAIT_LEAVE)
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
|
||||
@@ -4876,7 +4876,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
|
||||
// Spell casted only on battleground
|
||||
if ((m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_BATTLEGROUND) && m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
if (!m_caster->ToPlayer()->InBattleGround())
|
||||
if (!m_caster->ToPlayer()->InBattleground())
|
||||
return SPELL_FAILED_ONLY_BATTLEGROUNDS;
|
||||
|
||||
// do not allow spells to be cast in arenas
|
||||
@@ -5275,8 +5275,8 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
|
||||
if (m_spellInfo->Id != 1842 || m_targets.getGOTarget() &&
|
||||
m_targets.getGOTarget()->GetGOInfo()->type != GAMEOBJECT_TYPE_TRAP)
|
||||
if (m_caster->ToPlayer()->InBattleGround() && // In BattleGround players can use only flags and banners
|
||||
!m_caster->ToPlayer()->CanUseBattleGroundObject())
|
||||
if (m_caster->ToPlayer()->InBattleground() && // In Battleground players can use only flags and banners
|
||||
!m_caster->ToPlayer()->CanUseBattlegroundObject())
|
||||
return SPELL_FAILED_TRY_AGAIN;
|
||||
|
||||
// get the lock entry
|
||||
@@ -5398,7 +5398,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
{
|
||||
//Do not allow to cast it before BG starts.
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
if (BattleGround const *bg = m_caster->ToPlayer()->GetBattleGround())
|
||||
if (Battleground const *bg = m_caster->ToPlayer()->GetBattleground())
|
||||
if (bg->GetStatus() != STATUS_IN_PROGRESS)
|
||||
return SPELL_FAILED_TRY_AGAIN;
|
||||
break;
|
||||
@@ -5547,7 +5547,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
return SPELL_FAILED_NO_MOUNTS_ALLOWED;
|
||||
|
||||
// Ignore map check if spell have AreaId. AreaId already checked and this prevent special mount spells
|
||||
bool AllowMount = !m_caster->GetMap()->IsDungeon() || m_caster->GetMap()->IsBattleGroundOrArena();
|
||||
bool AllowMount = !m_caster->GetMap()->IsDungeon() || m_caster->GetMap()->IsBattlegroundOrArena();
|
||||
InstanceTemplate const *it = objmgr.GetInstanceTemplate(m_caster->GetMapId());
|
||||
if (it)
|
||||
AllowMount = it->allowMount;
|
||||
|
||||
@@ -45,10 +45,10 @@
|
||||
#include "Creature.h"
|
||||
#include "Totem.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "BattleGroundMgr.h"
|
||||
#include "BattleGround.h"
|
||||
#include "BattleGroundEY.h"
|
||||
#include "BattleGroundWS.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundEY.h"
|
||||
#include "BattlegroundWS.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
#include "Language.h"
|
||||
#include "SocialMgr.h"
|
||||
@@ -1370,7 +1370,7 @@ void Spell::EffectDummy(uint32 i)
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
if (BattleGround* bg = m_caster->ToPlayer()->GetBattleGround())
|
||||
if (Battleground* bg = m_caster->ToPlayer()->GetBattleground())
|
||||
bg->EventPlayerDroppedFlag(m_caster->ToPlayer());
|
||||
|
||||
m_caster->CastSpell(m_caster, 30452, true, NULL);
|
||||
@@ -2879,7 +2879,7 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype)
|
||||
// for battleground marks send by mail if not add all expected
|
||||
if (no_space > 0 && bgType)
|
||||
{
|
||||
if (BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(BattleGroundTypeId(bgType)))
|
||||
if (Battleground* bg = sBattlegroundMgr.GetBattlegroundTemplate(BattlegroundTypeId(bgType)))
|
||||
bg->SendRewardMarkByMail(player, newitemid, no_space);
|
||||
}
|
||||
*/
|
||||
@@ -3165,9 +3165,9 @@ void Spell::EffectOpenLock(uint32 effIndex)
|
||||
if (goInfo->type == GAMEOBJECT_TYPE_BUTTON && goInfo->button.noDamageImmune ||
|
||||
goInfo->type == GAMEOBJECT_TYPE_GOOBER && goInfo->goober.losOK)
|
||||
{
|
||||
//CanUseBattleGroundObject() already called in CheckCast()
|
||||
//CanUseBattlegroundObject() already called in CheckCast()
|
||||
// in battleground check
|
||||
if (BattleGround *bg = player->GetBattleGround())
|
||||
if (Battleground *bg = player->GetBattleground())
|
||||
{
|
||||
bg->EventPlayerClickedOnFlag(player, gameObjTarget);
|
||||
return;
|
||||
@@ -3175,9 +3175,9 @@ void Spell::EffectOpenLock(uint32 effIndex)
|
||||
}
|
||||
else if (goInfo->type == GAMEOBJECT_TYPE_FLAGSTAND)
|
||||
{
|
||||
//CanUseBattleGroundObject() already called in CheckCast()
|
||||
//CanUseBattlegroundObject() already called in CheckCast()
|
||||
// in battleground check
|
||||
if (BattleGround *bg = player->GetBattleGround())
|
||||
if (Battleground *bg = player->GetBattleground())
|
||||
{
|
||||
if (bg->GetTypeID(true) == BATTLEGROUND_EY)
|
||||
bg->EventPlayerClickedOnFlag(player, gameObjTarget);
|
||||
@@ -4657,7 +4657,7 @@ void Spell::EffectSummonObjectWild(uint32 i)
|
||||
if (pGameObj->GetGoType() == GAMEOBJECT_TYPE_FLAGDROP && m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Player *pl = m_caster->ToPlayer();
|
||||
BattleGround* bg = pl->GetBattleGround();
|
||||
Battleground* bg = pl->GetBattleground();
|
||||
|
||||
switch(pGameObj->GetMapId())
|
||||
{
|
||||
@@ -4670,7 +4670,7 @@ void Spell::EffectSummonObjectWild(uint32 i)
|
||||
if (pl->GetTeam() == team)
|
||||
team = HORDE;
|
||||
|
||||
((BattleGroundWS*)bg)->SetDroppedFlagGUID(pGameObj->GetGUID(),team);
|
||||
((BattlegroundWS*)bg)->SetDroppedFlagGUID(pGameObj->GetGUID(),team);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -4678,7 +4678,7 @@ void Spell::EffectSummonObjectWild(uint32 i)
|
||||
{
|
||||
if (bg && bg->GetTypeID(true) == BATTLEGROUND_EY && bg->GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
((BattleGroundEY*)bg)->SetDroppedFlagGUID(pGameObj->GetGUID());
|
||||
((BattlegroundEY*)bg)->SetDroppedFlagGUID(pGameObj->GetGUID());
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -7123,7 +7123,7 @@ void Spell::EffectSkill(uint32 /*i*/)
|
||||
sLog.outDebug("WORLD: SkillEFFECT");
|
||||
}
|
||||
|
||||
/* There is currently no need for this effect. We handle it in BattleGround.cpp
|
||||
/* There is currently no need for this effect. We handle it in Battleground.cpp
|
||||
If we would handle the resurrection here, the spiritguide would instantly disappear as the
|
||||
player revives, and so we wouldn't see the spirit heal visual effect on the npc.
|
||||
This is why we use a half sec delay between the visual effect and the resurrection itself */
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "World.h"
|
||||
#include "Chat.h"
|
||||
#include "Spell.h"
|
||||
#include "BattleGroundMgr.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "MapManager.h"
|
||||
|
||||
@@ -2699,9 +2699,9 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
|
||||
{
|
||||
case 23333: // Warsong Flag
|
||||
case 23335: // Silverwing Flag
|
||||
return map_id == 489 && player && player->InBattleGround() ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
|
||||
return map_id == 489 && player && player->InBattleground() ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
|
||||
case 34976: // Netherstorm Flag
|
||||
return map_id == 566 && player && player->InBattleGround() ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
|
||||
return map_id == 566 && player && player->InBattleground() ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
|
||||
case 2584: // Waiting to Resurrect
|
||||
case 22011: // Spirit Heal Channel
|
||||
case 22012: // Spirit Heal
|
||||
@@ -2714,7 +2714,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
|
||||
if (!mapEntry)
|
||||
return SPELL_FAILED_INCORRECT_AREA;
|
||||
|
||||
return zone_id == 4197 || (mapEntry->IsBattleGround() && player && player->InBattleGround()) ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
|
||||
return zone_id == 4197 || (mapEntry->IsBattleground() && player && player->InBattleground()) ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
|
||||
}
|
||||
case 44521: // Preparation
|
||||
{
|
||||
@@ -2725,10 +2725,10 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
|
||||
if (!mapEntry)
|
||||
return SPELL_FAILED_INCORRECT_AREA;
|
||||
|
||||
if (!mapEntry->IsBattleGround())
|
||||
if (!mapEntry->IsBattleground())
|
||||
return SPELL_FAILED_REQUIRES_AREA;
|
||||
|
||||
BattleGround* bg = player->GetBattleGround();
|
||||
Battleground* bg = player->GetBattleground();
|
||||
return bg && bg->GetStatus() == STATUS_WAIT_JOIN ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
|
||||
}
|
||||
case 32724: // Gold Team (Alliance)
|
||||
@@ -2740,7 +2740,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
|
||||
if (!mapEntry)
|
||||
return SPELL_FAILED_INCORRECT_AREA;
|
||||
|
||||
return mapEntry->IsBattleArena() && player && player->InBattleGround() ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
|
||||
return mapEntry->IsBattleArena() && player && player->InBattleground() ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
|
||||
}
|
||||
case 32727: // Arena Preparation
|
||||
{
|
||||
@@ -2754,7 +2754,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
|
||||
if (!mapEntry->IsBattleArena())
|
||||
return SPELL_FAILED_REQUIRES_AREA;
|
||||
|
||||
BattleGround *bg = player->GetBattleGround();
|
||||
Battleground *bg = player->GetBattleground();
|
||||
return bg && bg->GetStatus() == STATUS_WAIT_JOIN ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user