コード例 #1
0
        public RoRBattlefront(RegionMgr region, bool oRvRFront)
        {
            Region           = region;
            Region.Bttlfront = this;

            Tier = (byte)Region.GetTier();

            // TODO - this is a nasty piece of work by previous devs. Replace with something more suitable.
            if (Tier == 2)
            {
                Tier = 3;
            }

            if (oRvRFront && Tier > 0)
            {
                BattlefrontList.AddBattlefront(this, Tier);
            }

            Zones = Region.ZonesInfo;

            if (oRvRFront)
            {
                LoadObjectives();
                LoadKeeps();

                _aaoTracker          = new AAOTracker();
                _rationTracker       = new RationTracker(region);
                _contributionTracker = new ContributionTracker(Tier, region);

                _EvtInterface.AddEvent(RecalculateAAO, 10000, 0);                  // 20000
                _EvtInterface.AddEvent(BattlePopulationDistributionData, 6000, 0); // 60000
                _EvtInterface.AddEvent(UpdateBattlefrontScalers, 12000, 0);        // 120000
            }
        }
コード例 #2
0
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="objective"></param>
        /// <param name="tier"></param>
        public GuildClaimObjective(RegionMgr region, BattleFront_Objective objective)
        {
            Id       = objective.Entry;
            Name     = objective.Name;
            ZoneId   = objective.ZoneId;
            RegionId = objective.RegionId;
            Tier     = (byte)region.GetTier();
            State    = StateFlags.Unsecure;

            _x            = (uint)objective.X;
            _y            = (uint)objective.Y;
            _z            = (ushort)objective.Z;
            _o            = (ushort)objective.O;
            _tokdiscovery = objective.TokDiscovered;
            _tokunlocked  = objective.TokUnlocked;

            Heading         = _o;
            WorldPosition.X = (int)_x;
            WorldPosition.Y = (int)_y;
            WorldPosition.Z = _z;

            CommsEngine      = new ApocCommunications();
            _captureProgress = 20000;
            CaptureDuration  = 10;
            // TODO : Can add a default buff here.
            BuffId = 14121;  // King of the hill
        }
        /// <summary>(Re)loads portals data.</summary>
        internal bool Load()
        {
            ushort _zoneId     = _objective.ZoneId;
            int    objectiveId = _objective.ID;

            _objectivePortalData = BattlefrontService.GetPortalToWarcamp(_zoneId, objectiveId);
            _orderPortalData     = GetPortalToObjective(Realms.REALMS_REALM_ORDER);
            _destroPortalData    = GetPortalToObjective(Realms.REALMS_REALM_DESTRUCTION);

            if (_objectivePortalData != null && _orderPortalData != null && _destroPortalData != null)
            {
                return(true);
            }
#if DEBUG
            if (_region.GetTier() < 5)
            {
                List <string> missingInfo = new List <string>();
                if (_objectivePortalData == null)
                {
                    missingInfo.Add("objective portal");
                }
                if (_orderPortalData == null)
                {
                    missingInfo.Add("order portal");
                }
                if (_destroPortalData == null)
                {
                    missingInfo.Add("destro portal");
                }
                Log.Error("ObjectivePortalsMgr", $"Missing portal data for objective {_objective.Name} ({_objective.ID}) : " + string.Join(", ", missingInfo));
                BattlefrontService.LoadBattlefrontObjects();
            }
#endif


            return(false);
        }
コード例 #4
0
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="objective"></param>
        /// <param name="tier"></param>
        public BattlefieldObjective(RegionMgr region, BattleFront_Objective objective)
        {
            Id       = objective.Entry;
            Name     = objective.Name;
            ZoneId   = objective.ZoneId;
            RegionId = objective.RegionId;
            Tier     = (byte)region.GetTier();
            State    = StateFlags.Unsecure;

            _x            = (uint)objective.X;
            _y            = (uint)objective.Y;
            _z            = (ushort)objective.Z;
            _o            = (ushort)objective.O;
            _tokdiscovery = objective.TokDiscovered;
            _tokunlocked  = objective.TokUnlocked;

            Heading         = _o;
            WorldPosition.X = (int)_x;
            WorldPosition.Y = (int)_y;
            WorldPosition.Z = _z;

            CommsEngine   = new ApocCommunications();
            RewardManager = new RVRRewardManager();
            fsm           = new CampaignObjectiveStateMachine(this).fsm;
            fsm.Initialize(CampaignObjectiveStateMachine.ProcessState.Neutral);
            if (objective.Guards != null)
            {
                foreach (BattleFront_Guard Guard in objective.Guards)
                {
                    Guards.Add(new FlagGuard(this, region, objective.ZoneId, Guard.OrderId, Guard.DestroId, Guard.X, Guard.Y, Guard.Z, Guard.O));
                }
            }
            _captureProgress = 20000;
            CaptureDuration  = 10;
            EvtInterface.AddEvent(CheckTimers, 1000, 0);
            BuffId = 0;
        }