zze 1 Posted September 23, 2018 Share Posted September 23, 2018 hello, trying to do a warlock fightclass, and one thing i am working on is trying to have it drain soul shards when im getting low... I tried if (!ObjectManager.Me.IsMounted && ItemsManager.HasItemById(6265) && ObjectManager.Target.HealthPercent <= 10) { // drain soul } works but only checks for one shard... so then tried if (!ObjectManager.Me.IsMounted && ItemsManager.HasItemById(6265) <= 10 && ObjectManager.Target.HealthPercent <= 10) { // drain soul } but doesn't seem to like the idea of stacks... also tried ItemsManager.HasItemStacksById but dont think that exists ? any ideas? Link to comment https://wrobot.eu/forums/topic/10155-trying-to-use-itemsmanagerhasitembyid-but-with-a-stack/ Share on other sites More sharing options...
fantasia 6 Posted September 23, 2018 Share Posted September 23, 2018 I have not tried this, but I think this would work: ItemsManager.GetItemCountById(6265) <= 10 HasItemById is just a bool (true/false if we have it or not) zze 1 Link to comment https://wrobot.eu/forums/topic/10155-trying-to-use-itemsmanagerhasitembyid-but-with-a-stack/#findComment-47830 Share on other sites More sharing options...
zze 1 Posted September 23, 2018 Author Share Posted September 23, 2018 3 minutes ago, fantasia said: I have not tried this, but I think this would work: ItemsManager.GetItemCountById(6265) <= 10 HasItemById is just a bool (true/false if we have it or not) ❤️ thank you ? Link to comment https://wrobot.eu/forums/topic/10155-trying-to-use-itemsmanagerhasitembyid-but-with-a-stack/#findComment-47831 Share on other sites More sharing options...
zze 1 Posted September 23, 2018 Author Share Posted September 23, 2018 next silly question is, how do i get the the bot to path back to the body after it dies? currently just stands still after death :< Link to comment https://wrobot.eu/forums/topic/10155-trying-to-use-itemsmanagerhasitembyid-but-with-a-stack/#findComment-47832 Share on other sites More sharing options...
fantasia 6 Posted September 23, 2018 Share Posted September 23, 2018 It should path back by default. Is it your fight class that blocks it? Maybe try to see if it can path back without a fight class or with some xml fight class to see if the issue is your fight class Link to comment https://wrobot.eu/forums/topic/10155-trying-to-use-itemsmanagerhasitembyid-but-with-a-stack/#findComment-47833 Share on other sites More sharing options...
zze 1 Posted September 23, 2018 Author Share Posted September 23, 2018 its something with the fightclass forsure, without it or with normal xml one it works ? think its just my hacked together thing thats breaking it for some reason Link to comment https://wrobot.eu/forums/topic/10155-trying-to-use-itemsmanagerhasitembyid-but-with-a-stack/#findComment-47834 Share on other sites More sharing options...
fantasia 6 Posted September 23, 2018 Share Posted September 23, 2018 Maybe you use Sleep somewhere that blocks the code from running (not sure if it would block the pathfinding from running its code). Maybe you need to enclose your buff and combat code in a "if (!ObjectManager.Me.IsDeadMe)". That is the only 2 things I can come up with that could possibly affect it. zze 1 Link to comment https://wrobot.eu/forums/topic/10155-trying-to-use-itemsmanagerhasitembyid-but-with-a-stack/#findComment-47835 Share on other sites More sharing options...
zze 1 Posted September 23, 2018 Author Share Posted September 23, 2018 33 minutes ago, fantasia said: Maybe you use Sleep somewhere that blocks the code from running (not sure if it would block the pathfinding from running its code). Maybe you need to enclose your buff and combat code in a "if (!ObjectManager.Me.IsDeadMe)". That is the only 2 things I can come up with that could possibly affect it. after messing around with it more found was just the area desolace being werid with pathing after i died :3 now its working ? if (!ObjectManager.Me.IsMounted && ItemsManager.GetItemCountById(6265) <= 8 && ObjectManager.Target.HealthPercent <= 15) { DrainSoul.Launch(); System.Threading.Thread.Sleep(700); return; } thank you very much for you help ? fantasia 1 Link to comment https://wrobot.eu/forums/topic/10155-trying-to-use-itemsmanagerhasitembyid-but-with-a-stack/#findComment-47836 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now