Hello.
I am so sorry for double posting like this but i really need help.
I have a spell which uses 3 triggers, and i figured out a way to make it an MUI spell. It is not using any waits so this should be quite easy i thought.
WRONG
After i tried making it an MUI spell, the whole spell failed.
But the good news is that i know what the problem is, i think.
And i don't know how to solve it.
First trigger
Second trigger
Third and final trigger
As you can see, i made all the variables to arrays and then i set the arrays to
IntegerA. Then i had IntegerA be a new number when the spell is cast. By doing that i thought that the variables would refresh themselves each time the spell is cast, as if they where brand new.
WRONG AGAIN
This is what i think is the problem.
If the spell is cast twice then the first time will use the same variables as the second one.
What this spell does is that it lifts the enemy and the caster into the air.
Then it makes the life of the "Victim" go up and down between 70% and 100%
The problem is that it stops at 100% whenever. it does not matter if i cast the spell twice with 2 different heroes, The life of "Victim" will still stop when it reaches 100%
Tell me if you need to see the map yourselves.
Thanks in return
I am so sorry for double posting like this but i really need help.
I have a spell which uses 3 triggers, and i figured out a way to make it an MUI spell. It is not using any waits so this should be quite easy i thought.
WRONG
After i tried making it an MUI spell, the whole spell failed.
But the good news is that i know what the problem is, i think.
And i don't know how to solve it.
First trigger
Code:
Hells Judgement
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Hells judjement
(Percentage life of (Target unit of ability being cast)) Greater than or equal to 90.00
(Percentage life of (Casting unit)) Greater than or equal to 90.00
Actions
Set IntegerA = (IntegerA + 1)
Set Hell_Boolean[IntegerA] = True
Set Unit_Victim[IntegerA] = (Target unit of ability being cast)
Set Unit_Caster[IntegerA] = (Casting unit)
Set Point1[IntegerA] = (Position of (Casting unit))
Set Point2[IntegerA] = (Position of Unit_Victim[IntegerA])
Set Integer[IntegerA] = (Random integer number between 1 and 15)
Unit - Pause Unit_Caster[IntegerA]
Unit - Pause Unit_Victim[IntegerA]
Unit - Add Crow Form to Unit_Caster[IntegerA]
Unit - Remove Crow Form from Unit_Caster[IntegerA]
Unit - Add Crow Form to Unit_Victim[IntegerA]
Unit - Remove Crow Form from Unit_Victim[IntegerA]
Animation - Change Unit_Caster[IntegerA] flying height to 300.00 at 300.00
Animation - Change Unit_Victim[IntegerA] flying height to 300.00 at 300.00
Special Effect - Create a special effect at Point1[IntegerA] using Doodads\Cinematic\TownBurningFireEmitter\TownBurningFireEmitter.mdl
Set Special_Effect[IntegerA] = (Last created special effect)
Special Effect - Create a special effect at Point2[IntegerA] using Doodads\Cinematic\TownBurningFireEmitter\TownBurningFireEmitter.mdl
Set Special_Effect_2[IntegerA] = (Last created special effect)
Floating Text - Create floating text that reads String[IntegerA] above Unit_Victim[IntegerA] with Z offset 0.00, using font size 10.00, color (50.00%, 50.00%, 50.00%), and 0.00% transparency
Set Floating_Text[IntegerA] = (Last created floating text)
Trigger - Turn on Hells Judgement damage <gen>
Custom script: call RemoveLocation (udg_Point1[udg_IntegerA])
Custom script: call RemoveLocation (udg_Point2[udg_IntegerA])
Countdown Timer - Start Timer[IntegerA] as a One-shot timer that will expire in (Real(Integer[IntegerA])) seconds
Countdown Timer - Create a timer window for Timer[IntegerA] with title Hells Judgement
Trigger - Add to Timer Expires <gen> the event (Time - Timer[IntegerA] expires)
Set Timer_Window[IntegerA] = (Last created timer window)
Code:
Hells Judgement damage
Events
Time - Every 0.10 seconds of game time
Conditions
Actions
Set String[IntegerA] = ((String((Percentage life of Unit_Victim[IntegerA]))) + %)
Floating Text - Change text of Floating_Text[IntegerA] to String[IntegerA] using font size 10.00
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Hell_Boolean[IntegerA] Equal to True
Then - Actions
Unit - Cause Unit_Caster[IntegerA] to damage Unit_Victim[IntegerA], dealing ((Max life of Unit_Victim[IntegerA]) x 0.01) damage of attack type Chaos and damage type Fire
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Hells judjement for Unit_Caster[IntegerA]) Equal to 1
Then - Actions
If ((Percentage life of Unit_Victim[IntegerA]) Less than or equal to 70.00) then do (Set Hell_Boolean[IntegerA] = False) else do (Do nothing)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Hells judjement for Unit_Caster[IntegerA]) Equal to 2
Then - Actions
If ((Percentage life of Unit_Victim[IntegerA]) Less than or equal to 60.00) then do (Set Hell_Boolean[IntegerA] = False) else do (Do nothing)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Hells judjement for Unit_Caster[IntegerA]) Equal to 3
Then - Actions
If ((Percentage life of Unit_Victim[IntegerA]) Less than or equal to 50.00) then do (Set Hell_Boolean[IntegerA] = False) else do (Do nothing)
Else - Actions
Do nothing
Else - Actions
Unit - Set life of Unit_Victim[IntegerA] to (((Max life of Unit_Victim[IntegerA]) x 0.01) + (Life of Unit_Victim[IntegerA]))
If ((Life of Unit_Victim[IntegerA]) Equal to 100.00) then do (Set Hell_Boolean[IntegerA] = True) else do (Do nothing)
Code:
Timer Expires
Events
Conditions
Actions
Countdown Timer - Destroy Timer_Window[IntegerA]
Animation - Change Unit_Caster[IntegerA] flying height to 0.00 at 300.00
Animation - Change Unit_Victim[IntegerA] flying height to 0.00 at 300.00
Unit - Unpause Unit_Caster[IntegerA]
Unit - Unpause Unit_Victim[IntegerA]
Special Effect - Destroy Special_Effect[1]
Special Effect - Destroy Special_Effect[2]
Trigger - Turn off Hells Judgement damage <gen>
Unit - Set life of Unit_Caster[IntegerA] to (Percentage life of Unit_Victim[IntegerA])
As you can see, i made all the variables to arrays and then i set the arrays to
IntegerA. Then i had IntegerA be a new number when the spell is cast. By doing that i thought that the variables would refresh themselves each time the spell is cast, as if they where brand new.
WRONG AGAIN
This is what i think is the problem.
If the spell is cast twice then the first time will use the same variables as the second one.
What this spell does is that it lifts the enemy and the caster into the air.
Then it makes the life of the "Victim" go up and down between 70% and 100%
The problem is that it stops at 100% whenever. it does not matter if i cast the spell twice with 2 different heroes, The life of "Victim" will still stop when it reaches 100%
Tell me if you need to see the map yourselves.
Thanks in return