Пример #1
0
        public void OpenAwakeAwardForm()
        {
            CUIFormScript script = Singleton <CUIManager> .GetInstance().OpenForm(s_heroAwakeFinishFormPath, false, true);

            if (script != null)
            {
                Text             component = script.transform.Find("Panel/panelRewards/award1/lblDesc").GetComponent <Text>();
                Text             text2     = script.transform.Find("Panel/panelRewards/award2/lblDesc").GetComponent <Text>();
                CUI3DImageScript script2   = script.transform.Find("3DImage").GetComponent <CUI3DImageScript>();
                ResTalentLib     dataByKey = GameDataMgr.talentLib.GetDataByKey(this.m_heroInfo.cfgInfo.dwWakeTalentID);
                if (dataByKey != null)
                {
                    component.text = StringHelper.UTF8BytesToString(ref dataByKey.szDesc);
                }
                ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(this.m_heroInfo.cfgInfo.dwWakeSkinID);
                if (heroSkin != null)
                {
                    string[] args = new string[] { StringHelper.UTF8BytesToString(ref heroSkin.szSkinName) };
                    text2.text = Singleton <CTextManager> .instance.GetText("HeroAwake_Tips3", args);
                }
                ObjNameData data  = CUICommonSystem.GetHeroPrefabPath(this.m_heroInfo.cfgInfo.dwCfgID, (int)heroSkin.dwSkinID, true);
                GameObject  model = (script2 == null) ? null : script2.AddGameObject(data.ObjectName, false, false);
                if (model != null)
                {
                    CHeroAnimaSystem instance = Singleton <CHeroAnimaSystem> .GetInstance();

                    instance.Set3DModel(model);
                    instance.InitAnimatList();
                    instance.InitAnimatSoundList(this.m_heroInfo.cfgInfo.dwCfgID, heroSkin.dwSkinID);
                    instance.OnModePlayAnima("Come");
                }
            }
        }
Пример #2
0
        public static uint GetHeroSkinCost(uint heroId, uint skinId, RES_SHOPBUY_COINTYPE costType)
        {
            ResHeroSkinShop resHeroSkinShop = null;
            uint            skinCfgId       = CSkinInfo.GetSkinCfgId(heroId, skinId);

            GameDataMgr.skinShopInfoDict.TryGetValue(skinCfgId, out resHeroSkinShop);
            uint result = 0u;

            if (resHeroSkinShop == null)
            {
                return(result);
            }
            switch (costType)
            {
            case RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_SKINCOIN:
                return(resHeroSkinShop.dwBuySkinCoin);

            case RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_DIAMOND:
                return(resHeroSkinShop.dwBuyDiamond);
            }
            if (costType != RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_COUPONS)
            {
                return(result);
            }
            return(resHeroSkinShop.dwBuyCoupons);
        }
Пример #3
0
        private int CompareCoupons(ResHeroSkin l, ResHeroSkin r)
        {
            ResSkinPromotion skinPromotion    = CSkinInfo.GetSkinPromotion(l.dwHeroID, l.dwSkinID);
            ResSkinPromotion resPromotion     = CSkinInfo.GetSkinPromotion(r.dwHeroID, r.dwSkinID);
            stPayInfoSet     payInfoSetOfGood = CMallSystem.GetPayInfoSetOfGood(l, skinPromotion);
            stPayInfoSet     set2             = CMallSystem.GetPayInfoSetOfGood(r, resPromotion);
            uint             maxValue         = uint.MaxValue;
            uint             payValue         = uint.MaxValue;

            for (int i = 0; i < payInfoSetOfGood.m_payInfoCount; i++)
            {
                if ((((payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.Diamond) || (payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DianQuan)) || (payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DiamondAndDianQuan)) && (payInfoSetOfGood.m_payInfos[i].m_payValue < maxValue))
                {
                    maxValue = payInfoSetOfGood.m_payInfos[i].m_payValue;
                }
            }
            for (int j = 0; j < set2.m_payInfoCount; j++)
            {
                if ((((set2.m_payInfos[j].m_payType == enPayType.Diamond) || (set2.m_payInfos[j].m_payType == enPayType.DianQuan)) || (set2.m_payInfos[j].m_payType == enPayType.DiamondAndDianQuan)) && (set2.m_payInfos[j].m_payValue < payValue))
                {
                    payValue = set2.m_payInfos[j].m_payValue;
                }
            }
            if ((maxValue == uint.MaxValue) && this.IsDesc())
            {
                maxValue = 0;
            }
            if ((payValue == uint.MaxValue) && this.IsDesc())
            {
                payValue = 0;
            }
            return(maxValue.CompareTo(payValue));
        }
Пример #4
0
        public void OpenStartAwakeForm()
        {
            CUIFormScript script = Singleton <CUIManager> .GetInstance().OpenForm(s_heroAwakeFormPath, false, true);

            if (script != null)
            {
                Image      component = script.transform.Find("Panel/PanelLeft/HeroCell/Hero").GetComponent <Image>();
                Text       text      = script.transform.Find("Panel/PanelLeft/lblContent").GetComponent <Text>();
                Text       text2     = script.transform.Find("Panel/PanelLeft/panelRewards/award1/lblDesc").GetComponent <Text>();
                Text       text3     = script.transform.Find("Panel/PanelLeft/panelRewards/award2/lblDesc").GetComponent <Text>();
                GameObject prefab    = CUIUtility.GetSpritePrefeb(CUIUtility.s_Sprite_Dynamic_BustHero_Dir + StringHelper.UTF8BytesToString(ref this.m_heroInfo.cfgInfo.szImagePath), true, true);
                component.SetSprite(prefab);
                text.text = StringHelper.UTF8BytesToString(ref this.m_heroInfo.cfgInfo.szWakeDesc);
                ResTalentLib dataByKey = GameDataMgr.talentLib.GetDataByKey(this.m_heroInfo.cfgInfo.dwWakeTalentID);
                if (dataByKey != null)
                {
                    text2.text = StringHelper.UTF8BytesToString(ref dataByKey.szDesc);
                }
                ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(this.m_heroInfo.cfgInfo.dwWakeSkinID);
                if (heroSkin != null)
                {
                    string[] args = new string[] { StringHelper.UTF8BytesToString(ref heroSkin.szSkinName) };
                    text3.text = Singleton <CTextManager> .instance.GetText("HeroAwake_Tips3", args);
                }
            }
        }
Пример #5
0
        public static bool IsCanBuy(uint heroId, uint skinId)
        {
            ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId);

            if (heroSkin == null)
            {
                return(false);
            }
            if (!GameDataMgr.IsSkinAvailableAtShop(heroSkin.dwID))
            {
                return(false);
            }
            ResSkinPromotion resSkinPromotion = new ResSkinPromotion();
            stPayInfoSet     stPayInfoSet     = default(stPayInfoSet);

            resSkinPromotion = CSkinInfo.GetSkinPromotion(heroSkin.dwID);
            if (resSkinPromotion != null)
            {
                stPayInfoSet = CMallSystem.GetPayInfoSetOfGood(false, 0u, resSkinPromotion.bIsBuyCoupons > 0, resSkinPromotion.dwBuyCoupons, resSkinPromotion.bIsBuyDiamond > 0, resSkinPromotion.dwBuyDiamond, 10000u);
            }
            else
            {
                stPayInfoSet = CMallSystem.GetPayInfoSetOfGood(heroSkin);
            }
            return(stPayInfoSet.m_payInfoCount > 0);
        }
Пример #6
0
        public static uint GetHeroSkinCost(uint heroId, uint skinId, RES_SHOPBUY_COINTYPE costType)
        {
            ResHeroSkinShop resHeroSkinShop = null;
            uint            skinCfgId       = CSkinInfo.GetSkinCfgId(heroId, skinId);

            GameDataMgr.skinShopInfoDict.TryGetValue(skinCfgId, ref resHeroSkinShop);
            uint result = 0u;

            if (resHeroSkinShop != null)
            {
                switch (costType)
                {
                case 7:
                    result = resHeroSkinShop.dwBuySkinCoin;
                    return(result);

                case 8:
                case 9:
IL_3A:
                    if (costType != 2)
                    {
                        return(result);
                    }
                    result = resHeroSkinShop.dwBuyCoupons;
                    return(result);

                case 10:
                    result = resHeroSkinShop.dwBuyDiamond;
                    return(result);
                }
                goto IL_3A;
            }
            return(result);
        }
Пример #7
0
        public static void OnRecieveLimitSkinAdd(CSPkg msg)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            COMDT_HERO_LIMIT_SKIN_LIST stLimitSkinList = msg.stPkgData.stLimitSkinAdd.stLimitSkinList;

            for (int i = 0; i < stLimitSkinList.dwNum; i++)
            {
                COMDT_HERO_LIMIT_SKIN comdt_hero_limit_skin = stLimitSkinList.astSkinList[i];
                if (masterRoleInfo.heroExperienceSkinDic.ContainsKey(comdt_hero_limit_skin.dwSkinID))
                {
                    uint num2 = masterRoleInfo.heroExperienceSkinDic[comdt_hero_limit_skin.dwSkinID];
                    masterRoleInfo.heroExperienceSkinDic[comdt_hero_limit_skin.dwSkinID] = comdt_hero_limit_skin.dwDeadLine;
                    if ((0 < num2) && (num2 < masterRoleInfo.heroExperienceSkinDic[comdt_hero_limit_skin.dwSkinID]))
                    {
                        int      experienceHeroOrSkinExtendDays = CHeroInfo.GetExperienceHeroOrSkinExtendDays(masterRoleInfo.heroExperienceSkinDic[comdt_hero_limit_skin.dwSkinID] - num2);
                        string   skinName   = CSkinInfo.GetSkinName(comdt_hero_limit_skin.dwSkinID);
                        object[] replaceArr = new object[] { skinName, experienceHeroOrSkinExtendDays };
                        Singleton <CUIManager> .GetInstance().OpenTips("ExpCard_ExtendDays", true, 1f, null, replaceArr);
                    }
                }
                else
                {
                    uint num4;
                    uint num5;
                    masterRoleInfo.heroExperienceSkinDic.Add(comdt_hero_limit_skin.dwSkinID, comdt_hero_limit_skin.dwDeadLine);
                    CSkinInfo.ResolveHeroSkin(comdt_hero_limit_skin.dwSkinID, out num4, out num5);
                    CUICommonSystem.ShowNewHeroOrSkin(num4, num5, enUIEventID.None, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_SKIN, false, null, enFormPriority.Priority1, 0, CHeroInfo.GetExperienceHeroOrSkinValidDays(comdt_hero_limit_skin.dwDeadLine));
                }
            }
        }
Пример #8
0
        public static void GetHeroSkinProp(uint heroId, uint skinId, ref int[] propArr, ref int[] propPctArr, ref string[] propIconArr)
        {
            int num = 37;

            for (int i = 0; i < num; i++)
            {
                propArr[i]     = 0;
                propPctArr[i]  = 0;
                propIconArr[i] = string.Empty;
            }
            ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId);

            if (heroSkin != null)
            {
                for (int i = 0; i < heroSkin.astAttr.Length; i++)
                {
                    if (heroSkin.astAttr[i].wType == 0)
                    {
                        break;
                    }
                    if (heroSkin.astAttr[i].bValType == 0)
                    {
                        propArr[(int)heroSkin.astAttr[i].wType] += heroSkin.astAttr[i].iValue;
                    }
                    else if (heroSkin.astAttr[i].bValType == 1)
                    {
                        propPctArr[(int)heroSkin.astAttr[i].wType] += heroSkin.astAttr[i].iValue;
                    }
                }
            }
        }
Пример #9
0
        private void SetSkinItem(CMallItemWidget mallWidget, ResHeroSkin skinInfo, CUIFormScript form)
        {
            Image component = mallWidget.m_icon.GetComponent <Image>();

            component.color = CUIUtility.s_Color_White;
            string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustHero_Dir, skinInfo.szSkinPicID);

            component.SetSprite(prefabPath, form, false, true, true);
            mallWidget.m_skinLabel.CustomSetActive(true);
            CUICommonSystem.SetHeroSkinLabelPic(form, mallWidget.m_skinLabel, skinInfo.dwHeroID, skinInfo.dwSkinID);
            mallWidget.m_topNameLeftText.GetComponent <Text>().text = skinInfo.szHeroName;
            mallWidget.m_topNameRightText.CustomSetActive(true);
            mallWidget.m_topNameRightText.GetComponent <Text>().text = skinInfo.szSkinName;
            ResSkinPromotion skinPromotion = CSkinInfo.GetSkinPromotion(skinInfo.dwHeroID, skinInfo.dwSkinID);

            this._payInfoTemp = CMallSystem.GetPayInfoSetOfGood(skinInfo, skinPromotion);
            uint num = this.SetItemPriceInfo(mallWidget, ref this._payInfoTemp);

            this.SetItemTag(mallWidget, null, skinPromotion, form);
            stUIEventParams eventParams = new stUIEventParams();

            eventParams.openHeroFormPar.heroId = skinInfo.dwHeroID;
            eventParams.openHeroFormPar.skinId = skinInfo.dwSkinID;
            eventParams.commonUInt32Param1     = num;
            mallWidget.m_item.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.Mall_GiftShowDetail, eventParams);
            stUIEventParams params2 = new stUIEventParams();

            params2.heroSkinParam.heroId      = skinInfo.dwHeroID;
            params2.heroSkinParam.skinId      = skinInfo.dwSkinID;
            params2.heroSkinParam.isCanCharge = true;
            params2.commonUInt64Param1        = this._curFriendUid;
            params2.commonBool         = this._curFriendIsSns;
            params2.commonUInt32Param1 = this._curWorldId;
            mallWidget.m_buyBtn.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.HeroSkin_OpenBuyHeroSkinForFriend, params2);
        }
Пример #10
0
        private int CompareCoupons(ResHeroSkin l, ResHeroSkin r)
        {
            ResSkinPromotion skinPromotion     = CSkinInfo.GetSkinPromotion(l.dwHeroID, l.dwSkinID);
            ResSkinPromotion skinPromotion2    = CSkinInfo.GetSkinPromotion(r.dwHeroID, r.dwSkinID);
            stPayInfoSet     payInfoSetOfGood  = CMallSystem.GetPayInfoSetOfGood(l, skinPromotion);
            stPayInfoSet     payInfoSetOfGood2 = CMallSystem.GetPayInfoSetOfGood(r, skinPromotion2);
            uint             num  = 4294967295u;
            uint             num2 = 4294967295u;

            for (int i = 0; i < payInfoSetOfGood.m_payInfoCount; i++)
            {
                if ((payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.Diamond || payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DianQuan || payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DiamondAndDianQuan) && payInfoSetOfGood.m_payInfos[i].m_payValue < num)
                {
                    num = payInfoSetOfGood.m_payInfos[i].m_payValue;
                }
            }
            for (int j = 0; j < payInfoSetOfGood2.m_payInfoCount; j++)
            {
                if ((payInfoSetOfGood2.m_payInfos[j].m_payType == enPayType.Diamond || payInfoSetOfGood2.m_payInfos[j].m_payType == enPayType.DianQuan || payInfoSetOfGood2.m_payInfos[j].m_payType == enPayType.DiamondAndDianQuan) && payInfoSetOfGood2.m_payInfos[j].m_payValue < num2)
                {
                    num2 = payInfoSetOfGood2.m_payInfos[j].m_payValue;
                }
            }
            if (num == 4294967295u && this.IsDesc())
            {
                num = 0u;
            }
            if (num2 == 4294967295u && this.IsDesc())
            {
                num2 = 0u;
            }
            return(num.CompareTo(num2));
        }
Пример #11
0
        public static void OnReceiveDianQuanReward(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_CMD_COUPONS_REWARDINFO stCouponsRewardRsp = msg.stPkgData.stCouponsRewardRsp;
            bool       flag     = true;
            CPaySystem instance = Singleton <CPaySystem> .GetInstance();

            instance.rewardItems.Clear();
            int num = Mathf.Min(stCouponsRewardRsp.stRewardInfo.bNum, stCouponsRewardRsp.stRewardInfo.astRewardDetail.Length);

            for (int i = 0; i < num; i++)
            {
                if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 5)
                {
                    CUICommonSystem.ShowNewHeroOrSkin(stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stRewardInfo.stHero.dwHeroID, 0, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, false, null, enFormPriority.Priority1, 0, 0);
                    flag = false;
                    break;
                }
                if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 10)
                {
                    uint num3;
                    uint num4;
                    CSkinInfo.ResolveHeroSkin(stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stRewardInfo.stSkin.dwSkinID, out num3, out num4);
                    CUICommonSystem.ShowNewHeroOrSkin(num3, num4, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_SKIN, false, null, enFormPriority.Priority1, 0, 0);
                    flag = false;
                    break;
                }
                if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 1)
                {
                    if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bFromType == 1)
                    {
                        uint           dwHeroID  = stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stFromInfo.stHeroInfo.dwHeroID;
                        ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(dwHeroID);
                        if (dataByKey != null)
                        {
                            CUICommonSystem.ShowNewHeroOrSkin(dwHeroID, 0, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, true, null, enFormPriority.Priority1, dataByKey.dwChgItemCnt, 0);
                        }
                    }
                    else if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bFromType == 2)
                    {
                        uint dwSkinID = stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stFromInfo.stSkinInfo.dwSkinID;
                        uint heroId   = 0;
                        uint skinId   = 0;
                        CSkinInfo.ResolveHeroSkin(dwSkinID, out heroId, out skinId);
                        ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId);
                        if (heroSkin != null)
                        {
                            CUICommonSystem.ShowNewHeroOrSkin(heroId, skinId, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, true, null, enFormPriority.Priority1, heroSkin.dwChgItemCnt, 0);
                        }
                    }
                }
            }
            instance.rewardItems = CUseableManager.GetUseableListFromReward(stCouponsRewardRsp.stRewardInfo);
            if (flag)
            {
                Singleton <CUIManager> .GetInstance().OpenAwardTip(LinqS.ToArray <CUseable>(instance.rewardItems), null, false, enUIEventID.None, false, false, "Form_Award");
            }
        }
Пример #12
0
        public static stPayInfoSet GetSkinPayInfoSet(uint heroId, uint skinId)
        {
            ResSkinPromotion resPromotion = new ResSkinPromotion();
            stPayInfoSet     stPayInfoSet = default(stPayInfoSet);

            resPromotion = CSkinInfo.GetSkinPromotion(heroId, skinId);
            ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId);

            return(CMallSystem.GetPayInfoSetOfGood(heroSkin, resPromotion));
        }
Пример #13
0
        public static int GetCombatEft(uint heroId, uint skinId)
        {
            ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId);

            if (heroSkin != null)
            {
                return((int)heroSkin.dwCombatAbility);
            }
            return(0);
        }
Пример #14
0
        public static uint GetSkinCfgId(uint heroId, uint skinId)
        {
            ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId);

            if (heroSkin != null)
            {
                return(heroSkin.dwID);
            }
            return(0u);
        }
Пример #15
0
        public static uint GetSkinIdByIndex(uint heroId, int index)
        {
            ListView <ResHeroSkin> availableSkinByHeroId = CSkinInfo.GetAvailableSkinByHeroId(heroId);

            if (availableSkinByHeroId != null && index >= 0 && index < availableSkinByHeroId.get_Count())
            {
                return(availableSkinByHeroId.get_Item(index).dwSkinID);
            }
            return(0u);
        }
