Scripts

T_ScNpc_Mw_Map4VampBaluath

Tamriel_Data.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
T_Local_Khajiit
timer
Source
1begin T_ScNpc_Mw_Map4VampBaluath 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 35short T_Local_Khajiit 36 37;----------------------------------------------- 38; Drop vampire dust on death like vanilla 39;----------------------------------------------- 40 41if ( OnDeath ) 42 AddItem "ingred_vampire_dust_01" 1 43endif 44 45;----------------------------------------------- 46; Check player infection/vampire status 47;----------------------------------------------- 48 49if ( CellChanged ) 50 set checkBlood to 0 51 set state to 0 52 53 if ( T_Glob_PorphyricInfected ) 54 elseif ( player->GetSpell "Vampire Blood Quarra" ) 55 elseif ( player->GetSpell "Vampire Blood Aundae" ) 56 elseif ( player->GetSpell "Vampire Blood Berne" ) 57 elseif ( PCVampire != 0 ) 58 elseif ( PCWerewolf == 1 ) 59 else 60 ;Player isn't infected/vampire/cured vampire/werewolf 61 set checkBlood to 1 62 endif 63endif 64 65if ( fixHead ) 66 ;Mod-added heads disappear when the Vampirism effect is removed/swapped 67 ;To fix this we equip a helmet and remove it to reset the head model 68 set fixHead to 0 69 equip T_Glb_Var_HeadFixer ;Lack of AddItem is intentional 70 RemoveItem T_Glb_Var_HeadFixer 1 71endif 72 73if ( MenuMode ) 74 return 75endif 76 77;Baluath stuff, see cure script 78set timer to ( timer + GetSecondsPassed ) 79if ( timer > 1 ) 80 set timer to 0 81 if ( ashStorm ) 82 set ashStorm to 0 83 endif 84 if ( GetWindSpeed ) 85 if ( GetCurrentWeather >= 6 ) ;ash 86 if ( GetCurrentWeather <= 7 ) ;blight 87 set ashStorm to 1 88 endif 89 endif 90 endif 91 if ( ashStorm ) 92 if ( GetSpell "T_Vamp_Ab_Baluath_Ash" == 0 ) 93 AddSpell "T_Vamp_Ab_Baluath_Ash" 94 AddSpell "T_Vamp_Sp_Baluath_Ash" 95 AddSpell "T_Vamp_Ab_Baluath_SunDmg" 96 RemoveSpell "vampire sun damage" 97 set fixHead to 1 98 endif 99 elseif ( GetSpell "T_Vamp_Ab_Baluath_Ash" ) 100 RemoveSpell "T_Vamp_Ab_Baluath_Ash" 101 RemoveSpell "T_Vamp_Sp_Baluath_Ash" 102 AddSpell "vampire sun damage" 103 RemoveSpell "T_Vamp_Ab_Baluath_SunDmg" 104 set fixHead to 1 105 endif 106endif 107 108 109;------------------------------------------------ 110; Player was not infected before changing cell, 111; so constantly check for infection and then run 112; this clan's specific global script 113;------------------------------------------------ 114 115if ( checkBlood ) 116 if ( player->GetSpellEffects "T_Vamp_Dis_Baluath" ) 117 if ( ScriptRunning "T_ScVamp_Baluath_PC" != 1 ) 118 StartScript "T_ScVamp_Baluath_PC" 119 endif 120 endif 121 122;------------------------------------------------ 123; Player was infected/vampire before changing cell, 124; so check whether player is in an enemy clan 125;------------------------------------------------ 126 127elseif ( state != 1 ) 128 if ( VampClan == 100 ) 129 SetFight 30 ;Player is a friendly vampire 130 else 131 SetFight 90 ;Player is an enemy vampire 132 endif 133 134 set state to 1 135endif 136 137;------------------------------------------------ 138; Apply vampire spells/abilities to this NPC once 139;------------------------------------------------ 140 141if ( doOnce == 0 ) 142 AddSpell "T_Vamp_Dis_Baluath" 143 AddSpell "T_Vamp_Ab_Baluath" 144 AddSpell "Vampire Attributes" 145 AddSpell "Vampire Skills" 146 AddSpell "Vampire Immunities" 147 AddSpell "Vampire Sun Damage" 148 AddSpell "Vampire Touch" 149 ModRestoration 75 150 ;set province-specific location variable for dialogue here 151 set TR_Map to 4 152 set T_Local_Khajiit to -1 153 154 if ( GetRace "T_Els_Cathay" ) 155 set T_Local_Khajiit to 1 156 elseif ( GetRace "T_Els_Cathay-raht" ) 157 set T_Local_Khajiit to 1 158 elseif ( GetRace "T_Els_Dagi-raht" ) 159 set T_Local_Khajiit to 1 160 elseif ( GetRace "T_Els_Ohmes" ) 161 set T_Local_Khajiit to 1 162 elseif ( GetRace "T_Els_Ohmes-raht" ) 163 set T_Local_Khajiit to 1 164 elseif ( GetRace "T_Els_Suthay" ) 165 set T_Local_Khajiit to 1 166 elseif ( GetRace "T_Els_Tojay" ) 167 set T_Local_Khajiit to 1 168 elseif ( GetRace "Khajiit" ) 169 set T_Local_Khajiit to 1 170 endif 171 set doOnce to 1 172endif 173 174end