Ejemplo n.º 1
0
    private void OnOK(IUIObject obj)
    {
        if (this.m_QuestCommonSub == null)
        {
            return;
        }
        bool flag = false;

        if (this.m_QuestCommonSub.i32Code == 15)
        {
            long num = 0L;
            long.TryParse(this.m_TextField_TextField8.Text, out num);
            if (NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.m_Money < num && num < this.m_QuestCommonSub.i64ParamVAl)
            {
                return;
            }
            flag = true;
            GS_QUEST_GET_CHAR_REQ gS_QUEST_GET_CHAR_REQ = new GS_QUEST_GET_CHAR_REQ();
            TKString.StringChar(this.m_Quest.GetQuestUnique(), ref gS_QUEST_GET_CHAR_REQ.strQuestUnique);
            gS_QUEST_GET_CHAR_REQ.i32CharKind = this.m_i32CharKind;
            gS_QUEST_GET_CHAR_REQ.bItemType   = 0;
            gS_QUEST_GET_CHAR_REQ.nItemPos    = 0;
            gS_QUEST_GET_CHAR_REQ.i32ItemNum  = 0;
            SendPacket.GetInstance().SendObject(1023, gS_QUEST_GET_CHAR_REQ);
        }
        else if (this.m_QuestCommonSub.i32Code == 48)
        {
            if (this.m_Item == null)
            {
                return;
            }
            if ((long)this.m_Item.m_nItemUnique != this.m_QuestCommonSub.i64Param)
            {
                return;
            }
            if ((long)this.m_Item.m_nItemNum < this.m_QuestCommonSub.i64ParamVAl)
            {
                return;
            }
            flag = true;
            GS_QUEST_GET_CHAR_REQ gS_QUEST_GET_CHAR_REQ2 = new GS_QUEST_GET_CHAR_REQ();
            TKString.StringChar(this.m_Quest.GetQuestUnique(), ref gS_QUEST_GET_CHAR_REQ2.strQuestUnique);
            gS_QUEST_GET_CHAR_REQ2.i32CharKind = this.m_i32CharKind;
            gS_QUEST_GET_CHAR_REQ2.bItemType   = this.m_Item.m_nPosType;
            gS_QUEST_GET_CHAR_REQ2.nItemPos    = this.m_Item.m_nItemPos;
            gS_QUEST_GET_CHAR_REQ2.i32ItemNum  = this.m_Item.m_nItemNum;
            SendPacket.GetInstance().SendObject(1023, gS_QUEST_GET_CHAR_REQ2);
        }
        TakeTalk_DLG takeTalk_DLG = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.TAKETALK_DLG) as TakeTalk_DLG;

        if (takeTalk_DLG != null && !flag)
        {
            takeTalk_DLG.SetFailMessage();
        }
        this.Close();
    }
