mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 09:07:19 +00:00
Merge branch 'liyunfan1223:master' into bot_questing
This commit is contained in:
@@ -1567,7 +1567,7 @@ bool PlayerbotAI::ContainsStrategy(StrategyType type)
|
||||
{
|
||||
for (uint8 i = 0; i < BOT_STATE_MAX; i++)
|
||||
{
|
||||
if (engines[i]->ContainsStrategy(type))
|
||||
if (engines[i]->HasStrategyType(type))
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3671,28 +3671,29 @@ bool PlayerbotAI::HasAuraToDispel(Unit* target, uint32 dispelType)
|
||||
return false;
|
||||
}
|
||||
bool isFriend = bot->IsFriendlyTo(target);
|
||||
for (uint32 type = SPELL_AURA_NONE; type < TOTAL_AURAS; ++type)
|
||||
Unit::VisibleAuraMap const* visibleAuras = target->GetVisibleAuras();
|
||||
for (Unit::VisibleAuraMap::const_iterator itr = visibleAuras->begin(); itr != visibleAuras->end(); ++itr)
|
||||
{
|
||||
Unit::AuraEffectList const& auras = target->GetAuraEffectsByType((AuraType)type);
|
||||
for (AuraEffect const* aurEff : auras)
|
||||
{
|
||||
Aura const* aura = aurEff->GetBase();
|
||||
SpellInfo const* spellInfo = aura->GetSpellInfo();
|
||||
Aura* aura = itr->second->GetBase();
|
||||
|
||||
bool isPositiveSpell = spellInfo->IsPositive();
|
||||
if (isPositiveSpell && isFriend)
|
||||
continue;
|
||||
if (aura->IsPassive())
|
||||
continue;
|
||||
|
||||
if (!isPositiveSpell && !isFriend)
|
||||
continue;
|
||||
if (sPlayerbotAIConfig->dispelAuraDuration && aura->GetDuration() &&
|
||||
aura->GetDuration() < (int32)sPlayerbotAIConfig->dispelAuraDuration)
|
||||
continue;
|
||||
|
||||
if (sPlayerbotAIConfig->dispelAuraDuration && aura->GetDuration() &&
|
||||
aura->GetDuration() < (int32)sPlayerbotAIConfig->dispelAuraDuration)
|
||||
continue;
|
||||
SpellInfo const* spellInfo = aura->GetSpellInfo();
|
||||
|
||||
if (canDispel(spellInfo, dispelType))
|
||||
return true;
|
||||
}
|
||||
bool isPositiveSpell = spellInfo->IsPositive();
|
||||
if (isPositiveSpell && isFriend)
|
||||
continue;
|
||||
|
||||
if (!isPositiveSpell && !isFriend)
|
||||
continue;
|
||||
|
||||
if (canDispel(spellInfo, dispelType))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user