Exemple #1
0
        public static void Main()
        {
            dbc = Serializer.DeSerializeObject("db.dbc");


            spell_data_t[] a = new spell_data_t[dbc.Spells.Values.Count];
            dbc.Spells.Values.CopyTo(a, 0);

            foreach (var v in a)
            {
                dbc.Spells[v.id, v.token] = v;
            }


            int    c   = 0;
            String akk = "";

            SimcNames.Populate();


            //var u = new SimcNames.SpecList { new SimcNames.SpecPair(WoWSpec.None, 1), };

            /*foreach (var s in SimcNames.spells.Keys)
             * {
             * if (SimcNames.spells[s].Count == 0)  Console.WriteLine("spell::"+s);
             * }
             *
             * foreach (var s in SimcNames.debuffs.Keys)
             * {
             *  if (SimcNames.debuffs[s].Count == 0) Console.WriteLine("debuff::" + s);
             * }
             *
             * foreach (var s in SimcNames.buffs.Keys)
             * {
             *  if (SimcNames.buffs[s].Count == 0) Console.WriteLine("buff::" + s);
             * }*/


            //var attr = dbc.Spells[SimcNames.spells["sinister_strike"].First().V2].attr1;


            foreach (var s in dbc.Spells.Values)
            {
                if (s.IsChanneled() && SimcNames.spells.ContainsKey(s.token))
                {
                    Console.WriteLine(s.name);
                }
            }

            Console.ReadKey();

            /*String content = "";
             * foreach (var s in SimcNames.spells.Keys)
             * {
             *  if (!dbc.Spells.RelationContainsKey(s))
             *  {
             *      content += "spells[\"" + s + "\"]=new SpecList();" + Environment.NewLine;
             *      continue;
             *  }
             *  string arr = "";
             *
             *  foreach (var e in GetAllSpells(s))
             *  {
             *      arr += "new SpecPair(WoWSpec.None, "+e.id+"),";
             *
             *  }
             *  content += "spells[\"" + s + "\"]=new SpecList{" +arr+ "};" + Environment.NewLine;
             * }
             *
             * foreach (var s in SimcNames.buffs.Keys)
             * {
             *  if (!dbc.Spells.RelationContainsKey(s))
             *  {
             *      content += "buffs[\"" + s + "\"]=new SpecList();" + Environment.NewLine;
             *      continue;
             *  }
             *  string arr = "";
             *
             *  foreach (var e in GetAllSpells(s))
             *  {
             *      arr += "new SpecPair(WoWSpec.None, " + e.id + "),";
             *
             *  }
             *  content += "buffs[\"" + s + "\"]=new SpecList{" + arr + "};" + Environment.NewLine;
             * }
             *
             * foreach (var s in SimcNames.debuffs.Keys)
             * {
             *  if (!dbc.Spells.RelationContainsKey(s))
             *  {
             *      content += "debuffs[\"" + s + "\"]=new SpecList();" + Environment.NewLine;
             *      continue;
             *  }
             *  string arr = "";
             *
             *  foreach (var e in GetAllSpells(s))
             *  {
             *      arr += "new SpecPair(WoWSpec.None, " + e.id + "),";
             *
             *  }
             *  content += "debuffs[\"" + s + "\"]=new SpecList{" + arr + "};" + Environment.NewLine;
             * }
             *
             * File.WriteAllText("a.txt",content);
             *
             * Console.WriteLine(c);
             *
             * //Console.WriteLine(FindBuff("steady_focus").tooltip);
             *
             * //Console.WriteLine(e.Spells[lid].name + " " + e.Spells[lid].desc);*/
        }
Exemple #2
0
        public SimcraftImpl()
        {
            //Write("go!");
            try
            {
                dbc = Serializer.DeSerializeObject(FindDatabase());
            }
            catch (Exception e)
            {
                Write(e.ToString());
            }

            spell_data_t[] a = new spell_data_t[dbc.Spells.Values.Count];
            dbc.Spells.Values.CopyTo(a, 0);

            foreach (var v in a)
            {
                dbc.Spells[v.id, v.token] = v;
            }

            Write("Count " + dbc.Spells.Count);

            Directory.CreateDirectory(SimcraftProfilePath);

            try
            {
                RoutineManager.Current = null;

                SimcNames.Populate();
                MainCache  = new ProxyCacheEntry();
                inst       = this;
                active_dot = new ActiveDot();
                //trinket = new TrinketProxy(() => StyxWoW.Me.ToUnit(), this);
                health       = new HealthProxy(() => StyxWoW.Me.ToUnit());
                energy       = new EnergyProxy(() => StyxWoW.Me.ToUnit());
                focus        = new FocusProxy(() => StyxWoW.Me.ToUnit());
                chi          = new ChiProxy(() => StyxWoW.Me.ToUnit());
                rage         = new RageProxy(() => StyxWoW.Me.ToUnit());
                buff         = new BuffProxy(() => StyxWoW.Me.ToUnit(), PlayerAuras);
                debuff       = new DebuffProxy(() => conditionUnit);
                talent       = new TalentProxy(() => StyxWoW.Me.ToUnit());
                cooldown     = new CooldownProxy(() => StyxWoW.Me.ToUnit());
                spell        = new SpellProxy(() => StyxWoW.Me.ToUnit());
                combo_points = new ComboPointProxy(() => StyxWoW.Me.ToUnit());

                target         = new TargetProxy(() => conditionUnit);
                runic_power    = new RunicPowerProxy(() => StyxWoW.Me.ToUnit());
                disease        = new DiseaseProxy(this);
                blood          = new RuneProxy(() => StyxWoW.Me.ToUnit(), RuneType.Blood);
                unholy         = new RuneProxy(() => StyxWoW.Me.ToUnit(), RuneType.Unholy);
                frost          = new RuneProxy(() => StyxWoW.Me.ToUnit(), RuneType.Frost);
                death          = new RuneProxy(() => StyxWoW.Me.ToUnit(), RuneType.Death);
                glyph          = new GlyphProxy(() => StyxWoW.Me.ToUnit());
                set_bonus      = new SetBonusProxy();
                prev_gcd       = new PrevGcdProxy();
                prev           = new PrevGcdProxy();
                pet            = new PetProxy("def");
                eclipse_energy = new EclipseProxy(() => StyxWoW.Me.ToUnit());
                mana           = new ManaProxy(() => StyxWoW.Me.ToUnit());
                holy_power     = new HolyPowerProxy(() => StyxWoW.Me.ToUnit());
                seal           = new SealProxy();
                actions        = new ActionProxy();
                stat           = new StatProxy();
                obliterate     = new ObliterateProxy();

                MainCache["gcd"].SetRetrievalDelegate(() =>
                {
                    var rem = (Decimal)SpellManager.GlobalCooldownLeft.TotalSeconds;
                    var g   = BaseGcd();
                    g       = g / ((100 + spell_haste) / 100);
                    return(new Gcd((Decimal)_conditionSpell.gcd, Math.Max(g, 1), rem));
                });

                MainCache["GlobalCooldown"].SetRetrievalDelegate(() =>
                {
                    return(SpellManager.GlobalCooldownLeft.TotalMilliseconds > 1000 / 15);
                });

                MainCache["WoWTime"].SetRetrievalDelegate(() =>
                {
                    return(Lua.GetReturnVal <double>("return GetTime()", 0));
                });


                var s = new spell_data_t();
                s.name  = "Storm, Earth, and Fire";
                s.token = "storm_earth_and_fire";
                s.id    = 138130;
                dbc.Spells.Add(138130, s);
            }
            catch (Exception e)
            {
                Write(e.ToString());
            }
        }