Fixed selecting quest package rewards

This commit is contained in:
hondacrx
2017-07-02 12:00:48 -04:00
parent 0022923079
commit 06f203082f
3 changed files with 10 additions and 2 deletions
+4 -1
View File
@@ -195,8 +195,11 @@ namespace Game.Entities
maxDamage = (float)Math.Floor(avgDamage * (GetStatScalingFactor() * 0.5f + 1.0f) + 0.5f); maxDamage = (float)Math.Floor(avgDamage * (GetStatScalingFactor() * 0.5f + 1.0f) + 0.5f);
} }
public bool IsUsableByLootSpecialization(Player player) public bool IsUsableByLootSpecialization(Player player, bool alwaysAllowBoundToAccount)
{ {
if (GetFlags().HasAnyFlag(ItemFlags.IsBoundToAccount) && alwaysAllowBoundToAccount)
return true;
uint spec = player.GetUInt32Value(PlayerFields.LootSpecId); uint spec = player.GetUInt32Value(PlayerFields.LootSpecId);
if (spec == 0) if (spec == 0)
spec = player.GetUInt32Value(PlayerFields.CurrentSpecId); spec = player.GetUInt32Value(PlayerFields.CurrentSpecId);
+1 -1
View File
@@ -806,7 +806,7 @@ namespace Game.Entities
switch (questPackageItem.FilterType) switch (questPackageItem.FilterType)
{ {
case QuestPackageFilter.LootSpecialization: case QuestPackageFilter.LootSpecialization:
return rewardProto.IsUsableByLootSpecialization(this); return rewardProto.IsUsableByLootSpecialization(this, true);
case QuestPackageFilter.Class: case QuestPackageFilter.Class:
return rewardProto.ItemSpecClassMask == 0 || (rewardProto.ItemSpecClassMask & getClassMask()) != 0; return rewardProto.ItemSpecClassMask == 0 || (rewardProto.ItemSpecClassMask & getClassMask()) != 0;
case QuestPackageFilter.Everyone: case QuestPackageFilter.Everyone:
+5
View File
@@ -4340,6 +4340,11 @@ namespace Game
} }
} }
// Items that have no specializations set can be used by everyone
foreach (var specs in itemTemplate.Specializations)
if (specs.Count == 0)
specs.SetAll(true);
++sparseCount; ++sparseCount;
ItemTemplateStorage.Add(sparse.Id, itemTemplate); ItemTemplateStorage.Add(sparse.Id, itemTemplate);
} }