Example #1
0
        public virtual void OnFlagStolen(PlayerMobile attacker, CTFTeam enemyTeam)
        {
            if (attacker == null || enemyTeam == null || Flag == null || Flag.Deleted || CTFBattle == null || CTFBattle.Deleted)
            {
                return;
            }

            Broadcast("[{0}]: {1} has stolen your flag!", enemyTeam.Name, attacker.RawName);
            CTFBattle.OnFlagStolen(Flag, attacker, enemyTeam);
        }
Example #2
0
        public virtual void OnFlagReturned(PlayerMobile defender)
        {
            if (defender == null || Flag == null || Flag.Deleted || CTFBattle == null || CTFBattle.Deleted)
            {
                return;
            }

            if (Defenders.ContainsKey(defender))
            {
                Defenders[defender]++;
            }
            else
            {
                Defenders.Add(defender, 1);
            }

            Broadcast("[{0}]: {1} has returned your flag!", Name, defender.RawName);
            CTFBattle.OnFlagReturned(Flag, defender);
        }
Example #3
0
        public virtual void OnFlagCaptured(PlayerMobile attacker, CTFTeam enemyTeam)
        {
            if (attacker == null || enemyTeam == null || Flag == null || Flag.Deleted || CTFBattle == null || CTFBattle.Deleted)
            {
                return;
            }

            if (enemyTeam.Attackers.ContainsKey(attacker))
            {
                enemyTeam.Attackers[attacker]++;
            }
            else
            {
                enemyTeam.Attackers.Add(attacker, 1);
            }

            Broadcast("[{0}]: {1} has captured your flag!", enemyTeam.Name, attacker.RawName);

            CTFBattle.OnFlagCaptured(Flag, attacker, enemyTeam);

            RespawnFlag();
        }