Exemplo n.º 1
0
    int GetNewBonusAddItemByLevel(int nLevel, int nProfession, int index)
    {
        Tab_VipBook tBook = TableManager.GetVipBookByID(nLevel, 0);

        if (tBook != null && nProfession >= 0 && nProfession < tBook.getVipAddCount())
        {
            if (0 == index)
            {
                return(tBook.GetNew1VipAddbyIndex(nProfession));
            }
            else if (1 == index)
            {
                return(tBook.GetNew2VipAddbyIndex(nProfession));
            }
            else if (2 == index)
            {
                return(tBook.GetNew3VipAddbyIndex(nProfession));
            }
            else if (3 == index)
            {
                return(tBook.GetNew4VipAddbyIndex(nProfession));
            }
        }
        return(0);
    }
Exemplo n.º 2
0
    int GetNewAddCount(int nLevel, int nProfession, int index)
    {
        Tab_VipBook tBook = TableManager.GetVipBookByID(nLevel, 0);

        if (tBook != null && nProfession >= 0 && nProfession < tBook.getVipAddCount())
        {
            if (0 == index)
            {
                return(tBook.New1AddCount);
            }
            else if (1 == index)
            {
                return(tBook.New2AddCount);
            }
            else if (2 == index)
            {
                return(tBook.New3AddCount);
            }
            else if (3 == index)
            {
                return(tBook.New4AddCount);
            }
        }
        return(0);
    }
Exemplo n.º 3
0
    /*
     * return 1: single, 2:team,0:valid
     */
    public static int GetBuyCopySceneMode(int sceneid, int nSingle)
    {
        Tab_VipBook pVipBook = TableManager.GetVipBookByID(0, 0);

        if (pVipBook != null)
        {
            if (nSingle == 1)
            {
                return(1);
//                for (int i = 0; i < pVipBook.getSceneIdCount(); i++)
//				{
//                    if (sceneid == pVipBook.GetSceneIdbyIndex(i))
//					{
//                        return 1;
//                    }
//                }
            }
            else
            {
                for (int i = 0; i < pVipBook.getTeamSceneIdCount(); ++i)
                {
                    if (sceneid == pVipBook.GetTeamSceneIdbyIndex(i))
                    {
                        return(2);
                    }
                }
            }
        }
        return(0);
    }
Exemplo n.º 4
0
    public static void GetVipLevel(int nCost, ref int rLevel, ref int rLeft)
    {
        if (nCost < 0)
        {
            rLeft  = 0;
            rLevel = 0;
            return;
        }
        Dictionary <int, List <Tab_VipBook> > allData = TableManager.GetVipBook();

        foreach (int key in allData.Keys)
        {
            Tab_VipBook tBook = allData[key][0];
            if (nCost >= tBook.VipCost)
            {
                nCost -= tBook.VipCost;
                rLevel = tBook.Id;
                rLeft  = nCost;
            }
            else
            {
                break;
            }
        }
    }
Exemplo n.º 5
0
    public static int GetVipMaxTeamCopySceneNum(int sceneid, int nCost)
    {
        if (nCost < 0)
        {
            return(0);
        }

        int nLevel = 0;
        int nLeft  = 0;

        GetVipLevel(nCost, ref nLevel, ref nLeft);
        Tab_VipBook pVipBook = TableManager.GetVipBookByID(nLevel, 0);

        if (pVipBook != null)
        {
            for (int i = 0; i < pVipBook.getTeamSceneIdCount(); ++i)
            {
                if (pVipBook.GetTeamSceneIdbyIndex(i) == sceneid)
                {
                    return(pVipBook.GetBuyTeamSceneCountbyIndex(i));
                }
            }
        }
        return(0);
    }
Exemplo n.º 6
0
    public static bool IsCanSweepCopyScene(int sceneid)
    {
        //藏经阁谁都可以扫荡
        if (sceneid == (int)Games.GlobeDefine.GameDefine_Globe.TLI_COPYSCENEID.TLI_CANGJINGGE)
        {
            return(true);
        }

        if (Singleton <ObjManager> .Instance.MainPlayer != null)
        {
            int nCost  = Singleton <ObjManager> .Instance.MainPlayer.VipCost;
            int nLevel = 0;
            int nLeft  = 0;
            GetVipLevel(nCost, ref nLevel, ref nLeft);
            Tab_VipBook tBook = TableManager.GetVipBookByID(nLevel, 0);
            if (tBook != null)
            {
                for (int i = 0; i < tBook.getSceneIdCount(); i++)
                {
                    if (sceneid == tBook.GetSceneIdbyIndex(i))
                    {
                        return(tBook.GetSweepCountbyIndex(i) > 0);
                    }
                }
            }
        }
        return(false);
    }
Exemplo n.º 7
0
    int GetBonusAddItemByLevel(int nLevel, int nProfession)
    {
        Tab_VipBook tBook = TableManager.GetVipBookByID(nLevel, 0);

        if (tBook != null && nProfession >= 0 && nProfession < tBook.getVipAddCount())
        {
            return(tBook.GetVipAddbyIndex(nProfession));
        }
        return(0);
    }
Exemplo n.º 8
0
    int GetMaxCostByLevel(int nLevel)
    {
        Tab_VipBook tBook = TableManager.GetVipBookByID(nLevel, 0);

        if (tBook != null)
        {
            return(tBook.VipCost);
        }
        return(99999999);
    }
Exemplo n.º 9
0
    public static bool CanChallengeHigher()
    {
        int vipLevel = GetVipLv();
        Dictionary <int, List <Tab_VipBook> > allData = TableManager.GetVipBook();

        foreach (int key in allData.Keys)
        {
            Tab_VipBook tBook = allData[key][0];
            if (tBook.Id == vipLevel)
            {
                return(tBook.HiChallenge > 0);
            }
        }
        return(false);
    }
Exemplo n.º 10
0
 public static int GetVipSweepYuanBao()
 {
     if (Singleton <ObjManager> .Instance.MainPlayer != null)
     {
         int nCost  = Singleton <ObjManager> .Instance.MainPlayer.VipCost;
         int nLevel = 0;
         int nLeft  = 0;
         GetVipLevel(nCost, ref nLevel, ref nLeft);
         Tab_VipBook tBook = TableManager.GetVipBookByID(nLevel, 0);
         if (tBook != null)
         {
             return(tBook.SDCost);
         }
     }
     return(0);
 }
Exemplo n.º 11
0
    public static int GetVipCopySceneMaxBuyNum(int sceneid)
    {
        Tab_VipBook tBook = TableManager.GetVipBookByID(GetVipLv(), 0);

        if (tBook != null)
        {
            for (int i = 0; i < tBook.getSceneIdCount(); i++)
            {
                if (sceneid == tBook.GetSceneIdbyIndex(i))
                {
                    return(tBook.GetBuyCountbyIndex(i));
                }
            }
        }
        return(0);
    }
Exemplo n.º 12
0
    public static int GetVipTeamCopySceneNum(int sceneid)
    {
//        int nId = GlobeVar.INVALID_ID;

        Tab_VipBook pVipBook = TableManager.GetVipBookByID(GetVipLv(), 0);

        if (pVipBook != null)
        {
            for (int i = 0; i < pVipBook.getTeamSceneIdCount(); ++i)
            {
                if (sceneid == pVipBook.GetTeamSceneIdbyIndex(i))
                {
                    return(GameManager.gameManager.PlayerDataPool.CommonData.GetCommonData(s_nVipTeamCopySceneArray[i]));
                }
            }
        }
        return(GlobeVar.INVALID_ID);
    }
Exemplo n.º 13
0
    public void UpdateVipTip()
    {
        int nVipCount = GameManager.gameManager.PlayerDataPool.CommonData.GetCommonData((int)Games.UserCommonData.USER_COMMONDATA.CD_VIPCP_MONEYTREE);

        if (m_VipAwardCountTipText)
        {
            Tab_VipBook Vip = TableManager.GetVipBookByID(VipData.GetVipLv(), 0);
            if (Vip == null)
            {
                return;
            }

            m_VipAwardCountTipText.text = StrDictionary.GetClientDictionaryString("#{4013}", nVipCount, Vip.VipMoneyTree);
        }

        if (YuanBaoAwardCount >= MoneyTreeYuanBaoAwardTimes && nVipCount <= 0)
        {
            m_YuanBaoButton.isEnabled = false;
        }
    }
