Este un bug care este in Metin2 de vreo 20 de ani. O sa las quote de la @Mitachi, persoana care a rezolvat acest bug.
Sursa de la martysama are deja rezolvat acest bug.
*Poze / Video:I don't usually explain what I do, but I've decided to start doing so. It might be useful, who knows.
This is quite an old and well-known bug, that’s why quests have always been written in a way to avoid it.
The core issue is that quests are initialized before affects, so the when login trigger fires before affects are loaded.
Have you ever tried to do something on login that involved affects?
e.g.:
-You want to check if the player has a mount when entering the OX map and dismount them.
-You want to polymorph them into mob 101.
Well, that wouldn’t work.
The common workaround everyone uses is simply adding a timer to the login trigger, even 1 second is enough.
That’s why this bug has never been considered a real problem: the workaround is simple and effective. If it works, it works.
*Link download / Code:
Cautam in void CInputDB::QuestLoad(LPDESC d, const char * c_pData), la sfarsitul functiei:
Code:
if (ch->GetDesc()->IsPhase(PHASE_GAME))
{
sys_log(0, "QUEST_LOAD: Login pc %d", pQuestTable[0].dwPID);
quest::CQuestManager::instance().Login(pQuestTable[0].dwPID);
}
else
{
quest_login_event_info* info = AllocEventInfo<quest_login_event_info>();
info->dwPID = ch->GetPlayerID();
event_create(quest_login_event, info, PASSES_PER_SEC(1));
}Cautam in EVENTFUNC(quest_login_event):
Code:
else if (d->IsPhase(PHASE_GAME))
{
sys_log(0, "QUEST_LOAD: Login pc %d by event", ch->GetPlayerID());
quest::CQuestManager::instance().Login(ch->GetPlayerID());
return 0;
}IsLoadedAffect is only set if you actually have an Affect or LoadAffect won't load, which is a problem.
Not only for this fix, but in general, IsLoadedAffect is used in anti-exploit contexts.
It is necessary that they are loaded even if you do not have affect, so, you got another fix thereCode:case QID_AFFECT: sys_log(0, "QID_AFFECT %u", info->dwHandle); // if there are no affects, make an empty one to send the packet if (!mysql_num_rows(pSQLResult)) { TPacketAffectElement pAffElem{}; DWORD dwCount = 0; peer->EncodeHeader(HEADER_DG_AFFECT_LOAD, info->dwHandle, sizeof(DWORD) + sizeof(DWORD) + sizeof(TPacketAffectElement) * dwCount); peer->Encode(&info->player_id, sizeof(DWORD)); peer->Encode(&dwCount, sizeof(DWORD)); peer->Encode(&pAffElem, sizeof(TPacketAffectElement) * dwCount); break; } RESULT_AFFECT_LOAD(peer, pSQLResult, info->dwHandle); break;


la acest mesaj și conținutul se va afișa automat.

