Exemple #1
0
 public static void HandleChallengeTargetsListRequest(ChallengeTargetsListRequestMessage message, WorldClient client)
 {
     if (client.Character.Fighting)
     {
         client.Character.Fighter.ShowChallengeTargetsList(message.challengeId);
     }
 }
        public static void HandleChallengeTargetsListRequestMessage(WorldClient client, ChallengeTargetsListRequestMessage message)
        {
            if (!client.Character.IsFighting())
            {
                return;
            }

            var challenge = client.Character.Fight.Challenges.FirstOrDefault(x => x.Id == message.challengeId);

            if (challenge?.Target == null)
            {
                return;
            }

            if (!challenge.Target.IsVisibleFor(client.Character))
            {
                return;
            }

            SendChallengeTargetsListMessage(challenge.Fight.Clients, new[] { (double)challenge.Target.Id }, new[] { challenge.Target.Cell.Id });
        }
Exemple #3
0
 public static void HandleChallengeTargetsListRequestMessage(WorldClient client, ChallengeTargetsListRequestMessage message)
 {
     if (client.Character.Fight != null)
     {
         var challenge = client.Character.Fight.GetChallenge(message.challengeId);
         if (challenge != null)
         {
             var target = client.Character.Fight.GetOneFighter(challenge.TargetId);
             if (target != null && target.IsVisibleFor(client.Character))
             {
                 ContextHandler.SendChallengeTargetsListMessage(client, new int[1] {
                     target.Id
                 }, new short[1] {
                     target.Cell.Id
                 });
             }
             else
             {
                 ContextHandler.SendChallengeTargetsListMessage(client, new int[0], new short[0]);
             }
         }
     }
 }