Hello again.
I found that on WoWWiki site :
Originally Posted by Wiki
When the player changes his target there is a small delay before the global variable 'playertarget' is updated. This can be exploited and used for restoring your old target.
Example:
TargetUnit("unit")
CastSpell()
TargetUnit("playertarget") -- This will restore your old target because of the delay. It will not clear your target if you didnt have one.
|
My question is : can we store the Global variable 'playertarget' to use it later ?
That will be usefull for mages to retrieve a sheep de-sheeped.
First :
- the mage choice a target and clic a button
- the script store this target ID in a variable (for example 'thesheep')
- the script launch the sheep spell
Later (when the sheep broke)
- the mage clic a button
- the script target the stored target id /target(thesheep)
- the script launch the sheep spell
I downloaded some existing mod like SheepWatch, but this AddOn retrieve the sheep by storing the name of mob. Not ideal when we have more that one mob with the same name.
I searched on this forum about my question, but no success. I'm sure all ennemis in game have a unique ID, but can we store it ...
Thanks again for your help, very appreciated.