Пример #16
0
        private void OnBuyItem(CUIEvent uiEvent)
        {
            enPayType     tag           = (enPayType)uiEvent.m_eventParams.tag;
            uint          payValue      = uiEvent.m_eventParams.commonUInt32Param1;
            string        goodName      = string.Empty;
            COM_ITEM_TYPE com_item_type = COM_ITEM_TYPE.COM_OBJTYPE_NULL;
            uint          uniSkinId     = 0;
            long          key           = 0L;

            if (uiEvent.m_eventParams.heroSkinParam.skinId != 0)
            {
                com_item_type = COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN;
                uniSkinId     = CSkinInfo.GetSkinCfgId(uiEvent.m_eventParams.heroSkinParam.heroId, uiEvent.m_eventParams.heroSkinParam.skinId);
                ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(uniSkinId);
                DebugHelper.Assert(heroSkin != null, string.Format("找不到皮肤{0}的配置信息", uniSkinId));
                if (heroSkin == null)
                {
                    return;
                }
                goodName = StringHelper.UTF8BytesToString(ref heroSkin.szSkinName);
            }
            else if (uiEvent.m_eventParams.heroId != 0)
            {
                com_item_type = COM_ITEM_TYPE.COM_OBJTYPE_HERO;
                uniSkinId     = uiEvent.m_eventParams.heroId;
                ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(uniSkinId);
                DebugHelper.Assert(dataByKey != null, string.Format("找不到英雄{0}的配置信息", uniSkinId));
                if (dataByKey == null)
                {
                    return;
                }
                goodName = StringHelper.UTF8BytesToString(ref dataByKey.szName);
            }
            else
            {
                DebugHelper.Assert(false, "神秘商店购买不支持该物品类型");
                return;
            }
            key = GameDataMgr.GetDoubleKey((uint)com_item_type, uniSkinId);
            CMallMysteryProduct product = new CMallMysteryProduct();

            if (!this.m_ProductDic.TryGetValue(key, out product))
            {
                DebugHelper.Assert(false, string.Format("神秘商店找不到该物品{0}/{1}", Enum.GetName(typeof(COM_ITEM_TYPE), com_item_type), uniSkinId));
            }
            else
            {
                CUIEvent uIEvent = Singleton <CUIEventManager> .GetInstance().GetUIEvent();

                uIEvent.m_eventID         = enUIEventID.Mall_Mystery_On_Confirm_Buy_Item;
                uIEvent.m_eventParams.tag = (int)product.ID;
                CMallSystem.TryToPay(enPayPurpose.Buy, goodName, tag, payValue, uIEvent.m_eventID, ref uIEvent.m_eventParams, enUIEventID.None, false, true);
            }
        }
Пример #17
0
        public static string GetHeroSkinPic(uint heroId, uint skinId)
        {
            string      result   = string.Empty;
            ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId);

            if (heroSkin != null)
            {
                result = StringHelper.UTF8BytesToString(ref heroSkin.szSkinPicID);
            }
            return(result);
        }
Пример #18
0
        public static int GetInitCombatByHeroId(uint id)
        {
            ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(id);

            if (dataByKey == null)
            {
                return(0);
            }
            int combatEftByStarLevel = GetCombatEftByStarLevel(1, dataByKey.iInitialStar);
            int combatEft            = CSkinInfo.GetCombatEft(id, 0);

            return(combatEftByStarLevel + combatEft);
        }
Пример #19
0
        private void OnBuyItem(CUIEvent uiEvent)
        {
            enPayType     tag = (enPayType)uiEvent.m_eventParams.tag;
            uint          commonUInt32Param = uiEvent.m_eventParams.commonUInt32Param1;
            string        goodName          = string.Empty;
            COM_ITEM_TYPE cOM_ITEM_TYPE;
            uint          num;

            if (uiEvent.m_eventParams.heroSkinParam.skinId != 0u)
            {
                cOM_ITEM_TYPE = COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN;
                num           = CSkinInfo.GetSkinCfgId(uiEvent.m_eventParams.heroSkinParam.heroId, uiEvent.m_eventParams.heroSkinParam.skinId);
                ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(num);
                DebugHelper.Assert(heroSkin != null, string.Format("找不到皮肤{0}的配置信息", num));
                if (heroSkin == null)
                {
                    return;
                }
                goodName = StringHelper.UTF8BytesToString(ref heroSkin.szSkinName);
            }
            else
            {
                if (uiEvent.m_eventParams.heroId == 0u)
                {
                    DebugHelper.Assert(false, "神秘商店购买不支持该物品类型");
                    return;
                }
                cOM_ITEM_TYPE = COM_ITEM_TYPE.COM_OBJTYPE_HERO;
                num           = uiEvent.m_eventParams.heroId;
                ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(num);
                DebugHelper.Assert(dataByKey != null, string.Format("找不到英雄{0}的配置信息", num));
                if (dataByKey == null)
                {
                    return;
                }
                goodName = StringHelper.UTF8BytesToString(ref dataByKey.szName);
            }
            int productID = this.GetProductID(num);

            if (productID < 0)
            {
                DebugHelper.Assert(false, string.Format("神秘商店找不到该物品{0}/{1}", Enum.GetName(typeof(COM_ITEM_TYPE), cOM_ITEM_TYPE), num));
                return;
            }
            CUIEvent uIEvent = Singleton <CUIEventManager> .GetInstance().GetUIEvent();

            uIEvent.m_eventID         = enUIEventID.Mall_Mystery_On_Confirm_Buy_Item;
            uIEvent.m_eventParams.tag = productID;
            CMallSystem.TryToPay(enPayPurpose.Buy, goodName, tag, commonUInt32Param, uIEvent.m_eventID, ref uIEvent.m_eventParams, enUIEventID.None, false, true, false);
        }
