Exemplo n.º 1
0
        public override bool Run()
        {
            try
            {
                Target.AddExitReason(ExitReason.SuspensionRequested);
                NFinalizeDeath.ForceCancelAllInteractionsPro(Target);



                /*
                 * if (Target.InteractionQueue.HasInteractionOfType(Sims3.Gameplay.Objects.Environment.BonehildaCoffin.AwakenBonehilda.Singleton)) // Fixed Error Cancel All GrimReaperSituation.ReapSoul.Singleton
                 * {
                 *  SimpleMessageDialog.Show("NiecMod", "Cancel BonehildaCoffin.AwakenBonehilda.Singleton");
                 *  Target.SetObjectToReset();
                 *  NiecMod.Nra.SpeedTrap.Sleep();
                 *  return true;
                 * }
                 * if (Target.InteractionQueue.HasInteractionOfType(GrimReaperSituation.ReapSoul.Singleton)) // Fixed Error Cancel All GrimReaperSituation.ReapSoul.Singleton
                 * {
                 *  if (!AcceptCancelDialog.Show("Cancel Quit ReapSoul? Accept Reset ReapSoul")) return false;
                 *  //SimpleMessageDialog.Show("NiecS3Mod", " Sorry, Can't Cancel GrimReaperSituation.ReapSoul");
                 *  Target.SetObjectToReset();
                 *  NiecMod.Nra.SpeedTrap.Sleep();
                 *  return true;
                 * }
                 * if (!Target.HasBeenDestroyed && Simulator.CheckYieldingContext(false))
                 * {
                 *  NiecMod.Nra.SpeedTrap.Sleep();
                 *  if (AcceptCancelDialog.Show("Force Cancel All Interactions Without Cleanup?"))
                 *  {
                 *      NFinalizeDeath.ForceCancelAllInteractionsWithoutCleanup(Target);
                 *      Target.InteractionQueue.OnReset();
                 *      return true;
                 *  }
                 *  else if (!AcceptCancelDialog.Show("Cancel All Interactions?"))
                 *  {
                 *      this.FixExit = false;
                 *      return true;
                 *  }
                 *
                 *  try
                 *  {
                 *      foreach (InteractionInstance interactionInstance in Target.InteractionQueue.InteractionList) // Cant Cancel Fix
                 *      {
                 *          interactionInstance.MustRun = false;
                 *          interactionInstance.Hidden = false;
                 *      }
                 *  }
                 *  catch
                 *  { }
                 *  NFinalizeDeath.CancelAllInteractions(Target);
                 * }
                 *
                 * return true;
                 *
                 *
                 * /*
                 * //Custom CancelAllInteractions
                 * checked
                 * {
                 *  for (int i = Target.InteractionQueue.mInteractionList.Count - 1; i >= 0; i--)
                 *  {
                 *      if (!(Target.InteractionQueue.mInteractionList[i] is ExtKillSimNiec))
                 *      {
                 *          try
                 *          {
                 *              Target.InteractionQueue.CancelNthInteraction(i, true, ExitReason.SuspensionRequested);
                 *          }
                 *          catch
                 *          { }
                 *
                 *      }
                 *  }
                 * }
                 */



                /*
                 * for (int i = Target.InteractionQueue.mInteractionList.Count - 1; i >= 0; i--)
                 * {
                 *  try
                 *  {
                 *      InteractionInstance interactionInstance = Target.InteractionQueue.mInteractionList[i];
                 *      if (!(interactionInstance is ExtKillSimNiec))
                 *      {
                 *          Target.InteractionQueue.CancelNthInteraction(i);
                 *      }
                 *  }
                 *  catch (Exception)
                 *  {
                 *
                 *      throw;
                 *  }
                 *
                 * }
                 */
                /*
                 * try
                 * {
                 *  Target.InteractionQueue.OnReset();
                 * }
                 * catch
                 * { }
                 */


                /*
                 * // Test 1
                 * {
                 *  //try
                 *  //Target.InteractionQueue.OnReset();
                 *
                 * }
                 *
                 * {
                 *  Target.InteractionQueue.CancelAllInteractions(); // Cancel All Interactions Byasss Anti-Cancel
                 * }
                 *
                 * // Test 2
                 *
                 *
                 *
                 *
                 * // Test 3
                 * {
                 *  Target.InteractionQueue.OnReset(); // Sim Interactions is Reset
                 *  Target.InteractionQueue.CancelAllInteractions();
                 * }
                 * // Test 4
                 * {
                 *  Target.InteractionQueue.CancelAllInteractions(); // Cancel All Interactions Byasss Anti-Cancel
                 *  Target.InteractionQueue.OnReset();
                 * }
                 * foreach (InteractionInstance interactionInstance in Target.InteractionQueue.InteractionList) // Cant Cancel Fix
                 * {
                 *  interactionInstance.MustRun = false;
                 *  interactionInstance.Hidden = false;
                 * }
                 * {
                 *  Target.InteractionQueue.CancelAllInteractions();
                 * }
                 *
                 * {
                 *  Target.InteractionQueue.OnReset();
                 * }
                 *
                 * {
                 *  Target.InteractionQueue.CancelAllInteractions();
                 * }
                 *
                 * {
                 *  Target.InteractionQueue.CancelAllInteractions();
                 * }
                 * //
                 * {
                 *
                 *  if (Target.IsInActiveHousehold)
                 *  {
                 *      //Target.BuffManager.AddElement(BuffNames.HeartBroken, 60000, 6000000, Origin.FromGrimReaper);
                 *      return false;
                 *  }
                 *
                 *
                 *  Target.InteractionQueue.Add(Singleton.CreateInstance(Target, Target, new InteractionPriority((InteractionPriorityLevel)999), false, true));
                 *  Target.InteractionQueue.AddNext(Singleton.CreateInstance(Target, Target, new InteractionPriority((InteractionPriorityLevel)999), false, true));
                 *  Target.InteractionQueue.OnReset();
                 * }
                 * //Actor.LoopIdle();
                 * return true;
                 */
            }
            catch (ResetException)
            {
                foreach (InteractionInstance interactionInstance in Target.InteractionQueue.InteractionList) // Cant Cancel Fix
                {
                    interactionInstance.SetPriority(new InteractionPriority((InteractionPriorityLevel)0, -1f));
                    interactionInstance.MustRun = false;
                    interactionInstance.Hidden  = false;
                }
                Target.InteractionQueue.Add(Singleton.CreateInstance(Target, Target, new InteractionPriority((InteractionPriorityLevel)999, 999f), false, true));
                Target.InteractionQueue.Add(Singleton.CreateInstance(Target, Target, new InteractionPriority((InteractionPriorityLevel)999, 999f), false, true));
                Target.InteractionQueue.Add(Singleton.CreateInstance(Target, Target, new InteractionPriority((InteractionPriorityLevel)999, 999f), false, true));
                Target.InteractionQueue.Add(Singleton.CreateInstance(Target, Target, new InteractionPriority((InteractionPriorityLevel)999, 999f), false, true));
                Target.InteractionQueue.Add(Singleton.CreateInstance(Target, Target, new InteractionPriority((InteractionPriorityLevel)999, 999f), false, true));
                Target.InteractionQueue.Add(Singleton.CreateInstance(Target, Target, new InteractionPriority((InteractionPriorityLevel)999, 999f), false, true));
                Target.InteractionQueue.Add(Singleton.CreateInstance(Target, Target, new InteractionPriority((InteractionPriorityLevel)999, 999f), false, true));
                Target.InteractionQueue.CancelAllInteractions();
                //throw;
            }
            catch (Exception ex)
            {
                NiecException.WriteLog("CancelAllInteractions: " + NiecException.NewLine + NiecException.LogException(ex), true, false, true);
            }

            /*
             * if (Target.InteractionQueue.HasInteractionOfType(Sims3.Gameplay.Objects.Environment.BonehildaCoffin.AwakenBonehilda.Singleton)) // Fixed Error Cancel All GrimReaperSituation.ReapSoul.Singleton
             * {
             *  SimpleMessageDialog.Show("NiecS3Mod", " Sorry, Can't Cancel GrimReaperSituation.ReapSoul");
             *  Target.SetObjectToReset();
             *  return false;
             * }
             */
            return(true);
        }