mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 10:56:38 +01:00
Code/ConditionMgr: added condition_NOITEM (26) value1: item.entry value2: 0/1 if 1 it searches player's bank too
--HG-- branch : trunk
This commit is contained in:
@@ -165,6 +165,9 @@ bool Condition::Meets(Player * player, Unit* invoker)
|
||||
case CONDITION_SPELL:
|
||||
condMeets = player->HasSpell(mConditionValue1);
|
||||
break;
|
||||
case CONDITION_NOITEM:
|
||||
condMeets = !player->HasItemCount(mConditionValue1, 1, mConditionValue2 ? true : false);
|
||||
break;
|
||||
default:
|
||||
condMeets = false;
|
||||
refId = 0;
|
||||
@@ -1249,6 +1252,16 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
||||
sLog.outErrorDb("Spell condition has useless data in value2 (%u)!", cond->mConditionValue2);
|
||||
break;
|
||||
}
|
||||
case CONDITION_NOITEM:
|
||||
{
|
||||
ItemPrototype const *proto = sObjectMgr.GetItemPrototype(cond->mConditionValue1);
|
||||
if (!proto)
|
||||
{
|
||||
sLog.outErrorDb("NoItem condition has non existing item (%u), skipped", cond->mConditionValue1);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_AREAID:
|
||||
case CONDITION_INSTANCE_DATA:
|
||||
break;
|
||||
|
||||
@@ -55,7 +55,8 @@ enum ConditionType
|
||||
CONDITION_AREAID = 23, // area_id 0 +referenceID true if in area_id
|
||||
CONDITION_ITEM_TARGET = 24, // ItemRequiredTargetType, TargetEntry, 0
|
||||
CONDITION_SPELL = 25, // spell_id 0 +referenceID true if knows spell
|
||||
CONDITION_MAX = 26 // MAX
|
||||
CONDITION_NOITEM = 26, // item_id bank +referenceID true if player does not have any of the item (if 'bank' is set it searches in bank slots too)
|
||||
CONDITION_MAX = 27 // MAX
|
||||
};
|
||||
|
||||
enum ConditionSourceType
|
||||
|
||||
Reference in New Issue
Block a user