Advertisement
Rolebacktime

Hunter

Apr 3rd, 2014
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.10 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using SPQR;
  7. using MySPQR;
  8.  
  9. namespace SPQR.Engine
  10. {
  11. class Hunter : Engine.FightModule
  12. {
  13. public override string DisplayName
  14. {
  15. get { return "Hunter"; } //This is the name displayed in SPQR's Class selection DropdownList
  16. }
  17.  
  18. internal enum Spells : int //This is a convenient list of all spells used by our combat routine
  19. { //you can have search on wowhead.com for spell name, and get the id in url
  20. SteadyShot = 56641,
  21. CobraShot = 77767,
  22. ExplosiveShot = 53301,
  23. ArcaneShot = 3044,
  24. ChimeraShot = 53209,
  25. BlackArrow = 3674,
  26. SerpentSting = 1978,
  27. AimedShot = 19434,
  28. KillCommand = 34026,
  29. GlaiveToss = 117050,
  30. Fervor = 82726,
  31. DireBeast = 120679,
  32. SilencingShot = 34490,
  33. KillsShot = 53351,
  34. }
  35. internal enum Auras : int //This is another convenient list of Auras used in our combat routine
  36. { //you can have those in wowhead.com (again) and get the id in url
  37. SerpentSting = 1978,
  38. }
  39.  
  40. public override void CombatLogic() //This is the DPS / healing coutine, called in loop by SPQR all code here is executed
  41. {
  42. var TARGET = MySPQR.Internals.ObjectManager.Target;
  43. var ME = MySPQR.Internals.ObjectManager.WoWLocalPlayer;
  44.  
  45.  
  46.  
  47. if(TARGET.HealthPercent < 20)
  48. CastSpellById((int)Spells.KillsShot);
  49.  
  50. if(TARGET.IsCasting)
  51. CastSpellById((int)Spells.SilencingShot);
  52.  
  53. if(TARGET.HealthPercent > 80)
  54. CastSpellById((int)Spells.DireBeast);
  55.  
  56. if(ME.Focus < 15 && TARGET.HealthPercent > 45)
  57. CastSpellById((int)Spells.Fervor);
  58.  
  59. if(TARGET.HealthPercent > 55)
  60. CastSpellById((int)Spells.GlaiveToss);
  61.  
  62. if(TARGET.Position.Distance3DFromPlayer < 25)
  63. CastSpellById((int)Spells.KillCommand);
  64.  
  65. CastSpellById((int)Spells.AimedShot);
  66.  
  67. if(TARGET.HealthPercent > 75)
  68. CastSpellById((int)Spells.BlackArrow);
  69.  
  70. if(!TARGET.HasAurabyId((int)Auras.SerpentSting))
  71. CastSpellById((int)Spells.SerpentSting);
  72.  
  73. if(ME.Focus > 70)
  74. CastSpellById((int)Spells.ArcaneShot);
  75.  
  76. CastSpellById((int)Spells.ExplosiveShot);
  77.  
  78. CastSpellById((int)Spells.CobraShot);
  79.  
  80. CastSpellById((int)Spells.SteadyShot);
  81. }
  82.  
  83. public static void CastSpellById(int spellId) //This is a *usermade* function to evaluate if the given spell (spellId) can be cast
  84. {
  85. if (MySPQR.Internals.ObjectManager.Target.IsValid) /*return true if the Target is valid(exist) or not dead*/
  86. {
  87. if (MySPQR.Internals.ActionBar.CanCast(spellId)) /*return true if your char can use the spell (check cooldown and global cooldown*/
  88. {
  89. MySPQR.Internals.ActionBar.GetSlotById(spellId).Execute(); /*if all is ok, this will get the ActionBarSlot for your spell,
  90. and execute the right Keybind to cast it*/
  91. }
  92. }
  93. }
  94.  
  95. public override void OnLoad() //This is called when the Customclass is loaded in SPQR
  96. {
  97.  
  98. }
  99.  
  100. public override void OnClose() //This is called when the Customclass is unloaded in SPQR
  101. {
  102.  
  103. }
  104.  
  105. public override void OnStart() //This is called once, when you hit CTRL+X to start SPQR combat routine
  106. {
  107.  
  108. }
  109.  
  110. public override void OnStop() //This is called once, when you hit CTRL+X to stop SPQR combat routine
  111. {
  112.  
  113. }
  114. }
  115. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement