Core/Quest: do not send SMSG_QUESTGIVER_OFFER_REWARD right after SMSG_QUESTGIVER_QUEST_FAILED.
Port From (https://github.com/TrinityCore/TrinityCore/commit/ecce30a8072fd9352edae378a182f6bf6619d412)
This commit is contained in:
@@ -574,10 +574,6 @@ namespace Game.Entities
|
||||
|
||||
public bool CanRewardQuest(Quest quest, LootItemType rewardType, uint rewardId, bool msg)
|
||||
{
|
||||
// prevent receive reward with quest items in bank or for not completed quest
|
||||
if (!CanRewardQuest(quest, msg))
|
||||
return false;
|
||||
|
||||
List<ItemPosCount> dest = new();
|
||||
if (quest.GetRewChoiceItemsCount() > 0)
|
||||
{
|
||||
|
||||
@@ -350,14 +350,16 @@ namespace Game
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetPlayer().CanRewardQuest(quest, packet.Choice.LootItemType, packet.Choice.Item.ItemID, true))
|
||||
if (GetPlayer().CanRewardQuest(quest, true)) // First, check if player is allowed to turn the quest in (all objectives completed). If not, we send players to the offer reward screen
|
||||
{
|
||||
GetPlayer().RewardQuest(quest, packet.Choice.LootItemType, packet.Choice.Item.ItemID, obj);
|
||||
|
||||
switch (obj.GetTypeId())
|
||||
if (GetPlayer().CanRewardQuest(quest, packet.Choice.LootItemType, packet.Choice.Item.ItemID, true)) // Then check if player can receive the reward item (if inventory is not full, if player doesn't have too many unique items, and so on). If not, the client will close the gossip window
|
||||
{
|
||||
case TypeId.Unit:
|
||||
case TypeId.Player:
|
||||
GetPlayer().RewardQuest(quest, packet.Choice.LootItemType, packet.Choice.Item.ItemID, obj);
|
||||
|
||||
switch (obj.GetTypeId())
|
||||
{
|
||||
case TypeId.Unit:
|
||||
case TypeId.Player:
|
||||
{
|
||||
//For AutoSubmition was added plr case there as it almost same exclute AI script cases.
|
||||
// Send next quest
|
||||
@@ -380,7 +382,7 @@ namespace Game
|
||||
creatureQGiver.GetAI().QuestReward(_player, quest, packet.Choice.LootItemType, packet.Choice.Item.ItemID);
|
||||
break;
|
||||
}
|
||||
case TypeId.GameObject:
|
||||
case TypeId.GameObject:
|
||||
{
|
||||
GameObject questGiver = obj.ToGameObject();
|
||||
// Send next quest
|
||||
@@ -401,8 +403,9 @@ namespace Game
|
||||
questGiver.GetAI().QuestReward(_player, quest, packet.Choice.LootItemType, packet.Choice.Item.ItemID);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user