Added option item requirement
This commit is contained in:
parent
760540f687
commit
c12e7aded0
@ -30,3 +30,11 @@ Leech.DungeonsOnly = 1
|
|||||||
#
|
#
|
||||||
|
|
||||||
Leech.Amount = 0.05
|
Leech.Amount = 0.05
|
||||||
|
#
|
||||||
|
# Leech.RequiredItemId
|
||||||
|
# Description: Allows setting an item required in bags to activate leech.
|
||||||
|
# Default: 0 - No Item Required
|
||||||
|
# xxxxx - Specify the item ID
|
||||||
|
#
|
||||||
|
|
||||||
|
Leech.RequiredItemId = 0
|
||||||
|
|||||||
@ -23,6 +23,15 @@ public:
|
|||||||
}
|
}
|
||||||
Player* player = isPet ? attacker->GetOwner()->ToPlayer() : attacker->ToPlayer();
|
Player* player = isPet ? attacker->GetOwner()->ToPlayer() : attacker->ToPlayer();
|
||||||
|
|
||||||
|
|
||||||
|
uint32 requiredItem = sConfigMgr->GetOption<uint32>("Leech.RequiredItemId", 0u);
|
||||||
|
if (requiredItem != 0)
|
||||||
|
{
|
||||||
|
if (!player || !player->HasItemCount(requiredItem, 1, false))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (sConfigMgr->GetOption<bool>("Leech.DungeonsOnly", true) && !(player->GetMap()->IsDungeon()))
|
if (sConfigMgr->GetOption<bool>("Leech.DungeonsOnly", true) && !(player->GetMap()->IsDungeon()))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user