And the Autodeath on falling thing is just dumb...I literally gave myself +50,000 health, and I still can die from falling around 20 feet.
scriptName ShanaCannon2MEffectScript extends ActiveMagicEffect{Scripted magic effect for CANNON.}import utility ; For Random Float ?;======; PROPERTIES / =============/Activator Property ShanaCannonGoalActivator Auto;======; VARIABLES / =============/ObjectReference MoveWhat ; TargetObjectReference CannonTarget ; Cannon Target; Middle Coordenates, Flying Speed and Distance to Goal; Angles do not seem to do anythingFloat DXFloat DYFloat DZFloat NewAngleXFloat NewAngleYFloat NewAngleZFloat FlySpeed ; How fast to move.Float GoalDistance;================; EVENTS /=============/Event OnEffectStart(Actor Target, Actor Caster) Debug.Trace(" OnEffectStart ") ; Sets Stuff MoveWhat = Target CannonTarget = MoveWhat.PlaceAtMe(ShanaCannonGoalActivator,1) CannonTarget.MoveTo(MoveWhat, MoveWhat.X + 1000.0, MoveWhat.Y + 1000.0, 0.0,false) GoalDistance = MoveWhat.GetDistance( CannonTarget ) Debug.Trace(" Initial Distance between Player and Goal: " + GoalDistance ) ComputeNextTranslationData() FlySpeed = FlySpeed * 10 ; Let's go faster first time MoveWhat.TranslateTo( DX , DY , DZ , NewAngleX, NewAngleY, NewAngleZ, FlySpeed , 20.0) RegisterForUpdate(1) ; Since we can't catch the OnTranslationComplete, have to guess. Debug.Notification(" You should be turning God mode on by now...")EndEventEvent OnUpdate() ; Start moving the player with translates GoalDistance = MoveWhat.GetDistance( CannonTarget ) Debug.Trace(" FlySpeed: " + FlySpeed + " Distance between Player and Goal: " + GoalDistance ) if GoalDistance < 200.0 ; At the destination case. Debug.Trace(" We are there! ") ; No way I am getting here... EndThisThing() UnRegisterForUpdate() endifEndEventEvent OnTranslationAlmostComplete() GoalDistance = MoveWhat.GetDistance( CannonTarget ) Debug.Trace(" Translation Almost Complete ! Distance : " + GoalDistance ) ComputeNextTranslationData() MoveWhat.TranslateTo( DX , DY , DZ , NewAngleX, NewAngleY, NewAngleZ, FlySpeed , 100.0)EndEventEvent OnEffectFinish(Actor Target, Actor Caster) Debug.Trace(" OnEffectFinish") EndThisThing()EndEventFunction EndThisThing() if CannonTarget CannonTarget.Disable() CannonTarget.Delete() endif Debug.Notification("Doooooooooooown!") wait(2) MoveWhat.StopTranslation()EndFunctionFunction ComputeNextTranslationData() DX = ( (CannonTarget.X - MoveWhat.x) / 2.0 ) + RandomFloat(-200.0,200.0) DY = ( (CannonTarget.Y - MoveWhat.y) / 2.0 ) + RandomFloat(-200.0,200.0) DZ = (CannonTarget.Z - MoveWhat.z) / 2.0 + ( GoalDistance / 1000 ) NewAngleX = MoveWhat.GetAngleX() + RandomFloat(-360.0,360.0) NewAngleY = MoveWhat.GetAngleY() + RandomFloat(-360.0,360.0) NewAngleZ = MoveWhat.GetAngleZ() + RandomFloat(-360.0,360.0) ; Tumble at random FlySpeed = MoveWhat.GetDistance( CannonTarget ) / 20.0EndFunction; We never get these events...Event OnTranslationComplete() Debug.Trace(" Translation Complete") ; can't get this to fire by using translations of cannon object - it doesn't translate. Ever.EndEventEvent OnTranslationFailed() Debug.Trace(" Translation Failed")EndEventScriptname BallisticLaunchingScript extends ObjectReference{Lancelot, Galahad, and I jump out of the rabbit...}import gameimport utilityimport RedwoodsToolsfloat ForceBool FirstUpdate = TrueFlightNodeTargetScript property FlyTarget auto; a marker in the airActivator Property FlyTargetType Auto ; The object type being used to keep track of the "next" position to fly to.ObjectReference MoveWhat ; Me. Saves tons of function calls to Game.GetPlayer()Float property FlySpeed auto; How fast to move.Sound BoomSound Whooshfunction PlayCannon(objectreference Here) Boom = BoomSound Whoosh = WhooshSound Boom.Play(Here) Whoosh.Play(Here)endfunctionfunction FindCannonPosition(ObjectReference A, ObjectReference B) ; Do the math before we play the sounds Moveto(B,0.0,0.0,15000.0) ; move to a point far above the destination. Force = DistanceBetween(A,B) / 50.0 if Force > 80.0 Force = 80.0 ; If you don't cap the value, you may never come down... endifendfunctionfunction FireCannon(float ForceFactor) ; Use the FusRohDah Cannon! PushActorAway(Game.GetPlayer(),Force * ForceFactor) ; Negative value pushes you TOWARD the cannon instead of AWAY from it.endFunctionEvent OnInit() MoveWhat = GetPlayer() FindCannonPosition(MoveWhat,Gvar.Node) ; Find position for the cannon PlayCannon(MoveWhat) FireCannon(-1.0) ; Negative value pushes you TOWARD the cannon instead of AWAY from it. RegisterForSingleUpdate(10.0) ; To give the player time to land...sometimes.EndEventEvent OnUpdate() ; Keep moving the player with Cannon Shots until he's close enough. if MoveWhat.GetDistance(Gvar.Node) < 1000.0 ; At the destination case. Disable() Delete() else FindCannonPosition(MoveWhat,Gvar.Node) ; Find position for the cannon PlayCannon(MoveWhat) FireCannon(-1.0) RegisterForSingleUpdate(10.0) endifEndEventSound Property WhooshSound AutoSound Property BoomSound Auto ; Using VOCShoutFXFireBreathCNodeVariableScript Property GVar AutoScriptname NodeFusRohDahCannonPlayer extends activemagiceffect import utilityimport GameBallisticLaunchingScript Cannonfloat FlySpeedFlightNodeTargetScript FlyTargetEvent OnEffectStart(Actor Target, Actor Caster) ActorBase Me = Target.GetActorBase() ; What is your name? Me.SetEssential(True) Me.SetInvulnerable(True) ; What is your quest? Cannon = (Target.PlaceAtMe(CannonType,1,false,false) as BallisticLaunchingScript) ; What is your favorite color?EndEventEvent OnEffectFinish(Actor Target, Actor Caster) while Cannon Wait(1.0) ; Don't turn invulnerability off while we're still bouncing around endwhile Debug.Notification("Spell Invulnerability shield Down") ActorBase Me = Target.GetActorBase() Me.SetEssential(False) Me.SetInvulnerable(False)EndEventActivator property CannonType autoNodeVariableScript property Gvar Auto