mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-16 21:20:01 -04:00
implement objectdetection
This commit is contained in:
@@ -1796,11 +1796,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
|
||||
|
||||
Reference in New Issue
Block a user