Example #1
0
    public override bool CheckCondition(long i64Param, ref long i64ParamVal)
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return(false);
        }
        int num = 0;

        if (base.GetParam() == 0L)
        {
            for (int i = 0; i < 6; i++)
            {
                for (int j = 0; j < 6; j++)
                {
                    NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
                    if (soldierInfo != null && soldierInfo.GetSolID() != 0L)
                    {
                        int nItemUnique = soldierInfo.GetEquipItem(j).m_nItemUnique;
                        if (nItemUnique > 0)
                        {
                            if (NrTSingleton <ItemManager> .Instance.GetItemPartByItemUnique(nItemUnique) == eITEM_PART.ITEMPART_WEAPON)
                            {
                                num++;
                            }
                            if (base.GetParamVal() <= (long)num)
                            {
                                return(true);
                            }
                        }
                    }
                }
            }
        }
        else
        {
            for (int k = 0; k < 6; k++)
            {
                for (int l = 0; l < 6; l++)
                {
                    if ((long)charPersonInfo.GetSoldierInfo(k).GetEquipItem(l).m_nItemUnique == base.GetParam())
                    {
                        num++;
                    }
                    if (base.GetParamVal() <= (long)num)
                    {
                        return(true);
                    }
                }
            }
        }
        return(false);
    }
Example #2
0
    public void SetSolderinfo()
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return;
        }
        for (int i = 0; i < 6; i++)
        {
            NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
            if (!soldierInfo.IsValid())
            {
                base.SetShowLayer(i, false);
            }
            else
            {
                this.m_itSolPortrait[i].SetSolImageTexure(eCharImageType.SMALL, soldierInfo.GetCharKind(), (int)soldierInfo.GetGrade());
                this.m_pbSolHP[i].Value = (float)soldierInfo.GetHP() / (float)soldierInfo.GetMaxHP();
                this.SetToolTip(i, soldierInfo);
                this.m_pbSolHP[i].Visible = false;
                this.m_pbBG[i].Visible    = false;
            }
        }
    }
Example #3
0
    public void ClickbuSolButton(IUIObject obj)
    {
        if (obj == null)
        {
            return;
        }
        int num = (int)obj.Data;
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return;
        }
        NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(num);

        if (soldierInfo == null || !soldierInfo.IsValid())
        {
            return;
        }
        SolMilitaryGroupDlg solMilitaryGroupDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.SOLMILITARYGROUP_DLG) as SolMilitaryGroupDlg;

        if (solMilitaryGroupDlg != null)
        {
            solMilitaryGroupDlg.SetSoldierSelectByBattle(num);
        }
    }
Example #4
0
    private void ProcessCharPartInfo(NrCharPartInfo pkCustomPartInfo, bool bChangeBase, bool bChangeEquip)
    {
        NrPersonInfoUser nrPersonInfoUser = base.GetPersonInfo() as NrPersonInfoUser;

        if (bChangeBase)
        {
            nrPersonInfoUser.SetBasePart(pkCustomPartInfo.m_kBasePart);
            this.ChangeBasePart();
        }
        if (bChangeEquip)
        {
            NkSoldierInfo soldierInfo = nrPersonInfoUser.GetSoldierInfo(0);
            if (soldierInfo != null)
            {
                soldierInfo.SetEquipItemInfo(pkCustomPartInfo.m_kEquipPart);
            }
            if (this.m_k3DChar != null)
            {
                this.ChangeEquipItem();
            }
            else
            {
                base.SetChangedItem(true);
            }
        }
    }
    public void SetLeaveGuild()
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return;
        }
        if (charPersonInfo.GetSoldierInfo(0) == null)
        {
            return;
        }
        string textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("592");

        string textFromMessageBox = NrTSingleton <NrTextMgr> .Instance.GetTextFromMessageBox("56");

        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref textFromMessageBox, new object[]
        {
            textFromMessageBox,
            "targetname",
            NrTSingleton <NewGuildManager> .Instance.GetGuildName()
        });

        MsgBoxUI msgBoxUI = NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.MSGBOX_DLG) as MsgBoxUI;

        if (msgBoxUI != null)
        {
            msgBoxUI.SetMsg(new YesDelegate(this.MsgBoxOKEvent), null, null, null, textFromInterface, textFromMessageBox, eMsgType.MB_OK_CANCEL);
            msgBoxUI.SetButtonOKText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("10"));
            msgBoxUI.SetButtonCancelText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("11"));
        }
    }
    public void SetClearData()
    {
        this.nSelectedBattelPos           = -1;
        this.BattlePosSolName.Text        = string.Empty;
        this.BattlePosSolWeapon1.Visible  = false;
        this.BattlePosSolWeapon2.Visible  = false;
        this.BattlePosSelectedPos.Visible = false;
        for (int i = 0; i < 6; i++)
        {
            this.m_kBattlePosSolList[i] = new NkSoldierInfo();
        }
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return;
        }
        for (int j = 0; j < 6; j++)
        {
            NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(j);
            if (soldierInfo != null && soldierInfo.IsValid())
            {
                this.m_kBattlePosSolList[(int)soldierInfo.GetSolPosIndex()].Set(soldierInfo);
            }
        }
    }
