[svn] -enabled instantiated battlegrounds

-enabled arena matches
-rewritten battleground queuing to support joining as group
-removed queue announcements

--HG--
branch : trunk
This commit is contained in:
w12x committed 2008-10-05 08:48:32 -05:00
1 parent 8b3fcc37c6
commit 6f0c3469a6
40 files changed
+3258 -744

No files matched your search

+35 -19
View File
@@ -593,25 +593,6 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
((Creature*)pVictim)->SetLootRecipient(this);
if (health <= damage)
{
// battleground things
if(pVictim->GetTypeId() == TYPEID_PLAYER && (((Player*)pVictim)->InBattleGround()))
{
Player *killed = ((Player*)pVictim);
Player *killer = NULL;
if(GetTypeId() == TYPEID_PLAYER)
killer = ((Player*)this);
else if(GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet())
{
Unit *owner = GetOwner();
if(owner && owner->GetTypeId() == TYPEID_PLAYER)
killer = ((Player*)owner);
}
if(killer)
if(BattleGround *bg = killed->GetBattleGround())
bg->HandleKillPlayer(killed, killer); // drop flags and etc
}
DEBUG_LOG("DealDamage: victim just died");
// find player: owner of controlled `this` or `this` itself maybe
@@ -750,6 +731,25 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
he->DuelComplete(DUEL_INTERUPTED);
}
// battleground things (do this at the end, so the death state flag will be properly set to handle in the bg->handlekill)
if(pVictim->GetTypeId() == TYPEID_PLAYER && (((Player*)pVictim)->InBattleGround()))
{
Player *killed = ((Player*)pVictim);
Player *killer = NULL;
if(GetTypeId() == TYPEID_PLAYER)
killer = ((Player*)this);
else if(GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet())
{
Unit *owner = GetOwner();
if(owner && owner->GetTypeId() == TYPEID_PLAYER)
killer = ((Player*)owner);
}
if(killer)
if(BattleGround *bg = killed->GetBattleGround())
bg->HandleKillPlayer(killed, killer); // drop flags and etc
}
}
else // if (health <= damage)
{
@@ -4143,6 +4143,22 @@ void Unit::RemoveAllAuras()
}
}
void Unit::RemoveArenaAuras(bool onleave)
{
// in join, remove positive buffs, on end, remove negative
// used to remove positive visible auras in arenas
for(AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end();)
{
if ( !(iter->second->GetSpellProto()->AttributesEx4 & (1<<21)) // don't remove stances, shadowform, pally/hunter auras
&& !iter->second->IsPassive() // don't remove passive auras
&& (!(iter->second->GetSpellProto()->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) || !(iter->second->GetSpellProto()->Attributes & SPELL_ATTR_UNK8)) // not unaffected by invulnerability auras or not having that unknown flag (that seemed the most probable)
&& (iter->second->IsPositive() ^ onleave)) // remove positive buffs on enter, negative buffs on leave
RemoveAura(iter);
else
++iter;
}
}
void Unit::RemoveAllAurasOnDeath()
{
// used just after dieing to remove all visible auras