First they wrote the server, and it was reassembling tibia's default socket communication protocols because the server used to communicate with oficial tibia client , before Tibia 11 release coz they changed eveything, specially overrall networking connectivity to avoid bots.
Well.. then edubart created the otclient's github and it had a snowball effect for some period.. i think it was because he wanted to gave people freedom to customize client in many ways..
I believe it's almost everything from scratch, including the server since the reassembling is almost only for get socket default lines...
If you compare game dev with game engines nowadays like unity, yes it was totally from scratch.