This is more for other coders than anything. I've been working on an alternate custom game for my heroes/map, and decided to do a CTF mode.
I had more or less psuedocoded the idea beforehand, but thus far have had little success in implementation.
Flag is a unit. Unit has an "aura" ability, which triggers when a unit is nearby. When the aura "triggers", the unit is "killed" and a state is applied to the triggering unit (State_IHAZFLAG). If the state "expires" i.e. on the death of the unit that has the state, a new unit is "spawned". If an ally is the first to come in contact with it, the flag teleports to the original spawn location, otherwise if the enemy is the first to come in contact with it, they have the state applied to them.
Alternatively, the flag could be an item box that is picked up, and the rest would work when the unit is in inventory etc.
The state applied to the target that has the flag is silenced and perplexed (rely on allies to keep you alive or fend off foes, you can attack, but no spells or items).
In addition, there's a "device" that checks if your own team's "flag" is present. If it is, you can score by coming within an aura range of it, otherwise the aura is turned off, and you can't score until the flag has teleported home.
Thus far I've been attempting to use a unit as the flag (neutral, for whatever reason gadgets weren't spawning correctly or being placed correctly, but units seemed to work fine). The unit has two aura abilities, one for allies and one for enemies. The rest is done from there. My block right now: The "aura" never seems to apply a state and kill the "flag", so right now it's just sitting in the base.
Would there be a better way to go about this that you can think of? Any ideas?
HONOR- If you need it defined, you don't have it.