mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-20 18:10:02 +01:00
Update NonCombatActions.cpp
This is better, even though aura check is tiny more expensive then most. Placing them into isUseful() is kinda confusing.
This commit is contained in:
parent
aaa9e1a42c
commit
972e2604ce
@ -51,15 +51,15 @@ bool DrinkAction::isUseful()
|
|||||||
{
|
{
|
||||||
return UseItemAction::isUseful() &&
|
return UseItemAction::isUseful() &&
|
||||||
AI_VALUE2(bool, "has mana", "self target") &&
|
AI_VALUE2(bool, "has mana", "self target") &&
|
||||||
AI_VALUE2(uint8, "mana", "self target") < 100 &&
|
AI_VALUE2(uint8, "mana", "self target") < 100;
|
||||||
!botAI->HasAnyAuraOf(GetTarget(), "dire bear form", "bear form", "cat form", "travel form",
|
|
||||||
"aquatic form","flight form", "swift flight form", nullptr) &&
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DrinkAction::isPossible()
|
bool DrinkAction::isPossible()
|
||||||
{
|
{
|
||||||
return !bot->IsInCombat() &&
|
return !bot->IsInCombat() &&
|
||||||
!bot->IsMounted() &&
|
!bot->IsMounted() &&
|
||||||
|
!botAI->HasAnyAuraOf(GetTarget(), "dire bear form", "bear form", "cat form", "travel form",
|
||||||
|
"aquatic form","flight form", "swift flight form", nullptr) &&
|
||||||
(botAI->HasCheat(BotCheatMask::food) || UseItemAction::isPossible());
|
(botAI->HasCheat(BotCheatMask::food) || UseItemAction::isPossible());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,14 +105,14 @@ bool EatAction::Execute(Event event)
|
|||||||
bool EatAction::isUseful()
|
bool EatAction::isUseful()
|
||||||
{
|
{
|
||||||
return UseItemAction::isUseful() &&
|
return UseItemAction::isUseful() &&
|
||||||
AI_VALUE2(uint8, "health", "self target") < 100 &&
|
AI_VALUE2(uint8, "health", "self target") < 100;
|
||||||
!botAI->HasAnyAuraOf(GetTarget(), "dire bear form", "bear form", "cat form", "travel form",
|
|
||||||
"aquatic form","flight form", "swift flight form", nullptr) &&
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EatAction::isPossible()
|
bool EatAction::isPossible()
|
||||||
{
|
{
|
||||||
return !bot->IsInCombat() &&
|
return !bot->IsInCombat() &&
|
||||||
!bot->IsMounted() &&
|
!bot->IsMounted() &&
|
||||||
|
!botAI->HasAnyAuraOf(GetTarget(), "dire bear form", "bear form", "cat form", "travel form",
|
||||||
|
"aquatic form","flight form", "swift flight form", nullptr) &&
|
||||||
(botAI->HasCheat(BotCheatMask::food) || UseItemAction::isPossible());
|
(botAI->HasCheat(BotCheatMask::food) || UseItemAction::isPossible());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user