Scriptname _00E_FS_Affinity_ApparationWolfFormSC extends activemagiceffect _FS_Phasmalist_ControlQuest Property ControlQuest auto Explosion Property _00E_FS_Theriantrophist_TransEXP Auto Race Property _00E_Theriantrophist_PlayerWerewolfRace Auto Static Property Xmarker Auto Idle Property _00_Theriantrophist_WerewolfTransformBack Auto Idle Property IdleWerewolfTransformation Auto Idle Property _00E_IdleStomp Auto EffectShader Property _00E_Theriantrophist_TransformBackShader Auto EffectShader Property _00E_Theriantrophist_TransformShader Auto FormList Property _00E_Phasmalist_CombatStyleWerewolfList Auto Spell Property _00E_FS_Affinity_Soulcaller_ApparationWolfBoostSP Auto ObjectReference Property _00E_FS_Affinity_Soulcaller_RemoveAndAddApparationItemsChest Auto Race originalRace = None Float Property ApparationUnarmedDamage = 20 Autoreadonly Hidden Float Property ApparationHealthBoost = 40 Autoreadonly Hidden Event OnEffectStart(Actor akTarget, Actor akCaster) akTarget.SetPlayerTeammate(false) Utility.Wait(0.2) akTarget.UnequipAll() originalRace = akTarget.getRace() _00E_Theriantrophist_TransformShader.Play(akTarget) akTarget.playIdle(IdleWerewolfTransformation) _ForceCombatStyle(akTarget, _00E_Phasmalist_CombatStyleWerewolfList.GetAt(0) as CombatStyle) _AdjustBoost() akTarget.addSpell(_00E_FS_Affinity_Soulcaller_ApparationWolfBoostSP) Utility.wait(1) ObjectReference explosionMarker = akTarget.PlaceAtMe(Xmarker) explosionMarker.SetPosition(akTarget.GetPositionX(), akTarget.GetPositionY(), (akTarget.GetPositionZ() + 100.0)) explosionMarker.PlaceAtMe(_00E_FS_Theriantrophist_TransEXP) akTarget.SetRace(_00E_Theriantrophist_PlayerWerewolfRace) _00E_Theriantrophist_TransformShader.Stop(akTarget) explosionMarker.Delete() Utility.Wait(0.2) akTarget.SetPlayerTeammate(true) Endevent Event OnEffectFinish(Actor akTarget, Actor akCaster) akTarget.SetPlayerTeammate(false) bool wasDead = false if (akTarget.isDead()) akTarget.RemoveAllItems(_00E_FS_Affinity_Soulcaller_RemoveAndAddApparationItemsChest) akTarget.Resurrect() wasDead = true _00E_FS_Affinity_Soulcaller_RemoveAndAddApparationItemsChest.RemoveAllItems(akTarget) Endif Utility.Wait(0.2) _00E_Theriantrophist_TransformBackShader.Play(akTarget) akTarget.PlaceAtMe(_00E_FS_Theriantrophist_TransEXP) akTarget.PlayIdle(_00_Theriantrophist_WerewolfTransformBack) _ForceCombatStyle(akTarget, ControlQuest.apparationAlias.GetEquippedTrinket().GetUsedCombatStyle()) akTarget.removeSpell(_00E_FS_Affinity_Soulcaller_ApparationWolfBoostSP) akTarget.SetRace(originalRace) akTarget.PlayIdle(_00E_IdleStomp) _00E_Theriantrophist_TransformBackShader.Stop(akTarget) Utility.Wait(0.2) akTarget.SetPlayerTeammate(true) if wasDead akTarget.kill() Else ; necessary to correctly reequip items akTarget.RemoveAllItems(_00E_FS_Affinity_Soulcaller_RemoveAndAddApparationItemsChest) _00E_FS_Affinity_Soulcaller_RemoveAndAddApparationItemsChest.RemoveAllItems(akTarget) Endif EndEvent Function _ForceCombatStyle(Actor target, CombatStyle style) target.StopCombat() target.GetActorBase().SetCombatStyle(style) EndFunction Function _AdjustBoost() _00E_FS_Affinity_Soulcaller_ApparationWolfBoostSP.SetNthEffectMagnitude(0, ApparationUnarmedDamage) _00E_FS_Affinity_Soulcaller_ApparationWolfBoostSP.SetNthEffectMagnitude(1, ApparationHealthBoost) EndFunction