Пример #20
0
        private void OnShowGiveFriendSkin(uint heroId, uint skinId, uint price)
        {
            ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId);

            if (heroSkin == null)
            {
                return;
            }
            CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(string.Format("{0}{1}", "UGUI/Form/System/", "Mall/Form_GiveHeroSkin_3D.prefab"), false, true);

            Text component = cUIFormScript.transform.Find("Panel/skinNameText").GetComponent <Text>();

            component.set_text(heroSkin.szSkinName);
            GameObject gameObject = cUIFormScript.transform.Find("Panel/Panel_Prop/List_Prop").gameObject;

            CSkinInfo.GetHeroSkinProp(heroId, skinId, ref CHeroInfoSystem2.s_propArr, ref CHeroInfoSystem2.s_propPctArr, ref CHeroInfoSystem2.s_propImgArr);
            CUICommonSystem.SetListProp(gameObject, ref CHeroInfoSystem2.s_propArr, ref CHeroInfoSystem2.s_propPctArr);
            Text component2 = cUIFormScript.transform.Find("Panel/pricePanel/priceText").GetComponent <Text>();

            component2.set_text(price.ToString());
            CUIEventScript  component3  = cUIFormScript.transform.Find("Panel/BtnGroup/buyButton").gameObject.GetComponent <CUIEventScript>();
            stUIEventParams eventParams = default(stUIEventParams);

            eventParams.heroSkinParam.heroId      = heroId;
            eventParams.heroSkinParam.skinId      = skinId;
            eventParams.heroSkinParam.isCanCharge = true;
            eventParams.commonUInt64Param1        = this._curFriendUid;
            eventParams.commonBool         = this._curFriendIsSns;
            eventParams.commonUInt32Param1 = this._curWorldId;
            component3.SetUIEvent(enUIEventType.Click, enUIEventID.HeroSkin_OpenBuyHeroSkinForFriend, eventParams);
            CUI3DImageScript component4     = cUIFormScript.transform.Find("Panel/3DImage").gameObject.GetComponent <CUI3DImageScript>();
            ObjNameData      heroPrefabPath = CUICommonSystem.GetHeroPrefabPath(heroId, (int)skinId, true);
            GameObject       gameObject2    = component4.AddGameObject(heroPrefabPath.ObjectName, false, false);

            if (gameObject2 != null)
            {
                if (heroPrefabPath.ActorInfo != null)
                {
                    gameObject2.transform.localScale = new Vector3(heroPrefabPath.ActorInfo.LobbyScale, heroPrefabPath.ActorInfo.LobbyScale, heroPrefabPath.ActorInfo.LobbyScale);
                }
                DynamicShadow.EnableDynamicShow(component4.gameObject, true);
                CHeroAnimaSystem instance = Singleton <CHeroAnimaSystem> .GetInstance();

                instance.Set3DModel(gameObject2);
                instance.InitAnimatList();
                instance.InitAnimatSoundList(heroId, skinId);
                instance.OnModePlayAnima("Come");
            }
        }
Пример #21
0
        public void Init()
        {
            CSkinInfo.InitHeroSkinDicData();
            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Mall_SkinItem_Enable, new CUIEventManager.OnUIEventHandler(this.OnSkinItemEnable));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Mall_Skin_JobSelect, new CUIEventManager.OnUIEventHandler(this.OnSkinJobSelect));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Mall_Appear, new CUIEventManager.OnUIEventHandler(this.OnMallAppear));

            Singleton <EventRouter> .instance.AddEventHandler <uint>("HeroAdd", new Action <uint>(this.OnNtyHeroInfoChange));

            Singleton <EventRouter> .instance.AddEventHandler <uint, uint, uint>("HeroSkinAdd", new Action <uint, uint, uint>(this, (IntPtr)this.OnNtyHeroInfoChangeBySkinAdd));

            Singleton <EventRouter> .instance.AddEventHandler(EventID.SERVER_SKIN_DATABIN_READY, new Action(this, (IntPtr)this.OnServerSkinDatabinReady));
        }
Пример #22
0
        public static int GetIndexBySkinId(uint heroId, uint skinId)
        {
            ListView <ResHeroSkin> availableSkinByHeroId = CSkinInfo.GetAvailableSkinByHeroId(heroId);

            if (availableSkinByHeroId != null)
            {
                for (int i = 0; i < availableSkinByHeroId.get_Count(); i++)
                {
                    if (availableSkinByHeroId.get_Item(i).dwSkinID == skinId)
                    {
                        return(i);
                    }
                }
            }
            return(-1);
        }
Пример #23
0
        public static ResHeroSkin GetHeroSkin(uint heroId, uint skinId)
        {
            ListView <ResHeroSkin> listView = null;

            CSkinInfo.s_heroSkinDic.TryGetValue(heroId, ref listView);
            if (listView != null)
            {
                for (int i = 0; i < listView.get_Count(); i++)
                {
                    if (listView.get_Item(i) != null && listView.get_Item(i).dwHeroID == heroId && listView.get_Item(i).dwSkinID == skinId)
                    {
                        return(listView.get_Item(i));
                    }
                }
            }
            return(CSkinInfo.GetHeroSkin(heroId * 100u + skinId));
        }
