Scripts

TR_m4_Bal_NPC_ArvsShadanVamp_Sc

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