Fixed selecting quest package rewards
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user