mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-25 18:47:35 +00:00
Push
This commit is contained in:
@@ -68,6 +68,7 @@ extern volatile bool RunLoops;
|
|||||||
#include "../common/repositories/character_disciplines_repository.h"
|
#include "../common/repositories/character_disciplines_repository.h"
|
||||||
#include "../common/repositories/character_data_repository.h"
|
#include "../common/repositories/character_data_repository.h"
|
||||||
#include "../common/repositories/character_pet_name_repository.h"
|
#include "../common/repositories/character_pet_name_repository.h"
|
||||||
|
#include "../common/repositories/completed_tasks_repository.h"
|
||||||
#include "../common/repositories/discovered_items_repository.h"
|
#include "../common/repositories/discovered_items_repository.h"
|
||||||
#include "../common/repositories/inventory_repository.h"
|
#include "../common/repositories/inventory_repository.h"
|
||||||
#include "../common/repositories/keyring_repository.h"
|
#include "../common/repositories/keyring_repository.h"
|
||||||
@@ -13253,3 +13254,17 @@ void Client::CheckItemDiscoverability(uint32 item_id)
|
|||||||
|
|
||||||
DiscoverItem(item_id);
|
DiscoverItem(item_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Client::UncompleteTask(int task_id)
|
||||||
|
{
|
||||||
|
CompletedTasksRepository::DeleteWhere(
|
||||||
|
database,
|
||||||
|
fmt::format(
|
||||||
|
"charid = {} AND taskid = {}",
|
||||||
|
CharacterID(),
|
||||||
|
task_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return task_state->UncompleteTask(task_id);
|
||||||
|
}
|
||||||
|
|||||||
@@ -1501,6 +1501,7 @@ public:
|
|||||||
{
|
{
|
||||||
return task_state ? task_state->CompleteTask(this, task_id) : false;
|
return task_state ? task_state->CompleteTask(this, task_id) : false;
|
||||||
}
|
}
|
||||||
|
bool UncompleteTask(int task_id);
|
||||||
inline void FailTask(int task_id) { if (task_state) { task_state->FailTask(this, task_id); }}
|
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 TaskTimeLeft(int task_id) { return (task_state ? task_state->TaskTimeLeft(task_id) : 0); }
|
||||||
inline int EnabledTaskCount(int task_set_id)
|
inline int EnabledTaskCount(int task_set_id)
|
||||||
|
|||||||
@@ -1271,9 +1271,9 @@ void Perl__failtask(int task_id)
|
|||||||
quest_manager.failtask(task_id);
|
quest_manager.failtask(task_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Perl__uncompletetask(int task_id)
|
bool Perl__uncompletetask(int task_id)
|
||||||
{
|
{
|
||||||
quest_manager.uncompletetask(task_id);
|
return quest_manager.uncompletetask(task_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Perl__tasktimeleft(int task_id)
|
int Perl__tasktimeleft(int task_id)
|
||||||
|
|||||||
@@ -304,16 +304,7 @@ void command_task(Client *c, const Seperator *sep)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (t->UncompleteTask(task_id)) {
|
||||||
CompletedTasksRepository::DeleteWhere(
|
|
||||||
database,
|
|
||||||
fmt::format(
|
|
||||||
"charid = {} AND taskid = {}",
|
|
||||||
t->CharacterID(),
|
|
||||||
task_id
|
|
||||||
)
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
|
|||||||
@@ -3584,6 +3584,18 @@ bool Lua_Client::KeyRingRemove(uint32 item_id)
|
|||||||
return self->KeyRingRemove(item_id);
|
return self->KeyRingRemove(item_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Lua_Client::CompleteTask(int task_id)
|
||||||
|
{
|
||||||
|
Lua_Safe_Call_Bool();
|
||||||
|
return self->CompleteTask(task_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Lua_Client::UncompleteTask(int task_id)
|
||||||
|
{
|
||||||
|
Lua_Safe_Call_Bool();
|
||||||
|
return self->UncompleteTask(task_id);
|
||||||
|
}
|
||||||
|
|
||||||
luabind::scope lua_register_client() {
|
luabind::scope lua_register_client() {
|
||||||
return luabind::class_<Lua_Client, Lua_Mob>("Client")
|
return luabind::class_<Lua_Client, Lua_Mob>("Client")
|
||||||
.def(luabind::constructor<>())
|
.def(luabind::constructor<>())
|
||||||
@@ -4156,6 +4168,7 @@ luabind::scope lua_register_client() {
|
|||||||
.def("TrainDisc", (void(Lua_Client::*)(int))&Lua_Client::TrainDisc)
|
.def("TrainDisc", (void(Lua_Client::*)(int))&Lua_Client::TrainDisc)
|
||||||
.def("TrainDiscBySpellID", (void(Lua_Client::*)(int32))&Lua_Client::TrainDiscBySpellID)
|
.def("TrainDiscBySpellID", (void(Lua_Client::*)(int32))&Lua_Client::TrainDiscBySpellID)
|
||||||
.def("UnFreeze", (void(Lua_Client::*)(void))&Lua_Client::UnFreeze)
|
.def("UnFreeze", (void(Lua_Client::*)(void))&Lua_Client::UnFreeze)
|
||||||
|
.def("UncompleteTask", (bool(Lua_Client::*)(int))&Lua_Client::UncompleteTask)
|
||||||
.def("Undye", (void(Lua_Client::*)(void))&Lua_Client::Undye)
|
.def("Undye", (void(Lua_Client::*)(void))&Lua_Client::Undye)
|
||||||
.def("UnmemSpell", (void(Lua_Client::*)(int))&Lua_Client::UnmemSpell)
|
.def("UnmemSpell", (void(Lua_Client::*)(int))&Lua_Client::UnmemSpell)
|
||||||
.def("UnmemSpell", (void(Lua_Client::*)(int,bool))&Lua_Client::UnmemSpell)
|
.def("UnmemSpell", (void(Lua_Client::*)(int,bool))&Lua_Client::UnmemSpell)
|
||||||
|
|||||||
@@ -521,6 +521,8 @@ public:
|
|||||||
bool KeyRingClear();
|
bool KeyRingClear();
|
||||||
void KeyRingList();
|
void KeyRingList();
|
||||||
bool KeyRingRemove(uint32 item_id);
|
bool KeyRingRemove(uint32 item_id);
|
||||||
|
bool CompleteTask(int task_id);
|
||||||
|
bool UncompleteTask(int task_id);
|
||||||
|
|
||||||
// account data buckets
|
// account data buckets
|
||||||
void SetAccountBucket(std::string bucket_name, std::string bucket_value);
|
void SetAccountBucket(std::string bucket_name, std::string bucket_value);
|
||||||
|
|||||||
@@ -722,8 +722,8 @@ void lua_fail_task(int task_id) {
|
|||||||
quest_manager.failtask(task_id);
|
quest_manager.failtask(task_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lua_uncomplete_task(int task_id) {
|
bool lua_uncomplete_task(int task_id) {
|
||||||
quest_manager.uncompletetask(task_id);
|
return quest_manager.uncompletetask(task_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_task_time_left(int task_id) {
|
int lua_task_time_left(int task_id) {
|
||||||
|
|||||||
@@ -3336,6 +3336,16 @@ bool Perl_Client_KeyRingRemove(Client* self, uint32 item_id)
|
|||||||
return self->KeyRingRemove(item_id);
|
return self->KeyRingRemove(item_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Perl_Client_CompleteTask(Client* self, int task_id)
|
||||||
|
{
|
||||||
|
return self->CompleteTask(task_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Perl_Client_UncompleteTask(Client* self, int task_id)
|
||||||
|
{
|
||||||
|
return self->UncompleteTask(task_id);
|
||||||
|
}
|
||||||
|
|
||||||
void perl_register_client()
|
void perl_register_client()
|
||||||
{
|
{
|
||||||
perl::interpreter perl(PERL_GET_THX);
|
perl::interpreter perl(PERL_GET_THX);
|
||||||
@@ -3418,6 +3428,7 @@ void perl_register_client()
|
|||||||
package.add("ClearPEQZoneFlag", &Perl_Client_ClearPEQZoneFlag);
|
package.add("ClearPEQZoneFlag", &Perl_Client_ClearPEQZoneFlag);
|
||||||
package.add("ClearXTargets", &Perl_Client_ClearXTargets);
|
package.add("ClearXTargets", &Perl_Client_ClearXTargets);
|
||||||
package.add("ClearZoneFlag", &Perl_Client_ClearZoneFlag);
|
package.add("ClearZoneFlag", &Perl_Client_ClearZoneFlag);
|
||||||
|
package.add("CompleteTask", &Perl_Client_CompleteTask);
|
||||||
package.add("Connected", &Perl_Client_Connected);
|
package.add("Connected", &Perl_Client_Connected);
|
||||||
package.add("CountAugmentEquippedByID", &Perl_Client_CountAugmentEquippedByID);
|
package.add("CountAugmentEquippedByID", &Perl_Client_CountAugmentEquippedByID);
|
||||||
package.add("CountItem", &Perl_Client_CountItem);
|
package.add("CountItem", &Perl_Client_CountItem);
|
||||||
@@ -3909,6 +3920,7 @@ void perl_register_client()
|
|||||||
package.add("Thirsty", &Perl_Client_Thirsty);
|
package.add("Thirsty", &Perl_Client_Thirsty);
|
||||||
package.add("TrainDiscBySpellID", &Perl_Client_TrainDiscBySpellID);
|
package.add("TrainDiscBySpellID", &Perl_Client_TrainDiscBySpellID);
|
||||||
package.add("UnFreeze", &Perl_Client_UnFreeze);
|
package.add("UnFreeze", &Perl_Client_UnFreeze);
|
||||||
|
package.add("UncompleteTask", &Perl_Client_UncompleteTask);
|
||||||
package.add("Undye", &Perl_Client_Undye);
|
package.add("Undye", &Perl_Client_Undye);
|
||||||
package.add("UnmemSpell", (void(*)(Client*, int))&Perl_Client_UnmemSpell);
|
package.add("UnmemSpell", (void(*)(Client*, int))&Perl_Client_UnmemSpell);
|
||||||
package.add("UnmemSpell", (void(*)(Client*, int, bool))&Perl_Client_UnmemSpell);
|
package.add("UnmemSpell", (void(*)(Client*, int, bool))&Perl_Client_UnmemSpell);
|
||||||
|
|||||||
+6
-10
@@ -2959,19 +2959,15 @@ void QuestManager::failtask(int taskid) {
|
|||||||
initiator->FailTask(taskid);
|
initiator->FailTask(taskid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::uncompletetask(int task_id) {
|
bool QuestManager::uncompletetask(int task_id) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
if (RuleB(TaskSystem, EnableTaskSystem) && initiator) {
|
if (!RuleB(TaskSystem, EnableTaskSystem) || !initiator) {
|
||||||
CompletedTasksRepository::DeleteWhere(
|
return false;
|
||||||
database,
|
|
||||||
fmt::format(
|
|
||||||
"charid = {} AND taskid = {}",
|
|
||||||
initiator->CharacterID(),
|
|
||||||
task_id
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return initiator->UncompleteTask(task_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int QuestManager::tasktimeleft(int taskid) {
|
int QuestManager::tasktimeleft(int taskid) {
|
||||||
|
|||||||
+1
-1
@@ -224,7 +224,7 @@ public:
|
|||||||
void resettaskactivity(int task, int activity);
|
void resettaskactivity(int task, int activity);
|
||||||
void assigntask(int taskid, bool enforce_level_requirement = false);
|
void assigntask(int taskid, bool enforce_level_requirement = false);
|
||||||
void failtask(int taskid);
|
void failtask(int taskid);
|
||||||
void uncompletetask(int task_id);
|
bool uncompletetask(int task_id);
|
||||||
int tasktimeleft(int taskid);
|
int tasktimeleft(int taskid);
|
||||||
bool istaskcompleted(int task_id);
|
bool istaskcompleted(int task_id);
|
||||||
bool aretaskscompleted(const std::vector<int>& task_ids);
|
bool aretaskscompleted(const std::vector<int>& task_ids);
|
||||||
|
|||||||
@@ -1406,6 +1406,16 @@ bool ClientTaskState::CompleteTask(Client *c, uint32 task_id)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ClientTaskState::UncompleteTask(int task_id)
|
||||||
|
{
|
||||||
|
return std::erase_if(
|
||||||
|
m_completed_tasks,
|
||||||
|
[&](const CompletedTaskInformation& task) {
|
||||||
|
return task.task_id == task_id;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
void ClientTaskState::ShowClientTaskInfoMessage(ClientTaskInformation *task, Client *c)
|
void ClientTaskState::ShowClientTaskInfoMessage(ClientTaskInformation *task, Client *c)
|
||||||
{
|
{
|
||||||
const auto task_data = task_manager->GetTaskData(task->task_id);
|
const auto task_data = task_manager->GetTaskData(task->task_id);
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ public:
|
|||||||
bool HasExploreTask(Client* client) const;
|
bool HasExploreTask(Client* client) const;
|
||||||
void EndSharedTask(Client* client, bool send_fail);
|
void EndSharedTask(Client* client, bool send_fail);
|
||||||
bool CompleteTask(Client *c, uint32 task_id);
|
bool CompleteTask(Client *c, uint32 task_id);
|
||||||
|
bool UncompleteTask(int task_id);
|
||||||
|
|
||||||
inline bool HasFreeTaskSlot() { return m_active_task.task_id == TASKSLOTEMPTY; }
|
inline bool HasFreeTaskSlot() { return m_active_task.task_id == TASKSLOTEMPTY; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user