示例#1
0
        private static void AintAllDelDesc(bool loadworld)
        {
            try
            {
                if (NiecMod.KillNiec.AssemblyCheckByNiec.IsInstalled("DGSCore"))
                {
                    //bool checkkillsimxxx = false;
                    try
                    {
                        //Sleep(3.0);
                        foreach (SimDescription sdtyf in NiecMod.Nra.NFinalizeDeath.TattoaX())
                        {
                            try
                            {
                                if (!Sims3.NiecModList.Persistable.ListCollon.NiecSimDescriptions.Contains(sdtyf))
                                {
                                    Sims3.NiecModList.Persistable.ListCollon.NiecSimDescriptions.Add(sdtyf);
                                }
                            }
                            catch
                            { }
                        }
                    }
                    catch
                    { }

                    //Sleep(3.0);

                    try
                    {
                        CommandSystem.ExecuteCommandString("dgsunsafekill false");
                    }
                    catch
                    { }

                    try
                    {
                        CommandSystem.ExecuteCommandString("dgspx false");
                        PlumbBob.ForceSelectActor(null);
                        try
                        {
                            PlumbBob.sSingleton.mSelectedActor = null;
                        }
                        catch
                        { }
                    }
                    catch
                    { }

                    try
                    {
                        List <MiniSimDescription> asdr = new List <MiniSimDescription>(MiniSimDescription.sMiniSims.Values);
                        foreach (MiniSimDescription esdtyef in asdr)
                        {
                            try
                            {
                                if (esdtyef == null)
                                {
                                    continue;
                                }

                                if (esdtyef.mProtectionFlags != null)
                                {
                                    esdtyef.mProtectionFlags.Clear();
                                }


                                esdtyef.Instantiated = false;
                                esdtyef.mGenealogy   = null;
                                try
                                {
                                    foreach (MiniRelationship miniRelationship in esdtyef.mMiniRelationships)
                                    {
                                        if (miniRelationship == null)
                                        {
                                            continue;
                                        }
                                        try
                                        {
                                            MiniSimDescription miniSimDescription2 = MiniSimDescription.Find(miniRelationship.SimDescriptionId);
                                            if (miniSimDescription2 != null)
                                            {
                                                if (miniSimDescription2.mProtectionFlags != null)
                                                {
                                                    miniSimDescription2.mProtectionFlags.Clear();
                                                }


                                                miniSimDescription2.Instantiated = false;
                                                miniSimDescription2.RemoveMiniRelatioship(esdtyef.mSimDescriptionId);
                                                miniSimDescription2.mGenealogy = null;
                                            }
                                        }
                                        catch
                                        { }
                                    }
                                }
                                catch
                                { }
                                if (esdtyef.mMiniRelationships != null)
                                {
                                    esdtyef.mMiniRelationships.Clear();
                                }
                                //MiniSimDescription.sMiniSims.Remove(esdtyef.mSimDescriptionId);
                            }
                            catch
                            { }
                        }
                    }
                    catch
                    { }


                    foreach (SimDescription sdtyef in Sims3.NiecModList.Persistable.ListCollon.NiecSimDescriptions)
                    {
                        try
                        {
                            if (sdtyef == null)
                            {
                                continue;
                            }

                            //sdtyef.RemoveOutfits(OutfitCategories.All, true);
                            //sdtyef.RemoveOutfit(OutfitCategories.All, 0, true);



                            if (!sdtyef.mIsValidDescription && !loadworld)
                            {
                                continue;
                            }


                            try
                            {
                                try
                                {
                                    if (sdtyef.OccultManager != null)
                                    {
                                        sdtyef.OccultManager.RemoveAllOccultTypes();
                                    }
                                }
                                catch
                                {
                                }

                                sdtyef.OccultManager = null;
                            }
                            catch
                            { }

                            try
                            {
                                if (sdtyef.IsPregnant)
                                {
                                    NRaas.CommonSpace.Helpers.CASParts.RemoveOutfits(sdtyef, OutfitCategories.All, false);
                                }
                                else
                                {
                                    NRaas.CommonSpace.Helpers.CASParts.RemoveOutfits(sdtyef, OutfitCategories.All, true);
                                }
                            }
                            catch
                            { }
                            sdtyef.Protected = false;
                            MiniSimDescription inim = MiniSimDescription.Find(sdtyef.mSimDescriptionId);
                            if (inim != null)
                            {
                                if (inim.mProtectionFlags != null)
                                {
                                    inim.mProtectionFlags.Clear();
                                }
                                inim.Instantiated = false;
                                inim.mGenealogy   = null;
                                inim.ClearMiniRelationships();
                            }
                        }
                        catch
                        { }
                        try
                        {
                            Niec.iCommonSpace.KillPro.RemoveSimDescriptionRelationships(sdtyef);
                        }
                        catch
                        { }
                        try
                        {
                            Niec.iCommonSpace.KillPro.CleanseGenealogy(sdtyef);
                            sdtyef.mGenealogy = null;
                        }
                        catch
                        { }
                        try
                        {
                            Niec.iCommonSpace.KillPro.RemoveSimDescriptionRelationships(sdtyef);
                        }
                        catch
                        { }
                    }

                    List <Sim> asdo = new List <Sim>();
                    try
                    {
                        try
                        {
                            foreach (Sim simau in Sims3.Gameplay.Queries.GetObjects <Sim>())
                            {
                                try
                                {
                                    if (!asdo.Contains(simau))
                                    {
                                        asdo.Add(simau);
                                    }
                                }
                                catch
                                { }
                            }

                            foreach (Sim simau in LotManager.Actors)
                            {
                                try
                                {
                                    if (!asdo.Contains(simau))
                                    {
                                        asdo.Add(simau);
                                    }
                                }
                                catch
                                { }
                            }
                        }
                        catch
                        { }


                        try
                        {
                            foreach (Sim simaue in asdo)
                            {
                                try
                                {
                                    NFinalizeDeath.ForceCancelAllInteractionsWithoutCleanup(simaue);
                                }
                                catch
                                { }
                                try
                                {
                                    simaue.Genealogy.ClearAllGenealogyInformation();
                                }
                                catch
                                { }

                                try
                                {
                                    simaue.Genealogy.ClearMiniSimDescription();
                                }
                                catch
                                { }

                                try
                                {
                                    simaue.Destroy();
                                }
                                catch
                                { }

                                try
                                {
                                    (simaue as ScriptObject).Destroy();
                                }
                                catch
                                { }
                            }
                        }
                        catch
                        { }
                    }
                    catch
                    { }
                    finally
                    {
                        try
                        {
                            asdo.Clear();
                        }
                        catch
                        { }

                        asdo = null;
                    }


                    foreach (SimDescription description in Sims3.NiecModList.Persistable.ListCollon.NiecSimDescriptions)
                    {
                        try
                        {
                            if (description == null)
                            {
                                continue;
                            }

                            if (!description.mIsValidDescription && !loadworld)
                            {
                                try
                                {
                                    while (true)
                                    {
                                        Urnstone urnstone = null;
                                        urnstone = HelperNra.TFindGhostsGrave(description);

                                        if (urnstone != null)
                                        {
                                            urnstone.DeadSimsDescription = null;
                                            try
                                            {
                                                urnstone.Dispose();
                                            }
                                            catch
                                            { }
                                            try
                                            {
                                                urnstone.Destroy();
                                            }
                                            catch
                                            { }
                                        }
                                        else
                                        {
                                            break;
                                        }
                                    }
                                }
                                catch
                                { }
                                continue;
                            }
                        }
                        catch
                        { }

                        try
                        {
                            if (description.IsPregnant)
                            {
                                NRaas.CommonSpace.Helpers.CASParts.RemoveOutfits(description, OutfitCategories.All, false);
                            }
                            else
                            {
                                NRaas.CommonSpace.Helpers.CASParts.RemoveOutfits(description, OutfitCategories.All, true);
                            }
                        }
                        catch
                        { }



                        try
                        {
                            description.Genealogy.ClearMiniSimDescription();
                        }
                        catch
                        { }

                        try
                        {
                            description.Genealogy.ClearDerivedData();
                        }
                        catch
                        { }

                        try
                        {
                            description.Genealogy.ClearSimDescription();
                        }
                        catch
                        { }

                        try
                        {
                            description.Genealogy.ClearAllGenealogyInformation();
                        }
                        catch
                        { }



                        try
                        {
                            if (description.CreatedSim != null)
                            {
                                NFinalizeDeath.ForceCancelAllInteractionsWithoutCleanup(description.CreatedSim);
                            }
                        }
                        catch
                        { }


                        try
                        {
                            Household household = description.Household;
                            if (household != null)
                            {
                                household.Remove(description, !household.IsSpecialHousehold);
                            }
                        }
                        catch
                        { }

                        try
                        {
                            while (true)
                            {
                                Urnstone urnstone = null;
                                urnstone = HelperNra.TFindGhostsGrave(description);
                                if (urnstone != null)
                                {
                                    urnstone.DeadSimsDescription = null;
                                    try
                                    {
                                        urnstone.Dispose();
                                    }
                                    catch
                                    { }
                                    try
                                    {
                                        urnstone.Destroy();
                                    }
                                    catch
                                    { }
                                }
                                else
                                {
                                    break;
                                }
                            }
                        }
                        catch
                        { }
                        try
                        {
                            MiniSimDescription.RemoveMSD(description.SimDescriptionId);
                        }
                        catch
                        { }



                        try
                        {
                            description.Dispose();
                        }
                        catch
                        { }

                        /*
                         * try
                         * {
                         *  NRaas.CommonSpace.Helpers.Annihilation.Cleanse(description);
                         * }
                         * catch
                         * { }
                         */
                        description.mIsValidDescription = false;
                    }


                    try
                    {
                        //Sleep(3.0);
                        foreach (Service allService in Services.AllServices)
                        {
                            try
                            {
                                if (!(allService is GrimReaper))
                                {
                                    allService.ClearServicePool();
                                }
                            }
                            catch
                            { }
                        }
                    }
                    catch
                    { }
                    try
                    {
                        //Sleep(3.0);
                        foreach (Service allService in Services.AllServices)
                        {
                            try
                            {
                                if (!(allService is GrimReaper))
                                {
                                    Service.Destroy(allService);
                                }
                            }
                            catch
                            { }
                        }
                    }
                    catch
                    { }

                    try
                    {
                        try
                        {
                            try
                            {
                                SimDescription.sLoadedSimDescriptions.Clear();
                            }
                            catch
                            { }

                            SimDescription.sLoadedSimDescriptions = null;
                            SimDescription.sLoadedSimDescriptions = new List <SimDescription>();
                        }
                        catch
                        {
                            StyledNotification.Format afra = new StyledNotification.Format("Failed 1", StyledNotification.NotificationStyle.kSystemMessage);
                            StyledNotification.Show(afra);
                        }
                        if (!loadworld)
                        {
                            try
                            {
                                Sims3.NiecModList.Persistable.ListCollon.NiecSimDescriptions.Clear();

                                Sims3.NiecModList.Persistable.ListCollon.NiecSimDescriptions = null;
                                Sims3.NiecModList.Persistable.ListCollon.NiecSimDescriptions = new List <SimDescription>();
                            }
                            catch
                            {
                                StyledNotification.Format afra = new StyledNotification.Format("Failed 2", StyledNotification.NotificationStyle.kSystemMessage);
                                StyledNotification.Show(afra);
                            }
                        }
                        try
                        {
                            MiniSimDescription.sMiniSims.Clear();
                            MiniSimDescription.sMiniSims = null;
                            MiniSimDescription.sMiniSims = new Dictionary <ulong, MiniSimDescription>();
                        }
                        catch
                        {
                            StyledNotification.Format afra = new StyledNotification.Format("Failed 3", StyledNotification.NotificationStyle.kSystemMessage);
                            StyledNotification.Show(afra);
                        }
                        if (NiecMod.KillNiec.AssemblyCheckByNiec.IsInstalled("DGSCore"))
                        {
                            try
                            {
                                CommandSystem.ExecuteCommandString("dgsnocreate true");
                                StyledNotification.Format afra = new StyledNotification.Format("Termination Status: Perfect Execution!", StyledNotification.NotificationStyle.kGameMessageNegative);
                                afra.mTNSCategory = NotificationManager.TNSCategory.Chatty;

                                StyledNotification.Show(afra);
                            }
                            catch
                            { }

                            try
                            {
                                CommandSystem.ExecuteCommandString("dgsnocreate true");
                            }
                            catch
                            { }

                            OptionsModel optionsModel = Sims3.Gameplay.UI.Responder.Instance.OptionsModel as OptionsModel;
                            if (optionsModel != null)
                            {
                                optionsModel.SaveName = "ClearSave " + "No Name";
                            }
                            try
                            {
                                GameStates.TransitionToEditTown();
                            }
                            catch
                            { }
                        }
                    }
                    catch
                    { }
                }
            }
            catch
            { }

            return;
        }
示例#2
0
            public override void ConfigureInteraction()
            {
                Sims3.Gameplay.CAS.SimDescription.DeathType deathtyp = base.simDeathType;
                try
                {
                    bool isplayer = Actor.IsSelectable;

                    if (isplayer)
                    {
                        mMustRun            = false;
                        mHidden             = false;
                        CancellableByPlayer = true;
                    }

                    var killSim =
                        ExtKillSimNiec.Singleton.CreateInstance(Target, Actor, KillSimNiecX.DGSAndNonDGSPriority(), Autonomous, isplayer) as ExtKillSimNiec;

                    killSim.simDeathType       = base.simDeathType;
                    killSim.PlayDeathAnimation = base.PlayDeathAnimation;
                    killSim.mMustRun           = true;

                    base.mPriority = KillSimNiecX.DGSAndNonDGSPriority();

                    runI = killSim;
                    runI.ConfigureInteraction();
                }
                catch (ResetException) { throw; }
                catch { }
                if (!_IsOpenDGSInstalled && !Actor.IsInActiveHousehold)
                {
                    SimDescription ActorDesc = Actor.SimDescription;
                    Sim            Actior    = Actor;


                    if (ATask == ObjectGuid.InvalidObjectGuid)
                    {
                        InteractionPriority MaxDeathP = KillSimNiecX.DGSAndNonDGSPriority();

                        ATask = NiecTask.Perform(delegate
                        {
                            for (int i = 0; i < 190; i++)
                            {
                                Simulator.Sleep(10);
                            }
                            try
                            {
                                while (Actior != null && Actior.mSimDescription != null && !Actior.HasBeenDestroyed && Actior.InteractionQueue != null && Actior.InteractionQueue.HasInteractionOfType(typeof(NiecKillSim)))
                                {
                                    Simulator.Sleep(0);
                                    base.mPriority = MaxDeathP;
                                    base.mMustRun  = true;
                                }
                            }
                            catch (ResetException)
                            {
                                throw;
                            }
                            catch { }
                        });
                    }
                    if (AutoKillSimTask == ObjectGuid.InvalidObjectGuid)
                    {
                        AutoKillSimTask = NiecTask.Perform(delegate
                        {
                            /*
                             * ActorDesc.IsGhost = true;
                             * ActorDesc.mDeathStyle = base.simDeathType;
                             *
                             *
                             *
                             *
                             * if (NFinalizeDeath.GetKillNPCSimToGhost(Actor, deathtyp)) return;
                             * else SafeNRaas.NRUrnstones_CreateGrave(ActorDesc, deathtyp, false, false);*/


                            for (int i = 0; i < 190; i++)
                            {
                                Simulator.Sleep(10);
                            }

                            try
                            {
                                try
                                {
                                    while (Actior != null && Actior.mSimDescription != null && !Actior.HasBeenDestroyed && Actior.InteractionQueue != null && Actior.InteractionQueue.HasInteractionOfType(typeof(NiecKillSim)))
                                    {
                                        Simulator.Sleep(170);
                                    }
                                }
                                catch (ResetException)
                                {
                                    throw;
                                }
                                catch { }

                                Sim CreatedSim = ActorDesc.CreatedSim;

                                try
                                {
                                    if (NFinalizeDeath.IsHasInteractionNHSTargetSim(Actior))
                                    {
                                        return;
                                    }
                                    if (CreatedSim != null && CreatedSim.mSimDescription == ActorDesc)
                                    {
                                        if (NFinalizeDeath.IsHasInteractionNHSTargetSim(CreatedSim))
                                        {
                                            return;
                                        }
                                    }
                                }
                                catch (ResetException)
                                {
                                    throw;
                                }
                                catch
                                { }

                                try
                                {
                                    if (ActorDesc.AssignedRole != null)
                                    {
                                        ActorDesc.AssignedRole.RemoveSimFromRole();
                                    }
                                    ActorDesc.AssignedRole = null;
                                }
                                catch (ResetException)
                                {
                                    throw;
                                }
                                catch
                                { }

                                try
                                {
                                    ActorDesc.IsGhost     = true;
                                    ActorDesc.mDeathStyle = deathtyp;
                                    NiecHelperSituation.FinalizeSimDeathPro(
                                        ActorDesc, ActorDesc.Household, AssemblyCheckByNiec.IsInstalled(NiecMod.Instantiator.DGSModsAssembly)
                                        );
                                }
                                catch (ResetException)
                                {
                                    throw;
                                }
                                catch
                                { }

                                try
                                {
                                    if (Actior.Inventory != null)
                                    {
                                        //Actior.MoveInventoryItemsToSim(NFinalizeDeath.ActiveActor ?? PlumbBob.SelectedActor);
                                        NFinalizeDeath._MoveInventoryItemsToAFamilyMember
                                            (Target, NFinalizeDeath.HouseholdMembersToSim(Household.ActiveHousehold, true, false) ?? NFinalizeDeath.ActiveActor ?? PlumbBob.SelectedActor);
                                    }
                                }
                                catch (ResetException)
                                {
                                    throw;
                                }
                                catch
                                { }


                                Urnstone RIPObject;

                                RIPObject = HelperNra.TFindGhostsGrave(ActorDesc);

                                if (RIPObject == null)
                                {
                                    NFinalizeDeath.GetKillNPCSimToGhost(Actior, deathtyp, Vector3.OutOfWorld, out RIPObject);
                                }
                                if (RIPObject == null)
                                {
                                    RIPObject = Urnstone.CreateGrave(ActorDesc, false, true);
                                }

                                NiecHelperSituation.safePosRIPObject(Actior, Actior, RIPObject);

                                NFinalizeDeath.ForceDestroyObject(Actior);
                                NFinalizeDeath.ForceDestroyObject(CreatedSim);

                                if (ActorDesc.DeathStyle == SimDescription.DeathType.None)
                                {
                                    ActorDesc.mDeathStyle = SimDescription.DeathType.Drown;
                                }
                                ActorDesc.IsGhost = true;


                                RIPObject = HelperNra.TFindGhostsGrave(ActorDesc);

                                if (RIPObject == null)
                                {
                                    NFinalizeDeath.GetKillNPCSimToGhost(Actior, deathtyp, Vector3.OutOfWorld, out RIPObject);
                                }

                                NiecHelperSituation.safePosRIPObject(Actior, Actior, RIPObject);

                                RIPObject.AddToWorld();
                                RIPObject.FadeIn();

                                RIPObject.SetHiddenFlags(HiddenFlags.Nothing);
                                RIPObject.SetOpacity(1f, 0f);
                                RIPObject.AddToWorld();
                                RIPObject.FadeIn();

                                if (ActorDesc.DeathStyle == SimDescription.DeathType.None)
                                {
                                    ActorDesc.mDeathStyle = SimDescription.DeathType.Drown;
                                }
                                ActorDesc.IsGhost = true;
                            }
                            catch (ResetException)
                            {
                                throw;
                            }
                            catch { }
                        });
                    }
                }
            }