Merge pull request #4726 from ille/baa2252bd31718e93ccc3e97aa81afeecb5ec9c3

Core/GameObject: implement stealth/invisibility for traps
This commit is contained in:
QAston committed 2012-02-09 09:38:13 -08:00
commit 012be16796
2 files changed
+21 -3

No files matched your search

+5 -1
View File
@@ -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