Ejemplo n.º 1
0
        public override bool SetPosition(ushort PinX, ushort PinY, ushort PinZ, ushort Head, bool SendState = false)
        {
            if (_Client.State != (int)eClientState.Playing)
            {
                _Client.State = (int)eClientState.Playing;
                AddPlayer(this);
                EvtInterface.Notify(EventName.PLAYING, this, null);
            }

            bool Updated = base.SetPosition(PinX, PinY, PinZ, Head);

            _Value.WorldX = WorldPosition.X;
            _Value.WorldY = WorldPosition.Y;
            _Value.WorldZ = WorldPosition.Z;
            _Value.WorldO = Head;

            return(Updated);
        }
 private void BombDroppedOff(Player plr, Part part)
 {
     if (plr == null)
     {
         Log.Error("BombDroppedOff", "NULL player");
         return;
     }
     if (_bomb == null)
     {
         Log.Error("BombDroppedOff", "NULL bomb");
         return;
     }
     GivePoints((_carrier.Realm == Realms.REALMS_REALM_ORDER ? 1 : 2), 75);
     _carrier.CanMount = true;
     RemoveBombBuff(_carrier);
     EvtInterface.AddEvent(DetonateStockpile, RandomMgr.Next(3000, 5000), 1);
     Broadcast(new[] { plr.GenderedName, (plr.Realm == Realms.REALMS_REALM_ORDER ? "Order" : "Destruction"), _bomb.Name }, ChatLogFilters.CHATLOGFILTERS_C_WHITE, Localized_text.TEXT_BOMB_CAPTURE);
 }
        private void BombPickedUp(Player plr, Part part)
        {
            RemoveBombFromWorld();

            _carrier = plr;
            EvtInterface.RemoveEvent(CarrierBombTimer);
            EvtInterface.AddEvent(CarrierBombTimer, RandomMgr.Next(50000, 80000), 1);

            if (_carrier.Realm == Realms.REALMS_REALM_DESTRUCTION)
            {
                _centerGlow.VfxState = 2;
            }
            else
            {
                _centerGlow.VfxState = 1;
            }

            Broadcast(new[] { plr.GenderedName, (plr.Realm == Realms.REALMS_REALM_ORDER ? "Order" : "Destruction"), _bomb.Name }, ChatLogFilters.CHATLOGFILTERS_C_WHITE, Localized_text.TEXT_FLAG_CAPTURE);
        }
Ejemplo n.º 4
0
        public void End()
        {
            //Log.Success("PQuest", "End");// added mite not work

            if (ended)
            {
                return;
            }

            EvtInterface.AddEvent(Reset, TIME_PQ_RESET * 1000, 1);
            started = false;
            ended   = true;

            foreach (Player Plr in Players)
            {
                Plr.SendLocalizeString(Info.Name + " Complete", GameData.Localized_text.CHAT_TAG_MONSTER_EMOTE);
                SendReinitTime(Plr, TIME_PQ_RESET);
            }
        }
Ejemplo n.º 5
0
        public override void OnStart()
        {
            EvtInterface.AddEvent(ActivateFlag, 30000, 1);

            foreach (Object obj in Region.Objects)
            {
                Creature crea = obj as Creature;

                if (crea == null)
                {
                    continue;
                }

                if (crea.Name == "Stone Troll")
                {
                    crea.IsInvulnerable = true;
                }
            }
        }
        protected override void SetDeath(Unit killer)
        {
            base.SetDeath(killer);

            Pet    pet      = killer as Pet;
            Player credited = (pet != null) ? pet.Owner : (killer as Player);

            if (credited != null)
            {
                HandleXPRenown(credited);
            }

            SiegeInterface.RemoveAllPlayers();

            Health = 0;

            States.Add((byte)CreatureState.Dead); // Death State

            PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECT_DEATH, 12);

            Out.WriteUInt16(Oid);
            Out.WriteByte(1);
            Out.WriteByte(0);
            Out.WriteUInt16(killer.IsPet() ? killer.GetPet().Owner.Oid : killer.Oid);
            Out.Fill(0, 6);
            DispatchPacket(Out, true);

            switch (_type)
            {
            case SiegeType.OIL:
                EvtInterface.AddEvent(Destroy, 180000, 1);     // Oil is replacable after 180 seconds
                break;

            case SiegeType.GTAOE:
            case SiegeType.SNIPER:
                EvtInterface.AddEvent(Destroy, 30000, 1);
                break;

            case SiegeType.RAM:
                EvtInterface.AddEvent(Destroy, 30000, 1);
                break;
            }
        }
