I m trying to make a custom spell, that will be added to player's spellbook abd when he casts it on an NPC, that will turn NPC's stats on in a texbox.
I have made the script atm using GetContainer function which gives me results when i enter NPC's invtentory.
Example:
ScriptName REPORT
ref ReportTarget
String_var NPCName
Short NPCBaseHealth
Begin GameMode
set ReportTarget to getcontainer
Set NPCName to ReportTarget.GetName
Set NPCHealth to ReportTarget.GetActorValue Health
End
but i really want to change it and be activated when player cast a spell on the chanracter.
I searched a lot but cant find the correct expression to replace the set ReportTarget to getcontainer.
Can anyone help?