Partial cp of https://github.com/TrinityCore/TrinityCore/commit/c8589f771c89d8ee946b0e4eb5e4a3f7f5c7c37a By Killyana