Example #1
0
        void LoadLootTables_Process_Handler(Task t)
        {
            foreach (object[] row in t.Query.Rows)
            {
                // 0: loot_table_id   int(11)
                // 1: chance  double
                // 2: item_template   int(11)

                int table = (int)row[0];
                double chance = (double)row[1];
                uint item_template = (uint)row[2];

                LootTable lt = _server.GetLootTable(table);
                if (lt == null)
                {
                    lt = new LootTable();
                    _server.AddLootTable(table, lt);
                }
                lt.AddEntry(chance, item_template);
            }

            t.Type = Task.TaskType.LoadLocations_Process;
            AddDBQuery("SELECT * FROM locations;", t);
        }
Example #2
0
 public void AddLootTable(int table, LootTable lt)
 {
     _lootTables[table] = lt;
 }