mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-23 13:36:23 +00:00
date: 2024-11-3 bronjahm strategy
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
#include "Unit.h"
|
||||
#include "Vehicle.h"
|
||||
#include "WaypointMovementGenerator.h"
|
||||
#include "Corpse.h"
|
||||
|
||||
MovementAction::MovementAction(PlayerbotAI* botAI, std::string const name) : Action(botAI, name)
|
||||
{
|
||||
|
||||
@@ -15,9 +15,13 @@
|
||||
bool QuestAction::Execute(Event event)
|
||||
{
|
||||
ObjectGuid guid = event.getObject();
|
||||
|
||||
Player* master = GetMaster();
|
||||
|
||||
// Checks if the bot and botAI are valid
|
||||
if (!bot || !botAI)
|
||||
return false;
|
||||
|
||||
// Sets guid based on bot or master target
|
||||
if (!guid)
|
||||
{
|
||||
if (!master)
|
||||
@@ -36,19 +40,27 @@ bool QuestAction::Execute(Event event)
|
||||
}
|
||||
|
||||
bool result = false;
|
||||
|
||||
// Check the nearest NPCs
|
||||
GuidVector npcs = AI_VALUE(GuidVector, "nearest npcs");
|
||||
for (const auto npc : npcs)
|
||||
for (const auto& npc : npcs)
|
||||
{
|
||||
Unit* unit = botAI->GetUnit(npc);
|
||||
if (unit && bot->GetDistance(unit) <= INTERACTION_DISTANCE)
|
||||
{
|
||||
result |= ProcessQuests(unit);
|
||||
}
|
||||
}
|
||||
|
||||
// Checks the nearest game objects
|
||||
std::list<ObjectGuid> gos = AI_VALUE(std::list<ObjectGuid>, "nearest game objects");
|
||||
for (const auto go : gos)
|
||||
for (const auto& go : gos)
|
||||
{
|
||||
GameObject* gameobj = botAI->GetGameObject(go);
|
||||
if (gameobj && bot->GetDistance(gameobj) <= INTERACTION_DISTANCE)
|
||||
{
|
||||
result |= ProcessQuests(gameobj);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "ObjectGuid.h"
|
||||
#include "Playerbots.h"
|
||||
#include "ServerFacade.h"
|
||||
#include "Corpse.h"
|
||||
|
||||
bool ReleaseSpiritAction::Execute(Event event)
|
||||
{
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "Playerbots.h"
|
||||
#include "RandomPlayerbotMgr.h"
|
||||
#include "ServerFacade.h"
|
||||
#include "Corpse.h"
|
||||
|
||||
bool ReviveFromCorpseAction::Execute(Event event)
|
||||
{
|
||||
|
||||
@@ -8,15 +8,17 @@
|
||||
|
||||
float KrikthirMultiplier::GetValue(Action* action)
|
||||
{
|
||||
if (!botAI->IsDps(bot)) { return 1.0f; }
|
||||
|
||||
// Target is not findable from threat table using AI_VALUE2(),
|
||||
// therefore need to search manually for the unit name
|
||||
Unit* boss = nullptr;
|
||||
Unit* watcher = nullptr;
|
||||
GuidVector targets = AI_VALUE(GuidVector, "possible targets no los");
|
||||
|
||||
for (auto i = targets.begin(); i != targets.end(); ++i)
|
||||
GuidVector targets = AI_VALUE(GuidVector, "possible targets no los");
|
||||
for (auto& target : targets)
|
||||
{
|
||||
Unit* unit = botAI->GetUnit(*i);
|
||||
Unit* unit = botAI->GetUnit(target);
|
||||
if (!unit) { continue; }
|
||||
|
||||
switch (unit->GetEntry())
|
||||
|
||||
@@ -15,6 +15,8 @@ float MountingDrakeMultiplier::GetValue(Action* action)
|
||||
// It seems like this is due to moving/other actions being processed during the 0.5 secs.
|
||||
// If we suppress everything, they seem to mount properly. A bit of a ham-fisted solution but it works
|
||||
Player* master = botAI->GetMaster();
|
||||
if (!master) { return 1.0f; }
|
||||
|
||||
if (bot->GetMapId() != OCULUS_MAP_ID || !master->GetVehicleBase() || bot->GetVehicleBase()) { return 1.0f; }
|
||||
|
||||
if (!dynamic_cast<MountDrakeAction*>(action))
|
||||
|
||||
Reference in New Issue
Block a user