mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 17:09:08 +00:00
Avoid aoe for game object
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Playerbots.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "SpellMgr.h"
|
||||
|
||||
class AnyGameObjectInObjectRangeCheck
|
||||
{
|
||||
@@ -58,15 +59,32 @@ GuidVector NearestTrapWithDamageValue::Calculate()
|
||||
{
|
||||
continue;
|
||||
}
|
||||
uint32 spellId = go->GetSpellId();
|
||||
const GameObjectTemplate* goInfo = go->GetGOInfo();
|
||||
if (!goInfo)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
uint32 spellId = goInfo->trap.spellId;
|
||||
if (!spellId)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// if (ignoreLos || bot->IsWithinLOSInMap(go))
|
||||
result.push_back(go->GetGUID());
|
||||
const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (spellInfo->IsPositive()) {
|
||||
continue;
|
||||
}
|
||||
for (int i = 0; i < MAX_SPELL_EFFECTS; i++) {
|
||||
if (spellInfo->Effects[i].Effect == SPELL_EFFECT_APPLY_AURA) {
|
||||
if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE) {
|
||||
result.push_back(go->GetGUID());
|
||||
break;
|
||||
}
|
||||
} else if (spellInfo->Effects[i].Effect == SPELL_EFFECT_SCHOOL_DAMAGE) {
|
||||
result.push_back(go->GetGUID());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user