public static void GetSpellFormula(Session session, params string[] parameters)
        {
            if (parameters?.Length != 2)
            {
                Console.WriteLine("getspellformula <accountname> <spellid>");
                return;
            }

            if (!uint.TryParse(parameters[1], out var spellid))
            {
                Console.WriteLine("getspellformula <accountname> <spellid>");
                return;
            }

            DatLoader.FileTypes.SpellComponentsTable comps      = DatManager.PortalDat.SpellComponentsTable;
            DatLoader.FileTypes.SpellTable           spellTable = DatManager.PortalDat.SpellTable;
            string spellName = spellTable.Spells[spellid].Name;
            var    formula   = DatLoader.FileTypes.SpellTable.GetSpellFormula(DatManager.PortalDat.SpellTable, spellid, parameters[0]);

            Console.WriteLine("Formula for " + spellName);
            for (int i = 0; i < formula.Count; i++)
            {
                Console.WriteLine("Comp " + i + ": " + comps.SpellComponents[formula[i]].Name);
            }
            Console.WriteLine();
        }
Example #2
0
        public static void GetSpellFormula(Session session, params string[] parameters)
        {
            if (parameters?.Length != 2)
            {
                Console.WriteLine("getspellformula <accountname> <spellid>");
                return;
            }

            uint spellid;

            if (!uint.TryParse(parameters[1], out spellid))
            {
                Console.WriteLine("getspellformula <accountname> <spellid>");
                return;
            }

            DatLoader.FileTypes.SpellComponentsTable comps      = DatLoader.FileTypes.SpellComponentsTable.ReadFromDat();
            DatLoader.FileTypes.SpellTable           spellTable = DatLoader.FileTypes.SpellTable.ReadFromDat();
            string spellName = spellTable.Spells[spellid].Name;

            System.Collections.Generic.List <uint> formula = DatLoader.FileTypes.SpellTable.GetSpellFormula(spellid, parameters[0]);
            Console.WriteLine("Formula for " + spellName);
            for (int i = 0; i < formula.Count; i++)
            {
                Console.WriteLine("Comp " + i.ToString() + ": " + comps.SpellComponents[formula[i]].Name);
            }
            Console.WriteLine();
        }