Shadowstep

LuckyStrike

New Member
Reaction score
1
Hy, i got a problem with my spell...

The spell : Shadowstep - works the same as blink but only on units

I want to add a slow effect to my spell.

Here's how far i got:
JASS:
function Trig_Shadowstep_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A008' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Shadowstep_Func009C takes nothing returns boolean
    if ( not ( IsUnitEnemy(udg_Shadow_Units[2], GetOwningPlayer(udg_Shadow_Units[1])) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Shadowstep_Actions takes nothing returns nothing
    set udg_Shadow_Units[1] = GetTriggerUnit()
    set udg_Shadow_Units[2] = GetSpellTargetUnit()
    set udg_Shadow_Point = GetUnitLoc(udg_Shadow_Units[2])
    call AddSpecialEffectTargetUnitBJ( "feet", udg_Shadow_Units[1], "Abilities\\Spells\\Undead\\CarrionSwarm\\CarrionSwarmDamage.mdl" )
    set udg_Shadow_effects[1] = GetLastCreatedEffectBJ()
    call TriggerSleepAction( 0.03 )
    call AddSpecialEffectTargetUnitBJ( "feet", udg_Shadow_Units[1], "Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl" )
    set udg_Shadow_effects[2] = GetLastCreatedEffectBJ()
    if ( Trig_Shadowstep_Func009C() ) then
        call SetUnitPositionLoc( udg_Shadow_Units[1], udg_Shadow_Point )
        call IssueTargetOrder( udg_Shadow_Units[1], "attack", udg_Shadow_Units[2] )
    else
    endif
endfunction

//===========================================================================
function InitTrig_Shadowstep takes nothing returns nothing
    set gg_trg_Shadowstep = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Shadowstep, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Shadowstep, Condition( function Trig_Shadowstep_Conditions ) )
    call TriggerAddAction( gg_trg_Shadowstep, function Trig_Shadowstep_Actions )
endfunction
(converted from MUI to JASS)
 

Nexor

...
Reaction score
74
It's GUI, not MUI
GUI stands for Graphical User Interface : a user-friendly interface for JASS
MUI stands for Multi-Unit Instable : it means that the skill can be used by an unlimited number of units, and wont crash
 

Exide

I am amazingly focused right now!
Reaction score
448
Why did you convert it, when you haven't optimized it?
What is it that you want to happen, and what happens? (What's the problem?)

>I want to add a slow effect to my spell.
You want the target unit to be slowed?
 

T.s.e

Wish I was old and a little sentimental
Reaction score
133
> Instable
Instanceable.

JASS:
function Trig_Shadowstep_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A008'
endfunction

function Trig_Shadowstep_Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local unit target = GetSpellTargetUnit()
    local real ms = GetUnitMoveSpeed(target)
    call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Undead\\CarrionSwarm\\CarrionSwarmDamage.mdl", GetUnitX(caster), GetUnitY(caster)))
    call TriggerSleepAction( 0.03 )
    call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl", GetUnitX(caster), GetUnitY(caster)))
    if IsUnitEnemy(caster, target) then
        call SetUnitPosition(caster, GetUnitX(target), GetUnitY(target))
        call IssueTargetOrder(caster, "attack", target)
        call SetUnitMoveSpeed(target, ms/1.5)
        call TriggerSleepAction(3)
        call SetUnitMoveSpeed(target, ms)
    else
    endif
    set caster = null
    set target = null
endfunction

//===========================================================================
function InitTrig_Shadowstep takes nothing returns nothing
    set gg_trg_Shadowstep = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Shadowstep, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Shadowstep, Condition( function Trig_Shadowstep_Conditions ) )
    call TriggerAddAction( gg_trg_Shadowstep, function Trig_Shadowstep_Actions )
endfunction


I believe this should work, I didn't fully understand if you wanted a slowing in an area though.
 

LuckyStrike

New Member
Reaction score
1
Srry i didnt specified, i want it to work like this : the spell is cast by my hero on an unit, he is teleported next to the unit and adds a slow effect for a couple of seconds to the targeted unit.
Also srry for my bad english, because i'm romanian :rolleyes:
 

Exide

I am amazingly focused right now!
Reaction score
448
Simply create a dummy unit and have it cast a 'slow ability' on the target.
 

LuckyStrike

New Member
Reaction score
1
> Instable
Instanceable.

JASS:
function Trig_Shadowstep_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A008'
endfunction

function Trig_Shadowstep_Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local unit target = GetSpellTargetUnit()
    local real ms = GetUnitMoveSpeed(target)
    call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Undead\\CarrionSwarm\\CarrionSwarmDamage.mdl", GetUnitX(caster), GetUnitY(caster)))
    call TriggerSleepAction( 0.03 )
    call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl", GetUnitX(caster), GetUnitY(caster)))
    if IsUnitEnemy(caster, target) then
        call SetUnitPosition(caster, GetUnitX(target), GetUnitY(target))
        call IssueTargetOrder(caster, "attack", target)
        call SetUnitMoveSpeed(target, ms/1.5)
        call TriggerSleepAction(3)
        call SetUnitMoveSpeed(target, ms)
    else
    endif
    set caster = null
    set target = null
endfunction

//===========================================================================
function InitTrig_Shadowstep takes nothing returns nothing
    set gg_trg_Shadowstep = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Shadowstep, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Shadowstep, Condition( function Trig_Shadowstep_Conditions ) )
    call TriggerAddAction( gg_trg_Shadowstep, function Trig_Shadowstep_Actions )
