protected override async Task Handle(GroupInvitationSendEvent e, CancellationToken cancellation) { if (!(e.Sender is IPlayerEntity player)) { return; } IPlayerEntity sender = _playerManager.GetPlayerByCharacterId(e.Sender.Id); IPlayerEntity target = _playerManager.GetPlayerByCharacterId(e.Target.Character.Id); if (target == null || sender == null) { return; } _groupManager.CreateInvitation(sender, target); await player.SendChatMessageAsync(PlayerMessages.GROUP_PLAYER_X_INVITED_TO_YOUR_GROUP, SayColorType.Yellow); PacketBase acceptPacket = new PJoinPacket { CharacterId = target.Id, RequestType = PJoinPacketType.Accepted }; PacketBase refusePacket = new PJoinPacket { CharacterId = target.Id, RequestType = PJoinPacketType.Declined }; string question = target.GetLanguageFormat(PlayerMessages.GROUP_PLAYER_X_INVITED_YOU_TO_JOIN_HIS_GROUP, sender.Character.Name); await target.SendDialog(acceptPacket, refusePacket, question); }