Ejemplo n.º 1
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            try
            {
                if (mRequirement.mCareerSim != null)
                {
                    AcquireOccupationParameters parameters = new AcquireOccupationParameters(mRequirement.CareerLoc, false, false);
                    parameters.JumpStartJob   = true;
                    parameters.JumpStartLevel = mRequirement.CareerLevel.NextLevels[0];

                    Sim.AcquireOccupation(parameters);
                }
            }
            catch (Exception e)
            {
                Common.DebugException(Sim, e);
                return(false);
            }

            if (mRequirement.mCareerSim == null)
            {
                Add(frame, new FindJobScenario(Sim, true, false), ScenarioResult.Start);

                mCareerSim = null;
            }
            else
            {
                if (Sim.Occupation != null)
                {
                    foreach (KeyValuePair <uint, DreamNodeInstance> instance in DreamsAndPromisesManager.sMajorWishes)
                    {
                        if (instance.Value.InputSubject == null)
                        {
                            continue;
                        }

                        if (instance.Value.InputSubject.mType != DreamNodePrimitive.InputSubjectType.Career)
                        {
                            continue;
                        }

                        OccupationNames career = (OccupationNames)instance.Value.InputSubject.EnumValue;
                        if (career != Sim.Occupation.Guid)
                        {
                            continue;
                        }

                        Sim.LifetimeWish = instance.Key;
                        break;
                    }
                }

                Add(frame, new CareerChangedScenario(Sim), ScenarioResult.Start);

                mRequirement.mCareerSim = null;
            }

            return(true);
        }
Ejemplo n.º 2
0
            public override bool Perform(SimDescription me, bool applyAll)
            {
                Occupation job        = me.Occupation;
                Occupation retiredJob = me.CareerManager.mRetiredCareer;

                me.CareerManager.mRetiredCareer = null;

                Occupation staticCareer = CareerManager.GetStaticOccupation(mCareer.Guid);

                if (staticCareer is School)
                {
                    me.CareerManager.mJob = null;
                }

                int originaHighest = 0;

                try
                {
                    if (mLocation != null)
                    {
                        AcquireOccupationParameters parameters = new AcquireOccupationParameters(mLocation, false, false);
                        parameters.ForceAutomaticChange = applyAll;

                        me.CareerManager.AcquireOccupation(parameters);
                    }
                    else
                    {
                        if (mCareer.Guid == OccupationNames.Firefighter)
                        {
                            ActiveCareerStaticData activeCareerStaticData = ActiveCareer.GetActiveCareerStaticData(OccupationNames.Firefighter);

                            originaHighest = activeCareerStaticData.HighestLevel;

                            // Required to bypass auto promotion in SetAttributesForNewJob
                            activeCareerStaticData.HighestLevel = 1;
                        }

                        AcquireOccupation(me.CareerManager, new AcquireOccupationParameters(mCareer.Guid, false, false), !applyAll);
                    }
                }
                finally
                {
                    me.CareerManager.mRetiredCareer = retiredJob;

                    if (me.CareerManager.mJob == null)
                    {
                        me.CareerManager.mJob = job;
                    }

                    if (mCareer.Guid == OccupationNames.Firefighter)
                    {
                        ActiveCareerStaticData activeCareerStaticData = ActiveCareer.GetActiveCareerStaticData(OccupationNames.Firefighter);
                        activeCareerStaticData.HighestLevel = originaHighest;
                    }
                }

                return(true);
            }
Ejemplo n.º 3
0
        protected bool AcquireOccupation(CareerManager ths, AcquireOccupationParameters occupationParameters)
        {
            Occupation occupation;

            Sim createdSim = ths.mSimDescription.CreatedSim;

            CareerLocation  location   = occupationParameters.Location;
            OccupationNames newJobGuid = occupationParameters.TargetJob;

            if ((ths.mJob != null) && (location != null) && (ths.mJob.Guid == location.Career.Guid) && (ths.mJob.CareerLoc != location))
            {
                Career mJob = ths.mJob as Career;
                if ((mJob != null) && (mJob.TransferBetweenCareerLocations(location, false)))
                {
                    IncStat("Transferred");
                    return(true);
                }
            }

            if (!ths.TryGetNewCareer(newJobGuid, out occupation))
            {
                IncStat("TryGetNewCareer Fail");
                return(false);
            }

            if (ths.mJob != null)
            {
                if (createdSim != null)
                {
                    EventTracker.SendEvent(new TransferCareerEvent(createdSim, ths.mJob, occupation));
                }
                ths.mJob.LeaveJob(false, Career.LeaveJobReason.kTransfered);
            }

            EventTracker.SendEvent(EventTypeId.kCareerNewJob, createdSim);
            occupation.OwnerDescription        = ths.mSimDescription;
            occupation.mDateHired              = SimClock.CurrentTime();
            occupation.mAgeWhenJobFirstStarted = ths.mSimDescription.Age;
            occupation.SetAttributesForNewJob(location, occupationParameters.LotId, occupationParameters.CharacterImportRequest);
            EventTracker.SendEvent(new CareerEvent(EventTypeId.kEventCareerHired, occupation));
            EventTracker.SendEvent(new CareerEvent(EventTypeId.kEventCareerChanged, occupation));
            EventTracker.SendEvent(new CareerEvent(EventTypeId.kCareerDataChanged, occupation));
            occupation.RefreshMapTagForOccupation();
            ths.UpdateCareerUI();

            if ((createdSim != null) && createdSim.IsActiveSim)
            {
                HudController.SetInfoState(InfoState.Career);
            }

            IncStat("Job Acquired " + occupation.Guid);
            return(true);
        }
Ejemplo n.º 4
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            try
            {
                if (mRequirement.mCareerSim != null)
                {
                    AcquireOccupationParameters parameters = new AcquireOccupationParameters(mRequirement.CareerLoc, false, false);
                    parameters.JumpStartJob = true;
                    parameters.JumpStartLevel = mRequirement.CareerLevel.NextLevels[0];

                    Sim.AcquireOccupation(parameters);
                }
            }
            catch (Exception e)
            {
                Common.DebugException(Sim, e);
                return false;
            }

            if (mRequirement.mCareerSim == null)
            {
                Add(frame, new FindJobScenario(Sim, true, false), ScenarioResult.Start);

                mCareerSim = null;
            }
            else
            {
                if (Sim.Occupation != null)
                {
                    foreach (KeyValuePair<uint, DreamNodeInstance> instance in DreamsAndPromisesManager.sMajorWishes)
                    {
                        if (instance.Value.InputSubject == null) continue;

                        if (instance.Value.InputSubject.mType != DreamNodePrimitive.InputSubjectType.Career) continue;

                        OccupationNames career = (OccupationNames)instance.Value.InputSubject.EnumValue;
                        if (career != Sim.Occupation.Guid) continue;

                        Sim.LifetimeWish = instance.Key;
                        break;
                    }
                }

                Add(frame, new CareerChangedScenario(Sim), ScenarioResult.Start);

                mRequirement.mCareerSim = null;
            }

            return true;
        }
Ejemplo n.º 5
0
        public override bool InRabbitHole()
        {
            try
            {
                OpportunityDialog.MaptagObjectInfo info;
                if (!UIUtils.IsOkayToStartModalDialog() || !Sims3.Gameplay.ActiveCareer.ActiveCareer.CanAddActiveCareer(Actor.SimDescription, CareerToSet))
                {
                    return(false);
                }

                SkillBasedCareerStaticData occupationStaticData = Occupation.GetOccupationStaticData(CareerToSet) as SkillBasedCareerStaticData;
                Occupation staticOccupation    = CareerManager.GetStaticOccupation(CareerToSet);
                string     localizedCareerName = Occupation.GetLocalizedCareerName(CareerToSet, Actor.SimDescription);
                string     description         = Common.LocalizeEAString(Actor.IsFemale, occupationStaticData.CareerDescriptionLocalizationKey, new object[0x0]);
                string     reward = string.Empty;
                foreach (string str4 in staticOccupation.ResponsibilitiesLocalizationKeys)
                {
                    reward = reward + Common.LocalizeEAString(Actor.IsFemale, str4, new object[0x0]) + Common.NewLine;
                }
                info.mLotId          = 0x0L;
                info.mMapTag         = null;
                info.mObjectGuid     = ObjectGuid.InvalidObjectGuid;
                info.mHouseholdLotId = ulong.MaxValue;
                bool flag = OpportunityDialog.Show(ThumbnailKey.kInvalidThumbnailKey, Actor.ObjectId, ObjectGuid.InvalidObjectGuid, Actor.Name, OpportunityDialog.OpportunityType.SkillBasedCareer, localizedCareerName, description, string.Empty, reward, info, true, OpportunityDialog.DescriptionBackgroundType.NotSet, Actor.IsFemale, false);
                if (flag)
                {
                    AcquireOccupationParameters occupationParameters = new AcquireOccupationParameters(CareerToSet, true, false);

                    OmniCareer tempCareer = new OmniCareer();
                    tempCareer.mCareerGuid = staticOccupation.Guid;

                    occupationParameters.Location        = new CareerLocation();
                    occupationParameters.Location.Career = tempCareer;

                    return(Actor.AcquireOccupation(occupationParameters));
                }
                return(flag);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
Ejemplo n.º 6
0
        public static Sim CreateAnNPCPerformer(ShowStage ths)
        {
            Sim createdSim = null;
            Lot lotCurrent = null;

            OccupationNames[]           randomList           = new OccupationNames[] { OccupationNames.SingerCareer, OccupationNames.MagicianCareer, OccupationNames.PerformanceArtistCareer };
            AcquireOccupationParameters occupationParameters = new AcquireOccupationParameters(RandomUtil.GetRandomObjectFromList(randomList), false, true);
            bool flag = RandomUtil.CoinFlip();

            // Custom
            List <SimDescription> list = Household.AllTownieSimDescriptions(ValidPerformer);

            if (list.Count != 0)
            {
                SimDescription randomObjectFromList = RandomUtil.GetRandomObjectFromList(list);
                if (randomObjectFromList.CreatedSim == null)
                {
                    lotCurrent = ths.LotCurrent;
                    createdSim = randomObjectFromList.Instantiate(lotCurrent);
                }
                else
                {
                    createdSim = randomObjectFromList.CreatedSim;
                }
            }
            else
            {
                Sim servicePerformer = CreateServicePerformer(ths);
                if (servicePerformer != null)
                {
                    createdSim = servicePerformer;
                }
            }

            if (createdSim == null)
            {
                return(null);
            }

            GoToLot interaction = GoToLot.Singleton.CreateInstanceWithCallbacks(ths.LotCurrent, createdSim, new InteractionPriority(InteractionPriorityLevel.CriticalNPCBehavior), false, true, null, new Callback(GoToLotSuccess), new Callback(GoToLotFailure)) as GoToLot;

            if (createdSim.InteractionQueue != null)
            {
                Common.DebugNotify("Pushing GoToLot on " + createdSim.FullName);
                createdSim.InteractionQueue.Add(interaction);
            }

            if (createdSim.CareerManager == null)
            {
                return(null);
            }

            if (createdSim.CareerManager.OccupationAsPerformanceCareer == null)
            {
                try
                {
                    if (createdSim.WasCreatedByAService)
                    {
                        switch (createdSim.Service.ServiceType)
                        {
                        case ServiceType.Magician:
                            occupationParameters = new AcquireOccupationParameters(OccupationNames.MagicianCareer, false, true);
                            break;

                        case ServiceType.Singer:
                            occupationParameters = new AcquireOccupationParameters(OccupationNames.SingerCareer, false, true);
                            break;

                        case ServiceType.PerformanceArtist:
                            occupationParameters = new AcquireOccupationParameters(OccupationNames.PerformanceArtistCareer, false, true);
                            break;

                        default:
                            break;
                        }
                    }

                    createdSim.AcquireOccupation(occupationParameters);

                    int num = flag ? RandomUtil.GetInt(0x0, 0x5) : RandomUtil.GetInt(0x5, createdSim.Occupation.HighestLevel);
                    for (int i = 0x1; i < num; i++)
                    {
                        createdSim.CareerManager.Occupation.PromoteSim();
                    }
                }
                catch (ResetException)
                {
                    throw;
                }
                catch (Exception e)
                {
                    Common.Exception(createdSim, e);
                    return(null);
                }
            }
            return(createdSim);
        }
Ejemplo n.º 7
0
        protected static bool AcquireOccupation(CareerManager ths, AcquireOccupationParameters occupationParameters, bool prompt)
        {
            CareerLocation  location   = occupationParameters.Location;
            OccupationNames newJobGuid = occupationParameters.TargetJob;

            if ((ths.mJob != null) && (location != null) && (ths.mJob.Guid == location.Career.Guid) && (ths.mJob.CareerLoc != location))
            {
                Career mJob = ths.mJob as Career;
                return((mJob != null) && mJob.TransferBetweenCareerLocations(location, false));
            }

            Occupation occupation = null;

            if (!ths.TryGetNewCareer(newJobGuid, out occupation))
            {
                return(false);
            }

            if (occupation is Career)
            {
                if (location == null)
                {
                    return(false);
                }
            }

            Sim createdSim = ths.mSimDescription.CreatedSim;

            if (ths.mJob != null)
            {
                if (prompt)
                {
                    string newJobName = string.Empty;
                    if (!occupation.TryDisplayingGetHiredUi(location, ref occupationParameters, out newJobName))
                    {
                        return(false);
                    }

                    if (!Occupation.ShowYesNoCareerOptionDialog(Common.LocalizeEAString(ths.mSimDescription.IsFemale, "Gameplay/Careers/Career:ConfirmLeavingOldCareer", new object[] { ths.mSimDescription, occupation.CareerName, ths.mJob.CareerName })))
                    {
                        return(false);
                    }
                }

                if (createdSim != null)
                {
                    EventTracker.SendEvent(new TransferCareerEvent(createdSim, ths.mJob, occupation));
                }
                ths.mJob.LeaveJob(false, Career.LeaveJobReason.kTransfered);
            }

            if (newJobGuid == OccupationNames.AcademicCareer)
            {
                AcademicCareer.EnrollSimInAcademicCareer(ths.mSimDescription, ths.DegreeManager.EnrollmentAcademicDegreeName, ths.DegreeManager.EnrollmentCouseLoad);
            }
            else
            {
                EventTracker.SendEvent(EventTypeId.kCareerNewJob, createdSim);
                occupation.OwnerDescription        = ths.mSimDescription;
                occupation.mDateHired              = SimClock.CurrentTime();
                occupation.mAgeWhenJobFirstStarted = ths.mSimDescription.Age;

                occupation.SetAttributesForNewJob(location, occupationParameters.LotId, occupationParameters.CharacterImportRequest);

                EventTracker.SendEvent(new CareerEvent(EventTypeId.kEventCareerHired, occupation));
                EventTracker.SendEvent(new CareerEvent(EventTypeId.kEventCareerChanged, occupation));
                EventTracker.SendEvent(new CareerEvent(EventTypeId.kCareerDataChanged, occupation));
            }

            occupation.RefreshMapTagForOccupation();
            ths.UpdateCareerUI();

            if ((createdSim != null) && createdSim.IsActiveSim)
            {
                HudController.SetInfoState(InfoState.Career);
            }

            return(true);
        }
Ejemplo n.º 8
0
        protected static bool AcquireOccupation(CareerManager ths, AcquireOccupationParameters occupationParameters, bool prompt)
        {
            CareerLocation location = occupationParameters.Location;
            OccupationNames newJobGuid = occupationParameters.TargetJob;

            if ((ths.mJob != null) && (location != null) && (ths.mJob.Guid == location.Career.Guid) && (ths.mJob.CareerLoc != location))
            {
                Career mJob = ths.mJob as Career;
                return ((mJob != null) && mJob.TransferBetweenCareerLocations(location, false));
            }

            Occupation occupation = null;
            if (!ths.TryGetNewCareer(newJobGuid, out occupation))
            {
                return false;
            }

            if (occupation is Career)
            {
                if (location == null) return false;
            }

            Sim createdSim = ths.mSimDescription.CreatedSim;

            if (ths.mJob != null)
            {
                if (prompt)
                {
                    string newJobName = string.Empty;
                    if (!occupation.TryDisplayingGetHiredUi(location, ref occupationParameters, out newJobName))
                    {
                        return false;
                    }

                    if (!Occupation.ShowYesNoCareerOptionDialog(Common.LocalizeEAString(ths.mSimDescription.IsFemale, "Gameplay/Careers/Career:ConfirmLeavingOldCareer", new object[] { ths.mSimDescription, occupation.CareerName, ths.mJob.CareerName })))
                    {
                        return false;
                    }
                }

                if (createdSim != null)
                {
                    EventTracker.SendEvent(new TransferCareerEvent(createdSim, ths.mJob, occupation));
                }
                ths.mJob.LeaveJob(false, Career.LeaveJobReason.kTransfered);
            }

            if (newJobGuid == OccupationNames.AcademicCareer)
            {
                AcademicCareer.EnrollSimInAcademicCareer(ths.mSimDescription, ths.DegreeManager.EnrollmentAcademicDegreeName, ths.DegreeManager.EnrollmentCouseLoad);
            }
            else
            {
                EventTracker.SendEvent(EventTypeId.kCareerNewJob, createdSim);
                occupation.OwnerDescription = ths.mSimDescription;
                occupation.mDateHired = SimClock.CurrentTime();
                occupation.mAgeWhenJobFirstStarted = ths.mSimDescription.Age;

                occupation.SetAttributesForNewJob(location, occupationParameters.LotId, occupationParameters.CharacterImportRequest);

                EventTracker.SendEvent(new CareerEvent(EventTypeId.kEventCareerHired, occupation));
                EventTracker.SendEvent(new CareerEvent(EventTypeId.kEventCareerChanged, occupation));
                EventTracker.SendEvent(new CareerEvent(EventTypeId.kCareerDataChanged, occupation));
            }

            occupation.RefreshMapTagForOccupation();
            ths.UpdateCareerUI();

            if ((createdSim != null) && createdSim.IsActiveSim)
            {
                HudController.SetInfoState(InfoState.Career);
            }

            return true;
        }
Ejemplo n.º 9
0
            public override bool Perform(SimDescription me, bool applyAll)
            {
                Occupation job = me.Occupation;
                Occupation retiredJob = me.CareerManager.mRetiredCareer;

                me.CareerManager.mRetiredCareer = null;

                Occupation staticCareer = CareerManager.GetStaticOccupation(mCareer.Guid);
                if (staticCareer is School)
                {
                    me.CareerManager.mJob = null;
                }

                int originaHighest = 0;

                try
                {
                    if (mLocation != null)
                    {
                        AcquireOccupationParameters parameters = new AcquireOccupationParameters(mLocation, false, false);
                        parameters.ForceAutomaticChange = applyAll;

                        me.CareerManager.AcquireOccupation(parameters);
                    }
                    else
                    {
                        if (mCareer.Guid == OccupationNames.Firefighter)
                        {
                            ActiveCareerStaticData activeCareerStaticData = ActiveCareer.GetActiveCareerStaticData(OccupationNames.Firefighter);

                            originaHighest = activeCareerStaticData.HighestLevel;

                            // Required to bypass auto promotion in SetAttributesForNewJob
                            activeCareerStaticData.HighestLevel = 1;
                        }

                        AcquireOccupation(me.CareerManager, new AcquireOccupationParameters(mCareer.Guid, false, false), !applyAll);
                    }
                }
                finally
                {
                    me.CareerManager.mRetiredCareer = retiredJob;

                    if (me.CareerManager.mJob == null)
                    {
                        me.CareerManager.mJob = job;
                    }

                    if (mCareer.Guid == OccupationNames.Firefighter)
                    {
                        ActiveCareerStaticData activeCareerStaticData = ActiveCareer.GetActiveCareerStaticData(OccupationNames.Firefighter);
                        activeCareerStaticData.HighestLevel = originaHighest;
                    }
                }

                return true;
            }
Ejemplo n.º 10
0
        protected bool AskForJob(SimDescription sim, Occupation occupation)
        {
            if ((sim.Occupation != null) && (sim.Occupation.Guid == occupation.Guid))
            {
                IncStat("Same Job");
                return(false);
            }

            Career career = occupation as Career;

            if (career != null)
            {
                if (!career.CareerAgeTest(sim))
                {
                    IncStat("Wrong Age");
                    return(false);
                }
            }

            if (!Careers.TestCareer(this, Sim, occupation.Guid))
            {
                IncStat("User Disallow " + occupation.CareerName);
                return(false);
            }

            AcquireOccupationParameters parameters;

            if (occupation is Career)
            {
                CareerLocation location = Career.FindClosestCareerLocation(sim, occupation.Guid);
                if (location == null)
                {
                    IncStat("No Location " + occupation.CareerName);
                    return(false);
                }
                else if (!AllowStandalone(location))
                {
                    IncStat("Standalone " + occupation.CareerName);
                    return(false);
                }
                else
                {
                    parameters = new AcquireOccupationParameters(location, false, false);
                }
            }
            else
            {
                parameters = new AcquireOccupationParameters(occupation.Guid, false, false);
            }

            try
            {
                if (sim.Occupation != null)
                {
                    if (sim.Occupation.Guid == occupation.Guid)
                    {
                        IncStat("Already In Job");
                        return(true);
                    }

                    if (sim.Occupation.CareerLoc != null)
                    {
                        foreach (SimDescription worker in sim.Occupation.CareerLoc.Workers)
                        {
                            if (worker.Occupation == null)
                            {
                                continue;
                            }

                            if (worker.Occupation.Coworkers == null)
                            {
                                worker.Occupation.Coworkers = new List <SimDescription>();
                            }
                        }
                    }

                    sim.Occupation.LeaveJobNow(Career.LeaveJobReason.kQuit);
                }

                Occupation retiredCareer = sim.CareerManager.mRetiredCareer;
                sim.CareerManager.mRetiredCareer = null;

                int originaHighest = 0;
                try
                {
                    if (occupation is ActiveFireFighter)
                    {
                        ActiveCareerStaticData activeCareerStaticData = ActiveCareer.GetActiveCareerStaticData(OccupationNames.Firefighter);

                        originaHighest = activeCareerStaticData.HighestLevel;

                        // Required to bypass auto promotion in SetAttributesForNewJob
                        activeCareerStaticData.HighestLevel = 1;
                    }

                    if (occupation is XpBasedCareer)
                    {
                        // Required by Stylist.GetOccupationJoiningTnsTextPrefix()
                        if (!Sims.Instantiate(sim, sim.LotHome, false))
                        {
                            IncStat("Hibernating");
                            return(false);
                        }
                    }

                    if (AcquireOccupation(sim.CareerManager, parameters))
                    {
                        IncStat(occupation.Guid.ToString());
                        return(true);
                    }
                }
                finally
                {
                    sim.CareerManager.mRetiredCareer = retiredCareer;

                    if (occupation is ActiveFireFighter)
                    {
                        ActiveCareerStaticData activeCareerStaticData = ActiveCareer.GetActiveCareerStaticData(OccupationNames.Firefighter);
                        activeCareerStaticData.HighestLevel = originaHighest;
                    }
                }
            }
            catch (Exception e)
            {
                Common.DebugException(sim, e);
            }

            IncStat("Core Failure");
            return(false);
        }
Ejemplo n.º 11
0
        public static Sim CreateAnNPCPerformer(ShowStage ths)
        {            
            Sim createdSim = null;
            Lot lotCurrent = null;
            OccupationNames[] randomList = new OccupationNames[] { OccupationNames.SingerCareer, OccupationNames.MagicianCareer, OccupationNames.PerformanceArtistCareer };
            AcquireOccupationParameters occupationParameters = new AcquireOccupationParameters(RandomUtil.GetRandomObjectFromList(randomList), false, true);
            bool flag = RandomUtil.CoinFlip();

            // Custom
            List<SimDescription> list = Household.AllTownieSimDescriptions(ValidPerformer);            
            if (list.Count != 0)
            {
                SimDescription randomObjectFromList = RandomUtil.GetRandomObjectFromList(list);
                if (randomObjectFromList.CreatedSim == null)
                {
                    lotCurrent = ths.LotCurrent;
                    createdSim = randomObjectFromList.Instantiate(lotCurrent);
                }
                else
                {
                    createdSim = randomObjectFromList.CreatedSim;
                }
            }
            else
            {
                Sim servicePerformer = CreateServicePerformer(ths);
                if (servicePerformer != null)
                {
                    createdSim = servicePerformer;                    
                }
            }

            if (createdSim == null)
            {
                return null;
            }

            GoToLot interaction = GoToLot.Singleton.CreateInstanceWithCallbacks(ths.LotCurrent, createdSim, new InteractionPriority(InteractionPriorityLevel.CriticalNPCBehavior), false, true, null, new Callback(GoToLotSuccess), new Callback(GoToLotFailure)) as GoToLot;
            if(createdSim.InteractionQueue != null)
            {
                Common.DebugNotify("Pushing GoToLot on " + createdSim.FullName);
                createdSim.InteractionQueue.Add(interaction);
            }

            if (createdSim.CareerManager == null)
            {                
                return null;
            }

            if (createdSim.CareerManager.OccupationAsPerformanceCareer == null)
            {
                try
                {
                    if (createdSim.WasCreatedByAService)
                    {                        
                        switch(createdSim.Service.ServiceType)
                        {
                            case ServiceType.Magician:
                                occupationParameters = new AcquireOccupationParameters(OccupationNames.MagicianCareer, false, true);
                                break;
                            case ServiceType.Singer:
                                occupationParameters = new AcquireOccupationParameters(OccupationNames.SingerCareer, false, true);
                                break;
                            case ServiceType.PerformanceArtist:
                                occupationParameters = new AcquireOccupationParameters(OccupationNames.PerformanceArtistCareer, false, true);
                                break;
                            default:
                                break;
                        }
                    }

                    createdSim.AcquireOccupation(occupationParameters);

                    int num = flag ? RandomUtil.GetInt(0x0, 0x5) : RandomUtil.GetInt(0x5, createdSim.Occupation.HighestLevel);
                    for (int i = 0x1; i < num; i++)
                    {
                        createdSim.CareerManager.Occupation.PromoteSim();
                    }
                }
                catch (ResetException)
                {
                    throw;
                }
                catch (Exception e)
                {
                    Common.Exception(createdSim, e);
                    return null;
                }
            }
            return createdSim;
        }