Ejemplo n.º 7
0
        public void Failed()
        {
            EvtInterface.RemoveEvent(Failed);
            EvtInterface.AddEvent(Reset, TIME_PQ_RESET * 1000, 1);
            _started = false;
            _ended   = true;
            Stage.Cleanup();

            foreach (uint Plr in ActivePlayers)
            {
                Player targPlayer = Player.GetPlayer(Plr);
                if (targPlayer != null)
                {
                    targPlayer.SendLocalizeString(Info.Name + " Failed", ChatLogFilters.CHATLOGFILTERS_SAY, GameData.Localized_text.CHAT_TAG_MONSTER_EMOTE);
                    SendCurrentStage(targPlayer);
                    // SendReinitTime(Plr, TIME_PQ_RESET);
                }
            }
        }
Ejemplo n.º 8
0
Archivo: Player.cs Proyecto: uvbs/DoR
        public void RespawnPlayer()
        {
            if (!GetPlayer().IsDead)
            {
                return;
            }

            EvtInterface.RemoveEvent(AutomaticRespawnPlayer);
            EvtInterface.RemoveEvent(RespawnPlayer);

            Zone_Respawn Respawn = WorldMgr.GetZoneRespawn(Zone.ZoneId, (byte)Realm, this);

            if (Respawn != null)
            {
                SafePinTeleport(Respawn.PinX, Respawn.PinY, Respawn.PinZ, Respawn.WorldO);
            }

            RezUnit();
        }
Ejemplo n.º 9
0
            public KeepGameObject(GameObject_spawn spawn, KeepDoor keepDoor, BattleFrontKeep keep)
            {
                _keep     = keep;
                Spawn     = spawn;
                Name      = spawn.Proto.Name;
                _keepDoor = keepDoor;


                if (keepDoor.Info.Number == (int)KeepDoorType.InnerMain || keepDoor.Info.Number == (int)KeepDoorType.OuterMain)
                {
                    Realm = keep.Realm;
                    Spawn.Proto.HealthPoints = 4 * 500000;
                    Health = Spawn.Proto.HealthPoints;
                }

                _enterExitPoints[0] = new Point3D(_keepDoor.Info.TeleportX1, _keepDoor.Info.TeleportY1, _keepDoor.Info.TeleportZ1);
                _enterExitPoints[1] = new Point3D(_keepDoor.Info.TeleportX2, _keepDoor.Info.TeleportY2, _keepDoor.Info.TeleportZ2);

                EvtInterface.AddEventNotify(EventName.OnReceiveDamage, OnReceiveDamage);
            }
Ejemplo n.º 10
0
Archivo: Player.cs Proyecto: uvbs/DoR
        public Player(GameClient Client, Character Info) : base()
        {
            _Client = Client;
            _Info   = Info;
            _Value  = Info.Value;

            Name  = Info.Name;
            Realm = (GameData.Realms)Info.Realm;
            SetPVPFlag(false);

            EvtInterface = AddInterface(EventInterface.GetEventInterface((uint)_Info.CharacterId)) as EventInterface;
            SocInterface = AddInterface <SocialInterface>();
            TokInterface = AddInterface <TokInterface>();
            MlInterface  = AddInterface <MailInterface>();

            EvtInterface.AddEventNotify(EventName.ON_MOVE, CancelQuit);
            EvtInterface.AddEventNotify(EventName.ON_RECEIVE_DAMAGE, CancelQuit);
            EvtInterface.AddEventNotify(EventName.ON_DEAL_DAMAGE, CancelQuit);
            EvtInterface.AddEventNotify(EventName.ON_START_CASTING, CancelQuit);
        }
Ejemplo n.º 11
0
        public LootChest(GameObject_spawn spawn)
        {
            Spawn = spawn;
            if (!string.IsNullOrEmpty(Spawn.AlternativeName))
            {
                Name = Spawn.AlternativeName;
            }
            else
            {
                Name = spawn.Proto.Name;
            }
            VfxState = (byte)spawn.VfxState;

            this.Y = spawn.WorldY;
            this.Z = spawn.WorldZ;
            this.X = spawn.WorldX;


            EvtInterface.AddEvent(Destroy, 180 * 1000, 1);
        }
Ejemplo n.º 12
0
        public override void Dispose()
        {
            RemovePlayer(this);

            SendLeave();
            StopQuit();

            EvtInterface.Notify("Leave", this, null);
            SocInterface.Stop();

            Save();

            if (_Client != null)
            {
                _Client.Plr = null;
                _Client.Disconnect();
            }

            base.Dispose();
        }
        private void SpawnAdds()
        {
            try
            {
                // first check if boss health is under 20%
                if (Health > MaxHealth * 0.2)
                {
                    return;
                }

                SpawnAdds(_AddSpawns);

                EvtInterface.RemoveEvent(SpawnAdds);
            }
            catch (Exception ex)
            {
                _logger.Error(ex.Message + "\r\n" + ex.StackTrace);
                EvtInterface.RemoveEvent(SpawnAdds);
                return;
            }
        }
Ejemplo n.º 14
0
        public override void SetDeath(Unit Killer)
        {
            UInt16 Time = 600; // Time to AutoResurrect in Seconds. 10 Minutes in Official Servers

            Killer.QtsInterface.HandleEvent(Objective_Type.QUEST_KILL_PLAYERS, 0, 1);

            base.SetDeath(Killer);

            if (Killer.IsPlayer())
            {
                WorldMgr.GenerateRenown(Killer.GetPlayer(), this);
            }

            PacketOut Out = new PacketOut((byte)Opcodes.F_PLAYER_DEATH);

            Out.WriteUInt16(Oid);
            Out.WriteUInt16(Time);
            SendPacket(Out);

            EvtInterface.AddEvent(AutomaticRespawnPlayer, Time * 1000, 1); // If the player don't resurrect. autoresurrect in 10 Minutes.
        }
        public void OnCapture(CapturePoint captured)
        {
            if (_capturePoints[0].OwningRealm == _capturePoints[1].OwningRealm && _capturePoints[0].OwningRealm != Realms.REALMS_REALM_NEUTRAL)
            {
                foreach (Object obj in Region.Objects)
                {
                    Player plr = obj as Player;
                    plr?.SendLocalizeString((_capturePoints[0].OwningRealm == Realms.REALMS_REALM_ORDER ? "Order" : "Destruction") + " will lock down both control points in 15 seconds!", ChatLogFilters.CHATLOGFILTERS_C_WHITE, Localized_text.CHAT_TAG_DEFAULT);
                }

                _capturePoints[0].CountdownTimerEnd = TCPManager.GetTimeStamp() + 15;
                _capturePoints[1].CountdownTimerEnd = TCPManager.GetTimeStamp() + 15;

                EvtInterface.AddEvent(Lockdown, 15000, 1);
                _pendingLockdown = true;
            }

            else
            {
                if (!_pendingLockdown)
                {
                    return;
                }
                EvtInterface.RemoveEvent(Lockdown);

                _capturePoints[0].CountdownTimerEnd = 0;
                _capturePoints[1].CountdownTimerEnd = 0;

                if (captured == _capturePoints[0])
                {
                    _capturePoints[1].BroadcastObjectiveInfo();
                }
                else
                {
                    _capturePoints[0].BroadcastObjectiveInfo();
                }

                _pendingLockdown = false;
            }
        }
Ejemplo n.º 16
0
        public Pet(ushort petId, Creature_spawn spawn, Player owner, byte aiMode, bool isStationary, bool isCombative) : base(spawn)
        {
            PetId        = petId;
            Owner        = owner;
            IsStationary = isStationary;
            if (!isStationary)
            {
                FollowMode = 2;
            }
            AIMode         = aiMode;
            _ownerUILinked = isCombative;

            if (!isCombative)
            {
                IsInvulnerable = true;
            }

            else
            {
                SpeedMult = 1.2f;
            }

            switch (aiMode)
            {
            case 3: AiInterface.SetBrain(new PassiveBrain(this)); break;

            case 4: AiInterface.SetBrain(new GuardBrain(this)); break;

            case 5: AiInterface.SetBrain(new AggressiveBrain(this)); break;
            }
            Realm   = owner.Realm;
            Faction = (byte)(owner.Realm == Realms.REALMS_REALM_DESTRUCTION ? 8 : 6);

            Owner.SendStats();

            Health = 1;

            EvtInterface.AddEvent(SendPetInitial, 500, 1);
        }
Ejemplo n.º 17
0
        private void Lockdown()
        {
            GivePoints((int)_capturePoints[0].OwningRealm, 65);

            foreach (CapturePoint c in _capturePoints)
            {
                c.Locked            = true;
                c.CountdownTimerEnd = TCPManager.GetTimeStamp() + 8;
            }

            PacketOut Out = new PacketOut((byte)Opcodes.F_PLAY_SOUND);

            Out.WriteByte(0);
            Out.WriteUInt16(_capturePoints[0].OwningRealm == Realms.REALMS_REALM_ORDER ? (ushort)0x0C : (ushort)0x332);
            Out.Fill(0, 10);

            foreach (Object obj in Region.Objects)
            {
                Player plr = obj as Player;
                if (plr == null)
                {
                    continue;
                }

                plr.SendLocalizeString((_capturePoints[0].OwningRealm == Realms.REALMS_REALM_ORDER ? "Order" : "Destruction") + " has pacified all of the Trolls!", ChatLogFilters.CHATLOGFILTERS_C_WHITE, Localized_text.CHAT_TAG_DEFAULT);
                plr.SendPacket(Out);
            }

            foreach (CapturePoint c in _capturePoints)
            {
                c.BroadcastObjectiveInfo();
            }

            _flag.ResetTo(EHeldState.Home);

            SetTimerState(false);

            EvtInterface.AddEvent(ReopenObjectives, 8000, 1);
        }
        public void Lockdown()
        {
            GivePoints((byte)_capturePoints[0].OwningRealm, 80);

            _capturePoints[0].Locked = true;
            _capturePoints[1].Locked = true;

            _capturePoints[0].CountdownTimerEnd = TCPManager.GetTimeStamp() + 30;
            _capturePoints[1].CountdownTimerEnd = TCPManager.GetTimeStamp() + 30;

            _pendingLockdown = false;

            PacketOut Out = new PacketOut((byte)Opcodes.F_PLAY_SOUND);

            Out.WriteByte(0);
            Out.WriteUInt16(_capturePoints[0].OwningRealm == Realms.REALMS_REALM_ORDER ? (ushort)0x0C : (ushort)0x332);
            Out.Fill(0, 10);

            foreach (Object obj in Region.Objects)
            {
                Player plr = obj as Player;
                if (plr != null)
                {
                    plr.SendLocalizeString((_capturePoints[0].OwningRealm == Realms.REALMS_REALM_ORDER ? "Order" : "Destruction") + " has locked down " + _capturePoints[0].ObjectiveName + " and " + _capturePoints[1].ObjectiveName + "!", ChatLogFilters.CHATLOGFILTERS_C_WHITE, Localized_text.CHAT_TAG_DEFAULT);
                    plr.SendPacket(Out);

                    // 25% damage buff for 30 seconds
                    if (plr.Realm == _capturePoints[0].OwningRealm)
                    {
                        plr.BuffInterface.QueueBuff(new BuffQueueInfo(plr, plr.Level, AbilityMgr.GetBuffInfo(14052)));
                    }
                }
            }

            _capturePoints[0].BroadcastObjectiveInfo();
            _capturePoints[1].BroadcastObjectiveInfo();

            EvtInterface.AddEvent(ReopenObjectives, 30000, 1);
        }
Ejemplo n.º 19
0
        public override void Update(long tick)
        {
            if (!_hasExploded && tick > _nextCheckInterval)
            {
                foreach (var obj in ObjectsInRange)
                {
                    Unit victim = obj as Unit;

                    if (victim == null || victim.IsDead)
                    {
                        continue;
                    }

                    if (!(victim is Player) && !(victim is Creature))
                    {
                        continue;
                    }

                    if (victim.Realm != Owner.Realm && ObjectWithinRadiusFeet(victim, 30))
                    {
                        BuffInterface.NotifyCombatEvent((byte)BuffCombatEvents.Manual, null, victim);

                        _hasExploded = true;
                        return;
                    }
                }

                _nextCheckInterval = tick + 1000;
            }

            if (PendingDisposal)
            {
                Dispose();
                return;
            }

            BuffInterface.Update(tick);
            EvtInterface.Update(tick);
        }
