Skip to content

Commit

Permalink
[9119] Add achievement creteria requirements for ACHIEVEMENT_CRITERIA…
Browse files Browse the repository at this point in the history
…_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>
  • Loading branch information
GriffonHeart authored and VladimirMangos committed Jan 7, 2010
1 parent beed0d4 commit c0e3cc9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/game/AchievementMgr.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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:
{
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9118"
#define REVISION_NR "9119"
#endif // __REVISION_NR_H__

0 comments on commit c0e3cc9

Please sign in to comment.