August 19, 20214 yr hi anyone can help me have the correct setting for the fight class im making please. my FC doesn't cast Corruption because it already sees another lock's corruption as it's own. I highlighted the possible line that needs to be changed to it will buff Corruption to it's target. Thank you. if (Corruption.IsSpellUsable && Corruption.KnownSpell && Corruption.IsDistanceGood && SpellManager.GlobalCooldownTimeLeft() == 0 && !ObjectManager.Target.Rooted && !ObjectManager.Target.HaveBuff("Corruption") && ObjectManager.Me.HaveBuff("Life Tap")) { Corruption.Launch(); return; }
August 19, 20214 yr 13 minutes ago, jiraiyasm said: hi anyone can help me have the correct setting for the fight class im making please. my FC doesn't cast Corruption because it already sees another lock's corruption as it's own. I highlighted the possible line that needs to be changed to it will buff Corruption to it's target. Thank you. if (Corruption.IsSpellUsable && Corruption.KnownSpell && Corruption.IsDistanceGood && SpellManager.GlobalCooldownTimeLeft() == 0 && !ObjectManager.Target.Rooted && !ObjectManager.Target.HaveBuff("Corruption") && ObjectManager.Me.HaveBuff("Life Tap")) { Corruption.Launch(); return; } Add something like this, but you should think about moving all the casting checks into one Function and do the Checks only once. if (Corruption.IsSpellUsable && Corruption.KnownSpell && Corruption.IsDistanceGood && SpellManager.GlobalCooldownTimeLeft() == 0 && !ObjectManager.Target.Rooted && ObjectManager.Me.HaveBuff("Life Tap")) { if(!DebuffCheckOwner("Corruption") { Corruption.Launch(); return; } } public static bool DebuffCheckOwner(Spell spell, bool owner = true) { List<Aura> DebuffList = ObjectManager.Target.GetAllBuff(); Aura aura = null; if (owner) { aura = DebuffList.FirstOrDefault(s => s.GetSpell.Name == spell.Name && s.Owner == ObjectManager.Me.Guid); if (aura != null) { return true; } } return false; }
August 23, 20214 yr Author Thank you so much for the help. i am still very new to this area. i tried having my lock to use grand spellstone but it doesn't "Left click" the spellstone to the weapon. i just based this on the snipets for rogue also. private void EnchantWeapon() { bool hasMainHandEnchant = Lua.LuaDoString<bool> (@"local hasMainHandEnchant, _, _, _, _, _, _, _, _ = GetWeaponEnchantInfo() if (hasMainHandEnchant) then return '1' else return '0' end"); if (!hasMainHandEnchant) { IEnumerable<uint> MP = InstantPoisonDictionary .Where(i => i.Key <= ObjectManager.Me.Level && ItemsManager.HasItemById(i.Value)) .OrderByDescending(i => i.Key) .Select(i => i.Value); if (MP.Any()) { MHPoison = MP.First(); ItemsManager.UseItem(MHPoison); Thread.Sleep(10); Lua.LuaDoString("/click PickupInventoryItem(16)"); Thread.Sleep(5000); return; } } } private static Dictionary<int, uint> InstantPoisonDictionary = new Dictionary<int, uint> { { 79, 41196 }, }; may i ask please how to check if the required item is available in the bag before casting the spell especially needed for casting buffs. Thank you @Talamin
August 23, 20214 yr The easiest way is: ItemsManager.GetItemCountByIdLUA(12345) >0 Instead of 12345 you have to enter a proper Item ID
August 23, 20214 yr Author 1 hour ago, Sye24 said: @jiraiyasmHello, i went ahead and cleaned up some of your code, this should work. let me know if you need any help. public static void EnchantWeapon() { try { if (hasMainHandEnchant || Fight.InFight || ObjectManager.Me.InCombatFlagOnly || ObjectManager.Me.IsDead) return; IEnumerable<uint> MainHandEnchant = InstantPoisonDictionary .Where(i => i.Key <= ObjectManager.Me.Level && ItemsManager.GetItemCountByIdLUA(i.Value) >= 1) .OrderByDescending(i => i.Key) .Select(i => i.Value); if (MainHandEnchant.Any()) { var MHPoison = MainHandEnchant.FirstOrDefault(); ItemsManager.UseItem(MHPoison); Thread.Sleep(10); Lua.LuaDoString("PickupInventoryItem(16);"); Thread.Sleep(5000); } } catch(Exception ex) { Logging.Write($"{ex}"); } } private static Dictionary<int, uint> InstantPoisonDictionary = new Dictionary<int, uint>() { { 79, 41196 }, }; private static Boolean hasMainHandEnchant => Lua.LuaDoString<Int32>("local GetWeaponEnchant = {GetWeaponEnchantInfo()}; return GetWeaponEnchant[1];") == 1; Yes it indeed worked. Thank you so much!
August 24, 20214 yr Author hi @Sye24is it possible for my characters to move away from the ground debuff that doesn't show as a debuff on the player? will this snipet below work? wManager.Events.FightEvents.OnFightLoop += (unit, cancelable) => { var me = wManager.Wow.ObjectManager.ObjectManager.Me; var target = wManager.Wow.ObjectManager.ObjectManager.Target; if (me.IsAlive && target.IsAlive && !me.IsCast && me.HaveBuff("Buff name")) { wManager.Wow.Helpers.Keybindings.PressKeybindings(wManager.Wow.Enums.Keybindings.STRAFELEFT, 1000 * 3); // strage left during 3 secondes } }; the debuff IDs are 69019 and 68863 which both hits the characters but no debuffs appears on them as they explode from the ground. Thank you.
August 26, 20214 yr Author @Sye24, may i ask how to make the string array option for the plug.in please? thank you.
September 9, 20214 yr Author On 9/2/2021 at 5:43 PM, Sye24 said: @jiraiyasmi dont follow, if you want to add Damaging spell names, do into settings . is it okay if i can ask for the code for this plugin? thank you.
September 10, 20214 yr Author 15 hours ago, Sye24 said: Sorry but no, i improved a lot of the code and i am gonna use it in upcoming project. im making a fightclass for DK, how do i get it to use Death and Decay skills to be casted? it only use the skill but doesn't actually click on the ground.
September 11, 20214 yr Author 14 hours ago, Sye24 said: Simple google search with words Wrobot Aoe Death and Decay will find a lot of help for you. tried using these code SpellManager.CastSpellByIDAndPosition(49936, ObjectManager.Target.Position ClickOnTerrain.Pulse(ObjectManager.Target.Position); but i get an error on vstudio. any way to correct these? Thank you.
September 12, 20214 yr Author 4 hours ago, Sye24 said: Are you using using wManager.Wow.Helpers; using wManager.Wow.ObjectManager; use these references yes i used those references already but still getting errors.
September 12, 20214 yr Author 8 hours ago, Sye24 said: Can you post a screenshot of your error? i cant really help without seeing the error.
September 12, 20214 yr 2 hours ago, jiraiyasm said: Bool - Boolean structure type that represents a Boolean value, which can be either true or false. Void - Is a reference type of data type and used to specify the return type of a method in C#. If you don't understand the above, start here: https://www.youtube.com/watch?v=GhQdlIFylQ8 I do not know what spell 49936 is as it says it has been removed on Wowhead. Remove the SpellManager..... line from the if condition since it's not a boolean (bool). instead of DnD.Launch(); use ClickOnTerrain.Spell(43265, ObjectManager.Target.Position, false, false); if you want to check if the Target is on your DnD, then do something like this in the if condition (bool): ObjectManager.Target.BuffCastedByAll(DnD.Name).Contains(ObjectManager.Me.Guid) if you want to cast it on the Target if it isn't on your DnD then add a "!" to it. The "!" is a negation. AKA the opposite (bool): !ObjectManager.Target.BuffCastedByAll(DnD.Name).Contains(ObjectManager.Me.Guid) I forget if the debuff is the same as the spell. If it is, the last few lines will work.
September 15, 20214 yr Author On 9/13/2021 at 3:46 AM, Zan said: Bool - Boolean structure type that represents a Boolean value, which can be either true or false. Void - Is a reference type of data type and used to specify the return type of a method in C#. If you don't understand the above, start here: https://www.youtube.com/watch?v=GhQdlIFylQ8 I do not know what spell 49936 is as it says it has been removed on Wowhead. Remove the SpellManager..... line from the if condition since it's not a boolean (bool). instead of DnD.Launch(); use ClickOnTerrain.Spell(43265, ObjectManager.Target.Position, false, false); if you want to check if the Target is on your DnD, then do something like this in the if condition (bool): ObjectManager.Target.BuffCastedByAll(DnD.Name).Contains(ObjectManager.Me.Guid) if you want to cast it on the Target if it isn't on your DnD then add a "!" to it. The "!" is a negation. AKA the opposite (bool): !ObjectManager.Target.BuffCastedByAll(DnD.Name).Contains(ObjectManager.Me.Guid) I forget if the debuff is the same as the spell. If it is, the last few lines will work. thanks for the help. i haven't tried it yet as i got busy.
Create an account or sign in to comment