mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[8970] Implement CONDITION_AREA_FLAG
Value1 is for "include flag", Value2 for "not include flag" Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
5e2c6e6b86
commit
fb6712f3a3
3 changed files with 21 additions and 2 deletions
|
|
@ -7244,6 +7244,15 @@ bool PlayerCondition::Meets(Player const * player) const
|
||||||
return !player->HasAura(value1, value2);
|
return !player->HasAura(value1, value2);
|
||||||
case CONDITION_ACTIVE_EVENT:
|
case CONDITION_ACTIVE_EVENT:
|
||||||
return sGameEventMgr.IsActiveEvent(value1);
|
return sGameEventMgr.IsActiveEvent(value1);
|
||||||
|
case CONDITION_AREA_FLAG:
|
||||||
|
{
|
||||||
|
if (AreaTableEntry const *pAreaEntry = GetAreaEntryByAreaID(player->GetAreaId()))
|
||||||
|
{
|
||||||
|
if ((!value1 || (pAreaEntry->flags & value1)) && (!value2 || !(pAreaEntry->flags & value2)))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -7388,6 +7397,15 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case CONDITION_AREA_FLAG:
|
||||||
|
{
|
||||||
|
if (!value1 && !value2)
|
||||||
|
{
|
||||||
|
sLog.outErrorDb("Area flag condition has both values like 0, skipped");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case CONDITION_NONE:
|
case CONDITION_NONE:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -284,9 +284,10 @@ enum ConditionType
|
||||||
CONDITION_AD_COMMISSION_AURA = 10, // 0 0, for condition true while one from AD commission aura 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_NO_AURA = 11, // spell_id effindex
|
||||||
CONDITION_ACTIVE_EVENT = 12, // event_id
|
CONDITION_ACTIVE_EVENT = 12, // event_id
|
||||||
|
CONDITION_AREA_FLAG = 13 // area_flag area_flag_not
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MAX_CONDITION 13 // maximum value in ConditionType enum
|
#define MAX_CONDITION 14 // maximum value in ConditionType enum
|
||||||
|
|
||||||
struct PlayerCondition
|
struct PlayerCondition
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8969"
|
#define REVISION_NR "8970"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue