SOTA update

-proper warning text (under attack, destroyed, capture..)
-proper icons on map for gate states
-fixed second round starting

--HG--
branch : trunk
This commit is contained in:
Rat
2010-06-01 23:55:09 +02:00
parent d53f91ff32
commit ad753b3f67
8 changed files with 258 additions and 63 deletions

View File

@@ -1598,6 +1598,7 @@ void GameObject::TakenDamage(uint32 damage, Unit *who)
if (HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED)) // from damaged to destroyed
{
uint8 hitType = BG_OBJECT_DMG_HIT_TYPE_HIGH_DAMAGED;
if (!m_goValue->building.health)
{
RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED);
@@ -1607,11 +1608,19 @@ void GameObject::TakenDamage(uint32 damage, Unit *who)
EventInform(m_goInfo->building.destroyedEvent);
if (pwho)
if (BattleGround* bg = pwho->GetBattleGround())
bg->EventPlayerDamagedGO(pwho, this, m_goInfo->building.destroyedEvent);
bg->DestroyGate(pwho, this, m_goInfo->building.destroyedEvent);
hitType = BG_OBJECT_DMG_HIT_TYPE_JUST_DESTROYED;
}
if (pwho)
if (BattleGround* bg = pwho->GetBattleGround())
bg->EventPlayerDamagedGO(pwho, this, hitType, m_goInfo->building.destroyedEvent);
}
else // from intact to damaged
{
uint8 hitType = BG_OBJECT_DMG_HIT_TYPE_JUST_DAMAGED;
if (m_goValue->building.health + damage < m_goInfo->building.intactNumHits + m_goInfo->building.damagedNumHits)
hitType = BG_OBJECT_DMG_HIT_TYPE_DAMAGED;
if (m_goValue->building.health <= m_goInfo->building.damagedNumHits)
{
if (!m_goInfo->building.destroyedDisplayId)
@@ -1622,7 +1631,11 @@ void GameObject::TakenDamage(uint32 damage, Unit *who)
SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED);
SetUInt32Value(GAMEOBJECT_DISPLAYID, m_goInfo->building.damagedDisplayId);
EventInform(m_goInfo->building.damagedEvent);
hitType = BG_OBJECT_DMG_HIT_TYPE_JUST_HIGH_DAMAGED;
}
if (pwho)
if (BattleGround* bg = pwho->GetBattleGround())
bg->EventPlayerDamagedGO(pwho, this, hitType, m_goInfo->building.destroyedEvent);
}
SetGoAnimProgress(m_goValue->building.health*255/(m_goInfo->building.intactNumHits + m_goInfo->building.damagedNumHits));
}