mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-22 21:16:24 +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;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class NearestGameObjects : public ObjectGuidListCalculatedValue
|
||||
class NearestTrapWithDamageValue : public ObjectGuidListCalculatedValue
|
||||
{
|
||||
public:
|
||||
NearestTrapWithDamageValue(PlayerbotAI* botAI, float range = sPlayerbotAIConfig->sightDistance) :
|
||||
NearestTrapWithDamageValue(PlayerbotAI* botAI, float range = 10.0f) :
|
||||
ObjectGuidListCalculatedValue(botAI, "nearest trap with damage", 1 * 1000), range(range) { }
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user