• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Pure Fail [JASS]

Status
Not open for further replies.
Here is my first Jass (its converted GUI, i just played with it a bit(removed some BJ and set some locals))

Syntax gives me 8 errors (special effect is not array (or something like that))
How do i make a local special effect array?
Is it possible to move "UNIT_STATE_LIFE" in a loop?(thats how was in GUI) locals? are they right?
There is no timers.

Could someone correct the code?
Any good tips are welcome.

I fail totally D:



JASS:
function Trig_Shdow_Fury_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A000' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Shdow_Fury_Func011Func012C takes nothing returns boolean
    if ( not ( GetUnitStateSwap(UNIT_STATE_LIFE, target) < 60.00 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Shdow_Fury_Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local unit target = GetSpellTargetUnit()
    local effect eff
    local effect eff2
    local integer i = 0
    local integer iloop = 20
    local location TargetLoc1
    local location TargetLoc2
    local real r 
    call PolledWait( 0.01 )
    call SetUnitInvulnerable( caster, true )
    call PauseUnit ( caster, true )
    call SetUnitTimeScalePercent( caster, 200.00 )
    call AddSpecialEffectTarget ( "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl", caster, "hand, right" )
    set eff = GetLastCreatedEffectBJ()
    call AddSpecialEffectTarget ( "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl", caster, "hand, left" )
    set eff2 = GetLastCreatedEffectBJ()
    loop
        exitwhen i >= iloop
        call TriggerSleepAction( 0.20 )
        call SetUnitAnimation( caster, "attack" )
        set TargetLoc1 = GetUnitLoc(target)
        call SetUnitPositionLocFacingLocBJ( caster, TargetLoc1, TargetLoc1 )
        call SetUnitFacingToFaceUnitTimed( caster, target, 0 )
        call UnitDamageTargetBJ( caster, target, 50.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
        call AddSpecialEffectTargetUnitBJ( "origin", caster, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
        call DestroyEffectBJ( GetLastCreatedEffectBJ() )
        call AddSpecialEffectTargetUnitBJ( "chest", target, "Objects\\Spawnmodels\\Critters\\Albatross\\CritterBloodAlbatross.mdl" )
        call DestroyEffectBJ( GetLastCreatedEffectBJ() )
        if ( Trig_Shdow_Fury_Func011Func012C() ) then
            call SetUnitFacingToFaceUnitTimed( caster, target, 0 )
            call SetUnitAnimation( caster, "attack" )
            call PauseUnitBJ( true, udg_UnitVarTarget )
            call SetUnitTimeScalePercent( caster, 25.00 )
            call SetUnitTimeScalePercent( target, 10.00 )
            call PolledWait( 1.85 )
            call SetUnitAnimation( target, "death" )
            call AddSpecialEffectTargetUnitBJ( "chest", target, "Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl" )
            call DestroyEffectBJ( GetLastCreatedEffectBJ() )
            set TargetLoc2 = GetUnitLoc(target)
            call AddSpecialEffectLocBJ( TargetLoc2, "Abilities\\Weapons\\MeatwagonMissile\\MeatwagonMissile.mdl" )
            call DestroyEffectBJ( GetLastCreatedEffectBJ() )
            call SetUnitTimeScalePercent( target, 100.00 )
            call PolledWait( 0.01 )
            call ExplodeUnitBJ( target )
            call PauseUnitBJ( false, target )
            call PolledWait( 1.00 )
            call ResetUnitAnimation( caster )
            call SetUnitInvulnerable( caster, false )
            call PauseUnitBJ( false, caster )
            call SetUnitTimeScalePercent( caster, 100.00 )
            call DestroyEffectBJ( udg_SpecialEffect[1] )
            call DestroyEffectBJ( udg_SpecialEffect[2] )
            return
        else
        endif
        set i = i + 1
    endloop
    call SetUnitInvulnerable( caster, false )
    call PauseUnitBJ( false, caster )
    call ResetUnitAnimation( caster )
    call SetUnitTimeScalePercent( caster, 100.00 )
    call DestroyEffectBJ( udg_SpecialEffect[1] )
    call DestroyEffectBJ( udg_SpecialEffect[2] )
endfunction

//===========================================================================
function InitTrig_Shdow_Fury takes nothing returns nothing
    set gg_trg_Shdow_Fury = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Shdow_Fury, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Shdow_Fury, Condition( function Trig_Shdow_Fury_Conditions ) )
    call TriggerAddAction( gg_trg_Shdow_Fury, function Trig_Shdow_Fury_Actions )
endfunction

  • Shadow Fury
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shadow Fury
    • Actions
      • Set UnitVarCaster = (Triggering unit)
      • Set UnitVarTarget = (Target unit of ability being cast)
      • Wait 0.01 game-time seconds
      • Unit - Make UnitVarCaster Invulnerable
      • Unit - Pause UnitVarCaster
      • Animation - Change UnitVarCaster's animation speed to 200.00% of its original speed
      • Special Effect - Create a special effect attached to the hand, right of UnitVarCaster using Abilities\Weapons\PhoenixMissile\Phoenix_Missile_mini.mdl
      • Set SpecialEffect[1] = (Last created special effect)
      • Special Effect - Create a special effect attached to the hand, left of UnitVarCaster using Abilities\Weapons\PhoenixMissile\Phoenix_Missile_mini.mdl
      • Set SpecialEffect[2] = (Last created special effect)
      • For each (Integer A) from 1 to 20, do (Actions)
        • Loop - Actions
          • Wait 0.20 seconds
          • Animation - Play UnitVarCaster's attack animation
          • Set TempLoc01 = (Position of UnitVarTarget)
          • Set TempLoc02 = (Random point in (Region centered at TempLoc01 with size (70.00, 70.00)))
          • Unit - Move UnitVarCaster instantly to TempLoc02, facing TempLoc01
          • Unit - Make UnitVarCaster face UnitVarTarget over 0.00 seconds
          • Unit - Cause UnitVarCaster to damage UnitVarTarget, dealing 50.00 damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect attached to the origin of UnitVarCaster using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect attached to the chest of UnitVarTarget using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
          • Special Effect - Destroy (Last created special effect)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Life of UnitVarTarget) Less than 60.00
            • Then - Actions
              • Unit - Make UnitVarCaster face UnitVarTarget over 0.00 seconds
              • Animation - Play UnitVarCaster's attack animation
              • Unit - Pause UnitVarTarget
              • Animation - Change UnitVarCaster's animation speed to 25.00% of its original speed
              • Animation - Change UnitVarTarget's animation speed to 25.00% of its original speed
              • Wait 1.85 game-time seconds
              • Animation - Play UnitVarTarget's death animation
              • Special Effect - Create a special effect attached to the head of UnitVarTarget using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
              • Special Effect - Destroy (Last created special effect)
              • Special Effect - Create a special effect attached to the chest of UnitVarTarget using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
              • Special Effect - Destroy (Last created special effect)
              • Special Effect - Create a special effect attached to the origin of UnitVarTarget using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
              • Special Effect - Destroy (Last created special effect)
              • Special Effect - Create a special effect attached to the hand, left of UnitVarTarget using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
              • Special Effect - Destroy (Last created special effect)
              • Special Effect - Create a special effect attached to the hand, right of UnitVarTarget using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
              • Special Effect - Destroy (Last created special effect)
              • Set TempLoc03 = (Position of UnitVarTarget)
              • Special Effect - Create a special effect at TempLoc03 using Abilities\Weapons\MeatwagonMissile\MeatwagonMissile.mdl
              • Special Effect - Destroy (Last created special effect)
              • Animation - Change UnitVarTarget's animation speed to 100.00% of its original speed
              • Wait 0.01 game-time seconds
              • Unit - Explode UnitVarTarget
              • Unit - Unpause UnitVarTarget
              • Wait 1.00 game-time seconds
              • Animation - Reset UnitVarCaster's animation
              • Unit - Make UnitVarCaster Vulnerable
              • Unit - Unpause UnitVarCaster
              • Animation - Change UnitVarCaster's animation speed to 100.00% of its original speed
              • Special Effect - Destroy SpecialEffect[1]
              • Special Effect - Destroy SpecialEffect[2]
              • Custom script: call RemoveLocation (udg_TempLoc01)
              • Custom script: call RemoveLocation (udg_TempLoc02)
              • Custom script: call RemoveLocation (udg_TempLoc03)
              • Skip remaining actions
            • Else - Actions
      • Unit - Make UnitVarCaster Vulnerable
      • Unit - Unpause UnitVarCaster
      • Animation - Reset UnitVarCaster's animation
      • Animation - Change UnitVarCaster's animation speed to 100.00% of its original speed
      • Special Effect - Destroy SpecialEffect[1]
      • Special Effect - Destroy SpecialEffect[2]
      • Custom script: call RemoveLocation (udg_TempLoc01)
      • Custom script: call RemoveLocation (udg_TempLoc02)


-BZR-
 
Last edited:
Level 12
Joined
Feb 23, 2007
Messages
1,030
JASS:
function Trig_Shdow_Fury_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A000' ) ) then
return false
    endif
    return true
endfunction

can be shortened too

JASS:
function Trig_Shdow_Fury_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000'
endfunction

to create arrays go

local effect array name

and yes it is possible to change a units state in a loop. Anything is possible in JASS =D (Well not quite but almost anything)
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
Yes. A function has the following syntax:

JASS:
function Name takes parameters returns variable
endfunction

I guess you figured out what the parameters are, but usually a function also "returns" a variable. This means you can SET a variable to the "result" of a function. For instance:

JASS:
function Sum takes integer a, integer b returns integer
    return (a + b)
endfunction

To use this function, you could simply say:
JASS:
c = Sum(a, b)

Ofcourse, this is a stupid example because you could just as easily say "c = a + b", but in the case of the "AddSpecialEffectTarget" function, the created effect will be returned. Therefor, you could say:

JASS:
set eff[0] = AddSpecialEffectTarget("Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl", caster, "hand, right" )

Any "creation" function (CreateUnit, CreateItem, CreateGroup, AddSpecialEffect, DialogCreate, ...) will return the created object. Other functions will return a "success" boolean, such as UnitAddAbility, which will return false if the ability couldn't be added, etc.



Most other BJ functions have their native equivalent. The equivalent of "DestroyEffectBJ" is "DestroyEffect". An important note is that sometimes, the parameters of the BJ function are given in another order than the native. For instance:

JASS:
function UnitAddAbilitySwapped takes integer abilityid, unit whichunit returns boolean
    return UnitAddAbility(whichunit, abilityid)
endfunction
As you can see, UnitAddAbilitySwapped (or whatever the function is called, I don't have WE opened) has its parameters "swapped", compared to the UnitAddAbility function. But most of the time, removing the "BJ" from the functionname is enough.
 
Thanks! Now I know a bit more about Jass :D

Edit:

JASS:
function Trig_Shdow_Fury_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000'
endfunction

function Trig_Shdow_Fury_Func011Func012C takes nothing returns boolean
    if ( not ( GetUnitStateSwap(UNIT_STATE_LIFE, target) < 60.00 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Shdow_Fury_Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local unit target = GetSpellTargetUnit()
    local effect array eff
    local effect eff2
    local integer i = 0
    local integer iloop = 20
    local location TargetLoc1
    local location TargetLoc2
    local real r 
    call PolledWait( 0.01 )
    call SetUnitInvulnerable( caster, true )
    call PauseUnit ( caster, true )
    call SetUnitTimeScalePercent( caster, 200.00 )
    set eff [1] = AddSpecialEffectTarget ( "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl", caster, "hand, right" )
    set eff [2] = AddSpecialEffectTarget ( "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl", caster, "hand, left" )
    loop
        exitwhen i >= iloop
        call TriggerSleepAction( 0.20 )
        call SetUnitAnimation( caster, "attack" )
        set TargetLoc1 = GetUnitLoc(target)
        call SetUnitPositionLocFacingLocBJ( caster, TargetLoc1, TargetLoc1 )
        call SetUnitFacingToFaceUnitTimed( caster, target, 0 )
        call UnitDamageTargetBJ( caster, target, 50.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
        set eff [3] = AddSpecialEffectTarget( "origin", caster, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
        call DestroyEffectBJ( eff [3] )
        set eff [4] = AddSpecialEffectTarget( "chest", target, "Objects\\Spawnmodels\\Critters\\Albatross\\CritterBloodAlbatross.mdl" )
        call DestroyEffectBJ( eff [4] )
        if ( Trig_Shdow_Fury_Func011Func012C() ) then
            call SetUnitFacingToFaceUnitTimed( caster, target, 0 )
            call SetUnitAnimation( caster, "attack" )
            call PauseUnitBJ( true, target )
            call SetUnitTimeScalePercent( caster, 25.00 )
            call SetUnitTimeScalePercent( target, 10.00 )
            call PolledWait( 1.85 )
            call SetUnitAnimation( target, "death" )
            call AddSpecialEffectTargetUnitBJ( "chest", target, "Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl" )
            call DestroyEffectBJ( GetLastCreatedEffectBJ() )
            set TargetLoc2 = GetUnitLoc(target)
            set eff [5] = AddSpecialEffectLocBJ( TargetLoc2, "Abilities\\Weapons\\MeatwagonMissile\\MeatwagonMissile.mdl" )
            call DestroyEffectBJ( eff [5] )
            call SetUnitTimeScalePercent( target, 100.00 )
            call PolledWait( 0.01 )
            call ExplodeUnitBJ( target )
            call PauseUnitBJ( false, target )
            call PolledWait( 1.00 )
            call ResetUnitAnimation( caster )
            call SetUnitInvulnerable( caster, false )
            call PauseUnitBJ( false, caster )
            call SetUnitTimeScalePercent( caster, 100.00 )
            call DestroyEffect( eff [1] )
            call DestroyEffect( eff [2] )
            return
        else
        endif
        set i = i + 1
    endloop
    call SetUnitInvulnerable( caster, false )
    call PauseUnitBJ( false, caster )
    call ResetUnitAnimation( caster )
    call SetUnitTimeScalePercent( caster, 100.00 )
    call DestroyEffect( eff [1] )
    call DestroyEffect( eff [1] )
endfunction

//===========================================================================
function InitTrig_Shdow_Fury takes nothing returns nothing
    set gg_trg_Shdow_Fury = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Shdow_Fury, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Shdow_Fury, Condition( function Trig_Shdow_Fury_Conditions ) )
    call TriggerAddAction( gg_trg_Shdow_Fury, function Trig_Shdow_Fury_Actions )
endfunction

now i get 2 syntax
line 6 undeclared variable: target
line 80 undeclared variable: gg_trg_Shadow Fury (fourth line from the rear)
 
Last edited:
Level 8
Joined
Mar 23, 2007
Messages
302
for line 6:
in the function Trig_Shdow_Fury_Func011Func012C u have no variable declared
called target, that means in that function target = null, wich means not 0 but means empty.
for line 80:
it looks good, no idea why the problem apears, but mb if u solve line 6 the line 80
will not be anymore.

Edit:
why do u have 2 "call DestroyEffect( eff [1] )" near the end
and why u have a function (Trig_Shdow_Fury_Func011Func012C) u dont even use in this code.

Edit 2:
btw this here
JASS:
function Trig_Shdow_Fury_Func011Func012C takes nothing returns boolean
    if ( not ( GetUnitStateSwap(UNIT_STATE_LIFE, target) < 60.00 ) ) then
        return false
    endif
    return true
endfunction
is tha same as
JASS:
function Trig_Shdow_Fury_Func011Func012C takes nothing returns boolean
return ( GetUnitStateSwap(UNIT_STATE_LIFE, target) < 60.00 )
endfunction
and to make it work i should be like this
JASS:
function Trig_Shdow_Fury_Func011Func012C takes nothing returns boolean
local unit target = "yourParameters"
return ( GetUnitStateSwap(UNIT_STATE_LIFE, target) < 60.00 )
endfunction

Edit 3:
And if u make/find the line that uses
Trig_Shdow_Fury_Func011Func012C
u could write it like this
JASS:
function Trig_Shdow_Fury_Func011Func012C takes unit returns boolean
and in the call/set u could make it like this
JASS:
call Trig_Shdow_Fury_Func011Func012C(target)

but this requiers that the function that calls that function already has a
unit variable called target
 
Its so ugly structured, because it was once GUI(its converted) And this is my "First" atempt to Jass.
You can see the working(GUI) spell here Warcraft III Spells - Shadow Fury - Cinematic Spell

And thanks for help! To all of You!

Edit: now how do i remove the handles?

set caster = null
set target = null
set TargetLoc1 = null

Is this correct?

Edit2:

Now it somehow works, but the loop doesn't happen it should happen 20 times but there is none. Did I fuck up the loop integers or something?

JASS:
function Trig_Shdow_Fury_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000'
endfunction

function Trig_Shdow_Fury_Func011Func012C takes nothing returns boolean
local unit target = GetSpellTargetUnit()
return ( GetUnitStateSwap(UNIT_STATE_LIFE, target) < 60.00 )
endfunction

function Trig_Shdow_Fury_Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local unit target = GetSpellTargetUnit()
    local effect array eff
    local integer i = 0
    local integer iloop = 20
    local location TargetLoc1
    local location TargetLoc2 
    call PolledWait( 0.01 )
    call SetUnitInvulnerable( caster, true )
    call PauseUnit ( caster, true )
    call SetUnitTimeScalePercent( caster, 200.00 )
    set eff [1] = AddSpecialEffectTarget ( "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl", caster, "hand, right" )
    set eff [2] = AddSpecialEffectTarget ( "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl", caster, "hand, left" )
    loop
        exitwhen i > iloop
        call TriggerSleepAction( 0.20 )
        call SetUnitAnimation( caster, "attack" )
        set TargetLoc1 = GetUnitLoc(target)
        call SetUnitPositionLocFacingLocBJ( caster, TargetLoc1, TargetLoc1 )
        call SetUnitFacingToFaceUnitTimed( caster, target, 0 )
        call UnitDamageTargetBJ( caster, target, 50.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
        set eff [3] = AddSpecialEffectTarget( "origin", caster, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
        call DestroyEffect ( eff [3] )
        set eff [4] = AddSpecialEffectTarget( "chest", target, "Objects\\Spawnmodels\\Critters\\Albatross\\CritterBloodAlbatross.mdl" )
        call DestroyEffect ( eff [4] )
        if ( Trig_Shdow_Fury_Func011Func012C() ) then
            call SetUnitFacingToFaceUnitTimed( caster, target, 0 )
            call SetUnitAnimation( caster, "attack" )
            call PauseUnitBJ( true, target )
            call SetUnitTimeScalePercent( caster, 25.00 )
            call SetUnitTimeScalePercent( target, 10.00 )
            call PolledWait( 1.85 )
            call SetUnitAnimation( target, "death" )
            set eff [5] = AddSpecialEffectTarget( "chest", target, "Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl" )
            call DestroyEffect ( eff [5] )
            set TargetLoc2 = GetUnitLoc(target)
            set eff [6] = AddSpecialEffectLocBJ( TargetLoc2, "Abilities\\Weapons\\MeatwagonMissile\\MeatwagonMissile.mdl" )
            call DestroyEffectBJ( eff [6] )
            call SetUnitTimeScalePercent( target, 100.00 )
            call PolledWait( 0.01 )
            call ExplodeUnitBJ( target )
            call PauseUnitBJ( false, target )
            call PolledWait( 1.00 )
            call ResetUnitAnimation( caster )
            call SetUnitInvulnerable( caster, false )
            call PauseUnitBJ( false, caster )
            call SetUnitTimeScalePercent( caster, 100.00 )
            call DestroyEffect( eff [1] )
            call DestroyEffect( eff [2] )
            set target = null
            set caster = null
            set TargetLoc1 = null
            set TargetLoc2 = null
            return
        else
        endif
        set i = i + 1
    endloop
    call SetUnitInvulnerable( caster, false )
    call PauseUnitBJ( false, caster )
    call ResetUnitAnimation( caster )
    call SetUnitTimeScalePercent( caster, 100.00 )
    call DestroyEffect( eff [1] )
    call DestroyEffect( eff [2] )
    set target = null
    set caster = null
    set TargetLoc1 = null
endfunction
            
//===========================================================================
function InitTrig_Shdow_Fury takes nothing returns nothing
    set gg_trg_Shdow_Fury = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Shdow_Fury, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Shdow_Fury, Condition( function Trig_Shdow_Fury_Conditions ) )
    call TriggerAddAction( gg_trg_Shdow_Fury, function Trig_Shdow_Fury_Actions )
endfunction
 
Last edited:
Level 40
Joined
Dec 14, 2005
Messages
10,532
Completely optimized from the original version:

I'm not going to go over everything I did, but basically, remove useless ifs, you don't need else, use x/y rather than locs, inline, anti-bj,and so on.

JASS:
function Trig_Shdow_Fury_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000'
endfunction

function Trig_Shdow_Fury_Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local unit target = GetSpellTargetUnit()
    local effect eff
    local effect eff2
    local integer i = 0
    call PolledWait(.01)
    call SetUnitInvulnerable(caster,true)
    call PauseUnit(caster,true)
    call SetUnitTimeScale(caster,2.)
    set eff = AddSpecialEffectTarget("Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl",caster,"hand right")
    set eff2 = AddSpecialEffectTarget("Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl",caster,"hand left")
    loop
        exitwhen i >= 20
        call TriggerSleepAction(.20)
        call SetUnitAnimation(caster,"attack")
        call SetUnitPosition(caster,GetUnitX(target),GetUnitY(target))
        call SetUnitFacing(caster,Atan2(GetUnitY(target)-GetUnitY(caster),GetUnitX(target)-GetUnitX(caster))*bj_RADTODEG)
        call UnitDamageTarget(caster,target,50.,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,null)
        call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl",caster,"origin"))
        call DestroyEffect(AddSpecialEffectTarget("Objects\\Spawnmodels\\Critters\\Albatross\\CritterBloddAlbatross.mdl",target,"chest"))
        if GetWidgetLife(target) < 60. then
            call SetUnitAnimation(caster,"attack")
            call PauseUnit(target,true)
            call SetUnitTimeScale(caster,.25)
            call SetUnitTimeScale(target,.1)
            call PolledWait(1.85)
            call SetUnitAnimation(target,"death")
            call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl",target,"chest"))
            call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\MeatwagonMissile\\MeatwagonMissile.mdl",GetUnitX(target),GetUnitY(target)))
            call SetUnitTimeScale(target,1.)
            call PolledWait(.01)
            call SetUnitExploded(target,true)
            call KillUnit(target)
            call PolledWait(1.)
            exitwhen true
        endif
        set i = i + 1
    endloop
    call SetUnitAnimation(caster,"stand")
    call SetUnitInvulnerable(caster,false)
    call PauseUnit(caster,false)
    call SetUnitTimeScale(caster,1.)
    call DestroyEffect(eff)
    call DestroyEffect(eff2)
    set eff = null
    set eff2 = null
    set caster = null
    set target = null
endfunction

function InitTrig_Shdow_Fury takes nothing returns nothing
    set gg_trg_Shdow_Fury = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_Shdow_Fury,EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(gg_trg_Shdow_Fury,Condition(function Trig_Shdow_Fury_Conditions))
    call TriggerAddAction(gg_trg_Shdow_Fury,function Trig_Shdow_Fury_Actions)
endfunction
 
Status
Not open for further replies.
Top