diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 08107e603..cf4c61383 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -8191,6 +8191,10 @@ bool PlayerCondition::Meets(Player const * player) const return true; return false; } + case CONDITION_ITEM_WITH_BANK: + return player->HasItemCount(value1, value2, true); + case CONDITION_NOITEM_WITH_BANK: + return !player->HasItemCount(value1, value2, true); default: return false; } @@ -8224,6 +8228,8 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val } case CONDITION_ITEM: case CONDITION_NOITEM: + case CONDITION_ITEM_WITH_BANK: + case CONDITION_NOITEM_WITH_BANK: { ItemPrototype const *proto = ObjectMgr::GetItemPrototype(value1); if (!proto) diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index 579a618ef..5b74ea60a 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -594,7 +594,7 @@ enum ConditionType { // value1 value2 for the Condition enumed CONDITION_NONE = 0, // 0 0 CONDITION_AURA = 1, // spell_id effindex - CONDITION_ITEM = 2, // item_id count + CONDITION_ITEM = 2, // item_id count check present req. amount items in inventory CONDITION_ITEM_EQUIPPED = 3, // item_id 0 CONDITION_AREAID = 4, // area_id 0, 1 (0: in (sub)area, 1: not in (sub)area) CONDITION_REPUTATION_RANK = 5, // faction_id min_rank @@ -608,16 +608,18 @@ 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 + CONDITION_NOITEM = 16, // item_id count check not present req. amount items in inventory CONDITION_SPELL = 17, // spell_id 0, 1 (0: has spell, 1: hasn't spell) CONDITION_INSTANCE_SCRIPT = 18, // map_id instance_condition_id (instance script specific enum) CONDITION_QUESTAVAILABLE = 19, // quest_id 0 for case when loot/gossip possible only if player can start quest CONDITION_ACHIEVEMENT = 20, // ach_id 0, 1 (0: has achievement, 1: hasn't achievement) for player CONDITION_ACHIEVEMENT_REALM = 21, // ach_id 0, 1 (0: has achievement, 1: hasn't achievement) for server - CONDITION_QUEST_NONE = 22 // quest_id 0 (quest did not take and not rewarded) + CONDITION_QUEST_NONE = 22, // quest_id 0 (quest did not take and not rewarded) + CONDITION_ITEM_WITH_BANK = 23, // item_id count check present req. amount items in inventory or bank + CONDITION_NOITEM_WITH_BANK = 24, // item_id count check not present req. amount items in inventory or bank }; -#define MAX_CONDITION 23 // maximum value in ConditionType enum +#define MAX_CONDITION 25 // maximum value in ConditionType enum struct PlayerCondition { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index e95081c16..740f73d18 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 "10667" + #define REVISION_NR "10668" #endif // __REVISION_NR_H__