mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-02 22:03:52 +00:00
First pass
This commit is contained in:
parent
e8ab176d4a
commit
b7983d4c20
@ -76,7 +76,7 @@
|
||||
|
||||
extern QueryServ* QServ;
|
||||
extern WorldServer worldserver;
|
||||
extern TaskManager *taskmanager;
|
||||
extern TaskManager *p_task_manager;
|
||||
void CatchSignal(int sig_num);
|
||||
|
||||
|
||||
|
||||
@ -258,7 +258,7 @@ Client::Client(EQStreamInterface* ieqs)
|
||||
tgb = false;
|
||||
tribute_master_id = 0xFFFFFFFF;
|
||||
tribute_timer.Disable();
|
||||
taskstate = nullptr;
|
||||
task_state = nullptr;
|
||||
TotalSecondsPlayed = 0;
|
||||
keyring.clear();
|
||||
bind_sight_target = nullptr;
|
||||
@ -452,7 +452,7 @@ Client::~Client() {
|
||||
// will need this data right away
|
||||
Save(2); // This fails when database destructor is called first on shutdown
|
||||
|
||||
safe_delete(taskstate);
|
||||
safe_delete(task_state);
|
||||
safe_delete(KarmaUpdateTimer);
|
||||
safe_delete(GlobalChatLimiterTimer);
|
||||
safe_delete(qGlobals);
|
||||
|
||||
283
zone/client.h
283
zone/client.h
@ -86,7 +86,7 @@ namespace EQ
|
||||
#define XTARGET_HARDCAP 20
|
||||
|
||||
extern Zone* zone;
|
||||
extern TaskManager *taskmanager;
|
||||
extern TaskManager *p_task_manager;
|
||||
|
||||
class CLIENTPACKET
|
||||
{
|
||||
@ -1006,7 +1006,7 @@ public:
|
||||
uint32 GetSpellIDByBookSlot(int book_slot);
|
||||
int GetNextAvailableSpellBookSlot(int starting_slot = 0);
|
||||
inline uint32 GetSpellByBookSlot(int book_slot) { return m_pp.spell_book[book_slot]; }
|
||||
inline bool HasSpellScribed(int spellid) { return (FindSpellBookSlotBySpellID(spellid) != -1 ? true : false); }
|
||||
inline bool HasSpellScribed(int spellid) { return FindSpellBookSlotBySpellID(spellid) != -1; }
|
||||
uint16 GetMaxSkillAfterSpecializationRules(EQ::skills::SkillType skillid, uint16 maxSkill);
|
||||
void SendPopupToClient(const char *Title, const char *Text, uint32 PopupID = 0, uint32 Buttons = 0, uint32 Duration = 0);
|
||||
void SendFullPopup(const char *Title, const char *Text, uint32 PopupID = 0, uint32 NegativeID = 0, uint32 Buttons = 0, uint32 Duration = 0, const char *ButtonName0 = 0, const char *ButtonName1 = 0, uint32 SoundControls = 0);
|
||||
@ -1021,48 +1021,241 @@ public:
|
||||
// Task System Methods
|
||||
void LoadClientTaskState();
|
||||
void RemoveClientTaskState();
|
||||
void SendTaskActivityComplete(int TaskID, int ActivityID, int TaskIndex, TaskType type, int TaskIncomplete=1);
|
||||
void SendTaskFailed(int TaskID, int TaskIndex, TaskType type);
|
||||
void SendTaskComplete(int TaskIndex);
|
||||
inline ClientTaskState *GetTaskState() const { return taskstate; }
|
||||
|
||||
inline void CancelTask(int TaskIndex, TaskType type) { if(taskstate) taskstate->CancelTask(this, TaskIndex, type); }
|
||||
inline bool SaveTaskState() { return (taskmanager ? taskmanager->SaveClientState(this, taskstate) : false); }
|
||||
inline bool IsTaskStateLoaded() { return taskstate != nullptr; }
|
||||
inline bool IsTaskActive(int TaskID) { return (taskstate ? taskstate->IsTaskActive(TaskID) : false); }
|
||||
inline bool IsTaskActivityActive(int TaskID, int ActivityID) { return (taskstate ? taskstate->IsTaskActivityActive(TaskID, ActivityID) : false); }
|
||||
inline ActivityState GetTaskActivityState(TaskType type, int index, int ActivityID) { return (taskstate ? taskstate->GetTaskActivityState(type, index, ActivityID) : ActivityHidden); }
|
||||
inline void UpdateTaskActivity(int TaskID, int ActivityID, int Count, bool ignore_quest_update = false) { if (taskstate) taskstate->UpdateTaskActivity(this, TaskID, ActivityID, Count, ignore_quest_update); }
|
||||
inline void RemoveTaskByTaskID(uint32 task_id) { if (taskstate) taskstate->RemoveTaskByTaskID(this, task_id); }
|
||||
inline void ResetTaskActivity(int TaskID, int ActivityID) { if(taskstate) taskstate->ResetTaskActivity(this, TaskID, ActivityID); }
|
||||
inline void UpdateTasksOnKill(int NPCTypeID) { if(taskstate) taskstate->UpdateTasksOnKill(this, NPCTypeID); }
|
||||
inline void UpdateTasksForItem(ActivityType Type, int ItemID, int Count=1) { if(taskstate) taskstate->UpdateTasksForItem(this, Type, ItemID, Count); }
|
||||
inline void UpdateTasksOnExplore(int ExploreID) { if(taskstate) taskstate->UpdateTasksOnExplore(this, ExploreID); }
|
||||
inline bool UpdateTasksOnSpeakWith(int NPCTypeID) { if(taskstate) return taskstate->UpdateTasksOnSpeakWith(this, NPCTypeID); else return false; }
|
||||
inline bool UpdateTasksOnDeliver(std::list<EQ::ItemInstance*>& Items, int Cash, int NPCTypeID) { if (taskstate) return taskstate->UpdateTasksOnDeliver(this, Items, Cash, NPCTypeID); else return false; }
|
||||
inline void TaskSetSelector(Mob *mob, int TaskSetID) { if(taskmanager) taskmanager->TaskSetSelector(this, taskstate, mob, TaskSetID); }
|
||||
inline void TaskQuestSetSelector(Mob *mob, int count, int *tasks) { if(taskmanager) taskmanager->TaskQuestSetSelector(this, taskstate, mob, count, tasks); }
|
||||
inline void EnableTask(int TaskCount, int *TaskList) { if(taskstate) taskstate->EnableTask(CharacterID(), TaskCount, TaskList); }
|
||||
inline void DisableTask(int TaskCount, int *TaskList) { if(taskstate) taskstate->DisableTask(CharacterID(), TaskCount, TaskList); }
|
||||
inline bool IsTaskEnabled(int TaskID) { return (taskstate ? taskstate->IsTaskEnabled(TaskID) : false); }
|
||||
inline void ProcessTaskProximities(float X, float Y, float Z) { if(taskstate) taskstate->ProcessTaskProximities(this, X, Y, Z); }
|
||||
inline void AssignTask(int TaskID, int NPCID, bool enforce_level_requirement = false) { if (taskstate) taskstate->AcceptNewTask(this, TaskID, NPCID, enforce_level_requirement); }
|
||||
inline int ActiveSpeakTask(int NPCID) { if(taskstate) return taskstate->ActiveSpeakTask(NPCID); else return 0; }
|
||||
inline int ActiveSpeakActivity(int NPCID, int TaskID) { if(taskstate) return taskstate->ActiveSpeakActivity(NPCID, TaskID); else return 0; }
|
||||
inline void FailTask(int TaskID) { if(taskstate) taskstate->FailTask(this, TaskID); }
|
||||
inline int TaskTimeLeft(int TaskID) { return (taskstate ? taskstate->TaskTimeLeft(TaskID) : 0); }
|
||||
inline int EnabledTaskCount(int TaskSetID) { return (taskstate ? taskstate->EnabledTaskCount(TaskSetID) : -1); }
|
||||
inline int IsTaskCompleted(int TaskID) { return (taskstate ? taskstate->IsTaskCompleted(TaskID) : -1); }
|
||||
inline void ShowClientTasks() { if(taskstate) taskstate->ShowClientTasks(this); }
|
||||
inline void CancelAllTasks() { if(taskstate) taskstate->CancelAllTasks(this); }
|
||||
inline int GetActiveTaskCount() { return (taskstate ? taskstate->GetActiveTaskCount() : 0); }
|
||||
inline int GetActiveTaskID(int index) { return (taskstate ? taskstate->GetActiveTaskID(index) : -1); }
|
||||
inline int GetTaskStartTime(TaskType type, int index) { return (taskstate ? taskstate->GetTaskStartTime(type, index) : -1); }
|
||||
inline bool IsTaskActivityCompleted(TaskType type, int index, int ActivityID) { return (taskstate ? taskstate->IsTaskActivityCompleted(type, index, ActivityID) : false); }
|
||||
inline int GetTaskActivityDoneCount(TaskType type, int ClientTaskIndex, int ActivityID) { return (taskstate ? taskstate->GetTaskActivityDoneCount(type, ClientTaskIndex, ActivityID) :0); }
|
||||
inline int GetTaskActivityDoneCountFromTaskID(int TaskID, int ActivityID) { return (taskstate ? taskstate->GetTaskActivityDoneCountFromTaskID(TaskID, ActivityID) :0); }
|
||||
inline int ActiveTasksInSet(int TaskSet) { return (taskstate ? taskstate->ActiveTasksInSet(TaskSet) :0); }
|
||||
inline int CompletedTasksInSet(int TaskSet) { return (taskstate ? taskstate->CompletedTasksInSet(TaskSet) :0); }
|
||||
void SendTaskActivityComplete(int task_id, int activity_id, int task_index, TaskType task_type, int task_incomplete=1);
|
||||
void SendTaskFailed(int task_id, int task_index, TaskType task_type);
|
||||
void SendTaskComplete(int task_index);
|
||||
inline ClientTaskState *GetTaskState() const { return task_state; }
|
||||
inline void CancelTask(int TaskIndex, TaskType type)
|
||||
{
|
||||
if (task_state) {
|
||||
task_state->CancelTask(
|
||||
this,
|
||||
TaskIndex,
|
||||
type
|
||||
);
|
||||
}
|
||||
}
|
||||
inline bool SaveTaskState()
|
||||
{
|
||||
return p_task_manager != nullptr && p_task_manager->SaveClientState(this, task_state);
|
||||
}
|
||||
inline bool IsTaskStateLoaded() { return task_state != nullptr; }
|
||||
inline bool IsTaskActive(int TaskID) { return task_state != nullptr && task_state->IsTaskActive(TaskID); }
|
||||
inline bool IsTaskActivityActive(int TaskID, int ActivityID)
|
||||
{
|
||||
return task_state != nullptr &&
|
||||
task_state->IsTaskActivityActive(
|
||||
TaskID,
|
||||
ActivityID
|
||||
);
|
||||
}
|
||||
inline ActivityState GetTaskActivityState(TaskType task_type, int index, int activity_id)
|
||||
{
|
||||
return (task_state ? task_state->GetTaskActivityState(task_type, index, activity_id) : ActivityHidden);
|
||||
}
|
||||
inline void UpdateTaskActivity(
|
||||
int task_id,
|
||||
int activity_id,
|
||||
int count,
|
||||
bool ignore_quest_update = false
|
||||
)
|
||||
{
|
||||
if (task_state) {
|
||||
task_state->UpdateTaskActivity(this, task_id, activity_id, count, ignore_quest_update);
|
||||
}
|
||||
}
|
||||
inline void RemoveTaskByTaskID(uint32 task_id) {
|
||||
if (task_state) {
|
||||
task_state->RemoveTaskByTaskID(this, task_id);
|
||||
}
|
||||
}
|
||||
inline void ResetTaskActivity(int task_id, int activity_id)
|
||||
{
|
||||
if (task_state) {
|
||||
task_state->ResetTaskActivity(
|
||||
this,
|
||||
task_id,
|
||||
activity_id
|
||||
);
|
||||
}
|
||||
}
|
||||
inline void UpdateTasksOnKill(int npc_type_id)
|
||||
{
|
||||
if (task_state) {
|
||||
task_state->UpdateTasksOnKill(
|
||||
this,
|
||||
npc_type_id
|
||||
);
|
||||
}
|
||||
}
|
||||
inline void UpdateTasksForItem(
|
||||
ActivityType activity_type,
|
||||
int item_id,
|
||||
int count = 1
|
||||
)
|
||||
{
|
||||
if (task_state) {
|
||||
task_state->UpdateTasksForItem(this, activity_type, item_id, count);
|
||||
}
|
||||
}
|
||||
inline void UpdateTasksOnExplore(int explore_id)
|
||||
{
|
||||
if (task_state) {
|
||||
task_state->UpdateTasksOnExplore(
|
||||
this,
|
||||
explore_id
|
||||
);
|
||||
}
|
||||
}
|
||||
inline bool UpdateTasksOnSpeakWith(int npc_type_id)
|
||||
{
|
||||
if (task_state) {
|
||||
return task_state->UpdateTasksOnSpeakWith(
|
||||
this,
|
||||
npc_type_id
|
||||
);
|
||||
}
|
||||
else { return false; }
|
||||
}
|
||||
inline bool UpdateTasksOnDeliver(
|
||||
std::list<EQ::ItemInstance *> &items,
|
||||
int cash,
|
||||
int npc_type_id
|
||||
)
|
||||
{
|
||||
if (task_state) {
|
||||
return task_state->UpdateTasksOnDeliver(
|
||||
this,
|
||||
items,
|
||||
cash,
|
||||
npc_type_id
|
||||
);
|
||||
}
|
||||
else { return false; }
|
||||
}
|
||||
inline void TaskSetSelector(Mob *mob, int task_set_id)
|
||||
{
|
||||
if (p_task_manager) {
|
||||
p_task_manager->TaskSetSelector(
|
||||
this,
|
||||
task_state,
|
||||
mob,
|
||||
task_set_id
|
||||
);
|
||||
}
|
||||
}
|
||||
inline void TaskQuestSetSelector(Mob *mob, int count, int *tasks)
|
||||
{
|
||||
if (p_task_manager) {
|
||||
p_task_manager->TaskQuestSetSelector(
|
||||
this,
|
||||
task_state,
|
||||
mob,
|
||||
count,
|
||||
tasks
|
||||
);
|
||||
}
|
||||
}
|
||||
inline void EnableTask(int task_count, int *task_list)
|
||||
{
|
||||
if (task_state) {
|
||||
task_state->EnableTask(
|
||||
CharacterID(),
|
||||
task_count,
|
||||
task_list
|
||||
);
|
||||
}
|
||||
}
|
||||
inline void DisableTask(int task_count, int *task_list)
|
||||
{
|
||||
if (task_state) {
|
||||
task_state->DisableTask(
|
||||
CharacterID(),
|
||||
task_count,
|
||||
task_list
|
||||
);
|
||||
}
|
||||
}
|
||||
inline bool IsTaskEnabled(int task_id) {
|
||||
return task_state != nullptr && task_state->IsTaskEnabled(task_id);
|
||||
}
|
||||
inline void ProcessTaskProximities(float X, float Y, float Z)
|
||||
{
|
||||
if (task_state) {
|
||||
task_state->ProcessTaskProximities(
|
||||
this,
|
||||
X,
|
||||
Y,
|
||||
Z
|
||||
);
|
||||
}
|
||||
}
|
||||
inline void AssignTask(
|
||||
int task_id,
|
||||
int npc_id,
|
||||
bool enforce_level_requirement = false
|
||||
) {
|
||||
if (task_state) {
|
||||
task_state->AcceptNewTask(this, task_id, npc_id, enforce_level_requirement);
|
||||
}
|
||||
}
|
||||
inline int ActiveSpeakTask(int npc_type_id)
|
||||
{
|
||||
if (task_state) {
|
||||
return task_state->ActiveSpeakTask(npc_type_id);
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
inline int ActiveSpeakActivity(int npc_type_id, int task_id)
|
||||
{
|
||||
if (task_state) {
|
||||
return task_state->ActiveSpeakActivity(
|
||||
npc_type_id,
|
||||
task_id
|
||||
);
|
||||
}
|
||||
else { return 0; }
|
||||
}
|
||||
inline void FailTask(int task_id) { if (task_state) { task_state->FailTask(this, task_id); }}
|
||||
inline int TaskTimeLeft(int task_id) { return (task_state ? task_state->TaskTimeLeft(task_id) : 0); }
|
||||
inline int EnabledTaskCount(int task_set_id)
|
||||
{
|
||||
return (task_state ? task_state->EnabledTaskCount(task_set_id) : -1);
|
||||
}
|
||||
inline int IsTaskCompleted(int task_id) { return (task_state ? task_state->IsTaskCompleted(task_id) : -1); }
|
||||
inline void ShowClientTasks() { if (task_state) { task_state->ShowClientTasks(this); }}
|
||||
inline void CancelAllTasks() { if (task_state) { task_state->CancelAllTasks(this); }}
|
||||
inline int GetActiveTaskCount() { return (task_state ? task_state->GetActiveTaskCount() : 0); }
|
||||
inline int GetActiveTaskID(int index) { return (task_state ? task_state->GetActiveTaskID(index) : -1); }
|
||||
inline int GetTaskStartTime(TaskType task_type, int index)
|
||||
{
|
||||
return (task_state ? task_state->GetTaskStartTime(
|
||||
task_type,
|
||||
index
|
||||
) : -1);
|
||||
}
|
||||
inline bool IsTaskActivityCompleted(TaskType task_type, int index, int activity_id)
|
||||
{
|
||||
return task_state != nullptr && task_state->IsTaskActivityCompleted(task_type, index, activity_id);
|
||||
}
|
||||
inline int GetTaskActivityDoneCount(TaskType task_type, int client_task_index, int activity_id)
|
||||
{
|
||||
return (task_state ? task_state->GetTaskActivityDoneCount(task_type, client_task_index, activity_id) : 0);
|
||||
}
|
||||
inline int GetTaskActivityDoneCountFromTaskID(int task_id, int activity_id)
|
||||
{
|
||||
return (task_state ? task_state->GetTaskActivityDoneCountFromTaskID(task_id, activity_id) : 0);
|
||||
}
|
||||
inline int ActiveTasksInSet(int task_set_id)
|
||||
{
|
||||
return (task_state ? task_state->ActiveTasksInSet(task_set_id) : 0);
|
||||
}
|
||||
inline int CompletedTasksInSet(int task_set_id)
|
||||
{
|
||||
return (task_state ? task_state->CompletedTasksInSet(task_set_id) : 0);
|
||||
}
|
||||
|
||||
inline const EQ::versions::ClientVersion ClientVersion() const { return m_ClientVersion; }
|
||||
inline const uint32 ClientVersionBit() const { return m_ClientVersionBit; }
|
||||
@ -1645,7 +1838,7 @@ private:
|
||||
|
||||
std::set<uint32> zone_flags;
|
||||
|
||||
ClientTaskState *taskstate;
|
||||
ClientTaskState *task_state;
|
||||
int TotalSecondsPlayed;
|
||||
|
||||
//Anti Spam Stuff
|
||||
|
||||
@ -1821,8 +1821,8 @@ void Client::Handle_OP_AcceptNewTask(const EQApplicationPacket *app)
|
||||
}
|
||||
AcceptNewTask_Struct *ant = (AcceptNewTask_Struct*)app->pBuffer;
|
||||
|
||||
if (ant->task_id > 0 && RuleB(TaskSystem, EnableTaskSystem) && taskstate)
|
||||
taskstate->AcceptNewTask(this, ant->task_id, ant->task_master_id);
|
||||
if (ant->task_id > 0 && RuleB(TaskSystem, EnableTaskSystem) && task_state)
|
||||
task_state->AcceptNewTask(this, ant->task_id, ant->task_master_id);
|
||||
}
|
||||
|
||||
void Client::Handle_OP_AdventureInfoRequest(const EQApplicationPacket *app)
|
||||
@ -4004,8 +4004,8 @@ void Client::Handle_OP_CancelTask(const EQApplicationPacket *app)
|
||||
}
|
||||
CancelTask_Struct *cts = (CancelTask_Struct*)app->pBuffer;
|
||||
|
||||
if (RuleB(TaskSystem, EnableTaskSystem) && taskstate)
|
||||
taskstate->CancelTask(this, cts->SequenceNumber, static_cast<TaskType>(cts->type));
|
||||
if (RuleB(TaskSystem, EnableTaskSystem) && task_state)
|
||||
task_state->CancelTask(this, cts->SequenceNumber, static_cast<TaskType>(cts->type));
|
||||
}
|
||||
|
||||
void Client::Handle_OP_CancelTrade(const EQApplicationPacket *app)
|
||||
@ -13996,8 +13996,8 @@ void Client::Handle_OP_TaskHistoryRequest(const EQApplicationPacket *app)
|
||||
}
|
||||
TaskHistoryRequest_Struct *ths = (TaskHistoryRequest_Struct*)app->pBuffer;
|
||||
|
||||
if (RuleB(TaskSystem, EnableTaskSystem) && taskstate)
|
||||
taskstate->SendTaskHistory(this, ths->TaskIndex);
|
||||
if (RuleB(TaskSystem, EnableTaskSystem) && task_state)
|
||||
task_state->SendTaskHistory(this, ths->TaskIndex);
|
||||
}
|
||||
|
||||
void Client::Handle_OP_Taunt(const EQApplicationPacket *app)
|
||||
|
||||
@ -158,8 +158,8 @@ bool Client::Process() {
|
||||
CalcItemScale();
|
||||
}
|
||||
|
||||
if (TaskPeriodic_Timer.Check() && taskstate)
|
||||
taskstate->TaskPeriodicChecks(this);
|
||||
if (TaskPeriodic_Timer.Check() && task_state)
|
||||
task_state->TaskPeriodicChecks(this);
|
||||
|
||||
if (dynamiczone_removal_timer.Check() && zone && zone->GetInstanceID() != 0)
|
||||
{
|
||||
|
||||
@ -77,7 +77,7 @@
|
||||
|
||||
extern QueryServ* QServ;
|
||||
extern WorldServer worldserver;
|
||||
extern TaskManager *taskmanager;
|
||||
extern TaskManager *p_task_manager;
|
||||
extern FastMath g_Math;
|
||||
void CatchSignal(int sig_num);
|
||||
|
||||
|
||||
@ -3900,7 +3900,7 @@ void EntityList::ProcessProximitySay(const char *Message, Client *c, uint8 langu
|
||||
|
||||
void EntityList::SaveAllClientsTaskState()
|
||||
{
|
||||
if (!taskmanager)
|
||||
if (!p_task_manager)
|
||||
return;
|
||||
|
||||
auto it = client_list.begin();
|
||||
@ -3915,7 +3915,7 @@ void EntityList::SaveAllClientsTaskState()
|
||||
|
||||
void EntityList::ReloadAllClientsTaskState(int TaskID)
|
||||
{
|
||||
if (!taskmanager)
|
||||
if (!p_task_manager)
|
||||
return;
|
||||
|
||||
auto it = client_list.begin();
|
||||
@ -3928,7 +3928,7 @@ void EntityList::ReloadAllClientsTaskState(int TaskID)
|
||||
Log(Logs::General, Logs::Tasks, "[CLIENTLOAD] Reloading Task State For Client %s", client->GetName());
|
||||
client->RemoveClientTaskState();
|
||||
client->LoadClientTaskState();
|
||||
taskmanager->SendActiveTasksToClient(client);
|
||||
p_task_manager->SendActiveTasksToClient(client);
|
||||
}
|
||||
}
|
||||
++it;
|
||||
|
||||
@ -115,8 +115,8 @@ char errorname[32];
|
||||
extern Zone* zone;
|
||||
npcDecayTimes_Struct npcCorpseDecayTimes[100];
|
||||
TitleManager title_manager;
|
||||
QueryServ *QServ = 0;
|
||||
TaskManager *taskmanager = 0;
|
||||
QueryServ *QServ = 0;
|
||||
TaskManager *p_task_manager = 0;
|
||||
NpcScaleManager *npc_scale_manager;
|
||||
QuestParserCollection *parse = 0;
|
||||
EQEmuLogSys LogSys;
|
||||
@ -427,8 +427,8 @@ int main(int argc, char** argv) {
|
||||
|
||||
if (RuleB(TaskSystem, EnableTaskSystem)) {
|
||||
Log(Logs::General, Logs::Tasks, "[INIT] Loading Tasks");
|
||||
taskmanager = new TaskManager;
|
||||
taskmanager->LoadTasks();
|
||||
p_task_manager = new TaskManager;
|
||||
p_task_manager->LoadTasks();
|
||||
}
|
||||
|
||||
parse = new QuestParserCollection();
|
||||
@ -607,7 +607,7 @@ int main(int argc, char** argv) {
|
||||
if (zone != 0)
|
||||
Zone::Shutdown(true);
|
||||
//Fix for Linux world server problem.
|
||||
safe_delete(taskmanager);
|
||||
safe_delete(p_task_manager);
|
||||
command_deinit();
|
||||
#ifdef BOTS
|
||||
bot_command_deinit();
|
||||
|
||||
@ -2223,27 +2223,27 @@ bool QuestManager::createBot(const char *name, const char *lastname, uint8 level
|
||||
|
||||
void QuestManager::taskselector(int taskcount, int *tasks) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && owner && taskmanager)
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && owner && p_task_manager)
|
||||
initiator->TaskQuestSetSelector(owner, taskcount, tasks);
|
||||
}
|
||||
void QuestManager::enabletask(int taskcount, int *tasks) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && taskmanager)
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && p_task_manager)
|
||||
initiator->EnableTask(taskcount, tasks);
|
||||
}
|
||||
|
||||
void QuestManager::disabletask(int taskcount, int *tasks) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && taskmanager)
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && p_task_manager)
|
||||
initiator->DisableTask(taskcount, tasks);
|
||||
}
|
||||
|
||||
bool QuestManager::istaskenabled(int taskid) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && taskmanager)
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && p_task_manager)
|
||||
return initiator->IsTaskEnabled(taskid);
|
||||
|
||||
return false;
|
||||
@ -2252,7 +2252,7 @@ bool QuestManager::istaskenabled(int taskid) {
|
||||
void QuestManager::tasksetselector(int tasksetid) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
Log(Logs::General, Logs::Tasks, "[UPDATE] TaskSetSelector called for task set %i", tasksetid);
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && owner && taskmanager)
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && owner && p_task_manager)
|
||||
initiator->TaskSetSelector(owner, tasksetid);
|
||||
}
|
||||
|
||||
@ -2341,8 +2341,8 @@ int QuestManager::enabledtaskcount(int taskset) {
|
||||
int QuestManager::firsttaskinset(int taskset) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && taskmanager)
|
||||
return taskmanager->FirstTaskInSet(taskset);
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && p_task_manager)
|
||||
return p_task_manager->FirstTaskInSet(taskset);
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -2350,8 +2350,8 @@ int QuestManager::firsttaskinset(int taskset) {
|
||||
int QuestManager::lasttaskinset(int taskset) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && taskmanager)
|
||||
return taskmanager->LastTaskInSet(taskset);
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && p_task_manager)
|
||||
return p_task_manager->LastTaskInSet(taskset);
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -2359,8 +2359,8 @@ int QuestManager::lasttaskinset(int taskset) {
|
||||
int QuestManager::nexttaskinset(int taskset, int taskid) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && taskmanager)
|
||||
return taskmanager->NextTaskInSet(taskset, taskid);
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && p_task_manager)
|
||||
return p_task_manager->NextTaskInSet(taskset, taskid);
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -2412,8 +2412,8 @@ int QuestManager::completedtasksinset(int taskset) {
|
||||
bool QuestManager::istaskappropriate(int task) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && taskmanager)
|
||||
return taskmanager->AppropriateLevel(task, initiator->GetLevel());
|
||||
if(RuleB(TaskSystem, EnableTaskSystem) && initiator && p_task_manager)
|
||||
return p_task_manager->ValidateLevel(task, initiator->GetLevel());
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -2422,7 +2422,7 @@ std::string QuestManager::gettaskname(uint32 task_id) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if (RuleB(TaskSystem, EnableTaskSystem)) {
|
||||
return taskmanager->GetTaskName(task_id);
|
||||
return p_task_manager->GetTaskName(task_id);
|
||||
}
|
||||
|
||||
return std::string();
|
||||
|
||||
3343
zone/tasks.cpp
3343
zone/tasks.cpp
File diff suppressed because it is too large
Load Diff
292
zone/tasks.h
292
zone/tasks.h
@ -39,23 +39,22 @@ Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
||||
#define TASKSLOTEMPTY 0
|
||||
|
||||
// Command Codes for worldserver ServerOP_ReloadTasks
|
||||
//
|
||||
#define RELOADTASKS 0
|
||||
#define RELOADTASKGOALLISTS 1
|
||||
#define RELOADTASKPROXIMITIES 2
|
||||
#define RELOADTASKSETS 3
|
||||
#define RELOADTASKS 0
|
||||
#define RELOADTASKGOALLISTS 1
|
||||
#define RELOADTASKPROXIMITIES 2
|
||||
#define RELOADTASKSETS 3
|
||||
|
||||
class Client;
|
||||
|
||||
class Mob;
|
||||
|
||||
namespace EQ
|
||||
{
|
||||
namespace EQ {
|
||||
class ItemInstance;
|
||||
}
|
||||
|
||||
struct TaskGoalList_Struct {
|
||||
int ListID;
|
||||
int Min, Max;
|
||||
int ListID;
|
||||
int Min, Max;
|
||||
std::vector<int> GoalItemEntries;
|
||||
};
|
||||
|
||||
@ -77,11 +76,11 @@ public:
|
||||
private:
|
||||
|
||||
std::vector<TaskGoalList_Struct> TaskGoalLists;
|
||||
int NumberOfLists;
|
||||
int NumberOfLists;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
int ExploreID;
|
||||
int ExploreID;
|
||||
float MinX, MaxX, MinY, MaxY, MinZ, MaxZ;
|
||||
} TaskProximity;
|
||||
|
||||
@ -98,99 +97,122 @@ private:
|
||||
std::vector<TaskProximity> TaskProximities;
|
||||
};
|
||||
|
||||
typedef enum { METHODSINGLEID = 0, METHODLIST = 1, METHODQUEST = 2 } TaskMethodType;
|
||||
typedef enum {
|
||||
METHODSINGLEID = 0,
|
||||
METHODLIST = 1,
|
||||
METHODQUEST = 2
|
||||
} TaskMethodType;
|
||||
|
||||
struct ActivityInformation {
|
||||
int StepNumber;
|
||||
int Type;
|
||||
std::string target_name; // name mob, location -- default empty
|
||||
std::string item_list; // likely defaults to empty
|
||||
std::string skill_list; // IDs ; separated -- default -1
|
||||
std::string spell_list; // IDs ; separated -- default 0
|
||||
std::string desc_override; // overrides auto generated description -- default empty
|
||||
int skill_id; // older clients, first id from above
|
||||
int spell_id; // older clients, first id from above
|
||||
int GoalID;
|
||||
TaskMethodType GoalMethod;
|
||||
int GoalCount;
|
||||
int DeliverToNPC;
|
||||
std::vector<int> ZoneIDs;
|
||||
std::string zones; // IDs ; searated, ZoneID is the first in this list for older clients -- default empty string
|
||||
bool Optional;
|
||||
int StepNumber;
|
||||
int Type;
|
||||
std::string target_name; // name mob, location -- default empty
|
||||
std::string item_list; // likely defaults to empty
|
||||
std::string skill_list; // IDs ; separated -- default -1
|
||||
std::string spell_list; // IDs ; separated -- default 0
|
||||
std::string desc_override; // overrides auto generated description -- default empty
|
||||
int skill_id; // older clients, first id from above
|
||||
int spell_id; // older clients, first id from above
|
||||
int GoalID;
|
||||
TaskMethodType GoalMethod;
|
||||
int GoalCount;
|
||||
int DeliverToNPC;
|
||||
std::vector<int> ZoneIDs;
|
||||
std::string zones; // IDs ; searated, ZoneID is the first in this list for older clients -- default empty string
|
||||
bool Optional;
|
||||
|
||||
inline bool CheckZone(int zone_id) {
|
||||
if (ZoneIDs.empty())
|
||||
inline bool CheckZone(int zone_id)
|
||||
{
|
||||
if (ZoneIDs.empty()) {
|
||||
return true;
|
||||
}
|
||||
return std::find(ZoneIDs.begin(), ZoneIDs.end(), zone_id) != ZoneIDs.end();
|
||||
}
|
||||
};
|
||||
|
||||
typedef enum { ActivitiesSequential = 0, ActivitiesStepped = 1 } SequenceType;
|
||||
typedef enum {
|
||||
ActivitiesSequential = 0, ActivitiesStepped = 1
|
||||
} SequenceType;
|
||||
|
||||
enum class TaskType {
|
||||
Task = 0, // can have at max 1
|
||||
Shared = 1, // can have at max 1
|
||||
Quest = 2, // can have at max 19 or 29 depending on client
|
||||
E = 3 // can have at max 19 or 29 depending on client, not present in live anymore
|
||||
Task = 0, // can have at max 1
|
||||
Shared = 1, // can have at max 1
|
||||
Quest = 2, // can have at max 19 or 29 depending on client
|
||||
E = 3 // can have at max 19 or 29 depending on client, not present in live anymore
|
||||
};
|
||||
|
||||
enum class DurationCode {
|
||||
None = 0,
|
||||
Short = 1,
|
||||
None = 0,
|
||||
Short = 1,
|
||||
Medium = 2,
|
||||
Long = 3
|
||||
Long = 3
|
||||
};
|
||||
|
||||
struct TaskInformation {
|
||||
TaskType type;
|
||||
int Duration;
|
||||
DurationCode dur_code; // description for time investment for when Duration == 0
|
||||
std::string Title; // max length 64
|
||||
std::string Description; // max length 4000, 2048 on Tit
|
||||
std::string Reward;
|
||||
std::string item_link; // max length 128 older clients, item link gets own string
|
||||
std::string completion_emote; // emote after completing task, yellow. Maybe should make more generic ... but yellow for now!
|
||||
int RewardID;
|
||||
int CashReward; // Expressed in copper
|
||||
int XPReward;
|
||||
int faction_reward; // just a npc_faction_id
|
||||
TaskMethodType RewardMethod;
|
||||
int ActivityCount;
|
||||
SequenceType SequenceMode;
|
||||
int LastStep;
|
||||
short MinLevel;
|
||||
short MaxLevel;
|
||||
bool Repeatable;
|
||||
ActivityInformation Activity[MAXACTIVITIESPERTASK];
|
||||
TaskType type;
|
||||
int duration;
|
||||
DurationCode duration_code; // description for time investment for when duration == 0
|
||||
std::string title; // max length 64
|
||||
std::string description; // max length 4000, 2048 on Tit
|
||||
std::string reward;
|
||||
std::string item_link; // max length 128 older clients, item link gets own string
|
||||
std::string completion_emote; // emote after completing task, yellow. Maybe should make more generic ... but yellow for now!
|
||||
int reward_id;
|
||||
int cash_reward; // Expressed in copper
|
||||
int experience_reward;
|
||||
int faction_reward; // just a npc_faction_id
|
||||
TaskMethodType reward_method;
|
||||
int activity_count;
|
||||
SequenceType sequence_mode;
|
||||
int last_step;
|
||||
short min_level;
|
||||
short max_level;
|
||||
bool repeatable;
|
||||
ActivityInformation activity_information[MAXACTIVITIESPERTASK];
|
||||
};
|
||||
|
||||
typedef enum { ActivityHidden = 0, ActivityActive = 1, ActivityCompleted = 2 } ActivityState;
|
||||
|
||||
typedef enum { ActivityDeliver = 1, ActivityKill = 2, ActivityLoot = 3, ActivitySpeakWith = 4, ActivityExplore = 5,
|
||||
ActivityTradeSkill = 6, ActivityFish = 7, ActivityForage = 8, ActivityCastOn = 9, ActivitySkillOn = 10,
|
||||
ActivityTouch = 11, ActivityCollect = 13, ActivityGiveCash = 100 } ActivityType;
|
||||
typedef enum {
|
||||
ActivityHidden = 0,
|
||||
ActivityActive = 1,
|
||||
ActivityCompleted = 2
|
||||
} ActivityState;
|
||||
|
||||
typedef enum {
|
||||
ActivityDeliver = 1,
|
||||
ActivityKill = 2,
|
||||
ActivityLoot = 3,
|
||||
ActivitySpeakWith = 4,
|
||||
ActivityExplore = 5,
|
||||
ActivityTradeSkill = 6,
|
||||
ActivityFish = 7,
|
||||
ActivityForage = 8,
|
||||
ActivityCastOn = 9,
|
||||
ActivitySkillOn = 10,
|
||||
ActivityTouch = 11,
|
||||
ActivityCollect = 13,
|
||||
ActivityGiveCash = 100
|
||||
} ActivityType;
|
||||
|
||||
struct ClientActivityInformation {
|
||||
int ActivityID;
|
||||
int DoneCount;
|
||||
ActivityState State;
|
||||
bool Updated; // Flag so we know if we need to update the database
|
||||
int activity_id;
|
||||
int done_count;
|
||||
ActivityState activity_state;
|
||||
bool updated; // Flag so we know if we need to updated the database
|
||||
};
|
||||
|
||||
struct ClientTaskInformation {
|
||||
int slot; // intrusive, but makes things easier :P
|
||||
int TaskID;
|
||||
int CurrentStep;
|
||||
int AcceptedTime;
|
||||
bool Updated;
|
||||
ClientActivityInformation Activity[MAXACTIVITIESPERTASK];
|
||||
int slot; // intrusive, but makes things easier :P
|
||||
int task_id;
|
||||
int current_step;
|
||||
int accepted_time;
|
||||
bool updated;
|
||||
ClientActivityInformation activity[MAXACTIVITIESPERTASK];
|
||||
};
|
||||
|
||||
struct CompletedTaskInformation {
|
||||
int TaskID;
|
||||
int CompletedTime;
|
||||
bool ActivityDone[MAXACTIVITIESPERTASK];
|
||||
int task_id;
|
||||
int completed_time;
|
||||
bool activity_done[MAXACTIVITIESPERTASK];
|
||||
};
|
||||
|
||||
class ClientTaskState {
|
||||
@ -199,7 +221,7 @@ public:
|
||||
ClientTaskState();
|
||||
~ClientTaskState();
|
||||
void ShowClientTasks(Client *c);
|
||||
inline int GetActiveTaskCount() { return ActiveTaskCount; }
|
||||
inline int GetActiveTaskCount() { return active_task_count; }
|
||||
int GetActiveTaskID(int index);
|
||||
bool IsTaskActivityCompleted(TaskType type, int index, int ActivityID);
|
||||
int GetTaskActivityDoneCount(TaskType type, int index, int ActivityID);
|
||||
@ -218,67 +240,76 @@ public:
|
||||
void CancelAllTasks(Client *c);
|
||||
void RemoveTask(Client *c, int SequenceNumber, TaskType type);
|
||||
void RemoveTaskByTaskID(Client *c, uint32 task_id);
|
||||
bool UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeID);
|
||||
bool UpdateTasksByNPC(Client *c, int activity_type, int npc_type_id);
|
||||
void UpdateTasksOnKill(Client *c, int NPCTypeID);
|
||||
void UpdateTasksForItem(Client *c, ActivityType Type, int ItemID, int Count=1);
|
||||
void UpdateTasksForItem(Client *c, ActivityType Type, int ItemID, int Count = 1);
|
||||
void UpdateTasksOnExplore(Client *c, int ExploreID);
|
||||
bool UpdateTasksOnSpeakWith(Client *c, int NPCTypeID);
|
||||
bool UpdateTasksOnDeliver(Client *c, std::list<EQ::ItemInstance*>& Items, int Cash, int NPCTypeID);
|
||||
bool UpdateTasksOnDeliver(Client *c, std::list<EQ::ItemInstance *> &Items, int Cash, int NPCTypeID);
|
||||
void UpdateTasksOnTouch(Client *c, int ZoneID);
|
||||
void ProcessTaskProximities(Client *c, float X, float Y, float Z);
|
||||
bool TaskOutOfTime(TaskType type, int Index);
|
||||
void TaskPeriodicChecks(Client *c);
|
||||
void SendTaskHistory(Client *c, int TaskIndex);
|
||||
void RewardTask(Client *c, TaskInformation *Task);
|
||||
void EnableTask(int CharID, int TaskCount, int *TaskList);
|
||||
void DisableTask(int CharID, int TaskCount, int *TaskList);
|
||||
void EnableTask(int character_id, int task_count, int *TaskList);
|
||||
void DisableTask(int character_id, int task_count, int *task_list);
|
||||
bool IsTaskEnabled(int TaskID);
|
||||
int EnabledTaskCount(int TaskSetID);
|
||||
int ActiveSpeakTask(int NPCID);
|
||||
int ActiveSpeakActivity(int NPCID, int TaskID);
|
||||
int ActiveSpeakTask(int npc_type_id);
|
||||
int ActiveSpeakActivity(int npc_type_id, int task_id);
|
||||
int ActiveTasksInSet(int TaskSetID);
|
||||
int CompletedTasksInSet(int TaskSetID);
|
||||
bool HasSlotForTask(TaskInformation *task);
|
||||
|
||||
inline bool HasFreeTaskSlot() { return ActiveTask.TaskID == TASKSLOTEMPTY; }
|
||||
inline bool HasFreeTaskSlot() { return active_task.task_id == TASKSLOTEMPTY; }
|
||||
|
||||
friend class TaskManager;
|
||||
|
||||
private:
|
||||
bool UnlockActivities(int CharID, ClientTaskInformation &task_info);
|
||||
void IncrementDoneCount(Client *c, TaskInformation *Task, int TaskIndex, int ActivityID, int Count = 1, bool ignore_quest_update = false);
|
||||
bool UnlockActivities(int character_id, ClientTaskInformation &task_info);
|
||||
void IncrementDoneCount(
|
||||
Client *c,
|
||||
TaskInformation *Task,
|
||||
int TaskIndex,
|
||||
int ActivityID,
|
||||
int Count = 1,
|
||||
bool ignore_quest_update = false
|
||||
);
|
||||
inline ClientTaskInformation *GetClientTaskInfo(TaskType type, int index)
|
||||
{
|
||||
ClientTaskInformation *info = nullptr;
|
||||
switch (type) {
|
||||
case TaskType::Task:
|
||||
if (index == 0)
|
||||
info = &ActiveTask;
|
||||
break;
|
||||
case TaskType::Shared:
|
||||
break;
|
||||
case TaskType::Quest:
|
||||
if (index < MAXACTIVEQUESTS)
|
||||
info = &ActiveQuests[index];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case TaskType::Task:
|
||||
if (index == 0) {
|
||||
info = &active_task;
|
||||
}
|
||||
break;
|
||||
case TaskType::Shared:
|
||||
break;
|
||||
case TaskType::Quest:
|
||||
if (index < MAXACTIVEQUESTS) {
|
||||
info = &active_quests[index];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return info;
|
||||
}
|
||||
int ActiveTaskCount;
|
||||
int active_task_count;
|
||||
union { // easier to loop over
|
||||
struct {
|
||||
ClientTaskInformation ActiveTask; // only one
|
||||
ClientTaskInformation ActiveQuests[MAXACTIVEQUESTS];
|
||||
ClientTaskInformation active_task; // only one
|
||||
ClientTaskInformation active_quests[MAXACTIVEQUESTS];
|
||||
};
|
||||
ClientTaskInformation ActiveTasks[MAXACTIVEQUESTS + 1];
|
||||
};
|
||||
// Shared tasks should be limited to 1 as well
|
||||
std::vector<int> EnabledTasks;
|
||||
std::vector<CompletedTaskInformation> CompletedTasks;
|
||||
int LastCompletedTaskLoaded;
|
||||
bool CheckedTouchActivities;
|
||||
std::vector<int> enabled_tasks;
|
||||
std::vector<CompletedTaskInformation> completed_tasks;
|
||||
int last_completed_task_loaded;
|
||||
bool checked_touch_activities;
|
||||
};
|
||||
|
||||
|
||||
@ -289,7 +320,7 @@ public:
|
||||
~TaskManager();
|
||||
int GetActivityCount(int TaskID);
|
||||
bool LoadSingleTask(int TaskID);
|
||||
bool LoadTasks(int SingleTask=0);
|
||||
bool LoadTasks(int SingleTask = 0);
|
||||
void ReloadGoalLists();
|
||||
inline void LoadProximities(int ZoneID) { ProximityManager.LoadProximities(ZoneID); }
|
||||
bool LoadTaskSets();
|
||||
@ -297,35 +328,58 @@ public:
|
||||
bool SaveClientState(Client *c, ClientTaskState *state);
|
||||
void SendTaskSelector(Client *c, Mob *mob, int TaskCount, int *TaskList);
|
||||
void SendTaskSelectorNew(Client *c, Mob *mob, int TaskCount, int *TaskList);
|
||||
bool AppropriateLevel(int TaskID, int PlayerLevel);
|
||||
bool ValidateLevel(int TaskID, int PlayerLevel);
|
||||
int GetTaskMinLevel(int TaskID);
|
||||
int GetTaskMaxLevel(int TaskID);
|
||||
std::string GetTaskName(uint32 task_id);
|
||||
TaskType GetTaskType(uint32 task_id);
|
||||
void TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, int TaskSetID);
|
||||
void TaskQuestSetSelector(Client *c, ClientTaskState *state, Mob *mob, int count, int *tasks); // task list provided by QuestManager (perl/lua)
|
||||
void SendActiveTasksToClient(Client *c, bool TaskComplete=false);
|
||||
void SendSingleActiveTaskToClient(Client *c, ClientTaskInformation &task_info, bool TaskComplete, bool BringUpTaskJournal = false);
|
||||
void TaskQuestSetSelector(
|
||||
Client *c,
|
||||
ClientTaskState *state,
|
||||
Mob *mob,
|
||||
int count,
|
||||
int *tasks
|
||||
); // task list provided by QuestManager (perl/lua)
|
||||
void SendActiveTasksToClient(Client *c, bool TaskComplete = false);
|
||||
void SendSingleActiveTaskToClient(
|
||||
Client *c,
|
||||
ClientTaskInformation &task_info,
|
||||
bool TaskComplete,
|
||||
bool BringUpTaskJournal = false
|
||||
);
|
||||
void SendTaskActivityShort(Client *c, int TaskID, int ActivityID, int ClientTaskIndex);
|
||||
void SendTaskActivityLong(Client *c, int TaskID, int ActivityID, int ClientTaskIndex,
|
||||
bool Optional, bool TaskComplete=false);
|
||||
void SendTaskActivityNew(Client *c, int TaskID, int ActivityID, int ClientTaskIndex,
|
||||
bool Optional, bool TaskComplete=false);
|
||||
void SendTaskActivityLong(
|
||||
Client *c, int TaskID, int ActivityID, int ClientTaskIndex,
|
||||
bool Optional, bool TaskComplete = false
|
||||
);
|
||||
void SendTaskActivityNew(
|
||||
Client *c, int TaskID, int ActivityID, int ClientTaskIndex,
|
||||
bool Optional, bool TaskComplete = false
|
||||
);
|
||||
void SendCompletedTasksToClient(Client *c, ClientTaskState *state);
|
||||
void ExplainTask(Client *c, int TaskID);
|
||||
int FirstTaskInSet(int TaskSet);
|
||||
int LastTaskInSet(int TaskSet);
|
||||
int NextTaskInSet(int TaskSet, int TaskID);
|
||||
bool IsTaskRepeatable(int TaskID);
|
||||
|
||||
friend class ClientTaskState;
|
||||
|
||||
|
||||
private:
|
||||
TaskGoalListManager GoalListManager;
|
||||
TaskGoalListManager GoalListManager;
|
||||
TaskProximityManager ProximityManager;
|
||||
TaskInformation* Tasks[MAXTASKS];
|
||||
std::vector<int> TaskSets[MAXTASKSETS];
|
||||
void SendActiveTaskDescription(Client *c, int TaskID, ClientTaskInformation &task_info, int StartTime, int Duration, bool BringUpTaskJournal=false);
|
||||
TaskInformation *Tasks[MAXTASKS];
|
||||
std::vector<int> TaskSets[MAXTASKSETS];
|
||||
void SendActiveTaskDescription(
|
||||
Client *c,
|
||||
int TaskID,
|
||||
ClientTaskInformation &task_info,
|
||||
int StartTime,
|
||||
int Duration,
|
||||
bool BringUpTaskJournal = false
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -3100,16 +3100,16 @@ void WorldServer::HandleReloadTasks(ServerPacket *pack)
|
||||
|
||||
if (rts->Parameter == 0) {
|
||||
Log(Logs::General, Logs::Tasks, "[GLOBALLOAD] Reload ALL tasks");
|
||||
safe_delete(taskmanager);
|
||||
taskmanager = new TaskManager;
|
||||
taskmanager->LoadTasks();
|
||||
safe_delete(p_task_manager);
|
||||
p_task_manager = new TaskManager;
|
||||
p_task_manager->LoadTasks();
|
||||
if (zone)
|
||||
taskmanager->LoadProximities(zone->GetZoneID());
|
||||
p_task_manager->LoadProximities(zone->GetZoneID());
|
||||
entity_list.ReloadAllClientsTaskState();
|
||||
}
|
||||
else {
|
||||
Log(Logs::General, Logs::Tasks, "[GLOBALLOAD] Reload only task %i", rts->Parameter);
|
||||
taskmanager->LoadTasks(rts->Parameter);
|
||||
p_task_manager->LoadTasks(rts->Parameter);
|
||||
entity_list.ReloadAllClientsTaskState(rts->Parameter);
|
||||
}
|
||||
|
||||
@ -3118,18 +3118,18 @@ void WorldServer::HandleReloadTasks(ServerPacket *pack)
|
||||
case RELOADTASKPROXIMITIES:
|
||||
if (zone) {
|
||||
Log(Logs::General, Logs::Tasks, "[GLOBALLOAD] Reload task proximities");
|
||||
taskmanager->LoadProximities(zone->GetZoneID());
|
||||
p_task_manager->LoadProximities(zone->GetZoneID());
|
||||
}
|
||||
break;
|
||||
|
||||
case RELOADTASKGOALLISTS:
|
||||
Log(Logs::General, Logs::Tasks, "[GLOBALLOAD] Reload task goal lists");
|
||||
taskmanager->ReloadGoalLists();
|
||||
p_task_manager->ReloadGoalLists();
|
||||
break;
|
||||
|
||||
case RELOADTASKSETS:
|
||||
Log(Logs::General, Logs::Tasks, "[GLOBALLOAD] Reload task sets");
|
||||
taskmanager->LoadTaskSets();
|
||||
p_task_manager->LoadTaskSets();
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@ -964,7 +964,7 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name)
|
||||
lootvar = 0;
|
||||
|
||||
if(RuleB(TaskSystem, EnableTaskSystem)) {
|
||||
taskmanager->LoadProximities(zoneid);
|
||||
p_task_manager->LoadProximities(zoneid);
|
||||
}
|
||||
|
||||
short_name = strcpy(new char[strlen(in_short_name)+1], in_short_name);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user