endfunction


I believe this should work, I didn't fully understand if you wanted a slowing in an area though.

No this doesn't work. I wanted this spell to function like combining blinkstrike with slow if u understand what i mean.
Simply create a dummy unit and have it cast a 'slow ability' on the target.
Can i do that in GUI? ( i understant GUI better than JASS)
 

Exide

I am amazingly focused right now!
Reaction score
448

LuckyStrike

New Member
Reaction score
1
Still not slowing...

I made the trigger like this :
Trigger:
  • Shadowstep
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shadowstep
    • Actions
      • Set Shadow_Units[1] = (Triggering unit)
      • Set Shadow_Units[2] = (Target unit of ability being cast)
      • Set Shadow_Point = (Position of Shadow_Units[2])
      • Special Effect - Create a special effect attached to the chest of Shadow_Units[1] using Abilities\Spells\Undead\CarrionSwarm\CarrionSwarmDamage.mdl
      • Set Shadow_effects[1] = (Last created special effect)
      • Wait 0.03 seconds
      • Special Effect - Create a special effect attached to the chest of Shadow_Units[1] using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
      • Set Shadow_effects[2] = (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Shadow_Units[2] belongs to an enemy of (Owner of Shadow_Units[1])) Equal to True
        • Then - Actions
          • Set Point = (Position of (Triggering unit))
          • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at Point facing Default building facing degrees
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
          • Unit - Add Slow to (Last created unit)
          • Unit - Set level of Slow for (Last created unit) to (Level of Shadowstep for (Triggering unit))
          • Unit - Order (Last created unit) to Human Sorceress - Slow (Target unit of ability being cast)
          • Unit - Move Shadow_Units[1] instantly to Shadow_Point
          • Unit - Order Shadow_Units[1] to Attack Shadow_Units[2]
          • Custom script: call RemoveLocation (udg_Point)
        • Else - Actions



It teleports, but doesn't slows the target...where did I go wrong?
 

Meowier

New Member
Reaction score
6
Target unit of ability being cast cannot work after 'wait' is put into a trigger.

Unit - Order (Last created unit) to Human Sorceress - Slow (Target unit of ability being cast)

You want to change that to

Unit - Order (Last created unit) to Human Sorceress - Slow (Shadow_Units[2])

It should work after that.
 

Exide

