Scripts

TR_m4_BarendrethFight1

TR_Mainland.esm
Variables 5
Local Variables
TR_Map
control
controlQ
T_Local_NPC
NoLore
Source
1Begin TR_m4_BarendrethFight1 2; ordinators TR_m4_Sarvil_Omarel and TR_m4_Teleri_Selos 3; 1. attack TR_m4_V_Barendreth_Low1 and TR_m4_V_Barendreth_Low2 4; 2. afterwards, attack TR_m4_V_Barendreth_Low3 5 6short TR_Map 7short control 8short controlQ 9short T_Local_NPC 10short NoLore 11 12if ( controlQ == -1 ) 13 return 14endif 15 16if ( OnDeath ) 17 set TR_m4_Barendreth_DeadOrd to ( TR_m4_Barendreth_DeadOrd + 1 ) 18 set controlQ to -1 19 return 20endif 21 22if ( PCVampire == -1 ) 23 ; become peaceful if you cured your vampirism 24 if ( control < 2 ) 25 set control to 2 26 setfight 30 27 endif 28elseif ( PCVampire ) 29 ; attack on sight if you're a vampire 30 if ( control == 0 ) 31 set control to 1 32 setfight 100 33 endif 34endif 35 36if ( controlQ == 0 ) 37 if ( GetLOS player ) 38 set controlQ to 1 39 if ( GetDeadCount TR_m4_Barendreth_Hunger == 0 ) 40 startcombat TR_m4_Barendreth_Hunger 41 if ( GetDeadCount TR_m4_Sarvil_Omarel == 0 ) 42 TR_m4_Barendreth_Hunger->startcombat TR_m4_Sarvil_Omarel 43 endif 44 if ( GetDeadCount TR_m4_Teleri_Selos == 0 ) 45 TR_m4_Barendreth_Hunger->startcombat TR_m4_Teleri_Selos 46 endif 47 endif 48 if ( GetDeadCount TR_m4_V_Barendreth_Low2 == 0 ) 49 startcombat TR_m4_V_Barendreth_Low2 50 if ( GetDeadCount TR_m4_Sarvil_Omarel == 0 ) 51 TR_m4_V_Barendreth_Low2->startcombat TR_m4_Sarvil_Omarel 52 endif 53 if ( GetDeadCount TR_m4_Teleri_Selos == 0 ) 54 TR_m4_V_Barendreth_Low2->startcombat TR_m4_Teleri_Selos 55 endif 56 endif 57 return 58 endif 59elseif ( controlQ == 1 ) 60 if ( GetDeadCount TR_m4_Barendreth_Hunger >= 1 ) 61 if ( GetDeadCount TR_m4_V_Barendreth_Low2 >= 1 ) 62 set controlQ to 2 63 return 64 endif 65 endif 66elseif ( controlQ == 2 ) 67 set controlQ to 3 68 if ( GetDeadCount TR_m4_V_Barendreth_Low3 == 0 ) 69 startcombat TR_m4_V_Barendreth_Low3 70 if ( GetDeadCount TR_m4_Sarvil_Omarel == 0 ) 71 TR_m4_V_Barendreth_Low3->startcombat TR_m4_Sarvil_Omarel 72 endif 73 if ( GetDeadCount TR_m4_Teleri_Selos == 0 ) 74 TR_m4_V_Barendreth_Low3->startcombat TR_m4_Teleri_Selos 75 endif 76 endif 77 return 78elseif ( controlQ == 3 ) 79 if ( GetDeadCount TR_m4_V_Barendreth_Low3 >= 1 ) 80 set controlQ to 4 81 AiWander 512 0 0 82 endif 83endif 84 85if ( TR_Map ) 86 return 87endif 88 89set TR_Map to 4 90 91End