コード例 #1
0
        public MainForm()
        {
            InitializeComponent();

            creatureScriptsCreator    = new CreatureScriptsCreator(this);
            waypointsCreator          = new WaypointsCreator(this);
            coreScriptTemplate        = new CoreScriptTemplates(this);
            spellAuraScriptCreatorDB  = new SpellAuraScriptDbCreator(this);
            creatureNamesDict         = new Dictionary <uint, string>();
            spellDBCOverrideCreatorDB = new SpellInfoOverrideCreator(this);
            combatAIScriptsCreatorDB  = new CombatAICreator(this);
            objectTemplateHelperDB    = new ObjectTemplateHelper(this);
            journalLootCreatorDB      = new JournalLootCreator(this);
            dungeonDataParser         = new DungeonDataInfoCreator(this);
            areaTriggerActionCreator  = new AreaTriggerActionCreator(this);

            if (Properties.Settings.Default.UsingDB)
            {
                creatureNamesDict = GetCreatureNamesFromDB();
            }
            else
            {
                checkBox_DatabaseConsidering.Enabled = false;
            }
        }
コード例 #2
0
        static public string CreateCombatEntryValues(CombatAIEventDataEntry combatData, uint id)
        {
            string npcName = "";

            string creatureNameQuery = "SELECT `Name1` FROM `creature_template_wdb` WHERE `entry` = " + combatData.NpcEntry + ";";
            var    creatureNameDs    = Properties.Settings.Default.UsingDB ? SQLModule.DatabaseSelectQuery(creatureNameQuery) : null;

            if (creatureNameDs != null)
            {
                foreach (DataRow row in creatureNameDs.Tables["table"].Rows)
                {
                    npcName = row[0].ToString();
                }
            }

            if (npcName == "")
            {
                return("");
            }

            string spellName = SpellInfoOverrideCreator.GetSpellName(combatData.SpellId);

            string comment = "\"" + npcName + " -- " + spellName + "\"";
            string query   = "(" + combatData.NpcEntry + ", " + id + ", " + combatData.StartMin + ", " + combatData.StartMax +
                             ", " + combatData.RepeatMin + ", " + combatData.RepeatMax + ", " + combatData.RepeatFail + ", " + combatData.SpellId + ", " +
                             combatData.EventCheck + ", " + combatData.EventFlags + ", " + combatData.AttackDist + ", " + combatData.DifficultyMask + ", "
                             + comment + ")";

            return(query);
        }
コード例 #3
0
        public void GenerateSQL()
        {
            mainForm.SpellAuraScript_SQL_Out_RichTextBox.Clear();

            foreach (var item in spellScriptsEntries)
            {
                var SQLtext = "-- " + SpellInfoOverrideCreator.GetSpellName(item.Key) + " \r\n";
                SQLtext += "DELETE FROM `spell_scripting` WHERE `SpellId` = " + item.Key + ";\r\n";
                SQLtext += "INSERT INTO `spell_scripting` (`SpellId`, `Id`, `Hook`, `EffectId`, `Action`, `ActionSpellId`, `ActionCaster`, `OriginalCaster`, `ActionTarget`, `Triggered`, " +
                           "`Calculation`, `DataSource`, `ActionSpellList`, `TargetSpellId`, `TargetEffectId`, `DataEffectId`, `Comment`) VALUES\r\n";

                uint itr = 0;
                foreach (SpellScriptEntry script in item.Value)
                {
                    string query = SpellScriptDB.CreateSqlQuery(script, itr);

                    if (itr + 1 >= item.Value.Count)
                    {
                        query += ";\n";
                    }
                    else
                    {
                        query += ",\n";
                    }

                    SQLtext += query;
                    itr++;
                }

                SQLtext += "\n\n";
                mainForm.SpellAuraScript_SQL_Out_RichTextBox.AppendText(SQLtext);
            }

            foreach (var item in auraScriptsEntries)
            {
                var SQLtext = "-- " + SpellInfoOverrideCreator.GetSpellName(item.Key) + " \r\n";
                SQLtext += "DELETE FROM `aura_scripts` WHERE `SpellId` = " + item.Key + ";\r\n";
                SQLtext += "insert into `aura_scripts` (`SpellId`, `Id`, `Hook`, `EffectId`, `Action`, `ActionSpellId`, `ActionCaster`, `OriginalCaster`, `ActionTarget`, `Triggered`, " +
                           "`Calculation`, `DataSource`, `ActionSpellList`, `Comment`) VALUES\r\n";

                uint itr = 0;
                foreach (AuraScriptEntry script in item.Value)
                {
                    string query = AuraScriptDB.CreateSqlQuery(script, itr);

                    if (itr + 1 >= item.Value.Count)
                    {
                        query += ";\n";
                    }
                    else
                    {
                        query += ",\n";
                    }

                    SQLtext += query;
                    itr++;
                }

                SQLtext += "\n\n";
                mainForm.SpellAuraScript_SQL_Out_RichTextBox.AppendText(SQLtext);
            }

            MessageBox.Show("SQL Queries Generated");
        }