the way this is implentend in starcraft 1 and 2 is as forllows
you give the unit a abilty that have a certain effect this effect can be many different things but lets keep it simple.
what you will need (gameplay/codewise)to make stealth.
you are able to add/modify a units renderstate.(the render state is used to acually remove the unit from the players screen, this could be a sort of disortion from 0-100 were 100 is totally invisible and NOTHING is rendered. and 0 is full rendering). or perhaps a transparency effect.(i personally LOVE the starcraft style cloak).
and
you are able to modify the units attackable status (in starcraft this is dont by a flag in the effect section i guess).
so in a abilty of this type (crude example it would go down something like this:)and its some time ive been in the XM's
<ability>
<renderstate="100">
<flag="1""0""0"> (there the flag values are in order, wich means the first number is stealth and second*
<Duration="passive"> (acceptable values"passive" and "1-99999999999999999999" where passive is allways-on
<Type"=passive"> (the type defines how the button is suposed to act,if its passive the button is in a "state"of*2
<target"none"> (acceptable values are "enemy,self,allied,owned,objects"
<dmg"disable" (acceptable values are "disable","1-9999999999999999"
<ability/>
*Could be invunrable, and third could be stucture,
*2allways pressed down.
Firstly, it is a crude example in comparrison to the current xml, but the values and diffines are as i would like them to be just with a syntax that looked more like the current XML syntax.
Secondly, it does look like im either inventing a new ability system, or vastly adding to the flexbilty, i suggest a open mind to this as the current system is limited, BUT capable of for example of adding new features like this-
thirdly, im sorry i couldt push AOE in there, i could not quite figure how you would define spash, since it both could be a effect on a attack on enemy and a spash effect on a ability.
Comment!, i would like to hear you opinions/concerns about this.