Scripts

TR_m4_Bal_NPC_AldBalaalVamp_Sc

TR_Mainland.esm
Variables 19
Local Variables
nolore
TR_Map
T_Local_Vampire
control
controlQ
NoHello
NoFlee
NoIdle
NoIntruder
NoThief
T_Local_NPC
T_Local_NoLore
checkBlood
doOnce
state
ashStorm
fixHead
TR_m4_Bal_ClanMember
timer
Source
1begin TR_m4_Bal_NPC_AldBalaalVamp_Sc 2 3; Baluath Questline 4; Script running on Ald Balaal vampires. 5 6; two generic vampires appearing after recruiting Alvayah 7; they are vampires from Khirakai, original ones get disabled 8 9; PROVINCE LOCAL VARIABLES HERE 10short nolore 11short TR_Map 12short T_Local_Vampire 13short control 14short controlQ 15 16short NoHello 17short NoFlee 18short NoIdle 19short NoIntruder 20short NoThief 21short T_Local_NPC 22short T_Local_NoLore 23 24short checkBlood 25short doOnce 26short state 27 28;Vanilla global PCVampire 29;Vanilla global PCWerewolf 30;Tamriel_Data global T_Glob_PorphyricInfected 31 32;Baluath ash storm benefits variables 33float timer 34short ashStorm 35short fixHead 36 37; Ald Balaal vampires 38short TR_m4_Bal_ClanMember 39 40;----------------------------------------------- 41; Drop vampire dust on death like vanilla 42;----------------------------------------------- 43 44if ( OnDeath ) 45 AddItem "ingred_vampire_dust_01" 1 46 47 ; Ald Balaal vampires 48 if ( TR_m4_Bal_ClanMember == 1 ) 49 set TR_m4_baluathdead to ( TR_m4_baluathdead + 1 ) 50 endif 51endif 52 53;----------------------------------------------- 54; Check player infection/vampire status 55;----------------------------------------------- 56 57if ( CellChanged ) 58 set checkBlood to 0 59 set state to 0 60 61 if ( T_Glob_PorphyricInfected ) 62 elseif ( player->GetSpell "Vampire Blood Quarra" ) 63 elseif ( player->GetSpell "Vampire Blood Aundae" ) 64 elseif ( player->GetSpell "Vampire Blood Berne" ) 65 elseif ( PCVampire != 0 ) 66 elseif ( PCWerewolf == 1 ) 67 else 68 ;Player isn't infected/vampire/cured vampire/werewolf 69 set checkBlood to 1 70 endif 71endif 72 73if ( fixHead ) 74 ;Mod-added heads disappear when the Vampirism effect is removed/swapped 75 ;To fix this we equip a helmet and remove it to reset the head model 76 set fixHead to 0 77 equip T_Glb_Var_HeadFixer ;Lack of AddItem is intentional 78 RemoveItem T_Glb_Var_HeadFixer 1 79endif 80 81if ( MenuMode ) 82 return 83endif 84 85;Baluath stuff, see cure script 86set timer to ( timer + GetSecondsPassed ) 87if ( timer > 1 ) 88 set timer to 0 89 if ( ashStorm ) 90 set ashStorm to 0 91 endif 92 if ( GetWindSpeed ) 93 if ( GetCurrentWeather >= 6 ) ;ash 94 if ( GetCurrentWeather <= 7 ) ;blight 95 set ashStorm to 1 96 endif 97 endif 98 endif 99 if ( ashStorm ) 100 if ( GetSpell "T_Vamp_Ab_Baluath_Ash" == 0 ) 101 AddSpell "T_Vamp_Ab_Baluath_Ash" 102 AddSpell "T_Vamp_Sp_Baluath_Ash" 103 AddSpell "T_Vamp_Ab_Baluath_SunDmg" 104 RemoveSpell "vampire sun damage" 105 set fixHead to 1 106 endif 107 elseif ( GetSpell "T_Vamp_Ab_Baluath_Ash" ) 108 RemoveSpell "T_Vamp_Ab_Baluath_Ash" 109 RemoveSpell "T_Vamp_Sp_Baluath_Ash" 110 AddSpell "vampire sun damage" 111 RemoveSpell "T_Vamp_Ab_Baluath_SunDmg" 112 set fixHead to 1 113 endif 114endif 115 116 117;------------------------------------------------ 118; Player was not infected before changing cell, 119; so constantly check for infection and then run 120; this clan's specific global script 121;------------------------------------------------ 122 123if ( checkBlood ) 124 if ( player->GetSpellEffects "T_Vamp_Dis_Baluath" ) 125 if ( ScriptRunning "T_ScVamp_Baluath_PC" != 1 ) 126 StartScript "T_ScVamp_Baluath_PC" 127 endif 128 endif 129 130;------------------------------------------------ 131; Player was infected/vampire before changing cell, 132; so check whether player is in an enemy clan 133;------------------------------------------------ 134 135elseif ( state != 1 ) 136 if ( VampClan == 100 ) 137 SetFight 30 ;Player is a friendly vampire 138 else 139 SetFight 90 ;Player is an enemy vampire 140 endif 141 142 set state to 1 143endif 144 145;------------------------------------------------ 146; Apply vampire spells/abilities to this NPC once 147;------------------------------------------------ 148 149if ( doOnce == 0 ) 150 AddSpell "T_Vamp_Dis_Baluath" 151 AddSpell "T_Vamp_Ab_Baluath" 152 AddSpell "Vampire Attributes" 153 AddSpell "Vampire Skills" 154 AddSpell "Vampire Immunities" 155 AddSpell "Vampire Sun Damage" 156 AddSpell "Vampire Touch" 157 ;set province-specific location variable for dialogue here 158 set TR_Map to 4 159 set doOnce to 1 160 161 ; Ald Balaal vampires 162 set TR_m4_Bal_ClanMember to 1 163endif 164 165;------------------------------------------------ 166; quest-specific behavior 167;------------------------------------------------ 168 169 170; disable before recruiting Alvayah 171if ( GetJournalIndex "TR_m4_Bal3_ArvsShadan" < 60 ) 172 if ( GetDisabled ) 173 return 174 else 175 disable 176 return 177 endif 178elseif ( GetDisabled ) 179 enable 180 ; also disable two Khirakai vampires 181 ; because they are the same vamps who moved to Ald Balaal 182 "TR_m4_V_Khirakai_02"->disable 183 "TR_m4_V_Khirakai_03"->disable 184 return 185endif 186 187end