public CHARKIND_MONSTERINFO GetBaseMonsterInfo(int charkind)
    {
        NrCharKindInfo charKindInfo = this.GetCharKindInfo(charkind);

        if (charKindInfo == null)
        {
            return(null);
        }
        return(charKindInfo.GetCHARKIND_MONSTERINFO());
    }
Beispiel #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();
    }
Beispiel #3
0
    private void ShowNpcImage(Adventure adventure)
    {
        if (adventure == null)
        {
            return;
        }
        bool flag = false;

        for (int i = 0; i < this.m_MaxControlNum; i++)
        {
            NrCharKindInfo charKindInfoFromCode = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfoFromCode(adventure.GetMonsterKind(i));

            if (charKindInfoFromCode != null)
            {
                this.m_AdventureControl[i].m_MonsterImage.SetTexture(eCharImageType.SMALL, charKindInfoFromCode.GetCharKind(), -1, string.Empty);
                this.m_AdventureControl[i].m_ClearImage.Visible = false;
                if (NrTSingleton <NkQuestManager> .Instance.QuestGroupClearCheck(adventure.GetQuestGroupUnique(i)) == QUEST_CONST.E_QUEST_GROUP_STATE.E_QUEST_GROUP_STATE_NONE)
                {
                    this.m_AdventureControl[i].m_ClearImage.Visible  = true;
                    this.m_AdventureControl[i].m_DisableMark.Visible = false;
                    this.m_AdventureControl[i].m_DisableBG.Visible   = false;
                    this.m_AdventureControl[i].m_MonsterLevel.Text   = NrTSingleton <UIDataManager> .Instance.GetString(NrTSingleton <CTextParser> .Instance.GetTextColor("1002"), NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("152"), charKindInfoFromCode.GetCHARKIND_MONSTERINFO().MINLEVEL.ToString());
                }
                else if (!flag)
                {
                    CQuestGroup questGroupByGroupUnique = NrTSingleton <NkQuestManager> .Instance.GetQuestGroupByGroupUnique(adventure.GetQuestGroupUnique(i));

                    if (questGroupByGroupUnique != null)
                    {
                        CQuest cQuest = questGroupByGroupUnique.FindCurrentQuest();
                        if (cQuest != null)
                        {
                            QUEST_CONST.eQUESTSTATE questState = NrTSingleton <NkQuestManager> .Instance.GetQuestState(cQuest.GetQuestUnique());

                            if (questState == QUEST_CONST.eQUESTSTATE.QUESTSTATE_ACCEPTABLE)
                            {
                                this.m_CurrentQuest = cQuest;
                                this.m_AdventureControl[i].m_NpcButton.Visible = true;
                                this.m_AdventureControl[i].m_NpcImage.Visible  = true;
                                this.m_AdventureControl[i].m_QuestMark.Visible = true;
                                this.m_AdventureControl[i].m_NpcImage.SetTexture(eCharImageType.SMALL, cQuest.GetQuestCommon().i32QuestCharKind, -1, string.Empty);
                                this.m_AdventureControl[i].m_MonsterLevel.Text = NrTSingleton <UIDataManager> .Instance.GetString(NrTSingleton <CTextParser> .Instance.GetTextColor("1002"), NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("152"), charKindInfoFromCode.GetCHARKIND_MONSTERINFO().MINLEVEL.ToString());
                            }
                            else if (questState == QUEST_CONST.eQUESTSTATE.QUESTSTATE_ONGOING || questState == QUEST_CONST.eQUESTSTATE.QUESTSTATE_COMPLETE)
                            {
                                this.m_AdventureControl[i].m_DisableMark.Visible = false;
                                this.m_AdventureControl[i].m_DisableBG.Visible   = false;
                                this.m_AdventureControl[i].m_MonsterLevel.Text   = NrTSingleton <UIDataManager> .Instance.GetString(NrTSingleton <CTextParser> .Instance.GetTextColor("1002"), NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("152"), charKindInfoFromCode.GetCHARKIND_MONSTERINFO().MINLEVEL.ToString());
                            }
                            else
                            {
                                this.m_AdventureControl[i].m_MonsterLevel.Text = NrTSingleton <UIDataManager> .Instance.GetString(NrTSingleton <CTextParser> .Instance.GetTextColor("1102"), NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("152"), charKindInfoFromCode.GetCHARKIND_MONSTERINFO().MINLEVEL.ToString());
                            }
                            flag = true;
                        }
                    }
                }
                else
                {
                    this.m_AdventureControl[i].m_MonsterLevel.Text = NrTSingleton <UIDataManager> .Instance.GetString(NrTSingleton <CTextParser> .Instance.GetTextColor("1102"), NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("152"), charKindInfoFromCode.GetCHARKIND_MONSTERINFO().MINLEVEL.ToString());
                }
            }
        }
        CQuestGroup questGroupByGroupUnique2 = NrTSingleton <NkQuestManager> .Instance.GetQuestGroupByGroupUnique(adventure.GetQuestGroupUnique(0));

        if (questGroupByGroupUnique2 == null)
        {
            return;
        }
        CQuest firstQuest = questGroupByGroupUnique2.GetFirstQuest();

        if (firstQuest == null)
        {
            return;
        }
        NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;

        if (kMyCharInfo == null)
        {
            return;
        }
        if ((int)firstQuest.GetQuestLevel(0) > kMyCharInfo.GetLevel())
        {
            base.SetShowLayer(1, true);
            string empty = string.Empty;
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
            {
                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("622"),
                "count",
                firstQuest.GetQuestLevel(0)
            });

            this.m_BaloonText.Text             = empty;
            this.m_NextButton.controlIsEnabled = false;
        }
        else
        {
            base.SetShowLayer(1, false);
            this.m_NextButton.controlIsEnabled = true;
        }
    }