- Joined
- Sep 19, 2016
- Messages
- 4
Hello there! I'm new here and I'm trying to create a simple MUI spell that I'll use it in some future spells. Before jumps to the question, I'm not sure if this is already or not answered and sorry if I'm creating new thread for no reason. Also, I searched in the web and I'm still in doubt.
So, here is my question: when I use the spell until the second instance, it's ok. But, when I try the third, the loop trigger (see below) tend to don't off and some leaks appears (some special effects aren't destroyed).
If don't mind, please, download my map here http://www.hiveworkshop.com/attachments/spell-pack-by-suomalainen-varis-w3x.248960/ test it and tell me what's going wrong.
The spell code is below:
Loop:
Cast:
Can you give me a hand, tip or link? Also, what do you think about this code?
Above all, thank you for your time, attention and help.
So, here is my question: when I use the spell until the second instance, it's ok. But, when I try the third, the loop trigger (see below) tend to don't off and some leaks appears (some special effects aren't destroyed).
- Can you give me a hand? A tip or link to solve this problem?
- What do you think about these codes?
If don't mind, please, download my map here http://www.hiveworkshop.com/attachments/spell-pack-by-suomalainen-varis-w3x.248960/ test it and tell me what's going wrong.
The spell code is below:
Loop:
-
Rejuvenation Loop
-
Events
-
Time - Every 0.05 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer Spell_Loop) from 1 to Spell_Index_Max, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Spell_Last_Current[Spell_Loop] Less than or equal to 0.00
-
-
Then - Actions
-
Special Effect - Destroy Spell_SE[Spell_Loop]
-
Set Spell_Index_Max = (Spell_Index_Max - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Spell_Index_Max Less than or equal to 0
-
-
Then - Actions
-
Game - Display to (All players) the text: (((Final) Loop = + ((String(Spell_Loop)) + and Index = )) + (String(Spell_Index)))
-
Game - Display to (All players) the text: Trigger (Rejuvenati...
-
Set Spell_Index = 0
-
Set Spell_Index_Max = 0
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-
-
Else - Actions
-
Set Spell_Last_Current[Spell_Loop] = (Spell_Last_Current[Spell_Loop] - 0.05)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Spell_Heal_Every_Current[Spell_Loop] Greater than or equal to Spell_Heal_Every_Base[Spell_Loop]
-
-
Then - Actions
-
-------- --------
-
Set Spell_Player = (Player group((Owner of Spell_Caster[Spell_Loop])))
-
Floating Text - Create floating text that reads ((Index = + ((String(Spell_Index)) + , Loop = )) + ((String(Spell_Loop)) + (, Max = + (String(Spell_Index_Max))))) above Spell_Target[Spell_Loop] with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
-
Floating Text - Hide (Last created floating text) for (All players)
-
Floating Text - Show (Last created floating text) for Spell_Player
-
Floating Text - Change (Last created floating text): Disable permanence
-
Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
-
Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
-
Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
-
-------- Destroy/Remove any leak(s): --------
-
Custom script: call DestroyForce(udg_Spell_Player)
-
Custom script: set udg_Spell_Player = null
-
-------- --------
-
Unit - Set life of Spell_Target[Spell_Loop] to ((Life of Spell_Target[Spell_Loop]) + ((Life of Spell_Target[Spell_Loop]) x Spell_Heal_Amount_Current[Spell_Loop]))
-
Set Spell_Heal_Every_Current[Spell_Loop] = 0.00
-
-
Else - Actions
-
Set Spell_Heal_Every_Current[Spell_Loop] = (Spell_Heal_Every_Current[Spell_Loop] + 0.05)
-
-
-
-
-
-
-
-
Cast:
-
Rejuvenation Cast
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Spell_Ability
-
-
Actions
-
-------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Spell_Index Less than or equal to 0
-
-
Then - Actions
-
Set Spell_Index = 1
-
Set Spell_Index_Max = 1
-
-
Else - Actions
-
Set Spell_Index = (Spell_Index + 1)
-
Set Spell_Index_Max = (Spell_Index_Max + 1)
-
-
-
-------- --------
-
Set Spell_Caster[Spell_Index] = (Triggering unit)
-
Set Spell_Target[Spell_Index] = (Target unit of ability being cast)
-
Set Spell_Level = (Level of Spell_Ability for Spell_Caster[Spell_Index])
-
Set Spell_Heal_Amount_Current[Spell_Index] = Spell_Heal_Amount_Base[Spell_Level]
-
Set Spell_Last_Current[Spell_Index] = Spell_Last_Base[Spell_Index]
-
-------- --------
-
Special Effect - Create a special effect attached to the chest of Spell_Target[Spell_Index] using Abilities\Spells\NightElf\Rejuvenation\RejuvenationTarget.mdl
-
Set Spell_SE[Spell_Index] = (Last created special effect)
-
-------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Spell_Index Equal to 1
-
-
Then - Actions
-
Game - Display to (All players) the text: Trigger (Rejuvenati...
-
Trigger - Turn on Rejuvenation Loop <gen>
-
-
Else - Actions
-
Game - Display to (All players) the text: Trigger (Rejuvenati...
-
-
-
-------- --------
-
-
Can you give me a hand, tip or link? Also, what do you think about this code?
Above all, thank you for your time, attention and help.