mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-21 10:30:01 +01:00
General improvement
This commit is contained in:
parent
c9d341cb36
commit
eff9873272
@ -78,7 +78,7 @@ bool NewRpgBaseAction::MoveFarTo(WorldPosition dest)
|
|||||||
float rx, ry, rz;
|
float rx, ry, rz;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
int attempt = 3;
|
int attempt = 3;
|
||||||
while (--attempt)
|
while (attempt--)
|
||||||
{
|
{
|
||||||
float angle = bot->GetAngle(&dest);
|
float angle = bot->GetAngle(&dest);
|
||||||
float delta = urand(1, 100) <= 75 ? (rand_norm() - 0.5) * M_PI * 0.5 : (rand_norm() - 0.5) * M_PI * 2;
|
float delta = urand(1, 100) <= 75 ? (rand_norm() - 0.5) * M_PI * 0.5 : (rand_norm() - 0.5) * M_PI * 2;
|
||||||
@ -157,8 +157,8 @@ bool NewRpgBaseAction::MoveRandomNear(float moveStep, MovementPriority priority)
|
|||||||
const float x = bot->GetPositionX();
|
const float x = bot->GetPositionX();
|
||||||
const float y = bot->GetPositionY();
|
const float y = bot->GetPositionY();
|
||||||
const float z = bot->GetPositionZ();
|
const float z = bot->GetPositionZ();
|
||||||
int attempts = 5;
|
int attempts = 1;
|
||||||
while (--attempts)
|
while (attempts--)
|
||||||
{
|
{
|
||||||
float angle = (float)rand_norm() * 2 * static_cast<float>(M_PI);
|
float angle = (float)rand_norm() * 2 * static_cast<float>(M_PI);
|
||||||
float dx = x + distance * cos(angle);
|
float dx = x + distance * cos(angle);
|
||||||
|
|||||||
@ -195,16 +195,16 @@ bool GrindTargetValue::needForQuest(Unit* target)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (CreatureTemplate const* data = sObjectMgr->GetCreatureTemplate(target->GetEntry()))
|
if (CreatureTemplate const* data = sObjectMgr->GetCreatureTemplate(target->GetEntry()))
|
||||||
|
{
|
||||||
|
if (uint32 lootId = data->lootid)
|
||||||
|
{
|
||||||
|
if (LootTemplates_Creature.HaveQuestLootForPlayer(lootId, bot))
|
||||||
{
|
{
|
||||||
if (uint32 lootId = data->lootid)
|
return true;
|
||||||
{
|
|
||||||
if (LootTemplates_Creature.HaveQuestLootForPlayer(lootId, bot))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ class NearestCorpsesValue : public NearestUnitsValue
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NearestCorpsesValue(PlayerbotAI* botAI, float range = sPlayerbotAIConfig->sightDistance)
|
NearestCorpsesValue(PlayerbotAI* botAI, float range = sPlayerbotAIConfig->sightDistance)
|
||||||
: NearestUnitsValue(botAI, "nearest corpses", range)
|
: NearestUnitsValue(botAI, "nearest corpses", range, true)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user