Example #1
0
        // Token: 0x06009AEB RID: 39659 RVA: 0x00350290 File Offset: 0x0034E490
        public override bool Run()
        {
            try
            {
                /*
                 * this.mSituation = (ServiceSituation.FindServiceSituationInvolving(this.Actor) as GrimReaperSituation);
                 * //this.mSituation.AddRelationshipWithEverySimInHousehold();
                 * this.Actor.SetPosition(this.mSituation.Lot.Position);
                 * this.mSituation.ScaredReactionBroadcaster = new ReactionBroadcaster(this.Actor, GrimReaperSituation.ScaredParams, new ReactionBroadcaster.BroadcastCallback(GrimReaperSituation.ScaredDelegate));
                 * try
                 * {
                 *  Sim sim = Target;
                 *  if (sim != null)
                 *  {
                 *      Matrix44 transform = sim.Transform;
                 *      Matrix44 invalid = Matrix44.Invalid;
                 *      Vector3 position = Actor.Position;
                 *      float num = (this.Actor.Position - sim.Position).LengthSqr();
                 *      if (num < 0.25f || num > 4f)
                 *      {
                 *          double @double = RandomUtil.GetDouble(6.2831853071795862);
                 *          position = sim.Position + new Vector3((float)Math.Sin(@double), 0f, (float)Math.Cos(@double));
                 *      }
                 *      this.Actor.SetForward(sim.PositionOnFloor - this.Actor.PositionOnFloor);
                 *      this.Actor.SetForward(new Vector3(this.Actor.ForwardVector.x, 0f, this.Actor.ForwardVector.z));
                 *      SimDescription.DeathType deathStyle = sim.SimDescription.DeathStyle;
                 *  }
                 * }
                 * catch (Exception exception)
                 * {
                 *  NiecException.PrintMessage("1a" + exception.Message + NiecException.NewLine + exception.StackTrace);
                 * }
                 *
                 * this.Actor.GreetSimOnLot(this.mSituation.Worker.LotCurrent);
                 * try
                 * {
                 *  this.mSituation.SMCDeath = StateMachineClient.Acquire(this.Actor, "Death");
                 *  this.mSituation.SMCDeath.SetActor("x", this.Actor);
                 *  this.mSituation.SMCDeath.EnterState("x", "Enter");
                 *  this.mSituation.SMCDeath.AddOneShotScriptEventHandler(666u, new SacsEventHandler(this.EventCallbackFadeInReaper));
                 *  this.mSituation.StartGrimReaperSmoke();
                 *  this.mSituation.SMCDeath.RequestState("x", "Float");
                 *  this.Actor.Posture = new SimCarryingObjectPosture(this.Actor, null);
                 *  this.mWasMemberOfActiveHousehold = (this.Target.Household == Household.ActiveHousehold);
                 *  if (this.Target.DeathReactionBroadcast == null)
                 *  {
                 *      Urnstone.CreateDeathReactionBroadcaster(this.Target);
                 *  }
                 * }
                 * catch (Exception exception)
                 * {
                 *  NiecException.PrintMessage("2" + exception.Message + NiecException.NewLine + exception.StackTrace);
                 * }
                 * try
                 * {
                 *  this.Actor.SynchronizationLevel = Sim.SyncLevel.NotStarted;
                 *  this.Target.SynchronizationLevel = Sim.SyncLevel.NotStarted;
                 *  this.mDeadSimsHousehold = this.Target.Household;
                 *  this.mSMCDeath = this.mSituation.SMCDeath;
                 *  ThoughtBalloonManager.BalloonData balloonData = new ThoughtBalloonManager.DoubleBalloonData("moodlet_mourning", this.Target.GetThoughtBalloonThumbnailKey());
                 *  balloonData.BalloonType = ThoughtBalloonTypes.kSpeechBalloon;
                 *  balloonData.mPriority = ThoughtBalloonPriority.High;
                 *  this.Actor.ThoughtBalloonManager.ShowBalloon(balloonData);
                 * }
                 * catch (Exception exception)
                 * {
                 *  NiecException.PrintMessage("3" + exception.Message + NiecException.NewLine + exception.StackTrace);
                 * }
                 * try
                 * {
                 *  var killSim = this.Target.CurrentInteraction as ExtKillSimNiec;
                 *  if (killSim != null)
                 *  {
                 *      killSim.StartDeathEffect();
                 *  }
                 *  Audio.StartSound("sting_death", this.Actor.Position);
                 *  this.mSMCDeath.RequestState("x", "take_sim");
                 *  this.mSMCDeath.RequestState("x", "Exit");
                 *  this.Target.FadeOut();
                 *  this.FinalizeDeath();
                 *  this.GrimReaperPostSequenceCleanup();
                 *  this.Target.StartOneShotFunction(new Sims3.Gameplay.Function(this.ReapSoulCallback), GameObject.OneShotFunctionDisposeFlag.OnDispose);
                 * }
                 * catch (Exception exception)
                 * {
                 *  NiecException.PrintMessage("4" + exception.Message + NiecException.NewLine + exception.StackTrace);
                 * }
                 * return true;
                 */
                //var grimReaperSituation = ServiceSituation.FindServiceSituationInvolving as ;
                //grimReaperSituation.AddRelationshipWithEverySimInHousehold();

                //grimReaperSituation.ScaredReactionBroadcaster = new ReactionBroadcaster(this.Actor, GrimReaperSituation.ScaredParams, new ReactionBroadcaster.BroadcastCallback(GrimReaperSituation.ScaredDelegate));

                this.Actor.SetPosition(Actor.Position);

                SimDescription.DeathType deathType = SimDescription.DeathType.Drown;

                try
                {
                    Sim sim = FindClosestDeadSim();
                    if (sim != null)
                    {
                        Vector3 position = Vector3.Invalid;
                        World.FindGoodLocationParams fglParams = new World.FindGoodLocationParams(sim.Position);
                        Vector3 vector;
                        if (!GlobalFunctions.FindGoodLocation(this.Actor, fglParams, out position, out vector))
                        {
                            position = fglParams.StartPosition;
                        }
                        this.Actor.SetPosition(position);
                        this.Actor.RouteTurnToFace(sim.Position);
                        deathType = sim.SimDescription.DeathStyle;
                    }
                }
                catch (Exception exception)
                {
                    NiecException.PrintMessage("SAE" + exception.Message + NiecException.NewLine + exception.StackTrace);
                }

                //this.Actor.GreetSimOnLot(grimReaperSituation.Worker.LotCurrent);
                SMCDeath = StateMachineClient.Acquire(this.Actor, "DeathSequence");
                SMCDeath.SetActor("x", this.Actor);
                SMCDeath.EnterState("x", "Enter");
                Urnstone.FogEffectTurnAllOn(Actor.LotCurrent);
                VisualEffect visualEffect = Urnstone.ReaperApperEffect(this.Actor, deathType);
                visualEffect.Start();
                //grimReaperSituation.StartGrimReaperSmoke();
                VisualEffect.FireOneShotEffect("reaperSmokeConstant", Actor, Sim.FXJoints.Pelvis, VisualEffect.TransitionType.HardTransition);

                SMCDeath.AddOneShotScriptEventHandler(666u, new SacsEventHandler(this.EventCallbackFadeInReaper));
                SMCDeath.RequestState("x", "ReaperBrushingHimself");
                visualEffect.Stop();
                ReaperLoop = new ObjectSound(this.Actor.ObjectId, "death_reaper_lp");
                ReaperLoop.Start(true);
                this.Actor.Posture = new SimCarryingObjectPosture(this.Actor, null);
                return(true);
            }
            catch (Exception exception)
            {
                NiecException.PrintMessage("ASF" + exception.Message + NiecException.NewLine + exception.StackTrace);
                return(true);
            }
        }