Scripts

TR_m4_NPC_V_Artisa_Seran

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