コード例 #1
0
        private void ODBCGiveLoot()
        {
            List <Dictionary <string, object> > listaLoots = ControladorODBC.ODBCGiveLoot(this.NomeTipoCriatura, this.NomeCriatura);

            foreach (Dictionary <string, object> linha in listaLoots)
            {
                int id         = Convert.ToInt32(linha["IdLoteGenerico"].ToString());
                int quantidade = Convert.ToInt32(linha["Quantidade"].ToString());
                int ouro       = 0;

                string nome = linha["Classe"].ToString();
                string item = linha["Item"].ToString();

                if (item.ToUpper().Equals("OURO") || item.ToUpper().Equals("GOLD"))
                {
                    ouro = Convert.ToInt32(quantidade);
                }
                else if (item == "1cscroll" && quantidade > 0)
                {
                    this.PackItem(Loot.RandomScroll(0, 7, SpellbookType.Regular));
                }
                else if (item == "2cscroll" && quantidade > 0)
                {
                    this.PackItem(Loot.RandomScroll(8, 15, SpellbookType.Regular));
                }
                else if (item == "3cscroll" && quantidade > 0)
                {
                    this.PackItem(Loot.RandomScroll(16, 23, SpellbookType.Regular));
                }
                else if (item == "4cscroll" && quantidade > 0)
                {
                    this.PackItem(Loot.RandomScroll(24, 31, SpellbookType.Regular));
                }
                else if (item == "5cscroll" && quantidade > 0)
                {
                    this.PackItem(Loot.RandomScroll(32, 39, SpellbookType.Regular));
                }
                else if (item == "6cscroll" && quantidade > 0)
                {
                    this.PackItem(Loot.RandomScroll(40, 47, SpellbookType.Regular));
                }
                else if (item == "7cscroll" && quantidade > 0)
                {
                    this.PackItem(Loot.RandomScroll(48, 55, SpellbookType.Regular));
                }
                else if (item == "8cscroll" && quantidade > 0)
                {
                    this.PackItem(Loot.RandomScroll(56, 63, SpellbookType.Regular));
                }
                else if (item == "necrolowscroll" && quantidade > 0)
                {
                    this.PackItem(Loot.RandomScroll(0, 5, SpellbookType.Necromancer));
                }
                else if (item == "necromedscroll" && quantidade > 0)
                {
                    this.PackItem(Loot.RandomScroll(6, 10, SpellbookType.Necromancer));
                }
                else if (item == "necrohighscroll" && quantidade > 0)
                {
                    this.PackItem(Loot.RandomScroll(11, 15, SpellbookType.Necromancer));
                }

                AddItemLoot.AddItem(this.BolsaCriatura, item, quantidade, ouro);
            }
        }