mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-23 13:36:23 +00:00
Port fixes until b4094bf - flying, mount animations, bot attack range, free food option
This commit is contained in:
@@ -64,6 +64,9 @@ bool PanicTrigger::IsActive()
|
||||
|
||||
bool OutNumberedTrigger::IsActive()
|
||||
{
|
||||
if (bot->GetMap() && (bot->GetMap()->IsDungeon() || bot->GetMap()->IsRaid()))
|
||||
return false;
|
||||
|
||||
int32 botLevel = bot->getLevel();
|
||||
uint32 friendPower = 200;
|
||||
uint32 foePower = 0;
|
||||
@@ -144,11 +147,19 @@ bool AoeTrigger::IsActive()
|
||||
|
||||
bool NoFoodTrigger::IsActive()
|
||||
{
|
||||
bool isRandomBot = sRandomPlayerbotMgr->IsRandomBot(bot);
|
||||
if (isRandomBot && sPlayerbotAIConfig->freeFood)
|
||||
return false;
|
||||
|
||||
return AI_VALUE2(std::vector<Item*>, "inventory items", "conjured food").empty();
|
||||
}
|
||||
|
||||
bool NoDrinkTrigger::IsActive()
|
||||
{
|
||||
bool isRandomBot = sRandomPlayerbotMgr->IsRandomBot(bot);
|
||||
if (isRandomBot && sPlayerbotAIConfig->freeFood)
|
||||
return false;
|
||||
|
||||
return AI_VALUE2(std::vector<Item*>, "inventory items", "conjured water").empty();
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,8 @@ bool EnemyTooCloseForSpellTrigger::IsActive()
|
||||
|
||||
bool isBoss = false;
|
||||
bool isRaid = false;
|
||||
float targetDistance = sServerFacade->GetDistance2d(bot, target) + bot->GetCombatReach() + target->GetCombatReach();
|
||||
float combatReach = bot->GetCombatReach() + target->GetCombatReach();
|
||||
float targetDistance = sServerFacade->GetDistance2d(bot, target) + combatReach;
|
||||
if (target->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
Creature* creature = botAI->GetCreature(target->GetGUID());
|
||||
@@ -35,10 +36,10 @@ bool EnemyTooCloseForSpellTrigger::IsActive()
|
||||
if (bot->GetMap() && bot->GetMap()->IsRaid())
|
||||
isRaid = true;
|
||||
|
||||
if (isBoss || isRaid)
|
||||
return sServerFacade->IsDistanceLessThan(targetDistance, botAI->GetRange("spell"));
|
||||
// if (isBoss || isRaid)
|
||||
// return sServerFacade->IsDistanceLessThan(targetDistance, (botAI->GetRange("spell") + combatReach) / 2);
|
||||
|
||||
return sServerFacade->IsDistanceLessOrEqualThan(targetDistance, (botAI->GetRange("spell") / 2));
|
||||
return sServerFacade->IsDistanceLessOrEqualThan(targetDistance, (botAI->GetRange("spell") + combatReach / 2));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -53,7 +54,9 @@ bool EnemyTooCloseForShootTrigger::IsActive()
|
||||
return false;
|
||||
|
||||
bool isBoss = false;
|
||||
float targetDistance = sServerFacade->GetDistance2d(bot, target) + bot->GetCombatReach() + target->GetCombatReach();
|
||||
bool isRaid = false;
|
||||
float combatReach = bot->GetCombatReach() + target->GetCombatReach();
|
||||
float targetDistance = sServerFacade->GetDistance2d(bot, target) + combatReach;
|
||||
if (target->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
Creature* creature = botAI->GetCreature(target->GetGUID());
|
||||
@@ -63,10 +66,13 @@ bool EnemyTooCloseForShootTrigger::IsActive()
|
||||
}
|
||||
}
|
||||
|
||||
if (isBoss)
|
||||
return sServerFacade->IsDistanceLessThan(targetDistance, botAI->GetRange("shoot"));
|
||||
if (bot->GetMap() && bot->GetMap()->IsRaid())
|
||||
isRaid = true;
|
||||
|
||||
return sServerFacade->IsDistanceLessOrEqualThan(targetDistance, (botAI->GetRange("shoot") / 2));
|
||||
// if (isBoss || isRaid)
|
||||
// return sServerFacade->IsDistanceLessThan(targetDistance, botAI->GetRange("shoot") + combatReach);
|
||||
|
||||
return sServerFacade->IsDistanceLessOrEqualThan(targetDistance, (botAI->GetRange("shoot") + combatReach / 2));
|
||||
}
|
||||
|
||||
bool EnemyTooCloseForMeleeTrigger::IsActive()
|
||||
@@ -97,7 +103,11 @@ EnemyOutOfSpellRangeTrigger::EnemyOutOfSpellRangeTrigger(PlayerbotAI* botAI) : O
|
||||
bool EnemyOutOfSpellRangeTrigger::IsActive()
|
||||
{
|
||||
Unit* target = AI_VALUE(Unit*, GetTargetName());
|
||||
return target && (sServerFacade->GetDistance2d(bot, target) > distance || !bot->IsWithinLOSInMap(target));
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
float combatReach = bot->GetCombatReach() + target->GetCombatReach();
|
||||
return target && (sServerFacade->GetDistance2d(bot, target) > (distance + combatReach + sPlayerbotAIConfig->contactDistance) || !bot->IsWithinLOSInMap(target));
|
||||
}
|
||||
|
||||
bool EnemyOutOfMeleeTrigger::IsActive()
|
||||
@@ -117,7 +127,7 @@ bool PartyMemberToHealOutOfSpellRangeTrigger::IsActive()
|
||||
return false;
|
||||
|
||||
float combatReach = bot->GetCombatReach() + target->GetCombatReach();
|
||||
return target && (sServerFacade->GetDistance2d(bot, target) > (distance + combatReach) || !bot->IsWithinLOSInMap(target));
|
||||
return target && (sServerFacade->GetDistance2d(bot, target) > (distance + sPlayerbotAIConfig->contactDistance) || !bot->IsWithinLOSInMap(target));
|
||||
}
|
||||
|
||||
PartyMemberToHealOutOfSpellRangeTrigger::PartyMemberToHealOutOfSpellRangeTrigger(PlayerbotAI* botAI) :
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user