Scripts

TR_m4_NPC_Llayno_Erendi

TR_Mainland.esm
Variables 9
Local Variables
TR_Map
T_Local_NPC
NoLore
control
controlQ
noHit
MoveProgress
timer
frameHour
Source
1Begin TR_m4_NPC_Llayno_Erendi 2; Script for Remnants of Resdayn 3 4; T_ScNpcMW_Map4 variables 5short TR_Map 6short T_Local_NPC 7short NoLore 8short control 9short controlQ 10float timer 11float frameHour ; time stamp of previous frame 12short noHit 13 14; When Llayno is asked to move the bowl himself 15short MoveProgress 16 17if ( MenuMode ) 18 return 19endif 20 21if ( GetJournalIndex "TR_m4_Om_RemnantsPath2" >= 30 ) 22 return 23endif 24 25if ( MoveProgress == 2 ) 26 if ( GetJournalIndex "TR_m4_Om_RemnantsPath2" < 20 ) 27 if ( GetDistance Player < 1200 ) 28 Forcegreeting 29 endif 30 return 31 endif 32 33elseif ( MoveProgress == 3 ) 34 if ( timer > 1 ) 35 ForceGreeting 36 endif 37 Set timer to ( timer + GetSecondsPassed ) 38 return 39endif 40 41if ( GetJournalIndex, "TR_m4_Om_RemnantsPath2" == 10 ) 42 if ( MoveProgress >= 0 ) 43 if ( ScriptRunning "TR_m4_Om_ReRe_Teleport" ) 44 ; stops the sequence in case the player picks up the bowl 45 Set MoveProgress to -1 46 AiWander, 150, 5, 0, 0, 60, 20, 10, 0, 0, 0, 0, 0 47 return 48 endif 49 endif 50 if ( MoveProgress == 0 ) 51 if ( GetDistance, "TR_m4_Om_AncientBowl" < 800 ) 52 Set MoveProgress to 1 53 ForceGreeting 54 return 55 endif 56 elseif ( MoveProgress == 1 ) 57 if ( CellChanged ) 58 Set MoveProgress to 2 59 elseif ( GameHour >= ( frameHour + 1 ) ) ; player rested 60 Set MoveProgress to 2 61 elseif ( GameHour < frameHour ) 62 if ( GameHour >= ( frameHour - 23 ) ) 63 Set MoveProgress to 2 64 endif 65 elseif ( GetAIPackageDone ) 66 Set MoveProgress to 2 67 endif 68 Set frameHour to GameHour 69 if ( MoveProgress == 2 ) 70 PositionCell 6659 -3312 13592 5820 "Etana Egg Mine" 71 AIWander 0, 5, 0, 0, 60, 20, 10, 0, 0, 0, 0, 0 72 return 73 endif 74 endif 75endif 76 77; When dispelled or calmed 78if ( GetJournalIndex, "TR_m4_Om_RemnantsPath2" == 20 ) 79 if ( MoveProgress == 2 ) 80 if ( GetEffect, sEffectDispel == 1 ) 81 Set MoveProgress to 3 82 elseif ( GetEffect, sEffectCalmHumanoid == 1) 83 Set MoveProgress to 3 84 endif 85 if ( MoveProgress == 3 ) 86 RemoveItem, "TR_m4_Om_AncientBowl", 1 87 PlaceAtMe, "TR_m4_Om_AncientBowl", 1, 0, 0 88 StopCombat 89 SetFight, 0 90 ModDisposition, 20 91 Say, "Vo\d\m\Flw_DM004.mp3", "Thank you!" 92 AiWander, 150, 5, 0, 0, 60, 20, 10, 0, 0, 0, 0, 0 93 return 94 endif 95 endif 96endif 97 98if ( OnDeath ) 99 if ( GetJournalIndex, "TR_m4_Om_RemnantsPath2" == 20 ) 100 if ( MoveProgress == 2 ) 101 RemoveItem, "TR_m4_Om_AncientBowl", 1 102 PlaceAtMe, "TR_m4_Om_AncientBowl", 1, 50, 2 103 Journal, "TR_m4_Om_RemnantsPath2", 50 104 endif 105 endif 106endif 107 108; T_ScNpcMW_Map4 bits 109if ( TR_Map == 4 ) 110 return 111endif 112set TR_Map to 4 113set noHit to 1 114 115End