diff --git a/Source/Game/Conditions/ConditionManager.cs b/Source/Game/Conditions/ConditionManager.cs index acb2d4e82..1fc2deb93 100644 --- a/Source/Game/Conditions/ConditionManager.cs +++ b/Source/Game/Conditions/ConditionManager.cs @@ -768,14 +768,6 @@ namespace Game Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `creature_loot_template`, ignoring.", cond.ToString()); return false; } - - LootTemplate loot = LootStorage.Creature.GetLootForConditionFill(cond.SourceGroup); - ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) - { - Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, Item does not exist, ignoring.", cond.ToString()); - return false; - } break; } case ConditionSourceType.DisenchantLootTemplate: @@ -785,14 +777,6 @@ namespace Game Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `disenchant_loot_template`, ignoring.", cond.ToString()); return false; } - - LootTemplate loot = LootStorage.Disenchant.GetLootForConditionFill(cond.SourceGroup); - ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) - { - Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond.ToString()); - return false; - } break; } case ConditionSourceType.FishingLootTemplate: @@ -802,14 +786,6 @@ namespace Game Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `fishing_loot_template`, ignoring.", cond.ToString()); return false; } - - LootTemplate loot = LootStorage.Fishing.GetLootForConditionFill(cond.SourceGroup); - ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) - { - Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond.ToString()); - return false; - } break; } case ConditionSourceType.GameobjectLootTemplate: @@ -819,14 +795,6 @@ namespace Game Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `gameobject_loot_template`, ignoring.", cond.ToString()); return false; } - - LootTemplate loot = LootStorage.Gameobject.GetLootForConditionFill(cond.SourceGroup); - ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) - { - Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond.ToString()); - return false; - } break; } case ConditionSourceType.ItemLootTemplate: @@ -836,14 +804,6 @@ namespace Game Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `item_loot_template`, ignoring.", cond.ToString()); return false; } - - LootTemplate loot = LootStorage.Items.GetLootForConditionFill(cond.SourceGroup); - ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) - { - Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond.ToString()); - return false; - } break; } case ConditionSourceType.MailLootTemplate: @@ -853,14 +813,6 @@ namespace Game Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `mail_loot_template`, ignoring.", cond.ToString()); return false; } - - LootTemplate loot = LootStorage.Mail.GetLootForConditionFill(cond.SourceGroup); - ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) - { - Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond.ToString()); - return false; - } break; } case ConditionSourceType.MillingLootTemplate: @@ -870,14 +822,6 @@ namespace Game Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `milling_loot_template`, ignoring.", cond.ToString()); return false; } - - LootTemplate loot = LootStorage.Milling.GetLootForConditionFill(cond.SourceGroup); - ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) - { - Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond.ToString()); - return false; - } break; } case ConditionSourceType.PickpocketingLootTemplate: @@ -887,14 +831,6 @@ namespace Game Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `pickpocketing_loot_template`, ignoring.", cond.ToString()); return false; } - - LootTemplate loot = LootStorage.Pickpocketing.GetLootForConditionFill(cond.SourceGroup); - ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) - { - Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond.ToString()); - return false; - } break; } case ConditionSourceType.ProspectingLootTemplate: @@ -904,14 +840,6 @@ namespace Game Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `prospecting_loot_template`, ignoring.", cond.ToString()); return false; } - - LootTemplate loot = LootStorage.Prospecting.GetLootForConditionFill(cond.SourceGroup); - ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) - { - Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond.ToString()); - return false; - } break; } case ConditionSourceType.ReferenceLootTemplate: @@ -921,14 +849,6 @@ namespace Game Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `reference_loot_template`, ignoring.", cond.ToString()); return false; } - - LootTemplate loot = LootStorage.Reference.GetLootForConditionFill(cond.SourceGroup); - ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) - { - Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond.ToString()); - return false; - } break; } case ConditionSourceType.SkinningLootTemplate: @@ -938,14 +858,6 @@ namespace Game Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `skinning_loot_template`, ignoring.", cond.ToString()); return false; } - - LootTemplate loot = LootStorage.Skinning.GetLootForConditionFill(cond.SourceGroup); - ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) - { - Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond.ToString()); - return false; - } break; } case ConditionSourceType.SpellLootTemplate: @@ -955,14 +867,6 @@ namespace Game Log.outError(LogFilter.Sql, "{0} SourceGroup in `condition` table, does not exist in `spell_loot_template`, ignoring.", cond.ToString()); return false; } - - LootTemplate loot = LootStorage.Spell.GetLootForConditionFill(cond.SourceGroup); - ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) - { - Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, item does not exist, ignoring.", cond.ToString()); - return false; - } break; } case ConditionSourceType.SpellImplicitTarget: diff --git a/Source/Game/Loot/LootManager.cs b/Source/Game/Loot/LootManager.cs index dbbe7f7f2..c5a684eb2 100644 --- a/Source/Game/Loot/LootManager.cs +++ b/Source/Game/Loot/LootManager.cs @@ -1064,15 +1064,6 @@ namespace Game.Loots return false; } - public bool IsReference(uint id) - { - foreach (var storeItem in Entries) - if (storeItem.itemid == id && storeItem.reference > 0) - return true; - - return false;//not found or not reference - } - LootStoreItemList Entries = new(); // not grouped only Dictionary Groups = new(); // groups have own (optimised) processing, grouped entries go there