Ejemplo n.º 20
0
        public void Capture()
        {
            EvtInterface.RemoveEvent(Capture);
            OwningRealm = Ownership;

            foreach (Object obj in ObjectsInRange)
            {
                if (obj.IsPlayer())
                {
                    SendMeTo(obj.GetPlayer());
                    SendFlagInfo(obj.GetPlayer());
                }
            }

            foreach (FlagGuard Guard in Guards)
            {
                Guard.SpawnGuard(OwningRealm);
            }

            PacketOut Out = new PacketOut((byte)Opcodes.F_PLAY_SOUND);

            Out.WriteByte(0);
            Out.WriteUInt16(OwningRealm == (byte)Realms.REALMS_REALM_ORDER ? (ushort)0x0C : (ushort)0x332);
            Out.Fill(0, 10);

            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            sb.Append("The Forces of ");
            sb.Append(OwningRealm == (byte)Realms.REALMS_REALM_ORDER ? "Order" : "Destruction");
            sb.Append(" have captured ");
            sb.Append(ObjectiveName + "!");

            foreach (Player plr in Region.Players)
            {
                SendFlagState(plr);
                plr.SendPacket(Out);
                plr.SendLocalizeString(sb.ToString(), SystemData.ChatLogFilters.CHATLOGFILTERS_C_WHITE, Localized_text.CHAT_TAG_DEFAULT);
            }
        }
Ejemplo n.º 21
0
        /// <summary>
        /// Kill this unit, Generate Xp and Loots
        /// </summary>
        /// <param name="Killer"></param>
        public virtual void SetDeath(Unit Killer)
        {
            Health = 0;

            States.Add(3); // Death State

            PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECT_DEATH);

            Out.WriteUInt16(Oid);
            Out.WriteByte(1);
            Out.WriteByte(0);
            Out.WriteUInt16(Killer.Oid);
            Out.Fill(0, 6);
            DispatchPacket(Out, true);

            CbtInterface.Evade();

            WorldMgr.GenerateXP(Killer, this);
            GenerateLoot(Killer);

            ScrInterface.OnDie(this);
            EvtInterface.Notify(EventName.ON_DIE, this, null);
        }
Ejemplo n.º 22
0
        public override void OnLoad()
        {
            // Objective position
            Z = _z;
            X = Zone.CalculPin(_x, true);
            Y = Zone.CalculPin(_y, false);
            base.OnLoad();

            SetOffset((ushort)(_x >> 12), (ushort)(_y >> 12));

            // Events
            EvtInterface.AddEvent(CheckPlayersInCloseRange, 5000, 0);

            // Initial state
            IsActive = true;


            //if (!Ruin)
            //    _objectivePortalMgr.ObjectiveUnlocked(); // Updates portals

            ////if (_supplySpawns != null && _supplySpawns.Count > 0 && _tier > 1)
            ////    LoadResources();
        }
Ejemplo n.º 23
0
        public override bool SetPosition(ushort PinX, ushort PinY, ushort PinZ, ushort Head)
        {
            if (_Client.State != (int)eClientState.Playing)
            {
                _Client.State = (int)eClientState.Playing;
                AddPlayer(this);
                EvtInterface.Notify("Playing", this, null);
            }

            bool Updated = base.SetPosition(PinX, PinY, PinZ, Head);

            if (Updated)
            {
                Zone.AreaInfo.GetTokExplore(TokInterface, PinX, PinY, (byte)Realm);
            }

            _Value.WorldX = WorldPosition.X;
            _Value.WorldY = WorldPosition.Y;
            _Value.WorldZ = WorldPosition.Z;
            _Value.WorldO = Head;

            return(Updated);
        }
Ejemplo n.º 24
0
        public override void SendInteract(Player Plr, InteractMenu Menu)
        {
            Tok_Info Info = WorldMgr.GetTok(Spawn.Proto.TokUnlock);

            if (!IsDead)
            {
                Plr.QtsInterface.HandleEvent(Objective_Type.QUEST_USE_GO, Spawn.Entry, 1);
            }

            if (Spawn.Proto.TokUnlock != 0)
            {
                Plr.TokInterface.AddTok(Info);
            }

            Loot Loots = LootsMgr.GenerateLoot(this, Plr);

            if (Loots != null)
            {
                Loots.SendInteract(Plr, Menu);
                // If object has been looted, make it unlootable
                // and then Reset its lootable staus in XX seconds
                if (!Loots.IsLootable())
                {
                    Looted = true;
                    foreach (Object Obj in this._ObjectRanged)
                    {
                        if (Obj.IsPlayer())
                        {
                            this.SendMeTo(Obj.GetPlayer());
                        }
                    }
                    EvtInterface.AddEvent(ResetLoot, RELOOTABLE_TIME, 1);
                }
            }

            base.SendInteract(Plr, Menu);
        }
