Scripts

TR_m7_sc_BridgeTroll

TR_Mainland.esm
Variables 3
Local Variables
burning
hasregen
timer
Source
1begin TR_m7_sc_BridgeTroll 2 3short burning ;variable to determine if the troll has a fire damage effect on itself 4short hasregen ;variable to determine if the troll has its regen ability 5float timer ;variable to add a delay after adding the regen before continuing the script 6 7if ( MenuMode ) ;don't run this script while in a menu 8 return 9endif 10 11if ( GetEffect sEffectFireDamage ) 12 if ( burning == 0 ) 13 set burning to 1 ;burning? set variable to 1. this is used to remove the regen below 14 set timer to 0 ;burning? reset timer to 0. 15 endif 16elseif ( burning == 1 ) 17 set burning to 0 ;not burning? set variable to 0. this is used to add the regen below 18endif 19 20if ( burning == 1 ) ;if burning, and if regen is there, remove it 21 if ( hasregen == 1 ) 22 RemoveSpell "TR_m7_BridgeTrollRegen" ;remove regen 23 set hasregen to 0 ;set regen variable to 0 24 endif 25else ;if not burning, and if regen is not there, add it 26 set timer to ( timer + GetSecondsPassed ) 27 if ( timer > 5 ) 28 if ( hasregen == 0 ) 29 AddSpell "TR_m7_BridgeTrollRegen" 30 set hasregen to 1 31 endif 32 endif 33endif 34 35if ( GetDistance player <= 2000 ) 36 if ( GetJournalIndex "TR_m7_wil_LurkerInTheMangrove" == 10 ) 37 Journal "TR_m7_wil_LurkerInTheMangrove" 20 ;journal entry for spotting the troll 38 endif 39endif 40 41if ( OnDeath ) 42 if ( GetJournalIndex "TR_m7_wil_LurkerInTheMangrove" >= 10 ) 43 if ( GetJournalIndex "TR_m7_wil_LurkerInTheMangrove" <= 20 ) 44 AddTopic "bridge troll" 45 Journal "TR_m7_wil_LurkerInTheMangrove" 40 ;journal entry for killing the troll 46 endif 47 endif 48endif 49 50end TR_m7_sc_BridgeTroll