Implement support of Timed Achievement. Thanks Shauren.
Fixes issue #1431. --HG-- branch : trunk
This commit is contained in:
@@ -1218,6 +1218,8 @@ void Player::Update(uint32 p_time)
|
||||
}
|
||||
}
|
||||
|
||||
GetAchievementMgr().UpdateTimedAchievements(p_time);
|
||||
|
||||
if (hasUnitState(UNIT_STAT_MELEE_ATTACKING) && !hasUnitState(UNIT_STAT_CASTING))
|
||||
{
|
||||
if (Unit *pVictim = getVictim())
|
||||
@@ -13975,6 +13977,8 @@ void Player::AddQuest(Quest const *pQuest, Object *questGiver)
|
||||
if (questStatusData.uState != QUEST_NEW)
|
||||
questStatusData.uState = QUEST_CHANGED;
|
||||
|
||||
GetAchievementMgr().StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_QUEST, quest_id);
|
||||
|
||||
//starting initial quest script
|
||||
if (questGiver && pQuest->GetQuestStartScript() != 0)
|
||||
GetMap()->ScriptsStart(sQuestStartScripts, pQuest->GetQuestStartScript(), questGiver, this);
|
||||
@@ -14899,7 +14903,9 @@ void Player::KilledMonsterCredit(uint32 entry, uint64 guid)
|
||||
real_entry = killed->GetEntry();
|
||||
}
|
||||
|
||||
GetAchievementMgr().StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_CREATURE, real_entry); // MUST BE CALLED FIRST
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, real_entry, addkillcount);
|
||||
|
||||
for (uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i)
|
||||
{
|
||||
uint32 questid = GetQuestSlotQuestId(i);
|
||||
|
||||
Reference in New Issue
Block a user