diff --git a/playerbot/PlayerbotAIConfig.cpp b/playerbot/PlayerbotAIConfig.cpp index fba1e3277..10e79ff74 100644 --- a/playerbot/PlayerbotAIConfig.cpp +++ b/playerbot/PlayerbotAIConfig.cpp @@ -462,10 +462,10 @@ bool PlayerbotAIConfig::Initialize() for (auto value : values) { std::vector ids = split(value, '.'); - std::vector params = { 0,0,0,0,0 }; + std::vector params = { 0,0,0,0,0,0 }; //Extract faction, class, spec, minlevel, maxlevel - for (uint8 i = 0; i < 5; i++) + for (uint8 i = 0; i < 6; i++) if (ids.size() > i + 2) params[i] = stoi(ids[i + 2]); @@ -476,7 +476,7 @@ bool PlayerbotAIConfig::Initialize() //Store buffs for later application. for (auto buff : buffs) { - worldBuff wb = { buff, params[0], params[1], params[2], params[3], params[4] }; + worldBuff wb = { buff, params[0], params[1], params[2], params[3], params[4], params[5] }; worldBuffs.push_back(wb); } diff --git a/playerbot/PlayerbotAIConfig.h b/playerbot/PlayerbotAIConfig.h index 2be7a55e6..616870b4d 100644 --- a/playerbot/PlayerbotAIConfig.h +++ b/playerbot/PlayerbotAIConfig.h @@ -341,6 +341,7 @@ class PlayerbotAIConfig uint32 specId = 0; uint32 minLevel = 0; uint32 maxLevel = 0; + uint32 eventId = 0; }; std::vector worldBuffs; diff --git a/playerbot/aiplayerbot.conf.dist.in b/playerbot/aiplayerbot.conf.dist.in index 5c0a1b523..16588153c 100644 --- a/playerbot/aiplayerbot.conf.dist.in +++ b/playerbot/aiplayerbot.conf.dist.in @@ -678,7 +678,7 @@ AiPlayerbot.PremadeSpecName.11.9 = pvp dps balance (boomkin) AiPlayerbot.PremadeSpecLink.11.9.60 = 0143503002551351--5005021 # Applies a permanent buff to all bots. -# WorldBuff.Faction.Class.MinLevel.MaxLevel = spellId +# WorldBuff.Faction.Class.MinLevel.MaxLevel,EventID = spellId # All bots: Rallying Cry of the Dragonslayer for all bots # AiPlayerbot.WorldBuff = 22888 # All horde Warchief's Blessing for all horde @@ -689,6 +689,8 @@ AiPlayerbot.PremadeSpecLink.11.9.60 = 0143503002551351--5005021 # AiPlayerbot.WorldBuff.0.9.1.10 = 18149,3436 # All alliance lvl60 rogues Plainsrunning & Sprint & Speed # AiPlayerbot.WorldBuff.1.4.60 = 12566,11305,2379 +# Darkmoon Faire - Elwynn Forest Sayge's Dark Fortune of Damage +AiPlayerbot.WorldBuff.0.0.0.0.0.4 = 23768 # Prefix for bot chat commands (e.g. follow, stay) #AiPlayerbot.CommandPrefix = diff --git a/playerbot/strategy/actions/WorldBuffAction.cpp b/playerbot/strategy/actions/WorldBuffAction.cpp index 7492f62d8..4f5049a4d 100644 --- a/playerbot/strategy/actions/WorldBuffAction.cpp +++ b/playerbot/strategy/actions/WorldBuffAction.cpp @@ -2,6 +2,7 @@ #include "WorldBuffAction.h" #include "playerbot/AiFactory.h" #include "playerbot/PlayerbotAIConfig.h" +#include "GameEvents/GameEventMgr.h" using namespace ai; @@ -46,6 +47,9 @@ std::vector WorldBuffAction::NeedWorldBuffs(Unit* unit) if (wb.maxLevel != 0 && wb.maxLevel < unit->GetLevel()) continue; + if (wb.eventId != 0 && !sGameEventMgr.IsActiveEvent(wb.eventId)) + continue; + if (unit->HasAura(wb.spellId)) continue;