2021-10-05 22:15:58 +00:00
|
|
|
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)
|
|
|
|
|
2024-02-14 12:37:23 +00:00
|
|
|
bool bHasCompanion = false
|
|
|
|
int i = NoTeleportCompanions.GetSize()
|
|
|
|
while i > 0 && ! bHasCompanion
|
|
|
|
i -= 1
|
|
|
|
bHasCompanion = (NoTeleportCompanions.GetAt(i) as Actor).IsPlayerTeammate()
|
|
|
|
endwhile
|
|
|
|
|
|
|
|
If bHasCompanion || (_00E_TeleportGlobal.GetValueInt() == 1) || (PlayerREF.GetWorldSpace() == Akropolis)
|
2021-10-05 22:15:58 +00:00
|
|
|
_00E_Teleport_sTeleportNotPossible.Show()
|
|
|
|
MAGVampireSunlight.Play(PlayerREF)
|
|
|
|
MagicEffect CastedMGEF = Self.GetBaseObject()
|
|
|
|
|
2024-02-14 10:51:18 +00:00
|
|
|
int nItems = _00E_TeleportScrollMGEF_List.GetSize()
|
2021-10-05 22:15:58 +00:00
|
|
|
Int iIndex = 0
|
2024-02-14 10:51:18 +00:00
|
|
|
While iIndex < nItems && !bScrollAdded
|
2021-10-05 22:15:58 +00:00
|
|
|
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
|
2024-01-09 22:00:18 +00:00
|
|
|
_00E_PlayerFunctions.GetTeleportControl().TeleportPlayer(__Config_TeleportTargetMarker)
|
2021-10-05 22:15:58 +00:00
|
|
|
EndIf
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
EndEvent
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; PROPERTIES
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
bool bScrollAdded
|
|
|
|
|
|
|
|
WorldSpace Property Akropolis Auto
|
|
|
|
|
|
|
|
Cell Property ability_container Auto
|
|
|
|
|
|
|
|
Formlist Property _00E_TeleportScroll_List Auto
|
|
|
|
Formlist Property _00E_TeleportScrollMGEF_List Auto
|
2024-02-14 12:37:23 +00:00
|
|
|
Formlist Property NoTeleportCompanions Auto
|
2021-10-05 22:15:58 +00:00
|
|
|
|
|
|
|
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
|