예제 #1
0
 public static void AddToMonsterThread(ProjectX_V3_Game.Entities.Monster mob, bool guard)
 {
     if (MonsterCount > 5000 || Threads.Count == 0)
     {
         MonsterCount = 0;
         MonsterThreadCount++;
         if (!Threads.TryAdd(MonsterThreadCount, new MonsterThread()))
             throw new Exception("Could not start monster thread...");
     }
     MonsterThread thread;
     if (!Threads.TryGetValue(MonsterThreadCount, out thread))
         throw new Exception("Could not get monster thread...");
     if (guard)
     {
         if (!thread.SpawnedGuards.TryAdd(mob.EntityUID, mob))
         {
             throw new Exception("Could not add guard to the monster thread...");
         }
     }
     else
     {
         if (!thread.SpawnedMonsters.TryAdd(mob.EntityUID, mob))
         {
             throw new Exception("Could not add mob to the monster thread...");
         }
     }
     MonsterCount++;
 }
예제 #2
0
 public override void KillMob(ProjectX_V3_Game.Entities.GameClient Attacker, uint MobUID)
 {
     // do nothing ...
 }
예제 #3
0
 public override bool HandleRevive(ProjectX_V3_Game.Entities.GameClient Killed)
 {
     return false;
 }
예제 #4
0
 public override bool HandleDeath(ProjectX_V3_Game.Entities.GameClient Attacker, ProjectX_V3_Game.Entities.GameClient Attacked)
 {
     return false;
 }
예제 #5
0
 public override bool HandleBeginHit_Ranged(ProjectX_V3_Game.Entities.GameClient Attacker)
 {
     return false;
 }
예제 #6
0
 public override bool HandleBeginHit_Magic(ProjectX_V3_Game.Entities.GameClient Attacker, Packets.UseSpellPacket usespell)
 {
     if (usespell.SpellID != 1045 && usespell.SpellID != 1046)
         return false;
     return true;
 }
예제 #7
0
 public override bool HandleBeginAttack(ProjectX_V3_Game.Entities.GameClient Attacker)
 {
     return (DateTime.Now >= LastManStanding.TournamentStartTime);
 }
예제 #8
0
            public override bool HandleAttack(ProjectX_V3_Game.Entities.GameClient Attacker, ProjectX_V3_Game.Entities.GameClient Attacked, ref uint damage)
            {
                damage = 1;

                Attacked.TournamentScore.CurrentHP -= 1;
                LastManStanding.SendMessage(Attacked, string.Format(LastManStanding.HEALTH, Attacked.TournamentScore.CurrentHP));

                if (Attacked.TournamentScore.CurrentHP <= 0)
                {
                    Attacker.TournamentScore.CurrentScore += 1;
                    Attacker.TournamentInfo.TotalKills += 1;

                    Entities.GameClient rClient;
                    LastManStanding.Players.TryRemove(Attacked.EntityUID, out rClient);

                    Attacked.Battle = null;
                    Attacked.Equipments.ClearMask();
                    if (Attacked.TournamentScore.CurrentScore >= 5)
                        Attacked.TournamentInfo.TournamentPoints += LastManStanding.EXTRA_SCORE;

                    Attacked.TournamentInfo.TotalDeaths -= 1;

                    Attacked.Teleport(Attacked.LastMapID, Attacked.LastMapX, Attacked.LastMapY);

                    LastManStanding.UpdateBroadcast();
                    LastManStanding.CheckForWin();
                }

                return false;
            }
예제 #9
0
 public override bool SignUp(ProjectX_V3_Game.Entities.GameClient client, out bool AlreadySigned)
 {
     AlreadySigned = false;
     if (Started)
         return false;
     AlreadySigned = !Players.TryAdd(client.EntityUID, client);
     return true;
 }
예제 #10
0
 public override bool HandleDeath(ProjectX_V3_Game.Entities.GameClient Attacker, ProjectX_V3_Game.Entities.GameClient Attacked)
 {
     if (Attacker == Player1)
     {
         Player1Damage = 1;
         Player2Damage = 0;
     }
     else
     {
         Player2Damage = 1;
         Player1Damage = 0;
     }
     EndMatch();
     return false;
 }
예제 #11
0
 public override bool HandleBeginHit_Physical(ProjectX_V3_Game.Entities.GameClient Attacker)
 {
     return true;
 }
예제 #12
0
 public override bool HandleBeginHit_Magic(ProjectX_V3_Game.Entities.GameClient Attacker, Packets.UseSpellPacket usespell)
 {
     return true;
 }
예제 #13
0
        public override bool HandleBeginAttack(ProjectX_V3_Game.Entities.GameClient Attacker)
        {
            if (!Started)
                return false;
            if (!FightingMatch)
                return false;

            return (DateTime.Now >= MatchStartTime);
        }
예제 #14
0
        public override bool HandleAttack(ProjectX_V3_Game.Entities.GameClient Attacker, ProjectX_V3_Game.Entities.GameClient Attacked, ref uint damage)
        {
            if (Attacked.Battle == null)
                return false;
            if (Attacker.Battle == null)
                return false;

            if (Attacker == Player1)
                Player1Damage += damage;
            else
                Player2Damage += damage;

            SendPacket();

            return (Attacked == Player1 || Attacked == Player2);
        }