MSFD Limiting the use of teleport
[no fix] DisableTeleporting
[no fix] EnableTeleporting
Rather self explanatory, these functions turn the ability to use teleporting magic on or off. Nice to keep those magic user types from wimping out of your dungeon . In the original game it's only used when the player encounters Dagoth Ur.
I won't show the whole script as it would be quite a spoiler, but here is the part that uses the function:
short teleportDisabled
if ( teleportDisabled == 0 )
DisableTeleporting
Set teleportDisabled to 1
endif
This is later reset in the EndGame script.
Note: when the original Tribunal is installed this function is effectively broken: One of the start-up scripts in Tribunal overrides all other teleport commands and forces teleporting on except within one specific area in Mournhold (thanks to Slink and Riiak for the info). Here is the culprit:
Begin TribunalMain
;check for teleporting
if ( GetPCCell "Sotha Sil," == 1 )
DisableTeleporting
else
EnableTeleporting
endif
;check levitate
if ( GetPCCell "Sotha Sil," == 1 )
DisableLevitation
elseif ( GetPCCell "Mournhold" == 1 )
DisableLevitation
else
EnableLevitation ; This is why teleporting was always on outside Mournhold
endif
end
With one of the updates this problem was fixed. The latest version of the script looks like this:
Begin TribunalMain
short disablestate
short newstate
;by default, enable teleport and levitate
set newstate to 0
;only need to check cells in interiors
if ( GetInterior )
if ( GetPCCell "Sotha Sil," == 1 )
;disable teleport and levitate here
set newstate to 1
elseif ( GetPCCell "Mournhold" == 1 )
;disable levitate only here
set newstate to 2
endif
endif
;if state should change
if ( disablestate != newstate )
if ( newstate == 1 )
DisableTeleporting
DisableLevitation
elseif ( newstate == 2 )
DisableLevitation
elseif ( newstate == 0 )
EnableTeleporting
EnableLevitation
endif
set disablestate to newstate
endif
end
Note: DisableTeleporting does not disable scripted amulets etc. for teleporting. DinkumThinkum suggested the following workaround which uses GetPCCell to check the player's current location. As long as they're in one of the mod cells, nothing happens. If they're not where they're supposed to be, then the script teleports them back into the correct area: back to the initial entry point for the mod, for example. This wouldn't be exactly the same as blocking the teleports, but it should make the area totally inescapable until you've fulfilled the modder's conditions for getting out legitimately.
Begin DT_Test_BalmoraTrap
If ( GetPCCell, "Balmora" == 1 )
Return
Endif
MessageBox "Off to Balmora with you!"
Player->PositionCell, -21278, -17613, 534, 0, "Balmora (-3, -3)"
End DT_Test_BalmoraTrap