SPELL Property VoiceDragonFire05 AutoObjectReference Property CFXMarkerSource Auto ObjectReference Property CFXMarker AutoACTOR Property PlayerRef AutoEvent OnInit(); Store all player camera anglesfloat AngleX = Math.Abs(PlayerRef.GetAngleX()) * -1float AngleY = PlayerRef.GetAngleY()float AngleZ = PlayerRef.GetAngleZ(); Create our distance variablesfloat SourceDistance = 10.0float TargetDistance = 2000.0; Calculate source positionfloat OffsetZ = SourceDistance * Math.Sin(AngleX)float DistanceXY = SourceDistance * Math.Cos(AngleX)float OffsetX = DistanceXY * Math.Sin(AngleZ)float OffsetY = DistanceXY * Math.Cos(AngleZ); Calculate the target positionOffsetZ = TargetDistance * Math.Sin(AngleX)DistanceXY = TargetDistance * Math.Cos(AngleX)OffsetX = DistanceXY * Math.Sin(AngleZ)OffsetY = DistanceXY * Math.Sin(AngleZ)Utility.Wait(1.5); Place CFXMarkerSource in front of Runefloat Mult = SourceDistance / TargetDistanceCFXMarkerSource.Enable()CFXMarkerSource.MoveTo(Self, OffsetX * Mult, OffsetY * Mult, OffsetZ * Mult)CFXMarkerSource.SetAngle(AngleX, AngleY, AngleZ); DESIGNATE YOUR LASER\Place CFXMarker at target positionCFXMarker.Enable()CFXMarker.MoveTo(Self, OffsetX, OffsetY, OffsetZ)VoiceDragonFire05.RemoteCast(CFXMarkerSource, PlayerRef, CFXMarker)Utility.Wait(0.5)CFXMarker.Disable()CFXMarkerSource.Disable()Self.Disable()Self.Delete()EndEvent
I know I've probably just butchered the script somewhere in my copying/changing, but I can't for the life of me find where, as it stands right now my spell will fire in different directions, but they're kind of all over the place, so I assume I just borked the mathematics and am too math challenged to find and understand where.
You guys are a clever bunch, what did I screw up? : )