Core/SAI: add cooldownMin (event_param2) and cooldownMax (event_param3) to SMART_EVENT_ACCEPTED_QUEST and SMART_EVENT_REWARD_QUEST.

Port From (https://github.com/TrinityCore/TrinityCore/commit/7745e3f94389cf22cf9be04b411e94936306a6f6)
This commit is contained in:
hondacrx
2021-12-22 20:13:01 -05:00
parent 2cbed03883
commit 6a295f7fe4
2 changed files with 6 additions and 0 deletions
@@ -689,6 +689,9 @@ namespace Game.AI
case SmartEvents.RewardQuest:
if (e.Event.quest.questId != 0 && !IsQuestValid(e, e.Event.quest.questId))
return false;
if (!IsMinMaxValid(e, e.Event.quest.cooldownMin, e.Event.quest.cooldownMax))
return false;
break;
case SmartEvents.ReceiveEmote:
{
@@ -2097,6 +2100,8 @@ namespace Game.AI
public struct Quest
{
public uint questId;
public uint cooldownMin;
public uint cooldownMax;
}
public struct QuestObjective
{
@@ -3478,6 +3478,7 @@ namespace Game.AI
{
if (e.Event.quest.questId != 0 && var0 != e.Event.quest.questId)
return;
RecalcTimer(e, e.Event.quest.cooldownMin, e.Event.quest.cooldownMax);
ProcessAction(e, unit, var0);
break;
}