AZ was once a powerful ruler of Kalos. However when the Kalos war broke out 3,000 years ago, he began to change. He wanted to save floette after the war killed it. I believe AZ ruled many lands in Kalos. I think we will learn that the war was started by another rule trying to take over Kalos. As King, AZ participated in the war, as in ancient times this wasn't to uncommon.
Which reminds me, The ultimate weapon killed a lot of pokemon, enough to make Floette sad and leave. How many did it kill? I have to imagine that a war fought by giant monsters and humans would be enough power to destroy the earth as pokemon like Gyrados and tyranitar could destroy entire cities. Let alone any megas at the time...
So how powerful was this weapon? It must have been just as, if not more destructive then the war itself..... Which is pretty insane if you think about it.
Moving on, I believe AZOTH was the main civilization that AZ had conquered. It was probably A strategic city to own. Perhaps it was massive like Luminous City? From this City, AZ ruled. I also think this is why it's called Azoth. It be named after him, much like Alexandria was named after Alexander the Great. IT could be a real life comparison by GF. In this city, volcanion lived, because as we've seen in the anime movies and games, legendaries lived with ancient humans.
By the time AZ takes over AZOTH, floette is dead, and he plans to build the ultimate weapon to resurrect it. Azoth is built as a technological advancement. It has stempunk like tech as we've been hinted at.
As part of this theory, I should mention, that based on the games, I am thinking and Hoenn were once connected to Kalos. Moving on...
As AZ builds the ultimate weapon, he is unsure if it will work Using the corpses of pokemon his soldiers bring back from the fighting grounds. For this theory, I predict that AZOTH is in the southeast portion of Kalos. Why?
Well currently in the anime, Ash and co are on their way to Snowbelle. This movie takes place at the same time. Volcanion is heading to Azoth to save magianna, but ends up dragging Ash with it. Volcanion lives in mountains, and to the South East of Kalos, there seems to be a lot of them. Plus a place this could easily work in a mountain, or almost badlands setting.
Also there is no place for it where the kalos map is now, but it clearly will be important, so it being in the south makes sense.
Moving on.... After enough pokemon were sacrificed, AZ tests the device out on an old lifeless robot that was lying around. IT works and brings Magianna to life. Magianna is confused on what life is and is brought to life in the middle of the war.. Perhaps he also managed to Create regigias somehow, who then pushed the continents away, separating Kalos and Hoenn? And eventually created the regis Seeing his idea worked, Az brings floette back to life. But the war and everything else gets to him...
He finds a way to rework the life saving device into one that ends lives. The device kills more people and pokemon, and ends the war. However firing that beam released the energy that causes primal evolution. Magianna somehow will use this energy and cause volcanion to use primal reversion. Perhaps magianna actually holds part of the ultimate weapon in it, and if something happens to it, it could end up killing many people. Volcanion will want to stop it's kidnappers from harassing this power in the movie.
After firing the ultimate weapon, not only did it release the energy that can cause primal reversion, but it also gave AZ immortality since he was so close to the firing range. Or maybe Magianna somehow became the reason.
The blasts also destroys the Azoth kingdom. However left confused and by itself, Magianna ends up staying in the kingdom, and becomes friends with volcanion. Due to the actions they both witness, they isolated themselves and avoid the human race.
As the years go by, AZ wanders Kalos alone, saddened by his actions and the loss of his beloved floette. Until the events of XY,
I also think that Magma and Aqua knew about the Azoth kingdom but not magianna. I believe that due to the state he was in at the time, AZ would neglect magianna as his focus was on Floette, and even in his sadness, he ignores it. Az would the go back to the kingdom in Z and apologize and state how you would be better at owning it maybe. Although it's a mythical pokemon so maybe we won't see it in game at all, but after deoxys, it's possible.
In Z, maybe we go to Azoth and learn that the machine actually created a new type,by causing it's energy to bring things like magianna to life. This could lead into my theory of a new type, the machine, or man made type. It would apply to manmade pokemon, and maybe we could see that there are steampunk or self aware objects that became pokemon as a result of the machine's energy. This could all take place in Z. Maybe southern Kalos is opened up after the mountains mysteriously get leveled and the region is accessible by land. As we go along we could get into Episode V, a plot that revolves around volcanion being the reason the south is accessible, and end to the AZ/Team Flare story, and the discovery of magianna and learning more about how the world changed recently.
I also wouldn't be surprised if the story takes a new turn before the end of the game, and a war is about to happen that would be catastrophic. Perhaps Malva now leading Neo team Flare, could find a way to obtain the ultimate weapon, and a war is waged. You have to stop them from activating the weapon again and perhaps in them reactivating it, we learn lysandre was alive and immortal. Bit of a stretch for this last part but who knows.
I do think we could see a theme of man vs machine for the game, and I do think we will go to Hoenn in HGSS style, not much story for it( maybe it ties into the V episode or Z episode, whichever) but more challenging and the battle frontier could return as well.