Example #7
0
    public override bool CheckCondition(long i64Param, ref long i64ParamVal)
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        int num = 0;

        if (charPersonInfo == null)
        {
            return(false);
        }
        for (int i = 0; i < 6; i++)
        {
            NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
            for (int j = 0; j < 6; j++)
            {
                ITEM equipItem = soldierInfo.GetEquipItem(j);
                if (equipItem != null)
                {
                    if ((long)equipItem.m_nItemUnique == base.GetParam())
                    {
                        num++;
                    }
                }
            }
        }
        return((long)num >= base.GetParamVal());
    }
    public override string GetConditionText(long i64ParamVal)
    {
        string textFromQuest_Code = NrTSingleton <NrTextMgr> .Instance.GetTextFromQuest_Code(this.m_szTextKey);

        string           empty          = string.Empty;
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return("No User");
        }
        int num = 0;

        for (int i = 0; i < 6; i++)
        {
            NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
            if (soldierInfo.GetSolPosType() == 0)
            {
                num++;
            }
        }
        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
        {
            textFromQuest_Code,
            "count1",
            num,
            "count2",
            base.GetParamVal()
        });

        return(empty);
    }
Example #9
0
    public void RightbuSolButton(IUIObject obj)
    {
        if (obj == null)
        {
            return;
        }
        int solindex = (int)obj.Data;
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return;
        }
        NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(solindex);

        if (soldierInfo == null || !soldierInfo.IsValid())
        {
            return;
        }
        SolMilitaryGroupDlg solMilitaryGroupDlg = NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.SOLMILITARYGROUP_DLG) as SolMilitaryGroupDlg;

        if (solMilitaryGroupDlg != null)
        {
            solMilitaryGroupDlg.RefreshSolList();
        }
    }
Example #10
0
    private void ShowSoldierList()
    {
        this.SoldierList.Clear();
        this.m_ShowList.Clear();
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        int num = 0;

        for (int i = 0; i < 6; i++)
        {
            NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
            if (soldierInfo != null)
            {
                if (soldierInfo.GetSolID() > 0L)
                {
                    SOLDIER_INFO_EXTEND sOLDIER_INFO_EXTEND = this.SetUserData(soldierInfo);
                    if (sOLDIER_INFO_EXTEND != null)
                    {
                        this.SoldierList.Add(sOLDIER_INFO_EXTEND);
                        this.m_ShowList.Add(sOLDIER_INFO_EXTEND);
                    }
                    num++;
                }
            }
        }
        this.m_TotalPage = (num - 1) / SelectItemDlg.NUM_SOLDIERLIST + 1;
        if (this.m_TotalPage <= 0)
        {
            this.m_TotalPage = 1;
        }
        this.ShowList();
    }
Example #11
0
    public override void SetReadyPartInfo()
    {
        NrPersonInfoUser personInfoUser = this.GetPersonInfoUser();
        NrCharBasePart   basePart       = personInfoUser.GetBasePart();
        NrEquipItemInfo  equipItemInfo  = personInfoUser.GetSoldierInfo(0).GetEquipItemInfo();

        this.m_kPartControl.CollectPartInfo(basePart, equipItemInfo);
    }
Example #12
0
    public void SetLevelValue()
    {
        if (this.m_DisableContorl)
        {
            return;
        }
        CAMERASETTING_DATA cameraData = NrTSingleton <NkCameraSettingsManager> .Instance.GetCameraData(this.m_nCameraLevel);

        if (this.m_bUseCameraLevel && cameraData != null)
        {
            this.yMaxLimit          = cameraData.m_YRotate;
            this.yDeg               = maxCamera.ClampAngle(this.yDeg, this.yMinLimit, this.yMaxLimit);
            this.rotation           = Quaternion.Euler(this.yDeg, this.xDeg, 0f);
            base.transform.rotation = this.rotation;
            NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

            if (charPersonInfo != null)
            {
                NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(0);
                if (soldierInfo == null)
                {
                    return;
                }
                if (soldierInfo.GetSolID() <= 0L)
                {
                    return;
                }
                this.fLevelHeight = cameraData.GetTribeHeight(soldierInfo.GetCharKindInfo().GetCharTribe());
                if (this.fTargetHeight == 0f)
                {
                    this.fTargetHeight = this.fLevelHeight;
                }
                if (Scene.CurScene == Scene.Type.WORLD)
                {
                    this.minDistance = cameraData.GetTribeZoom(soldierInfo.GetCharKindInfo().GetCharTribe());
                    this.maxDistance = cameraData.GetTribeZoom(soldierInfo.GetCharKindInfo().GetCharTribe());
                }
                else
                {
                    this.minDistance = cameraData.m_Zoom;
                    this.maxDistance = cameraData.m_Zoom;
                }
            }
            if (Scene.CurScene == Scene.Type.WORLD && this.m_nCameraLevel >= NrTSingleton <NkCameraSettingsManager> .Instance.GetMaxLevel() - 1)
            {
                NrCharBase @char = NrTSingleton <NkCharManager> .Instance.GetChar(1);

                if (@char != null && @char.IsReady3DModel())
                {
                    @char.SetShowHide3DModel(false, false, false);
                }
            }
            this.m_bDistanceMove = true;
        }
    }
    public override bool CheckGameGuideOnce()
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo != null)
        {
            for (int i = 0; i < 6; i++)
            {
                NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
                if (soldierInfo != null)
                {
                    if (soldierInfo.GetSolID() != 0L)
                    {
                        if (soldierInfo.GetCharKindInfo() != null)
                        {
                            if ("2070" == soldierInfo.GetCharKindInfo().GetCHARKIND_INFO().SoldierSpec1)
                            {
                                return(false);
                            }
                            if (soldierInfo.GetCharKind() == 6)
                            {
                                return(false);
                            }
                        }
                    }
                }
            }
            NkReadySolList readySolList = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetReadySolList();

            if (readySolList == null)
            {
                return(false);
            }
            int num = -1;
            foreach (NkSoldierInfo current in readySolList.GetList().Values)
            {
                if (current != null)
                {
                    if (current.GetSolID() != 0L)
                    {
                        if ("2070" == current.GetCharKindInfo().GetCHARKIND_INFO().SoldierSpec1&& num < (int)current.GetGrade())
                        {
                            num = (int)current.GetGrade();
                            this.m_nCharKind = current.GetCharKind();
                        }
                    }
                }
            }
            if (0 < this.m_nCharKind)
            {
                return(true);
            }
        }
        return(false);
    }
Example #14
0
    public override string GetConditionText(long i64ParamVal)
    {
        string           empty          = string.Empty;
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return(empty);
        }
        int num = 0;

        for (int i = 0; i < 6; i++)
        {
            NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
            if (soldierInfo != null && soldierInfo.GetSolID() != 0L)
            {
                for (int j = 0; j < 6; j++)
                {
                    int battleSkillUnique = soldierInfo.GetBattleSkillUnique(j);
                    if (0 < battleSkillUnique)
                    {
                        int battleSkillLevel = soldierInfo.GetBattleSkillLevel(battleSkillUnique);
                        if (NrTSingleton <BattleSkill_Manager> .Instance.GetBattleSkillTraining(battleSkillUnique, battleSkillLevel) != null)
                        {
                            if (0 < battleSkillLevel)
                            {
                                num++;
                            }
                            if (base.GetParamVal() <= (long)num)
                            {
                                num = (int)base.GetParamVal();
                                break;
                            }
                        }
                    }
                }
            }
        }
        string textFromQuest_Code = NrTSingleton <NrTextMgr> .Instance.GetTextFromQuest_Code(this.m_szTextKey);

        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
        {
            textFromQuest_Code,
            "count1",
            num,
            "count2",
            base.GetParamVal()
        });

        return(empty);
    }
    private void MakeBattleSolList()
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return;
        }
        for (int i = 0; i < 6; i++)
        {
            NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
            this.AddSolList(soldierInfo, eSOL_POSTYPE.SOLPOS_BATTLE);
        }
    }
Example #16
0
    public int GetMyLevel()
    {
        int result = 1;
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo != null)
        {
            NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(0);
            if (soldierInfo != null)
            {
                result = (int)soldierInfo.GetLevel();
            }
        }
        return(result);
    }
Example #17
0
    public override string GetConditionText(long i64ParamVal)
    {
        string itemNameByItemUnique = NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique((int)base.GetParam());

        string textFromQuest_Code = NrTSingleton <NrTextMgr> .Instance.GetTextFromQuest_Code(this.m_szTextKey);

        string           empty          = string.Empty;
        int              num            = 0;
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return("No User");
        }
        for (int i = 0; i < 6; i++)
        {
            NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
            if (soldierInfo.GetSolPosType() == 1)
            {
                bool flag = false;
                for (int j = 0; j < 6; j++)
                {
                    if (soldierInfo.GetEquipItemInfo() != null && (long)soldierInfo.GetEquipItem(j).m_nItemUnique == base.GetParam())
                    {
                        num  = soldierInfo.GetEquipItem(j).m_nRank;
                        flag = true;
                        break;
                    }
                }
                if (flag)
                {
                    break;
                }
            }
        }
        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
        {
            textFromQuest_Code,
            "targetname",
            itemNameByItemUnique,
            "count1",
            base.GetParamVal(),
            "count2",
            num
        });

        return(empty);
    }
