mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-21 02:20:00 +01:00
Compare commits
No commits in common. "a19604024eaa424fdddaac9f3ae2a60b67047d05" and "c3eecc0d7cb3eda170713ba51aa6408a17864fc5" have entirely different histories.
a19604024e
...
c3eecc0d7c
@ -10,6 +10,9 @@
|
|||||||
|
|
||||||
bool DrinkAction::Execute(Event event)
|
bool DrinkAction::Execute(Event event)
|
||||||
{
|
{
|
||||||
|
if (bot->IsInCombat())
|
||||||
|
return false;
|
||||||
|
|
||||||
if (botAI->HasCheat(BotCheatMask::food))
|
if (botAI->HasCheat(BotCheatMask::food))
|
||||||
{
|
{
|
||||||
// if (bot->IsNonMeleeSpellCast(true))
|
// if (bot->IsNonMeleeSpellCast(true))
|
||||||
@ -49,22 +52,23 @@ bool DrinkAction::Execute(Event event)
|
|||||||
|
|
||||||
bool DrinkAction::isUseful()
|
bool DrinkAction::isUseful()
|
||||||
{
|
{
|
||||||
return UseItemAction::isUseful() &&
|
// check class uses mana
|
||||||
AI_VALUE2(bool, "has mana", "self target") &&
|
if (!AI_VALUE2(bool, "has mana", "self target"))
|
||||||
AI_VALUE2(uint8, "mana", "self target") < 100;
|
return false;
|
||||||
|
|
||||||
|
return UseItemAction::isUseful() && AI_VALUE2(uint8, "mana", "self target") < 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DrinkAction::isPossible()
|
bool DrinkAction::isPossible()
|
||||||
{
|
{
|
||||||
return !bot->IsInCombat() &&
|
return !bot->IsInCombat() && (botAI->HasCheat(BotCheatMask::food) || UseItemAction::isPossible());
|
||||||
!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());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EatAction::Execute(Event event)
|
bool EatAction::Execute(Event event)
|
||||||
{
|
{
|
||||||
|
if (bot->IsInCombat())
|
||||||
|
return false;
|
||||||
|
|
||||||
if (botAI->HasCheat(BotCheatMask::food))
|
if (botAI->HasCheat(BotCheatMask::food))
|
||||||
{
|
{
|
||||||
// if (bot->IsNonMeleeSpellCast(true))
|
// if (bot->IsNonMeleeSpellCast(true))
|
||||||
@ -102,17 +106,9 @@ bool EatAction::Execute(Event event)
|
|||||||
return UseItemAction::Execute(event);
|
return UseItemAction::Execute(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EatAction::isUseful()
|
bool EatAction::isUseful() { return UseItemAction::isUseful() && AI_VALUE2(uint8, "health", "self target") < 85; }
|
||||||
{
|
|
||||||
return UseItemAction::isUseful() &&
|
|
||||||
AI_VALUE2(uint8, "health", "self target") < 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool EatAction::isPossible()
|
bool EatAction::isPossible()
|
||||||
{
|
{
|
||||||
return !bot->IsInCombat() &&
|
return !bot->IsInCombat() && (botAI->HasCheat(BotCheatMask::food) || UseItemAction::isPossible());
|
||||||
!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());
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user