How do I tell if sleep is cast from the Harper Scout feat?
Terrorble
Member Posts: 185
I want to script different behavior for the Harper Scout's sleep feat. But I'm drawing a blank about how to tell if it is being cast from the Harper feat or an actual caster is casting it as a spell. Since the feat and spell both fire nw_s0_sleep for the spell.
I tried:
if( GetLastSpellCastClass() == CLASS_TYPE_HARPER )
but it doesn't work.
I tried:
if( GetLastSpellCastClass() == CLASS_TYPE_HARPER )
but it doesn't work.
0
Comments
Wizard and sorcerer return the appropriate class values.
This seems to work:
if( GetLastSpellCastClass() == 255 && GetSpellCastItem() == OBJECT_INVALID )
if ( GetSpellId() == 480 )
{
// do stuff
}
This will always return the Harper Scout Sleep as spells.2da line 480 is called from the SPELLID column for line 441 of feat.2da (which is HARPER_SLEEP).
That block of code should be added directly to nw_s0_sleep.nss with your custom modifications included inside. You could also use spellhooking - my recommendation - if you don't want to alter the default script. Just place the if statement along with your custom code inside a custom spellhook script.
The 1.69 Lexicon has more info on spellhooking.