Jump to content

Event on Spell Added?


xcafe

Recommended Posts

So I have this script, meant to activate an event when it's added to the player, but no dice. Any advice?

 

 

 

Scriptname grimoire24script extends MagicEffect
Form Property GrimoireSpellList Auto 
CentralListScript Property CentralQuest Auto
Actor Property PlayerRef Auto

    
Event OnEffectStart()
    Debug.Notification("Effect Started")
RegisterForSingleUpdateGameTime(24.0)
Debug.Notification("Effect Started, Registered")
EndEvent

                        Event OnUpdateGameTime()
                            Debug.Notification("Removespells Called")
    Int ListSize = CentralQuest.GrimoireSpellList.GetSize()
        Int Index = 0
            While Index < ListSize
                Form Entry = CentralQuest.GrimoireSpellList.GetAt(Index)
                    If (Entry as Spell)
                        PlayerRef.RemoveSpell(Entry as Spell)
                            EndIf
                                Index += 1
                                    EndWhile
                            Debug.Notification("Spells Removed")
                                        EndEvent
 
                         

 

 

 

P.S. The debugs aren't going off or anything either.

Link to comment
Share on other sites

Sorry that was hurting my eyes ... :tongue:

You do know that RegisterForSingleUpdateGameTime() is in hours ...

So this will not fire for 24 hours (game time), once set.

I'm not that good with spells so ... but it seems to me there is no effect

to key off of for the Event OnEffectStart().

 

;------

 

Scriptname grimoire24script extends MagicEffect
Form Property GrimoireSpellList Auto
CentralListScript Property CentralQuest Auto
Actor Property PlayerRef Auto
Event OnEffectStart()
Debug.Notification("Effect Started")
RegisterForSingleUpdateGameTime(24.0)
Debug.Notification("Effect Started, Registered")
EndEvent
Event OnUpdateGameTime()
Debug.Notification("Removespells Called")
Int ListSize = CentralQuest.GrimoireSpellList.GetSize()
Int Index = 0
While Index < ListSize
Form Entry = CentralQuest.GrimoireSpellList.GetAt(Index)
If (Entry as Spell)
PlayerRef.RemoveSpell(Entry as Spell)
EndIf
Index += 1
EndWhile
Debug.Notification("Spells Removed")
EndEvent
Edited by NexusComa
Link to comment
Share on other sites

  • Recently Browsing   0 members

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