Exemplo n.º 14
0
    /*
     * 获得副本剩余可购买次数,包括剧情幅本
     */
    public static int GetVipCopySceneRemainBuyNum(int sceneid, bool bIsSingle)
    {
        Tab_VipBook pVipBook = TableManager.GetVipBookByID(GetVipLv(), 0);

        if (pVipBook == null)
        {
            return(GlobeVar.INVALID_ID);
        }

        if (GCGame.Utils.GetSceneType(sceneid) == (int)Games.GlobeDefine.GameDefine_Globe.SCENE_TYPE.SCENETYPE_STORYCOPYSCENE)
        {
            return(GameManager.gameManager.PlayerDataPool.CommonData.GetCommonData((int)Games.UserCommonData.USER_COMMONDATA.CD_VIP_STORY_COPYSCENE));
        }
        else if (GCGame.Utils.GetSceneType(sceneid) == (int)Games.GlobeDefine.GameDefine_Globe.SCENE_TYPE.SCENETYPE_COPYSCENE)
        {
            if (pVipBook.getBuyCountCount() != s_nVipCopySceneArray.Length)
            {
                return(0);
            }
            if (bIsSingle)
            {
                for (int i = 0; i < pVipBook.getSceneIdCount(); ++i)
                {
                    if (pVipBook.GetSceneIdbyIndex(i) == sceneid)
                    {
                        return(GameManager.gameManager.PlayerDataPool.CommonData.GetCommonData(s_nVipCopySceneArray[i]));
                    }
                }
            }
            else
            {
                //这里还没有找到场景,去组队幅本里找
                return(GetVipTeamCopySceneNum(sceneid));
            }
        }
        return(GlobeVar.INVALID_ID);
    }
Exemplo n.º 15
0
    int GetCurMTVipID()
    {
        int nMaxNum = 0;
//         for (int i = 1; i < TableManager.GetMoneyTreeVIP().Count && i <= VipData.GetVipLv(); i++ )
//         {
//             Tab_VipBook vipTab = TableManager.GetVipBookByID(i, 0);
//             if (vipTab == null)
//            {
//                 continue;
//            }
//             nID += vipTab.VipMoneyTree;
//         }

        Tab_VipBook vipTab = TableManager.GetVipBookByID(VipData.GetVipLv(), 0);

        if (vipTab != null)
        {
            nMaxNum = vipTab.VipMoneyTree;
        }

        int nVipCount = GameManager.gameManager.PlayerDataPool.CommonData.GetCommonData((int)Games.UserCommonData.USER_COMMONDATA.CD_VIPCP_MONEYTREE);

        return(nMaxNum - nVipCount);
    }
