- Joined
- Mar 28, 2004
- Messages
- 1,616
I tried to make a MUI ability but it's is bugged and I don't know what's wrong.
Here is the trigger
Also when multipe instance it update duration off all instance and they all end at the same time of the last instance.
I think my indexing is not right but I don't know how.
Here is the trigger
-
DisembowelStart
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Disembowel (Neutral Hostile)
-
Actions
- -------- Indexing --------
- Set DBCurrentIndex = (DBCurrentIndex + 1)
- Set DBMaxIndex = (DBMaxIndex + 1)
- -------- Configurable --------
- Set DBTarget[DBMaxIndex] = (Target unit of ability being cast)
- Set DBCaster[DBMaxIndex] = (Triggering unit)
- Set DBDamagePS[DBMaxIndex] = 35.00
- Set DBHealPS[DBMaxIndex] = 10.00
- Set DBDuration[DBMaxIndex] = 10.00
- Set DBEffect[DBMaxIndex] = Objects\Spawnmodels\Undead\UndeadBlood\UndeadBloodNecromancer.mdl
- Unit - Make DBCaster[DBMaxIndex] Invulnerable
- Animation - Play DBCaster[DBMaxIndex]'s stand channel animation
- -------- Run Loop --------
- Trigger - Turn on DisembowelLoop <gen>
-
Events
-
DisembowelLoop
-
Events
- Time - Every 0.03 seconds of game time
- Conditions
-
Actions
-
For each (Integer DBCurrentIndex) from 1 to DBMaxIndex, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (DBTarget[DBCurrentIndex] is alive) Equal to True
- DBDuration[DBCurrentIndex] Greater than 0.00
-
Then - Actions
- Set DBDuration[DBCurrentIndex] = (DBDuration[DBCurrentIndex] - 0.03)
- Set DBTargetLoc[DBCurrentIndex] = (Position of DBTarget[DBCurrentIndex])
- Set DBCasterLoc[DBCurrentIndex] = (Position of DBCaster[DBCurrentIndex])
- Unit - Move DBCaster[DBCurrentIndex] instantly to (DBTargetLoc[DBCurrentIndex] offset by -100.00 towards (Facing of DBCaster[DBCurrentIndex]) degrees), facing (Angle from DBCasterLoc[DBCurrentIndex] to DBTargetLoc[DBCurrentIndex]) degrees
- Unit - Cause DBCaster[DBCurrentIndex] to damage DBTarget[DBCurrentIndex], dealing (DBDamagePS[DBCurrentIndex] / 33.00) damage of attack type Normal and damage type Normal
- Unit - Set life of DBCaster[DBCurrentIndex] to ((Life of DBCaster[DBCurrentIndex]) + (DBHealPS[DBCurrentIndex] / 33.00))
- Special Effect - Create a special effect attached to the chest of DBTarget[DBCurrentIndex] using DBEffect[DBCurrentIndex]
- Special Effect - Destroy (Last created special effect)
- Custom script: call RemoveLocation( udg_DBTargetLoc[udg_DBCurrentIndex] )
- Custom script: call RemoveLocation( udg_DBCasterLoc[udg_DBCurrentIndex] )
-
Else - Actions
- Unit - Make DBCaster[DBCurrentIndex] Vulnerable
- Animation - Play DBCaster[DBCurrentIndex]'s stand animation
- Set DBCurrentIndex = (DBCurrentIndex - 1)
- Set DBMaxIndex = (DBMaxIndex - 1)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- DBMaxIndex Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
- Else - Actions
-
If - Conditions
-
For each (Integer DBCurrentIndex) from 1 to DBMaxIndex, do (Actions)
-
Events
Also when multipe instance it update duration off all instance and they all end at the same time of the last instance.
I think my indexing is not right but I don't know how.