Here's a snippet of a basic cannon using alarms:
https://klazen.com/gm/QVKLet me also tell you what's wrong with the code you posted. By default, all alarms start out at 0. Alarms will only trigger if you set them to a value above 0, and then they count down back to 0 later. So, setting alarm[0] to 0 does nothing; the alarm event will never trigger! If you want the alarm to trigger immediately, you can set it to 1.
In your alarm 0 event, you set alarm[1] to 25 three times over, which is unnecessary. The alarm will only trigger once, not three times; that's just how alarms work.
In regards to what Kyir said about emulating alarms yourself, I think which method you use depends on personal preference and context. In one-off objects like this cannon I might prefer to use alarms to keep things simple. In more complex objects, I might prefer to do it manually.