Ejemplo n.º 1
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            api    = new WoW_API();
            events = new WoWEvents(api);

            lua            = new Lua();
            lua.DebugHook += (s, ev) => {
                textBox.Text = textBox.Text + "\n" + ev.LuaDebug.ToString();
            };

            registerWoWApiFunctions();

            var objs = lua.DoFile("C:\\Program Files (x86)\\World of Warcraft\\Interface\\AddOns\\Florenicon\\Florenicon.lua");

            if (objs != null)
            {
                foreach (var obj in objs)
                {
                    textBox.Text = textBox.Text + "\n" + obj.ToString();
                }
            }

            lua.DoString("Florenicon_OnLoad(GetWoWEventsObject());");

            GenerateSpellEvent("SPELL_AURA_APPLIED", "Player1", 81269, 100, 10, false);
            GenerateSpellEvent("SPELL_CAST_SUCCESS", "Player1", 81269, 100, 10, false);

            Thread.Sleep(1000);
            api.PlayerInCombat = false;
            GenerateSpellEvent("SPELL_HEAL", "Player1", 81269, 100, 10, false);
            GenerateSpellEvent("SPELL_HEAL", "Player2", 81269, 100, 10, false);

            Thread.Sleep(1000);
            api.PlayerInCombat = true;
            GenerateSpellEvent("SPELL_HEAL", "Player3", 81269, 100, 10, false);
            GenerateSpellEvent("SPELL_HEAL", "Player4", 81269, 100, 10, false);
            Thread.Sleep(1000);
            GenerateSpellEvent("SPELL_HEAL", "Player3", 81269, 150, 100, true);
            GenerateSpellEvent("SPELL_HEAL", "Player4", 81269, 100, 10, false);
            api.PlayerInCombat = false;

            Thread.Sleep(1000);
            GenerateSpellEvent("SPELL_HEAL", "Player5", 81269, 100, 10, false);
            GenerateSpellEvent("SPELL_HEAL", "Player6", 81269, 100, 10, false);

            Thread.Sleep(1000);
            Thread.Sleep(1000);
            Thread.Sleep(1000);
            Thread.Sleep(1000);
            Thread.Sleep(1000);
        }
Ejemplo n.º 2
0
 public WoWEvents(WoW_API api)
 {
     RegisteredEvents = new List <string>();
 }