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:
@@ -689,6 +689,9 @@ namespace Game.AI
|
|||||||
case SmartEvents.RewardQuest:
|
case SmartEvents.RewardQuest:
|
||||||
if (e.Event.quest.questId != 0 && !IsQuestValid(e, e.Event.quest.questId))
|
if (e.Event.quest.questId != 0 && !IsQuestValid(e, e.Event.quest.questId))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!IsMinMaxValid(e, e.Event.quest.cooldownMin, e.Event.quest.cooldownMax))
|
||||||
|
return false;
|
||||||
break;
|
break;
|
||||||
case SmartEvents.ReceiveEmote:
|
case SmartEvents.ReceiveEmote:
|
||||||
{
|
{
|
||||||
@@ -2097,6 +2100,8 @@ namespace Game.AI
|
|||||||
public struct Quest
|
public struct Quest
|
||||||
{
|
{
|
||||||
public uint questId;
|
public uint questId;
|
||||||
|
public uint cooldownMin;
|
||||||
|
public uint cooldownMax;
|
||||||
}
|
}
|
||||||
public struct QuestObjective
|
public struct QuestObjective
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3478,6 +3478,7 @@ namespace Game.AI
|
|||||||
{
|
{
|
||||||
if (e.Event.quest.questId != 0 && var0 != e.Event.quest.questId)
|
if (e.Event.quest.questId != 0 && var0 != e.Event.quest.questId)
|
||||||
return;
|
return;
|
||||||
|
RecalcTimer(e, e.Event.quest.cooldownMin, e.Event.quest.cooldownMax);
|
||||||
ProcessAction(e, unit, var0);
|
ProcessAction(e, unit, var0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user