Droidz 2494 Posted August 7, 2016 Share Posted August 7, 2016 Snippets C# codes for Fight Classes ps: Feel free to share your tips on this post. If your message is poorly presented or contains a question, it will be deleted. Dlarge 1 Quote Link to post Share on other sites
Droidz 2494 Posted August 7, 2016 Author Share Posted August 7, 2016 Check if character/target have or not buff/debuff by spell id: Use condition type "C Sharp Code" with Value: wManager.Wow.ObjectManager.ObjectManager.Me.HaveBuff(69369) Replace "69369" by your buff/debuff ID. Replace "Me" by "Target" to check buff/debuff on current target (you can also replace "Me" by "Pet" to check on the pet). Add "!" before this code to check if not have (de)buff ( http://www.tutorialspoint.com/csharp/csharp_logical_operators.htm ). To get list of player/target (de)buff id, you can go to tab "Tools" > "Development Tools" > (if you want check your target (de)buff select npc in game) > click on "Player/target buff/debuff". stweily and Bear T.O.E. 2 Quote Link to post Share on other sites
Droidz 2494 Posted August 7, 2016 Author Share Posted August 7, 2016 Check if character/target buff/debuff stack count by spell id: Use condition type "C Sharp Code" with Value: wManager.Wow.ObjectManager.ObjectManager.Me.BuffStack(44544) >= 1 Replace "44544" by your buff/debuff ID. Replace "Me" by "Target" to check buff/debuff on current target (you can also replace "Me" by "Pet" to check on the pet). ">= 1" check if stack count is "Bigger or Equal at 1", you can replace "1" by required stack count. You can also replace ">=" by "<=" to check if "Smaller or Equal", or by "==" to check if "Equal" - http://www.tutorialspoint.com/csharp/csharp_relational_operators.htm ). To get list of player/target (de)buff id, you can go to tab "Tools" > "Development Tools" > (if you want check your target (de)buff select npc in game) > click on "Player/target buff/debuff". Bear T.O.E. 1 Quote Link to post Share on other sites
Droidz 2494 Posted August 7, 2016 Author Share Posted August 7, 2016 Check character/target buff/debuff time left by spell id: Use condition type "C Sharp Code" with Value: wManager.Wow.ObjectManager.ObjectManager.Me.BuffTimeLeft(new List<uint> { 69369 }) >= 1000 Replace "69369" by your buff/debuff ID. Replace "Me" by "Target" to check buff/debuff on current target (you can also replace "Me" by "Pet" to check on the pet). ">= 1000" check if time left is "Bigger or Equal at 1000 millisecond", you can replace "1000" by required time left in millisacond. You can also replace ">=" by "<=" to check if "Smaller or Equal", or by "==" to check if "Equal" - http://www.tutorialspoint.com/csharp/csharp_relational_operators.htm ). To get list of player/target (de)buff id, you can go to tab "Tools" > "Development Tools" > (if you want check your target (de)buff select npc in game) > click on "Player/target buff/debuff". Razzue and Bear T.O.E. 2 Quote Link to post Share on other sites
DrSeltsam 0 Posted August 23, 2018 Share Posted August 23, 2018 On 8/7/2016 at 12:30 PM, Droidz said: Check character/target buff/debuff time left by spell id: Use condition type "C Sharp Code" with Value: wManager.Wow.ObjectManager.ObjectManager.Me.BuffTimeLeft(new List<uint> { 69369 }) >= 1000 Replace "69369" by your buff/debuff ID. Replace "Me" by "Target" to check buff/debuff on current target (you can also replace "Me" by "Pet" to check on the pet). ">= 1000" check if time left is "Bigger or Equal at 1000 millisecond", you can replace "1000" by required time left in millisacond. You can also replace ">=" by "<=" to check if "Smaller or Equal", or by "==" to check if "Equal" - http://www.tutorialspoint.com/csharp/csharp_relational_operators.htm ). To get list of player/target (de)buff id, you can go to tab "Tools" > "Development Tools" > (if you want check your target (de)buff select npc in game) > click on "Player/target buff/debuff". If I use this, the time left is always zero. The development Tools output also shows: PLAYER Buff/Debuff: Retribution Aura: ID=7294, Stack=1, TimeLeft=0 ms, Owner=0 Blessing of Might: ID=19834, Stack=1, TimeLeft=0 ms, Owner=0 Seal of the Crusader: ID=20162, Stack=1, TimeLeft=0 ms, Owner=0 Quote Link to post Share on other sites
pasdoy 1 Posted August 23, 2018 Share Posted August 23, 2018 3 hours ago, DrSeltsam said: If I use this, the time left is always zero. The development Tools output also shows: PLAYER Buff/Debuff: Retribution Aura: ID=7294, Stack=1, TimeLeft=0 ms, Owner=0 Blessing of Might: ID=19834, Stack=1, TimeLeft=0 ms, Owner=0 Seal of the Crusader: ID=20162, Stack=1, TimeLeft=0 ms, Owner=0 Funny I recently came back after a couple of months off and had to remove the TimeLeft check in my cc because it would always be 0. Thought the bug was on my side. Using vanilla. Quote Link to post Share on other sites
DrSeltsam 0 Posted August 24, 2018 Share Posted August 24, 2018 13 hours ago, pasdoy said: Funny I recently came back after a couple of months off and had to remove the TimeLeft check in my cc because it would always be 0. Thought the bug was on my side. Using vanilla. I am using Vanilla too. Quote Link to post Share on other sites
Matenia 557 Posted August 24, 2018 Share Posted August 24, 2018 ... vanilla doesn't have a timer on buffs/debuffs, with the exception of your own. But they don't fall under the regular aura API so you have to use Lua to get specific timers. Quote Link to post Share on other sites
someshit 0 Posted June 8, 2019 Share Posted June 8, 2019 need to calculate number of opponents within 8 yards of current target. any tips? Quote Link to post Share on other sites
TheSmokie 232 Posted June 8, 2019 Share Posted June 8, 2019 1 hour ago, someshit said: need to calculate number of opponents within 8 yards of current target. any tips? if(ObjectManager.GetWoWUnitAttackables().Any(x=> x.Position.DistanceTo(ObjectManager.Me.Position) < 20)) { MovementManager.StopMove(); Fight.StartFight(ObjectManager.GetWoWUnitAttackables().OrderBy(x => x.Position.DistanceTo(ObjectManager.Me.Position)).FirstOrDefault().Guid); } Quote Link to post Share on other sites
someshit 0 Posted June 9, 2019 Share Posted June 9, 2019 so, if(ObjectManager.GetWoWUnitAttackables().Any(x=> x.Position.DistanceTo(ObjectManager.Target.Position) <= 8 )) should work? Quote Link to post Share on other sites
TheSmokie 232 Posted June 9, 2019 Share Posted June 9, 2019 5 minutes ago, someshit said: so, if(ObjectManager.GetWoWUnitAttackables().Any(x=> x.Position.DistanceTo(ObjectManager.Target.Position) <= 8 )) should work? Yeah Quote Link to post Share on other sites
iMod 98 Posted December 25, 2020 Share Posted December 25, 2020 WoWUnit Extension "IsAutoAttacking" (WOTLK) /// <summary> /// Gets the flag if the unit is auto attacking. /// </summary> /// <returns>Returns true if the unit is auto attacking, otherwise false.</returns> public static bool IsAutoAttacking(this WoWUnit instance) { // Read bool result = Memory.WowMemory.Memory.ReadBoolean(address: instance.GetBaseAddress + (uint)0xA20); // Return return result; } I'm not sure about the other extension offsets. TheSmokie 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.