• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Telekiness v0.1

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Spell is:
¥.MUI
¥.GUI
¥.Leakless
¥.Bugless

Code:
Credits:
Shark_4_you - for spell

SCREENSHOT:
qyd1fp.jpg


Triggers:

[trigger= Spell Int]
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Telekinesis
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Integer[0] Equal to 0
Then - Actions
Trigger - Turn on Spell loop <gen>
Else - Actions
Set Integer[0] = (Integer[0] + 1)
Set Integer[1] = (Integer[1] + 1)
Set Bolean[Integer[1]] = True
-------- -------------------------------------------------------------------------------------------------------------------- --------
Set Caster[Integer[1]] = (Triggering unit)
Set Target[Integer[1]] = (Target unit of ability being cast)
Set Point1[Integer[1]] = (Position of Target[Integer[1]])
Unit - Pause Target[Integer[2]]
-------- -------------------------------------------------------------------------------------------------------------------- --------
Set Effect1[Integer[1]] = Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
-------- -------------------------------------------------------------------------------------------------------------------- --------
Set Point2[Integer[1]] = (Point1[Integer[1]] offset by 200.00 towards 10.00 degrees)
Unit - Create 1 Dummy 1 for (Owner of Caster[Integer[1]]) at Point2[Integer[1]] facing (Facing of Target[Integer[1]]) degrees
Set Dummy1[Integer[1]] = (Last created unit)
Unit - Make Dummy1[Integer[1]] face Target[Integer[1]] over 0.00 seconds
Lightning - Create a Drain Life lightning effect from source Point2[Integer[1]] to target Point1[Integer[1]]
Set Lighting1[Integer[1]] = (Last created lightning effect)
-------- -------------------------------------------------------------------------------------------------------------------- --------
Set Point3[Integer[1]] = (Point1[Integer[1]] offset by 200.00 towards 140.00 degrees)
Unit - Create 1 Dummy 1 for (Owner of Caster[Integer[1]]) at Point3[Integer[1]] facing (Facing of Target[Integer[1]]) degrees
Set Dummy2[Integer[1]] = (Last created unit)
Unit - Make Dummy2[Integer[1]] face Target[Integer[1]] over 0.00 seconds
Lightning - Create a Drain Life lightning effect from source Point3[Integer[1]] to target Point1[Integer[1]]
Set Lighting2[Integer[1]] = (Last created lightning effect)
-------- -------------------------------------------------------------------------------------------------------------------- --------
Set Point4[Integer[1]] = (Point1[Integer[1]] offset by 200.00 towards 270.00 degrees)
Unit - Create 1 Dummy 1 for (Owner of Caster[Integer[1]]) at Point4[Integer[1]] facing (Facing of Target[Integer[1]]) degrees
Set Dummy3[Integer[1]] = (Last created unit)
Unit - Make Dummy3[Integer[1]] face Target[Integer[1]] over 0.00 seconds
Lightning - Create a Drain Life lightning effect from source Point4[Integer[1]] to target Point1[Integer[1]]
Set Lighting3[Integer[1]] = (Last created lightning effect)
-------- -------------------------------------------------------------------------------------------------------------------- --------
Set Damage[Integer[1]] = (Real(((Level of Telekinesis for Caster[Integer[1]]) x 200)))
Set Distance1[Integer[1]] = 100
-------- ----------------------------------------------------- --------
Custom script: call RemoveLocation (udg_Point1[udg_Integer[1]])
Custom script: call RemoveLocation (udg_Point2[udg_Integer[1]])
Custom script: call RemoveLocation (udg_Point3[udg_Integer[1]])
Custom script: call RemoveLocation (udg_Point4[udg_Integer[1]])

[/trigger]


[trigger=Spell Loop]
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
For each (Integer Integer[2]) from 1 to Integer[1], do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Bolean[Integer[2]] Equal to True
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
Distance1[Integer[2]] Less than or equal to 20
(Target[Integer[2]] is dead) Equal to True
Then - Actions
Unit - Cause Caster[Integer[2]] to damage Target[Integer[2]], dealing Damage[Integer[2]] damage of attack type Spells and damage type Normal
Unit - Remove Dummy1[Integer[2]] from the game
Lightning - Destroy Lighting1[Integer[2]]
Lightning - Destroy Lighting2[Integer[2]]
Lightning - Destroy Lighting3[Integer[2]]
Unit - Remove Dummy2[Integer[2]] from the game
Unit - Remove Dummy3[Integer[2]] from the game
Unit - Unpause Target[Integer[2]]
Set Bolean[Integer[2]] = False
Set Integer[0] = (Integer[0] - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Integer[0] Equal to 0
Then - Actions
Set Integer[1] = 0
Trigger - Turn off (This trigger)
Else - Actions
Else - Actions
Set Point1[Integer[2]] = (Position of Dummy1[Integer[2]])
Set Point2[Integer[2]] = (Position of Dummy2[Integer[2]])
Set Point3[Integer[2]] = (Position of Dummy3[Integer[2]])
Set Point4[Integer[2]] = (Position of Target[Integer[2]])
-------- -------------------------------------------------------------------------------------------------------------------- --------
Set Real1[Integer[2]] = ((Angle from Point1[Integer[2]] to Point4[Integer[2]]) + 270.00)
Set Point5[Integer[2]] = (Point1[Integer[2]] offset by 15.00 towards Real1[Integer[2]] degrees)
Unit - Move Dummy1[Integer[2]] instantly to Point5[Integer[2]]
Special Effect - Create a special effect at Point5[Integer[2]] using Effect1[Integer[2]]
Special Effect - Destroy (Last created special effect)
Lightning - Move Lighting1[Integer[2]] to source Point1[Integer[2]] and target Point4[Integer[2]]
Unit - Make Dummy1[Integer[1]] face Target[Integer[1]] over 0.00 seconds
-------- -------------------------------------------------------------------------------------------------------------------- --------
Set Real2[Integer[2]] = ((Angle from Point2[Integer[2]] to Point4[Integer[2]]) + 270.00)
Set Point6[Integer[2]] = (Point2[Integer[2]] offset by 15.00 towards Real2[Integer[2]] degrees)
Unit - Move Dummy2[Integer[2]] instantly to Point6[Integer[2]]
Special Effect - Create a special effect at Point6[Integer[2]] using Effect1[Integer[2]]
Special Effect - Destroy (Last created special effect)
Lightning - Move Lighting2[Integer[2]] to source Point2[Integer[2]] and target Point4[Integer[2]]
Unit - Make Dummy2[Integer[1]] face Target[Integer[1]] over 0.00 seconds
-------- -------------------------------------------------------------------------------------------------------------------- --------
Set Real3[Integer[2]] = ((Angle from Point3[Integer[2]] to Point4[Integer[2]]) + 270.00)
Set Point7[Integer[2]] = (Point3[Integer[2]] offset by 15.00 towards Real3[Integer[2]] degrees)
Unit - Move Dummy3[Integer[2]] instantly to Point7[Integer[2]]
Special Effect - Create a special effect at Point7[Integer[2]] using Effect1[Integer[2]]
Special Effect - Destroy (Last created special effect)
Lightning - Move Lighting3[Integer[2]] to source Point3[Integer[2]] and target Point4[Integer[2]]
Unit - Make Dummy3[Integer[1]] face Target[Integer[1]] over 0.00 seconds
-------- -------------------------------------------------------------------------------------------------------------------- --------
Set Distance1[Integer[2]] = (Distance1[Integer[2]] - 1)
-------- -------------------------------------------------------------------------------------------------------------------- --------
Custom script: call RemoveLocation (udg_Point1[udg_Integer[2]])
Custom script: call RemoveLocation (udg_Point2[udg_Integer[2]])
Custom script: call RemoveLocation (udg_Point3[udg_Integer[2]])
Custom script: call RemoveLocation (udg_Point4[udg_Integer[2]])
Custom script: call RemoveLocation (udg_Point5[udg_Integer[2]])
Custom script: call RemoveLocation (udg_Point6[udg_Integer[2]])
Custom script: call RemoveLocation (udg_Point7[udg_Integer[2]])
-------- -------------------------------------------------------------------------------------------------------------------- --------
Else - Actions [/trigger]


Comment And Rate!



Keywords:
Shark_4_you ; naruto ; Telekiness
Contents

Just another Warcraft III map (Map)

Reviews
12.12 IcemanBo: For long time as NeedsFix. Rejected. Bribe: Integer[1] should be a normal integer variable. The indexing got over-complicated somewhere. (Owner of Caster[Integer[1]]) could be simplified as (Triggering player) To add to...

Moderator

M

Moderator

12.12
IcemanBo: For long time as NeedsFix. Rejected.

Bribe:

Integer[1] should be a normal integer variable. The indexing got over-complicated somewhere.

(Owner of Caster[Integer[1]]) could be simplified as (Triggering player)

To add to what has already been said your point variables need to be heavily consolidated. I do count 7 location array variables which is totally overcomplicated.

Integer[2] yeah move this to a normal variable, avoid arrays when you don't need them.

Your variable names are also bad and should be prefixed so that your spell is more easily importable.

Needs some more work.
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
Now this is off to the record, 7 arrayed point variables? Now that is something. Any description of the spell?

-Make them all non-arrayed.
-You don't even need 7 of them, you can call the remove and set it afterwards again. No need to put the leak removal at the bottom.

-Distance variable doesn't make any sense to me, neither the name or the value. It's like a counter.

-The lightnings doesn't count in height aka z factor.

-Also aren't the lightnings moving along the ground?
 
Level 10
Joined
Apr 25, 2009
Messages
296
Use:

  • Custom script: set udg_YOURLIGHTNING = AddLightningEx(udg_LIGHTNINGTYPE, true , GetLocationX(udg_POINT1), GetLocationY(udg_POINT1), GetLocationZ(udg_POINT1) + NUMBER, GetLocationX(udg_POINT2), GetLocationY(udg_POINT2), GetLocationZ(udg_POINT2) + NUMBER2 )
To fix the lightning height.

Also, you provide screenshots, but you do not state what this spell does... please add that in your description.

To increase your efficiency, set functions that you re-use to a variable, such as (GetUnitFacingAngle), and move constant numbers to a variable in a map initialization trigger...

Example:
  • Set Point2[Integer[1]] = (Point1[Integer[1]] offset by 200.00 towards 10.00 degrees)
Change that to:

  • Set Point2[Integer[1]] = (Point1[Integer[1]] offset by VariableA towards VariableB degrees)
  • Map Initialization
  • --
  • --
  • --
  • set VariableA = 200.00
  • set VariableB = 10
 
Top