Scripts

TR_m4_NPC_V_Rels_Uvalor

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