nxpert 3 Posted May 29, 2017 Share Posted May 29, 2017 I'm making a fight class for a holy pally follower. I need to be able to find what the player is casting so I can cast Blessing of Sacrifice to remove fear/polymorph. Any help would be appreciated. I tried pic related but it doesn't work. I assume it's because it isn't targeting the person trying to fear or poly me, so being able to find if someone is casting that on me is what I need. Link to comment https://wrobot.eu/forums/topic/5975-how-to-find-what-hostile-player-is-casting/ Share on other sites More sharing options...
reapler 154 Posted May 29, 2017 Share Posted May 29, 2017 Hello, for this behavior you need to subscribe lua events with arguments(wManager.Wow.Helpers.EventsLuaWithArgs.OnEventsLuaWithArgs). But i belive the event 'COMBAT_LOG_EVENT_UNFILTERED' is also not working yet for 2.4.3(https://wrobot.eu/forums/topic/5519-register-combat_log-with-args/). If it works you could add a c# code to your fightclass. It could look like this: //example private void EventsLuaWithArgsOnOnEventsLuaWithArgs(LuaEventsId id, List<string> args) { if (id == LuaEventsId.COMBAT_LOG_EVENT_UNFILTERED && args[8] == ObjectManager.Me.Name) { if (args[2] == "Polymorph") { Logging.Write("Someone is casting Polymorph on me"); ///... } } } Otherwise you can use 'UNIT_SPELLCAST_SENT' which should work as intend: if (wManager.Statistics.RunningTimeInSec() < 2) { robotManager.Helpful.Logging.Write("Register OnEventsLuaWithArgs"); wManager.Wow.Helpers.EventsLuaWithArgs.OnEventsLuaWithArgs += delegate(wManager.Wow.Enums.LuaEventsId id, System.Collections.Generic.List<string> args) { if (id == wManager.Wow.Enums.LuaEventsId.UNIT_SPELLCAST_SENT && args[3] == wManager.Wow.ObjectManager.ObjectManager.Me.Name) { if (args[1] == "Polymorph" || args[1] == "Fear") { robotManager.Helpful.Logging.Write("Someone casts " + args[1] + " on me"); wManager.Wow.Helpers.SpellManager.CastSpellByNameOn("Blessing of Sacrifice", "party1"); //you could add here a task in case if you are on global cooldown to cast it later } } }; System.Threading.Thread.Sleep(2000); } and here's an example how you can implement the c# code into your fightclass: BoS example.xml nxpert and dirtyjobs 2 Link to comment https://wrobot.eu/forums/topic/5975-how-to-find-what-hostile-player-is-casting/#findComment-27168 Share on other sites More sharing options...
Matenia 628 Posted May 29, 2017 Share Posted May 29, 2017 LuaCode: UnitCastingInfo("target") returns the spell name and some more info about cast time etc Link to comment https://wrobot.eu/forums/topic/5975-how-to-find-what-hostile-player-is-casting/#findComment-27171 Share on other sites More sharing options...
nxpert 3 Posted May 30, 2017 Author Share Posted May 30, 2017 Just to be clear this won't work currently? Link to comment https://wrobot.eu/forums/topic/5975-how-to-find-what-hostile-player-is-casting/#findComment-27190 Share on other sites More sharing options...
reapler 154 Posted May 30, 2017 Share Posted May 30, 2017 @nxpert if you mean the first method then probably yes. The second with 'LuaEventsId.UNIT_SPELLCAST_SENT' & the example should work(args will be received). nxpert 1 Link to comment https://wrobot.eu/forums/topic/5975-how-to-find-what-hostile-player-is-casting/#findComment-27203 Share on other sites More sharing options...
nxpert 3 Posted June 1, 2017 Author Share Posted June 1, 2017 Thanks, I'll see if I can get it working then. Link to comment https://wrobot.eu/forums/topic/5975-how-to-find-what-hostile-player-is-casting/#findComment-27260 Share on other sites More sharing options...
Matenia 628 Posted June 10, 2017 Share Posted June 10, 2017 The 2.4.3 version of wManager.dll doesn't seem to have a class EventsLuaWithArgs. Any current workaround for that? I'd love to read combatlog events to automate stuff for a PvP fightclass. Link to comment https://wrobot.eu/forums/topic/5975-how-to-find-what-hostile-player-is-casting/#findComment-27616 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