I am amazingly focused right now!
Reaction score
448
Also make sure that your slow ability has a long range (so that the dummy isn't out of range), and that it costs no mana (so that the dummy can actually cast it.)
To search for errors with the ability try pre-placing a dummy unit with the slow ability and order it around manually.
Don't forget the 'targets allowed' either. In case you're trying to cast slow on a mechanical unit or something.
Finally I suggest you move 'Point' to (Position of (Target unit of ability being cast)) - that way it'll be closer to the target.
 

LuckyStrike

New Member
Reaction score
1
I just don't get it...

Trigger:
  • Shadowstep
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shadowstep
    • Actions
      • Set Shadow_Units[1] = (Triggering unit)
      • Set Shadow_Units[2] = (Target unit of ability being cast)
      • Set Shadow_Point = (Position of Shadow_Units[2])
      • Special Effect - Create a special effect attached to the chest of Shadow_Units[1] using Abilities\Spells\Undead\CarrionSwarm\CarrionSwarmDamage.mdl
      • Set Shadow_effects[1] = (Last created special effect)
      • Wait 0.03 seconds
      • Special Effect - Create a special effect attached to the chest of Shadow_Units[1] using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
      • Set Shadow_effects[2] = (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Shadow_Units[2] belongs to an enemy of (Owner of Shadow_Units[1])) Equal to True
        • Then - Actions
          • Set Point = (Position of (Target unit of ability being cast))
          • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at Point facing Default building facing degrees
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
          • Unit - Add Slow to (Last created unit)
          • Unit - Set level of Slow for (Last created unit) to (Level of Shadowstep for (Triggering unit))
          • Unit - Order (Last created unit) to Human Sorceress - Slow Shadow_Units[2]
          • Unit - Move Shadow_Units[1] instantly to Shadow_Point
          • Unit - Order Shadow_Units[1] to Attack Shadow_Units[2]
          • Custom script: call RemoveLocation (udg_Point)
        • Else - Actions

I did every step you guys sugested... modified slow's range, manacost, target(air, ground,enemy), and still doesn't slow...
 

Exide

I am amazingly focused right now!
Reaction score
448
The 'Targets allowed' is a bitch.
-Did you try to give it to a unit and order it to slow other units manually? (You usually get messages like 'You can't cast that on that unit', 'Must target a tree', and so on. -Which will help you figure out what you need to allow in 'Targets allowed'.)

Here's what I have:
'Air, Allied, Enemy, Friend, Ground, Mechanical, Neutral, Non-suicidal, Organic'
 

LuckyStrike

New Member
Reaction score
1
I added slow to a unit and manualy it works, but the slow in shadowstep doesn't work. Im starting to belive that its the trigger.
 

Exide

I am amazingly focused right now!
Reaction score
448
Wanna upload your map?

Maybe your ability doesn't have enough levels?
Code:
Unit - Set level of Slow for (Last created unit) to (Level of Shadowstep for (Triggering unit))
 

Exide

I am amazingly focused right now!
Reaction score
448
Your action:

Code:
Unit - Create 1 [COLOR="Red"]Dummy[/COLOR] for (Owner of (Triggering unit)) at Point facing Default building facing degrees
Is wrong.

'Dummy' is a variable, not a unit -type.
This would be fine, if you had remembered to 'set Dummy = ...', but you seem to have forgotten this.

Either create a trigger like this:
Code:
Untitled Trigger 001
    Events
        Map initialization
    Conditions
    Actions
        Set Dummy = [B]*Your_Dummy_Unit*[/B]

or change the action in your trigger:
Code:
Unit - Create 1 [COLOR="Red"]Dummy[/COLOR] for (Owner of (Triggering unit)) at Point facing Default building facing degrees

to:
Code:
Unit - Create 1 [B]*Your_Dummy_Unit*[/B] for (Owner of (Triggering unit)) at Point facing Default building facing degrees
 

LuckyStrike

New Member
Reaction score
1
It worked !!! But...(there's a but :()now the dummy apears after the spell is cast... and dies after few seconds. Can I make the dummy not visible ?


L.E.: Solved problem!:thup:. Thank you all for the help, and thanks for being patient with me :D.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top