示例#1
0
 private void button2_Click(object sender, EventArgs e)
 {
     richTextBox3.Text = "";
     foreach (var spell in SaintCHelper.GetBlueMageSpells())
     {
         richTextBox3.Text += $"{spell.Action.Name} - {spell.Action.Key}\n";
     }
 }
示例#2
0
        private void button5_Click(object sender, EventArgs e)
        {
            List <RetainerTaskData> levels = SaintCHelper.GetRetainerData();

            using (StreamWriter outputFile = new StreamWriter(@"H:\Ventures.json", false))
            {
                outputFile.Write(JsonConvert.SerializeObject(levels, (Newtonsoft.Json.Formatting)Formatting.Indented));
            }
        }
示例#3
0
        private void button4_Click(object sender, EventArgs e)
        {
            var levels = SaintCHelper.GetRetainerTaskLevels();

/*
 *          foreach (var taskRange in levels)
 *          {
 *              richTextBox2.Text += $"{taskRange.Key}  ({taskRange.Value.Key} - {taskRange.Value.Value})\n";
 *          }
 */

            foreach (var taskRange in SaintCHelper.GetRetainerData())
            {
                richTextBox2.Text += $"{taskRange.ToString()}\n";
            }

            //richTextBox2.Text += $"{SaintCHelper.realm.GameData.IsLibraAvailable}";
        }
示例#4
0
        private void button1_Click(object sender, EventArgs e)
        {
            string NpcName = textBox1.Text.Trim();
            var    results = Program.MappyHelper.GetNpcsByName(NpcName);

            var spell = (AozAction)comboBox1.SelectedItem;

            //richTextBox2.Text += $"{spell.Action.Name} - {spell.Action.Key}\n";
            richTextBox1.Text = "";

            richTextBox2.Text = "";

            richTextBox2.Text += $"Count: {results.Count()}\n";
            List <HotSpot> hotspots = new List <HotSpot>();

            var first = Program.MappyHelper.GetNpcByName(NpcName);

            richTextBox2.Text += $"Filtered Count: {results.Count(i => i.MapTerritoryID == first.MapTerritoryID && i.Location.Distance2D(first.Location) > 75)}";
            foreach (var result in results.Where(i => i.MapTerritoryID == first.MapTerritoryID && i.Location.Distance2D(first.Location) > 75))
            {
                richTextBox1.Text += $"{result.Name} {result.MapTerritoryID} {result.GetCords()}\n";
                richTextBox1.Text += $"{result.TerritoryType.As<Aetheryte>("Aetheryte").PlaceName.Name} ";
                richTextBox1.Text += $"{result.TerritoryType.As<Aetheryte>("Aetheryte").IsAetheryte} ";
                richTextBox1.Text += $"{result.TerritoryType.As<Aetheryte>("Aetheryte").Key}\n";
                hotspots.Add(new HotSpot(result.Name.Replace(' ', '_'), result.Location, 50));
            }

            TargetMob target = new TargetMob();

            target.Id = SaintCHelper.GetNpcIdByName(first.Name);

            GrindArea grindArea = new GrindArea();

            grindArea.Name       = first.Name.Replace(' ', '_');
            grindArea.Hotspots   = hotspots;
            grindArea.MinLevel   = 60;
            grindArea.MaxLevel   = 80;
            grindArea.TargetMobs = new List <TargetMob> {
                target
            };

            Profile profile = new Profile();

            profile.Name       = spell.Action.Name;
            profile.Order      = " ";
            profile.GrindAreas = new List <GrindArea> {
                grindArea
            };
            profile.KillRadius = 50;

            int spellId = spell.Action.Key;

            XmlSerializer           serializer = new XmlSerializer(typeof(Profile));
            XmlSerializerNamespaces ns         = new XmlSerializerNamespaces();

            ns.Add("", "");

            string     filename = @"G:\test.xml";
            TextWriter writer   = new StreamWriter(filename);

            serializer.Serialize(writer, profile, ns);
            writer.Close();

            var doc = new XmlDocument();

            doc.Load(filename);
            var root = doc.GetElementsByTagName("Profile")[0];

            root.Normalize();
            var node1 = doc.GetElementsByTagName("Order")[0];
            // doc.

            //XmlNode myNode = doc.CreateNode(XmlNodeType.Element, "If");
            XmlNode myNode = doc.CreateElement("If");
            var     attr1  = doc.CreateAttribute("condition");

            attr1.Value = "Core.Me.CurrentJob == ClassJobType.BlueMage";
            myNode.Attributes.Append(attr1);
            //myNode.Normalize();
            var newNode = node1.AppendChild(myNode);

            XmlNode myNode2 = doc.CreateElement("If");
            var     attr2   = doc.CreateAttribute("condition");

            attr2.Value = $"not ActionManager.HasSpell({spellId})";
            myNode2.Attributes.Append(attr2);
            myNode2.Normalize();
            var newNode1 = newNode.AppendChild(myNode2);

            XmlNode myNode3 = doc.CreateElement("If");
            var     attr3   = doc.CreateAttribute("condition");

            attr3.Value = $"not IsOnMap({first.MapTerritoryID})";
            myNode3.Attributes.Append(attr3);
            myNode3.Normalize();
            var newNode2 = newNode1.AppendChild(myNode3);

            XmlNode myNode4 = doc.CreateElement("TeleportTo");
            var     attr4   = doc.CreateAttribute("name");

            attr4.Value = $"{first.TerritoryType.As<Aetheryte>("Aetheryte").PlaceName.Name}";
            var attr5 = doc.CreateAttribute("aetheryteId");

            attr5.Value = $"{first.TerritoryType.As<Aetheryte>("Aetheryte").Key}";
            var attr6 = doc.CreateAttribute("force");

            attr6.Value = $"true";
            myNode4.Attributes.Append(attr4);
            myNode4.Attributes.Append(attr5);
            myNode4.Attributes.Append(attr6);
            myNode4.Normalize();
            var newNode3 = newNode2.AppendChild(myNode4);


            XmlNode myNode5 = doc.CreateElement("Grind");
            var     attr7   = doc.CreateAttribute("grindRef");

            attr7.Value = $"{first.Name.Replace(' ', '_')}";
            var attr8 = doc.CreateAttribute("postCombatDelay");

            attr8.Value = $"1";
            var attr9 = doc.CreateAttribute("while");

            attr9.Value = $"not ActionManager.HasSpell({spellId})";
            myNode5.Attributes.Append(attr7);
            myNode5.Attributes.Append(attr8);
            myNode5.Attributes.Append(attr9);
            myNode5.Normalize();
            var newNode4 = newNode1.AppendChild(myNode5);

            doc.Save($@"g:\{spell.Action.Name}.xml");
            // myNode.AppendChild();


/*            if (result != null)
 *          {
 *              richTextBox1.Text = $"{result.Name} {result.MapTerritoryID} {result.GetCords()}\n";
 *              richTextBox1.Text += $"{result.TerritoryType.As<Aetheryte>("Aetheryte").PlaceName.Name}\n";
 *              richTextBox1.Text += $"{result.TerritoryType.As<Aetheryte>("Aetheryte").IsAetheryte}\n";
 *              richTextBox1.Text += $"{result.TerritoryType.As<Aetheryte>("Aetheryte").Key}\n";
 *          }*/

            //richTextBox1.Text += result;
        }
示例#5
0
 private void Form1_Load(object sender, EventArgs e)
 {
     comboBox1.DataSource = SaintCHelper.GetBlueMageSpells().ToList();
 }