private void RemoveBoss(Player player) { if (!BossList.ContainsKey(player.Id)) { return; } BossList.Remove(player.Id); PrintToChat(GetMessage("Boss removed")); CheckAllBossesAreGone(); }
private void OnPlayerDisconnected(Player player) { if (player == null) { return; } if (!BossList.ContainsKey(player.Id)) { return; } BossList.Remove(player.Id); PrintToChat(GetMessage("Boss left")); CheckAllBossesAreGone(); }
private void OnEntityDeath(EntityDeathEvent deathEvent) { #region Null checks if (deathEvent == null) { return; } if (deathEvent.Entity == null) { return; } if (!deathEvent.Entity.IsPlayer) { return; } if (deathEvent.KillingDamage == null) { return; } if (deathEvent.KillingDamage.DamageSource == null) { return; } if (!deathEvent.KillingDamage.DamageSource.IsPlayer) { return; } #endregion var victim = deathEvent.Entity.Owner; var killer = deathEvent.KillingDamage.DamageSource.Owner; var boss = GetBoss(victim); if (boss == null) { return; } BossList.Remove(boss.Id); PrintToChat(GetMessage("Boss killed")); CheckAllBossesAreGone(); if (!BossGold) { return; } if (victim.Equals(killer)) { return; } if (boss.GoldReward <= 0) { return; } if (!GuildBossGold && victim.GetGuild().Equals(killer.GetGuild())) { killer.SendError(GetMessage("Guild member kill", killer)); return; } if (GrandExchange == null) { return; } GrandExchange.Call("GiveGold", killer, boss.GoldReward); killer.SendMessage(GetMessage("Gold gained", killer), boss.GoldReward); }
private void RemoveBoss(Boss boss) { BossList.Remove(boss.Id); PrintToChat(GetMessage("Boss removed")); CheckAllBossesAreGone(); }