public void Merge(ItemDropDatabase dropsDatabase)
 {
     for (int i = -65; i < 663; i++)
     {
         ExtractDropsForNPC(dropsDatabase, i);
     }
 }
Esempio n. 2
0
        private static void SetupBestiary(CancellationToken token)
        {
            //Beastiary DB
            var bestiaryDatabase = new BestiaryDatabase();

            new BestiaryDatabaseNPCsPopulator().Populate(bestiaryDatabase);
            Main.BestiaryDB = bestiaryDatabase;
            ContentSamples.RebuildBestiarySortingIDsByBestiaryDatabaseContents(bestiaryDatabase);

            //Drops DB
            var itemDropDatabase = new ItemDropDatabase();

            itemDropDatabase.Populate();
            Main.ItemDropsDB = itemDropDatabase;

            //Update the bestiary DB with the drops DB.
            bestiaryDatabase.Merge(Main.ItemDropsDB);

            //Etc

            if (!Main.dedServ)
            {
                Main.BestiaryUI = new UIBestiaryTest(Main.BestiaryDB);
            }

            Main.ItemDropSolver  = new ItemDropResolver(itemDropDatabase);
            Main.BestiaryTracker = new BestiaryUnlocksTracker();
        }
Esempio n. 3
0
        public RPPDatabaseHandler(string _RPPDBFolder)
        {
            List <WowRealm> realmsInUse = new List <WowRealm>();

            foreach (var realm in Database.ALL_REALMS)
            {
                if (Database.SKIP_REALM_TAGS.Contains(realm))
                {
                    continue;
                }
                if (StaticValues.DeadRealms.Contains(realm) == false)
                {
                    realmsInUse.Add(realm);
                }
            }
            m_RealmsInUse = realmsInUse.ToArray();
            m_RPPDBFolder = _RPPDBFolder;
            if (ItemDropDatabase.DatabaseExists(m_RPPDBFolder + "Database\\") == false)
            {
                ItemDropDatabase itemDropDatabase = new ItemDropDatabase(m_RPPDBFolder + "Database\\");
            }
            m_Communicator = new UploaderCommunication.RPPCommunicator(18374);
            m_Database     = new Database(m_RPPDBFolder + "Database\\", null, m_RealmsInUse);
            m_MainThread   = new System.Threading.Thread(MainThread);
            m_MainThread.Start();
        }
Esempio n. 4
0
 public void Merge(ItemDropDatabase dropsDatabase)
 {
     for (int npcId = -65; npcId < 663; ++npcId)
     {
         this.ExtractDropsForNPC(dropsDatabase, npcId);
     }
 }
 public RPPDatabaseHandler(string _RPPDBFolder)
 {
     m_RPPDBFolder = _RPPDBFolder;
     if (ItemDropDatabase.DatabaseExists(m_RPPDBFolder + "Database\\") == false)
     {
         ItemDropDatabase itemDropDatabase = new ItemDropDatabase(m_RPPDBFolder + "Database\\");
     }
     m_Communicator = new UploaderCommunication.RPPCommunicator(18374);
     m_Database     = new Database(m_RPPDBFolder + "Database\\");
     m_MainThread   = new System.Threading.Thread(MainThread);
     m_MainThread.Start();
 }
Esempio n. 6
0
        private void ExtractDropsForNPC(ItemDropDatabase dropsDatabase, int npcId)
        {
            BestiaryEntry bestiaryEntry = FindEntryByNPCID(npcId);

            if (bestiaryEntry != null)
            {
                List <IItemDropRule>  rulesForNPCID = dropsDatabase.GetRulesForNPCID(npcId, includeGlobalDrops: false);
                List <DropRateInfo>   list          = new List <DropRateInfo>();
                DropRateInfoChainFeed ratesInfo     = new DropRateInfoChainFeed(1f);
                foreach (IItemDropRule item in rulesForNPCID)
                {
                    item.ReportDroprates(list, ratesInfo);
                }
                foreach (DropRateInfo item2 in list)
                {
                    bestiaryEntry.Info.Add(new ItemDropBestiaryInfoElement(item2));
                }
            }
        }
Esempio n. 7
0
        private void ExtractDropsForNPC(ItemDropDatabase dropsDatabase, int npcId)
        {
            BestiaryEntry entryByNpcid = this.FindEntryByNPCID(npcId);

            if (entryByNpcid == null)
            {
                return;
            }
            List <IItemDropRule>  rulesForNpcid = dropsDatabase.GetRulesForNPCID(npcId, false);
            List <DropRateInfo>   drops         = new List <DropRateInfo>();
            DropRateInfoChainFeed ratesInfo     = new DropRateInfoChainFeed(1f);

            foreach (IItemDropRule itemDropRule in rulesForNpcid)
            {
                itemDropRule.ReportDroprates(drops, ratesInfo);
            }
            foreach (DropRateInfo info in drops)
            {
                entryByNpcid.Info.Add((IBestiaryInfoElement) new ItemDropBestiaryInfoElement(info));
            }
        }
Esempio n. 8
0
 public GlobalLoot(ItemDropDatabase itemDropDatabase)
 {
     this.itemDropDatabase = itemDropDatabase;
 }
Esempio n. 9
0
 public ItemDropResolver(ItemDropDatabase database)
 {
     _database = database;
 }
Esempio n. 10
0
 public NPCLoot(int npcType, ItemDropDatabase itemDropDatabase)
 {
     this.npcType          = npcType;
     this.itemDropDatabase = itemDropDatabase;
 }