Scripts

TR_NecMQ_AlandroSulScript

TR_Mainland.esm
Variables 7
Local Variables
TR_Map
NoLore
T_Local_NPC
T_Local_Nolore
control
controlQ
timer
Source
1Begin TR_NecMQ_AlandroSulScript 2 3; this script goes on the NPCs representing the memories of Alandro Sul 4; 6+ 5 6Short TR_Map 7Short NoLore 8Short T_Local_NPC 9short T_Local_Nolore 10Short control 11Short controlQ 12Float timer 13 14; obligatory map position setting 15 16set TR_Map to 2 17 18if ( MenuMode == 1 ) 19 Return 20endif 21 22; if the spirit is somehow still there after the end of the quest, disable it 23 24if ( GetJournalIndex TR_NecMQ_3 > 0 ) 25 Set controlQ to 10 26endif 27 28; if the player is a murderhobo, the spirit just disappears 29 30if ( GetAttacked == 1 ) 31 Set controlQ to 10 32endif 33 34; the spirit has said his lines & can be disabled 35 36if ( controlQ == 10 ) 37 if ( GetDisabled == 0 ) 38 Disable 39 else 40 SetDelete 1 41 endif 42 43; the spirit greets the player & gives out a piece of information 44 45elseif ( controlQ == 6 ) 46 if ( GetDistance Player < 200 ) 47 ForceGreeting 48 ; Set controlQ to 10 49 else 50 if ( GetCurrentAIPackage < 0 ) 51 Set controlQ to 5 52 endif 53 endif 54 55; the spirit starts walking towards the player 56 57elseif ( controlQ == 5 ) 58; AIActivate Player 59 Set controlQ to 6 60 61elseif ( controlQ == 4 ) 62 if ( timer >1 ) 63 Set controlQ to 5 64 else 65 Set timer to ( timer + GetSecondsPassed ) 66 Return 67 endif 68 69; the spirit appears, if it's the first or last spirit, update the journal 70 71elseif ( controlQ == 3 ) 72 Enable 73 if ( control == 1 ) 74 if ( GetJournalIndex TR_NecMQ_2Path == 30 ) 75 Journal TR_NecMQ_2Path 35 76 elseif ( GetJournalIndex TR_NecMQ_2Path == 70 ) 77 Journal TR_NecMQ_2Path 75 78 endif 79 elseif ( control == 4 ) 80 Journal TR_NecMQ_2 60 81 endif 82 Set controlQ to 4 83 84; create summoning special effect 85 86elseif ( controlQ == 2 ) 87 if ( control == 1 ) 88 PlaySound3DVP T_SndEnv_GhostScream03 0.5 1.0 89 endif 90 PlaceAtMe TR_NecMQ_AlandroEffect 1 0 0 91 Set controlQ to 3 92 93; the spirits act in order based on position 94 95elseif ( controlQ == 1 ) 96 if ( control == 1 ) 97 if ( GetJournalIndex TR_NecMQ_2 == 56 ) 98 Set controlQ to 2 99 endif 100 elseif ( control == 2 ) 101 if ( GetJournalIndex TR_NecMQ_2 == 57 ) 102 Set controlQ to 2 103 endif 104 elseif ( control == 3 ) 105 if ( GetJournalIndex TR_NecMQ_2 == 58 ) 106 Set controlQ to 2 107 endif 108 elseif ( control == 4 ) 109 if ( GetJournalIndex TR_NecMQ_2 == 59 ) 110 Set controlQ to 2 111 endif 112 endif 113 114; the spirits start out disabled, assign them a control variable based on position 115 116elseif ( controlQ == 0 ) 117 if ( GetPos X < 1550 ) 118 Set control to 3 119 elseif ( GetPos X < 1650 ) 120 Set control to 1 121 elseif ( GetPos X < 1725 ) 122 Set control to 2 123 else 124 Set control to 4 125 endif 126 127 if ( GetDisabled == 0 ) 128 Disable 129 else 130 Set controlQ to 1 131 endif 132 133endif 134 135End TR_NecMQ_AlandroSulScript