Scripts

TR_m4_Bal_NPC_Alvayah_Sc

TR_Mainland.esm
Variables 22
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
greeting
greetOnce
waitDay
timer
Source
1begin TR_m4_Bal_NPC_Alvayah_Sc 2 3; Baluath Questline 4; Script running on Alvayah. 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; Alvayah 35short TR_m4_Bal_ClanMember 36short greeting 37short greetOnce 38short waitDay 39 40;----------------------------------------------- 41; Drop vampire dust on death like vanilla 42;----------------------------------------------- 43 44if ( OnDeath ) 45 AddItem "ingred_vampire_dust_01" 1 46 47 ; Alvayah 48 if ( TR_m4_Bal_ClanMember == 1 ) 49 set TR_m4_baluathdead to ( TR_m4_baluathdead + 1 ) 50 elseif ( GetJournalIndex "TR_m4_Bal3_ArvsShadan" > 0 ) 51 if ( GetJournalIndex "TR_m4_Bal3_ArvsShadan" < 100 ) 52 Journal "TR_m4_Bal3_ArvsShadan" 200 53 endif 54 endif 55endif 56 57;----------------------------------------------- 58; Check player infection/vampire status 59;----------------------------------------------- 60 61if ( CellChanged ) 62 set checkBlood to 0 63 set state to 0 64 65 if ( T_Glob_PorphyricInfected ) 66 elseif ( player->GetSpell "Vampire Blood Quarra" ) 67 elseif ( player->GetSpell "Vampire Blood Aundae" ) 68 elseif ( player->GetSpell "Vampire Blood Berne" ) 69 elseif ( PCVampire != 0 ) 70 elseif ( PCWerewolf == 1 ) 71 else 72 ;Player isn't infected/vampire/cured vampire/werewolf 73 set checkBlood to 1 74 endif 75endif 76 77if ( fixHead ) 78 ;Mod-added heads disappear when the Vampirism effect is removed/swapped 79 ;To fix this we equip a helmet and remove it to reset the head model 80 set fixHead to 0 81 equip T_Glb_Var_HeadFixer ;Lack of AddItem is intentional 82 RemoveItem T_Glb_Var_HeadFixer 1 83endif 84 85if ( MenuMode ) 86 return 87endif 88 89;Baluath stuff, see cure script 90set timer to ( timer + GetSecondsPassed ) 91if ( timer > 1 ) 92 set timer to 0 93 if ( ashStorm ) 94 set ashStorm to 0 95 endif 96 if ( GetWindSpeed ) 97 if ( GetCurrentWeather >= 6 ) ;ash 98 if ( GetCurrentWeather <= 7 ) ;blight 99 set ashStorm to 1 100 endif 101 endif 102 endif 103 if ( ashStorm ) 104 if ( GetSpell "T_Vamp_Ab_Baluath_Ash" == 0 ) 105 AddSpell "T_Vamp_Ab_Baluath_Ash" 106 AddSpell "T_Vamp_Sp_Baluath_Ash" 107 AddSpell "T_Vamp_Ab_Baluath_SunDmg" 108 RemoveSpell "vampire sun damage" 109 set fixHead to 1 110 endif 111 elseif ( GetSpell "T_Vamp_Ab_Baluath_Ash" ) 112 RemoveSpell "T_Vamp_Ab_Baluath_Ash" 113 RemoveSpell "T_Vamp_Sp_Baluath_Ash" 114 AddSpell "vampire sun damage" 115 RemoveSpell "T_Vamp_Ab_Baluath_SunDmg" 116 set fixHead to 1 117 endif 118endif 119 120 121;------------------------------------------------ 122; Player was not infected before changing cell, 123; so constantly check for infection and then run 124; this clan's specific global script 125;------------------------------------------------ 126 127if ( checkBlood ) 128 if ( player->GetSpellEffects "T_Vamp_Dis_Baluath" ) 129 if ( ScriptRunning "T_ScVamp_Baluath_PC" != 1 ) 130 StartScript "T_ScVamp_Baluath_PC" 131 endif 132 endif 133 134;------------------------------------------------ 135; Player was infected/vampire before changing cell, 136; so check whether player is in an enemy clan 137;------------------------------------------------ 138 139elseif ( state != 1 ) 140; if ( VampClan == 100 ) 141 SetFight 30 ;Player is a friendly vampire 142; else 143; SetFight 90 ;Player is an enemy vampire 144; endif 145 146 set state to 1 147endif 148 149;------------------------------------------------ 150; Apply vampire spells/abilities to this NPC once 151;------------------------------------------------ 152 153if ( doOnce == 0 ) 154 AddSpell "T_Vamp_Dis_Baluath" 155 AddSpell "T_Vamp_Ab_Baluath" 156 AddSpell "Vampire Attributes" 157 AddSpell "Vampire Skills" 158 AddSpell "Vampire Immunities" 159 AddSpell "Vampire Sun Damage" 160 AddSpell "Vampire Touch" 161 ;set province-specific location variable for dialogue here 162 set TR_Map to 4 163 set doOnce to 1 164endif 165 166;------------------------------------------------ 167; Alvayah quest-specific behavior 168;------------------------------------------------ 169 170; QUEST 3 171; greetOnce = 1: forcegreeted in Arvs-Shadan 172; timer: built-in Baluath timer used to optimize GetDetected 173; greeting = 1: first greeting in Ald Balaal 174 175if ( GetJournalIndex "TR_m4_Bal3_ArvsShadan" < 10 ) 176elseif ( GetJournalIndex "TR_m4_Bal3_ArvsShadan" < 40 ) 177 ; forcegreet if she detects you at a certain distance while trapped in Arvs-Shadan 178 if ( greetOnce == 0 ) 179 if ( timer == 0 ) 180 if ( GetDistance player < 600 ) 181 if ( GetDetected player ) 182 ForceGreeting 183 set greetOnce to 1 184 return 185 endif 186 endif 187 endif 188 endif 189endif 190 191; QUEST 5 192; waitDay: set to DaysPassed when she has teleportation amulet and several ingredients 193 194; update journal after day of waiting for her to make clan amulet 195if ( GetJournalIndex "TR_m4_Bal5_AmuletsPacts" == 40 ) 196 if ( DaysPassed != waitDay ) 197 Journal "TR_m4_Bal5_AmuletsPacts" 50 198 endif 199endif 200 201end