Here is one of my spells for my hero
It's called "Destiny Bond" , just like Pokemon! : )
But in here, it bound the caster and the target together, and if one were to leave the 600 radius of the other it would be pull back and if 1 unit were to die it would deal damage to the unit that survive
The Damage part is okay
But I don't know how to detect who is the one who move out of the other range, I was planning on using If <Distance between (Caster) and (Target) is greater than 600> but I realize that by using this method If one unit move out of the Bond it would pull back both unit since it cannot detect who is the actual unit that move out of range
I switch to a more complex way of doing things, with a lot of Real and Point Variable This is my Trigger
To put it in a Simple Way, The Trigger Store The Distance Variable before storing another one 0.01 second later
Then it would check if the Distance stored later is greater than the one stored before, if it is greater(The unit has move) it would Turn the Boolean True
Then finally it check that if the distance between the Caster and Target is greater than 600 then check that if the Boolean is true if both condition are met, the unit that trigger the Boolean will be pulled back
...This...is what I planned, but the unit is not pull back when It exits the range. Can anybody help me with this?
It's called "Destiny Bond" , just like Pokemon! : )
But in here, it bound the caster and the target together, and if one were to leave the 600 radius of the other it would be pull back and if 1 unit were to die it would deal damage to the unit that survive
The Damage part is okay
But I don't know how to detect who is the one who move out of the other range, I was planning on using If <Distance between (Caster) and (Target) is greater than 600> but I realize that by using this method If one unit move out of the Bond it would pull back both unit since it cannot detect who is the actual unit that move out of range
I switch to a more complex way of doing things, with a lot of Real and Point Variable This is my Trigger
Code:
Destiny Bond
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Destiny Bond
Actions
Set DB_Caster = (Triggering unit)
Set DB_Target = (Target unit of ability being cast)
Set DB_Distance = (Distance between (Position of DB_Caster) and (Position of DB_Target))
Trigger - Turn on Destiny Bond Lightning Effect <gen>
Trigger - Turn on Destiny Bond Move Check <gen>
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Destiny Bond for DB_Caster) Equal to 1
Then - Actions
Wait 4.00 seconds
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Destiny Bond for DB_Caster) Equal to 2
Then - Actions
Wait 5.00 seconds
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Destiny Bond for DB_Caster) Equal to 3
Then - Actions
Wait 6.00 seconds
Else - Actions
Trigger - Turn off Destiny Bond Lightning Effect <gen>
Trigger - Turn off Destiny Bond Move Check <gen>
Lightning - Destroy DB_Lightning
Code:
Destiny Bond Lightning Effect
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
Lightning - Destroy DB_Lightning
Lightning - Create a Spirit Link lightning effect from source DB_Caster_Point1 to target DB_Target_Point1
Set DB_Lightning = (Last created lightning effect)
Code:
Destiny Bond Move Check
Events
Time - Every 0.01 seconds of game time
Conditions
Actions
Set DB_Caster_Point1 = (Position of DB_Caster)
Set DB_Target_Point1 = (Position of DB_Target)
Wait 0.01 seconds
Set DB_Caster_Point2 = (Position of DB_Caster)
Set DB_Target_Point2 = (Position of DB_Target)
Set DB_Caster_Point_Distance = (Distance between DB_Caster_Point1 and DB_Caster_Point2)
Set DB_Target_Point_Distance = (Distance between DB_Target_Point1 and DB_Target_Point2)
-------- Check if Destiny Bond Caster has Move --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DB_Caster_Point_Distance Greater than 10.00
Then - Actions
Set DB_Caster_DistanceCheck = (Distance between (Position of DB_Caster) and (Position of DB_Target))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DB_Caster_DistanceCheck Greater than DB_Distance
Then - Actions
Set DB_Caster_HasMove = True
Else - Actions
Set DB_Caster_HasMove = False
Else - Actions
Set DB_Caster_HasMove = False
-------- Check if Destiny Bond Target has Move --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DB_Target_Point_Distance Greater than 10.00
Then - Actions
Set DB_Target_DistanceCheck = (Distance between (Position of DB_Caster) and (Position of DB_Target))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DB_Target_DistanceCheck Greater than DB_Distance
Then - Actions
Set DB_Target_HasMove = True
Else - Actions
Set DB_Target_HasMove = False
Else - Actions
Set DB_Target_HasMove = False
-------- Check Distance between both Units --------
Set DB_Distance = (Distance between (Position of DB_Caster) and (Position of DB_Target))
-------- Distance More Than 600 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DB_Distance Greater than 600.00
Then - Actions
Set DB_Angle = (Angle from (Position of DB_Caster) to (Position of DB_Target))
-------- Caster Has Move --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DB_Caster_HasMove Equal to True
Then - Actions
Unit - Move DB_Caster instantly to ((Position of DB_Target) offset by 600.00 towards DB_Angle degrees)
Set DB_Caster_HasMove = False
Else - Actions
-------- Target Has Move --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DB_Target_HasMove Equal to True
Then - Actions
Unit - Move DB_Target instantly to ((Position of DB_Caster) offset by 600.00 towards DB_Angle degrees)
Set DB_Target_HasMove = False
Else - Actions
-------- Both Has Move --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(DB_Caster_HasMove Equal to True) and (DB_Target_HasMove Equal to True)
Then - Actions
Unit - Move DB_Target instantly to ((Position of DB_Caster) offset by 600.00 towards DB_Angle degrees)
Unit - Move DB_Caster instantly to ((Position of DB_Target) offset by 600.00 towards DB_Angle degrees)
Set DB_Caster_HasMove = False
Set DB_Target_HasMove = False
Else - Actions
Else - Actions
-------- A Unit Die --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(DB_Target is dead) Equal to True
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Destiny Bond for DB_Caster) Equal to 1
Then - Actions
Unit - Cause DB_Target to damage DB_Caster, dealing 500.00 damage of attack type Spells and damage type Magic
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Destiny Bond for DB_Caster) Equal to 2
Then - Actions
Unit - Cause DB_Target to damage DB_Caster, dealing 600.00 damage of attack type Spells and damage type Magic
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Destiny Bond for DB_Caster) Equal to 3
Then - Actions
Unit - Cause DB_Target to damage DB_Caster, dealing 700.00 damage of attack type Spells and damage type Magic
Else - Actions
Special Effect - Create a special effect at (Position of DB_Caster) using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
Special Effect - Destroy (Last created special effect)
Trigger - Turn off Destiny Bond Lightning Effect <gen>
Trigger - Turn off (This trigger)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(DB_Caster is dead) Equal to True
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Destiny Bond for DB_Caster) Equal to 1
Then - Actions
Unit - Cause DB_Caster to damage DB_Target, dealing 500.00 damage of attack type Spells and damage type Magic
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Destiny Bond for DB_Caster) Equal to 2
Then - Actions
Unit - Cause DB_Caster to damage DB_Target, dealing 600.00 damage of attack type Spells and damage type Magic
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Destiny Bond for DB_Caster) Equal to 3
Then - Actions
Unit - Cause DB_Caster to damage DB_Target, dealing 700.00 damage of attack type Spells and damage type Magic
Else - Actions
Special Effect - Create a special effect at (Position of DB_Target) using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
Special Effect - Destroy (Last created special effect)
Trigger - Turn off Destiny Bond Lightning Effect <gen>
Trigger - Turn off (This trigger)
Else - Actions
To put it in a Simple Way, The Trigger Store The Distance Variable before storing another one 0.01 second later
Then it would check if the Distance stored later is greater than the one stored before, if it is greater(The unit has move) it would Turn the Boolean True
Then finally it check that if the distance between the Caster and Target is greater than 600 then check that if the Boolean is true if both condition are met, the unit that trigger the Boolean will be pulled back
...This...is what I planned, but the unit is not pull back when It exits the range. Can anybody help me with this?