mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[8002] Implemented ACHIEVEMENT_CRITERIA_DATA_TYPE S_DRUNK and fixed typos in ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM
(cherry picked from commit c2f9c7a0b46fb3544930666110e240256361cd4a) Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
cf7482e0c8
commit
d1c96855cb
4 changed files with 21 additions and 3 deletions
|
|
@ -207,7 +207,15 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
|
||||||
if(team.team != ALLIANCE && team.team != HORDE)
|
if(team.team != ALLIANCE && team.team != HORDE)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb( "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM (%u) have unknown team in value1 (%u), ignore.",
|
sLog.outErrorDb( "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM (%u) have unknown team in value1 (%u), ignore.",
|
||||||
criteria->ID, criteria->requiredType,dataType,gender.gender);
|
criteria->ID, criteria->requiredType,dataType,team.team);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK:
|
||||||
|
if(drunk.state >= MAX_DRUNKEN)
|
||||||
|
{
|
||||||
|
sLog.outErrorDb( "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK (%u) have unknown drunken state in value1 (%u), ignore.",
|
||||||
|
criteria->ID, criteria->requiredType,dataType,drunk.state);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -275,6 +283,8 @@ bool AchievementCriteriaData::Meets(Player const* source, Unit const* target, ui
|
||||||
if (!target || target->GetTypeId() != TYPEID_PLAYER)
|
if (!target || target->GetTypeId() != TYPEID_PLAYER)
|
||||||
return false;
|
return false;
|
||||||
return ((Player*)target)->GetTeam() == team.team;
|
return ((Player*)target)->GetTeam() == team.team;
|
||||||
|
case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK:
|
||||||
|
return Player::GetDrunkenstateByValue(source->GetDrunkValue()) >= drunk.state;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,9 +57,10 @@ enum AchievementCriteriaDataType
|
||||||
ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY = 12,// difficulty normal/heroic difficulty for current event map
|
ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY = 12,// difficulty normal/heroic difficulty for current event map
|
||||||
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
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE 15 // maximum value in AchievementCriteriaDataType enum
|
#define MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE 16 // maximum value in AchievementCriteriaDataType enum
|
||||||
|
|
||||||
class Player;
|
class Player;
|
||||||
class Unit;
|
class Unit;
|
||||||
|
|
@ -134,6 +135,11 @@ struct AchievementCriteriaData
|
||||||
{
|
{
|
||||||
uint32 team;
|
uint32 team;
|
||||||
} team;
|
} team;
|
||||||
|
// ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK = 15
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
uint32 state;
|
||||||
|
} drunk;
|
||||||
// ...
|
// ...
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -371,6 +371,8 @@ enum DrunkenState
|
||||||
DRUNKEN_SMASHED = 3
|
DRUNKEN_SMASHED = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define MAX_DRUNKEN 4
|
||||||
|
|
||||||
enum PlayerFlags
|
enum PlayerFlags
|
||||||
{
|
{
|
||||||
PLAYER_FLAGS_GROUP_LEADER = 0x00000001,
|
PLAYER_FLAGS_GROUP_LEADER = 0x00000001,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8001"
|
#define REVISION_NR "8002"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue