Jump to content

Reapply cloak effect on sleep via script


ModBrains

Recommended Posts

Edit; Thinking about the constancy of this effect, I think I need to reevaluate my approach to this issue.

-----

Anyone know how to apply 'Cloak' effects via script?

I have this script attached to an item which is equipped on the player.

The spell should highlight corpses. The spell/magic effect works normally, but doesn't reapply to corpses in the local area when waking up from sleep.

Trying to "reapply" the effect, but it's not highlighting already-present-corpses.

Have tested the register and unregister functions and they're definitely firing as expected, as is the OnPlayerSleepStop event.



Scriptname CorpselighterItemScript extends ObjectReference Const

Event OnEquipped(Actor akActor)
if akActor == Game.GetPlayer()
RegisterForPlayerSleep()
endIf
endEvent

Event OnUnequipped(Actor akActor)
if akActor == Game.GetPlayer()
UnregisterForPlayerSleep()
endIf
endEvent


Event OnPlayerSleepStop(bool abInterrupted, ObjectReference akBed)
CorpselighterSpell.Cast(Game.GetPlayer())
CorpselighterSpell.Cast(Game.GetPlayer(), Game.GetPlayer())
endEvent

SPELL Property CorpselighterSpell Auto Const

Edited by Jajjo
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...