public FighterRefusedReasonEnum AddDefender(Character character) { FighterRefusedReasonEnum result; if (character.TaxCollectorDefendFight != null) { result = FighterRefusedReasonEnum.IM_OCCUPIED; } else { if (!this.IsAttackersPlacementPhase) { result = FighterRefusedReasonEnum.TOO_LATE; } else { if (character.Guild == null || character.Guild != this.TaxCollector.TaxCollectorNpc.Guild) { result = FighterRefusedReasonEnum.WRONG_GUILD; } else { if (this.m_defendersQueue.Count >= 7) { result = FighterRefusedReasonEnum.TEAM_FULL; } else { if (this.m_defendersQueue.Any((Character x) => x.Client.IP == character.Client.IP)) { result = FighterRefusedReasonEnum.MULTIACCOUNT_NOT_ALLOWED; } else { if (this.m_defendersQueue.Contains(character)) { result = FighterRefusedReasonEnum.MULTIACCOUNT_NOT_ALLOWED; } else { this.m_defendersQueue.Add(character); character.SetDefender(this); TaxCollectorHandler.SendGuildFightPlayersHelpersJoinMessage(character.Guild.Clients, this.TaxCollector.TaxCollectorNpc, character); result = FighterRefusedReasonEnum.FIGHTER_ACCEPTED; } } } } } } return(result); }
public FighterRefusedReasonEnum AddDefender(Character character) { if (character.TaxCollectorDefendFight != null || character.IsBusy() || character.IsInFight() || character.IsInJail()) { return(FighterRefusedReasonEnum.IM_OCCUPIED); } if (!IsAttackersPlacementPhase) { return(FighterRefusedReasonEnum.TOO_LATE); } if (character.Guild == null || character.Guild.Id != TaxCollector.TaxCollectorNpc.Guild.Id) { return(FighterRefusedReasonEnum.WRONG_GUILD); } if (m_defendersQueue.Count >= PvTMaxFightersSlots) { return(FighterRefusedReasonEnum.TEAM_FULL); } if (m_defendersQueue.Any(x => x.Client.IP == character.Client.IP)) { return(FighterRefusedReasonEnum.MULTIACCOUNT_NOT_ALLOWED); } if (m_defendersQueue.Contains(character)) { return(FighterRefusedReasonEnum.MULTIACCOUNT_NOT_ALLOWED); } m_defendersQueue.Add(character); character.SetDefender(this); TaxCollectorHandler.SendGuildFightPlayersHelpersJoinMessage(character.Guild.Clients, TaxCollector.TaxCollectorNpc, character); return(FighterRefusedReasonEnum.FIGHTER_ACCEPTED); }