forked from metin2/server
1
0
Fork 0

add: Owsap quest renewal.

This commit is contained in:
WildEgo 2024-06-01 18:45:38 +01:00
parent 652534ae4a
commit 20565c174b
8 changed files with 241 additions and 1 deletions

View File

@ -0,0 +1,146 @@
#######################################
# Main Quests
# 0
0 main_quest_lv1
0 main_quest_lv2
0 main_quest_lv3
0 main_quest_lv6
0 main_quest_lv7
0 main_quest_lv9
0 main_quest_lv10
0 main_quest_lv12
0 main_quest_lv14
0 main_quest_lv15
0 main_quest_lv16
0 main_quest_lv27
0 main_quest_lv30
0 main_quest_lv32
0 main_quest_lv40
0 main_quest_lv47
0 main_quest_lv50
0 main_quest_lv55
0 main_quest_lv60
0 main_quest_lv66
0 main_quest_lv72
0 main_quest_lv78
0 main_quest_lv84
0 main_quest_lv90
0 main_quest_lv91
0 main_quest_lv92
0 main_quest_lv93
0 main_quest_lv94
0 main_quest_lv95
0 main_quest_lv96
0 main_quest_lv97
0 main_quest_lv98
0 main_quest_flame_lv99
0 main_quest_flame_lv100
0 main_quest_flame_lv101
0 main_quest_flame_lv102
0 main_quest_flame_lv103
0 main_quest_flame_lv104
0 main_quest_flame_lv105
#######################################
# Side Quests
# 1
1 new_quest_premium_lv4
1 subquest_1
1 subquest_2
1 subquest_3
1 subquest_4
1 subquest_5
1 subquest_6
1 subquest_7
1 subquest_8
1 subquest_9
1 subquest_10
1 subquest_11
1 subquest_12
1 subquest_13
1 subquest_15
1 subquest_16
1 subquest_17
1 subquest_18
1 subquest_19
1 subquest_20
1 subquest_21
1 subquest_22
1 subquest_23
1 subquest_24
1 subquest_25
1 subquest_26
1 subquest_27
1 subquest_30
1 subquest_31
1 subquest_32
1 subquest_33
1 subquest_34
1 subquest_36
1 subquest_37
1 subquest_38
1 subquest_39
1 subquest_40
1 subquest_41
1 subquest_42
1 subquest_44
1 subquest_45
1 subquest_46
1 subquest_47
1 subquest_48
1 subquest_49
1 new_quest_lv7
1 new_quest_lv17
1 new_quest_lv22
1 new_quest_lv26
1 new_quest_lv28
1 new_quest_lv29
1 new_quest_lv42
1 new_quest_lv43
1 new_quest_lv52
1 new_quest_lv54
1 new_quest_lv75
1 new_quest_lv80
#######################################
# Hunting Mission
# 2
#######################################
# Event Mission
# 3
#######################################
# Biologist Quests
# 4
4 make_herb_lv4
4 make_herb_lv7
4 make_herb_lv10
4 make_herb_lv15
4 make_herb_lv20
4 make_herb_lv25
4 collect_quest_lv30
4 collect_quest_lv40
4 collect_quest_lv50
4 collect_quest_lv60
4 collect_quest_lv70
4 collect_quest_lv80
4 collect_quest_lv85
4 collect_quest_lv90
4 collect_quest_lv92
4 collect_quest_lv94
#######################################
# Game Mission
# 5
5 find_brother_article
5 find_squareguard
5 find_senior_soldier
#######################################
# Mission Book Quests
# 6
#######################################
# Daily Quests
# 7

View File

@ -3,4 +3,5 @@
//#define __AUCTION__
#define __PET_SYSTEM__
#define __QUEST_RENEWAL__ // Quest Page Renewal by Owsap
#endif

View File

@ -1415,6 +1415,10 @@ struct packet_quest_info
WORD size;
WORD index;
BYTE flag;
#if defined(__QUEST_RENEWAL__)
BYTE type;
bool is_confirmed;
#endif
};
enum

View File