Пример #24
0
        public static void OnRecieveLimitSkinAdd(CSPkg msg)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            COMDT_HERO_LIMIT_SKIN_LIST stLimitSkinList = msg.stPkgData.get_stLimitSkinAdd().stLimitSkinList;
            int num = 0;

            while ((long)num < (long)((ulong)stLimitSkinList.dwNum))
            {
                COMDT_HERO_LIMIT_SKIN cOMDT_HERO_LIMIT_SKIN = stLimitSkinList.astSkinList[num];
                if (masterRoleInfo.heroExperienceSkinDic.ContainsKey(cOMDT_HERO_LIMIT_SKIN.dwSkinID))
                {
                    uint num2 = masterRoleInfo.heroExperienceSkinDic.get_Item(cOMDT_HERO_LIMIT_SKIN.dwSkinID);
                    masterRoleInfo.heroExperienceSkinDic.set_Item(cOMDT_HERO_LIMIT_SKIN.dwSkinID, cOMDT_HERO_LIMIT_SKIN.dwDeadLine);
                    if (0u < num2 && num2 < masterRoleInfo.heroExperienceSkinDic.get_Item(cOMDT_HERO_LIMIT_SKIN.dwSkinID))
                    {
                        int    experienceHeroOrSkinExtendDays = CHeroInfo.GetExperienceHeroOrSkinExtendDays(masterRoleInfo.heroExperienceSkinDic.get_Item(cOMDT_HERO_LIMIT_SKIN.dwSkinID) - num2);
                        string skinName = CSkinInfo.GetSkinName(cOMDT_HERO_LIMIT_SKIN.dwSkinID);
                        Singleton <CUIManager> .GetInstance().OpenTips("ExpCard_ExtendDays", true, 1f, null, new object[]
                        {
                            skinName,
                            experienceHeroOrSkinExtendDays
                        });
                    }
                }
                else
                {
                    masterRoleInfo.heroExperienceSkinDic.Add(cOMDT_HERO_LIMIT_SKIN.dwSkinID, cOMDT_HERO_LIMIT_SKIN.dwDeadLine);
                    uint heroId;
                    uint skinId;
                    CSkinInfo.ResolveHeroSkin(cOMDT_HERO_LIMIT_SKIN.dwSkinID, out heroId, out skinId);
                    if (!Singleton <CHeroSelectBaseSystem> .get_instance().m_isInHeroSelectState)
                    {
                        CUICommonSystem.ShowNewHeroOrSkin(heroId, skinId, enUIEventID.None, true, 10, false, null, enFormPriority.Priority1, 0u, CHeroInfo.GetExperienceHeroOrSkinValidDays(cOMDT_HERO_LIMIT_SKIN.dwDeadLine));
                    }
                    else if (!Singleton <CHeroSelectBaseSystem> .get_instance().IsMultilMode())
                    {
                        CHeroInfoSystem2.ReqWearHeroSkin(heroId, skinId, true);
                    }
                }
                num++;
            }
        }
Пример #25
0
        public void Init()
        {
            CSkinInfo.InitHeroSkinDicData();
            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Mall_SkinItem_Enable, new CUIEventManager.OnUIEventHandler(this.OnSkinItemEnable));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Mall_Skin_JobSelect, new CUIEventManager.OnUIEventHandler(this.OnSkinJobSelect));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Mall_Appear, new CUIEventManager.OnUIEventHandler(this.OnMallAppear));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Mall_Skin_Own_Flag_Change, new CUIEventManager.OnUIEventHandler(this.OnSkinOwnFlagChange));

            Singleton <EventRouter> .get_instance().AddEventHandler <uint>("HeroAdd", new Action <uint>(this.OnNtyHeroInfoChange));

            Singleton <EventRouter> .get_instance().AddEventHandler <uint, uint, uint>("HeroSkinAdd", new Action <uint, uint, uint>(this.OnNtyHeroInfoChangeBySkinAdd));

            Singleton <EventRouter> .get_instance().AddEventHandler(EventID.Mall_Sort_Type_Changed, new Action(this.OnSortTypeChanged));

            Singleton <EventRouter> .get_instance().AddEventHandler(EventID.SERVER_SKIN_DATABIN_READY, new Action(this.OnServerSkinDatabinReady));

            this.m_notOwnFlag = (PlayerPrefs.GetInt("Mall_Skin_Own_Flag_Key", 0) != 0);
        }
