Well, I'm making a npc to verify if a player has a quest completed.
As you maybe know, some custom quest gets bug and the players can't recive the awards and they have the npc kills or items requireds.
So, my NPC will check the items and requiredNPCorGo, and if those fields are completed, delete quest, add it again to the player and complete it.
Maybe this code will help me to do the thing that I want:
Thanks for your help
As you maybe know, some custom quest gets bug and the players can't recive the awards and they have the npc kills or items requireds.
So, my NPC will check the items and requiredNPCorGo, and if those fields are completed, delete quest, add it again to the player and complete it.
Maybe this code will help me to do the thing that I want:
Code:
Quest const* qInfo = sObjectMgr->GetQuestTemplate(quest_id);
QuestStatusMap::iterator itr = m_QuestStatus.find(quest_id);
QuestStatusData &q_status = itr->second;
if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL | QUEST_SPECIAL_FLAGS_CAST | QUEST_SPECIAL_FLAGS_SPEAKTO))
{
for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
{
if (qInfo->RequiredNpcOrGo[i] == 0)
continue;
if (qInfo->RequiredNpcOrGoCount[i] != 0 && q_status.CreatureOrGOCount[i] < qInfo->RequiredNpcOrGoCount[i])
return false;
}
}
if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER))
{
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++)
{
if (qInfo->RequiredItemCount[i]!= 0 && q_status.ItemCount[i] < qInfo->RequiredItemCount[i])
return false;
}
}
Thanks for your help