Port fixes until b4094bf - flying, mount animations, bot attack range, free food option

This commit is contained in:
郑佩茹
2022-03-22 17:13:10 -06:00
parent 44600080ec
commit f1bcca1a7b
25 changed files with 224 additions and 32 deletions

View File

@@ -291,6 +291,10 @@ bool RpgHomeBindTrigger::IsActive()
bool RpgQueueBGTrigger::IsActive()
{
// skip bots not in continents
if (!WorldPosition(bot).isOverworld()) // bg, raid, dungeon
return false;
GuidPosition guidP(getGuidP());
if (!guidP.IsCreature())
@@ -420,6 +424,22 @@ bool RpgDuelTrigger::IsActive()
if (!botAI->HasStrategy("start duel", BOT_STATE_NON_COMBAT))
return false;
// Less spammy duels
if (bot->getLevel() < 3)
return false;
if (botAI->HasRealPlayerMaster())
{
// do not auto duel if master is not afk
if (botAI->GetMaster() && !botAI->GetMaster()->isAFK())
return false;
}
// do not auto duel with low hp
if (AI_VALUE2(uint8, "health", "self target") < 90)
return false;
GuidPosition guidP(getGuidP());
if (!guidP.IsPlayer())
@@ -433,7 +453,7 @@ bool RpgDuelTrigger::IsActive()
if (player->getLevel() > bot->getLevel() + 3)
return false;
if (bot->getLevel() > player->getLevel() + 20)
if (bot->getLevel() > player->getLevel() + 10)
return false;
// caster or target already have requested duel