Phasing
This commit is contained in:
commit
251cce9685
5 files changed
+25
-12
No files matched your search
@@ -688,9 +688,9 @@ struct AreaTriggerEntry
|
||||
float x; // 2 m_x
|
||||
float y; // 3 m_y
|
||||
float z; // 4 m_z
|
||||
//uint32 // 5
|
||||
//uint32 // 6
|
||||
//uint32 // 7
|
||||
uint32 PhaseUseFlags; // 5 PhaseUseFlags
|
||||
uint32 PhaseID; // 6 PhaseID
|
||||
uint32 PhaseGroupID; // 7 PhaseGroupID
|
||||
float radius; // 8 m_radius
|
||||
float box_x; // 9 m_box_length
|
||||
float box_y; // 10 m_box_width
|
||||
|
||||
@@ -30,7 +30,7 @@ char const AchievementCriteriafmt[] = "niiiliiiisiiiiixxiiiiii";
|
||||
char const AreaTableEntryfmt[] = "niiiixxxxxisiiiiiffiixxxxx";
|
||||
char const AreaGroupEntryfmt[] = "niiiiiii";
|
||||
char const AreaPOIEntryfmt[] = "niiiiiiiiiiiffixixxixx";
|
||||
char const AreaTriggerEntryfmt[] = "nifffxxxfffff";
|
||||
char const AreaTriggerEntryfmt[] = "nifffiiifffff";
|
||||
char const ArmorLocationfmt[] = "nfffff";
|
||||
char const AuctionHouseEntryfmt[] = "niiix";
|
||||
char const BankBagSlotPricesEntryfmt[] = "ni";
|
||||
|
||||
@@ -2584,9 +2584,16 @@ void Player::SetInWater(bool apply)
|
||||
|
||||
bool Player::IsInAreaTriggerRadius(const AreaTriggerEntry* trigger) const
|
||||
{
|
||||
if (!trigger || GetMapId() != trigger->mapid)
|
||||
if (!trigger)
|
||||
return false;
|
||||
|
||||
if (int32(GetMapId()) != trigger->mapid && !GetPhaseShift().HasVisibleMapId(trigger->mapid))
|
||||
return false;
|
||||
|
||||
if (trigger->PhaseID || trigger->PhaseGroupID || trigger->PhaseUseFlags)
|
||||
if (!PhasingHandler::InDbPhaseShift(this, trigger->PhaseUseFlags, trigger->PhaseID, trigger->PhaseGroupID))
|
||||
return false;
|
||||
|
||||
if (trigger->radius > 0.f)
|
||||
{
|
||||
// if we have radius check it
|
||||
|
||||
@@ -3924,7 +3924,7 @@ void Unit::RemoveNotOwnSingleTargetAuras(bool onPhaseChange /*= false*/)
|
||||
for (AuraList::iterator iter = scAuras.begin(); iter != scAuras.end();)
|
||||
{
|
||||
Aura* aura = *iter;
|
||||
if (aura->GetUnitOwner() != this && !aura->GetUnitOwner()->IsInPhase(this))
|
||||
if (aura->GetUnitOwner() != this && (!onPhaseChange || !aura->GetUnitOwner()->IsInPhase(this)))
|
||||
{
|
||||
aura->Remove();
|
||||
iter = scAuras.begin();
|
||||
|
||||
@@ -1704,15 +1704,17 @@ void AuraEffect::HandlePhase(AuraApplication const* aurApp, uint8 mode, bool app
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
PhasingHandler::AddPhase(target, uint32(GetMiscValueB()), true);
|
||||
|
||||
// call functions which may have additional effects after chainging state of unit
|
||||
// phase auras normally not expected at BG but anyway better check
|
||||
if (apply)
|
||||
{
|
||||
PhasingHandler::AddPhase(target, uint32(GetMiscValueB()), true);
|
||||
|
||||
// call functions which may have additional effects after chainging state of unit
|
||||
// phase auras normally not expected at BG but anyway better check
|
||||
// drop flag at invisibiliy in bg
|
||||
target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION);
|
||||
}
|
||||
else
|
||||
PhasingHandler::RemovePhase(target, uint32(GetMiscValueB()), true);
|
||||
}
|
||||
|
||||
void AuraEffect::HandlePhaseGroup(AuraApplication const* aurApp, uint8 mode, bool apply) const
|
||||
@@ -1724,13 +1726,17 @@ void AuraEffect::HandlePhaseGroup(AuraApplication const* aurApp, uint8 mode, boo
|
||||
|
||||
PhasingHandler::AddPhaseGroup(target, uint32(GetMiscValueB()), true);
|
||||
|
||||
// call functions which may have additional effects after chainging state of unit
|
||||
// phase auras normally not expected at BG but anyway better check
|
||||
if (apply)
|
||||
{
|
||||
PhasingHandler::AddPhaseGroup(target, uint32(GetMiscValueB()), true);
|
||||
|
||||
// call functions which may have additional effects after chainging state of unit
|
||||
// phase auras normally not expected at BG but anyway better check
|
||||
// drop flag at invisibiliy in bg
|
||||
target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION);
|
||||
}
|
||||
else
|
||||
PhasingHandler::RemovePhaseGroup(target, uint32(GetMiscValueB()), true);
|
||||
}
|
||||
|
||||
/**********************/
|
||||
|
||||
Reference in new issue
Block a user