mirror of
https://github.com/mangosfour/server.git
synced 2025-12-20 16:37:04 +00:00
[11557] Duel related fixes
* Implement duel allowed check base at proper area flag AREA_FLAG_DUEL (0x00000040) This allow duels for example in capital area 4570 and allow/fogbid correctly some other zones and areas. * Implement duel cancel at leave duel allowed area * Fixed code for duels work in sunctuary if area allow duels.
This commit is contained in:
parent
7205023415
commit
4a087e6bda
8 changed files with 89 additions and 63 deletions
|
|
@ -640,14 +640,13 @@ void Spell::FillTargetMap()
|
|||
break;
|
||||
}
|
||||
|
||||
if(m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Player *me = (Player*)m_caster;
|
||||
for (UnitList::const_iterator itr = tmpUnitMap.begin(); itr != tmpUnitMap.end(); ++itr)
|
||||
{
|
||||
Unit *owner = (*itr)->GetOwner();
|
||||
Unit *u = owner ? owner : (*itr);
|
||||
if(u!=m_caster && u->IsPvP() && (!me->duel || me->duel->opponent != u))
|
||||
Player *targetOwner = (*itr)->GetCharmerOrOwnerPlayerOrPlayerItself();
|
||||
if (targetOwner && targetOwner != me && targetOwner->IsPvP() && !me->IsInDuelWith(targetOwner))
|
||||
{
|
||||
me->UpdatePvP(true);
|
||||
me->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue