i played Dofus several years...
But the reallity is, if you can't found a clear solution and no ones want to research for you.
My recommendation is:
You must pick an engine that use any script languagues.
Use the tool and the script facilities to find a solution insted of mess up with c++. And even ask on the engine forum.
When you catch up the solution and the necessary formulas then implement those thing in c++ with sfml.