Пример #26
0
        public int GetCombatEft()
        {
            DebugHelper.Assert(this.mActorValue != null, "GetCombatEft mActorValue is null");
            int combatEftByStarLevel = 0;

            if (this.mActorValue != null)
            {
                combatEftByStarLevel = GetCombatEftByStarLevel(this.mActorValue.actorLvl, this.mActorValue.actorStar);
            }
            int       combatEft      = CSkinInfo.GetCombatEft(this.cfgInfo.dwCfgID, this.m_skinInfo.GetWearSkinId());
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            DebugHelper.Assert(masterRoleInfo != null, "GetCombatEft master is null");
            int symbolPageEft = 0;

            if (masterRoleInfo != null)
            {
                symbolPageEft = masterRoleInfo.m_symbolInfo.GetSymbolPageEft(this.m_selectPageIndex);
            }
            return((combatEftByStarLevel + combatEft) + symbolPageEft);
        }
Пример #27
0
        public static string GetHeroTitle(uint heroId, uint skinId)
        {
            string str = string.Empty;

            if (skinId == 0)
            {
                ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(heroId);
                if (dataByKey != null)
                {
                    str = StringHelper.UTF8BytesToString(ref dataByKey.szHeroTitle);
                }
                return(str);
            }
            ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId);

            if (heroSkin != null)
            {
                str = StringHelper.UTF8BytesToString(ref heroSkin.szSkinName);
            }
            return(str);
        }
Пример #28
0
        public static bool IsBuyForbiddenForRankBigGrade(uint heroId, uint skinId, out RES_RANK_LIMIT_TYPE rankLimitType, out byte rankLimitBigGrade, out ulong rankLimitParam, out bool isHaveRankBigGradeLimit)
        {
            uint            skinCfgId = CSkinInfo.GetSkinCfgId(heroId, skinId);
            ResHeroSkinShop resHeroSkinShop;

            if (GameDataMgr.skinShopInfoDict.TryGetValue(skinCfgId, ref resHeroSkinShop))
            {
                rankLimitType     = (int)resHeroSkinShop.bRankLimitType;
                rankLimitBigGrade = resHeroSkinShop.bRankLimitGrade;
                rankLimitParam    = resHeroSkinShop.ullRankLimitParam;
                switch (rankLimitType)
                {
                case 1:
                    isHaveRankBigGradeLimit = true;
                    return(CLadderSystem.GetRankBigGrade(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_rankGrade) < rankLimitBigGrade);

                case 2:
                    isHaveRankBigGradeLimit = true;
                    return(CLadderSystem.GetRankBigGrade(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_rankSeasonHighestGrade) < rankLimitBigGrade);

                case 3:
                    isHaveRankBigGradeLimit = true;
                    return(CLadderSystem.GetRankBigGrade(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_rankHistoryHighestGrade) < rankLimitBigGrade);

                case 4:
                    isHaveRankBigGradeLimit = true;
                    if (Singleton <CLadderSystem> .GetInstance().IsCurSeason(rankLimitParam))
                    {
                        return(CLadderSystem.GetRankBigGrade(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_rankGrade) < rankLimitBigGrade);
                    }
                    return(CLadderSystem.GetRankBigGrade(Singleton <CLadderSystem> .GetInstance().GetHistorySeasonGrade(rankLimitParam)) < rankLimitBigGrade);
                }
            }
            rankLimitType           = 0;
            rankLimitBigGrade       = 0;
            rankLimitParam          = 0uL;
            isHaveRankBigGradeLimit = false;
            return(false);
        }
Пример #29
0
        public static bool GetSkinFeatureCnt(uint heroId, uint skinId, out int cnt)
        {
            cnt = 0;
            if (skinId == 0u)
            {
                return(false);
            }
            ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId);

            if (heroSkin != null)
            {
                for (int i = 0; i < 10; i++)
                {
                    if (string.IsNullOrEmpty(heroSkin.astFeature[i].szDesc))
                    {
                        break;
                    }
                    cnt++;
                }
            }
            return(cnt > 0);
        }
Пример #30
0
        private void ShowHero(PoolObjHandle <ActorRoot> actor)
        {
            ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey((long)actor.handle.TheActorMeta.ConfigId);
            GameObject     obj2      = this.m_FormScript.m_formWidgets[4];

            if (obj2 != null)
            {
                string str         = CUIUtility.s_Sprite_Dynamic_BustHero_Dir;
                string heroSkinPic = CSkinInfo.GetHeroSkinPic((uint)actor.handle.TheActorMeta.ConfigId, 0);
                Image  component   = obj2.transform.GetComponent <Image>();
                if (component != null)
                {
                    component.SetSprite(CUIUtility.s_Sprite_Dynamic_BustHero_Dir + heroSkinPic, Singleton <CUIManager> .GetInstance().GetForm(s_battleHeroInfoForm), true, false, false);
                }
            }
            GameObject obj3 = this.m_FormScript.m_formWidgets[5];

            if (obj3 != null)
            {
                Text text = obj3.transform.GetComponent <Text>();
                if (text != null)
                {
                    text.text = StringHelper.UTF8BytesToString(ref dataByKey.szName);
                }
            }
            GameObject obj4 = this.m_FormScript.m_formWidgets[6];

            if (obj4 != null)
            {
                Text text2 = obj4.transform.GetComponent <Text>();
                if (text2 != null)
                {
                    text2.text = StringHelper.UTF8BytesToString(ref dataByKey.szHeroTips);
                }
            }
        }