void InitSplines(List <Vector3> splinePoints, uint timeToTarget) { if (splinePoints.Count < 2) { return; } _movementTime = 0; _spline.Init_Spline(splinePoints.ToArray(), splinePoints.Count, Spline.EvaluationMode.Linear); _spline.initLengths(); // should be sent in object create packets only updateValues[(int)AreaTriggerFields.TimeToTarget].UnsignedValue = timeToTarget; if (IsInWorld) { if (_reachedDestination) { AreaTriggerRePath reshapeDest = new AreaTriggerRePath(); reshapeDest.TriggerGUID = GetGUID(); SendMessageToSet(reshapeDest, true); } AreaTriggerRePath reshape = new AreaTriggerRePath(); reshape.TriggerGUID = GetGUID(); reshape.AreaTriggerSpline.HasValue = true; reshape.AreaTriggerSpline.Value.ElapsedTimeForMovement = GetElapsedTimeForMovement(); reshape.AreaTriggerSpline.Value.TimeToTarget = timeToTarget; reshape.AreaTriggerSpline.Value.Points = splinePoints; SendMessageToSet(reshape, true); } _reachedDestination = false; }
void InitCircularMovement(AreaTriggerCircularMovementInfo cmi, uint timeToTarget) { // Circular movement requires either a center position or an attached unit Cypher.Assert(cmi.Center.HasValue || cmi.PathTarget.HasValue); // should be sent in object create packets only updateValues[(int)AreaTriggerFields.TimeToTarget].UnsignedValue = timeToTarget; _circularMovementInfo.Set(cmi); _circularMovementInfo.Value.TimeToTarget = timeToTarget; _circularMovementInfo.Value.ElapsedTimeForMovement = 0; if (IsInWorld) { AreaTriggerRePath reshape = new AreaTriggerRePath(); reshape.TriggerGUID = GetGUID(); reshape.AreaTriggerCircularMovement = _circularMovementInfo; SendMessageToSet(reshape, true); } }
void InitOrbit(AreaTriggerOrbitInfo cmi, uint timeToTarget) { // Circular movement requires either a center position or an attached unit Cypher.Assert(cmi.Center.HasValue || cmi.PathTarget.HasValue); // should be sent in object create packets only SetUpdateFieldValue(m_values.ModifyValue(m_areaTriggerData).ModifyValue(m_areaTriggerData.TimeToTarget), timeToTarget); m_areaTriggerData.ClearChanged(m_areaTriggerData.TimeToTarget); _orbitInfo.Set(cmi); _orbitInfo.Value.TimeToTarget = timeToTarget; _orbitInfo.Value.ElapsedTimeForMovement = 0; if (IsInWorld) { AreaTriggerRePath reshape = new AreaTriggerRePath(); reshape.TriggerGUID = GetGUID(); reshape.AreaTriggerOrbit = _orbitInfo; SendMessageToSet(reshape, true); } }