Ejemplo n.º 25
0
        protected override void SetDeath(Unit killer)
        {
            Health = 0;

            States.Add((byte)CreatureState.Dead); // Death State

            PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECT_DEATH, 12);

            Out.WriteUInt16(Oid);
            Out.WriteByte(1);
            Out.WriteByte(0);
            Out.WriteUInt16(killer.IsPet() ? killer.GetPet().Owner.Oid : killer.Oid);
            Out.Fill(0, 6);
            DispatchPacket(Out, true);

            AbtInterface.Cancel(true);
            ScrInterface.OnDie(this);

            BuffInterface.RemoveBuffsOnDeath();

            EvtInterface.Notify(EventName.OnDie, this, killer);

            AiInterface.ProcessCombatEnd();

            EvtInterface.AddEvent(RezUnit, 10000, 1); // Clear the object in 10 seconds.

            if (_ownerUILinked)
            {
                SendPetRemove(true);

                IPetCareerInterface petInterface = Owner.CrrInterface as IPetCareerInterface;

                petInterface?.Notify_PetDown();

                _ownerUILinked = false;
            }
        }
Ejemplo n.º 26
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;
        }
Ejemplo n.º 27
0
        public void NextStage()
        {
            Stage.Cleanup();
            int nextStageId = Stage.Number + 1;

            EvtInterface.RemoveEvent(Failed);

            foreach (PQuestStage sStage in Stages)
            {
                if (sStage.Number == nextStageId)
                {
                    Stage = sStage;
                    Stage.Reset();
                    foreach (Player Plr in Players)
                    {
                        SendCurrentStage(Plr);
                    }
                    EvtInterface.AddEvent(Failed, TIME_EACH_STAGE * 1000, 1);
                    return;
                }
            }

            End();
        }
        private void OnCaptured(ClickFlag flag)
        {
            flag.GlowOwner = flag.Owner;
            EvtInterface.RemoveEvent(Lock);
            for (int i = 0; i < 2; i++)
            {
                foreach (Player plr in Players[i])
                {
                    if (plr == null || plr.IsDisposed || !plr.IsInWorld())
                    {
                        continue;
                    }

                    flag.SendFlagInfo(plr);
                    flag.SendFlagState(plr);
                    flag.SendMeTo(plr);
                }
            }

            if (flag.Owner == (int)Realms.REALMS_REALM_ORDER)
            {
                PlaySoundToAll(580);
            }
            else if (flag.Owner == (int)Realms.REALMS_REALM_DESTRUCTION)
            {
                PlaySoundToAll(818);
            }


            if (Flags[0].Owner == Flags[1].Owner)
            {
                Broadcast(new[] { (Flags[0].Owner == (int)Realms.REALMS_REALM_ORDER ? "Order" : "Destruction") + " will lock down both control points in 15 seconds!" },
                          ChatLogFilters.CHATLOGFILTERS_C_WHITE, Localized_text.CHAT_TAG_DEFAULT);
                EvtInterface.AddEvent(Lock, 15000, 1);
            }
        }
Ejemplo n.º 29
0
        public override void Update()
        {
            long Tick = TCPManager.GetTimeStampMS();

            UpdateHealth(Tick);
            UpdateActionPoints(Tick);
            EvtInterface.Update(Tick);

            CbtInterface.Update(Tick);
            ItmInterface.Update(Tick);
            StsInterface.Update(Tick);
            QtsInterface.Update(Tick);
            MvtInterface.Update(Tick);
            AbtInterface.Update(Tick);
            AiInterface.Update(Tick);

            if (NextSend < Tick)
            {
                NextSend = Tick + STATE_INTERVAL;
                SendState(null);
            }

            base.Update();
        }
Ejemplo n.º 30
0
 public bool Save(Object Sender, EventArgs Args)
 {
     EvtInterface.AddEvent(Save, 20000, 0);
     return(true); // True, doit être delete après lancement
 }