void UpdateArea(uint newArea) { // FFA_PVP flags are area and not zone id dependent // so apply them accordingly m_areaUpdateId = newArea; AreaTableRecord area = CliDB.AreaTableStorage.LookupByKey(newArea); bool oldFFAPvPArea = pvpInfo.IsInFFAPvPArea; pvpInfo.IsInFFAPvPArea = area != null && area.Flags[0].HasAnyFlag(AreaFlags.Arena); UpdatePvPState(true); // check if we were in ffa arena and we left if (oldFFAPvPArea && !pvpInfo.IsInFFAPvPArea) { ValidateAttackersAndOwnTarget(); } PhasingHandler.OnAreaChange(this); UpdateAreaDependentAuras(newArea); if (IsAreaThatActivatesPvpTalents(newArea)) { EnablePvpRules(); } else { DisablePvpRules(); } // previously this was in UpdateZone (but after UpdateArea) so nothing will break pvpInfo.IsInNoPvPArea = false; if (area != null && area.IsSanctuary()) // in sanctuary { AddPvpFlag(UnitPVPStateFlags.Sanctuary); pvpInfo.IsInNoPvPArea = true; if (duel == null) { CombatStopWithPets(); } } else { RemovePvpFlag(UnitPVPStateFlags.Sanctuary); } AreaFlags areaRestFlag = (GetTeam() == Team.Alliance) ? AreaFlags.RestZoneAlliance : AreaFlags.RestZoneHorde; if (area != null && area.Flags[0].HasAnyFlag(areaRestFlag)) { _restMgr.SetRestFlag(RestFlag.FactionArea); } else { _restMgr.RemoveRestFlag(RestFlag.FactionArea); } UpdateCriteria(CriteriaTypes.TravelledToArea, newArea); }
void UpdateArea(uint newArea) { // FFA_PVP flags are area and not zone id dependent // so apply them accordingly m_areaUpdateId = newArea; AreaTableRecord area = CliDB.AreaTableStorage.LookupByKey(newArea); pvpInfo.IsInFFAPvPArea = area != null && area.Flags[0].HasAnyFlag(AreaFlags.Arena); UpdatePvPState(true); UpdateAreaDependentAuras(newArea); PhasingHandler.OnAreaChange(this); if (IsAreaThatActivatesPvpTalents(newArea)) { EnablePvpRules(); } else { DisablePvpRules(); } // previously this was in UpdateZone (but after UpdateArea) so nothing will break pvpInfo.IsInNoPvPArea = false; if (area != null && area.IsSanctuary()) // in sanctuary { SetByteFlag(UnitFields.Bytes2, UnitBytes2Offsets.PvpFlag, UnitBytes2Flags.Sanctuary); pvpInfo.IsInNoPvPArea = true; if (duel == null) { CombatStopWithPets(); } } else { RemoveByteFlag(UnitFields.Bytes2, UnitBytes2Offsets.PvpFlag, UnitBytes2Flags.Sanctuary); } AreaFlags areaRestFlag = (GetTeam() == Team.Alliance) ? AreaFlags.RestZoneAlliance : AreaFlags.RestZoneHorde; if (area != null && area.Flags[0].HasAnyFlag(areaRestFlag)) { _restMgr.SetRestFlag(RestFlag.FactionArea); } else { _restMgr.RemoveRestFlag(RestFlag.FactionArea); } }