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++; }
public override void KillMob(ProjectX_V3_Game.Entities.GameClient Attacker, uint MobUID) { // do nothing ... }
public override bool HandleRevive(ProjectX_V3_Game.Entities.GameClient Killed) { return false; }
public override bool HandleDeath(ProjectX_V3_Game.Entities.GameClient Attacker, ProjectX_V3_Game.Entities.GameClient Attacked) { return false; }
public override bool HandleBeginHit_Ranged(ProjectX_V3_Game.Entities.GameClient Attacker) { return false; }
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; }
public override bool HandleBeginAttack(ProjectX_V3_Game.Entities.GameClient Attacker) { return (DateTime.Now >= LastManStanding.TournamentStartTime); }
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; }
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; }
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; }
public override bool HandleBeginHit_Physical(ProjectX_V3_Game.Entities.GameClient Attacker) { return true; }
public override bool HandleBeginHit_Magic(ProjectX_V3_Game.Entities.GameClient Attacker, Packets.UseSpellPacket usespell) { return true; }
public override bool HandleBeginAttack(ProjectX_V3_Game.Entities.GameClient Attacker) { if (!Started) return false; if (!FightingMatch) return false; return (DateTime.Now >= MatchStartTime); }
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); }