• 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.

[Trigger] Dead trigger

Status
Not open for further replies.
Im not under standing why this trigger doesnt do anything.
all that happens is the hero starts the effect of ability, you lose control of your hero, your hero plays spell animation, you hero unpauses. Its not getting the target of ability or something. Why?

  • Sting
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shadow Strike
    • Actions
      • Unit - Pause (Casting unit)
      • Unit - Pause (Target unit of ability being cast)
      • Unit - Order (Casting unit) to Stop
      • Unit - Order (Target unit of ability being cast) to Stop
      • Unit - Make (Target unit of ability being cast) face (Casting unit) over 1.00 seconds
      • Animation - Play (Casting unit)'s spell animation
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Casting unit)) Equal to Arthas
            • Then - Actions
              • Special Effect - Create a special effect at ((Position of (Target unit of ability being cast)) offset by 100.00 towards (36.00 x (Real((Integer A)))) degrees) using war3mapImported\ZombifyTargetBlue.mdx
              • Special Effect - Destroy (Last created special effect)
              • Unit - Create 1 DummyUnits Arthas for (Owner of (Casting unit)) at ((Position of (Target unit of ability being cast)) offset by 100.00 towards (36.00 x (Real((Integer A)))) degrees) facing (Position of (Targeted unit))
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Casting unit)) Equal to Paladin
            • Then - Actions
              • Special Effect - Create a special effect at ((Position of (Target unit of ability being cast)) offset by 100.00 towards (36.00 x (Real((Integer A)))) degrees) using war3mapImported\ZombifyTargetBlue.mdx
              • Special Effect - Destroy (Last created special effect)
              • Unit - Create 1 DummyUnits Paladin for (Owner of (Casting unit)) at ((Position of (Target unit of ability being cast)) offset by 100.00 towards (36.00 x (Real((Integer A)))) degrees) facing (Position of (Targeted unit))
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Casting unit)) Equal to Mal'Ganis
            • Then - Actions
              • Special Effect - Create a special effect at ((Position of (Target unit of ability being cast)) offset by 100.00 towards (36.00 x (Real((Integer A)))) degrees) using Abilities\Spells\Demon\DarkConversion\ZombifyTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Create 1 DummyUnits Mal'Ganis for (Owner of (Casting unit)) at ((Position of (Target unit of ability being cast)) offset by 100.00 towards (36.00 x (Real((Integer A)))) degrees) facing (Position of (Targeted unit))
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Casting unit)) Equal to Dreadlord
            • Then - Actions
              • Special Effect - Create a special effect at ((Position of (Target unit of ability being cast)) offset by 100.00 towards (36.00 x (Real((Integer A)))) degrees) using Abilities\Spells\Demon\DarkConversion\ZombifyTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Create 1 DummyUnits Dreadlord for (Owner of (Casting unit)) at ((Position of (Target unit of ability being cast)) offset by 100.00 towards (36.00 x (Real((Integer A)))) degrees) facing (Position of (Targeted unit))
            • Else - Actions
          • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 50.00% transparency
          • Animation - Change (Last created unit)'s animation speed to 50.00% of its original speed
          • Unit - Pause (Last created unit)
          • Unit Group - Add (Last created unit) to StingGroup[(Player number of (Owner of (Casting unit)))]
          • Wait 0.30 seconds
      • Unit Group - Pick every unit in StingGroup[(Player number of (Owner of (Casting unit)))] and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack (Target unit of ability being cast)
      • Wait 1.80 seconds
      • Unit Group - Pick every unit in StingGroup[(Player number of (Owner of (Casting unit)))] and do (Actions)
        • Loop - Actions
          • Animation - Change (Picked unit)'s animation speed to 400.00% of its original speed
      • Wait ((1.80 / 4.00) x 10.00) seconds
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Casting unit)) Equal to Arthas
            • Then - Actions
              • Special Effect - Create a special effect at ((Position of (Target unit of ability being cast)) offset by 100.00 towards (36.00 x (Real((Integer A)))) degrees) using war3mapImported\ZombifyTargetBlue.mdx
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Casting unit)) Equal to Paladin
            • Then - Actions
              • Special Effect - Create a special effect at ((Position of (Target unit of ability being cast)) offset by 100.00 towards (36.00 x (Real((Integer A)))) degrees) using war3mapImported\ZombifyTargetBlue.mdx
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Casting unit)) Equal to Mal'Ganis
            • Then - Actions
              • Special Effect - Create a special effect at ((Position of (Target unit of ability being cast)) offset by 100.00 towards (36.00 x (Real((Integer A)))) degrees) using Abilities\Spells\Demon\DarkConversion\ZombifyTarget.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Casting unit)) Equal to Dreadlord
            • Then - Actions
              • Special Effect - Create a special effect at ((Position of (Target unit of ability being cast)) offset by 100.00 towards (36.00 x (Real((Integer A)))) degrees) using Abilities\Spells\Demon\DarkConversion\ZombifyTarget.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
      • Unit Group - Pick every unit in StingGroup[(Player number of (Owner of (Casting unit)))] and do (Actions)
        • Loop - Actions
          • Unit - Unpause (Picked unit)
          • Unit - Remove (Picked unit) from the game
      • Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing 500.00 damage of attack type Hero and damage type Normal
      • Unit - Unpause (Casting unit)
      • Unit - Unpause (Target unit of ability being cast)
 
ok now it works fine for arthas but for everyone else the units dont attack and dont dissapear, sounds like its not grouping them...


EDIT

Ok I converted it to JASS and set them to local because they were interfering with each other but now it wont work.
JASS:
function Trig_Sting_01_Conditions takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetSpellAbilityUnit()) == 'H000' ) ) then
        return false
    endif
    if ( not ( GetSpellAbilityId() == 'AEsh' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Sting_01_Func013A takes nothing returns nothing
    call SetUnitAnimation( GetEnumUnit(), "attack" )
endfunction

function Trig_Sting_01_Func020A takes nothing returns nothing
    call RemoveUnit( GetEnumUnit() )
endfunction

function Trig_Sting_01_Actions takes nothing returns nothing
    local unit sngCast = GetSpellAbilityUnit()
    local unit sngTarg = GetSpellTargetUnit()
    local location sngPoint = GetUnitLoc(sngTarg)
    local group StingGroup
    local effect array Effects
    call PauseUnitBJ( true, sngCast )
    call PauseUnitBJ( true, sngTarg )
    call IssueImmediateOrderBJ( sngCast, "stop" )
    call IssueImmediateOrderBJ( sngTarg, "stop" )
    call SetUnitFacingToFaceUnitTimed( sngTarg, sngCast, 1.00 )
    call SetUnitAnimation( sngCast, "spell" )
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 10
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        call AddSpecialEffectLocBJ( PolarProjectionBJ(sngPoint, 100.00, ( 36.00 * I2R(GetForLoopIndexA()) )), "war3mapImported\\ZombifyTargetBlue.mdx" )
        set Effects[GetForLoopIndexA()] = GetLastCreatedEffectBJ()
        call CreateNUnitsAtLocFacingLocBJ( 1, 'h005', Player(PLAYER_NEUTRAL_PASSIVE), PolarProjectionBJ(sngPoint, 100.00, ( 36.00 * I2R(GetForLoopIndexA()) )), sngPoint )
        call SetUnitColor( GetLastCreatedUnit(), udg_CustColor[1] )
        call SetUnitVertexColorBJ( GetLastCreatedUnit(), 100, 100, 100, 50.00 )
        call GroupAddUnitSimple( GetLastCreatedUnit(), StingGroup )
        call TriggerSleepAction( 0.30 )
        call DestroyEffectBJ( Effects[GetForLoopIndexA()] )
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
    call TriggerSleepAction( 1.00 )
    call ForGroupBJ( StingGroup , function Trig_Sting_01_Func013A )
    call TriggerSleepAction( 0.43 )
    call UnitDamageTargetBJ( sngCast, sngTarg, ( 400.00 + ( 100.00 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), sngCast)) ) ), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
    call TriggerSleepAction( 0.57 )
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 10
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        call AddSpecialEffectLocBJ( PolarProjectionBJ(sngPoint, 100.00, ( 36.00 * I2R(GetForLoopIndexA()) )), "war3mapImported\\ZombifyTargetBlue.mdx" )
        set Effects[( GetForLoopIndexA() + 10 )] = GetLastCreatedEffectBJ()
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
    call TriggerSleepAction( 0.30 )
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 20
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        call DestroyEffectBJ( Effects[GetForLoopIndexA()] )
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
    call ForGroupBJ( StingGroup , function Trig_Sting_01_Func020A )
    call PauseUnitBJ( false, sngCast )
    call PauseUnitBJ( false, sngTarg )
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 20
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        set Effects[GetForLoopIndexA()] = null
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
    set sngCast = null
    set sngTarg = null
    set sngPoint = null
endfunction

//===========================================================================
function InitTrig_Sting_01 takes nothing returns nothing
    set gg_trg_Sting_01 = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Sting_01, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Sting_01, Condition( function Trig_Sting_01_Conditions ) )
    call TriggerAddAction( gg_trg_Sting_01, function Trig_Sting_01_Actions )
endfunction
 
Last edited:
Status
Not open for further replies.
Top