public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <elsasHeart>(), 1, 2, 5)); npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <Items.Weapons.Keyblade_ice>())); npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <Items.Materials.frostCrystal>(), 1, 1, 15)); npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <Items.Materials.frostStone>(), 1, 15, 50)); }
//Mimics ItemDropRule.ExpertGetsRerolls but with custom % instead of #rerolls //Wrapper for other rules ontop internal static void NPCExpertGetsRerolls(NPCLoot npcLoot, int itemId, int chanceDenominator = 1, int minimumDropped = 1, int maximumDropped = 1, int chanceNumerator = 1, IItemDropRule ruleExpert = null, IItemDropRule ruleNormal = null, float rerollChance = 0.5f) { //Since the conditions are exclusive, only one of them will show up IItemDropRule expertRule = new LeadingConditionRule(new Conditions.IsExpert()); IItemDropRule ruleToAdd = expertRule; if (ruleExpert != null) { ruleToAdd = ruleExpert; //If a rule is specified, use that to add it (Always add the "baseline" rule first) expertRule = ruleToAdd.OnSuccess(expertRule); } expertRule.OnSuccess(new CommonDropWithReroll(itemId, chanceDenominator, minimumDropped, maximumDropped, chanceNumerator, rerollChance)); npcLoot.Add(ruleToAdd); //Vanilla example //Conditions.IsPumpkinMoon condition2 = new Conditions.IsPumpkinMoon(); //Conditions.FromCertainWaveAndAbove condition3 = new Conditions.FromCertainWaveAndAbove(15); //LeadingConditionRule entry = new LeadingConditionRule(condition2); //LeadingConditionRule ruleToChain = new LeadingConditionRule(condition3); //npcLoot.Add(entry).OnSuccess(ruleToChain).OnSuccess(ItemDropRule.Common(1856)); IItemDropRule notExpertRule = new LeadingConditionRule(new Conditions.NotExpert()); ruleToAdd = notExpertRule; if (ruleNormal != null) { ruleToAdd = ruleNormal; notExpertRule = ruleToAdd.OnSuccess(notExpertRule); } notExpertRule.OnSuccess(new CommonDrop(itemId, chanceDenominator, minimumDropped, maximumDropped, chanceNumerator)); npcLoot.Add(ruleToAdd); }
public override void ModifyNPCLoot(NPCLoot npcLoot) { int[] dropOptions = new int[] { ModContent.ItemType <Items.Weapons.Keyblade_Kingdom>(), ModContent.ItemType <Items.Armor.orgCoat>(), ModContent.ItemType <Items.seasaltIcecream>() }; npcLoot.Add(ItemDropRule.OneFromOptions(3, dropOptions)); npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <Items.Materials.twilightGem>(), 1, 15, 35)); }
public override void ModifyNPCLoot(NPCLoot npcLoot) { int[] dropOptions = new int[] { ModContent.ItemType <Items.Weapons.Keyblade_Lionheart>(), ModContent.ItemType <Items.Weapons.Org13.Xigbar.sharpshooter>(), ModContent.ItemType <Items.Armor.orgCoat>(), ModContent.ItemType <Items.glide>() }; npcLoot.Add(ItemDropRule.OneFromOptions(1, dropOptions)); npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <xigbarSpawner>())); npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <Items.Materials.twilightShard>(), 1, 5, 15)); }
public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <Items.Materials.blazingShard>(), 5, 1, 6)); if (Main.player[NPC.target].Center.Y > Main.UnderworldLayer) { npcLoot.Add(ItemDropRule.Common(ItemID.Hellstone, 1, 1, 5)); } }
public override void ModifyNPCLoot(NPCLoot npcLoot) { int[] dropOptions = new int[] { ModContent.ItemType <Items.Weapons.Keyblade_FinalXion>(), ModContent.ItemType <Items.Armor.orgCoat>(), ModContent.ItemType <Items.seasaltIcecream>() }; npcLoot.Add(ItemDropRule.OneFromOptions(3, dropOptions)); npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <Items.Materials.twilightCrystal>(), 1, 50, 137)); npcLoot.Add(ItemDropRule.Common(ItemID.BlueSolution, 1, 10, 15)); }
public override void ModifyNPCLoot(NPCLoot npcLoot) { int[] dropOptions = new int[] { ModContent.ItemType <Items.Weapons.Keyblade_flameFrolic>(), ModContent.ItemType <Items.Weapons.Org13.Axel.Chacrams_EternalFlames>(), ModContent.ItemType <Items.Armor.orgCoat>(), ModContent.ItemType <Items.seasaltIcecream>() }; npcLoot.Add(ItemDropRule.OneFromOptions(1, dropOptions)); npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <AxelSpawner>())); npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <Items.Materials.blazingShard>(), 1, 5, 15)); }
public override void ModifyNPCLoot(NPCLoot npcLoot) { //Bestiary int[] possibleItems = new int[] { ModContent.ItemType <Items.Materials.blazingShard>(), ModContent.ItemType <Items.Materials.betwixtShard>(), ModContent.ItemType <Items.Materials.frostShard>(), ModContent.ItemType <Items.Materials.frostShard>(), ModContent.ItemType <Items.Materials.lucidShard>(), ModContent.ItemType <Items.Materials.mythrilShard>(), ModContent.ItemType <Items.Materials.pulsingShard>(), ModContent.ItemType <Items.Materials.lightningShard>(), ModContent.ItemType <Items.Materials.twilightShard>() }; npcLoot.Add(ItemDropRule.OneFromOptions(1, possibleItems)); possibleItems = new int[] { ItemID.CopperOre, ItemID.SilverOre, ItemID.GoldOre, ItemID.LeadOre, ItemID.IronOre, ItemID.TinOre }; npcLoot.Add(ItemDropRule.OneFromOptions(1, possibleItems)); }
public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType <TrojanSquirrelBag>())); npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <TrojanSquirrelTrophy>(), 10)); LeadingConditionRule rule = new LeadingConditionRule(new Conditions.NotExpert()); rule.OnSuccess(ItemDropRule.OneFromOptions(1, ModContent.ItemType <TreeSword>(), ModContent.ItemType <MountedAcornGun>(), ModContent.ItemType <SnowballStaff>(), ModContent.ItemType <KamikazeSquirrelStaff>())); rule.OnSuccess(ItemDropRule.Common(ItemID.WoodenCrate, 1, 1, 5)); rule.OnSuccess(ItemDropRule.Common(ItemID.HerbBag, 1, 1, 5)); rule.OnSuccess(ItemDropRule.Common(ItemID.Acorn, 1, 100, 100)); rule.OnSuccess(ItemDropRule.Common(ModContent.Find <ModItem>("Fargowiltas", "LumberJaxe").Type, 10)); npcLoot.Add(rule); }
//ModifyNPCLoot uses a unique system called the ItemDropDatabase, which has many different rules for many different drop use cases. //Here we go through all of them, and how they can be used. //There are tons of other examples in vanilla! In a decompiled vanilla build, GameContent/ItemDropRules/ItemDropDatabase adds item drops to every single vanilla NPC, which can be a good resource. public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) { if (!NPCID.Sets.CountsAsCritter[npc.type]) //If npc is not a critter { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <ExampleItem>(), 1)); //Make it drop ExampleItem. // ItemDropRule.Common is what you would use in most cases, it simply drops the item with a chance specified. // The dropsOutOfY int is used for the numerator of the fractional chance of dropping this item. // Likewise, the dropsXOutOfY int is used for the denominator. // For example, if you had a dropsOutOfY as 7 and a dropsXOutOfY as 2, then the chance the item would drop is 2/7 or about 28%. } // We will now use the Guide to explain many of the other types of drop rules. if (npc.type == NPCID.Guide) { // RemoveWhere will remove any drop rule that matches the provided expression. // To make your own expressions to remove vanilla drop rules, you'll usually have to study the original source code that adds those rules. npcLoot.RemoveWhere( // The following expression returns true if the following conditions are met: rule => rule is ItemDropWithConditionRule drop && // If the rule is an ItemDropWithConditionRule instance drop.itemId == ItemID.GreenCap && // And that instance drops a green cap drop.condition is Conditions.NamedNPC npcNameCondition && // ..And if its condition is that an npc name must match some string npcNameCondition.neededName == "Andrew" // And the condition's string is "Andrew". ); npcLoot.Add(ItemDropRule.Common(ItemID.GreenCap, 1)); //In conjunction with the above removal, this makes it so a guide with any name will drop the Green Cap. } if (npc.type == NPCID.Crimera || npc.type == NPCID.Corruptor) { //Here we make use of our own special rule we created: drop during daytime ExampleDropCondition exampleDropCondition = new ExampleDropCondition(); IItemDropRule conditionalRule = new LeadingConditionRule(exampleDropCondition); int itemType = ItemID.Vertebrae; if (npc.type == NPCID.Crimera) { itemType = ItemID.RottenChunk; } //33% chance to drop other corresponding item in addition IItemDropRule rule = ItemDropRule.Common(itemType, chanceDenominator: 3); //Apply our item drop rule to the conditional rule conditionalRule.OnSuccess(rule); //Add the rule npcLoot.Add(conditionalRule); //It will result in the drop being shown in the bestiary, but only drop if the condition is true. } //TODO: Add the rest of the vanilla drop rules!! }
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) { if (npc.type == NPCID.Mothron) { npcLoot.Add(ItemDropRule.Common(ItemType <Items.BrokenStaff>(), 4)); } }
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) { if (npc.type == NPCID.UndeadMiner) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <MinersBackpack>(), 5)); } }
public static void EModeDrop(NPCLoot npcLoot, IItemDropRule rule) { EModeDropCondition dropCondition = new EModeDropCondition(); IItemDropRule conditionalRule = new LeadingConditionRule(dropCondition); conditionalRule.OnSuccess(rule); npcLoot.Add(conditionalRule); }
public override void ModifyNPCLoot(NPCLoot npcLoot) { //TODO, this use to reference an item called CrystalCharm, was it suppose to be CrystiliumHelmet? Also, old commented out code had GEM but didn't have PrismaticBoomstick or "CrystalCharm"/CrystiliumHelmet int[] lootTable = { ItemType <Items.Accessories.CrystalMonocle>(), ItemType <Items.Weapons.PrismBlade>(), ItemType <Items.Weapons.Gemshot>(), ItemType <Items.Weapons.Crystishae>(), ItemType <Items.Weapons.QuartzBlade>(), ItemType <Items.Weapons.DiamondSceptor>(), ItemType <Items.Weapons.ManaDrainer>(), ItemType <Items.Armor.CrystiliumHelmet>(), ItemType <Items.Weapons.PrismaticBoomstick>() }; npcLoot.Add(new OneFromOptionsDropRule(lootTable.Length, 1, lootTable)); }
public static bool LockEarlyBirdDrop(NPCLoot npcLoot, IItemDropRule rule) { EModeEarlyBirdLockDropCondition lockCondition = new EModeEarlyBirdLockDropCondition(); IItemDropRule conditionalRule = new LeadingConditionRule(lockCondition); conditionalRule.OnSuccess(rule); npcLoot.Add(conditionalRule); return(true); }
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) { base.ModifyNPCLoot(npc, npcLoot); LeadingConditionRule emodeRule = new LeadingConditionRule(new EModeDropCondition()); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ModContent.ItemType <GalacticGlobe>())); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ItemID.LunarOre, 150)); npcLoot.Add(emodeRule); }
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) { base.ModifyNPCLoot(npc, npcLoot); LeadingConditionRule emodeRule = new LeadingConditionRule(new EModeDropCondition()); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ModContent.ItemType <NecromanticBrew>())); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ItemID.DungeonFishingCrate, 5)); npcLoot.Add(emodeRule); }
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) { base.ModifyNPCLoot(npc, npcLoot); LeadingConditionRule emodeRule = new LeadingConditionRule(new EModeDropCondition()); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ModContent.ItemType <PrecisionSeal>())); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ItemID.HallowedFishingCrateHard, 5)); npcLoot.Add(emodeRule); }
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) { base.ModifyNPCLoot(npc, npcLoot); LeadingConditionRule emodeRule = new LeadingConditionRule(new EModeDropCondition()); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ModContent.ItemType <BetsysHeart>())); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ItemID.GoldenCrateHard, 5)); npcLoot.Add(emodeRule); }
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) { base.ModifyNPCLoot(npc, npcLoot); LeadingConditionRule emodeRule = new LeadingConditionRule(new EModeDropCondition()); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ModContent.ItemType <QueenStinger>())); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ItemID.JungleFishingCrate, 5)); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ItemID.HerbBag, 5)); npcLoot.Add(emodeRule); }
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) { base.ModifyNPCLoot(npc, npcLoot); LeadingConditionRule emodeRule = new LeadingConditionRule(new EModeDropCondition()); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ModContent.ItemType <SlimyShield>())); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ItemID.WoodenCrate, 5)); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ItemID.LifeCrystal, 3)); npcLoot.Add(emodeRule); }
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) { base.ModifyNPCLoot(npc, npcLoot); LeadingConditionRule emodeRule = new LeadingConditionRule(new EModeDropCondition()); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ModContent.ItemType <Deerclawps>())); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ModContent.ItemType <DeerSinew>())); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ItemID.FrozenCrate, 5)); npcLoot.Add(emodeRule); }
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) { base.ModifyNPCLoot(npc, npcLoot); if (npc.type == NPCID.EyeofCthulhu) { if (!NPC.downedBoss1) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <Items.Misc.AlchemistCharmTier1>(), 1)); } } if (npc.type == NPCID.WallofFlesh) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <Items.Misc.LuckCharm>(), 1)); } if (npc.type == ModContent.NPCType <Operator>()) { npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <Items.Summoning.APMC>(), 1)); } }
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) { base.ModifyNPCLoot(npc, npcLoot); LeadingConditionRule emodeRule = new LeadingConditionRule(new EModeDropCondition()); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ModContent.ItemType <AgitatingLens>())); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ItemID.IronCrate, 5)); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ItemID.FallenStar, 5)); npcLoot.Add(emodeRule); }
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) { base.ModifyNPCLoot(npc, npcLoot); LeadingConditionRule emodeRule = new LeadingConditionRule(new EModeDropCondition()); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ModContent.ItemType <MagicalBulb>())); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ItemID.JungleFishingCrateHard, 5)); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ItemID.LifeFruit, 3)); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ItemID.ChlorophyteOre, 200)); npcLoot.Add(emodeRule); }
public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(new CommonDrop(ItemType <Items.Placeable.KingTrophy>(), 10)); npcLoot.Add(new DropBasedOnExpertMode(new CommonDrop(ItemType <Items.Armor.CrystalMask>(), 10), new DropNothing())); npcLoot.Add(new DropBasedOnExpertMode(new CommonDrop(ItemType <Items.CrystiliumBar>(), 1, 13, 20), new DropNothing())); var normalModeRule = new OneFromOptionsDropRule(8, 1, new[] { ItemType <Cryst>(), ItemType <Callandor>(), ItemType <QuartzSpear>(), ItemType <ShiningTrigger>(), ItemType <Slamborite>(), ItemType <Shimmer>(), ItemType <Shatterocket>(), ItemType <RoyalShredder>() }); npcLoot.Add(new DropBasedOnExpertMode(normalModeRule, ItemDropRule.BossBag(ItemType <Items.CrystalBag>()))); npcLoot.Add(new DefeatCrystalKing()); }
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) { base.ModifyNPCLoot(npc, npcLoot); LeadingConditionRule emodeRule = new LeadingConditionRule(new EModeDropCondition()); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ModContent.ItemType <GuttedHeart>())); emodeRule.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ItemID.CrimsonFishingCrate, 5)); //to make up for no loot until dead emodeRule.OnSuccess(ItemDropRule.Common(ItemID.TissueSample, 1, 60, 60)); emodeRule.OnSuccess(ItemDropRule.Common(ItemID.CrimtaneOre, 1, 200, 200)); npcLoot.Add(emodeRule); }
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) { base.ModifyNPCLoot(npc, npcLoot); LeadingConditionRule emodeRule = new LeadingConditionRule(new EModeDropCondition()); LeadingConditionRule lastEater = new LeadingConditionRule(new Conditions.LegacyHack_IsABoss()); emodeRule.OnSuccess(lastEater); lastEater.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ModContent.ItemType <DarkenedHeart>())); lastEater.OnSuccess(FargoSoulsUtil.BossBagDropCustom(ItemID.CorruptFishingCrate, 5)); //to make up for no loot until dead lastEater.OnSuccess(ItemDropRule.Common(ItemID.ShadowScale, 1, 60, 60)); lastEater.OnSuccess(ItemDropRule.Common(ItemID.DemoniteOre, 1, 200, 200)); npcLoot.Add(emodeRule); }
public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(new CommonDrop(ItemType <Items.EnchantedGeode>(), 2)); }
public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(new CommonDrop(ItemType <Items.ShinyGemstone>(), 2)); }