There are a few ways that will lag Ragnarok. one of them is when your internet is receiving heavy input/output of 'Info Packets'. Such Packets are generated by:
1) Ragnarok Bots
2) MSN ( Occasional sharp lags that freezes you for a few seconds, occurs on heavy duty games )
3) Routers (when your internet is shared )
But the fact that you actually have malwares on your computer triggers this feeling in me that it has something to do with them. I am no expert, but please do try this Anti Virus, it's called
AVG Anti Virus. Please uninstall any anti virus software to avoid conflicts/crash. You do not need that unless you have Avast.