@ -199,9 +199,44 @@ namespace quest
CloseState(*pPC->GetRunningQuestState());
pPC->EndRunning();
}
}
#if defined(__QUEST_RENEWAL__)
int CQuestManager::ReadQuestCategoryFile(WORD quest_index)
{
// ¹ÞÀº quest_index¸¦ quest_name·Î º¯È¯ ÈÄ ºñ±³
int quest_type = 0;
string quest_name = CQuestManager::instance().GetQuestNameByIndex(quest_index);
ifstream file((g_stQuestDir + "/questcategory.txt").c_str());
if (file)
{
std::string line;
while (getline(file, line))
{
line.erase(remove(line.begin(), line.end(), ' '), line.end()); // remove all white spaces
if (line.empty() || line.front() == '#')
continue; // Skip empty lines or lines starting with #
int type = stoi(line.substr(0, line.find('\t')));
string name = line.substr(line.find('\t') + 1);
if (test_server)
sys_log(0, "QUEST reading script of %s(%d)", name.c_str(), type);
if (quest_name == name)
{
quest_type = type;
break;
}
}
}
else
sys_err("QUEST Cannot open 'questcategory.txt'");
return quest_type;
}
#endif
void CQuestManager::Input(unsigned int pc, const char* msg)
{
PC* pPC = GetPC(pc);

View File

@ -181,6 +181,10 @@ namespace quest
#endif
void RegisterNPCVnum(DWORD dwVnum);
#if defined(__QUEST_RENEWAL__)
// Quest Category
int ReadQuestCategoryFile(WORD quest_index);
#endif
private:
LPDUNGEON m_pSelectedDungeon;

View File

@ -778,6 +778,20 @@ namespace quest
return false;
}
#if defined(__QUEST_RENEWAL__)
CQuestManager& rkQmgr = CQuestManager::instance();
const LPCHARACTER c_lpCh = rkQmgr.GetCurrentCharacterPtr();
if (c_lpCh != NULL)
{
char szBuf[255]{};
snprintf(szBuf, sizeof(szBuf), "%s.%s", questName, "is_confirmed");
c_lpCh->SetQuestFlag(string(questName) + ".is_confirmed", 1);
if (test_server)
SPDLOG_DEBUG("NPC::OnInfo: pc (name) %s has confirmed the quest %s", c_lpCh->GetName(), questName);
}
#endif
CQuestManager::ExecuteQuestScript(pc, quest_index, itPCQuest->second.st, itQuestScript->second.GetCode(), itQuestScript->second.GetSize());
return true;
}

View File

@ -236,6 +236,14 @@ namespace quest
qi.size = sizeof(struct packet_quest_info);
qi.index = m_RunningQuestState->iIndex;
qi.flag = m_iSendToClient;
#if defined(__QUEST_RENEWAL__)
qi.type = CQuestManager::instance().ReadQuestCategoryFile(qi.index);
qi.is_confirmed = false;
const LPCHARACTER c_lpCh = CQuestManager::instance().GetCurrentCharacterPtr();
if (c_lpCh != NULL)
qi.is_confirmed = static_cast<bool>(c_lpCh->GetQuestFlag(m_stCurQuest + ".is_confirmed"));
#endif
TEMP_BUFFER buf;
buf.write(&qi, sizeof(qi));

View File

@ -43,6 +43,34 @@ namespace quest
QUEST_SEND_ICON_FILE = (1 << 6), // 24자 까지
};
#if defined(__QUEST_RENEWAL__)
enum EQuestType
{
QUEST_TYPE_MAIN,
QUEST_TYPE_SUB,
QUEST_TYPE_LEVELUP,
QUEST_TYPE_EVENT,
QUEST_TYPE_COLLECTION,
QUEST_TYPE_SYSTEM,
QUEST_TYPE_SCROLL,
QUEST_TYPE_DAILY,
QUEST_TYPE_UNEXPOSED,
QUEST_TYPE_MAX
};
enum EQuestSkin
{
QUEST_SKIN_NOWINDOW,
QUEST_SKIN_NORMAL,
QUEST_SKIN_UNKOWN1,
QUEST_SKIN_UNKOWN2,
QUEST_SKIN_SCROLL,
QUEST_SKIN_CINEMATIC,
QUEST_SKIN_COUNT,
QUEST_SKIN_MAX
};
#endif
typedef map<unsigned int, QuestState> QuestInfo;
typedef QuestInfo::iterator QuestInfoIterator;