/// <summary> /// Periodically checks player positions around flags to debuff /// them when they approach warcamp entrances. /// </summary> private void CheckSpawnFarm() { foreach (Player player in _syncPlayersList) { BattlefrontFlag flag = (BattlefrontFlag)GetClosestFlag(player.WorldPosition, true); if (flag != null && flag.FlagState != ObjectiveFlags.ZoneLocked) { flag.AddPlayerInQuadrant(player); } // Check warcamp farm if (player.Zone != null) { Realms opposite = player.Realm == Realms.REALMS_REALM_DESTRUCTION ? Realms.REALMS_REALM_ORDER : Realms.REALMS_REALM_DESTRUCTION; Point3D warcampLoc = BattlefrontService.GetWarcampEntrance(player.Zone.ZoneId, opposite); if (warcampLoc != null) { float range = (float)player.GetDistanceTo(warcampLoc); if (range < WARCAMP_FARM_RANGE) { player.WarcampFarmScaler = range / WARCAMP_FARM_RANGE; } else { player.WarcampFarmScaler = 1f; } } } } }
// This is place in code where Campaign starts in a pairing - Hargrim public override void EnableSupplies() { if (!NoSupplies) { return; } if (HeldObjectives[0] + HeldObjectives[1] < 4) { Keep orderKeep = _Keeps.First(keep => keep.Realm == Realms.REALMS_REALM_ORDER && keep.Info.ZoneId == Zones[_battlefrontStatus.OpenZoneIndex].ZoneId); if (orderKeep == null) { Log.Error("ProgressingBattlefront", "Unable to find an Order keep?"); return; } Keep destroKeep = _Keeps.First(keep => keep.Realm == Realms.REALMS_REALM_DESTRUCTION && keep.Info.ZoneId == Zones[_battlefrontStatus.OpenZoneIndex].ZoneId); if (destroKeep == null) { Log.Error("ProgressingBattlefront", "Unable to find a Destruction keep?"); return; } while (HeldObjectives[0] < 2) { BattlefrontFlag flag = GetClosestNeutralFlagTo(orderKeep.WorldPosition); #if DEBUG flag.OpenObjective(Realms.REALMS_REALM_ORDER, 30 * 1000); #else flag.OpenObjective(Realms.REALMS_REALM_ORDER, (int)(8 * 60 * 1000 * TIMER_MODIFIER)); #endif } while (HeldObjectives[1] < 2) { BattlefrontFlag flag = GetClosestNeutralFlagTo(destroKeep.WorldPosition); #if DEBUG flag.OpenObjective(Realms.REALMS_REALM_DESTRUCTION, 30 * 1000); #else flag.OpenObjective(Realms.REALMS_REALM_DESTRUCTION, (int)(8 * 60 * 1000 * TIMER_MODIFIER)); #endif } } _NoSupplies = !_NoSupplies; foreach (var objective in _Objectives) { if (objective.FlagState == ObjectiveFlags.Open || objective.FlagState == ObjectiveFlags.Locked) { #if DEBUG objective.OpenObjective(objective._owningRealm, 2 * 60 * 1000); #else objective.OpenObjective(objective.OwningRealm, (int)(8 * 60 * 1000 * TIMER_MODIFIER)); #endif objective.StartSupplyRespawnTimer(SupplyEvent.ZoneActiveStatusChanged); } } string message = "The forces of Order and Destruction direct their supply lines towards " + Zones[_battlefrontStatus.OpenZoneIndex].Name + "!"; Log.Info("ProgressingBattlefront", message); lock (Player._Players) { foreach (Player player in Player._Players) { if (player.ValidInTier(Tier, true)) { player.SendClientMessage(message, player.Realm == Realms.REALMS_REALM_ORDER ? ChatLogFilters.CHATLOGFILTERS_C_ORDER_RVR_MESSAGE : ChatLogFilters.CHATLOGFILTERS_C_DESTRUCTION_RVR_MESSAGE); player.SendClientMessage(message, ChatLogFilters.CHATLOGFILTERS_RVR); } } } ActiveSupplyLine = 1; }