Exemplo n.º 1
0
    public bool CheckAttackDistance(ObjectCreature pObject, ObjectCreature pTarget)
    {
        LogManager.LogAssert(IsValid());
        LogManager.LogAssert(pObject);
        LogManager.LogAssert(pTarget);
        Vector3 _SrcPos     = pObject.getWorldPos();
        Vector3 _DstPos     = pTarget.getWorldPos();
        float   _myLengthSq = (_SrcPos.x - _DstPos.x) * (_SrcPos.x - _DstPos.x) + (_SrcPos.z - _DstPos.z) * (_SrcPos.z - _DstPos.z);

        if (_myLengthSq > m_pTableRowSpell.getAttDistance())
        {
            return(false);
        }
        return(true);
    }