Hello i was wondering if anyone could help me with my cc creation i am new to visual studio's and any help would be highly apprectiated and once ive grasped it i plan on making pvp cc's for as many classes as i can!
Code: public override void Combat() { WoWUnit tar = Me.CurrentTarget; if (!Me.IsFacing(tar)) { tar.Face(); Logging.Write("Facing target"); } else if ((tar.HealthPercent <=20 && SpellManager.CanCast("Hammer of Wrath", tar)) { if (SpellManager.CanCast ("Hammer of Wrath", tar); { SpellManager.Cast ("Hammer of Wrath", tar); } } else if (Me.CurrentHolyPower == 3) { if (SpellManager.CanCast("Zealotry") { SpellManager.Cast ("Zealotry") } } else if ((Me.CurrentHolyPower == 3 || isAuraActive("Zealotry")) && SpellManager.CanCast("Templar's Verdict", tar)) { if (SpellManager.CanCast("Templar's Verdict") { SpellManager.Cast ("Templar's Verdict") } } else if (isAuraActive("The Art of War")) { if (SpellManager.CanCast("Exorcism", tar)) { SpellManager.Cast("Exorcism", tar); Logging.Write("AoW proc"); } } else if (tar.Distance > 5 && tar.Distance <= 30) { String s = "Judgement"; if (s != null && SpellManager.CanCast(s, tar)) { SpellManager.Cast(s, tar); Logging.Write(s); } else { Navigator.MoveTo(tar.Location); } } else if (tar.Distance <= 5) { String s = "Judgement"; if (tar.IsCasting) { if ((tar.Distance <= 5 && SpellManager.CanCast("Rebuke", tar)) { s = "Rebuke"; } else if ((tar.Distance > 5 && SpellManager.CanCast("Repentance", tar)) { s = "Repentance"; } else if (SpellManager.CanCast("Hammer of Justice", tar)) { s = "Hammer of Justice"; } } else if (SpellManager.CanCast("Crusader Strike", tar)) { s = "Crusader Strike"; } if (SpellManager.CanCast(s, tar)) { Logging.Write(s); SpellManager.Cast(s, tar); } } else if (tar.Distance > 30) { Logging.Write("Changing targets"); Me.ClearTarget(); } }
if you havent take a look at my CC creation guide. it seems like this code could bottleneck in a few places, and might need to be re-thinked.
ice had a look at your cc creatin guide its just confused me tbh ive tried comparing extracts of the guide to exemplars ret pvp cc and it makes no sense to me ive made a few adjustments to his cc and it seems to be running ok but id much rather build one from scratch Edit: this is the main extract i want to work since its so important in pvp else if (Me.CurrentHolyPower == 3) { if (SpellManager.CanCast("Zealotry") { SpellManager.Cast ("Zealotry") } } else if ((Me.CurrentHolyPower == 3 || isAuraActive("Zealotry")) && SpellManager.CanCast("Templar's Verdict", tar)) { if (SpellManager.CanCast("Templar's Verdict") { SpellManager.Cast ("Templar's Verdict") } }
If you want to have pretty basics example you can look at Lionheart CC or mine Lazylock. You should use the CODE tag to paste your code. Can you explain what you want it to do?
I would like the cc im currently using to use zealotry at 3 hp then use CS then inquisition then CS Templars Verdict CS Templars Vedict CS and so on.
Im using a edited version of Exemplars pvp cc Another change i made in comparison to exemplars cc is to use rebuke when tar.distance <=5 And repentance when tar.distance > 5 but <=30
Code: else if ((Me.CurrentHolyPower == 3 || isAuraActive("Zealotry")) && SpellManager.CanCast("Templar's Verdict", tar)) { SpellManager.Cast ("Templar's Verdict") } In the second "else if" you've already check if you can cast TV so you can simplify by not testing it a second time. Code: else if ((Me.CurrentHolyPower == 3 || isAuraActive("Zealotry")) && SpellManager.CanCast("Templar's Verdict", tar)) Are you sure youre conditions are correct? I don't know how it is tested (HP == 3 or zealotry) && can cast TV or HP == 3 or (zealotry && can cast TV)
else if ((Me.CurrentHolyPower == 3 || isAuraActive("Zealotry")) && SpellManager.CanCast("Crusader Strike", tar)) else spellmanager.Cancast("templar's Verdict") so i need to set cs priority above TV unless i have 3 hp
Please use the CODE tag when you post some code. Can you explain what is not working I don't understand where you need help.
this is the current variation of exemplars cc i am using i have tried adding the code you suggested but it refuses to compile any ideas Code: using System; using System.Linq; using System.Collections.Generic; using System.Diagnostics; using System.Threading; using Styx; using Styx.Combat.CombatRoutine; using Styx.Helpers; using Styx.Logic; using Styx.Logic.Combat; using Styx.Logic.Pathing; using Styx.WoWInternals; using Styx.WoWInternals.WoWObjects; using TreeSharp; using Action = TreeSharp.Action; namespace RetPVP { class Paladin : CombatRoutine { public override void Combat() { WoWUnit tar = Me.CurrentTarget; if (!Me.IsFacing(tar)) { tar.Face(); Logging.Write("Facing target"); } else if (SpellManager.CanCast("Avenging Wrath", Me)) { SpellManager.Cast("Avenging Wrath"); Logging.Write("Avenging Wrath"); } else if (SpellManager.CanCast("Guardian of Ancient Kings", Me)) { SpellManager.Cast("Guardian of Ancient Kings"); Logging.Write("Guardian of Ancient Kings"); } else if ((tar.HealthPercent <= 20 || isAuraActive("Avenging Wrath")) && SpellManager.CanCast("Hammer of Wrath", tar)) //////////////Needs changing to no aura active////// { if (SpellManager.CanCast("Hammer of Wrath", tar)) { SpellManager.Cast("Hammer of Wrath", tar); Logging.Write("HoW"); } } else if (isAuraActive("The Art of War")) { if (SpellManager.CanCast("Exorcism", tar)) { SpellManager.Cast("Exorcism", tar); Logging.Write("AoW proc"); } } else if (tar.Distance > 5 && tar.Distance <= 30) { String s = "Judgement"; if (s != null && SpellManager.CanCast(s, tar)) { SpellManager.Cast(s, tar); Logging.Write(s); } else { Navigator.MoveTo(tar.Location); } } else if (tar.Distance <= 5) { String s = "Judgement"; if (tar.IsCasting) { if (SpellManager.CanCast("Rebuke", tar)) { s = "Rebuke"; ////////change so only if tar.distance is <5///////////////// } else if (SpellManager.CanCast("Repentance", tar)) { s = "Repentance"; ////////change so only if tar.distance is >5 <=30//////////// } else if (SpellManager.CanCast("Hammer of Justice", tar)) { s = "Hammer of Justice"; } } else if (Me.CurrentHolyPower == 3) { if (SpellManager.CanCast("Zealotry")) { s = "Zealotry"; } else { s = "Templar's Verdict"; } } else if (SpellManager.CanCast("Crusader Strike", tar)) { s = "Crusader Strike"; } if (SpellManager.CanCast(s, tar)) { Logging.Write(s); SpellManager.Cast(s, tar); } } else if (tar.Distance > 30) { Logging.Write("Changing targets"); Me.ClearTarget(); } } public override void Pull() { if (Me.GotTarget) { WoWUnit tar = Me.CurrentTarget; if (tar.Distance > PULL_DISTANCE || !tar.InLineOfSight) { Logging.Write("Moving to " + tar); Navigator.MoveTo(tar.Location); } else { Combat(); } } else { var target = (from player in ObjectManager.GetObjectsOfType<WoWPlayer>(false, false) where player.IsAlliance != Me.IsAlliance where player.Dead == false && player.IsGhost == false orderby player.Distance ascending select player).FirstOrDefault(); if (target != null) { Logging.Write("Targeting " + target); target.Target(); } } } public override void Heal() { string s = null; if (Me.MovementInfo.RunSpeed < HOF_THRESHOLD && SpellManager.CanCast("Hand of Freedom", Me)) { s = "Hand of Freedom"; } else if ((Me.Stunned || Me.Fleeing)) { if (SpellManager.CanCast("Blessing of Protection", Me)) { s = "Blessing of Protection"; } else if (SpellManager.CanCast("Divine Shield", Me)) { s = "Divine Shield"; } } else if (Me.CurrentHolyPower > 0) { s = "Word of Glory"; } else if (Me.HealthPercent <= HEAL_THRESHOLD / 2 && SpellManager.CanCast("Lay on Hands")) { s = "Lay on Hands"; } else if (Me.IsMoving) { WoWMovement.MoveStop(); } else { s = "Flash of Light"; } if (s != null && SpellManager.CanCast(s)) { Logging.Write("Heal " + s); SpellManager.Cast(s); } } public override void PreCombatBuff() { if (!isAuraActive("Seal of Truth")) { SpellManager.Cast("Seal of Truth", Me); Logging.Write("SoR"); } else if (isAuraActive("Mark of the Wild") && !isAuraActive("Blessing of Might")) { SpellManager.Cast("Blessing of Might", Me); Logging.Write("might"); } else if (isAuraActive("Blessing of Kings") && !isAuraActive("Blessing of Might")) { if (Me.ActiveAuras["Blessing of Kings"].CreatorGuid != Me.Guid) { SpellManager.Cast("Blessing of Might", Me); Logging.Write("might"); } } else if (!isAuraActive("Blessing of Kings") && !isAuraActive("Mark of the Wild")) { SpellManager.Cast("Blessing of Kings", Me); Logging.Write("kings"); } } public override bool NeedPreCombatBuffs { get { return (!isAuraActive("Blessing of Kings") && !isAuraActive("Mark of the Wild")) || (!isAuraActive("Blessing of Might") && isAuraActive("Mark of the Wild")) || !isAuraActive("Seal of Truth"); } } public override bool NeedHeal { get { return Me.HealthPercent <= HEAL_THRESHOLD || (Me.MovementInfo.RunSpeed < HOF_THRESHOLD && SpellManager.CanCast("Hand of Freedom")); } } private bool isAuraActive(string name) { return Me.ActiveAuras.ContainsKey(name); } public override sealed string Name { get { return "RetPVP"; } } public override WoWClass Class { get { return WoWClass.Paladin; } } private static LocalPlayer Me { get { return ObjectManager.Me; } } public override bool NeedRest { get { return false; } } public override bool NeedPullBuffs { get { return false; } } public override bool NeedCombatBuffs { get { return false; } } private static int HEAL_THRESHOLD = 50; private static int PULL_DISTANCE = 30; private static float HOF_THRESHOLD = 8.05f; } }
i know that but then i dont know how to correct it :/ owell i guess trial and error and i will eventually get there thanks for the help +rep
the problem is in ur Pull Logic search Code: GetObjectsOfType(false, false) should be in line 133 edit ... code-tag replaces some of the sources ... line 133 should be: var target = (from player in ObjectManager.GetObjectsOfType<WoWPlayer>(false, false) don't know if yours looks like that if i take your code and fix this line, it'll compile
its compiling as it currently is its just when i try and add lines to use zealotry then TV thats cuasing the problem
Code: using System; using System.Linq; using System.Collections.Generic; using System.Diagnostics; using System.Threading; using Styx; using Styx.Combat.CombatRoutine; using Styx.Helpers; using Styx.Logic; using Styx.Logic.Combat; using Styx.Logic.Pathing; using Styx.WoWInternals; using Styx.WoWInternals.WoWObjects; using TreeSharp; using Action = TreeSharp.Action; namespace RetPVP { class Paladin : CombatRoutine { public override void Combat() { WoWUnit tar = Me.CurrentTarget; if (!Me.IsFacing(tar)) { tar.Face(); Logging.Write("Facing target"); } else if (SpellManager.CanCast("Avenging Wrath", Me)) { SpellManager.Cast("Avenging Wrath"); Logging.Write("Avenging Wrath"); } else if ((Me.CurrentHolyPower == 3 || isAuraActive("Zealotry")) && SpellManager.CanCast("Templar's Verdict", tar)) { SpellManager.Cast ("Templar's Verdict") } else if (SpellManager.CanCast("Guardian of Ancient Kings", Me)) { SpellManager.Cast("Guardian of Ancient Kings"); Logging.Write("Guardian of Ancient Kings"); } else if ((tar.HealthPercent <= 20 || isAuraActive("Avenging Wrath")) && SpellManager.CanCast("Hammer of Wrath", tar)) //////////////Needs changing to no aura active////// { if (SpellManager.CanCast("Hammer of Wrath", tar)) { SpellManager.Cast("Hammer of Wrath", tar); Logging.Write("HoW"); } } else if (isAuraActive("The Art of War")) { if (SpellManager.CanCast("Exorcism", tar)) { SpellManager.Cast("Exorcism", tar); Logging.Write("AoW proc"); } } else if (tar.Distance > 5 && tar.Distance <= 30) { String s = "Judgement"; if (s != null && SpellManager.CanCast(s, tar)) { SpellManager.Cast(s, tar); Logging.Write(s); } else { Navigator.MoveTo(tar.Location); } } else if (tar.Distance <= 5) { String s = "Judgement"; if (tar.IsCasting) { if (SpellManager.CanCast("Rebuke", tar)) { s = "Rebuke"; ////////change so only if tar.distance is <5///////////////// } else if (SpellManager.CanCast("Repentance", tar)) { s = "Repentance"; ////////change so only if tar.distance is >5 <=30//////////// } else if (SpellManager.CanCast("Hammer of Justice", tar)) { s = "Hammer of Justice"; } } else if (Me.CurrentHolyPower == 3) { if (SpellManager.CanCast("Zealotry")) { s = "Zealotry"; } else { s = "Templar's Verdict"; } } else if (SpellManager.CanCast("Crusader Strike", tar)) { s = "Crusader Strike"; } if (SpellManager.CanCast(s, tar)) { Logging.Write(s); SpellManager.Cast(s, tar); } } else if (tar.Distance > 30) { Logging.Write("Changing targets"); Me.ClearTarget(); } } public override void Pull() { if (Me.GotTarget) { WoWUnit tar = Me.CurrentTarget; if (tar.Distance > PULL_DISTANCE || !tar.InLineOfSight) { Logging.Write("Moving to " + tar); Navigator.MoveTo(tar.Location); } else { Combat(); } } else { var target = (from player in ObjectManager.GetObjectsOfType(false, false) where player.IsAlliance != Me.IsAlliance where player.Dead == false && player.IsGhost == false orderby player.Distance ascending select player).FirstOrDefault(); if (target != null) { Logging.Write("Targeting " + target); target.Target(); } } } public override void Heal() { string s = null; if (Me.MovementInfo.RunSpeed < HOF_THRESHOLD && SpellManager.CanCast("Hand of Freedom", Me)) { s = "Hand of Freedom"; } else if ((Me.Stunned || Me.Fleeing)) { if (SpellManager.CanCast("Blessing of Protection", Me)) { s = "Blessing of Protection"; } else if (SpellManager.CanCast("Divine Shield", Me)) { s = "Divine Shield"; } } else if (Me.CurrentHolyPower > 0) { s = "Word of Glory"; } else if (Me.HealthPercent <= HEAL_THRESHOLD / 2 && SpellManager.CanCast("Lay on Hands")) { s = "Lay on Hands"; } else if (Me.IsMoving) { WoWMovement.MoveStop(); } else { s = "Flash of Light"; } if (s != null && SpellManager.CanCast(s)) { Logging.Write("Heal " + s); SpellManager.Cast(s); } } public override void PreCombatBuff() { if (!isAuraActive("Seal of Truth")) { SpellManager.Cast("Seal of Truth", Me); Logging.Write("SoR"); } else if (isAuraActive("Mark of the Wild") && !isAuraActive("Blessing of Might")) { SpellManager.Cast("Blessing of Might", Me); Logging.Write("might"); } else if (isAuraActive("Blessing of Kings") && !isAuraActive("Blessing of Might")) { if (Me.ActiveAuras["Blessing of Kings"].CreatorGuid != Me.Guid) { SpellManager.Cast("Blessing of Might", Me); Logging.Write("might"); } } else if (!isAuraActive("Blessing of Kings") && !isAuraActive("Mark of the Wild")) { SpellManager.Cast("Blessing of Kings", Me); Logging.Write("kings"); } } public override bool NeedPreCombatBuffs { get { return (!isAuraActive("Blessing of Kings") && !isAuraActive("Mark of the Wild")) || (!isAuraActive("Blessing of Might") && isAuraActive("Mark of the Wild")) || !isAuraActive("Seal of Truth"); } } public override bool NeedHeal { get { return Me.HealthPercent <= HEAL_THRESHOLD || (Me.MovementInfo.RunSpeed < HOF_THRESHOLD && SpellManager.CanCast("Hand of Freedom")); } } private bool isAuraActive(string name) { return Me.ActiveAuras.ContainsKey(name); } public override sealed string Name { get { return "RetPVP"; } } public override WoWClass Class { get { return WoWClass.Paladin; } } private static LocalPlayer Me { get { return ObjectManager.Me; } } public override bool NeedRest { get { return false; } } public override bool NeedPullBuffs { get { return false; } } public override bool NeedCombatBuffs { get { return false; } } private static int HEAL_THRESHOLD = 50; private static int PULL_DISTANCE = 30; private static float HOF_THRESHOLD = 8.05f; } } Could not compile CC from C:\HB\CustomClasses\RetPVP.cs! File: RetPVP.cs Line: 38 Error: ; expected File: RetPVP.cs Line: 137 Error: The type arguments for method 'Styx.WoWInternals.ObjectManager.GetObjectsOfType<T>(bool, bool)' cannot be inferred from the usage. Try specifying the type arguments explicitly. File: RetPVP.cs Line: 146 Error: 'T' does not contain a definition for 'Target' and no extension method 'Target' accepting a first argument of type 'T' could be found (are you missing a using directive or an assembly reference?)