1
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

47 lines
1.9 KiB

Scriptname _00E_Phasmalist_SummonApparitionSC extends ObjectReference
; script on the marker that is placed by the apparation summon spell. This summons the apparation at the place the marker has been placed
Actor Property PlayerREF auto
_00E_Phasmalist_ApparationAlias Property summonedApparation auto
_FS_Phasmalist_ControlQuest Property controlQuest auto
Message Property alreadySummonedApparation auto
{Message objects whose title is the message that is displayed when the player tries to summon an apparation but has already one}
Message Property illegalTrinket auto
{Message objects whose title is the message that is displayed when the player tries to summon an apparation but wears no phasmalist trinket object}
GlobalVariable Property summonDisabled auto
Message Property cannotSummonNow auto
Message Property _00E_Phasmalist_CantSummonInCombat auto
GlobalVariable Property _00E_Phasmalist_FailsaveSummonTwiceControl auto
Event OnInit()
;because sometimes a projectile does not spawn its explosion correctly, the explosion is placed twice, once by the magic effect and once by the projectile
;this "lock" prevents that both explosions spawn an apparation
if _00E_Phasmalist_FailsaveSummonTwiceControl.getValue() == 1
self.delete()
return
else
_00E_Phasmalist_FailsaveSummonTwiceControl.setValue(1)
Endif
;summon control is done in _00E_Phasmalist_SummonControl
_00E_Phasmalist_TrinketSC trinket = summonedApparation.getEquippedTrinket()
if trinket
summonApparation(trinket)
Endif
RegisterForSingleUpdate(2)
Endevent
function summonApparation(_00E_Phasmalist_TrinketSC summonTrinket)
controlQuest.OnPlayerApparationSummoned()
Actor summoned = Self.placeAtMe(summonTrinket.connectedApparation) as Actor
summoned.disable()
summonedApparation.forceRefTo(summoned)
summonedApparation.enterWorld()
Endfunction
Event OnUpdate()
_00E_Phasmalist_FailsaveSummonTwiceControl.setValue(0)
self.delete()
Endevent