Example #18
0
    public override bool CheckCondition(long i64Param, ref long i64ParamVal)
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return(false);
        }
        int num = 0;

        for (int i = 0; i < 6; i++)
        {
            NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
            if (soldierInfo.GetSolPosType() == 1)
            {
                for (int j = 0; j < 6; j++)
                {
                    if (soldierInfo.GetEquipItemInfo() != null && (long)soldierInfo.GetEquipItem(j).m_nItemUnique == base.GetParam())
                    {
                        int num2 = Protocol_Item.Get_Defense(soldierInfo.GetEquipItem(j));
                        if (num > num2)
                        {
                            num = num2;
                        }
                    }
                }
            }
        }
        NkUserInventory instance = NkUserInventory.GetInstance();

        if (instance == null)
        {
            return(false);
        }
        for (short num3 = 0; num3 < 30; num3 += 1)
        {
            ITEM item = instance.GetItem(1, (int)num3);
            if (item != null)
            {
                int num4 = Protocol_Item.Get_Defense(item);
                if (num > num4)
                {
                    num = num4;
                }
            }
        }
        return((long)num >= base.GetParamVal());
    }
    private void InsertMythList(SolComposeListDlg.SOL_LIST_INSERT_TYPE eIndex)
    {
        this.mSortList.Clear();
        this.mCheckList.Clear();
        bool flag  = eIndex == SolComposeListDlg.SOL_LIST_INSERT_TYPE.ALL || eIndex == SolComposeListDlg.SOL_LIST_INSERT_TYPE.BATTLE;
        bool flag2 = eIndex == SolComposeListDlg.SOL_LIST_INSERT_TYPE.ALL || eIndex == SolComposeListDlg.SOL_LIST_INSERT_TYPE.WAIT;

        if (NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo != null)
        {
            NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

            if (flag && charPersonInfo != null)
            {
                for (int i = 0; i < 6; i++)
                {
                    NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
                    if (soldierInfo != null)
                    {
                        if (soldierInfo.GetSolID() > 0L)
                        {
                            if (soldierInfo.GetGrade() >= 6 && soldierInfo.GetGrade() < 10)
                            {
                                this.mSortList.Add(soldierInfo);
                            }
                        }
                    }
                }
            }
            if (flag2)
            {
                NkReadySolList readySolList = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetReadySolList();

                foreach (NkSoldierInfo current in readySolList.GetList().Values)
                {
                    if (current.GetSolID() != NrTSingleton <NkCharManager> .Instance.GetMyCharInfo().GetFaceSolID())
                    {
                        if (current.GetSolPosType() == 0 && current.GetGrade() >= 6 && current.GetGrade() < 10)
                        {
                            this.mSortList.Add(current);
                        }
                    }
                }
            }
        }
        this.ddList1.SetIndex((int)eIndex);
        this.ddList1.RepositionItems();
        this.ChangeSortDDL(null);
    }
Example #20
0
    public override bool Verify()
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo != null)
        {
            NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(0);
            if (soldierInfo != null)
            {
                int level = (int)soldierInfo.GetLevel();
                if (this.m_MinLevel <= level && level <= this.m_MaxLevel)
                {
                    return(true);
                }
            }
        }
        return(false);
    }
Example #21
0
    private void SetCharInfo()
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo != null)
        {
            NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(0);
            if (soldierInfo != null)
            {
                this.m_dtCharImg.SetUVMask(new Rect(4f / this.TEX_SIZE, 0f, 504f / this.TEX_SIZE, 448f / this.TEX_SIZE));
                this.m_dtCharImg.SetTexture(eCharImageType.LARGE, soldierInfo.GetCharKind(), (int)soldierInfo.GetGrade(), string.Empty);
                this.m_lbCharName.Text = string.Format("Lv.{0} {1}", soldierInfo.GetLevel(), soldierInfo.GetName());
                if (NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.IntroMsg == string.Empty)
                {
                    string textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("124");

                    string text = string.Empty;
                    NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
                    {
                        textFromInterface,
                        "username",
                        charPersonInfo.GetCharName()
                    });

                    if ("true" == MsgHandler.HandleReturn <string>("ReservedWordManagerIsUse", new object[0]))
                    {
                        text = MsgHandler.HandleReturn <string>("ReservedWordManagerReplaceWord", new object[]
                        {
                            text
                        });
                    }
                    if (text.Contains("*"))
                    {
                        Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("797"), SYSTEM_MESSAGE_TYPE.NAGATIVE_MESSAGE);
                    }
                    this.m_taIntroMsg.SetText(text);
                }
                else
                {
                    this.m_taIntroMsg.SetText(NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.IntroMsg);
                }
            }
        }
    }
