596 | | // battleground things |
597 | | if(pVictim->GetTypeId() == TYPEID_PLAYER && (((Player*)pVictim)->InBattleGround())) |
598 | | { |
599 | | Player *killed = ((Player*)pVictim); |
600 | | Player *killer = NULL; |
601 | | if(GetTypeId() == TYPEID_PLAYER) |
602 | | killer = ((Player*)this); |
603 | | else if(GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet()) |
604 | | { |
605 | | Unit *owner = GetOwner(); |
606 | | if(owner && owner->GetTypeId() == TYPEID_PLAYER) |
607 | | killer = ((Player*)owner); |
608 | | } |
609 | | |
610 | | if(killer) |
611 | | if(BattleGround *bg = killed->GetBattleGround()) |
612 | | bg->HandleKillPlayer(killed, killer); // drop flags and etc |
613 | | } |
614 | | |
| 733 | } |
| 734 | |
| 735 | // battleground things (do this at the end, so the death state flag will be properly set to handle in the bg->handlekill) |
| 736 | if(pVictim->GetTypeId() == TYPEID_PLAYER && (((Player*)pVictim)->InBattleGround())) |
| 737 | { |
| 738 | Player *killed = ((Player*)pVictim); |
| 739 | Player *killer = NULL; |
| 740 | if(GetTypeId() == TYPEID_PLAYER) |
| 741 | killer = ((Player*)this); |
| 742 | else if(GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet()) |
| 743 | { |
| 744 | Unit *owner = GetOwner(); |
| 745 | if(owner && owner->GetTypeId() == TYPEID_PLAYER) |
| 746 | killer = ((Player*)owner); |
| 747 | } |
| 748 | |
| 749 | if(killer) |
| 750 | if(BattleGround *bg = killed->GetBattleGround()) |
| 751 | bg->HandleKillPlayer(killed, killer); // drop flags and etc |
| 4143 | } |
| 4144 | } |
| 4145 | |
| 4146 | void Unit::RemoveArenaAuras(bool onleave) |
| 4147 | { |
| 4148 | // in join, remove positive buffs, on end, remove negative |
| 4149 | // used to remove positive visible auras in arenas |
| 4150 | for(AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end();) |
| 4151 | { |
| 4152 | if ( !(iter->second->GetSpellProto()->AttributesEx4 & (1<<21)) // don't remove stances, shadowform, pally/hunter auras |
| 4153 | && !iter->second->IsPassive() // don't remove passive auras |
| 4154 | && (!(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) |
| 4155 | && (iter->second->IsPositive() ^ onleave)) // remove positive buffs on enter, negative buffs on leave |
| 4156 | RemoveAura(iter); |
| 4157 | else |
| 4158 | ++iter; |