protected static void OnSupernaturalConsign() { if (PotionShopConsignmentRegister.sSkillVsSaleChanceCurve == null) { PotionShopConsignmentRegister.InitializeData(); } Dictionary <ulong, List <ConsignedObjectProxy> > objects = ConsignedObjectProxy.ConvertToList(PotionShopConsignmentRegister.sConsignedObjects); Consign(objects, PotionShopConsignmentRegister.sConsignAttempts, PotionShopConsignmentRegister.kConsignmentPrices, PotionShopConsignmentRegister.kMadeGoodSaleThreshold, PotionShopConsignmentRegister.kReputationBonusForPositiveFeedback, PotionShopConsignmentRegister.sQualityVsReputationCurve, PotionShopConsignmentRegister.kSellXItemsOpportunityReputationGainMultiplier, PotionShopConsignmentRegister.kConsignmentLifespan, PotionShopConsignmentRegister.kDailyNumberOfAttemptsDecrement, PotionShopConsignmentRegister.sReputationVsStoreFeeCurve, PotionShopConsignmentRegister.kNumberOfTopSellingItems, PotionShopConsignmentRegister.kMakeXSimoleonsOpportunityConsignmentFeeMultiplier); PotionShopConsignmentRegister.sConsignedObjects = ConsignedObjectProxy.ConvertToList <PotionShopConsignmentRegister.ConsignedObject>(objects); }
private static List <ISellableUIItem> CreatePotionObjectsList(Sim customer) { List <ISellableUIItem> consignableObjectsList = new List <ISellableUIItem>(); foreach (GameObject obj in Inventories.QuickFind <GameObject>(customer.Inventory, true, IsPotionConsignable)) { PotionShopConsignmentRegister.AddObjectToSellableObjectsList(obj, consignableObjectsList); } foreach (GameObject obj in Inventories.QuickFind <GameObject>(customer.Household.SharedFamilyInventory.Inventory, true, IsPotionConsignable)) { PotionShopConsignmentRegister.AddObjectToSellableObjectsList(obj, consignableObjectsList); } return(consignableObjectsList); }
public static void UpdateSkillBasedCareerEarning(SimDescription sd, GameObject soldItem) { if (sd != null && sd.Occupation != null && sd.Occupation.IsSkillBased) { if (((ulong)sd.OccupationAsSkillBasedCareer.Guid) == ((ulong)OccupationNames.SpellCrafter) && soldItem.GetType() == typeof(AlchemyPotion)) { PotionShopConsignmentRegister.RewardAlchemistForConsignmentSell((float)((long)soldItem.Value / (long)((ulong)PotionShopConsignmentRegister.GetNumSimsWithAlchemyJob()))); EventTracker.SendEvent(EventTypeId.kSoldConsignedObject, sd.CreatedSim); // sd.OccupationAsSkillBasedCareer.UpdateXpForEarningMoneyFromSkill(Sims3.Gameplay.Skills.SkillNames.Spellcasting, soldItem.Value); } else if (((ulong)sd.OccupationAsSkillBasedCareer.Guid) == ((ulong)OccupationNames.Inventor) && soldItem.GetType() == typeof(Invention)) { sd.OccupationAsSkillBasedCareer.UpdateXpForEarningMoneyFromSkill(Sims3.Gameplay.Skills.SkillNames.Inventing, soldItem.Value); } else if (((ulong)sd.OccupationAsSkillBasedCareer.Guid) == ((ulong)OccupationNames.NectarMaker) && soldItem.GetType() == typeof(NectarBottle)) { sd.OccupationAsSkillBasedCareer.UpdateXpForEarningMoneyFromSkill(Sims3.Gameplay.Skills.SkillNames.Nectar, soldItem.Value); } else if (((ulong)sd.OccupationAsSkillBasedCareer.Guid) == ((ulong)OccupationNames.Gardener) && soldItem.GetType() == typeof(Ingredient)) { sd.OccupationAsSkillBasedCareer.UpdateXpForEarningMoneyFromSkill(Sims3.Gameplay.Skills.SkillNames.Gardening, soldItem.Value); } else if (((ulong)sd.OccupationAsSkillBasedCareer.Guid) == ((ulong)OccupationNames.Fisher) && soldItem.GetType() == typeof(Fish)) { sd.OccupationAsSkillBasedCareer.UpdateXpForEarningMoneyFromSkill(Sims3.Gameplay.Skills.SkillNames.Fishing, soldItem.Value); } else if (((ulong)sd.OccupationAsSkillBasedCareer.Guid) == ((ulong)OccupationNames.Photographer) && soldItem.GetType() == typeof(Photograph)) { sd.OccupationAsSkillBasedCareer.UpdateXpForEarningMoneyFromSkill(Sims3.Gameplay.Skills.SkillNames.Photography, soldItem.Value); } else if (((ulong)sd.OccupationAsSkillBasedCareer.Guid) == ((ulong)OccupationNames.Sculptor) && soldItem.GetType() == typeof(Sculpture)) { sd.OccupationAsSkillBasedCareer.UpdateXpForEarningMoneyFromSkill(Sims3.Gameplay.Skills.SkillNames.Sculpting, soldItem.Value); } } }
protected static bool IsConsignable(GameObject obj) { if (!obj.CanBeSold()) { return(false); } if ((!GameUtils.IsInstalled(ProductVersion.EP2)) && (!GameUtils.IsInstalled(ProductVersion.EP7))) { return(false); } if (GameUtils.IsInstalled(ProductVersion.EP2)) { if (ConsignmentRegister.IsObjectConsignable(obj, null)) { return(true); } } if (GameUtils.IsInstalled(ProductVersion.EP7)) { if (PotionShopConsignmentRegister.IsObjectConsignable(obj, null)) { return(true); } } if (obj is ICraftedArt) { return(true); } if (obj is MinorPet) { return(true); } return(Consignments.IsCollectable(obj)); }
public int Sell(SimDescription sim, GameObject obj) { if ((mAllowConsignment) && (sim.CreatedSim != null) && (IsConsignable(obj))) { Inventory inventory = Inventories.ParentInventory(obj); if ((inventory == null) || (inventory.TryToRemove(obj))) { try { if (GameUtils.IsInstalled(ProductVersion.EP2)) { ConsignmentRegister.OnConsignedItem(sim.CreatedSim, obj); } else if (GameUtils.IsInstalled(ProductVersion.EP7)) { PotionShopConsignmentRegister.OnConsignedItem(sim.CreatedSim, obj); } return(0); } catch (Exception e) { Common.DebugException(obj, e); } } } int value = obj.Value; Consignments.NotifySell(sim, obj); AdjustFunds(sim, "SellItem", value); obj.Destroy(); return(value); }
public override int GetValueOfSale(SimDescription sim) { return(PotionShopConsignmentRegister.GetValueOfSale(mData, sim)); }
public override float GetChanceOfSale(Sim createdSim) { return(PotionShopConsignmentRegister.GetChanceOfSale(createdSim, mData)); }