Ejemplo n.º 2
0
    public void NpcClick(IUIObject obj)
    {
        UI_UIGuide uI_UIGuide = NrTSingleton <FormsManager> .Instance.GetForm((G_ID)this.m_nWinID) as UI_UIGuide;

        if (uI_UIGuide != null)
        {
            uI_UIGuide.CloseUI = true;
        }
        NrCharBase charByCharUnique = NrTSingleton <NkCharManager> .Instance.GetCharByCharUnique(this.m_i16CharUnique);

        if (charByCharUnique == null)
        {
            return;
        }
        NrCharKindInfo charKindInfo = charByCharUnique.GetCharKindInfo();

        if (charKindInfo == null)
        {
            return;
        }
        if (!charByCharUnique.IsCharKindATB(16L))
        {
            if (charByCharUnique.IsCharKindATB(8L))
            {
                if (NrTSingleton <NkClientLogic> .Instance.IsNPCTalkState())
                {
                    return;
                }
                if (charByCharUnique.IsCharKindATB(562949953421312L))
                {
                    GS_TREASUREBOX_CLICK_REQ gS_TREASUREBOX_CLICK_REQ = new GS_TREASUREBOX_CLICK_REQ();
                    gS_TREASUREBOX_CLICK_REQ.i32CharUnique = (int)charByCharUnique.GetCharUnique();
                    SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_TREASUREBOX_CLICK_REQ, gS_TREASUREBOX_CLICK_REQ);
                    return;
                }
                if (charByCharUnique.IsCharKindATB(1125899906842624L))
                {
                    if (!NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.IsBountyHunt())
                    {
                        return;
                    }
                    GS_BABELTOWER_GOLOBBY_REQ gS_BABELTOWER_GOLOBBY_REQ = new GS_BABELTOWER_GOLOBBY_REQ();
                    gS_BABELTOWER_GOLOBBY_REQ.mode                = 0;
                    gS_BABELTOWER_GOLOBBY_REQ.babel_floor         = 0;
                    gS_BABELTOWER_GOLOBBY_REQ.babel_subfloor      = 0;
                    gS_BABELTOWER_GOLOBBY_REQ.nPersonID           = 0L;
                    gS_BABELTOWER_GOLOBBY_REQ.i16BountyHuntUnique = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.BountyHuntUnique;
                    SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_BABELTOWER_GOLOBBY_REQ, gS_BABELTOWER_GOLOBBY_REQ);
                    return;
                }
                else
                {
                    NrTSingleton <NkQuestManager> .Instance.IncreaseQuestParamVal(30, (long)charKindInfo.GetCharKind(), 1L);

                    NrTSingleton <NkQuestManager> .Instance.IncreaseQuestParamVal(8, (long)charKindInfo.GetCharKind(), 1L);

                    NrTSingleton <NkQuestManager> .Instance.IncreaseQuestParamVal(99, (long)charKindInfo.GetCharKind(), 1L);

                    NrTSingleton <NkQuestManager> .Instance.IncreaseQuestParamVal(48, (long)charKindInfo.GetCharKind(), 1L);

                    if (charByCharUnique.GetCharUnique() >= 31300 && charByCharUnique.GetCharUnique() <= 31400)
                    {
                        string text = NrTSingleton <NkQuestManager> .Instance.IsCheckCodeANDParam(QUEST_CONST.eQUESTCODE.QUESTCODE_TAKECHAR, (long)charKindInfo.GetCharKind());

                        if (text != string.Empty)
                        {
                            TakeTalk_DLG takeTalk_DLG = NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.TAKETALK_DLG) as TakeTalk_DLG;

                            if (takeTalk_DLG != null)
                            {
                                takeTalk_DLG.SetNpc(charKindInfo.GetCharKind(), charByCharUnique.GetCharUnique(), text);
                                takeTalk_DLG.Show();
                            }
                            return;
                        }
                    }
                    if (charByCharUnique.GetCharUnique() >= 31005 && charByCharUnique.GetCharUnique() <= 31200)
                    {
                        return;
                    }
                    NpcTalkUI_DLG npcTalkUI_DLG = (NpcTalkUI_DLG)NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.NPCTALK_DLG);

                    npcTalkUI_DLG.SetNpcID(charKindInfo.GetCharKind(), charByCharUnique.GetCharUnique());
                    npcTalkUI_DLG.Show();
                }
            }
            else if (charByCharUnique.IsCharKindATB(4L))
            {
                NrCharBase @char = NrTSingleton <NkCharManager> .Instance.GetChar(1);

                if (@char == null)
                {
                    return;
                }
                @char.MoveTo(charByCharUnique.GetCharObject().transform.position);
                NrTSingleton <NkClientLogic> .Instance.SetPickChar(charByCharUnique);

                if (charKindInfo.GetCHARKIND_MONSTERINFO() != null)
                {
                    NrTSingleton <GameGuideManager> .Instance.MonsterLevel = (int)charKindInfo.GetCHARKIND_MONSTERINFO().MINLEVEL;
                }
                else
                {
                    NrTSingleton <GameGuideManager> .Instance.MonsterLevel = 0;
                }
                this.Close();
                return;
            }
            return;
        }
        if (charByCharUnique.IsCharKindATB(268435456L))
        {
            Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("39"), SYSTEM_MESSAGE_TYPE.NORMAL_SYSTEM_MESSAGE);
            return;
        }
        NrCharBase char2 = NrTSingleton <NkCharManager> .Instance.GetChar(1);

        if (char2 == null)
        {
            return;
        }
        char2.MoveTo(charByCharUnique.GetCharObject().transform.position);
        NrTSingleton <NkClientLogic> .Instance.SetPickChar(charByCharUnique);

        this.Close();
    }