Scripts

TR_NecMQ_UrnSpawnScript

TR_Mainland.esm
Variables 2
Local Variables
controlQ
timer
Source
1Begin TR_NecMQ_UrnSpawnScript 2 3; this script goes on the urn used to carry a spirit to his ancestral tomb and spawn ghosts along the way 4; 6+ 5 6Short controlQ 7Float timer 8 9if ( MenuMode == 1 ) 10 Return 11endif 12 13if ( controlQ == 10 ) 14 Return 15 16; if the ghost has been released, update the player's journal 17 18elseif ( controlQ == 2 ) 19 Journal TR_NecMQ_Destroyer 85 20 Player->RemoveItem TR_NecMQ_UrnDestroyer 1 21 if ( GetJournalIndex TR_NecMQ_2Path == 10 ) 22 Journal TR_NecMQ_Destroyer 90 23 elseif ( GetJournalIndex TR_NecMQ_2Path == 50 ) 24 Journal TR_NecMQ_Destroyer 95 25 endif 26 Set controlQ to 10 27 Return 28 29; if the player wants to release the ghost, check their position & give a message when east of Necrom 30 31elseif ( controlQ == 1 ) 32 if ( GetInterior == 0 ) 33 if ( Player -> GetPos X > 375000 ) 34 if ( Player -> GetPos X < 500000 ) 35 if ( Player -> GetPos Y < -62500 ) 36 if ( Player -> GetPos Y > -142500 ) 37 MessageBox "As you release the ghost she wordlessly turns towards the shore and quickly begins to head southeast across the water. You feel a wave of relief wash over you. Suddenly, you experience a memory that is not your own: you see yourself entering your family's ancestral tomb. You locate an urn on top of an ornate altar at the northwestern wall of the central chamber, and you place the ringlet inside it." "Ok" 38 Set controlQ to 2 39 Return 40 endif 41 endif 42 endif 43 endif 44 endif 45 46; if the spirit has been released already, stop doing anything 47 48elseif ( controlQ == 0 ) 49 if ( GetJournalIndex TR_NecMQ_Destroyer == 70 ) 50 Set controlQ to 1 51 Return 52 elseif ( GetJournalIndex TR_NecMQ_Destroyer > 80 ) 53 Set controlQ to 10 54 Return 55 endif 56 57endif 58 59; don't spawn spirits if the PC is in Necrom or inside the ancestral tomb 60 61if ( GetPCCell "Necrom" == 1 ) 62 Return 63elseif ( GetPCCell "Theras Ancestral Tomb" == 1 ) 64 Return 65endif 66 67; add a short timer to slow down the spawning rate and not overwhelm and/or piss off the players 68 69if ( timer < 42 ) 70 Set timer to ( timer + GetSecondsPassed ) 71 Return 72endif 73 74; randomly spawn one ancestor ghost, reset the timer and add a journal entry (if this is the first spawn) 75 76if ( Random100 == 100 ) 77 PlaySound "ancestor ghost moan" 78 PlaceAtPC ancestor_ghost 1 200 1 79 Set timer to 0 80 if ( GetJournalIndex TR_NecMQ_Destroyer == 60 ) 81 Journal TR_NecMQ_Destroyer 65 82 endif 83endif 84 85End TR_NecMQ_UrnSpawnScript