How to pass data from CommandScript to ScriptedAI


I’m trying to make scriptedAI which should summon, unsummon, follow, stop on action based from CommandScript.

My only idea how to get this working is store data in database and make in ScriptedAI override of UpdateAI and select, but isn’t that bad way at all?

I don’t really recommend it but you can get the AI* from an Unit* and then dynamic_cast the UI to your custom AI type, calling whatever methods you have there (including setters).