public QuestDataParser(Locale locale, int flags)
            : base(locale, flags)
        {
            this.Address = "quests?filter=cr=30:30;crs=1:4;crv={0}:{1}";
            this.MaxCount = 32000;

            parsers = (SubParsers)flags;
        }
        public QuestDataParser(Locale locale, int flags)
            : base(locale, flags)
        {
            this.Address  = "quests?filter=cr=30:30;crs=1:4;crv={0}:{1}";
            this.MaxCount = 32000;

            parsers = (SubParsers)flags;
        }
        public NpcDataParser(Locale locale, int flags)
            : base(locale, flags, (int)SubParsersType.Max, typeof(SubParsers))
        {
            parsers = (SubParsers)flags;

            if (parsers.HasFlag(SubParsers.Level))
            {
                Builders[(int)SubParsersType.Level].Setup("creature_template", "entry", false, "minlevel", "maxlevel");
            }

            if (parsers.HasFlag(SubParsers.Money))
            {
                Builders[(int)SubParsersType.Money].Setup("creature_template", "entry", false, "mingold", "maxgold");
            }

            if (parsers.HasFlag(SubParsers.Currency))
            {
                Builders[(int)SubParsersType.Currency].Setup("creature_currency", "entry", false, "currencyId", "currencyAmount");
            }

            if (parsers.HasFlag(SubParsers.Quotes))
            {
                Builders[(int)SubParsersType.Quotes].Setup("creature_quotes", "entry", false, "id", "type", textFields[Locale]);
            }

            if (parsers.HasFlag(SubParsers.Health))
            {
                Builders[(int)SubParsersType.Health].Setup("creature_power", "entry", false, "Normal", "Heroic", "Normal10", "Normal25", "Heroic10", "Heroic25", "RaidFinder25");
            }

            if (parsers.HasFlag(SubParsers.Mana))
            {
                Builders[(int)SubParsersType.Mana].Setup("creature_power", "entry", false, "Mana");
            }

            if (parsers.HasFlag(SubParsers.Faction))
            {
                Builders[(int)SubParsersType.Faction].Setup("creature_faction", "entry", false, "faction_a", "faction_h");
            }

            if (parsers.HasFlag(SubParsers.QuestStart))
            {
                Builders[(int)SubParsersType.QuestStart].Setup("creature_questrelation", "id", false, "quest");
            }

            if (parsers.HasFlag(SubParsers.QuestEnd))
            {
                Builders[(int)SubParsersType.QuestEnd].Setup("creature_involvedrelation", "id", false, "quest");
            }

            #region Creature_currency

            if (parsers.HasFlag(SubParsers.Currency))
            {
                Content.AppendLine(
                    @"DROP TABLE IF EXISTS `creature_currency`;
CREATE TABLE `creature_currency` (
  `entry` int(10) NOT NULL,
  `currencyId` int(10) NOT NULL default '0',
  `currencyAmount` int(10) NOT NULL default '0',
  PRIMARY KEY (`entry`)
  ) ENGINE=MyISAM DEFAULT CHARSET=utf8;"
                    );
            }

            #endregion

            Content.AppendLine();

            #region Creature_quotes

            if (parsers.HasFlag(SubParsers.Quotes))
            {
                Content.AppendLine(
                    @"DROP TABLE IF EXISTS `creature_quotes`;
CREATE TABLE `creature_quotes` (
  `entry` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `text` longtext,
  `text_loc1` longtext,
  `text_loc2` longtext,
  `text_loc3` longtext,
  `text_loc4` longtext,
  PRIMARY KEY (`entry`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
                    );
            }

            #endregion

            Content.AppendLine();

            #region Creature_power

            if (parsers.HasFlag(SubParsers.Health | SubParsers.Mana))
            {
                Content.AppendLine(
                    @"DROP TABLE IF EXISTS `creature_power`;
CREATE TABLE `creature_power` (
  `entry` int(10) NOT NULL,
  `Mana` int(10) NOT NULL default '0',
  `Normal` int(10) NOT NULL default '0',
  `Heroic` int(10) NOT NULL default '0',
  `Normal10` int(10) NOT NULL default '0',
  `Normal25` int(10) NOT NULL default '0',
  `Heroic10` int(10) NOT NULL default '0',
  `Heroic25` int(10) NOT NULL default '0',
  `RaidFinder25` int(10) NOT NULL default '0',
  PRIMARY KEY (`entry`)
  ) ENGINE=MyISAM DEFAULT CHARSET=utf8;"
                    );
            }

            #endregion

            Content.AppendLine();

            #region Creature_faction

            if (parsers.HasFlag(SubParsers.Faction))
            {
                Content.AppendLine(
                    @"DROP TABLE IF EXISTS `creature_faction`;
CREATE TABLE `creature_faction` (
  `entry` int(10) NOT NULL,
  `faction_a` int(10) NOT NULL default '0',
  `faction_h` int(10) NOT NULL default '0',
  PRIMARY KEY (`entry`)
  ) ENGINE=MyISAM DEFAULT CHARSET=utf8;"
                    );
            }

            #endregion

            Content.AppendLine();
        }
Beispiel #4
0
 public QuestDataParser(Locale locale, int flags)
     : base(locale, flags)
 {
     parsers = (SubParsers)flags;
 }
 public QuestDataParser(Locale locale, int flags)
     : base(locale, flags)
 {
     parsers = (SubParsers)flags;
 }
        public NpcDataParser(Locale locale, int flags)
            : base(locale, flags, (int)SubParsersType.Max, typeof(SubParsers))
        {
            parsers = (SubParsers)flags;

            if (parsers.HasFlag(SubParsers.Level))
                Builders[(int)SubParsersType.Level].Setup("creature_template", "entry", false, "minlevel", "maxlevel");

            if (parsers.HasFlag(SubParsers.Money))
                Builders[(int)SubParsersType.Money].Setup("creature_template", "entry", false, "mingold", "maxgold");

            if (parsers.HasFlag(SubParsers.Currency))
                Builders[(int)SubParsersType.Currency].Setup("creature_currency", "entry", false, "currencyId", "currencyAmount");

            if (parsers.HasFlag(SubParsers.Quotes))
                Builders[(int)SubParsersType.Quotes].Setup("creature_quotes", "entry", false, "id", "type", textFields[Locale]);

            if (parsers.HasFlag(SubParsers.Health))
                Builders[(int)SubParsersType.Health].Setup("creature_power", "entry", false, "Normal", "Heroic", "Normal10", "Normal25", "Heroic10", "Heroic25", "RaidFinder25");

            if (parsers.HasFlag(SubParsers.Mana))
                Builders[(int)SubParsersType.Mana].Setup("creature_power", "entry", false, "Mana");

            if (parsers.HasFlag(SubParsers.Faction))
                Builders[(int)SubParsersType.Faction].Setup("creature_faction", "entry", false, "faction_a", "faction_h");

            if (parsers.HasFlag(SubParsers.QuestStart))
                Builders[(int)SubParsersType.QuestStart].Setup("creature_questrelation", "id", false, "quest");

            if (parsers.HasFlag(SubParsers.QuestEnd))
                Builders[(int)SubParsersType.QuestEnd].Setup("creature_involvedrelation", "id", false, "quest");

            #region Creature_currency

            if (parsers.HasFlag(SubParsers.Currency))
            {
                Content.AppendLine(
             @"DROP TABLE IF EXISTS `creature_currency`;
            CREATE TABLE `creature_currency` (
              `entry` int(10) NOT NULL,
              `currencyId` int(10) NOT NULL default '0',
              `currencyAmount` int(10) NOT NULL default '0',
              PRIMARY KEY (`entry`)
              ) ENGINE=MyISAM DEFAULT CHARSET=utf8;"
             );
            }

            #endregion

            Content.AppendLine();

            #region Creature_quotes

            if (parsers.HasFlag(SubParsers.Quotes))
            {
                Content.AppendLine(
            @"DROP TABLE IF EXISTS `creature_quotes`;
            CREATE TABLE `creature_quotes` (
              `entry` mediumint(8) unsigned NOT NULL DEFAULT '0',
              `id` tinyint(3) unsigned NOT NULL DEFAULT '0',
              `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
              `text` longtext,
              `text_loc1` longtext,
              `text_loc2` longtext,
              `text_loc3` longtext,
              `text_loc4` longtext,
              PRIMARY KEY (`entry`,`id`)
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
            );
            }

            #endregion

            Content.AppendLine();

            #region Creature_power

            if (parsers.HasFlag(SubParsers.Health | SubParsers.Mana))
            {
                Content.AppendLine(
             @"DROP TABLE IF EXISTS `creature_power`;
            CREATE TABLE `creature_power` (
              `entry` int(10) NOT NULL,
              `Mana` int(10) NOT NULL default '0',
              `Normal` int(10) NOT NULL default '0',
              `Heroic` int(10) NOT NULL default '0',
              `Normal10` int(10) NOT NULL default '0',
              `Normal25` int(10) NOT NULL default '0',
              `Heroic10` int(10) NOT NULL default '0',
              `Heroic25` int(10) NOT NULL default '0',
              `RaidFinder25` int(10) NOT NULL default '0',
              PRIMARY KEY (`entry`)
              ) ENGINE=MyISAM DEFAULT CHARSET=utf8;"
             );
            }

            #endregion

            Content.AppendLine();

            #region Creature_faction

            if (parsers.HasFlag(SubParsers.Faction))
            {
                Content.AppendLine(
             @"DROP TABLE IF EXISTS `creature_faction`;
            CREATE TABLE `creature_faction` (
              `entry` int(10) NOT NULL,
              `faction_a` int(10) NOT NULL default '0',
              `faction_h` int(10) NOT NULL default '0',
              PRIMARY KEY (`entry`)
              ) ENGINE=MyISAM DEFAULT CHARSET=utf8;"
             );
            }

            #endregion

            Content.AppendLine();
        }