mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[9544] Implement CONDITION_NOITEM.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
b47520a500
commit
a30af12772
3 changed files with 12 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue