protected bool OnPerform(Sim actor) { Urnstone urnstone = Urnstone.FindGhostsGrave(actor); SimDescription deadSimsDescription = urnstone.DeadSimsDescription; deadSimsDescription.IsGhost = false; deadSimsDescription.IsNeverSelectable = false; deadSimsDescription.ShowSocialsOnSim = true; Vector3 vector2 = actor.Position; vector2.x++; if (deadSimsDescription.CreatedSim != null) { urnstone.GhostToSim(deadSimsDescription.CreatedSim, false, true); } else { urnstone.OriginalHousehold.Add(deadSimsDescription); deadSimsDescription.Instantiate(vector2); deadSimsDescription.AgingEnabled = false; } if (urnstone.DeadSimsDescription.CreatedSim != null) { urnstone.Destroy(); } return(true); }
protected override bool Allow(GameHitParameters <GameObject> parameters) { mActor = parameters.mActor as Sim; Sim sim = parameters.mTarget as Sim; if (sim != null) { if (!sim.SimDescription.IsDead) { return(false); } Urnstone urnstone = Urnstone.FindGhostsGrave(sim.SimDescription); if (urnstone == null) { return(false); } Inventory inventory = Inventories.ParentInventory(urnstone); if ((inventory != null) && (inventory.Owner == sim)) { return(false); } } return(base.Allow(parameters)); }
protected bool OnPerform() { Urnstone urnstone = Urnstone.FindGhostsGrave(Target); if (urnstone != null) { urnstone.GhostToSim(Target, false, true); return(true); } return(false); }
public override bool Run() { try { Urnstone grave = Urnstone.FindGhostsGrave(Actor); if (grave != null) { grave.GhostToSim(Actor, false, false); } return(true); } catch (Exception e) { Common.Exception(Actor, Target, e); return(false); } }
public static void GhostToSim(Sim vamp, Sim vic) { OthersResurrect.player1 = vamp; OthersResurrect.player2 = vic; Sim actor = player1; Sim target = player2; Urnstone urnstone = Urnstone.FindGhostsGrave(target); if (urnstone != null) { OthersResurrect.PlayResurrectAnimation(target, true, true); urnstone.GhostToSim(target, true, true); target.OccultManager.AddOccultType(OccultTypes.Vampire, true, false, false); target.ChooseRandomOutfitCategoryOtherThanCurrent(OutfitCategories.Everyday); OthersResurrect.AppearSimInResurrect(target, true); } }
public override bool Test(Sim a, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (isAutonomous) { return(false); } if (a != target) { return(false); } if (!target.SimDescription.IsPlayableGhost) { return(false); } Assassination skill = a.SkillManager.GetSkill <Assassination>(Assassination.StaticGuid); if (skill == null) { return(false); } if (!skill.IsGhost()) { return(false); } if (Urnstone.FindGhostsGrave(a) == null) { return(false); } return(true); }
protected override void OnPerform() { int roomId = 0; Lot lot = null; if (mTarget.CreatedSim != null) { Vector3 location = mTarget.CreatedSim.PositionOnFloor; lot = mTarget.CreatedSim.LotCurrent; roomId = mTarget.CreatedSim.RoomId; List <GnomeData> gnomes = new List <GnomeData>(); if (mTarget.TraitManager.HasElement(TraitNames.CultureChina)) { gnomes.Add(new GnomeData(0x000000000098977D, ProductVersion.EP1)); } else if ((mTarget.TraitManager.HasElement(TraitNames.CultureEgypt)) || (mTarget.IsMummy)) { gnomes.Add(new GnomeData(0x000000000098977C, ProductVersion.EP1)); } else if (mTarget.TraitManager.HasElement(TraitNames.CultureFrance)) { gnomes.Add(new GnomeData(0x000000000098977E, ProductVersion.EP1)); } else if (mTarget.IsVampire) { gnomes.Add(new GnomeData(0x000000000098A1C2, ProductVersion.EP3)); } else if (mTarget.IsFrankenstein) { gnomes.Add(new GnomeData(0x0000000000989CD9, ProductVersion.EP2)); } else if ((mTarget.IsCelebrity) || (mTarget.AssignedRole is RolePaparazzi)) { gnomes.Add(new GnomeData(0x000000000098A1C4, ProductVersion.EP3)); } else if (mTarget.Occupation is MagicianCareer) { gnomes.Add(new GnomeData(0x000000000098D215, ProductVersion.EP6)); // Magician } else if (mTarget.Occupation is SingerCareer) { gnomes.Add(new GnomeData(0x000000000098D214, ProductVersion.EP6)); // Singer } else if (mTarget.IsCat) { gnomes.Add(new GnomeData(0x000000000098AAD6, ProductVersion.EP5)); // Pet Cat } else if (mTarget.IsADogSpecies) { gnomes.Add(new GnomeData(0x000000000098AAD5, ProductVersion.EP5)); // Pet Dog } else if (mTarget.IsHorse) { gnomes.Add(new GnomeData(0x000000000098AAD4, ProductVersion.EP5)); // Pet Horse } else { gnomes.Add(new GnomeData(0x000000000000058B, ProductVersion.BaseGame)); // Normal if (GameUtils.IsInstalled(ProductVersion.EP1)) { gnomes.Add(new GnomeData(0x000000000098977D, ProductVersion.EP1)); // China gnomes.Add(new GnomeData(0x000000000098977C, ProductVersion.EP1)); // Egypt gnomes.Add(new GnomeData(0x000000000098977E, ProductVersion.EP1)); // France } if (GameUtils.IsInstalled(ProductVersion.EP2)) { gnomes.Add(new GnomeData(0x0000000000989EEC, ProductVersion.EP2)); // Caveman gnomes.Add(new GnomeData(0x0000000000989CD9, ProductVersion.EP2)); // Inventor gnomes.Add(new GnomeData(0x0000000000989EDF, ProductVersion.EP2)); // Laundry gnomes.Add(new GnomeData(0x0000000000989CF2, ProductVersion.EP2)); // Sculptor } if (GameUtils.IsInstalled(ProductVersion.EP3)) { gnomes.Add(new GnomeData(0x000000000098A1C4, ProductVersion.EP3)); // Celebrity gnomes.Add(new GnomeData(0x000000000098A1C2, ProductVersion.EP3)); // Vampire } if (GameUtils.IsInstalled(ProductVersion.EP5)) { gnomes.Add(new GnomeData(0x000000000098AEB1, ProductVersion.EP5)); // Freezer Bunny gnomes.Add(new GnomeData(0x000000000098AAD6, ProductVersion.EP5)); // Pet Cat gnomes.Add(new GnomeData(0x000000000098AAD5, ProductVersion.EP5)); // Pet Dog gnomes.Add(new GnomeData(0x000000000098AAD4, ProductVersion.EP5)); // Pet Horse } if (GameUtils.IsInstalled(ProductVersion.EP6)) { gnomes.Add(new GnomeData(0x000000000098D215, ProductVersion.EP6)); // Magician gnomes.Add(new GnomeData(0x000000000098D214, ProductVersion.EP6)); // Singer } } if (gnomes.Count > 0) { GnomeData preferred = RandomUtil.GetRandomObjectFromList(gnomes); MagicGnomeBase gnome = ObjectCreation.CreateObject(preferred.mInstance, preferred.mVersion, null) as MagicGnomeBase; if (gnome != null) { NameComponent name = gnome.GetComponent <NameComponent>(); if (name != null) { name.mName = mTarget.FullName; } gnome.SetPosition(location); gnome.AddToWorld(); } } } Genealogy genealogy = mTarget.CASGenealogy as Genealogy; if (genealogy != null) { genealogy.ClearAllGenealogyInformation(); } foreach (SimDescription other in SimDescription.GetSimDescriptionsInWorld()) { MiniSimDescription miniOther = MiniSimDescription.Find(other.SimDescriptionId); if (miniOther == null) { continue; } miniOther.RemoveMiniRelatioship(mTarget.SimDescriptionId); } Annihilation.RemoveMSD(mTarget.SimDescriptionId); Relationship.RemoveSimDescriptionRelationships(mTarget); Urnstone urnstone = Urnstone.FindGhostsGrave(mTarget); if (urnstone != null) { if ((urnstone.InInventory) && (urnstone.Parent != null) && (urnstone.Parent.Inventory != null)) { urnstone.Parent.Inventory.RemoveByForce(urnstone); } urnstone.DestroyGrave(); try { urnstone.Dispose(); } catch { } } try { mTarget.Dispose(); Assassination skill = Assassination.EnsureSkill(mActor); if (skill != null) { skill.AddPotentialKill(mTarget, true); bool witnessed = false; if (lot != null) { witnessed = Assassination.WasWitnessed(lot, roomId, mActor.SimDescription, mTarget, new List <Sim>()); } skill.AddActualKill(mTarget, false, witnessed); } } catch { } }