ArmyOfFrogs
New Member
- Reaction score
- 20
Figured I needed work on my spells, so I made one yesterday just for you guys to judge it. Any pointers are welcome.. You'll probably notice I need work when looking at the code
Info
GUI
Leakless (I'm pretty sure)
MUI (You need to add triggers based on how many players you have)
Intended to be a dual use spell; It can heal or damage, pull or push any target. Useful in countless ways
Screenshots Tried resizing them all but the last one just didn't want to.
Heals
Damage
Targets: All organic
Casting Range: 800 (600 max for damaging)
Invert Polarity: Inverts the laws of gravity between you and target. If you're far away, it'll intensify gravity between you, sending you flying at eachother. If you're close, it'll reverse the gravity, sending you flying apart. The extreme effects of the gravity will have an effect on their body too. If the unit is sent towards you they are healed. If they are sent away, they are damaged.
Max Damage: 300 x level of spell
Max Healing: 100 x level of spell
Note: If you use this feel free to change anything about it ^^ Tooltips are rather bland I know, and the instructions on how to change the data for damage / healing are under the comment on the attached map.
Code
Criticism very welcome, I need to improve a lot
Note to readers: I accidentally left Magnetic Field as the name for the ability, so just ignore that (I changed it half way through >_>)
Invert Polarity
Info
GUI
Leakless (I'm pretty sure)
MUI (You need to add triggers based on how many players you have)
Intended to be a dual use spell; It can heal or damage, pull or push any target. Useful in countless ways
Screenshots Tried resizing them all but the last one just didn't want to.
Heals
Targets: All organic
Casting Range: 800 (600 max for damaging)
Invert Polarity: Inverts the laws of gravity between you and target. If you're far away, it'll intensify gravity between you, sending you flying at eachother. If you're close, it'll reverse the gravity, sending you flying apart. The extreme effects of the gravity will have an effect on their body too. If the unit is sent towards you they are healed. If they are sent away, they are damaged.
Max Damage: 300 x level of spell
Max Healing: 100 x level of spell
Note: If you use this feel free to change anything about it ^^ Tooltips are rather bland I know, and the instructions on how to change the data for damage / healing are under the comment on the attached map.
Code
Trigger:
- R Cast
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Magnetic Field
- Actions
- For each (Integer A) from (Player number of (Owner of (Casting unit))) to (Player number of (Owner of (Casting unit))), do (Actions)
- Loop - Actions
- Set R_TrigNumber[(Player number of (Owner of (Triggering unit)))] = R Cas Movement red <gen>
- Set R_TarTrigNum[(Player number of (Owner of (Triggering unit)))] = R Tar Movment red <gen>
- Set R_CasDCount[(Integer A)] = 0
- Set R_TarDCount[(Integer A)] = 0
- Set R_Caster[(Integer A)] = (Casting unit)
- Set R_CasInitPos[(Integer A)] = (Position of R_Caster[(Integer A)])
- Set R_Target[(Integer A)] = (Target unit of ability being cast)
- Set R_TarInitPos[(Integer A)] = (Position of R_Target[(Integer A)])
- Set R_CastDistance[(Integer A)] = (Distance between R_CasInitPos[(Integer A)] and R_TarInitPos[(Integer A)])
- Set R_CasAngle[(Integer A)] = (Angle from R_CasInitPos[(Integer A)] to R_TarInitPos[(Integer A)])
- Set R_SpFX = ((Position of R_Caster[(Integer A)]) offset by (0.50 x R_CastDistance[(Integer A)]) towards R_CasAngle[(Integer A)] degrees)
- Special Effect - Create a special effect at R_SpFX using Abilities\Spells\Undead\DeathPact\DeathPactTarget.mdl
- Special Effect - Destroy (Last created special effect)
- Unit - Turn collision for R_Caster[(Integer A)] Off
- Unit - Turn collision for R_Target[(Integer A)] Off
- Unit - Pause R_Caster[(Integer A)]
- Unit - Pause R_Target[(Integer A)]
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Player number of (Owner of (Triggering unit))) Equal to 1
- Then - Actions
- Trigger - Turn on R_TrigNumber[1]
- Trigger - Turn on R_TarTrigNum[1]
- Else - Actions
- If - Conditions
- Loop - Actions
- For each (Integer A) from (Player number of (Owner of (Casting unit))) to (Player number of (Owner of (Casting unit))), do (Actions)
- Events
Trigger:
- R Cas Movement red
- Events
- Time - Every 0.04 seconds of game time
- Conditions
- Actions
- For each (Integer A) from 1 to 1, do (Actions)
- Loop - Actions
- Set R_CasDCount[(Integer A)] = (R_CasDCount[(Integer A)] + 30)
- Set R_CasInitPos[(Integer A)] = (Position of R_Caster[(Integer A)])
- Set R_CasMovetoPnt[(Integer A)] = (R_CasInitPos[(Integer A)] offset by (60.00 - (0.10 x R_CastDistance[(Integer A)])) towards (180.00 + R_CasAngle[(Integer A)]) degrees)
- Unit - Move R_Caster[(Integer A)] instantly to R_CasMovetoPnt[(Integer A)]
- Special Effect - Create a special effect at R_CasInitPos[(Integer A)] using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
- Special Effect - Destroy (Last created special effect)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- R_CasDCount[(Integer A)] Greater than (Integer(R_CastDistance[(Integer A)]))
- Then - Actions
- Custom script: call RemoveLocation(udg_R_CasInitPos[1])
- Custom script: call RemoveLocation(udg_R_CasMovetoPnt[1])
- Set R_CasDCount[(Integer A)] = 0
- Unit - Turn collision for R_Caster[(Integer A)] On
- Unit - Unpause R_Caster[(Integer A)]
- Trigger - Turn off (This trigger)
- Else - Actions
- If - Conditions
- Loop - Actions
- For each (Integer A) from 1 to 1, do (Actions)
- Events
Trigger:
- R Tar Movment red
- Events
- Time - Every 0.04 seconds of game time
- Conditions
- Actions
- For each (Integer A) from 1 to 1, do (Actions)
- Loop - Actions
- Set R_TarDCount[(Integer A)] = (R_TarDCount[(Integer A)] + 30)
- Set R_TarInitPos[(Integer A)] = (Position of R_Target[(Integer A)])
- Set R_TarMoveToPnt[(Integer A)] = (R_TarInitPos[(Integer A)] offset by (60.00 - (0.10 x R_CastDistance[(Integer A)])) towards R_CasAngle[(Integer A)] degrees)
- Unit - Move R_Target[(Integer A)] instantly to R_TarMoveToPnt[(Integer A)]
- Special Effect - Create a special effect at R_TarInitPos[(Integer A)] using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
- Special Effect - Destroy (Last created special effect)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- R_TarDCount[(Integer A)] Greater than (Integer(R_CastDistance[(Integer A)]))
- Then - Actions
- Custom script: call RemoveLocation(udg_R_TarInitPos[1])
- Custom script: call RemoveLocation(udg_R_TarMoveToPnt[1])
- Set R_TarDCount[(Integer A)] = 0
- Unit - Turn collision for R_Target[(Integer A)] On
- Unit - Unpause R_Target[(Integer A)]
- Unit - Cause R_Caster[(Integer A)] to damage R_Target[(Integer A)], dealing ((600.00 - R_CastDistance[(Integer A)]) x (0.50 x (Real((Level of Magnetic Field for R_Caster[(Integer A)]))))) damage of attack type Spells and damage type Normal
- Trigger - Turn off (This trigger)
- Else - Actions
- If - Conditions
- Loop - Actions
- For each (Integer A) from 1 to 1, do (Actions)
- Events
Criticism very welcome, I need to improve a lot
Note to readers: I accidentally left Magnetic Field as the name for the ability, so just ignore that (I changed it half way through >_>)