Scripts

TR_m4_NPC_V_Uvayn

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