mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[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:
parent
9eb96b7811
commit
e19943b907
2 changed files with 9 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -367,6 +367,9 @@ enum ConditionType
|
|||
// True when player can learn ability (using min skill value from SkillLineAbility).
|
||||
// Item_id can be defined in addition, to check if player has one (1) item in inventory or bank.
|
||||
// When player has spell or has item (when defined), condition return false.
|
||||
CONDITION_SKILL_BELOW = 29, // skill_id skill_value
|
||||
// True if player has skill skill_id and skill less than (and not equal) skill_value (for skill_value > 1)
|
||||
// If skill_value == 1, then true if player has not skill skill_id
|
||||
};
|
||||
|
||||
struct PlayerCondition
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue