public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) { base.ModifyNPCLoot(npc, npcLoot); FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.ByCondition(new Conditions.IsHardmode(), ItemID.FloatingIslandFishingCrateHard)); FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ModContent.ItemType <WyvernFeather>(), 5)); FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.CloudinaBottle, 20)); }
public static IItemDropRule DropOnBattlegroundWithRule(IItemDropRuleCondition condition, SoraPlayer wielder, int itemID, int chanceDenominator = 1, int minimumDropped = 1, int maximumDropped = 1) { if (wielder.fightingInBattleground) { return(ItemDropRule.ByCondition(condition, itemID, chanceDenominator, minimumDropped, maximumDropped)); } else { return(ItemDropRule.DropNothing()); } }
public static IItemDropRule MasterModeCommonDrop(int itemId) { return(ItemDropRule.ByCondition((IItemDropRuleCondition) new Conditions.IsMasterMode(), itemId, 1, 1, 1, 1)); }
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) { base.ModifyNPCLoot(npc, npcLoot); npcLoot.Add(ItemDropRule.ByCondition(new EModeDropCondition(), ModContent.ItemType <TimsConcoction>(), 5)); }
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) { //HOW TO SEE DROP RATES IN THE BESTIARY: /* * 1. Get the "GamerMod (Debug Tools)" mod * 2. Enter a world, type "/bestiary" in chat * 3. If it says "done?", leave the world (so that the 100% progress saves on that world) * 4. ??? * 5. profit (check bestiary for drops) * * You need to do this for every world you are using (ideally a normal and an expert world) * You only have to do this once or when new NPCs get added. New drops to existing NPCs do not need redoing the steps */ //This method is called once when the game loads (per NPC), so you can't make dynamic checks based on world state like "npc.value > 0f" here if (npc.type == NPCID.GoblinSorcerer) { //20 is the chanceDenominator argument, meaning its a 1/20 roll aka old Main.rand.NextBool(20) npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <ShadowyClicker>(), 20)); } else if (npc.type == NPCID.Frankenstein || npc.type == NPCID.SwampThing) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <EclipticClicker>(), 25)); } else if (npc.type == NPCID.BloodZombie || npc.type == NPCID.Drippler) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <HemoClicker>(), 25)); } else if (npc.type == NPCID.DarkCaster) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <Milk>(), 15)); } else if (npc.type == NPCID.IceMimic) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <AimAssistModule>(), 4)); } else if (npc.type == NPCID.Gastropod) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <ChocolateChip>(), 20)); } else if (npc.type == NPCID.SandElemental) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <SandstormClicker>(), 2)); } else if (npc.type == NPCID.IceGolem) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <BlizzardClicker>(), 2)); } else if (npc.type == NPCID.PirateCaptain) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <CaptainsClicker>(), 8)); } else if (npc.type == NPCID.PirateShip) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <GoldenTicket>(), 4)); } else if (npc.type == NPCID.Pumpking) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <LanternClicker>(), 10)); } else if (npc.type == NPCID.MourningWood) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <WitchClicker>(), 10)); } else if (npc.type == NPCID.SantaNK1) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <NaughtyClicker>(), 10)); } else if (npc.type == NPCID.IceQueen) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <FrozenClicker>(), 10)); } else if (npc.type == NPCID.DD2DarkMageT1 || npc.type == NPCID.DD2DarkMageT3) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <ArcaneClicker>(), 5)); } else if (npc.type == NPCID.DD2OgreT2 || npc.type == NPCID.DD2OgreT3) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <SnottyClicker>(), 5)); } else if (npc.type == NPCID.MaggotZombie) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <TriggerFinger>(), 18)); } else if (npc.type == NPCID.MartianSaucerCore) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <HighTechClicker>(), 4)); } else if (npc.type == NPCID.WindyBalloon) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <BalloonClicker>(), 10)); } else if (npc.type == NPCID.BloodNautilus) { npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType <SpiralClicker>(), 2, 1)); } else if (npc.type == NPCID.FireImp) { DropHelper.NPCExpertGetsRerolls(npcLoot, ModContent.ItemType <ImpishClicker>(), 35); } else if (npc.type == NPCID.TorchGod) { LeadingConditionRule neverDropsRule = new LeadingConditionRule(new Conditions.NeverTrue()); neverDropsRule.OnSuccess(ItemDropRule.Common(ModContent.ItemType <TorchClicker>())); npcLoot.Add(neverDropsRule); } //Here go drops for normal mode that mirror through boss bags in expert mode (see ClickerItemGlobal) Conditions.NotExpert notExpert = new Conditions.NotExpert(); if (npc.type == NPCID.MoonLordCore) { npcLoot.Add(ItemDropRule.ByCondition(notExpert, ModContent.ItemType <LordsClicker>())); npcLoot.Add(ItemDropRule.ByCondition(notExpert, ModContent.ItemType <TheClicker>(), 5)); } else if (npc.type == NPCID.TheDestroyer || npc.type == NPCID.SkeletronPrime || npc.type == NPCID.Retinazer || npc.type == NPCID.Spazmatism) { var ruleToAdd = ItemDropRule.ByCondition(notExpert, ModContent.ItemType <BottomlessBoxofPaperclips>(), 4); if (npc.type == NPCID.TheDestroyer || npc.type == NPCID.SkeletronPrime) { npcLoot.Add(ruleToAdd); } else { LeadingConditionRule missingTwinRule = new LeadingConditionRule(new Conditions.MissingTwin()); missingTwinRule.OnSuccess(ruleToAdd); npcLoot.Add(missingTwinRule); } } else if (npc.type == NPCID.DD2Betsy) { npcLoot.Add(ItemDropRule.ByCondition(notExpert, ModContent.ItemType <DraconicClicker>(), 4)); } else if (npc.type == NPCID.Deerclops) { npcLoot.Add(ItemDropRule.ByCondition(notExpert, ModContent.ItemType <CyclopsClicker>(), 4)); } else if (npc.type == NPCID.HallowBoss) { npcLoot.Add(ItemDropRule.ByCondition(notExpert, ModContent.ItemType <RainbowClicker>(), 4)); } else if (npc.type == NPCID.DukeFishron) { npcLoot.Add(ItemDropRule.ByCondition(notExpert, ModContent.ItemType <SeafoamClicker>(), 5)); } else if (npc.type == NPCID.WallofFlesh) { npcLoot.Add(ItemDropRule.ByCondition(notExpert, ModContent.ItemType <ClickerEmblem>(), 4)); } else if (npc.type == NPCID.KingSlime) { npcLoot.Add(ItemDropRule.ByCondition(notExpert, ModContent.ItemType <StickyKeychain>(), 4)); } else if (npc.type == NPCID.QueenSlimeBoss) { npcLoot.Add(ItemDropRule.ByCondition(notExpert, ModContent.ItemType <ClearKeychain>(), 4)); } else if (npc.type == NPCID.LunarTowerStardust || npc.type == NPCID.LunarTowerSolar || npc.type == NPCID.LunarTowerVortex || npc.type == NPCID.LunarTowerNebula) { int miceFragment = ModContent.ItemType <MiceFragment>(); var pNormal = default(DropOneByOne.Parameters); pNormal.ChanceDenominator = 1; pNormal.ChanceNumerator = 1; pNormal.MinimumStackPerChunkBase = 1; pNormal.MaximumStackPerChunkBase = 1; pNormal.BonusMinDropsPerChunkPerPlayer = 0; pNormal.BonusMaxDropsPerChunkPerPlayer = 0; pNormal.MinimumItemDropsCount = 3; pNormal.MaximumItemDropsCount = 15; var pExpert = pNormal; //Since DropOneByOne.Parameters is a struct, this is a copy/new assignment pExpert.MinimumItemDropsCount = 5; pExpert.MaximumItemDropsCount = 22; var normalModeRule = new DropOneByOne(miceFragment, pNormal); var expertModeRule = new DropOneByOne(miceFragment, pExpert); npcLoot.Add(new DropBasedOnExpertMode(normalModeRule, expertModeRule)); } }
//ModifyGlobalLoot allows you to modify loot that every NPC should be able to drop, preferably with a condition. //Vanilla uses this for the biome keys, souls of night/light, as well as the holiday drops. //Any drop rules in ModifyGlobalLoot should only run once. Everything else should go in ModifyNPCLoot. public override void ModifyGlobalLoot(GlobalLoot globalLoot) { globalLoot.Add(ItemDropRule.ByCondition(new Conditions.IsMasterMode(), ModContent.ItemType <ExampleSoul>(), 5, 1, 1)); //If the world is in master mode, drop ExampleSouls 20% of the time from every npc. //TODO: Make it so it only drops from enemies in ExampleBiome when that gets made. }