mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
[Avoid aoe] Fix friendly game object
This commit is contained in:
@@ -170,7 +170,6 @@ bool MovementAction::MoveTo(uint32 mapId, float x, float y, float z, bool idle,
|
|||||||
botAI->InterruptSpell();
|
botAI->InterruptSpell();
|
||||||
}
|
}
|
||||||
MotionMaster &mm = *bot->GetMotionMaster();
|
MotionMaster &mm = *bot->GetMotionMaster();
|
||||||
|
|
||||||
mm.Clear();
|
mm.Clear();
|
||||||
mm.MovePoint(mapId, x, y, z, generatePath);
|
mm.MovePoint(mapId, x, y, z, generatePath);
|
||||||
AI_VALUE(LastMovement&, "last movement").Set(mapId, x, y, z, bot->GetOrientation());
|
AI_VALUE(LastMovement&, "last movement").Set(mapId, x, y, z, bot->GetOrientation());
|
||||||
@@ -1564,17 +1563,17 @@ bool AvoidAoeAction::AvoidGameObjectWithDamage()
|
|||||||
if (spellInfo->IsPositive()) {
|
if (spellInfo->IsPositive()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
float radius = 5.0f;
|
float radius = (float)goInfo->trap.diameter / 2;
|
||||||
for (int i = 0; i < MAX_SPELL_EFFECTS; i++) {
|
// for (int i = 0; i < MAX_SPELL_EFFECTS; i++) {
|
||||||
if (spellInfo->Effects[i].Effect == SPELL_EFFECT_APPLY_AURA) {
|
// if (spellInfo->Effects[i].Effect == SPELL_EFFECT_APPLY_AURA) {
|
||||||
if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE) {
|
// if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE) {
|
||||||
radius = spellInfo->Effects[i].CalcRadius();
|
// radius = spellInfo->Effects[i].CalcRadius();
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
} else if (spellInfo->Effects[i].Effect == SPELL_EFFECT_SCHOOL_DAMAGE) {
|
// } else if (spellInfo->Effects[i].Effect == SPELL_EFFECT_SCHOOL_DAMAGE) {
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
if (bot->GetDistance(go) > radius) {
|
if (bot->GetDistance(go) > radius) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,11 @@ GuidVector NearestTrapWithDamageValue::Calculate()
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Unit* owner = go->GetOwner();
|
||||||
|
if (owner && owner->IsFriendlyTo(bot))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
const GameObjectTemplate* goInfo = go->GetGOInfo();
|
const GameObjectTemplate* goInfo = go->GetGOInfo();
|
||||||
if (!goInfo)
|
if (!goInfo)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user