[Tasks] Make Task Selector Cooldown Optional (#2420)

Some live npcs ignore the request cooldown timer (tutorialb)

A separate function had to be used for perl because the apis use an
array instead of array reference which won't allow a bool overload

This also replaces the fixed array and count args with a vector
This commit is contained in:
hg
2022-09-03 13:20:03 -04:00
committed by GitHub
parent 5e9a9e8afe
commit aa3c72c1de
10 changed files with 120 additions and 112 deletions
+4 -4
View File
@@ -2294,10 +2294,10 @@ bool QuestManager::createBot(const char *name, const char *lastname, uint8 level
#endif //BOTS
void QuestManager::taskselector(int taskcount, int *tasks) {
void QuestManager::taskselector(const std::vector<int>& tasks, bool ignore_cooldown) {
QuestManagerCurrentQuestVars();
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && owner && task_manager)
initiator->TaskQuestSetSelector(owner, taskcount, tasks);
initiator->TaskQuestSetSelector(owner, tasks, ignore_cooldown);
}
void QuestManager::enabletask(int taskcount, int *tasks) {
QuestManagerCurrentQuestVars();
@@ -2322,11 +2322,11 @@ bool QuestManager::istaskenabled(int taskid) {
return false;
}
void QuestManager::tasksetselector(int tasksetid) {
void QuestManager::tasksetselector(int tasksetid, bool ignore_cooldown) {
QuestManagerCurrentQuestVars();
Log(Logs::General, Logs::Tasks, "[UPDATE] TaskSetSelector called for task set %i", tasksetid);
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && owner && task_manager)
initiator->TaskSetSelector(owner, tasksetid);
initiator->TaskSetSelector(owner, tasksetid, ignore_cooldown);
}
bool QuestManager::istaskactive(int task) {