Resolved issues with herb gathering (#926)

* Check game objects loot tables and determine if loot is valid

* Removed LOS checks since they already occur and removed enemy near node check

* Dismount if mounted, decresed interaction distance, added looting delay

* Decreased interaction distance

* oops, wrong file

* Check game objects loot tables and determine if loot is valid
This commit is contained in:
avirar
2025-01-30 10:29:17 +11:00
committed by GitHub
parent 247c67e449
commit 0c8785d8d1
4 changed files with 131 additions and 53 deletions

View File

@@ -13,9 +13,9 @@ bool LootAvailableTrigger::IsActive()
{
return AI_VALUE(bool, "has available loot") &&
(sServerFacade->IsDistanceLessOrEqualThan(AI_VALUE2(float, "distance", "loot target"),
INTERACTION_DISTANCE) ||
INTERACTION_DISTANCE - 2.0f) ||
AI_VALUE(GuidVector, "all targets").empty()) &&
!AI_VALUE2(bool, "combat", "self target") && !AI_VALUE2(bool, "mounted", "self target");
!AI_VALUE2(bool, "combat", "self target");
}
bool FarFromCurrentLootTrigger::IsActive()
@@ -24,7 +24,7 @@ bool FarFromCurrentLootTrigger::IsActive()
if (!loot.IsLootPossible(bot))
return false;
return AI_VALUE2(float, "distance", "loot target") > INTERACTION_DISTANCE;
return AI_VALUE2(float, "distance", "loot target") >= INTERACTION_DISTANCE - 2.0f;
}
bool CanLootTrigger::IsActive() { return AI_VALUE(bool, "can loot"); }