Example #22
0
    public override string GetConditionText(long i64ParamVal)
    {
        string itemNameByItemUnique = NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique((int)base.GetParam());

        string textFromQuest_Code = NrTSingleton <NrTextMgr> .Instance.GetTextFromQuest_Code(this.m_szTextKey);

        string           empty          = string.Empty;
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        int num = 0;

        if (charPersonInfo == null)
        {
            return("No User");
        }
        for (int i = 0; i < 6; i++)
        {
            NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
            for (int j = 0; j < 6; j++)
            {
                ITEM equipItem = soldierInfo.GetEquipItem(j);
                if (equipItem != null)
                {
                    if ((long)equipItem.m_nItemUnique == base.GetParam())
                    {
                        num++;
                    }
                }
            }
        }
        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
        {
            textFromQuest_Code,
            "targetname",
            itemNameByItemUnique,
            "count1",
            num,
            "count2",
            base.GetParamVal()
        });

        return(empty);
    }
Example #23
0
    public void UpdateHP(int nSolIndex)
    {
        if (nSolIndex < 0 || nSolIndex >= 6)
        {
            return;
        }
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return;
        }
        NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(nSolIndex);

        if (soldierInfo != null && soldierInfo.IsValid())
        {
            this.m_pbSolHP[nSolIndex].Value = (float)soldierInfo.GetHP() / (float)soldierInfo.GetMaxHP();
            this.SetToolTip(nSolIndex, soldierInfo);
        }
    }
