diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 191f08def..d9ca72173 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -7469,6 +7469,8 @@ bool PlayerCondition::Meets(Player const * player) const } return false; } + case CONDITION_NOITEM: + return !player->HasItemCount(value1, value2); default: return false; } @@ -7500,6 +7502,7 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val break; } case CONDITION_ITEM: + case CONDITION_NOITEM: { ItemPrototype const *proto = ObjectMgr::GetItemPrototype(value1); if(!proto) @@ -7507,6 +7510,12 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val sLog.outErrorDb("Item condition requires to have non existing item (%u), skipped", value1); return false; } + + if(value2 < 1) + { + sLog.outErrorDb("Item condition useless with count < 1, skipped"); + return false; + } break; } case CONDITION_ITEM_EQUIPPED: diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index 4442f56a9..00976731f 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -313,9 +313,10 @@ enum ConditionType CONDITION_AREA_FLAG = 13, // area_flag area_flag_not CONDITION_RACE_CLASS = 14, // race_mask class_mask CONDITION_LEVEL = 15, // player_level 0, 1 or 2 (0: equal to, 1: equal or higher than, 2: equal or less than) + CONDITION_NOITEM = 16, // item_id count }; -#define MAX_CONDITION 16 // maximum value in ConditionType enum +#define MAX_CONDITION 17 // maximum value in ConditionType enum struct PlayerCondition { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 27ef34d56..c03f249e3 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9543" + #define REVISION_NR "9544" #endif // __REVISION_NR_H__