Scripts

TR_m4_NPC_Vrashammu_sc

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