[11849] Implement Condition CONDITION_SKILL_BELOW to be able to check if a player has a skill lower than a given value

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
Schmoozerd 2011-11-27 19:11:16 +01:00
parent 9eb96b7811
commit e19943b907
2 changed files with 9 additions and 0 deletions

View file

@ -7654,6 +7654,11 @@ bool PlayerCondition::Meets(Player const * player) const
return false;
}
case CONDITION_SKILL_BELOW:
if (value2 == 1)
return !player->HasSkill(value1);
else
return player->HasSkill(value1) && player->GetBaseSkillValue(value1) < value2;
default:
return false;
}
@ -7744,6 +7749,7 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val
break;
}
case CONDITION_SKILL:
case CONDITION_SKILL_BELOW:
{
SkillLineEntry const *pSkill = sSkillLineStore.LookupEntry(value1);
if (!pSkill)