A function included in the GECK version 18.104.22.168.
(0, 1:int) [ActorRefID].IsSpellTarget MagicID
This will return 1 if Buddy has the specified Actor Ability.
If an actor is addicted to a chem, this function will return 1 when the addiction Actor Effect is passed to this function, even when the actor is not presently undergoing withdrawal symptoms. You can use this to detect whether the player is addicted to a substance.
This will return 1 even if the player has recently consumed alcohol and is not presently undergoing withdrawal. It will return 0 for a player who is not addicted to alcohol.
Detecting satiation of addictions
You can also detect whether the player is under the influence of the chem itself to determine whether the player has sated their addiction or not. This isn't compatible for chems added by other mods, because you need to check all of the chemical types directly, but is still quite handy.
if Player.IsSpellTarget WithdrawalAlcohol > 0 if Player.IsSpellTarget Beer > 0 || Player.IsSpellTarget Scotch > 0 || Player.IsSpellTarget Wine > 0 || Player.IsSpellTarget Whiskey > 0 || Player.IsSpellTarget Vodka > 0 ;Display a message of satisfaction ... else ;Display a message of anguish ... endif else ;Display a message of purity and serenity ... endif