mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 10:37:01 +00:00
[8003] Implement ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY.
This commit is contained in:
parent
d1c96855cb
commit
f6029831e3
3 changed files with 33 additions and 17 deletions
|
|
@ -219,6 +219,14 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
case ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY:
|
||||||
|
if (!sHolidaysStore.LookupEntry(holiday.id))
|
||||||
|
{
|
||||||
|
sLog.outErrorDb( "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY (%u) have unknown holiday in value1 (%u), ignore.",
|
||||||
|
criteria->ID, criteria->requiredType,dataType,drunk.state);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
default:
|
default:
|
||||||
sLog.outErrorDb( "Table `achievement_criteria_data` (Entry: %u Type: %u) have data for not supported data type (%u), ignore.", criteria->ID, criteria->requiredType,dataType);
|
sLog.outErrorDb( "Table `achievement_criteria_data` (Entry: %u Type: %u) have data for not supported data type (%u), ignore.", criteria->ID, criteria->requiredType,dataType);
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -285,6 +293,8 @@ bool AchievementCriteriaData::Meets(Player const* source, Unit const* target, ui
|
||||||
return ((Player*)target)->GetTeam() == team.team;
|
return ((Player*)target)->GetTeam() == team.team;
|
||||||
case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK:
|
case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK:
|
||||||
return Player::GetDrunkenstateByValue(source->GetDrunkValue()) >= drunk.state;
|
return Player::GetDrunkenstateByValue(source->GetDrunkValue()) >= drunk.state;
|
||||||
|
case ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY:
|
||||||
|
return IsHolidayActive(HolidayIds(holiday.id));
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,9 +58,10 @@ enum AchievementCriteriaDataType
|
||||||
ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT = 13,// count "with less than %u people in the zone"
|
ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT = 13,// count "with less than %u people in the zone"
|
||||||
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM = 14,// team HORDE(67), ALLIANCE(469)
|
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM = 14,// team HORDE(67), ALLIANCE(469)
|
||||||
ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK = 15,// drunken_state 0 (enum DrunkenState) of player
|
ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK = 15,// drunken_state 0 (enum DrunkenState) of player
|
||||||
|
ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY = 16,// holiday_id 0 event in holiday time
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE 16 // maximum value in AchievementCriteriaDataType enum
|
#define MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE 17 // maximum value in AchievementCriteriaDataType enum
|
||||||
|
|
||||||
class Player;
|
class Player;
|
||||||
class Unit;
|
class Unit;
|
||||||
|
|
@ -140,6 +141,11 @@ struct AchievementCriteriaData
|
||||||
{
|
{
|
||||||
uint32 state;
|
uint32 state;
|
||||||
} drunk;
|
} drunk;
|
||||||
|
// ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
uint16 id;
|
||||||
|
} holiday;
|
||||||
// ...
|
// ...
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8002"
|
#define REVISION_NR "8003"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue