Ejemplo n.º 1
0
        public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
        {
            base.ModifyNPCLoot(npc, npcLoot);

            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.FrogLeg, 10));
            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.BalloonPufferfish, 10));
        }
Ejemplo n.º 2
0
 public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
 {
     if (npc.type == NPCID.Mothron)
     {
         npcLoot.Add(ItemDropRule.Common(ItemType <Items.BrokenStaff>(), 4));
     }
 }
Ejemplo n.º 3
0
 public static IItemDropRule NormalvsExpert(
     int itemId,
     int oncePerXInNormal,
     int oncePerXInExpert)
 {
     return((IItemDropRule) new DropBasedOnExpertMode(ItemDropRule.Common(itemId, oncePerXInNormal, 1, 1), ItemDropRule.Common(itemId, oncePerXInExpert, 1, 1)));
 }
Ejemplo n.º 4
0
        public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
        {
            base.ModifyNPCLoot(npc, npcLoot);

            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.GoodieBag, 1, 1, 5));
            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.BloodyMachete, 10));
        }
        public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
        {
            base.ModifyNPCLoot(npc, npcLoot);

            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.DesertFossil, 3, 1, 10));
            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.FlyingCarpet, 100));
        }
Ejemplo n.º 6
0
 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));
 }
Ejemplo n.º 7
0
        public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
        {
            base.ModifyNPCLoot(npc, npcLoot);

            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.Starfish, 10, 1, 3));
            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.Seashell, 10, 1, 3));
        }
Ejemplo n.º 8
0
 public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
 {
     if (npc.type == NPCID.UndeadMiner)
     {
         npcLoot.Add(ItemDropRule.Common(ModContent.ItemType <MinersBackpack>(), 5));
     }
 }
        public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
        {
            base.ModifyNPCLoot(npc, npcLoot);

            switch (npc.type)
            {
            case NPCID.Medusa:
                npcLoot.RemoveWhere(rule => rule is CommonDrop drop && drop.itemId == ItemID.MedusaHead && FargoSoulsUtil.LockEarlyBirdDrop(npcLoot, rule));
                break;

            case NPCID.WyvernHead:
                npcLoot.RemoveWhere(rule => rule is DropBasedOnExpertMode drop && drop.ruleForNormalMode is CommonDrop drop2 && drop2.itemId == ItemID.SoulofFlight && FargoSoulsUtil.LockEarlyBirdDrop(npcLoot, rule));
                break;

            case NPCID.PigronHallow:
            case NPCID.PigronCorruption:
            case NPCID.PigronCrimson:
                npcLoot.RemoveWhere(rule => rule is ItemDropWithConditionRule drop && drop.condition is Conditions.DontStarveIsUp && drop.itemId == ItemID.HamBat && FargoSoulsUtil.LockEarlyBirdDrop(npcLoot, rule));
                npcLoot.RemoveWhere(rule => rule is ItemDropWithConditionRule drop && drop.condition is Conditions.DontStarveIsNotUp && drop.itemId == ItemID.HamBat && FargoSoulsUtil.LockEarlyBirdDrop(npcLoot, rule));
                break;

            case NPCID.RedDevil:
                npcLoot.RemoveWhere(rule => rule is CommonDrop drop && drop.itemId == ItemID.UnholyTrident && FargoSoulsUtil.LockEarlyBirdDrop(npcLoot, rule));
                FargoSoulsUtil.AddEarlyBirdDrop(npcLoot, ItemDropRule.Common(ItemID.DemonScythe, 3));
                break;

            case NPCID.IchorSticker:
                npcLoot.RemoveWhere(rule => rule is CommonDrop drop && drop.itemId == ItemID.Ichor && FargoSoulsUtil.LockEarlyBirdDrop(npcLoot, rule));
                FargoSoulsUtil.AddEarlyBirdDrop(npcLoot, ItemDropRule.OneFromOptions(1, ItemID.TheUndertaker, ItemID.TheRottedFork, ItemID.CrimsonRod, ItemID.CrimsonHeart, ItemID.PanicNecklace));
                break;

            case NPCID.SeekerHead:
                npcLoot.RemoveWhere(rule => rule is CommonDrop drop && drop.itemId == ItemID.CursedFlame && FargoSoulsUtil.LockEarlyBirdDrop(npcLoot, rule));
                FargoSoulsUtil.AddEarlyBirdDrop(npcLoot, ItemDropRule.OneFromOptions(1, ItemID.BallOHurt, ItemID.BandofStarpower, ItemID.Musket, ItemID.ShadowOrb, ItemID.Vilethorn));
                break;

            case NPCID.Mimic:
                npcLoot.RemoveWhere(rule => rule is OneFromOptionsDropRule drop && drop.dropIds.Contains(ItemID.DualHook) && FargoSoulsUtil.LockEarlyBirdDrop(npcLoot, rule));
                FargoSoulsUtil.AddEarlyBirdDrop(npcLoot, ItemDropRule.OneFromOptions(1, ItemID.TitanGlove, ItemID.PhilosophersStone, ItemID.CrossNecklace, ItemID.DualHook));
                break;

            case NPCID.IceMimic:
                npcLoot.RemoveWhere(rule => rule is CommonDrop drop && drop.itemId == ItemID.ToySled && FargoSoulsUtil.LockEarlyBirdDrop(npcLoot, rule));
                FargoSoulsUtil.AddEarlyBirdDrop(npcLoot, ItemDropRule.OneFromOptions(1, ItemID.TitanGlove, ItemID.PhilosophersStone, ItemID.CrossNecklace, ItemID.DualHook));
                break;

            case NPCID.AngryNimbus:
                npcLoot.RemoveWhere(rule => rule is CommonDrop drop && drop.itemId == ItemID.NimbusRod && FargoSoulsUtil.LockEarlyBirdDrop(npcLoot, rule));
                FargoSoulsUtil.AddEarlyBirdDrop(npcLoot, ItemDropRule.Common(ItemID.FloatingIslandFishingCrate));
                break;

            case NPCID.DuneSplicerHead:
                FargoSoulsUtil.AddEarlyBirdDrop(npcLoot, ItemDropRule.Common(ItemID.SandstorminaBottle, 3));
                FargoSoulsUtil.AddEarlyBirdDrop(npcLoot, ItemDropRule.Common(ItemID.OasisCrate));
                break;

            default: break;
            }
        }
Ejemplo n.º 10
0
        public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
        {
            base.ModifyNPCLoot(npc, npcLoot);

            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.GlowingMushroom, 1, 1, 5));
            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.MushroomGrassSeeds, 5));
            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.TruffleWorm, 20));
        }
Ejemplo n.º 11
0
        public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
        {
            base.ModifyNPCLoot(npc, npcLoot);

            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ModContent.ItemType <Items.Accessories.Masomode.SecurityWallet>(), 5));
            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.CoinGun, 50));
            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.LuckyCoin, 50));
        }
Ejemplo n.º 12
0
        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));
        }
Ejemplo n.º 13
0
        public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
        {
            base.ModifyNPCLoot(npc, npcLoot);

            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.FrozenCrateHard));
            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ModContent.ItemType <Items.Accessories.Masomode.FrigidGemstone>(), 5));
            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.BlizzardinaBottle, 20));
        }
Ejemplo n.º 14
0
        public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
        {
            base.ModifyNPCLoot(npc, npcLoot);

            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ModContent.ItemType <Items.Accessories.Masomode.SandsofTime>(), 5));
            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.OasisCrateHard));
            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.SandstorminaBottle, 20));
        }
Ejemplo n.º 15
0
        public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
        {
            base.ModifyNPCLoot(npc, npcLoot);

            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.GoodieBag, 1, 1, 5));
            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.BladedGlove, 10));
            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ModContent.ItemType <PumpkingsCape>(), 5));
        }
Ejemplo n.º 16
0
        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));
        }
Ejemplo n.º 17
0
        public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
        {
            base.ModifyNPCLoot(npc, npcLoot);

            if (npc.type == NPCID.BlackRecluse || npc.type == NPCID.BlackRecluseWall)
            {
                FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.SpiderEgg, 50));
            }
        }
Ejemplo n.º 18
0
        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));
        }
Ejemplo n.º 19
0
        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));
            }
        }
Ejemplo n.º 20
0
        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));
        }
Ejemplo n.º 21
0
        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));
        }
Ejemplo n.º 22
0
        public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
        {
            base.ModifyNPCLoot(npc, npcLoot);

            if (npc.type == NPCID.AngryTrapper)
            {
                FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.Vine, 2));
            }

            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ModContent.Find <ModItem>("Fargowiltas", "PlanterasFruit").Type, 200));
        }
Ejemplo n.º 23
0
        public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
        {
            base.ModifyNPCLoot(npc, npcLoot);

            if (npc.type == NPCID.MossHornet)
            {
                FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.Stinger, 2));
            }

            FargoSoulsUtil.EModeDrop(npcLoot, ItemDropRule.Common(ItemID.JungleGrassSeeds, 10));
        }
Ejemplo n.º 24
0
 public static IItemDropRule DropOnBattleground(SoraPlayer wielder, int itemID, int chanceDenominator = 1, int minimumDropped = 1, int maximumDropped = 1)
 {
     if (wielder.fightingInBattleground)
     {
         return(ItemDropRule.Common(itemID, chanceDenominator, minimumDropped, maximumDropped));
     }
     else
     {
         return(ItemDropRule.DropNothing());
     }
 }
Ejemplo n.º 25
0
        //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!!
        }
Ejemplo n.º 26
0
        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);
        }
Ejemplo n.º 27
0
        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);
        }
Ejemplo n.º 28
0
        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);
        }
Ejemplo n.º 29
0
        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));
            }
        }
Ejemplo n.º 30
0
 public override void ModifyGlobalLoot(GlobalLoot globalLoot)
 {
     if (NPC.downedMoonlord)
     {
         globalLoot.Add(ItemDropRule.Common(ModContent.ItemType <Items.LootBag5>(), Amounts.tierFiveChance));
     }
     else if (NPC.downedPlantBoss)
     {
         globalLoot.Add(ItemDropRule.Common(ModContent.ItemType <Items.LootBag4>(), Amounts.tierFourChance));
     }
     else if (Main.hardMode)
     {
         globalLoot.Add(ItemDropRule.Common(ModContent.ItemType <Items.LootBag3>(), Amounts.tierThreeChance));
     }
     else if (NPC.downedBoss3)
     {
         globalLoot.Add(ItemDropRule.Common(ModContent.ItemType <Items.LootBag2>(), Amounts.tierTwoChance));
     }
     else
     {
         globalLoot.Add(ItemDropRule.Common(ModContent.ItemType <Items.LootBag1>(), Amounts.tierOneChance));
     }
 }