Esempio n. 1
0
        private int GetNameChangeHaveItemCount(RES_CHANGE_NAME_TYPE changeType)
        {
            int       num            = 0;
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            CUseableContainer useableContainer = masterRoleInfo.GetUseableContainer(enCONTAINER_TYPE.ITEM);

            if (useableContainer != null)
            {
                int curUseableCount = useableContainer.GetCurUseableCount();
                for (int i = 0; i < curUseableCount; i++)
                {
                    CUseable useableByIndex = useableContainer.GetUseableByIndex(i);
                    if (useableByIndex != null && useableByIndex.m_type == 2)
                    {
                        if (changeType == 1 && CItem.IsPlayerNameChangeCard(useableByIndex.m_baseID))
                        {
                            num += useableByIndex.m_stackCount;
                        }
                        else if (changeType == 2 && CItem.IsGuildNameChangeCard(useableByIndex.m_baseID))
                        {
                            num += useableByIndex.m_stackCount;
                        }
                    }
                }
            }
            return(num);
        }
Esempio n. 2
0
        private bool CheckNameChangeCard(CItem item)
        {
            if (item.m_itemData.bType == 1)
            {
                if (CItem.IsPlayerNameChangeCard(item.m_baseID))
                {
                    Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.NameChange_OpenPlayerNameChangeForm);

                    return(true);
                }
                if (CItem.IsGuildNameChangeCard(item.m_baseID))
                {
                    if (CGuildSystem.HasGuildNameChangeAuthority())
                    {
                        Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.NameChange_OpenGuildNameChangeForm);
                    }
                    else
                    {
                        Singleton <CUIManager> .GetInstance().OpenTips("NameChange_GuildOnlyChairman", true, 1f, null, new object[0]);
                    }
                    return(true);
                }
            }
            return(false);
        }