Port From (https://github.com/TrinityCore/TrinityCore/commit/8d38e1427da56331d43506ba474165c250f89eb7)