Enemy or Friendly spell?
hi, im trying to seperate enemy from friendly spells with range, but the only way i found to do this is with inRange=IsSpellInRange(spellname/ID, unit) (0= out of range, 1= in range, nil= invalid target)
the idea was to check all the range spells wether inRange is nil or not and if they are nil they are declared as enemy spells, otherwise as friendly spells. would this work or are there some problems with this method? or is there a function i missed to check if a spell can be casted on eney or on friendly units? |
since nobody answered to this im gona write an answer myself:eek:
so far the method is working without problems and no wrong spell has passed the check so far. |
Priest's Dispell Magic can be casted on friends and enemies.
Would break it, or not? :) |
it is, also hunters mark is recognized as friendly spell:eek:
|
Maybe IsHarmfulSpell() is what you are looking for?
For some reason I didn't find it on WoWwiki, just WoWprogramming. I hope this function actually works, because I didn't test it: http://wowprogramming.com/docs/api/IsHarmfulSpell Depending on when you want to distinguish spells you might also do so with the new combat log event. Here is an excerpt from my Pull Warning that decides if an enemy was the target of someone in my party or raid: Code:
function PullWarning_OnEvent(self, event, ...) |
thanks a lot for that info, i will try it when i find some time and report back if it works:)
edit: seems thats working a lot better than IsSpellInRange, thanks a lot:D |
All times are GMT -6. The time now is 11:59 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI