Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Player::KillCreditGO(uint32 entry, ObjectGuid guid)
- {
- uint16 addCastCount = 1;
- for (uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i)
- {
- uint32 questid = GetQuestSlotQuestId(i);
- if (!questid)
- continue;
- Quest const* qInfo = sObjectMgr->GetQuestTemplate(questid);
- if (!qInfo)
- continue;
- QuestStatusData& q_status = m_QuestStatus[questid];
- if (q_status.Status == QUEST_STATUS_INCOMPLETE)
- {
- if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_CAST) /*&& !qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL)*/)
- {
- for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
- {
- uint32 reqTarget = 0;
- // GO activate objective
- if (qInfo->RequiredNpcOrGo[j] < 0)
- // checked at quest_template loading
- reqTarget = - qInfo->RequiredNpcOrGo[j];
- // other not this creature/GO related objectives
- if (reqTarget != entry)
- continue;
- uint32 reqCastCount = qInfo->RequiredNpcOrGoCount[j];
- uint16 curCastCount = q_status.CreatureOrGOCount[j];
- if (curCastCount < reqCastCount)
- {
- q_status.CreatureOrGOCount[j] = curCastCount + addCastCount;
- m_QuestStatusSave[questid] = QUEST_DEFAULT_SAVE_TYPE;
- SendQuestUpdateAddCreatureOrGo(qInfo, guid, j, curCastCount, addCastCount);
- }
- if (CanCompleteQuest(questid))
- CompleteQuest(questid);
- // same objective target can be in many active quests, but not in 2 objectives for single quest (code optimization).
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment