public override bool Run()
        {
            try
            {
                string str;
                mTimeTravelDef = InteractionDefinition as Definition;
                if (!Target.RouteToMachine(Actor, false, null))
                {
                    return(false);
                }

                List <Sim> lazyList = new List <Sim>();
                if (!TimePortalTravelWithEx.PreTimeTravel1(this, this, lazyList))
                {
                    return(false);
                }

                if (!TimePortalTravelWithEx.PreTimeTravel2(this, lazyList))
                {
                    return(false);
                }

                Actor.SimDescription.Contactable = false;
                EnterStateMachine("TimeMachine", "Enter", "x");
                SetActor("timeMachine", Target);
                SetParameter("isFuture", mTimeTravelDef.TimePeriod == TimeMachine.TravelTimePeriod.Future);
                AddOneShotScriptEventHandler(0x3ee, OnEnterAnimationEvent);
                AddOneShotScriptEventHandler(0x66, ToggleHiddenAnimationEvent);
                AnimateSim("GetIn");
                Target.EnableRoutingFootprint(Actor);

                mTimeTravelAlarm = AlarmManager.Global.AddAlarmRepeating(RandomUtil.GetFloat(TimeMachine.kMinutesBetweenAdventureTNSMin, TimeMachine.kMinutesBetweenAdventureTNSMax), TimeUnit.Minutes, new AlarmTimerCallback(TimeTravelCallback), RandomUtil.GetFloat(TimeMachine.kMinutesBetweenAdventureTNSMin, TimeMachine.kMinutesBetweenAdventureTNSMax), TimeUnit.Minutes, "Time Travel Alarm For:" + Actor.SimDescription.FullName, AlarmType.AlwaysPersisted, Actor);
                Target.SetMaterial("InUse");

                bool succeeded = true;
                if (!GameUtils.IsFutureWorld())
                {
                    // Custom
                    succeeded = TimePortalEx.TravelToFuture(null, Actor, new List <Sim>(mFollowerGroup), new List <ulong>(mFollowerGroupIDs));
                }

                if (succeeded)
                {
                    foreach (Sim sim7 in lazyList)
                    {
                        Skill futureSkill = sim7.SkillManager.GetElement(SkillNames.Future);
                        if (futureSkill != null)
                        {
                            futureSkill.AddPoints(TimePortalTravelWithEx.kFollowerFutureSkillPointGain, true, false);
                        }
                    }
                }

                succeeded = DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));

                EndCommodityUpdates(succeeded);
                Target.PickExitStateAndSound(mTimeTravelDef.TimePeriod, out str, out mExitSound);
                AddOneShotScriptEventHandler(0x3e9, OnExitAnimationEvent);
                AddOneShotScriptEventHandler(0x3ef, OnExitAnimationEvent);
                AddOneShotScriptEventHandler(0x67, ToggleHiddenAnimationEvent);
                AnimateSim(str);

                Target.SetMaterial("default");
                AnimateSim("Exit");
                if (!string.IsNullOrEmpty(mTravelSummary))
                {
                    Actor.ShowTNSIfSelectable(mTravelSummary, StyledNotification.NotificationStyle.kGameMessagePositive, Target.ObjectId, Actor.ObjectId);
                }

                StandardExit();
                Target.Repairable.UpdateBreakage(Actor);
                InventingSkill skill = Actor.SkillManager.GetSkill <InventingSkill>(SkillNames.Inventing);
                if (succeeded && (skill != null))
                {
                    skill.RegisterTimeTravelDone();
                }

                if (GameUtils.IsFutureWorld())
                {
                    // Custom
                    GameStatesEx.UpdateTelemetryAndTriggerTravelBackToHomeWorld();

                    TimePortalTravelWithEx.SendEventForActorAndFollowers(Actor, lazyList, EventTypeId.kTravelToPresent);
                }

                return(succeeded);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
            finally
            {
                TravelUtil.PlayerMadeTravelRequest = false;
            }
        }
        public override bool Run()
        {
            try
            {
                Target.mRoutingSims.Add(Actor);
                if (!Target.RouteToPortal(Actor))
                {
                    Actor.AddExitReason(ExitReason.RouteFailed);
                    Target.mRoutingSims.Remove(Actor);
                    return(false);
                }

                Target.mRoutingSims.Remove(Actor);

                List <Sim> lazyList = new List <Sim>();
                if (!TimePortalTravelWithEx.PreTimeTravel1(this, this, lazyList))
                {
                    return(false);
                }

                mTargetPortal = Target;

                mTargetPortal.AddToUseList(Actor);

                if (!TimePortalTravelWithEx.PreTimeTravel2(this, lazyList))
                {
                    return(false);
                }

                mTargetPortal.EnableFootprint(FootprintPlacementHash);
                mTargetPortal.PushSimsFromFootprint(FootprintPlacementHash, Actor, null, false);
                EnterStateMachine("AncientPortal", "Enter", "x", "portal");

                AddOneShotScriptEventHandler(0x65, HideSim);
                AddOneShotScriptEventHandler(0x66, ShowSim);
                AnimateSim("InsidePortal");

                SetActor("portal", mTargetPortal);

                bool succeeded = true;
                if (!GameUtils.IsFutureWorld())
                {
                    // Custom
                    succeeded = TimePortalEx.TravelToFuture(null, Actor, new List <Sim>(mFollowerGroup), new List <ulong>(mFollowerGroupIDs));
                }

                if (succeeded)
                {
                    foreach (Sim sim7 in lazyList)
                    {
                        Skill futureSkill = sim7.SkillManager.GetElement(SkillNames.Future);
                        if (futureSkill != null)
                        {
                            futureSkill.AddPoints(TimePortalTravelWithEx.kFollowerFutureSkillPointGain, true, false);
                        }
                    }
                }

                Slot    slotName       = mTargetPortal.GetRoutingSlots()[0x0];
                Vector3 positionOfSlot = mTargetPortal.GetPositionOfSlot(slotName);
                Vector3 forwardOfSlot  = mTargetPortal.GetForwardOfSlot(slotName);
                Actor.SetPosition(positionOfSlot);
                Actor.SetForward(forwardOfSlot);
                mTargetPortal.DisableFootprint(FootprintPlacementHash);

                AnimateSim("Exit");

                for (int i = 0x0; i < kPotentialTravelBuffs.Length; i++)
                {
                    if (RandomUtil.RandomChance(kChanceForEachBuff))
                    {
                        Actor.BuffManager.AddElement(kPotentialTravelBuffs[i], Origin.FromAncientPortal);
                    }
                }

                EndCommodityUpdates(succeeded);
                StandardExit();
                mTargetPortal.RemoveFromUseList(Actor);

                Actor.Wander(1f, 2f, false, RouteDistancePreference.PreferNearestToRouteOrigin, false);

                if (GameUtils.IsFutureWorld())
                {
                    // Custom
                    GameStatesEx.UpdateTelemetryAndTriggerTravelBackToHomeWorld();

                    TimePortalTravelWithEx.SendEventForActorAndFollowers(Actor, lazyList, EventTypeId.kTravelToPresent);
                }

                return(succeeded);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
            finally
            {
                TravelUtil.PlayerMadeTravelRequest = false;
            }
        }