Scripts

TR_m3_EbonT_GhostCritterSCP

TR_Mainland.esm
Variables 5
Local Variables
GhostGone
Hostility
dead
firetimer
timer
Source
1begin TR_m3_EbonT_GhostCritterSCP 2 3;script that is assigned to the Indoril Ghost in Stendarr Tower 4 5float firetimer 6float timer 7short GhostGone 8short Hostility 9short dead 10 11if ( MenuMode ) 12 return 13endif 14 15if ( GetJournalIndex "TR_m3_OE_StendarrTowerHaunting" < 120 ) 16 if ( player->HasSoulGem "TR_m3_Cr_EbonTGhost" > 0 ) 17 Journal TR_m3_OE_StendarrTowerHaunting 120 18 set "TR_m3_EbonT_GhostActivator".control to 3 19 set GhostGone to 2 20 endif 21endif 22 23if ( GetDisabled ) 24 if ( GetSoundPlaying "T_SndObj_LargeFire" ) 25 StopSound "T_SndObj_LargeFire" 26 elseif ( CellChanged ) 27 SetDelete 1 28 endif 29 return 30endif 31 32if ( dead ) 33 disable 34 if ( GhostGone == 2 ) ;soul captured 35 else ;not captured, will respawn 36 set GhostGone to 1 37 set "TR_m3_EbonT_GhostActivator".control to 1 38 endif 39 return 40elseif ( GetHealth <= 0 ) ;if the ghost is dead, it will simply vanish 41 set dead to 1 42 return 43elseif ( OnDeath ) 44 set dead to 1 45 return 46endif 47 48if ( GetSoundPlaying "T_SndObj_LargeFire" == 0 ) 49 PlayLoopSound3DVP "T_SndObj_LargeFire" 1.0 1.0 50endif 51 52if ( firetimer >= 1 ) 53 PlaceAtMe "TR_m3_EbonT_GhostFire" 1 1 1 54 set firetimer to 0 55endif 56 57if ( timer >= 30 ) 58 if ( Hostility == 1 ) 59 SetFight 100 60 startcombat player 61 set Hostility to 2 62 endif 63endif 64 65if ( Hostility == 0 ) 66 SetFight 0 67 StopCombat 68 set Hostility to 1 69endif 70 71if ( GhostGone == 0 ) 72 if ( timer >= 60 ) 73 disable 74 set GhostGone to 1 75 set "TR_m3_EbonT_GhostActivator".control to 1 76 set timer to 0 77 endif 78endif 79 80set firetimer to ( firetimer + GetSecondsPassed ) 81 82set timer to ( timer + GetSecondsPassed ) 83 84end