mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
[12007] Add new CONDITION_REPUTATION_RANK_MAX (30)
Rename old CONDITION_REPUTATION_RANK to CONDITION_REPUTATION_RANK_MIN Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
parent
05a33ee04e
commit
ffd060d400
3 changed files with 17 additions and 4 deletions
|
|
@ -7560,7 +7560,7 @@ bool PlayerCondition::Meets(Player const * player) const
|
|||
player->GetZoneAndAreaId(zone,area);
|
||||
return (zone == m_value1 || area == m_value1) == (m_value2 == 0);
|
||||
}
|
||||
case CONDITION_REPUTATION_RANK:
|
||||
case CONDITION_REPUTATION_RANK_MIN:
|
||||
{
|
||||
FactionEntry const* faction = sFactionStore.LookupEntry(m_value1);
|
||||
return faction && player->GetReputationMgr().GetRank(faction) >= ReputationRank(m_value2);
|
||||
|
|
@ -7729,6 +7729,11 @@ bool PlayerCondition::Meets(Player const * player) const
|
|||
return !player->HasSkill(m_value1);
|
||||
else
|
||||
return player->HasSkill(m_value1) && player->GetBaseSkillValue(m_value1) < m_value2;
|
||||
case CONDITION_REPUTATION_RANK_MAX:
|
||||
{
|
||||
FactionEntry const* faction = sFactionStore.LookupEntry(m_value1);
|
||||
return faction && player->GetReputationMgr().GetRank(faction) <= ReputationRank(m_value2);
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
@ -7825,7 +7830,8 @@ bool PlayerCondition::IsValid(uint16 entry, ConditionType condition, uint32 valu
|
|||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_REPUTATION_RANK:
|
||||
case CONDITION_REPUTATION_RANK_MIN:
|
||||
case CONDITION_REPUTATION_RANK_MAX:
|
||||
{
|
||||
FactionEntry const* factionEntry = sFactionStore.LookupEntry(value1);
|
||||
if (!factionEntry)
|
||||
|
|
@ -7833,6 +7839,12 @@ bool PlayerCondition::IsValid(uint16 entry, ConditionType condition, uint32 valu
|
|||
sLog.outErrorDb("Reputation condition (entry %u, type %u) requires to have reputation non existing faction (%u), skipped", entry, condition, value1);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (value2 >= MAX_REPUTATION_RANK)
|
||||
{
|
||||
sLog.outErrorDb("Reputation condition (entry %u, type %u) has invalid rank requirement (value2 = %u) - must be between %u and %u, skipped", entry, condition, value2, MIN_REPUTATION_RANK, MAX_REPUTATION_RANK-1);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_TEAM:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue