@Woodenrat
In what sense?
The easiest way would be to rig up some h/v triggers.
You could also add a state to the boss that spawns enemies, or add that to another state.
Or create a generator.
What do you wish for exactly?
@Lunarsoul
Often in the operation of anything with multiple states, there is something called an offset table (or switch table, or jump table, etc). Basically, this does
Code:
jmp [f+4*eax]
...
f 489907
489523
489888
489909
...
Where eax is an index value of some sort, ie the entity number or scriptstate. As such, it continues the code in a different spot according to what the index is. I would assume that the weapons operate in such a manner (don't remember), so if you have the offset of some other weapons, you can backtrack to the table and then to the correct function. The same method is useful even if there isn't a jump table, because similar functions tend to be called to in around the same area.
As for what the code itself does, nopping stuff out randomly helps if you want to be lazy.
ALSO:
http://www.cavestory.org/forums/threads/2046/