Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 29th, 2012  |  syntax: C#  |  size: 3.08 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. using System;
  2. using System.Reflection;
  3. using System.Windows.Forms;
  4. using System.Drawing;
  5. using System.Threading;
  6. using System.Globalization;
  7. using System.Collections.Generic;
  8. using Styx.Combat.CombatRoutine;
  9. using Styx.Helpers;
  10. using Styx.Plugins.PluginClass;
  11. using TreeSharp;
  12.  
  13. namespace Vagabond
  14. {
  15.     public class VagabondLoader : CombatRoutine
  16.     {
  17.         private readonly CombatRoutine CC;
  18.  
  19.         public VagabondLoader()
  20.         {
  21.             try
  22.             {
  23.                 Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
  24.  
  25.                 string path = Logging.ApplicationPath + @"\CustomClasses\Vagabond.dll";
  26.  
  27.                 Assembly asm = Assembly.LoadFrom(path);
  28.  
  29.                 if (asm != null)
  30.                 {
  31.                     foreach (Type t in asm.GetTypes())
  32.                     {
  33.                         if (t.IsSubclassOf(typeof(CombatRoutine)) && t.IsClass)
  34.                         {
  35.                             var obj = Activator.CreateInstance(t);
  36.                             CC = (CombatRoutine)obj;
  37.                         }
  38.  
  39.                     }
  40.                 }
  41.                 else
  42.                 {
  43.                     Logging.Write(Color.DarkRed, "An error occured while loading Vagabond! asm is null!");
  44.                 }
  45.  
  46.             }
  47.             catch (System.Threading.ThreadAbortException) { throw; }
  48.             catch (Exception e)
  49.             {
  50.                 Logging.Write(Color.DarkRed, "An error occured while loading Vagabond!");
  51.                 Logging.Write(Color.DarkRed,e.ToString());
  52.             }
  53.         }
  54.  
  55. #region Overrides of CombatRoutine
  56.  
  57.         public override string Name
  58.         {
  59.             get { return CC.Name; }
  60.         }
  61.  
  62.         public override void Initialize()
  63.         {
  64.             CC.Initialize();
  65.  
  66.         }
  67.         public override WoWClass Class { get { return WoWClass.Rogue; } }
  68.         public override void Combat()
  69.         {
  70.             CC.Combat();
  71.         }
  72.  
  73.  
  74.         public override void Pulse()
  75.         {
  76.             CC.Pulse();
  77.         }
  78.  
  79.         public override void Pull()
  80.         {
  81.             CC.Pull();
  82.  
  83.  
  84.         }
  85.  
  86.         public override void PreCombatBuff()
  87.         {
  88.             CC.PreCombatBuff();
  89.         }
  90.  
  91.         public override bool NeedPreCombatBuffs
  92.         {
  93.             get { return CC.NeedPreCombatBuffs; }
  94.         }
  95.  
  96.         public override bool NeedHeal
  97.         {
  98.             get { return CC.NeedHeal; }
  99.         }
  100.         public override void Heal()
  101.         {
  102.             CC.Heal();
  103.         }
  104.  
  105.         public override void OnButtonPress()
  106.         {
  107.             CC.OnButtonPress();
  108.         }
  109.         public override bool WantButton { get { return true; } }
  110.         public override bool NeedPullBuffs { get { return false; } }
  111.         public override bool NeedCombatBuffs { get { return false; } }
  112.         public override void Rest()
  113.         {
  114.             CC.Rest();
  115.         }
  116.         public override bool NeedRest
  117.         {
  118.             get { return CC.NeedRest; }
  119.         }
  120.  
  121.         #endregion
  122.     }
  123. }