This spell is supposed to teleport the caster to the targeted location and have the spell's mana cost go up 50 points for every 500 range between the target and the caster's position. Could anyone clue me in as to why this doesn't work?
First Skill
Meld
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Meld
Actions
Set MeldCaster = (Casting unit)
Set MeldPosition = (Position of MeldCaster)
Set MeldTarget = (Target point of ability being cast)
Set MeldMana = (Mana of MeldCaster)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain type at MeldPosition) Equal to (Terrain type at MeldTarget)
Then - Actions
Unit - Set mana of MeldCaster to (MeldMana - (25.00 x ((Distance between MeldPosition and MeldTarget) / 500.00)))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain type at MeldPosition) Not equal to (Terrain type at MeldTarget)
Then - Actions
Unit - Set mana of MeldCaster to (MeldMana - (50.00 x ((Distance between MeldPosition and MeldTarget) / 500.00)))
Else - Actions
Do nothing
Custom script: call RemoveLocation (udg_MeldTarget)
Custom script: call RemoveLocation (udg_MeldPosition)
Set MeldCaster = No unit
Set MeldMana = 0.00
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Meld
Actions
Set MeldCaster = (Casting unit)
Set MeldPosition = (Position of MeldCaster)
Set MeldTarget = (Target point of ability being cast)
Set MeldMana = (Mana of MeldCaster)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain type at MeldPosition) Equal to (Terrain type at MeldTarget)
Then - Actions
Unit - Set mana of MeldCaster to (MeldMana - (25.00 x ((Distance between MeldPosition and MeldTarget) / 500.00)))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain type at MeldPosition) Not equal to (Terrain type at MeldTarget)
Then - Actions
Unit - Set mana of MeldCaster to (MeldMana - (50.00 x ((Distance between MeldPosition and MeldTarget) / 500.00)))
Else - Actions
Do nothing
Custom script: call RemoveLocation (udg_MeldTarget)
Custom script: call RemoveLocation (udg_MeldPosition)
Set MeldCaster = No unit
Set MeldMana = 0.00
Second Trigger
Meld Copy
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Meld
Actions
Set MeldCaster = (Casting unit)
Set MeldMana = (Mana of MeldCaster)
Set MeldPosition = (Position of MeldCaster)
Set MeldTarget = (Target point of ability being cast)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain type at MeldPosition) Equal to (Terrain type at MeldTarget)
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MeldMana Greater than or equal to (25.00 x ((Distance between MeldPosition and MeldTarget) / 500.00))
Then - Actions
Do nothing
Else - Actions
Unit - Order MeldCaster to Stop
Sound - Play SpellShieldImpact1 <gen> at 100.00% volume, attached to MeldCaster
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain type at MeldPosition) Not equal to (Terrain type at MeldTarget)
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MeldMana Greater than or equal to (50.00 x ((Distance between MeldPosition and MeldTarget) / 500.00))
Then - Actions
Do nothing
Else - Actions
Unit - Order MeldCaster to Stop
Sound - Play SpellShieldImpact1 <gen> at 100.00% volume, attached to MeldCaster
Else - Actions
Do nothing
Custom script: call RemoveLocation (udg_MeldTarget)
Custom script: call RemoveLocation (udg_MeldPosition)
Set MeldCaster = No unit
Set MeldMana = 0.00
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Meld
Actions
Set MeldCaster = (Casting unit)
Set MeldMana = (Mana of MeldCaster)
Set MeldPosition = (Position of MeldCaster)
Set MeldTarget = (Target point of ability being cast)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain type at MeldPosition) Equal to (Terrain type at MeldTarget)
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MeldMana Greater than or equal to (25.00 x ((Distance between MeldPosition and MeldTarget) / 500.00))
Then - Actions
Do nothing
Else - Actions
Unit - Order MeldCaster to Stop
Sound - Play SpellShieldImpact1 <gen> at 100.00% volume, attached to MeldCaster
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain type at MeldPosition) Not equal to (Terrain type at MeldTarget)
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MeldMana Greater than or equal to (50.00 x ((Distance between MeldPosition and MeldTarget) / 500.00))
Then - Actions
Do nothing
Else - Actions
Unit - Order MeldCaster to Stop
Sound - Play SpellShieldImpact1 <gen> at 100.00% volume, attached to MeldCaster
Else - Actions
Do nothing
Custom script: call RemoveLocation (udg_MeldTarget)
Custom script: call RemoveLocation (udg_MeldPosition)
Set MeldCaster = No unit
Set MeldMana = 0.00