mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
[Avoid aoe] Area debuff judgement
This commit is contained in:
@@ -121,37 +121,23 @@ bool HasAreaDebuffValue::Calculate()
|
|||||||
Aura* AreaDebuffValue::Calculate()
|
Aura* AreaDebuffValue::Calculate()
|
||||||
{
|
{
|
||||||
// Unit::AuraApplicationMap& map = bot->GetAppliedAuras();
|
// Unit::AuraApplicationMap& map = bot->GetAppliedAuras();
|
||||||
Unit::AuraEffectList const& auras = bot->GetAuraEffectsByType(SPELL_AURA_PERIODIC_DAMAGE);
|
Unit::AuraEffectList const& aurasPeriodicDamage = bot->GetAuraEffectsByType(SPELL_AURA_PERIODIC_DAMAGE);
|
||||||
for (auto i = auras.begin(); i != auras.end(); ++i)
|
Unit::AuraEffectList const& aurasPeriodicTriggerSpell = bot->GetAuraEffectsByType(SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||||
{
|
for (const Unit::AuraEffectList& list : {aurasPeriodicDamage, aurasPeriodicTriggerSpell}) {
|
||||||
AuraEffect* aurEff = *i;
|
for (auto i = list.begin(); i != list.end(); ++i)
|
||||||
Aura *aura = aurEff->GetBase();
|
{
|
||||||
AuraObjectType type = aura->GetType();
|
AuraEffect* aurEff = *i;
|
||||||
bool isPositive = aura->GetSpellInfo()->IsPositive();
|
Aura *aura = aurEff->GetBase();
|
||||||
if (type == DYNOBJ_AURA_TYPE && !isPositive) {
|
AuraObjectType type = aura->GetType();
|
||||||
DynamicObject* dynOwner = aura->GetDynobjOwner();
|
bool isPositive = aura->GetSpellInfo()->IsPositive();
|
||||||
if (!dynOwner) {
|
if (type == DYNOBJ_AURA_TYPE && !isPositive) {
|
||||||
continue;
|
DynamicObject* dynOwner = aura->GetDynobjOwner();
|
||||||
|
if (!dynOwner) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
return aura;
|
||||||
}
|
}
|
||||||
return aura;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// for (Unit::AuraApplicationMap::iterator i = map.begin(); i != map.end(); ++i)
|
|
||||||
// {
|
|
||||||
// Aura *aura = i->second->GetBase();
|
|
||||||
// if (!aura)
|
|
||||||
// continue;
|
|
||||||
|
|
||||||
// AuraObjectType type = aura->GetType();
|
|
||||||
// // bool is_area = aura->IsArea();
|
|
||||||
// bool isPositive = aura->GetSpellInfo()->IsPositive();
|
|
||||||
// if (type == DYNOBJ_AURA_TYPE && !isPositive) {
|
|
||||||
// DynamicObject* dynOwner = aura->GetDynobjOwner();
|
|
||||||
// if (!dynOwner) {
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
// return aura;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user