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
        public virtual void HolderDied()
        {
            if (Holder == null)
            {
                return;
            }

            WorldPosition.X = Holder.WorldPosition.X + 32;
            WorldPosition.Y = Holder.WorldPosition.Y;
            WorldPosition.Z = Holder.WorldPosition.Z;

            X = Holder.X + 32;
            Y = Holder.Y;
            Z = Holder.Z;

            SetOffset((ushort)(WorldPosition.X >> 12), (ushort)(WorldPosition.Y >> 12));

            // Automatically sets object visible
            SetHeldState(EHeldState.Ground);

            _evtInterface.AddEvent(ResetFromGround, GroundResetTime, 1);

            OnDropAction?.Invoke(this);

            Holder = null;
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="regionMgr"></param>
        /// <param name="objectives"></param>
        /// <param name="players"></param>
        public NewDawnBattlefront(RegionMgr regionMgr, List <BattlefrontObjective> objectives, HashSet <Player> players, IBattlefrontManager bfm)
        {
            this.Region = regionMgr;
            this.VictoryPointProgress  = new VictoryPointProgress();
            this.BattlefrontObjectives = objectives;
            this.PlayersInLakeSet      = players;
            this.Objectives            = new List <NewDawnBattlefieldObjective>();
            this.BattleFrontManager    = bfm;
            this.BattlefrontName       = bfm.GetActivePairing().PairingName;

            Tier = (byte)Region.GetTier();
            LoadObjectives();
            LoadKeeps();

            _contributionTracker = new ContributionTracker(Tier, regionMgr);
            _aaoTracker          = new AAOTracker();

            _EvtInterface.AddEvent(UpdateBattlefrontScalers, 12000, 0); // 120000
            _EvtInterface.AddEvent(UpdateVictoryPoints, 6000, 0);
            // Tell each player the RVR status
            _EvtInterface.AddEvent(UpdateRVRStatus, 60000, 0);
            // Recalculate AAO
            _EvtInterface.AddEvent(UpdateAAOBuffs, 60000, 0);
        }
        public void Start()
        {
            Logger.Info($"Starting Region Lock for Region : {Region.RegionId}");
            _EvtInterface.AddEvent(EndRegionLock, 90000, 1);
            RegionLocked = true;
            var playersToAnnounceTo = Player._Players.Where(x => !x.IsDisposed &&
                                                            x.IsInWorld() &&
                                                            x.ScnInterface.Scenario == null &&
                                                            x.Region.RegionId == this.Region.RegionId);

            foreach (var player in playersToAnnounceTo)
            {
                player.SendClientMessage($"{Region.RegionName} is in ruins, but it shall rise again!");
            }
        }
示例#5
0
        public Instance(ushort zoneid, ushort id, byte realm, Instance_Lockouts lockouts)
        {
            Lockout = lockouts;
            ID      = id;
            ZoneID  = zoneid;
            Realm   = realm;
            Region  = new RegionMgr(zoneid, ZoneService.GetZoneRegion(zoneid), "", new ApocCommunications());
            InstanceService._InstanceInfo.TryGetValue(zoneid, out Info);
            LoadBossSpawns();
            LoadSpawns(); // todo get the saved progress from group
            _running      = true;
            _evtInterface = new EventInterface();
            closetime     = (TCPManager.GetTimeStamp() + 7200);

            // instancing stuff
            InstanceService.SaveLockoutInstanceID(ZoneID + ":" + ID, Lockout);

            new Thread(Update).Start();

            Log.Success("Opening Instance", "Instance ID " + ID + "  Map: " + Info.Name);
            // TOVL
            if (zoneid == 179)
            {
                foreach (var p in GameObjectService.GameObjectSpawns.Where(e => e.Value.ZoneId == 179))
                {
                    if (p.Value.Entry == 98908)
                    {
                        GameObject go = new GameObject(p.Value);

                        _Objects.Add(go);
                        Region.AddObject(go, zoneid, true);
                    }
                }

                if (Info != null && Info.Objects.Count > 0)
                {
                    LoadObjects();
                }
                _evtInterface.AddEvent(UpdatePendulums, 7000, 0);
            }
        }
示例#6
0
 public ImpactMatrixManager()
 {
     ImpactMatrix = new ConcurrentDictionary <uint, List <PlayerImpact> >();
     _EvtInterface.AddEvent(DecayImpactMatrix, 60000, 0);
 }