示例#1
0
        public bool HasQuestDrop(LootTemplateMap store, byte groupId = 0)
        {
            if (groupId != 0)                                            // Group reference
            {
                if (groupId > Groups.Count)
                    return false;                                   // Error message [should be] already printed at loading stage

                if (Groups[groupId - 1] == null)
                    return false;

                return Groups[groupId - 1].HasQuestDrop();
            }

            foreach (var item in Entries)
            {
                if (item.reference > 0)                        // References
                {
                    var Referenced = store.LookupByKey(item.reference);
                    if (Referenced == null)
                        continue;                                   // Error message [should be] already printed at loading stage
                    if (Referenced.HasQuestDrop(store, item.groupid))
                        return true;
                }
                else if (item.needs_quest)
                    return true;                                    // quest drop found
            }

            // Now processing groups
            foreach (var group in Groups.Values)
                if (group.HasQuestDrop())
                    return true;

            return false;
        }
示例#2
0
        public bool HasQuestDropForPlayer(LootTemplateMap store, Player player, byte groupId = 0)
        {
            if (groupId != 0)                                            // Group reference
            {
                if (groupId > Groups.Count)
                    return false;                                   // Error message already printed at loading stage

                if (Groups[groupId - 1] == null)
                    return false;

                return Groups[groupId - 1].HasQuestDropForPlayer(player);
            }

            // Checking non-grouped entries
            foreach (var item in Entries)
            {
                if (item.reference > 0)                        // References processing
                {
                    var Referenced = store.LookupByKey(item.reference);
                    if (Referenced == null)
                        continue;                                   // Error message already printed at loading stage
                    if (Referenced.HasQuestDropForPlayer(store, player, item.groupid))
                        return true;
                }
                else if (player.HasQuestForItem(item.itemid))
                    return true;                                    // active quest drop found
            }

            // Now checking groups
            foreach (var group in Groups.Values)
                if (group.HasQuestDropForPlayer(player))
                    return true;

            return false;
        }
示例#3
0
            public void CheckLootRefs(LootTemplateMap store, List <uint> ref_set)
            {
                foreach (var item in ExplicitlyChanced)
                {
                    if (item.reference > 0)
                    {
                        if (LootStorage.Reference.GetLootFor(item.reference) == null)
                        {
                            LootStorage.Reference.ReportNonExistingId(item.reference, item.itemid);
                        }
                        else if (ref_set != null)
                        {
                            ref_set.Remove(item.reference);
                        }
                    }
                }

                foreach (var item in EqualChanced)
                {
                    if (item.reference > 0)
                    {
                        if (LootStorage.Reference.GetLootFor(item.reference) == null)
                        {
                            LootStorage.Reference.ReportNonExistingId(item.reference, item.itemid);
                        }
                        else if (ref_set != null)
                        {
                            ref_set.Remove(item.reference);
                        }
                    }
                }
            }
示例#4
0
        public void CheckLootRefs(LootTemplateMap store, List<uint> ref_set)
        {
            foreach (var item in Entries)
            {
                if (item.reference > 0)
                {
                    if (LootManager.Reference.GetLootFor(item.reference) == null)
                        LootManager.Reference.ReportNonExistingId(item.reference, item.itemid);
                    else if (ref_set != null)
                        ref_set.Remove(item.reference);
                }
            }

            foreach (var group in Groups.Values)
                group.CheckLootRefs(store, ref_set);
        }