mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
Merge branch 'master' into 303
Conflicts: src/game/CharacterHandler.cpp src/game/Chat.h src/game/Player.h src/game/World.h src/game/debugcmds.cpp
This commit is contained in:
commit
71b1065c8b
50 changed files with 3499 additions and 976 deletions
|
|
@ -606,25 +606,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
|
||||
|
|
@ -772,6 +753,19 @@ 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);
|
||||
if(BattleGround *bg = killed->GetBattleGround())
|
||||
if(player)
|
||||
bg->HandleKillPlayer(killed, player);
|
||||
//later we can add support for creature->player kills here i'm
|
||||
//not sure, but i guess those kills also get counted in av
|
||||
//else if(GetTypeId() == TYPEID_UNIT)
|
||||
// bg->HandleKillPlayer(killed,(Creature*)this);
|
||||
}
|
||||
}
|
||||
else // if (health <= damage)
|
||||
{
|
||||
|
|
@ -4182,6 +4176,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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue