aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/server/game/Entities/GameObject/GameObject.cpp18
-rwxr-xr-xsrc/server/game/Entities/Object/Object.cpp6
2 files changed, 21 insertions, 3 deletions
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index 3548ef3bc63..e26c6710b78 100755
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -228,13 +228,13 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa
if (GetGOInfo()->trap.stealthed)
{
m_stealth.AddFlag(STEALTH_TRAP);
- m_stealth.AddValue(STEALTH_TRAP, 300);
+ m_stealth.AddValue(STEALTH_TRAP, 70);
}
if (GetGOInfo()->trap.invisible)
{
m_invisibility.AddFlag(INVISIBILITY_TRAP);
- m_invisibility.AddValue(INVISIBILITY_TRAP, 70);
+ m_invisibility.AddValue(INVISIBILITY_TRAP, 300);
}
break;
@@ -850,6 +850,20 @@ bool GameObject::IsAlwaysVisibleFor(WorldObject const* seer) const
if (IsTransport())
return true;
+ if (!seer)
+ return false;
+
+ // Always seen by owner and friendly units
+ if (uint64 guid = GetOwnerGUID())
+ {
+ if (seer->GetGUID() == guid)
+ return true;
+
+ Unit* owner = GetOwner();
+ if (owner && seer->isType(TYPEMASK_UNIT) && owner->IsFriendlyTo(((Unit*)seer)))
+ return true;
+ }
+
return false;
}
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index 1a8eb8f82e2..c9b25b66cdc 100755
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -1807,11 +1807,15 @@ bool WorldObject::CanDetectStealthOf(WorldObject const* obj) const
// Level difference: 5 point / level, starting from level 1.
// There may be spells for this and the starting points too, but
- // not in the DBCs of the client.
+ // not in the DBCs of the client.
detectionValue += int32(getLevelForTarget(obj) - 1) * 5;
// Apply modifiers
detectionValue += m_stealthDetect.GetValue(StealthType(i));
+ if (obj->isType(TYPEMASK_GAMEOBJECT))
+ if (Unit* owner = ((GameObject*)obj)->GetOwner())
+ detectionValue -= int32(owner->getLevelForTarget(this) - 1) * 5;
+
detectionValue -= obj->m_stealth.GetValue(StealthType(i));
// Calculate max distance