Does anyone know how to make a temporary engineering upgrade type ability?
I've tried adding the ability to a unit and after a certain amount of time, removing the ability from the unit but that didnt quite work right. That's probably why Aghanim's Scepter used to be undroppable in DotA (it's an item that makes some heroes' ultimates stronger) but now it IS droppable and when the unit has the scepter the ultimate is upgraded, when they drop the scepter the ability is downgraded back to normal. Does anyone know how to do this? My goal is to make a hero have an ultimate that cuts casting time and mana cost for all of his other spells for a limited time when its used, i don't want it to be permanent.
What I tried before:
1. Created 4 copies of each of spells the hero has. 1 normal, 1 for the 1st upgrade, 1 for the 2nd upgrade, 1 for the 3rd upgrade
2. I created an engineering upgrade ability that upgrades the spells
3. I created a disabled spellbook ability that had the engineering upgrade ability in it.
4. I created the ultimate based on Frenzy that places a buff on caster and used a trigger like so:
E: Unit starts the effect of an ability
C: Ability being cast equal to <My modified Frenzy ultimate spell>
A: Add <disabled spellbook that has engineering upgrade in it> to <casting unit>
Set level of <modified engineering upgrade ability> for <casting unit> to <level of <modified frenzy ultimate> for <casting unit>>
Created a periodic timer every 0.1 seconds that checks if the unit has the ultimate buff, if it does not have the buff any more then the spellbook with the engineering upgrade is removed. This lets me adjust the duration by changing the spell's duration and requires no code changes, it also removes the effect early if the buff is dispelled.
When I cast the spell the abilities get upgraded but when it wears off they spells stay upgraded. I've added periodic debug messages to the map that check ever 1 second of game time if the unit has the engineering upgrade ability. I can see when it starts it doesnt have the ability, when i cast the spell it does have the ability, when the spell wears off it no longer has the ability, but all the spells stay upgraded.
I've tried adding the ability to a unit and after a certain amount of time, removing the ability from the unit but that didnt quite work right. That's probably why Aghanim's Scepter used to be undroppable in DotA (it's an item that makes some heroes' ultimates stronger) but now it IS droppable and when the unit has the scepter the ultimate is upgraded, when they drop the scepter the ability is downgraded back to normal. Does anyone know how to do this? My goal is to make a hero have an ultimate that cuts casting time and mana cost for all of his other spells for a limited time when its used, i don't want it to be permanent.
What I tried before:
1. Created 4 copies of each of spells the hero has. 1 normal, 1 for the 1st upgrade, 1 for the 2nd upgrade, 1 for the 3rd upgrade
2. I created an engineering upgrade ability that upgrades the spells
3. I created a disabled spellbook ability that had the engineering upgrade ability in it.
4. I created the ultimate based on Frenzy that places a buff on caster and used a trigger like so:
E: Unit starts the effect of an ability
C: Ability being cast equal to <My modified Frenzy ultimate spell>
A: Add <disabled spellbook that has engineering upgrade in it> to <casting unit>
Set level of <modified engineering upgrade ability> for <casting unit> to <level of <modified frenzy ultimate> for <casting unit>>
Created a periodic timer every 0.1 seconds that checks if the unit has the ultimate buff, if it does not have the buff any more then the spellbook with the engineering upgrade is removed. This lets me adjust the duration by changing the spell's duration and requires no code changes, it also removes the effect early if the buff is dispelled.
When I cast the spell the abilities get upgraded but when it wears off they spells stay upgraded. I've added periodic debug messages to the map that check ever 1 second of game time if the unit has the engineering upgrade ability. I can see when it starts it doesnt have the ability, when i cast the spell it does have the ability, when the spell wears off it no longer has the ability, but all the spells stay upgraded.