[7426] Mounted players now can capture tower point in Eye of Storm. Author: Triply
Renamed function isAllowUseBattleGroundObject to CanUseBattleGroundObject --HG-- branch : trunk
This commit is contained in:
@@ -156,7 +156,7 @@ void BattleGroundEY::CheckSomeoneJoinedPoint()
|
||||
++j;
|
||||
continue;
|
||||
}
|
||||
if (plr->isAllowUseBattleGroundObject() && plr->IsWithinDistInMap(obj, BG_EY_POINT_RADIUS))
|
||||
if (plr->CanCaptureTowerPoint() && plr->IsWithinDistInMap(obj, BG_EY_POINT_RADIUS))
|
||||
{
|
||||
//player joined point!
|
||||
//show progress bar
|
||||
@@ -199,7 +199,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint()
|
||||
++j;
|
||||
continue;
|
||||
}
|
||||
if (!plr->isAllowUseBattleGroundObject() || !plr->IsWithinDistInMap(obj, BG_EY_POINT_RADIUS))
|
||||
if (!plr->CanCaptureTowerPoint() || !plr->IsWithinDistInMap(obj, BG_EY_POINT_RADIUS))
|
||||
//move player out of point (add him to players that are out of points
|
||||
{
|
||||
m_PlayersNearPoint[EY_POINTS_MAX].push_back(m_PlayersNearPoint[i][j]);
|
||||
|
||||
@@ -1252,7 +1252,7 @@ void GameObject::Use(Unit* user)
|
||||
|
||||
Player* player = (Player*)user;
|
||||
|
||||
if( player->isAllowUseBattleGroundObject() )
|
||||
if( player->CanUseBattleGroundObject() )
|
||||
{
|
||||
// in battleground check
|
||||
BattleGround *bg = player->GetBattleGround();
|
||||
@@ -1277,7 +1277,7 @@ void GameObject::Use(Unit* user)
|
||||
|
||||
Player* player = (Player*)user;
|
||||
|
||||
if( player->isAllowUseBattleGroundObject() )
|
||||
if( player->CanUseBattleGroundObject() )
|
||||
{
|
||||
// in battleground check
|
||||
BattleGround *bg = player->GetBattleGround();
|
||||
|
||||
+11
-3
@@ -20104,14 +20104,22 @@ void Player::SetFarsightTarget(WorldObject* obj)
|
||||
SetFarSightGUID(obj->GetGUID());
|
||||
}
|
||||
|
||||
bool Player::isAllowUseBattleGroundObject()
|
||||
bool Player::CanUseBattleGroundObject()
|
||||
{
|
||||
return ( //InBattleGround() && // in battleground - not need, check in other cases
|
||||
!IsMounted() && // not mounted
|
||||
!isTotalImmunity() && // not totally immuned
|
||||
//!IsMounted() && - not correct, player is dismounted when he clicks on flag
|
||||
!HasStealthAura() && // not stealthed
|
||||
!HasInvisibilityAura() && // not invisible
|
||||
!HasAura(SPELL_RECENTLY_DROPPED_FLAG, 0) && // can't pickup
|
||||
//TODO player cannot use object when he is invulnerable (immune) - (ice block, divine shield, divine protection, divine intervention ...)
|
||||
isAlive() // live player
|
||||
);
|
||||
}
|
||||
|
||||
bool Player::CanCaptureTowerPoint()
|
||||
{
|
||||
return ( !HasStealthAura() && // not stealthed
|
||||
!HasInvisibilityAura() && // not invisible
|
||||
isAlive() // live player
|
||||
);
|
||||
}
|
||||
|
||||
+2
-1
@@ -1984,8 +1984,9 @@ class TRINITY_DLL_SPEC Player : public Unit
|
||||
void ClearAfkReports() { m_bgAfkReporter.clear(); }
|
||||
|
||||
bool GetBGAccessByLevel(BattleGroundTypeId bgTypeId) const;
|
||||
bool isAllowUseBattleGroundObject();
|
||||
bool isTotalImmunity();
|
||||
bool CanUseBattleGroundObject();
|
||||
bool CanCaptureTowerPoint();
|
||||
|
||||
/*********************************************************/
|
||||
/*** OUTDOOR PVP SYSTEM ***/
|
||||
|
||||
+1
-1
@@ -4070,7 +4070,7 @@ uint8 Spell::CanCast(bool strict)
|
||||
|
||||
// In BattleGround players can use only flags and banners
|
||||
if( ((Player*)m_caster)->InBattleGround() &&
|
||||
!((Player*)m_caster)->isAllowUseBattleGroundObject() )
|
||||
!((Player*)m_caster)->CanUseBattleGroundObject() )
|
||||
return SPELL_FAILED_TRY_AGAIN;
|
||||
|
||||
// get the lock entry
|
||||
|
||||
@@ -3135,7 +3135,7 @@ void Spell::EffectOpenLock(uint32 /*i*/)
|
||||
if( goInfo->type == GAMEOBJECT_TYPE_BUTTON && goInfo->button.noDamageImmune ||
|
||||
goInfo->type == GAMEOBJECT_TYPE_GOOBER && goInfo->goober.losOK )
|
||||
{
|
||||
//isAllowUseBattleGroundObject() already called in CanCast()
|
||||
//CanUseBattleGroundObject() already called in CanCast()
|
||||
// in battleground check
|
||||
if(BattleGround *bg = player->GetBattleGround())
|
||||
{
|
||||
@@ -3147,7 +3147,7 @@ void Spell::EffectOpenLock(uint32 /*i*/)
|
||||
}
|
||||
else if (goInfo->type == GAMEOBJECT_TYPE_FLAGSTAND)
|
||||
{
|
||||
//isAllowUseBattleGroundObject() already called in CanCast()
|
||||
//CanUseBattleGroundObject() already called in CanCast()
|
||||
// in battleground check
|
||||
if(BattleGround *bg = player->GetBattleGround())
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7425"
|
||||
#define REVISION_NR "7426"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
||||
Reference in New Issue
Block a user