mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[8976] Implement CONDITION_RACE_CLASS
Condition has independent value1 (race mask) and value2 (class mask) fields and can be used with one or both. Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
d897f55970
commit
4f5ed57fc2
3 changed files with 30 additions and 4 deletions
|
|
@ -7253,6 +7253,10 @@ bool PlayerCondition::Meets(Player const * player) const
|
|||
}
|
||||
return false;
|
||||
}
|
||||
case CONDITION_RACE_CLASS:
|
||||
if ((!value1 || (player->getRaceMask() & value1)) && (!value2 || (player->getClassMask() & value2)))
|
||||
return true;
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
@ -7406,6 +7410,27 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val
|
|||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_RACE_CLASS:
|
||||
{
|
||||
if (!value1 && !value2)
|
||||
{
|
||||
sLog.outErrorDb("Race_class condition has both values like 0, skipped");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (value1 && !(value1 & RACEMASK_ALL_PLAYABLE))
|
||||
{
|
||||
sLog.outErrorDb("Race_class condition has invalid player class %u, skipped", value1);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (value2 && !(value2 & CLASSMASK_ALL_PLAYABLE))
|
||||
{
|
||||
sLog.outErrorDb("Race_class condition has invalid race mask %u, skipped", value2);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_NONE:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -283,11 +283,12 @@ enum ConditionType
|
|||
CONDITION_QUESTTAKEN = 9, // quest_id 0, for condition true while quest active.
|
||||
CONDITION_AD_COMMISSION_AURA = 10, // 0 0, for condition true while one from AD commission aura active
|
||||
CONDITION_NO_AURA = 11, // spell_id effindex
|
||||
CONDITION_ACTIVE_EVENT = 12, // event_id
|
||||
CONDITION_AREA_FLAG = 13 // area_flag area_flag_not
|
||||
CONDITION_ACTIVE_EVENT = 12, // event_id 0
|
||||
CONDITION_AREA_FLAG = 13, // area_flag area_flag_not
|
||||
CONDITION_RACE_CLASS = 14, // race_mask class_mask
|
||||
};
|
||||
|
||||
#define MAX_CONDITION 14 // maximum value in ConditionType enum
|
||||
#define MAX_CONDITION 15 // maximum value in ConditionType enum
|
||||
|
||||
struct PlayerCondition
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "8975"
|
||||
#define REVISION_NR "8976"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue