- Joined
- Jan 14, 2017
- Messages
- 75
Hello Hive.
I am planning to submit this spell, but there are a few problems which I can't solve myself.
(you will get credits in the spell)
Here is the spell description.
-Even though the target is supposed to be damaged for a percentage of their life, when I target the unit, instead of being damaged for 5% of their health, they are damaged for 90% of their health! The same applies to the caster; they get healed for 90% of their health.
-I cannot figure out how to destroy the group using custom script (to avoid leaks) to which I add the target because it is indexed for MUI. I know how to destroy a regular group, but an indexed?
Here are the codes.
Siphon Life Configuration:
I am planning to submit this spell, but there are a few problems which I can't solve myself.
(you will get credits in the spell)
Here is the spell description.
-Even though the target is supposed to be damaged for a percentage of their life, when I target the unit, instead of being damaged for 5% of their health, they are damaged for 90% of their health! The same applies to the caster; they get healed for 90% of their health.
-I cannot figure out how to destroy the group using custom script (to avoid leaks) to which I add the target because it is indexed for MUI. I know how to destroy a regular group, but an indexed?
Here are the codes.
Siphon Life Configuration:
-
Siphon Life Config
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
-------- The duration of the spell --------
-
Set SL_Duration[1] = 6.00
-
Set SL_Duration[2] = 8.00
-
Set SL_Duration[3] = 10.00
-
-------- The damage the target receives, and the healing the caster receives (in percents). --------
-
Set SL_DamageOrHeal[1] = 0.05
-
Set SL_DamageOrHeal[2] = 0.07
-
Set SL_DamageOrHeal[3] = 0.10
-
-------- The range of the heal AoE --------
-
Set SL_AoEsize[1] = 50.00
-
Set SL_AoEsize[2] = 100.00
-
Set SL_AoEsize[3] = 150.00
-
-------- The percent of which the enemies around the dying unit are healed. --------
-
Set SL_AoeHeal[1] = 0.02
-
Set SL_AoeHeal[2] = 0.04
-
Set SL_AoeHeal[3] = 0.06
-
-
-
Siphon Life Cast
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Siphon Life
-
-
Actions
-
-------- I've made the spell MUI of course --------
-
Set SL_Index = (SL_Index + 1)
-
Set SL_Caster[SL_Index] = (Triggering unit)
-
Set SL_Victim[SL_Index] = (Target unit of ability being cast)
-
Set Level = (Level of Siphon Life for SL_Caster[SL_Index])
-
Unit Group - Add SL_Victim[SL_Index] to SL_Group[SL_Index]
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SL_Index Equal to 1
-
-
Then - Actions
-
Trigger - Turn on Siphon Life Loop <gen>
-
-
Else - Actions
-
-
-
-
Siphon Life Loop
-
Events
-
Time - Every 2.00 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer SL_LoopInteger) from 1 to SL_Index, do (Actions)
-
Loop - Actions
-
-------- The damage the caster does is equal to the max life of the target minus the max life multiplied by the percentage. For example, if the spell were level 1, --------
-
-------- and the target had 100 health, the formula would be 100 - (100 × 0.05), which would be 100 - 5. --------
-
Unit - Cause SL_Caster[SL_LoopInteger] to damage SL_Victim[SL_LoopInteger], dealing ((Max life of SL_Victim[SL_LoopInteger]) - ((Max life of SL_Victim[SL_LoopInteger]) x SL_DamageOrHeal[Level])) damage of attack type Spells and damage type Normal
-
Special Effect - Create a special effect attached to the origin of SL_Victim[SL_LoopInteger] using Abilities\Spells\Undead\DarkRitual\DarkRitualTarget.mdl
-
Special Effect - Destroy (Last created special effect)
-
-------- -------------------------- --------
-
-------- The same applies to the caster, except the caster receives healing, not damage. --------
-
Unit - Set life of SL_Caster[SL_LoopInteger] to ((Max life of SL_Caster[SL_LoopInteger]) + ((Max life of SL_Caster[SL_LoopInteger]) x SL_DamageOrHeal[Level]))
-
Special Effect - Create a special effect attached to the origin of SL_Caster[SL_Index] using Abilities\Spells\Items\AIma\AImaTarget.mdl
-
Special Effect - Destroy (Last created special effect)
-
Set SL_Duration[Level] = (SL_Duration[Level] - 2.00)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SL_Duration[Level] Equal to 0.00
-
-
Then - Actions
-
Set SL_Victim[SL_LoopInteger] = SL_Victim[SL_Index]
-
Set SL_Caster[SL_LoopInteger] = SL_Caster[SL_Index]
-
Set SL_Index = (SL_Index - 1)
-
Set SL_LoopInteger = (SL_LoopInteger - 1)
-
Unit Group - Remove SL_Victim[SL_LoopInteger] from SL_Group[SL_LoopInteger]
-
-
Else - Actions
-
-
-
-
-
-
Siphon Life Death
-
Events
-
Unit - A unit Dies
-
-
Conditions
-
(SL_Victim[SL_LoopInteger] is in SL_Group[SL_LoopInteger]) Equal to True
-
-
Actions
-
Unit Group - Pick every unit in (Units within SL_AoEsize[Level] of (Position of SL_Victim[SL_LoopInteger])) and do (Actions)
-
Loop - Actions
-
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + ((Life of (Picked unit)) x SL_AoeHeal[Level]))
-
Custom script: call DestroyGroup (udg_SL_Group[SL_Index])
-
-
-
-