Begin of the scripted AI