Exemplo n.º 1
0
        public uint GetNextItemLevel()
        {
            //Quality too low
            if (EquipmentQuality < 3)
            {
                return(staticID);
            }
            //Level too high
            switch (EquipmentLevel)
            {
            case 112:
            case 135:
            case 136:
            case 137:
            case 138:
            case 139:
                return(staticID);
            }
            DbItemInfo newItem = null;
            uint       loops   = 1;

            while (loops < 10 && newItem == null)
            {
                newItem = ServerDatabase.Context.ItemInformation.GetById(staticID + 10 * loops);
                loops++;
            }
            if (newItem == null || newItem.ID / 1000 != EquipmentType)
            {
                return(staticID);
            }
            return(newItem.ID);
        }
Exemplo n.º 2
0
        private void TemplateControl_DataBinding(object sender, EventArgs e)
        {
            var noTagText = (Literal)sender;
            var container = (RepeaterItem)noTagText.NamingContainer;

            var itemInfo = new DbItemInfo(container.DataItem, container.ItemIndex);

            if (contextType == EContextType.Channel)
            {
                pageInfo.ChannelItems.Push(itemInfo);
                noTagText.Text = TemplateUtility.GetChannelsItemTemplateString(templateString, selectedItems, selectedValues, container.ClientID, pageInfo, contextType, contextInfo);
            }
            else if (contextType == EContextType.Content)
            {
                pageInfo.ContentItems.Push(itemInfo);
                noTagText.Text = TemplateUtility.GetContentsItemTemplateString(templateString, selectedItems, selectedValues, container.ClientID, pageInfo, contextType, contextInfo);
            }
            else if (contextType == EContextType.Comment)
            {
                pageInfo.CommentItems.Push(itemInfo);
                noTagText.Text = TemplateUtility.GetCommentsTemplateString(templateString, container.ClientID, pageInfo, contextType, contextInfo);
            }
            else if (contextType == EContextType.InputContent)
            {
                pageInfo.InputItems.Push(itemInfo);
                noTagText.Text = TemplateUtility.GetInputContentsTemplateString(templateString, container.ClientID, pageInfo, contextType, contextInfo);
            }
            else if (contextType == EContextType.SqlContent)
            {
                pageInfo.SqlItems.Push(itemInfo);
                noTagText.Text = TemplateUtility.GetSqlContentsTemplateString(templateString, selectedItems, selectedValues, container.ClientID, pageInfo, contextType, contextInfo);
            }
            else if (contextType == EContextType.Site)
            {
                pageInfo.SiteItems.Push(itemInfo);
                noTagText.Text = TemplateUtility.GetSitesTemplateString(templateString, container.ClientID, pageInfo, contextType, contextInfo);
            }
            else if (contextType == EContextType.Photo)
            {
                pageInfo.PhotoItems.Push(itemInfo);
                noTagText.Text = TemplateUtility.GetPhotosTemplateString(templateString, selectedItems, selectedValues, container.ClientID, pageInfo, contextType, contextInfo);
            }
            else if (contextType == EContextType.Each)
            {
                pageInfo.EachItems.Push(itemInfo);
                noTagText.Text = TemplateUtility.GetEachsTemplateString(templateString, selectedItems, selectedValues, container.ClientID, pageInfo, contextType, contextInfo);
            }

            if (separatorRepeat > 1)
            {
                i++;
                if (i % separatorRepeat == 0)
                {
                    noTagText.Text += separatorRepeatTemplate;
                }
            }
        }
Exemplo n.º 3
0
        private void TemplateControl_DataBinding(object sender, EventArgs e)
        {
            var literal   = (Literal)sender;
            var container = (RepeaterItem)literal.NamingContainer;

            var itemInfo = new DbItemInfo(container.DataItem, container.ItemIndex);

            if (_contextType == EContextType.Channel)
            {
                var channelItemInfo = new ChannelItemInfo(SqlUtils.EvalInt(container.DataItem, ChannelAttribute.Id), container.ItemIndex);
                _pageInfo.ChannelItems.Push(channelItemInfo);
                literal.Text = TemplateUtility.GetChannelsItemTemplateString(_templateString, _selectedItems, _selectedValues, container.ClientID, _pageInfo, _contextType, _contextInfo);
            }
            else if (_contextType == EContextType.Content)
            {
                var contentItemInfo = new ContentItemInfo(SqlUtils.EvalInt(container.DataItem, ContentAttribute.ChannelId), SqlUtils.EvalInt(container.DataItem, ContentAttribute.Id), container.ItemIndex);
                _pageInfo.ContentItems.Push(contentItemInfo);
                literal.Text = TemplateUtility.GetContentsItemTemplateString(_templateString, _selectedItems, _selectedValues, container.ClientID, _pageInfo, _contextType, _contextInfo);
            }
            else if (_contextType == EContextType.Comment)
            {
                _pageInfo.CommentItems.Push(itemInfo);
                literal.Text = TemplateUtility.GetCommentsTemplateString(_templateString, container.ClientID, _pageInfo, _contextType, _contextInfo);
            }
            //else if (_contextType == EContextType.InputContent)
            //{
            //    _pageInfo.InputItems.Push(itemInfo);
            //    literal.Text = TemplateUtility.GetInputContentsTemplateString(_templateString, container.ClientID, _pageInfo, _contextType, _contextInfo);
            //}
            else if (_contextType == EContextType.SqlContent)
            {
                _pageInfo.SqlItems.Push(itemInfo);
                literal.Text = TemplateUtility.GetSqlContentsTemplateString(_templateString, _selectedItems, _selectedValues, container.ClientID, _pageInfo, _contextType, _contextInfo);
            }
            else if (_contextType == EContextType.Site)
            {
                _pageInfo.SiteItems.Push(itemInfo);
                literal.Text = TemplateUtility.GetSitesTemplateString(_templateString, container.ClientID, _pageInfo, _contextType, _contextInfo);
            }
            else if (_contextType == EContextType.Each)
            {
                _pageInfo.EachItems.Push(itemInfo);
                literal.Text = TemplateUtility.GetEachsTemplateString(_templateString, _selectedItems, _selectedValues, container.ClientID, _pageInfo, _contextType, _contextInfo);
            }

            if (_separatorRepeat > 1)
            {
                _i++;
                if (_i % _separatorRepeat == 0)
                {
                    literal.Text += _separatorRepeatTemplate;
                }
            }
        }
Exemplo n.º 4
0
        public ConquerItem(uint _uniqueID, DbItemInfo _info)
        {
            UniqueID = _uniqueID;
            BaseItem = _info;

            staticID   = BaseItem.ID;
            Durability = BaseItem.AmountMax;
            Gem1       = _info.Gem1;
            Gem2       = _info.Gem2;
            Effect     = _info.Magic1;
            plus       = _info.Magic3;
            Bless      = Enchant = 0;
            Locked     = false;
            if ((EquipmentSort == 1 || EquipmentSort == 3 || EquipmentSort == 4) && BaseItem.TypeDesc != "Earring")
            {
                Color = (byte)Common.Random.Next(3, 7);
            }
            else
            {
                Color = 3;
            }
        }