コード例 #1
0
        protected int SendBackNext(string text)
        {
            _result = new WaitableResult <int>();

            Send(new NpcStateInfo {
                Type = NpcMessageType.Standard, Text = text, IsPrevious = true, IsNext = true
            });

            _result.Wait();
            return(_result.Value);
        }
コード例 #2
0
        protected string SendRequestText(string text)
        {
            _stringResult = new WaitableResult <string>();

            Send(new NpcStateInfo {
                Type = NpcMessageType.RequestText, Text = text
            });

            _stringResult.Wait();
            return(_stringResult.Value);
        }
コード例 #3
0
        protected int SendChoice(string text)
        {
            _result = new WaitableResult <int>();

            Send(new NpcStateInfo {
                Type = NpcMessageType.Choice, Text = text, IsPrevious = false, IsNext = false
            });

            _result.Wait();
            return(_result.Value);
        }
コード例 #4
0
        protected int SendRequestStyle(string text, params int[] styles)
        {
            _result = new WaitableResult <int>();

            Send(new NpcStateInfo {
                Type = NpcMessageType.RequestStyle, Text = text, Styles = styles.ToList()
            });

            _result.Wait();
            return(_result.Value);
        }
コード例 #5
0
        protected int SendAcceptDeclineNoExit(string text)
        {
            _result = new WaitableResult <int>();

            Send(new NpcStateInfo {
                Type = NpcMessageType.AcceptDeclineNoExit, Text = text
            });

            _result.Wait();
            return(_result.Value);
        }
コード例 #6
0
        protected int AskYesNo(string text)
        {
            _result = new WaitableResult <int>();

            Send(new NpcStateInfo {
                Type = NpcMessageType.YesNo, Text = text
            });

            _result.Wait();
            return(_result.Value);
        }
コード例 #7
0
        private int SendBackOk()
        {
            mResult = new WaitableResult <int>();

            using (Packet oPacket = mNpc.GetDialogPacket(mText, NpcMessageType.Standard, 1, 0))
            {
                mCharacter.Client.Send(oPacket);
            }

            mText = string.Empty;

            mResult.Wait();

            return(mResult.Value);
        }
コード例 #8
0
        private int AskAcceptDecline()
        {
            mResult = new WaitableResult <int>();

            using (Packet oPacket = mNpc.GetDialogPacket(mText, NpcMessageType.AcceptDecline))
            {
                mCharacter.Client.Send(oPacket);
            }

            mText = string.Empty;

            mResult.Wait();

            return(mResult.Value);
        }
コード例 #9
0
ファイル: NpcScript.cs プロジェクト: Bia10/DestinyFork
        private int AskYesNo()
        {
            mResult = new WaitableResult <int>();

            using (Packet oPacket = mNpc.GetDialogPacket(mText, NPCsConstants.NpcMessageType.YesNo))
            {
                mCharacter.Client.Send(oPacket);
            }

            mText = string.Empty;

            mResult.Wait();

            return(mResult.Value);
        }
コード例 #10
0
        protected int SendRequestNumber(string text, int numberDefault = 0, int numberMinimum = 0,
                                        int numberMaximum = 0)
        {
            _result = new WaitableResult <int>();

            Send(new NpcStateInfo
            {
                Type          = NpcMessageType.RequestNumber,
                Text          = text,
                NumberDefault = numberDefault,
                NumberMinimum = numberMinimum,
                NumberMaximum = numberMaximum
            });

            _result.Wait();
            return(_result.Value);
        }