public void Populate(Enemy enemy, Tuple <Player, int> playerData, Random rnd, string lootState, IList <LootDef> lootDefs) { BagType = BagType.Blue; Lootstate = lootState; var whitebag = new[] { new Drops( new ItemLoot(itemName, LootUtils.GetProbability(enemy, LootBagRate.WHITE_BAG, eventChest), false, true) ) }; whitebag[0].Populate(enemy, playerData, rnd, Lootstate, lootDefs); }
public void Populate(Enemy enemy, Tuple <Player, int> playerData, Random rnd, string lootState, IList <LootDef> lootDefs) { BagType = BagType.Purple; Lootstate = lootState; var purpleBag = new[] { new Drops( new TierLoot(tier, itemType, BagType, false, LootUtils.GetProbability(enemy, LootBagRate.PURPLE_BAG)) ) }; purpleBag[0].Populate(enemy, playerData, rnd, lootState, lootDefs); }
public void Populate(Enemy enemy, Tuple <Player, int> playerData, Random rnd, string lootState, IList <LootDef> lootDefs) { BagType = BagType.Cyan; Lootstate = lootState; var cyanBag = !setByTier ? new[] { new Drops( new ItemLoot(itemName, LootUtils.GetProbability(enemy, LootBagRate.CYAN_BAG), false, false) ) } : new[] { new Drops( new TierLoot(tier, itemType, BagType, false, LootUtils.GetProbability(enemy, LootBagRate.CYAN_BAG)) ) }; cyanBag[0].Populate(enemy, playerData, rnd, lootState, lootDefs); }
public void Populate(Enemy enemy, Tuple <Player, int> playerData, Random rnd, string lootState, IList <LootDef> lootDefs) { Lootstate = lootState; var candidates = GameServer.Manager.GameData.Items .Where(item => item.Value.SlotType == 9000) .Where(item => item.Value.MinStars <= (int)rarity) .Select(item => item.Value) .ToArray(); var onlyOne = candidates[Environment.TickCount % candidates.Length]; double probability = 0; if (onlyOne.MinStars < 8) { probability = .15; // 15% } else if (onlyOne.MinStars >= 8 && onlyOne.MinStars < 12) { probability = .05; // 5% } else if (onlyOne.MinStars >= 12 && onlyOne.MinStars < 20) { probability = .01; // 1% } else { probability = .0025; // 0.25% } var eggBasket = new[] { new Drops( new ItemLoot(onlyOne.ObjectType, LootUtils.GetProbability(enemy, probability), false) ) }; eggBasket[0].Populate(enemy, playerData, rnd, lootState, lootDefs); }