public void ChargeAlchemy(BonusData bonus) { RavenhillResourceService resourceService = engine.GetService <IResourceService>().Cast <RavenhillResourceService>(); PlayerService playerService = engine.GetService <IPlayerService>().Cast <PlayerService>(); foreach (var pair in bonus.ingredients) { IngredientData ingredientData = resourceService.GetIngredient(pair.Key); playerService.RemoveItem(ingredientData.type, ingredientData.id, pair.Value); } playerService.AddItem(new InventoryItem(bonus, 1)); //engine.Cast<RavenhillEngine>().DropItems(new List<DropItem> { new DropItem(DropType.item, 1, bonus )}); RavenhillEvents.OnAlchemyCharged(bonus); }