Teleport Spell Trouble

Pandamanana

New Member
Reaction score
2
My triggers are not working... could someone possibly clue me in on why that is?

My spell is SUPPOSED to teleport the hero to the targeted point and cost 50 gold for every 500 range away the target is from his position.

Here are the two triggers...
Code:
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

Code:
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

When I tested it, the hero tried to cast the spell and was Stopped no matter what his mana was at the time.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top