Example #24
0
    public override bool CheckCondition(long i64Param, ref long i64ParamVal)
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return(false);
        }
        int num = 0;

        for (int i = 0; i < 6; i++)
        {
            NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
            if (soldierInfo.GetSolPosType() == 0)
            {
                num++;
            }
        }
        return((long)num >= base.GetParamVal());
    }
    public override bool CheckGameGuideOnce()
    {
        if (10000L <= NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.m_Money)
        {
            NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

            if (charPersonInfo != null)
            {
                for (int i = 0; i < 6; i++)
                {
                    NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
                    if (soldierInfo != null)
                    {
                        if (soldierInfo.GetSolID() != 0L)
                        {
                            NrEquipItemInfo equipItemInfo = soldierInfo.GetEquipItemInfo();
                            if (equipItemInfo != null)
                            {
                                for (int j = 0; j < 6; j++)
                                {
                                    if (0 < equipItemInfo.GetItemUnique(j))
                                    {
                                        int num = equipItemInfo.m_kItem[j].GetItem().m_nOption[2];
                                        if (num >= 3)
                                        {
                                            return(false);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                return(true);
            }
        }
        return(false);
    }
Example #26
0
    public override bool CheckCondition(long i64Param, ref long i64ParamVal)
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return(false);
        }
        int num = 0;

        for (int i = 0; i < 6; i++)
        {
            NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
            if (soldierInfo != null && soldierInfo.GetSolID() != 0L)
            {
                for (int j = 0; j < 6; j++)
                {
                    int battleSkillUnique = soldierInfo.GetBattleSkillUnique(j);
                    if (0 < battleSkillUnique)
                    {
                        int battleSkillLevel = soldierInfo.GetBattleSkillLevel(battleSkillUnique);
                        if (NrTSingleton <BattleSkill_Manager> .Instance.GetBattleSkillTraining(battleSkillUnique, battleSkillLevel) != null)
                        {
                            if (0 < battleSkillLevel)
                            {
                                num++;
                            }
                            if (base.GetParamVal() <= (long)num)
                            {
                                return(true);
                            }
                        }
                    }
                }
            }
        }
        return(false);
    }
    public override void ExcuteGameGuide()
    {
        NrMyCharInfo myCharInfo = NrTSingleton <NkCharManager> .Instance.GetMyCharInfo();

        if (myCharInfo == null)
        {
            return;
        }
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return;
        }
        int num = -1;

        for (int i = 0; i < 6; i++)
        {
            NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
            if (soldierInfo != null)
            {
                if (soldierInfo.GetSolID() == 0L)
                {
                    if (myCharInfo.IsAddBattleSoldier(i))
                    {
                        num = i;
                        break;
                    }
                }
            }
        }
        if (num == -1)
        {
            return;
        }
        NkReadySolList readySolList = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetReadySolList();

        if (readySolList == null)
        {
            return;
        }
        if (1 > readySolList.GetCount())
        {
            return;
        }
        List <NkSoldierInfo> list = new List <NkSoldierInfo>(readySolList.GetList().Values);

        if (list == null)
        {
            return;
        }
        list.Sort(new Comparison <NkSoldierInfo>(this.CompareExp));
        for (int j = 0; j < list.Count; j++)
        {
            NkSoldierInfo nkSoldierInfo = list[j];
            if (nkSoldierInfo != null)
            {
                NrCharKindInfo charKindInfo = nkSoldierInfo.GetCharKindInfo();
                if (charKindInfo != null)
                {
                    if (charKindInfo.GetCHARKIND_CLASSINFO() != null)
                    {
                        int num2 = 0;
                        for (int k = 0; k < 6; k++)
                        {
                            NkSoldierInfo soldierInfo2 = charPersonInfo.GetSoldierInfo(k);
                            if (soldierInfo2 != null)
                            {
                                if (soldierInfo2.GetSolID() != 0L)
                                {
                                    if (soldierInfo2.GetCharKind() == nkSoldierInfo.GetCharKind())
                                    {
                                        num2++;
                                    }
                                }
                            }
                        }
                        if (num2 < (int)nkSoldierInfo.GetJoinCount())
                        {
                            this.SendSolChangeToServer(ref nkSoldierInfo, 1, 1);
                            return;
                        }
                    }
                }
            }
        }
    }
Example #28
0
    private bool CheckGuide()
    {
        this.destItem = null;
        this.srcItem  = null;
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo != null)
        {
            for (int i = 0; i < 6; i++)
            {
                NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
                if (soldierInfo != null)
                {
                    if (soldierInfo.GetSolID() != 0L)
                    {
                        NrEquipItemInfo equipItemInfo = soldierInfo.GetEquipItemInfo();
                        if (equipItemInfo != null)
                        {
                            for (int j = 0; j < 6; j++)
                            {
                                if (0 < equipItemInfo.GetItemUnique(j))
                                {
                                    ITEM batterItemByUnique = NkUserInventory.instance.GetBatterItemByUnique(equipItemInfo.GetItem(j), soldierInfo.GetLevel());
                                    if (batterItemByUnique != null)
                                    {
                                        this.destItem = equipItemInfo.GetItem(j);
                                        this.srcItem  = batterItemByUnique;
                                        NkSoldierInfo soldierInfo2 = charPersonInfo.GetSoldierInfo(0);
                                        if (soldierInfo2 != null)
                                        {
                                            this.srcSolID = soldierInfo2.GetSolID();
                                        }
                                        this.destSolID = soldierInfo.GetSolID();
                                        return(true);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        NkReadySolList readySolList = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetReadySolList();

        if (readySolList == null)
        {
            return(false);
        }
        foreach (NkSoldierInfo current in readySolList.GetList().Values)
        {
            if (current != null)
            {
                if (0L < current.GetExp())
                {
                    if (current.GetSolID() != 0L)
                    {
                        NrEquipItemInfo equipItemInfo2 = current.GetEquipItemInfo();
                        if (equipItemInfo2 != null)
                        {
                            for (int k = 0; k < 6; k++)
                            {
                                if (0 < equipItemInfo2.GetItemUnique(k))
                                {
                                    ITEM batterItemByUnique2 = NkUserInventory.instance.GetBatterItemByUnique(equipItemInfo2.GetItem(k), current.GetLevel());
                                    if (batterItemByUnique2 != null)
                                    {
                                        this.destItem = equipItemInfo2.GetItem(k);
                                        this.srcItem  = batterItemByUnique2;
                                        NkSoldierInfo soldierInfo3 = charPersonInfo.GetSoldierInfo(0);
                                        if (soldierInfo3 != null)
                                        {
                                            this.srcSolID = soldierInfo3.GetSolID();
                                        }
                                        this.destSolID = current.GetSolID();
                                        return(true);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        return(false);
    }
    private void InsertList(SolComposeListDlg.SOL_LIST_INSERT_TYPE eIndex)
    {
        if (SolComposeMainDlg.Instance == null)
        {
            this.OnClose();
            return;
        }
        this.mSortList.Clear();
        this.mCheckList.Clear();
        bool flag  = eIndex == SolComposeListDlg.SOL_LIST_INSERT_TYPE.ALL || eIndex == SolComposeListDlg.SOL_LIST_INSERT_TYPE.BATTLE;
        bool flag2 = eIndex == SolComposeListDlg.SOL_LIST_INSERT_TYPE.ALL || eIndex == SolComposeListDlg.SOL_LIST_INSERT_TYPE.WAIT;
        bool flag3 = eIndex == SolComposeListDlg.SOL_LIST_INSERT_TYPE.ALL || eIndex == SolComposeListDlg.SOL_LIST_INSERT_TYPE.WAREHOUSE;

        if (!this.m_bMainSelect)
        {
            flag  = false;
            flag2 = true;
            flag3 = false;
        }
        if (NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo != null)
        {
            NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

            if (flag && charPersonInfo != null)
            {
                for (int i = 0; i < 6; i++)
                {
                    NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
                    if (soldierInfo != null)
                    {
                        if (soldierInfo.GetSolID() > 0L)
                        {
                            if (this.m_bMainSelect || !soldierInfo.IsLeader())
                            {
                                if (this.m_eShowType == SOLCOMPOSE_TYPE.TRANSCENDENCE)
                                {
                                    if (this.m_bMainSelect)
                                    {
                                        if (soldierInfo.GetGrade() < 6)
                                        {
                                            goto IL_152;
                                        }
                                        if (soldierInfo.GetGrade() == 9 || soldierInfo.GetGrade() >= 13)
                                        {
                                            goto IL_152;
                                        }
                                    }
                                }
                                else if (this.m_eShowType == SOLCOMPOSE_TYPE.COMPOSE && !this.IsAddComposeList(soldierInfo))
                                {
                                    goto IL_152;
                                }
                                this.mSortList.Add(soldierInfo);
                            }
                        }
                    }
                    IL_152 :;
                }
            }
            if (flag2)
            {
                NkReadySolList readySolList = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetReadySolList();

                foreach (NkSoldierInfo current in readySolList.GetList().Values)
                {
                    if (this.m_bMainSelect && this.m_eShowType == SOLCOMPOSE_TYPE.TRANSCENDENCE)
                    {
                        if (current.GetSolPosType() != 0 && current.GetSolPosType() != 2)
                        {
                            continue;
                        }
                    }
                    else if (current.GetSolPosType() != 0)
                    {
                        continue;
                    }
                    if (this.m_bMainSelect || NrTSingleton <NkCharManager> .Instance.GetMyCharInfo().GetFaceSolID() != current.GetSolID())
                    {
                        switch (this.m_eShowType)
                        {
                        case SOLCOMPOSE_TYPE.COMPOSE:
                            if (!this.IsAddComposeList(current))
                            {
                                continue;
                            }
                            if (!this.m_bMainSelect)
                            {
                                if (current.GetGrade() >= 6)
                                {
                                    continue;
                                }
                                if (current.IsAtbCommonFlag(1L))
                                {
                                    continue;
                                }
                            }
                            break;

                        case SOLCOMPOSE_TYPE.EXTRACT:
                            if (current.GetGrade() < 5)
                            {
                                continue;
                            }
                            if (current.GetGrade() >= 6)
                            {
                                continue;
                            }
                            if (current.IsAtbCommonFlag(1L))
                            {
                                continue;
                            }
                            break;

                        case SOLCOMPOSE_TYPE.TRANSCENDENCE:
                            if (current.GetGrade() < 6)
                            {
                                continue;
                            }
                            if (!this.m_bMainSelect)
                            {
                                if (current.IsAtbCommonFlag(1L))
                                {
                                    continue;
                                }
                            }
                            else if (current.GetGrade() == 9 || current.GetGrade() >= 13)
                            {
                                continue;
                            }
                            break;
                        }
                        this.mSortList.Add(current);
                    }
                }
            }
            if (flag3 && this.m_bMainSelect)
            {
                List <NkSoldierInfo> solWarehouseList = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetSolWarehouseList();

                foreach (NkSoldierInfo current2 in solWarehouseList)
                {
                    if (current2.GetSolPosType() == 5)
                    {
                        switch (this.m_eShowType)
                        {
                        case SOLCOMPOSE_TYPE.COMPOSE:
                            if (!this.IsAddComposeList(current2))
                            {
                                continue;
                            }
                            if (!this.m_bMainSelect && current2.IsAtbCommonFlag(1L))
                            {
                                continue;
                            }
                            break;

                        case SOLCOMPOSE_TYPE.TRANSCENDENCE:
                            if (current2.GetGrade() < 6)
                            {
                                continue;
                            }
                            if (current2.GetGrade() == 9 || current2.GetGrade() >= 13)
                            {
                                continue;
                            }
                            break;
                        }
                        this.mSortList.Add(current2);
                    }
                }
            }
            if (!this.m_bMainSelect && SolComposeMainDlg.Instance.mBaseSol != null)
            {
                this.mSortList.Remove(SolComposeMainDlg.Instance.mBaseSol);
            }
            if (this.m_bMainSelect)
            {
                List <long> list = new List <long>();
                list.AddRange(SolComposeMainDlg.Instance.SUB_ARRAY);
                if (list.Count != 0)
                {
                    List <NkSoldierInfo> list2 = new List <NkSoldierInfo>();
                    foreach (NkSoldierInfo current3 in this.mSortList)
                    {
                        for (int j = 0; j < list.Count; j++)
                        {
                            if (current3.GetSolID() == list[j])
                            {
                                list2.Add(current3);
                            }
                        }
                    }
                    for (int k = 0; k < list2.Count; k++)
                    {
                        this.mSortList.Remove(list2[k]);
                    }
                    list2.Clear();
                }
            }
            if (!this.m_bMainSelect && SolComposeMainDlg.Instance != null)
            {
                this.mCheckList.AddRange(SolComposeMainDlg.Instance.SUB_ARRAY);
            }
        }
        this.ddList1.SetIndex((int)eIndex);
        this.ddList1.RepositionItems();
        this.ChangeSortDDL(null);
    }
Example #30
0
    private bool CheckGuide()
    {
        this.srcItem  = null;
        this.destItem = null;
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo != null)
        {
            for (int i = 0; i < 6; i++)
            {
                NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
                if (soldierInfo != null)
                {
                    if (soldierInfo.GetSolID() != 0L)
                    {
                        ITEM iTEM = null;
                        int  num  = soldierInfo.GetEquipItemInfo().HaveEquipItem(ref iTEM, soldierInfo);
                        if (-1 < num && iTEM != null)
                        {
                            NkSoldierInfo soldierInfo2 = charPersonInfo.GetSoldierInfo(0);
                            if (soldierInfo2 != null)
                            {
                                this.srcSolID = soldierInfo2.GetSolID();
                            }
                            ITEMINFO itemInfo = NrTSingleton <ItemManager> .Instance.GetItemInfo(iTEM.m_nItemUnique);

                            if (itemInfo != null && itemInfo.m_nItemType == 19 && !soldierInfo.IsAtbCommonFlag(2L))
                            {
                                return(false);
                            }
                            this.srcItem   = iTEM;
                            this.destSolID = soldierInfo.GetSolID();
                            return(true);
                        }
                        else
                        {
                            NrEquipItemInfo equipItemInfo = soldierInfo.GetEquipItemInfo();
                            if (equipItemInfo != null)
                            {
                                for (int j = 0; j < 6; j++)
                                {
                                    if (j != 5 || soldierInfo.IsAtbCommonFlag(2L))
                                    {
                                        if (0 < equipItemInfo.GetItemUnique(j))
                                        {
                                            if (equipItemInfo.GetItem(j).m_nOption[4] == 0)
                                            {
                                                ITEM batterItemByUnique = NkUserInventory.instance.GetBatterItemByUnique(equipItemInfo.GetItem(j), soldierInfo.GetLevel());
                                                if (batterItemByUnique != null)
                                                {
                                                    this.destItem = equipItemInfo.GetItem(j);
                                                    this.srcItem  = batterItemByUnique;
                                                    NkSoldierInfo soldierInfo3 = charPersonInfo.GetSoldierInfo(0);
                                                    if (soldierInfo3 != null)
                                                    {
                                                        this.srcSolID = soldierInfo3.GetSolID();
                                                    }
                                                    this.destSolID = soldierInfo.GetSolID();
                                                    return(true);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            NkReadySolList readySolList = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetReadySolList();

            if (readySolList == null)
            {
                return(false);
            }
            foreach (NkSoldierInfo current in readySolList.GetList().Values)
            {
                if (current != null)
                {
                    if (0L < current.GetExp())
                    {
                        if (current.GetSolID() != 0L)
                        {
                            if (current.GetSolPosType() != 2 && current.GetSolPosType() != 6)
                            {
                                ITEM iTEM2 = null;
                                int  num2  = current.GetEquipItemInfo().HaveEquipItem(ref iTEM2, current);
                                if (-1 < num2 && iTEM2 != null)
                                {
                                    NkSoldierInfo soldierInfo4 = charPersonInfo.GetSoldierInfo(0);
                                    if (soldierInfo4 != null)
                                    {
                                        this.srcSolID = soldierInfo4.GetSolID();
                                    }
                                    ITEMINFO itemInfo2 = NrTSingleton <ItemManager> .Instance.GetItemInfo(iTEM2.m_nItemUnique);

                                    bool result;
                                    if (itemInfo2 != null && itemInfo2.m_nItemType == 19 && !current.IsAtbCommonFlag(2L))
                                    {
                                        result = false;
                                        return(result);
                                    }
                                    this.srcItem   = iTEM2;
                                    this.destSolID = current.GetSolID();
                                    result         = true;
                                    return(result);
                                }
                                else
                                {
                                    NrEquipItemInfo equipItemInfo2 = current.GetEquipItemInfo();
                                    if (equipItemInfo2 != null)
                                    {
                                        for (int k = 0; k < 6; k++)
                                        {
                                            if (k != 5 || current.IsAtbCommonFlag(2L))
                                            {
                                                if (0 < equipItemInfo2.GetItemUnique(k))
                                                {
                                                    ITEM batterItemByUnique2 = NkUserInventory.instance.GetBatterItemByUnique(equipItemInfo2.GetItem(k), current.GetLevel());
                                                    if (batterItemByUnique2 != null)
                                                    {
                                                        this.destItem = equipItemInfo2.GetItem(k);
                                                        this.srcItem  = batterItemByUnique2;
                                                        NkSoldierInfo soldierInfo5 = charPersonInfo.GetSoldierInfo(0);
                                                        if (soldierInfo5 != null)
                                                        {
                                                            this.srcSolID = soldierInfo5.GetSolID();
                                                        }
                                                        this.destSolID = current.GetSolID();
                                                        bool result = true;
                                                        return(result);
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return(false);
        }
        return(false);
    }