Scripts

TR_m4_V_Utukku_scr

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