- Joined
- Mar 27, 2008
- Messages
- 8,035
Okay I have learned a bit how to use Indexing in triggers, thanks to tutorials by Magtheridon96
Okay now, how do I check for the same unit, if it still has any other instances for that unit ?
Okay, let's make an example;
I have a spell that will apply buff to the target unit, lasts for 5 seconds.
Unit[1] = (Target unit of ability being cast)
Duration[1] = 5.00
And as usual in the loop trigger, we will loop through all instances and reduce the duration.
Let's say at the 2nd second of the spell being casted, another same spell is casted to the same unit, so now it would be;
Unit[2] = (Target unit of ability being cast)
Duration[2] = 5.00
So, when Duration[1] reaches 0.00, it would remove the buff.
But, I don't want to remove the buff yet because Duration[2] still has value greater than 0.00.
So now my question is, how do I check for that same unit, if it has any other instances left ?
I mean the same unit, having more than 1 instances applied for it.
And when Duration[1] ends, it still has Duration[2], and I don't want to remove buff when Duration[1] ends, I want to remove buff when all instances applied to the unit reaches 0.00, how would I do that ?
Okay now, how do I check for the same unit, if it still has any other instances for that unit ?
Okay, let's make an example;
I have a spell that will apply buff to the target unit, lasts for 5 seconds.
Unit[1] = (Target unit of ability being cast)
Duration[1] = 5.00
And as usual in the loop trigger, we will loop through all instances and reduce the duration.
Let's say at the 2nd second of the spell being casted, another same spell is casted to the same unit, so now it would be;
Unit[2] = (Target unit of ability being cast)
Duration[2] = 5.00
So, when Duration[1] reaches 0.00, it would remove the buff.
But, I don't want to remove the buff yet because Duration[2] still has value greater than 0.00.
So now my question is, how do I check for that same unit, if it has any other instances left ?
I mean the same unit, having more than 1 instances applied for it.
And when Duration[1] ends, it still has Duration[2], and I don't want to remove buff when Duration[1] ends, I want to remove buff when all instances applied to the unit reaches 0.00, how would I do that ?