mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
Implemented ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION
This commit is contained in:
parent
c0c0c9c776
commit
4f559eb7e6
2 changed files with 11 additions and 1 deletions
|
|
@ -455,6 +455,13 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
SetCriteriaProgress(achievementCriteria, 1);
|
||||
break;
|
||||
}
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION:
|
||||
{
|
||||
int32 reputation = GetPlayer()->GetReputation(achievementCriteria->gain_reputation.factionID);
|
||||
if (reputation > 0)
|
||||
SetCriteriaProgress(achievementCriteria, reputation);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(IsCompletedCriteria(achievementCriteria))
|
||||
CompletedCriteria(achievementCriteria);
|
||||
|
|
@ -544,6 +551,8 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achieve
|
|||
return progress->counter >= achievementCriteria->learn_skilline_spell.spellCount;
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP:
|
||||
return progress->counter >= achievementCriteria->visit_barber.numberOfVisits;
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION:
|
||||
return progress->counter >= achievementCriteria->gain_reputation.reputationAmount;
|
||||
|
||||
// handle all statistic-only criteria here
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND:
|
||||
|
|
|
|||
|
|
@ -5691,7 +5691,7 @@ bool Player::ModifyOneFactionReputation(FactionEntry const* factionEntry, int32
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION);
|
||||
SendFactionState(&(itr->second));
|
||||
|
||||
return true;
|
||||
|
|
@ -5757,6 +5757,7 @@ bool Player::SetOneFactionReputation(FactionEntry const* factionEntry, int32 sta
|
|||
SetFactionAtWar(&itr->second,true);
|
||||
|
||||
SendFactionState(&(itr->second));
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue