mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
Core/Quests: Fixed selecting quest package rewards
* Also revert 7e9a041470
This commit is contained in:
3
sql/updates/world/master/2017_07_02_01_world.sql
Normal file
3
sql/updates/world/master/2017_07_02_01_world.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
UPDATE `quest_template` SET `RewardChoiceItemID1`=0, `RewardChoiceItemQuantity1`=0, `RewardChoiceItemID2`=0, `RewardChoiceItemQuantity2`=0 WHERE `ID`=26799;
|
||||
UPDATE `quest_template` SET `RewardChoiceItemID1`=0, `RewardChoiceItemQuantity1`=0, `RewardChoiceItemID2`=0, `RewardChoiceItemQuantity2`=0, `RewardChoiceItemID3`=0, `RewardChoiceItemQuantity3`=0 WHERE `ID`=26800;
|
||||
|
||||
@@ -212,8 +212,11 @@ void ItemTemplate::GetDamage(uint32 itemLevel, float& minDamage, float& maxDamag
|
||||
maxDamage = floor(float(avgDamage * (GetStatScalingFactor() * 0.5f + 1.0f) + 0.5f));
|
||||
}
|
||||
|
||||
bool ItemTemplate::IsUsableByLootSpecialization(Player const* player) const
|
||||
bool ItemTemplate::IsUsableByLootSpecialization(Player const* player, bool alwaysAllowBoundToAccount) const
|
||||
{
|
||||
if (GetFlags() & ITEM_FLAG_IS_BOUND_TO_ACCOUNT && alwaysAllowBoundToAccount)
|
||||
return true;
|
||||
|
||||
uint32 spec = player->GetUInt32Value(PLAYER_FIELD_LOOT_SPEC_ID);
|
||||
if (!spec)
|
||||
spec = player->GetUInt32Value(PLAYER_FIELD_CURRENT_SPEC_ID);
|
||||
|
||||
@@ -803,7 +803,7 @@ struct TC_GAME_API ItemTemplate
|
||||
char const* GetDefaultLocaleName() const;
|
||||
uint32 GetArmor(uint32 itemLevel) const;
|
||||
void GetDamage(uint32 itemLevel, float& minDamage, float& maxDamage) const;
|
||||
bool IsUsableByLootSpecialization(Player const* player) const;
|
||||
bool IsUsableByLootSpecialization(Player const* player, bool alwaysAllowBoundToAccount) const;
|
||||
static std::size_t CalculateItemSpecBit(ChrSpecializationEntry const* spec);
|
||||
};
|
||||
|
||||
|
||||
@@ -15103,7 +15103,7 @@ bool Player::CanSelectQuestPackageItem(QuestPackageItemEntry const* questPackage
|
||||
switch (questPackageItem->FilterType)
|
||||
{
|
||||
case QUEST_PACKAGE_FILTER_LOOT_SPECIALIZATION:
|
||||
return rewardProto->IsUsableByLootSpecialization(this);
|
||||
return rewardProto->IsUsableByLootSpecialization(this, true);
|
||||
case QUEST_PACKAGE_FILTER_CLASS:
|
||||
return !rewardProto->ItemSpecClassMask || (rewardProto->ItemSpecClassMask & getClassMask()) != 0;
|
||||
case QUEST_PACKAGE_FILTER_EVERYONE:
|
||||
|
||||
@@ -2902,6 +2902,11 @@ void ObjectMgr::LoadItemTemplates()
|
||||
}
|
||||
}
|
||||
|
||||
// Items that have no specializations set can be used by everyone
|
||||
for (auto& specs : itemTemplate.Specializations)
|
||||
if (specs.count() == 0)
|
||||
specs.set();
|
||||
|
||||
++sparseCount;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user