@ -79,8 +79,6 @@ ImageSpaceModifier Property _00E_Phasmalist_ApparitionEnterWorldIMOD Auto
Sound Property _00E_FS_IncreaseArcaneFeverM Auto
Sound Property _00E_FS_IncreaseArcaneFeverM Auto
_00E_FS_ForgottenStories_Functions Property ForgottenStoriesMiscDialogue Auto
Message Property _00E_Player_sArcaneFeverIncreased Auto
Message Property _00E_Player_sArcaneFeverIncreased Auto
GlobalVariable Property _00E_Phasmalist_IsApparitionSummoned Auto
GlobalVariable Property _00E_Phasmalist_IsApparitionSummoned Auto
@ -137,7 +135,7 @@ Function Summon(_00E_Phasmalist_TrinketSC trinket, ObjectReference moveToRef, Bo
akSelf.BlockActivation()
akSelf.BlockActivation()
If bPhasmalismTankMode
If bPhasmalismTankMode
akSelf.SetAV("Variable01", 1.0)
akSelf.SetActor Value ("Variable01", 1.0)
akSelf.EnableAI(False)
akSelf.EnableAI(False)
Else
Else
If moveToRef == PlayerREF
If moveToRef == PlayerREF
@ -177,7 +175,7 @@ Function Setup()
SetupBehaviour(akSelf)
SetupBehaviour(akSelf)
SetupNotPersistentStats(akSelf)
SetupNotPersistentStats(akSelf)
Float fAttributeMult = (fPlayerConjSkillMult * PlayerREF.GetAV("Conjuration") + fPlayerEnchSkillMult * PlayerREF.GetAV("Enchanting")) / 100.0 + 1.0
Float fAttributeMult = (fPlayerConjSkillMult * PlayerREF.GetActor Value ("Conjuration") + fPlayerEnchSkillMult * PlayerREF.GetActor Value ("Enchanting")) / 100.0 + 1.0
ApplyClassBoost(akSelf, BOOST_CLASS_MAGE, _00E_Class_Phasmalist_P05_A_Shamanism_01, _00E_Class_Phasmalist_P05_A_Shamanism_02, _00E_Class_Phasmalist_P05_A_Shamanism_03)
ApplyClassBoost(akSelf, BOOST_CLASS_MAGE, _00E_Class_Phasmalist_P05_A_Shamanism_01, _00E_Class_Phasmalist_P05_A_Shamanism_02, _00E_Class_Phasmalist_P05_A_Shamanism_03)
ApplyClassBoost(akSelf, BOOST_CLASS_RANGER, _00E_Class_Phasmalist_P05_B_Mischief_01, _00E_Class_Phasmalist_P05_B_Mischief_02, _00E_Class_Phasmalist_P05_B_Mischief_03)
ApplyClassBoost(akSelf, BOOST_CLASS_RANGER, _00E_Class_Phasmalist_P05_B_Mischief_01, _00E_Class_Phasmalist_P05_B_Mischief_02, _00E_Class_Phasmalist_P05_B_Mischief_03)
@ -193,14 +191,14 @@ Function Setup()
If fPlayerStamina > fMaxAttributeValue
If fPlayerStamina > fMaxAttributeValue
fMaxAttributeValue = fPlayerStamina
fMaxAttributeValue = fPlayerStamina
EndIf
EndIf
akSelf.ForceAV("Health", ((akSelf.GetBaseAV("Health") + fMaxAttributeValue * fPlayerStatsMult) * fAttributeMult) as int)
akSelf.ForceActor Value ("Health", ((akSelf.GetBaseAV("Health") + fMaxAttributeValue * fPlayerStatsMult) * fAttributeMult) as int)
akSelf.ForceAV("Magicka", (((akSelf.GetBaseAV("Magicka") + fMaxAttributeValue * fPlayerStatsMult) * fAttributeMult) as int) + iCurrentBoostMagicka)
akSelf.ForceActor Value ("Magicka", (((akSelf.GetBaseAV("Magicka") + fMaxAttributeValue * fPlayerStatsMult) * fAttributeMult) as int) + iCurrentBoostMagicka)
akSelf.ForceAV("Stamina", ((akSelf.GetBaseAV("Stamina") + fMaxAttributeValue * fPlayerStatsMult) * fAttributeMult) as int)
akSelf.ForceActor Value ("Stamina", ((akSelf.GetBaseAV("Stamina") + fMaxAttributeValue * fPlayerStatsMult) * fAttributeMult) as int)
Else
Else
akSelf.ForceAV("Health", ((akSelf.GetBaseAV("Health") + PlayerREF.GetBaseAV("Health") * fPlayerStatsMult) * fAttributeMult) as int)
akSelf.ForceActor Value ("Health", ((akSelf.GetBaseAV("Health") + PlayerREF.GetBaseAV("Health") * fPlayerStatsMult) * fAttributeMult) as int)
akSelf.ForceAV("Magicka", (((akSelf.GetBaseAV("Magicka") + PlayerREF.GetBaseAV("Magicka") * fPlayerStatsMult) * fAttributeMult) as int) + iCurrentBoostMagicka)
akSelf.ForceActor Value ("Magicka", (((akSelf.GetBaseAV("Magicka") + PlayerREF.GetBaseAV("Magicka") * fPlayerStatsMult) * fAttributeMult) as int) + iCurrentBoostMagicka)
akSelf.ForceAV("Stamina", ((akSelf.GetBaseAV("Stamina") + PlayerREF.GetBaseAV("Stamina") * fPlayerStatsMult) * fAttributeMult) as int)
akSelf.ForceActor Value ("Stamina", ((akSelf.GetBaseAV("Stamina") + PlayerREF.GetBaseAV("Stamina") * fPlayerStatsMult) * fAttributeMult) as int)
EndIf
EndIf
EndFunction
EndFunction
@ -211,10 +209,10 @@ Function SetupBehaviour(Actor akSelf)
EndIf
EndIf
akSelf.SetPlayerTeammate()
akSelf.SetPlayerTeammate()
akSelf.SetAV("Confidence", 4) ; the apparition should never flee
akSelf.SetActor Value ("Confidence", 4) ; the apparition should never flee
akSelf.SetAV("Aggression", 0) ; the apparition should not initiate combat (-> stealth playstyle)
akSelf.SetActor Value ("Aggression", 0) ; the apparition should not initiate combat (-> stealth playstyle)
akSelf.SetAV("Sneak", 100)
akSelf.SetActor Value ("Sneak", 100)
akSelf.SetAV("Invisibility", 1) ; make the apparition undetectable when sneaking (-> stealth playstyle)
akSelf.SetActor Value ("Invisibility", 1) ; make the apparition undetectable when sneaking (-> stealth playstyle)
akSelf.IgnoreFriendlyHits() ; make the apparition ignore friendly fire from the PC
akSelf.IgnoreFriendlyHits() ; make the apparition ignore friendly fire from the PC
EndFunction
EndFunction
@ -222,19 +220,19 @@ Function SetupNotPersistentStats(Actor akSelf)
akSelf.GetActorBase().SetCombatStyle(SummonTrinket.GetUsedCombatStyle())
akSelf.GetActorBase().SetCombatStyle(SummonTrinket.GetUsedCombatStyle())
If bTeleportHealRate == False
If bTeleportHealRate == False
akSelf.SetAV("HealRate", DEFAULT_HEAL_RATE)
akSelf.SetActor Value ("HealRate", DEFAULT_HEAL_RATE)
Else
Else
akSelf.SetAV("HealRate", 0.0)
akSelf.SetActor Value ("HealRate", 0.0)
EndIf
EndIf
akSelf.SetAV("MagickaRate", fApparitionManaRate)
akSelf.SetActor Value ("MagickaRate", fApparitionManaRate)
;failsafe since setav doesn't work sometimes
;failsafe since setav doesn't work sometimes
If bTeleportHealRate == False
If bTeleportHealRate == False
akSelf.ForceAV("HealRate", DEFAULT_HEAL_RATE)
akSelf.ForceActor Value ("HealRate", DEFAULT_HEAL_RATE)
Else
Else
akSelf.ForceAV("HealRate", 0.0)
akSelf.ForceActor Value ("HealRate", 0.0)
EndIf
EndIf
akSelf.ForceAV("MagickaRate", fApparitionManaRate)
akSelf.ForceActor Value ("MagickaRate", fApparitionManaRate)
EndFunction
EndFunction
Function ApplyClassBoost(Actor akSelf, Int iBoostClass, Perk boostPerk1, Perk boostPerk2, Perk boostPerk3)
Function ApplyClassBoost(Actor akSelf, Int iBoostClass, Perk boostPerk1, Perk boostPerk2, Perk boostPerk3)
@ -262,8 +260,8 @@ Function _AddClassBoost(Actor akSelf, Int iBoostClass, Int iBoostLevel)
iDestructionPowerMod = iGhostlyMageBoostDestructionPowerMod1
iDestructionPowerMod = iGhostlyMageBoostDestructionPowerMod1
iCurrentBoostMagicka = iGhostlyMageBoostMagicka1
iCurrentBoostMagicka = iGhostlyMageBoostMagicka1
EndIf
EndIf
;akSelf.ForceAV("DestructionPowerMod", akSelf.GetAV("DestructionPowerMod") + iDestructionPowerMod)
;akSelf.ForceActor Value ("DestructionPowerMod", akSelf.GetActor Value ("DestructionPowerMod") + iDestructionPowerMod)
akSelf.ModAV("DestructionPowerMod", iDestructionPowerMod)
akSelf.ModActor Value ("DestructionPowerMod", iDestructionPowerMod)
ElseIf iBoostClass == BOOST_CLASS_RANGER
ElseIf iBoostClass == BOOST_CLASS_RANGER
Int iBoostArchery = 0
Int iBoostArchery = 0
Int iBoostCritChance = 0
Int iBoostCritChance = 0
@ -278,10 +276,10 @@ Function _AddClassBoost(Actor akSelf, Int iBoostClass, Int iBoostLevel)
iBoostCritChance = iGhostlyRangerBoostCritChance1
iBoostCritChance = iGhostlyRangerBoostCritChance1
EndIf
EndIf
;akSelf.ForceAV("Marksman", akSelf.GetAV("Marksman") + iBoostArchery)
;akSelf.ForceActor Value ("Marksman", akSelf.GetActor Value ("Marksman") + iBoostArchery)
akSelf.ModAV("Marksman", iBoostArchery)
akSelf.ModActor Value ("Marksman", iBoostArchery)
;akSelf.ForceAV("CritChance", akSelf.GetAV("CritChance") + iBoostCritChance)
;akSelf.ForceActor Value ("CritChance", akSelf.GetActor Value ("CritChance") + iBoostCritChance)
akSelf.ModAV("CritChance", iBoostCritChance)
akSelf.ModActor Value ("CritChance", iBoostCritChance)
ElseIf iBoostClass == BOOST_CLASS_WARRIOR
ElseIf iBoostClass == BOOST_CLASS_WARRIOR
Int iBoostMelee = 0
Int iBoostMelee = 0
Int iBoostArmor = 0
Int iBoostArmor = 0
@ -296,15 +294,15 @@ Function _AddClassBoost(Actor akSelf, Int iBoostClass, Int iBoostLevel)
iBoostArmor = iGhostlyWarriorBoostArmorSkill1
iBoostArmor = iGhostlyWarriorBoostArmorSkill1
EndIf
EndIf
;akSelf.ForceAV("HeavyArmor", akSelf.GetAV("HeavyArmor") + iBoostArmor)
;akSelf.ForceActor Value ("HeavyArmor", akSelf.GetActor Value ("HeavyArmor") + iBoostArmor)
akSelf.ModAV("HeavyArmor", iBoostArmor)
akSelf.ModActor Value ("HeavyArmor", iBoostArmor)
;akSelf.ForceAV("LightArmor", akSelf.GetAV("LightArmor") + iBoostArmor)
;akSelf.ForceActor Value ("LightArmor", akSelf.GetActor Value ("LightArmor") + iBoostArmor)
akSelf.ModAV("LightArmor", iBoostArmor)
akSelf.ModActor Value ("LightArmor", iBoostArmor)
; MeleeDamage AV seems to be not working, it's actually always zero
; MeleeDamage AV seems to be not working, it's actually always zero
;akSelf.ForceAV("MeleeDamage", akSelf.GetAV("MeleeDamage") + iBoostMelee)
;akSelf.ForceActor Value ("MeleeDamage", akSelf.GetActor Value ("MeleeDamage") + iBoostMelee)
;akSelf.ModAV("MeleeDamage", iBoostMelee)
;akSelf.ModActor Value ("MeleeDamage", iBoostMelee)
akSelf.ModAV("OneHanded", iBoostMelee)
akSelf.ModActor Value ("OneHanded", iBoostMelee)
akSelf.ModAV("TwoHanded", iBoostMelee)
akSelf.ModActor Value ("TwoHanded", iBoostMelee)
Else
Else
Debug.Notification("Phasmalist Control Quest has issues: Unsupported boost class " + iBoostClass)
Debug.Notification("Phasmalist Control Quest has issues: Unsupported boost class " + iBoostClass)
EndIf
EndIf
@ -318,6 +316,8 @@ Endfunction
Function Unsummon(Bool bSilent)
Function Unsummon(Bool bSilent)
Actor akSelf = self.GetActorReference()
Actor akSelf = self.GetActorReference()
HealthBarManager.Hide(akSelf)
GoToState("")
GoToState("")
AliasFailsafeRef = None
AliasFailsafeRef = None
@ -334,11 +334,13 @@ Function Unsummon(Bool bSilent)
akSelf.RemoveAllItems((akSelf.GetActorBase() as _00E_Phasmalist_ApparationSC).inventoryContainer, False, True)
akSelf.RemoveAllItems((akSelf.GetActorBase() as _00E_Phasmalist_ApparationSC).inventoryContainer, False, True)
akSelf.Disable()
akSelf.Disable()
Self.Clear()
Self.Clear()
ForgottenStoriesMiscDialogue.hideActorHealthBars(akSelf)
SummonTrinket = None
SummonTrinket = None
akSelf.Delete()
Utility.wait(1.0)
akSelf.Delete()
SendModEvent("Phasmalist_ApparationUnSummon")
SendModEvent("Phasmalist_ApparationUnSummon")
EndFunction
EndFunction
Function AddArcaneFever()
Function AddArcaneFever()
@ -377,10 +379,10 @@ Function AddArcaneFever()
Float fArcaneFeverAdd = fMaxArcaneFeverAdd * fHealthLostPercentage
Float fArcaneFeverAdd = fMaxArcaneFeverAdd * fHealthLostPercentage
If fArcaneFeverAdd > 0
If fArcaneFeverAdd > 0
PlayerREF.ModAV("LastFlattered", -fArcaneFeverAdd)
PlayerREF.ModActor Value ("LastFlattered", -fArcaneFeverAdd)
_00E_ArkanistenfieberIMOD.ApplyCrossFade()
_00E_ArkanistenfieberIMOD.ApplyCrossFade()
_00E_FS_IncreaseArcaneFeverM.Play(PlayerREF)
_00E_FS_IncreaseArcaneFeverM.Play(PlayerREF)
_00E_Player_sArcaneFeverIncreased.Show(fArcaneFeverAdd, -1 * PlayerREF.GetAV("LastFlattered"))
_00E_Player_sArcaneFeverIncreased.Show(fArcaneFeverAdd, -1 * PlayerREF.GetActor Value ("LastFlattered"))
EndIf
EndIf
EndFunction
EndFunction
@ -409,7 +411,7 @@ Function TeleportToPlayer(Bool bTeleportInFront, Bool bSilent)
; Zero out-of-combat heal rate for teleport and a few seconds after it.
; Zero out-of-combat heal rate for teleport and a few seconds after it.
; This is to prevent the apparition regenerating health IN combat on "Call Apparition" spam.
; This is to prevent the apparition regenerating health IN combat on "Call Apparition" spam.
UnregisterForUpdate()
UnregisterForUpdate()
akSelf.ForceAV("HealRate", 0.0)
akSelf.ForceActor Value ("HealRate", 0.0)
bTeleportHealRate = True
bTeleportHealRate = True
akSelf.Disable()
akSelf.Disable()
@ -634,7 +636,7 @@ EndFunction
Function _ShowHealthBar()
Function _ShowHealthBar()
Actor akSelf = Self.GetActorReference()
Actor akSelf = Self.GetActorReference()
If akSelf && akSelf.IsDead() == False
If akSelf && akSelf.IsDead() == False
ForgottenStoriesMiscDialogue.showActorHealthBars (akSelf)
HealthBarManager.Show (akSelf)
EndIf
EndIf
EndFunction
EndFunction
@ -777,7 +779,7 @@ State Working
Event OnUpdate()
Event OnUpdate()
If bTeleportHealRate
If bTeleportHealRate
bTeleportHealRate = False
bTeleportHealRate = False
GetActorReference().ForceAV("HealRate", DEFAULT_HEAL_RATE)
GetActorReference().ForceActor Value ("HealRate", DEFAULT_HEAL_RATE)
EndIf
EndIf
EndEvent
EndEvent