public void RenderQuest(Address avatarAddress, IEnumerable <int> ids) { foreach (var id in ids) { LocalLayerModifier.AddReceivableQuest(avatarAddress, id); var currentAvatarState = States.Instance.CurrentAvatarState; if (currentAvatarState.address != avatarAddress) { continue; } var quest = currentAvatarState.questList.First(q => q.Id == id); var rewardMap = quest.Reward.ItemMap; foreach (var reward in rewardMap) { var materialRow = Game.Game.instance.TableSheets.MaterialItemSheet .First(pair => pair.Key == reward.Key); LocalLayerModifier.RemoveItem(avatarAddress, materialRow.Value.ItemId, reward.Value); } } }