ScriptName aaaKimachuuGunGreatSwordME Extends ActiveMagicEffect

Actor Property PlayerRef Auto
Faction Property PotentialFollowerFaction Auto
Spell Property aaaKimachuuGGSLockOnMSpell Auto
Spell Property aaaKimachuuGGSLockOnATKSpell Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
	Bool bNotDead = (!akTarget.IsDead())
	Bool bNotTeam = (!akTarget.IsPlayerTeammate())
	Bool bNotBleed = (!akTarget.IsBleedingOut())
	Bool bNotFollower = (!akTarget.IsInFaction(PotentialFollowerFaction))
	Bool bFighting = (akTarget.IsInCombat())
	Bool bNotCrime = (!akTarget.GetCrimeFaction())

	If bNotDead && bNotTeam && bNotBleed && bNotFollower && bFighting && bNotCrime
		Float fRnd = Utility.RandomFloat(0.3, 1.3)
		Utility.Wait(fRnd)
		aaaKimachuuGGSLockOnMSpell.Cast(akTarget, akTarget)
		Utility.Wait(0.75)
		aaaKimachuuGGSLockOnATKSpell.Cast(PlayerRef, akTarget)
		Float fPlayerDest = PlayerRef.GetActorValue("Destruction")
		akTarget.DamageActorValue("Health", fPlayerDest * 2.0)
		Game.AdvanceSkill("Destruction", 35.0)
	EndIf
EndEvent