示例#1
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);
    }
示例#2
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);
    }