Newbie trigger not working properly

shinami

Redirect your complaints to the nearest wall
Reaction score
47
Ok so here's the trigger.. i only started jass yesterday so there must be a lot of wrong stuff here:


JASS:

//===========================================================================
function Trig_Untitled_Trigger_004_Actions takes nothing returns nothing
    call AddSpecialEffectTargetUnitBJ( "left hand", GetAttackedUnitBJ(), "Abilities\\Spells\\Orc\\Purge\\PurgeBuffTarget.mdl" )
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_004 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_004 = CreateTrigger(  )
    call TriggerRegisterUnitLifeEvent( gg_trg_Untitled_Trigger_004, gg_unit_nchw_0012, LESS_THAN, 150.00 )
    call TriggerAddAction( gg_trg_Untitled_Trigger_004, function Trig_Untitled_Trigger_004_Actions )
endfunction

function Trig_Untitled_Trigger_005 takes nothing returns nothing
local effect s= AddSpecialEffect("PurgeBuffTarget.mdl", 212, 212)
local unit a= gg_unit_nchw_0012
call AddSpecialEffectTargetUnitBJ( "left hand" , GetAttackedUnitBJ(), "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl" )
call DestroyEffect (s)
set s= null

endfunction

function UnitLife takes nothing returns nothing
set gg_trg_Untitled_Trigger_005 = CreateTrigger(  )
call TriggerRegisterUnitLifeEvent( gg_trg_Untitled_Trigger_004, gg_unit_nchw_0012, GREATER_THAN_OR_EQUAL, 70.00 )
call TriggerAddAction( gg_trg_Untitled_Trigger_005, function Trig_Untitled_Trigger_005 )

endfunction


The part that's not working properly is this

JASS:
function Trig_Untitled_Trigger_005 takes nothing returns nothing
local effect s= AddSpecialEffect("PurgeBuffTarget.mdl", 212, 212)
local unit a= gg_unit_nchw_0012
call AddSpecialEffectTargetUnitBJ( "left hand" , GetAttackedUnitBJ(), "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl" )
call DestroyEffect (s)
set s= null

endfunction


Nor does the purge dissapear nor does the thunderclap appear.. Solutions?
 

T.s.e

Wish I was old and a little sentimental
Reaction score
133
JASS:
function Trig_Untitled_Trigger_005 takes nothing returns nothing
//Not too sure about the path here...
local unit a= gg_unit_nchw_0012
call DestroyEffect( AddSpecialEffect("Abilities\\Spells\\Orc\\Purge\\PurgeBuffTarget.mdl", 212, 212))
//TargetUnitBJ... This will immediately destroy the special effect, but it still shows.
call DestroyEffect( AddSpecialEffectTarget( "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl", a, "hand left"))
set a = null

endfunction
 
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