Exemple #1
0
        public void GenerateKillLoot(ICharacter victim, IContainer container)
        {
            if (victim.Blueprint == null)
            {
                return;
            }
            QuestKillLootTable <int> table;

            if (!Blueprint.KillLootTable.TryGetValue(victim.Blueprint.Id, out table))
            {
                return;
            }
            List <int> killLoots = table.GenerateLoots();

            if (killLoots != null)
            {
                foreach (int loot in killLoots)
                {
                    ItemQuestBlueprint questItemBlueprint = DependencyContainer.Instance.GetInstance <IWorld>().GetItemBlueprint(loot) as ItemQuestBlueprint;
                    if (questItemBlueprint != null)
                    {
                        IItemQuest questItem = DependencyContainer.Instance.GetInstance <IWorld>().AddItemQuest(Guid.NewGuid(), questItemBlueprint, container);
                        Log.Default.WriteLine(LogLevels.Debug, $"Loot objective {loot} generated for {_character.DisplayName}");
                    }
                    else
                    {
                        Log.Default.WriteLine(LogLevels.Warning, $"Loot objective {loot} doesn't exist (or is not quest item) for quest {Blueprint.Id}");
                    }
                }
            }
        }
Exemple #2
0
        public IItemQuest AddItemQuest(Guid guid, ItemQuestBlueprint blueprint, IContainer container)
        {
            if (blueprint == null)
            {
                throw new ArgumentNullException(nameof(blueprint));
            }
            IItemQuest item = new ItemQuest(guid, blueprint, container);

            _items.Add(item);
            return(item);
        }
Exemple #3
0
 public IItemQuest AddItemQuest(Guid guid, ItemQuestBlueprint blueprint, IContainer container)
 {
     throw new NotImplementedException();
 }