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.
 
 
 

64 lines
2.2 KiB

Scriptname _00E_TeleportationMEScript extends activemagiceffect
{Attach this script to all teleportation scripts, and change the teleportation target by changing the "TeleportTargetMarker" property.}
;=====================================================================================
; EVENTS
;=====================================================================================
Event OnEffectStart (Actor akTarket, Actor akCaster)
If (_00E_TeleportGlobal.GetValueInt() == 1) || (PlayerREF.GetWorldSpace() == Akropolis)
_00E_Teleport_sTeleportNotPossible.Show()
MAGVampireSunlight.Play(PlayerREF)
MagicEffect CastedMGEF = Self.GetBaseObject()
Int iIndex = 0
While iIndex < 11 && !bScrollAdded
MagicEffect ScrollMGEF = _00E_TeleportScrollMGEF_List.GetAt(iIndex) as MagicEffect
If ScrollMGEF == CastedMGEF
Scroll ScrollToAdd = _00E_TeleportScroll_List.GetAt(iIndex) as Scroll
PlayerREF.AddItem(ScrollToAdd, 1)
bScrollAdded = true
EndIf
iIndex += 1
EndWhile
bScrollAdded = false
Else
If __Config_TeleportTargetMarker.GetParentCell() == ability_container
_00E_Teleport_sNoTargetMarked.Show()
Else
Levelsystem.TeleportPlayer(__Config_TeleportTargetMarker)
EndIf
EndIf
EndEvent
;=====================================================================================
; PROPERTIES
;=====================================================================================
bool bScrollAdded
_00E_Questfunctions Property Levelsystem Auto
WorldSpace Property Akropolis Auto
Cell Property ability_container Auto
Formlist Property _00E_TeleportScroll_List Auto
Formlist Property _00E_TeleportScrollMGEF_List Auto
Actor Property PlayerREF Auto
GlobalVariable Property _00E_TeleportGlobal Auto
Sound Property _00E_MagicProtectionSpellM Auto
Sound Property MAGVampireSunlight Auto
ObjectReference Property __Config_TeleportTargetMarker Auto
{Set this to be the XMarkerHeading where the player arrives}
Message Property _00E_Teleport_sNoTargetMarked Auto
Message Property _00E_Teleport_sTeleportNotPossible Auto