Exemplo n.º 1
0
 public override void Init(Int32 p_staticID)
 {
     m_staticData = StaticDataHandler.GetStaticData <ScrollStaticData>(EDataType.SCROLL, p_staticID);
     m_properties = new Dictionary <String, String>();
     InitTypeDescription();
     InitPropertyDescription();
 }
Exemplo n.º 2
0
        public static Scroll CreateScroll(Int32 p_modelLevel)
        {
            ETier etier = ETier.NOVICE;

            switch (p_modelLevel)
            {
            case 3:
                etier = ETier.EXPERT;
                break;

            case 4:
                etier = ETier.MASTER;
                break;

            case 5:
                etier = ETier.GRAND_MASTER;
                break;
            }
            List <ScrollStaticData> list = new List <ScrollStaticData>(StaticDataHandler.GetIterator <ScrollStaticData>(EDataType.SCROLL));

            if (m_scrollTempFilter == null)
            {
                m_scrollTempFilter = new List <Int32>();
            }
            m_scrollTempFilter.Clear();
            ETier  etier2 = (ETier)Random.Range(1, (Int32)(etier + 1));
            Single num    = 0f;

            for (Int32 i = 0; i < list.Count; i++)
            {
                ScrollStaticData scrollStaticData = list[i];
                if (scrollStaticData.ScrollTier == etier && scrollStaticData.SpellTier == etier2 && scrollStaticData.StaticID < 1000)
                {
                    m_scrollTempFilter.Add(i);
                    num += m_currentEnchantmentMultiplicators[scrollStaticData.MagicSchool];
                }
            }
            if (m_scrollTempFilter.Count > 0)
            {
                Single num2 = Random.Range(0f, num);
                Single num3 = 0f;
                for (Int32 j = 0; j < m_scrollTempFilter.Count; j++)
                {
                    Int32 index = m_scrollTempFilter[j];
                    num3 += m_currentEnchantmentMultiplicators[list[index].MagicSchool];
                    if (num2 < num3)
                    {
                        return(CreateItem <Scroll>(list[index].StaticID));
                    }
                }
            }
            return(null);
        }