enderalse/source/scripts/playerpotionracktriggerscript.psc

48 lines
1.1 KiB
Plaintext
Raw Normal View History

Scriptname PlayerPotionRackTriggerScript extends ObjectReference
import debug
import utility
ObjectReference Property ShelfContainer auto hidden
Bool Property AlreadyLoaded = FALSE Auto Hidden
EVENT OnCellLoad()
if AlreadyLoaded == FALSE
ShelfContainer = GetLinkedRef()
AlreadyLoaded = TRUE
endif
endEVENT
STATE WaitForBooks
EVENT OnBeginState()
2023-12-06 15:31:10 +00:00
;trace(self + " BOOKTRIGGER - Waiting For Books!")
endEVENT
EVENT OnTriggerEnter(ObjectReference TriggerRef)
2023-12-06 15:31:10 +00:00
;Trace("DARYL - " + self + " Reference " + TriggerRef + " has ENTERED")
endEvent
EVENT OnTriggerLeave(ObjectReference TriggerRef)
2023-12-06 15:31:10 +00:00
;Trace("DARYL - " + self + " Reference " + TriggerRef + " has EXITED")
Shelfcontainer.RemoveItem(TriggerRef.GetBaseObject(), 1)
(Shelfcontainer as PlayerBookShelfContainerScript).CurrentBookAmount = (Shelfcontainer as PlayerBookShelfContainerScript).CurrentBookAmount - 1
(ShelfContainer as PlayerBookShelfContainerScript).RemoveBooks((TriggerRef.GetBaseObject()), 1)
endEvent
endSTATE
auto STATE IgnoreBooks
Event OnBeginState()
2023-12-06 15:31:10 +00:00
;trace(self + " BOOKTRIGGER - Ignoring Books!")
endEVENT
endSTATE