[9119] Add achievement creteria requirements for ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET*

Most ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET and ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2
not need any additional requirements (so just ACHIEVEMENT_CRITERIA_REQUIRE_NONE(0) in DB) but some
need map difficualty checks and some ACHIEVEMENT_CRITERIA_REQUIRE_INSTANCE_SCRIPT also.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
GriffonHeart 2010-01-07 20:29:16 +03:00 committed by VladimirMangos
parent 0b3cf7883e
commit a2e92cdb4e
2 changed files with 14 additions and 1 deletions

View file

@ -93,6 +93,8 @@ bool AchievementCriteriaRequirement::IsValid(AchievementCriteriaEntry const* cri
case ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL:
case ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE:
case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2:
case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET:
case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2:
break;
default:
sLog.outErrorDb( "Table `achievement_criteria_requirement` have data for not supported criteria type (Entry: %u Type: %u), ignore.", criteria->ID, criteria->requiredType);
@ -1033,10 +1035,21 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
}
case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET:
case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2:
{
if (!miscvalue1 || miscvalue1 != achievementCriteria->be_spell_target.spellID)
continue;
// those requirements couldn't be found in the dbc
AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
if(!data)
continue;
if(!data->Meets(GetPlayer(),unit))
continue;
SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
break;
}
case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL:
case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2:
{

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9118"
#define REVISION_NR "9119"
#endif // __REVISION_NR_H__