This commit is contained in:
bash
2025-09-28 20:37:01 +02:00
committed by GitHub
parent ec4ab34f94
commit df77668b4b

View File

@@ -10,10 +10,6 @@
bool DrinkAction::Execute(Event event) bool DrinkAction::Execute(Event event)
{ {
// gatekeeper
if (!isPossible())
return false;
if (botAI->HasCheat(BotCheatMask::food)) if (botAI->HasCheat(BotCheatMask::food))
{ {
// if (bot->IsNonMeleeSpellCast(true)) // if (bot->IsNonMeleeSpellCast(true))
@@ -53,14 +49,15 @@ bool DrinkAction::Execute(Event event)
bool DrinkAction::isUseful() bool DrinkAction::isUseful()
{ {
return UseItemAction::isUseful() && AI_VALUE2(uint8, "mana", "self target") < 100; return UseItemAction::isUseful() &&
AI_VALUE2(bool, "has mana", "self target") &&
AI_VALUE2(uint8, "mana", "self target") < 100;
} }
bool DrinkAction::isPossible() bool DrinkAction::isPossible()
{ {
return !bot->IsInCombat() && return !bot->IsInCombat() &&
!bot->IsMounted() && !bot->IsMounted() &&
AI_VALUE2(bool, "has mana", "self target") &&
!botAI->HasAnyAuraOf(GetTarget(), "dire bear form", "bear form", "cat form", "travel form", !botAI->HasAnyAuraOf(GetTarget(), "dire bear form", "bear form", "cat form", "travel form",
"aquatic form","flight form", "swift flight form", nullptr) && "aquatic form","flight form", "swift flight form", nullptr) &&
(botAI->HasCheat(BotCheatMask::food) || UseItemAction::isPossible()); (botAI->HasCheat(BotCheatMask::food) || UseItemAction::isPossible());
@@ -68,10 +65,6 @@ bool DrinkAction::isPossible()
bool EatAction::Execute(Event event) bool EatAction::Execute(Event event)
{ {
// gatekeeper
if (!isPossible())
return false;
if (botAI->HasCheat(BotCheatMask::food)) if (botAI->HasCheat(BotCheatMask::food))
{ {
// if (bot->IsNonMeleeSpellCast(true)) // if (bot->IsNonMeleeSpellCast(true))
@@ -111,7 +104,8 @@ bool EatAction::Execute(Event event)
bool EatAction::isUseful() bool EatAction::isUseful()
{ {
return UseItemAction::isUseful() && AI_VALUE2(uint8, "health", "self target") < 100; return UseItemAction::isUseful() &&
AI_VALUE2(uint8, "health", "self target") < 100;
} }
bool EatAction::isPossible() bool EatAction::isPossible()