mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-24 14:06:22 +00:00
- added spec configuration for world buffs (#761)
- added world buffs to configuration file - fixed NeedWorldBuffTrigger
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "WorldBuffAction.h"
|
||||
|
||||
#include "AiFactory.h"
|
||||
#include "Event.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
@@ -39,6 +40,11 @@ std::vector<uint32> WorldBuffAction::NeedWorldBuffs(Unit* unit)
|
||||
if (wb.classId != 0 && wb.classId != unit->getClass())
|
||||
continue;
|
||||
|
||||
uint8 tab = AiFactory::GetPlayerSpecTab(unit->ToPlayer());
|
||||
|
||||
if (wb.specId != tab)
|
||||
continue;
|
||||
|
||||
if (wb.minLevel != 0 && wb.minLevel > unit->GetLevel())
|
||||
continue;
|
||||
|
||||
|
||||
@@ -25,4 +25,8 @@ bool PartyMemberNeedCureTrigger::IsActive()
|
||||
return target && target->IsInWorld();
|
||||
}
|
||||
|
||||
bool NeedWorldBuffTrigger::IsActive() { return !WorldBuffAction::NeedWorldBuffs(bot).empty(); }
|
||||
bool NeedWorldBuffTrigger::IsActive()
|
||||
{
|
||||
std::any_of(WorldBuffAction::NeedWorldBuffs(bot).begin(), WorldBuffAction::NeedWorldBuffs(bot).end(),
|
||||
[](const auto& wb) { return true; });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user