Exemplo n.º 16
0
    void RefreshVIPIntro(int nLevel)
    {
        m_LevelIntro.text = "";
        Tab_VipBook tBook = TableManager.GetVipBookByID(nLevel, 0);

        m_DragPanel.SetDragAmount(0, 0, false);
        if (tBook != null && nLevel > 0)
        {
            int            nCost    = 0;
            int            curLevel = 0;
            int            nLeft    = 0;
            Obj_MainPlayer obj      = Singleton <ObjManager> .GetInstance().MainPlayer;

            if (obj != null)
            {
                nCost = obj.VipCost;
            }
            VipData.GetVipLevel(nCost, ref curLevel, ref nLeft);
            if (curLevel < nLevel)
            {
                m_GiveBounsBtn.gameObject.GetComponent <UIWidget>().color = new Color(0, 0, 0, 1);
                m_GiveBounsBtn.transform.parent.GetComponent <UIButtonMessage>().enabled = false;
            }
            else
            {
                int nVipCommonDataAward = GameManager.gameManager.PlayerDataPool.CommonData.GetCommonData((int)Games.UserCommonData.USER_COMMONDATA.CD_VIP_AWARD_COMMONDATA);

                if ((nVipCommonDataAward & (1 << nLevel)) > 0)
                {
                    m_GiveBounsBtn.gameObject.GetComponent <UIWidget>().color = new Color(0, 0, 0, 1);
                    m_GiveBounsBtn.transform.parent.GetComponent <UIButtonMessage>().enabled = false;
                }
                else
                {
                    m_GiveBounsBtn.gameObject.GetComponent <UIWidget>().color = new Color(1, 1, 1, 1);
                    m_GiveBounsBtn.transform.parent.GetComponent <UIButtonMessage>().enabled = true;
                }
            }

            //m_LevelIntro.text += "升级到VIP" + nLevel.ToString() + "级后,您将享有以下特权:\n";
            m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{2883}", nLevel);

            m_LevelText.text = StrDictionary.GetClientDictionaryString("#{2882}", nLevel);

            //m_LevelIntro.text += "1 每天购买体力次数最多为" + VipData.GetVipStamina(nLevel).ToString() + "次\n";
            m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{2884}", VipData.GetVipStamina(nLevel));

            // 开启科技苑第{0}个实验室#r
            int deskindex = VipData.GetDeskIndex(nLevel);
            if (deskindex >= 0)
            {
                m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{3243}", deskindex);
            }

            // 开启自动强化功能#r
            if (nLevel >= GlobeVar.USE_AUTOFIGHT_VIPLEVEL)
            {
                m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{3244}");
            }

            // 每日摇钱树付费摇钱次数增加{0}次#r
            if (tBook.VipMoneyTree > 0)
            {
                m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{4012}", tBook.VipMoneyTree);
            }

            //m_LevelIntro.text += "4 每日各副本免费进入次数增加" + tBook.VipCopyScene.ToString() + "次\n";
            int nTotal = 0;
            for (int i = 0; i < tBook.getSceneIdCount(); ++i)
            {
                nTotal += tBook.GetBuyCountbyIndex(i);
            }
            if (nTotal > 0)
            {
                m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{2887}");
            }

            // 机械研究所:{0}次#r
            if (tBook.GetBuyCountbyIndex(0) > 0)
            {
                m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{3139}", tBook.GetBuyCountbyIndex(0));
            }

            // 雷纳堡:{0}次#r
            if (tBook.GetBuyCountbyIndex(1) > 0)
            {
                m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{3141}", tBook.GetBuyCountbyIndex(1));
            }

            // 冰冻地下墓地:{0}次#r
            if (tBook.GetBuyCountbyIndex(2) > 0)
            {
                m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{3142}", tBook.GetBuyCountbyIndex(2));
            }

            // 废弃都市:{0}次#r
            if (tBook.GetBuyCountbyIndex(3) > 0)
            {
                m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{3143}", tBook.GetBuyCountbyIndex(3));
            }

            // 黄昏要塞:{0}次#r
            if (tBook.GetBuyCountbyIndex(4) > 0)
            {
                m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{3144}", tBook.GetBuyCountbyIndex(4));
            }

            // 每日可购买剧情副本挑战次数{0}次#r
            if (tBook.BuyStorySceneCount > 0)
            {
                m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{11358}", tBook.BuyStorySceneCount);
            }
            //if ( tBook.VipJXZ > 0 )
            //{
            //    m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{3140}", tBook.VipJXZ);
            // }

            //开启扫荡功能的副本如下——#r
            int nOpen = 0;
            for (int i = 0; i < tBook.getSceneIdCount(); ++i)
            {
                nOpen += tBook.GetSweepCountbyIndex(i);
            }
            if (nOpen > 0)
            {
                m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{4834}");
            }
            // 机械研究所#r
            if (tBook.GetSweepCountbyIndex(0) > 0)
            {
                m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{4884}");
            }

            // 雷纳堡#r
            if (tBook.GetSweepCountbyIndex(1) > 0)
            {
                m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{4887}");
            }

            // 冰冻地下墓地#r
            if (tBook.GetSweepCountbyIndex(2) > 0)
            {
                m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{4885}");
            }

            // 废弃都市#r
            if (tBook.GetSweepCountbyIndex(3) > 0)
            {
                m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{4883}");
            }

            // 黄昏要塞#r
            if (tBook.GetSweepCountbyIndex(4) > 0)
            {
                m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{4886}");
            }

            //各副本每日组队次数增加——#r
            if (tBook.GetBuyTeamSceneCountbyIndex(0) + tBook.GetBuyTeamSceneCountbyIndex(1) > 0)
            {
                m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{4832}");
            }

            // 机械研究所:{0}次#r
            if (tBook.GetBuyTeamSceneCountbyIndex(0) > 0)
            {
                m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{3139}", tBook.GetBuyTeamSceneCountbyIndex(0));
            }

            // 冰冻地下墓地:{0}次#r
            if (tBook.GetBuyTeamSceneCountbyIndex(1) > 0)
            {
                m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{3142}", tBook.GetBuyTeamSceneCountbyIndex(1));
            }

            // 空
            if (tBook.GetBuyTeamSceneCountbyIndex(2) > 0)
            {
                m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{4833}");
            }
            //您可以在江湖名人录直接挑战排名前200的玩家
            if (tBook.HiChallenge > 0)
            {
                m_LevelIntro.text += StrDictionary.GetClientDictionaryString("#{4835}");
            }

            string strText = m_LevelIntro.text;
            m_LevelIntro.text = strText.Substring(0, strText.Length - 1);

            //m_LevelIntro.text += " 清杀气" + tBook.VipPKValue.ToString();
            // m_LevelIntro.text += "6 每日免费摇奖次数增加" + tBook.VipBonusBox.ToString()+"次";

            /*Tab_CommonItem tItemBook = TableManager.GetCommonItemByID(tBook.VipItem.ToString(), 0);
             * if (tItemBook != null)
             * {
             *  m_LevelIntro.text += " 升级奖励物品" + tItemBook.Name;
             * } */

            int nProfession = GameManager.gameManager.PlayerDataPool.Profession;
            int nItem       = GetBonusItemByLevel(nLevel, nProfession);
            //0级不应该有物品领取,直接不显示。
            if (nItem > 0 && nLevel > 0)
            {
                m_BonusEquip.SetActive(true);
                //奖励物品提示
                //m_BonusText.text = nLevel.ToString() + "级会员可以领取";// +GetItemNameById(nItem);
                //m_BonusText.text = StrDictionary.GetClientDictionaryString("#{2881}", nLevel);

                //奖励物品图标
                m_BonusImage.spriteName = GetItemIconById(nItem);
                m_SavedItem             = nItem;
                if (tBook.ItemCount > 1)
                {
                    m_BonusNum.text = tBook.ItemCount.ToString();
                }
                else
                {
                    m_BonusNum.text = "";
                }

                int nMyLv = VipData.GetVipLv();
                if (nMyLv >= nLevel)
                {
                    m_SentSprite.spriteName = "";
                }
                else
                {
                    m_SentSprite.spriteName = "";
                }

                m_BonusQuality.spriteName = GetItemQualityById(nItem);
            }
            else
            {
                m_BonusEquip.SetActive(false);
                m_BonusText.text          = "";
                m_BonusImage.spriteName   = "";
                m_SentSprite.spriteName   = "";
                m_BonusNum.text           = "";
                m_BonusQuality.spriteName = "";
            }

            int nAddItem = GetBonusAddItemByLevel(nLevel, nProfession);
            //0级不应该有物品领取,直接不显示。
            if (nAddItem > 0 && nLevel > 0)
            {
                m_AddItem.SetActive(true);

                //奖励物品图标
                m_AddImage.spriteName = GetItemIconById(nAddItem);
                m_SavedAdd            = nAddItem;
                if (tBook.AddCount > 1)
                {
                    m_AddNum.text = tBook.AddCount.ToString();
                }
                else
                {
                    m_AddNum.text = "";
                }

                int nMyLv = VipData.GetVipLv();
                if (nMyLv >= nLevel)
                {
                    m_AddSprite.spriteName = "";
                }
                else
                {
                    m_AddSprite.spriteName = "";
                }

                m_AddQuality.spriteName = GetItemQualityById(nAddItem);
            }
            else
            {
                m_AddItem.SetActive(false);
                m_AddImage.spriteName   = "";
                m_AddSprite.spriteName  = "";
                m_AddNum.text           = "";
                m_AddQuality.spriteName = "";
            }

            //新增的四个物品
            for (int i = 0; i < m_NewAddItem.Length; i++)
            {
                int nNewAddItem = GetNewBonusAddItemByLevel(nLevel, nProfession, i);
                //0级不应该有物品领取,直接不显示。
                if (nNewAddItem > 0 && nLevel > 0)
                {
                    m_NewAddItem[i].SetActive(true);

                    //奖励物品图标
                    m_NewAddImage[i].spriteName = GetItemIconById(nNewAddItem);
                    m_NewSavedAdd[i]            = nNewAddItem;
                    if (GetNewAddCount(nLevel, nProfession, i) > 1)
                    {
                        m_NewAddNum[i].text = GetNewAddCount(nLevel, nProfession, i).ToString();
                    }
                    else
                    {
                        m_NewAddNum[i].text = "";
                    }

                    int nMyLv = VipData.GetVipLv();
                    if (nMyLv >= nLevel)
                    {
                        m_SendSprite[i].spriteName = "";
                    }
                    else
                    {
                        m_SendSprite[i].spriteName = "";
                    }

                    m_NewAddQuality[i].spriteName = GetItemQualityById(nNewAddItem);
                }
                else
                {
                    m_NewAddItem[i].SetActive(false);
                    m_NewAddImage[i].spriteName   = "";
                    m_SendSprite[i].spriteName    = "";
                    m_NewAddNum[i].text           = "";
                    m_NewAddQuality[i].spriteName = "";
                }
            }
            //新增的四个物品
        }

        NGUITools.SetActive(m_preVipButton, m_ShowLevel > 1);
        NGUITools.SetActive(m_nextVipButton, m_ShowLevel < VipData.m_MaxShowLevel);
        SetArrowLabel(m_ShowLevel);
    }