mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Worldbuff feral druid bear/cat logic (#816)
* Add logic to separate cat and bear druid buffs Check for Thick Hide (16929) talent, use regular buffs if found, use new fourth row if not. * Added cat druid buffs (ArP food, AP flask) * Update playerbots.conf.dist * Refined logic for feral druids * Use rank 3 of Thick Hide and GetActiveSpec * Update WorldBuffAction.cpp * Added DK Blood DPS buffs AP Flask, STR food * Added logic for DPS Blood DKs
This commit is contained in:
@@ -1072,6 +1072,7 @@ AiPlayerbot.WorldBuff.0.5.2.80.80 = 53755,57327 #PRIEST SHADOW
|
||||
AiPlayerbot.WorldBuff.0.6.0.80.80 = 53758,57356 #DEATH KNIGHT BLOOD
|
||||
AiPlayerbot.WorldBuff.0.6.1.80.80 = 53760,57358 #DEATH KNIGHT FROST
|
||||
AiPlayerbot.WorldBuff.0.6.2.80.80 = 53760,57358 #DEATH KNIGHT UNHOLY
|
||||
AiPlayerbot.WorldBuff.0.6.3.80.80 = 53760,57371 #DEATH KNIGHT BLOOD DPS
|
||||
AiPlayerbot.WorldBuff.0.7.0.80.80 = 53755,57327 #SHAMAN ELEMENTAL
|
||||
AiPlayerbot.WorldBuff.0.7.1.80.80 = 53760,57325 #SHAMAN ENHANCEMENT
|
||||
AiPlayerbot.WorldBuff.0.7.2.80.80 = 53755,57327 #SHAMAN RESTORATION
|
||||
@@ -1082,8 +1083,9 @@ AiPlayerbot.WorldBuff.0.9.0.80.80 = 53755,57327 #WARLOCK AFFLICTION
|
||||
AiPlayerbot.WorldBuff.0.9.1.80.80 = 53755,57327 #WARLOCK DEMONOLOGY
|
||||
AiPlayerbot.WorldBuff.0.9.2.80.80 = 53755,57327 #WARLOCK DESTRUCTION
|
||||
AiPlayerbot.WorldBuff.0.11.0.80.80 = 53755,57327 #DRUID BALANCE
|
||||
AiPlayerbot.WorldBuff.0.11.1.80.80 = 53749,53763,57367 #DRUID FERAL
|
||||
AiPlayerbot.WorldBuff.0.11.1.80.80 = 53749,53763,57367 #DRUID FERAL BEAR
|
||||
AiPlayerbot.WorldBuff.0.11.2.80.80 = 54212,57334 #DRUID RESTORATION
|
||||
AiPlayerbot.WorldBuff.0.11.3.80.80 = 53760,57358 #DRUID FERAL CAT
|
||||
|
||||
#
|
||||
#
|
||||
|
||||
@@ -26,36 +26,76 @@ std::vector<uint32> WorldBuffAction::NeedWorldBuffs(Unit* unit)
|
||||
std::vector<uint32> retVec;
|
||||
|
||||
if (sPlayerbotAIConfig->worldBuffs.empty())
|
||||
return std::move(retVec);
|
||||
return retVec;
|
||||
|
||||
FactionTemplateEntry const* humanFaction = sFactionTemplateStore.LookupEntry(1);
|
||||
uint32 factionId =
|
||||
(Unit::GetFactionReactionTo(unit->GetFactionTemplateEntry(), humanFaction) >= REP_NEUTRAL) ? 1 : 2;
|
||||
|
||||
for (auto& wb : sPlayerbotAIConfig->worldBuffs)
|
||||
Player* bot = unit->ToPlayer();
|
||||
if (!bot)
|
||||
return retVec;
|
||||
|
||||
uint8 botClass = bot->getClass();
|
||||
uint8 botLevel = bot->GetLevel();
|
||||
|
||||
uint8 tab = AiFactory::GetPlayerSpecTab(bot);
|
||||
|
||||
// We'll store the final "effective" spec ID here.
|
||||
// For non-Feral druids (and all other classes),
|
||||
// effectiveSpec = tab by default.
|
||||
uint8 effectiveSpec = tab;
|
||||
|
||||
// If this is a druid in the Feral tab, decide Bear vs. Cat
|
||||
if (botClass == CLASS_DRUID && tab == 1) // 1 = feral
|
||||
{
|
||||
bool isBear = bot->HasTalent(16931, bot->GetActiveSpec()); // Thick Hide rank 3
|
||||
if (!isBear)
|
||||
{
|
||||
// If not bear, then treat it as "cat" spec = 3
|
||||
effectiveSpec = 3;
|
||||
}
|
||||
// If bear, effectiveSpec remains 1
|
||||
}
|
||||
|
||||
// If this is a Death Knight in the Blood tab, decide Tank vs. DPS
|
||||
if (botClass == CLASS_DEATH_KNIGHT && tab == 0) // 0 = Blood
|
||||
{
|
||||
bool isTank = bot->HasTalent(55226, bot->GetActiveSpec()); // Blade Barrier rank 5
|
||||
if (!isTank)
|
||||
{
|
||||
// If not tank, then treat it as DPS spec = 3
|
||||
effectiveSpec = 3;
|
||||
}
|
||||
// If tank, effectiveSpec remains unchanged
|
||||
}
|
||||
|
||||
|
||||
for (auto const& wb : sPlayerbotAIConfig->worldBuffs)
|
||||
{
|
||||
// Faction check
|
||||
if (wb.factionId != 0 && wb.factionId != factionId)
|
||||
continue;
|
||||
|
||||
if (wb.classId != 0 && wb.classId != unit->getClass())
|
||||
// Class check
|
||||
if (wb.classId != 0 && wb.classId != botClass)
|
||||
continue;
|
||||
|
||||
uint8 tab = AiFactory::GetPlayerSpecTab(unit->ToPlayer());
|
||||
|
||||
if (wb.specId != tab)
|
||||
// Level check
|
||||
if (wb.minLevel != 0 && wb.minLevel > botLevel)
|
||||
continue;
|
||||
if (wb.maxLevel != 0 && wb.maxLevel < botLevel)
|
||||
continue;
|
||||
|
||||
if (wb.minLevel != 0 && wb.minLevel > unit->GetLevel())
|
||||
continue;
|
||||
|
||||
if (wb.maxLevel != 0 && wb.maxLevel < unit->GetLevel())
|
||||
continue;
|
||||
|
||||
if (unit->HasAura(wb.spellId))
|
||||
// Already has aura?
|
||||
if (bot->HasAura(wb.spellId))
|
||||
continue;
|
||||
|
||||
// Final check: does the world-buff spec ID match our effective spec?
|
||||
if (wb.specId == effectiveSpec)
|
||||
retVec.push_back(wb.spellId);
|
||||
}
|
||||
|
||||
return std::move(retVec);
|
||||
return retVec;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user