Move Conjuration Script to Actor
This commit is contained in:
parent
4244bbee10
commit
ccd719c04d
8 changed files with 117 additions and 42 deletions
BIN
ConjurableMaid.esp
(Stored with Git LFS)
BIN
ConjurableMaid.esp
(Stored with Git LFS)
Binary file not shown.
BIN
Scripts/FCMSpectralMaidScript.pex
(Stored with Git LFS)
BIN
Scripts/FCMSpectralMaidScript.pex
(Stored with Git LFS)
Binary file not shown.
BIN
Scripts/FCMSummonMaidScript.pex
(Stored with Git LFS)
BIN
Scripts/FCMSummonMaidScript.pex
(Stored with Git LFS)
Binary file not shown.
BIN
Scripts/TIF__05011623.pex
(Stored with Git LFS)
BIN
Scripts/TIF__05011623.pex
(Stored with Git LFS)
Binary file not shown.
BIN
Scripts/TIF__05011634.pex
(Stored with Git LFS)
BIN
Scripts/TIF__05011634.pex
(Stored with Git LFS)
Binary file not shown.
|
@ -4,8 +4,107 @@ SPELL PROPERTY pGhostAbilityNew AUTO
|
||||||
SPELL PROPERTY pGhostResistsAbility AUTO
|
SPELL PROPERTY pGhostResistsAbility AUTO
|
||||||
|
|
||||||
GlobalVariable Property pMaidSpectralFlag Auto
|
GlobalVariable Property pMaidSpectralFlag Auto
|
||||||
|
GlobalVariable Property pMaidMovingFlag Auto
|
||||||
|
ObjectReference Property pMaidHomeMarker Auto
|
||||||
|
|
||||||
FUNCTION UpdateSpectralState()
|
EffectShader Property ConjureEffect Auto
|
||||||
|
|
||||||
|
Activator property ConjureEffectActivator Auto
|
||||||
|
ImageSpaceModifier property ConjureImageSpace Auto
|
||||||
|
|
||||||
|
SPELL Property pConjureMaidSpell AUTO
|
||||||
|
SPELL PROPERTY pConjureSpectralMaidSpell AUTO
|
||||||
|
|
||||||
|
Bool Function TryDispelPlayer()
|
||||||
|
Actor player = Game.GetPlayer()
|
||||||
|
return player.DispelSpell(pConjureMaidSpell) || player.DispelSpell(pConjureSpectralMaidSpell)
|
||||||
|
EndFunction
|
||||||
|
|
||||||
|
Bool Function TryConjure(Bool isSpectral)
|
||||||
|
if (isNearPlayer())
|
||||||
|
return False
|
||||||
|
EndIf
|
||||||
|
if (IsSpectral)
|
||||||
|
SetIsSpectral(True)
|
||||||
|
endif
|
||||||
|
return TryMoveto(game.GetPlayer())
|
||||||
|
EndFunction
|
||||||
|
|
||||||
|
Bool Function TryReturn()
|
||||||
|
|
||||||
|
return tryDispelPlayer() && TryMoveTo(pMaidHomeMarker)
|
||||||
|
|
||||||
|
EndFunction
|
||||||
|
|
||||||
|
Function SetIsSpectral(Bool b)
|
||||||
|
if (b)
|
||||||
|
pMaidSpectralFlag.SetValue(1)
|
||||||
|
else
|
||||||
|
pMaidSpectralFlag.SetValue(0)
|
||||||
|
EndIf
|
||||||
|
EndFunction
|
||||||
|
|
||||||
|
Bool Function GetIsSpectral()
|
||||||
|
if (pMaidSpectralFlag.getValue() == 1)
|
||||||
|
return True
|
||||||
|
Else
|
||||||
|
Return False
|
||||||
|
endIF
|
||||||
|
EndFunction
|
||||||
|
|
||||||
|
Bool Function GetIsMoving()
|
||||||
|
if (pMaidMovingFlag.getValue() == 1)
|
||||||
|
return True
|
||||||
|
Else
|
||||||
|
Return False
|
||||||
|
EndIf
|
||||||
|
EndFunction
|
||||||
|
|
||||||
|
Function SetIsMoving(Bool b)
|
||||||
|
If (b)
|
||||||
|
pMaidMovingFlag.SetValue(1)
|
||||||
|
Else
|
||||||
|
pMaidMovingFlag.SetValue(0)
|
||||||
|
endIf
|
||||||
|
EndFunction
|
||||||
|
|
||||||
|
|
||||||
|
Bool Function TryMoveTo(ObjectReference target)
|
||||||
|
If(GetIsMoving())
|
||||||
|
return False
|
||||||
|
Else
|
||||||
|
SetIsMoving(True)
|
||||||
|
Disappear()
|
||||||
|
Moveto(target)
|
||||||
|
Appear()
|
||||||
|
SetIsMoving(False)
|
||||||
|
Return True
|
||||||
|
EndIf
|
||||||
|
EndFunction
|
||||||
|
|
||||||
|
Function Appear()
|
||||||
|
StopCombat()
|
||||||
|
Enable()
|
||||||
|
If(IsNearPlayer())
|
||||||
|
placeAtMe(ConjureEffectActivator)
|
||||||
|
ConjureImageSpace.Apply()
|
||||||
|
ConjureEffect.Play(Self, 1)
|
||||||
|
EndIf
|
||||||
|
EndFunction
|
||||||
|
|
||||||
|
Function DisAppear()
|
||||||
|
SetIsSpectral(false)
|
||||||
|
If(IsNearPlayer())
|
||||||
|
ConjureEffect.Play(Self, 1)
|
||||||
|
Disable(true)
|
||||||
|
utility.wait(1)
|
||||||
|
Else
|
||||||
|
Disable(True)
|
||||||
|
EndIf
|
||||||
|
StopCombat()
|
||||||
|
EndFunction
|
||||||
|
|
||||||
|
FUNCTION UpdateSpectralAbilities()
|
||||||
if (pMaidSpectralFlag.getValue() == 1)
|
if (pMaidSpectralFlag.getValue() == 1)
|
||||||
SELF.addSpell(pGhostAbilityNew)
|
SELF.addSpell(pGhostAbilityNew)
|
||||||
SELF.addSpell(pGhostResistsAbility)
|
SELF.addSpell(pGhostResistsAbility)
|
||||||
|
@ -17,10 +116,10 @@ EndFUNCTION
|
||||||
|
|
||||||
|
|
||||||
EVENT onLoad()
|
EVENT onLoad()
|
||||||
updateSpectralState()
|
updateSpectralAbilities()
|
||||||
|
SetIsMoving(False)
|
||||||
ENDEVENT
|
ENDEVENT
|
||||||
|
|
||||||
EVENT onLocationChange(Location akOldLoc, Location akNewLoc)
|
EVENT onLocationChange(Location akOldLoc, Location akNewLoc)
|
||||||
updateSpectralState()
|
updateSpectralAbilities()
|
||||||
ENDEVENT
|
ENDEVENT
|
|
@ -1,36 +1,12 @@
|
||||||
Scriptname FCMSummonMaidScript extends activemagiceffect
|
Scriptname FCMSummonMaidScript extends activemagiceffect
|
||||||
|
|
||||||
ObjectReference Property MaidRef Auto
|
ObjectReference Property MaidRef Auto
|
||||||
ObjectReference Property MaidHomeMarker Auto
|
|
||||||
EffectShader Property ConjureEffect Auto
|
|
||||||
;; Scene Property DLC2DremoraScene Auto
|
|
||||||
;; GlobalVariable Property DLC2DremoraForceGreet Auto
|
|
||||||
Bool Property IsSpectral Auto
|
Bool Property IsSpectral Auto
|
||||||
|
|
||||||
Activator property ConjureEffectActivator Auto
|
|
||||||
ImageSpaceModifier property ConjureImageSpace Auto
|
|
||||||
|
|
||||||
|
|
||||||
Event OnEffectStart(actor akTarget, actor akCaster)
|
Event OnEffectStart(actor akTarget, actor akCaster)
|
||||||
if (IsSpectral)
|
(MaidRef as FCMSpectralMaidScript).TryConjure(isSpectral)
|
||||||
pSpectralFlag.SetValue(1)
|
|
||||||
endif
|
|
||||||
(MaidRef as actor).StopCombat()
|
|
||||||
MaidRef.Moveto(game.GetPlayer())
|
|
||||||
MaidRef.placeAtMe(ConjureEffectActivator)
|
|
||||||
ConjureImageSpace.Apply()
|
|
||||||
ConjureEffect.Play(MaidRef, 1)
|
|
||||||
EndEvent
|
EndEvent
|
||||||
|
|
||||||
Event OnEffectFinish(actor akTarget, actor akCaster)
|
Event OnEffectFinish(actor akTarget, actor akCaster)
|
||||||
pSpectralFlag.SetValue(0)
|
(MaidRef as FCMSpectralMaidScript).TryReturn()
|
||||||
ConjureEffect.Play(MaidRef, 1)
|
|
||||||
MaidRef.Disable(true)
|
|
||||||
utility.wait(1)
|
|
||||||
MaidRef.MoveTo(MaidHomeMarker)
|
|
||||||
(MaidRef as actor).StopCombat()
|
|
||||||
MaidRef.Enable()
|
|
||||||
EndEvent
|
EndEvent
|
||||||
|
|
||||||
|
|
||||||
GlobalVariable Property pSpectralFlag Auto
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ Scriptname TIF__05011623 Extends TopicInfo Hidden
|
||||||
Function Fragment_0(ObjectReference akSpeakerRef)
|
Function Fragment_0(ObjectReference akSpeakerRef)
|
||||||
Actor akSpeaker = akSpeakerRef as Actor
|
Actor akSpeaker = akSpeakerRef as Actor
|
||||||
;BEGIN CODE
|
;BEGIN CODE
|
||||||
(GetOwningQuest() as FCMMaidDialogueQuestScript).Dispel()
|
(akSpeaker as FCMSpectralMaidScript).TryReturn()
|
||||||
;END CODE
|
;END CODE
|
||||||
EndFunction
|
EndFunction
|
||||||
;END FRAGMENT
|
;END FRAGMENT
|
||||||
|
|
Loading…
Add table
Reference in a new issue