mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-26 06:56:24 +00:00
[HOT FIX] MS build issues regarding folder / command lenght usage or rc.exe (#2038)
This commit is contained in:
55
src/Ai/Base/Value/FishValues.cpp
Normal file
55
src/Ai/Base/Value/FishValues.cpp
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "FishValues.h"
|
||||
#include "PlayerbotAI.h"
|
||||
#include "RandomPlayerbotMgr.h"
|
||||
#include "Map.h"
|
||||
#include "Spell.h"
|
||||
#include "FishingAction.h"
|
||||
|
||||
bool CanFishValue::Calculate()
|
||||
{
|
||||
int32 SkillFishing = bot->GetSkillValue(SKILL_FISHING);
|
||||
|
||||
if (SkillFishing == 0)
|
||||
return false;
|
||||
|
||||
if (bot->isSwimming())
|
||||
return false;
|
||||
|
||||
if (bot->IsInCombat())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CanUseFishingBobberValue::Calculate()
|
||||
{
|
||||
GuidVector gos = AI_VALUE(GuidVector, "nearest game objects no los");
|
||||
for (auto const& guid : gos)
|
||||
{
|
||||
if (GameObject* go = botAI->GetGameObject(guid))
|
||||
{
|
||||
if (go->GetEntry() != FISHING_BOBBER)
|
||||
continue;
|
||||
if (go->GetOwnerGUID() != bot->GetGUID())
|
||||
continue;
|
||||
|
||||
if (go->getLootState() == GO_READY)
|
||||
return true;
|
||||
|
||||
// Not ready yet → delay next check
|
||||
time_t bobberActiveTime = go->GetRespawnTime() - FISHING_BOBBER_READY_TIME;
|
||||
if (bobberActiveTime > time(0))
|
||||
botAI->SetNextCheckDelay((bobberActiveTime - time(0)) * IN_MILLISECONDS + 500);
|
||||
else
|
||||
botAI->SetNextCheckDelay(1000);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user