Nestharus
o-o
- Reaction score
- 84
In other words, you want me to make a spell object for making spell effects, an ability that can steal spells temporarily and a system for stealing the spells temporarily (would be relatively small as it wouldn't have to track anything) : |.
Can't I just tell you Spawn can easily do it? wait.. are you guys trying to get me to make all your stuff for you instead of you guys making it and submitting them as various systems that run with spawn?? >: O
Here's the blue print if anyone else wants to do it, asking someone to do it for me because I'm tired of making demos, lol. He'd submit it as his own resource tho ^_^.
First- make a spell that steals spells temporarily via a timer array. Add the spell as a spawn to a handle and then use spawn to store the timers. When a spell steals another spell, start the timer for however long it should be, remove the ability from the first unit, add the ability to the second unit, then do base.lendSpawn(spawn.id) using the id of the spell. You'll need to attach the spawn id to the timer.
When it reverts back, first get the handle owner of the spell via Handle(Base(spawn.base).base). The handle is stored using its id, so for this you need to know the handle type, which should always be a unit as you are dealing with spells, so do this, UnitHandle_data[Handle(Base(spawn.base).base)] if you are using my object ; P. Now do spawn.revert() or w/e, and then get the second unit UnitHandle_data[Handle(Base(spawn.base).base)], same code =). Remove the ability from the first unit and add it to the second.
Now, release the timer of the first unit since it is expired and then check to see if the second unit has a timer (is timer[spawn] null?). If it does, resume it.
You are done =).
Also, the ability should not be hard coded into the spawn. Let the person define their own abilities and pass in their data. Do not extend the spawn struct, just use your own internal arrays and let people modify the data for different levels of the ability. The ability is simply an interface. Finally, you should do a spell event for all players when that ability is cast for spawning that ability. It'd be pretty weird to make it timed =P, unless you like wanted to steal a random ability from a unit in range every x seconds.
Can't I just tell you Spawn can easily do it? wait.. are you guys trying to get me to make all your stuff for you instead of you guys making it and submitting them as various systems that run with spawn?? >: O
Here's the blue print if anyone else wants to do it, asking someone to do it for me because I'm tired of making demos, lol. He'd submit it as his own resource tho ^_^.
First- make a spell that steals spells temporarily via a timer array. Add the spell as a spawn to a handle and then use spawn to store the timers. When a spell steals another spell, start the timer for however long it should be, remove the ability from the first unit, add the ability to the second unit, then do base.lendSpawn(spawn.id) using the id of the spell. You'll need to attach the spawn id to the timer.
When it reverts back, first get the handle owner of the spell via Handle(Base(spawn.base).base). The handle is stored using its id, so for this you need to know the handle type, which should always be a unit as you are dealing with spells, so do this, UnitHandle_data[Handle(Base(spawn.base).base)] if you are using my object ; P. Now do spawn.revert() or w/e, and then get the second unit UnitHandle_data[Handle(Base(spawn.base).base)], same code =). Remove the ability from the first unit and add it to the second.
Now, release the timer of the first unit since it is expired and then check to see if the second unit has a timer (is timer[spawn] null?). If it does, resume it.
You are done =).
Also, the ability should not be hard coded into the spawn. Let the person define their own abilities and pass in their data. Do not extend the spawn struct, just use your own internal arrays and let people modify the data for different levels of the ability. The ability is simply an interface. Finally, you should do a spell event for all players when that ability is cast for spawning that ability. It'd be pretty weird to make it timed =P, unless you like wanted to steal a random ability from a unit in range every x seconds.