Ardenian
A
Ardenian
Hello,
A.) I would like to create a general trigger for my TD that damages units if a spell is casted on them ( the spell has no damage and the trigger replaces the default damage the spell would have had).
This is what I have for now:
Armor_Wave is an indexed variable that is set at the initialization to the wave armors.
Unit_Armor is an integer variable that is used to check armor influences later ( not added in this trigger) and to define the final damage correctly. Armor reduces the damage with the exact armor value of the time the trigger executes. Negative armor increases the damage by the exact value.
So, now I need your help, please. First of all, the trigger does not work. I think it has something to do with the event and the condition. I also did not indexed the variable yet, but it should result into 0, so the damage still works.
B.) Additionally, I would like to transform this trigger into a general trigger. That means, one trigger runs for all abilities. This should be possible if using the variable Hero_Ability(1,NUMBER_OF_INDEXED_ABILITIES) as condition ( check if it is casted).
Now I can use another indexed variable called Ability_Damage(1,NUMBER_OF_INDEXED_ABILITIES) to get the corresponding damage value for the damage part ( not added in the trigger above). But, how do I get the corresponding ability number ( index) for the Ability_Damage variable ?
A.) I would like to create a general trigger for my TD that damages units if a spell is casted on them ( the spell has no damage and the trigger replaces the default damage the spell would have had).
This is what I have for now:
-
Death Bolt
-
Events
- Unit - A unit is attacked
-
Conditions
- (Ability being cast) Equal Death Bolt
-
Actions
- Set Armor_Wave[Levels_Current] = Unit_Armor
- Unit - Cause (Casting unit) to damage (Attacked unit), dealing ((50.00 + (50.00 x (Real((Level of (Ability being cast) for (Casting unit)))))) - (Real(Unit_Armor))) damage of attack type Spells and damage type Normal
-
Events
Armor_Wave is an indexed variable that is set at the initialization to the wave armors.
Unit_Armor is an integer variable that is used to check armor influences later ( not added in this trigger) and to define the final damage correctly. Armor reduces the damage with the exact armor value of the time the trigger executes. Negative armor increases the damage by the exact value.
So, now I need your help, please. First of all, the trigger does not work. I think it has something to do with the event and the condition. I also did not indexed the variable yet, but it should result into 0, so the damage still works.
B.) Additionally, I would like to transform this trigger into a general trigger. That means, one trigger runs for all abilities. This should be possible if using the variable Hero_Ability(1,NUMBER_OF_INDEXED_ABILITIES) as condition ( check if it is casted).
Now I can use another indexed variable called Ability_Damage(1,NUMBER_OF_INDEXED_ABILITIES) to get the corresponding damage value for the damage part ( not added in the trigger above). But, how do I get the corresponding ability number ( index) for the Ability_Damage variable ?