• 🏆 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!

[Solved] Trigger Ability not Working

Status
Not open for further replies.
Level 3
Joined
Mar 20, 2010
Messages
40
  • function Trig_Untitled_Trigger_004_Copy_Copy_Conditions takes nothing returns boolean
    • if ( not ( GetSpellAbilityId() == 'A00B' ) ) then
      • return false
    • endif
    • return true
  • endfunction
  • function Trig_Untitled_Trigger_004_Copy_Copy_Actions takes nothing returns nothing
    • call PauseUnitBJ( true, GetTriggerUnit() )
    • call SetUnitAnimation( GetTriggerUnit(), "spell one" )
    • call PauseUnitBJ( false, GetTriggerUnit() )
    • call CreateNUnitsAtLoc( 1, 'h000', GetOwningPlayer(GetTriggerUnit()), GetRandomLocInRect(GetEntireMapRect()), bj_UNIT_FACING )
    • call IssuePointOrderLocBJ( GetLastCreatedUnit(), "rainoffire", GetUnitLoc(GetTriggerUnit()) )
    • call UnitApplyTimedLifeBJ( 20.00, 'BTLF', GetLastCreatedUnit() )
    • call CreateNUnitsAtLoc( 1, 'h002', GetOwningPlayer(GetTriggerUnit()), GetRandomLocInRect(GetEntireMapRect()), bj_UNIT_FACING )
    • call IssuePointOrderLocBJ( GetLastCreatedUnit(), "rainoffire", GetUnitLoc(GetTriggerUnit()) )
    • call UnitApplyTimedLifeBJ( 20.00, 'BTLF', GetLastCreatedUnit() )
  • endfunction
  • //===========================================================================
  • function InitTrig_Untitled_Trigger_004_Copy_Copy takes nothing returns nothing
    • set gg_trg_Untitled_Trigger_004_Copy_Copy = CreateTrigger( )
    • call TriggerRegisterAnyUnitEventBJ( gg_trg_Untitled_Trigger_004_Copy_Copy, EVENT_PLAYER_UNIT_SPELL_FINISH )
    • call TriggerAddCondition( gg_trg_Untitled_Trigger_004_Copy_Copy, Condition( function Trig_Untitled_Trigger_004_Copy_Copy_Conditions ) )
    • call TriggerAddAction( gg_trg_Untitled_Trigger_004_Copy_Copy, function Trig_Untitled_Trigger_004_Copy_Copy_Actions )
  • endfunction
It's supposed to make 2 dummy units that cast Rain of Chaos onto the caster after casting a channel ability. I don't know why it doesn't work. Also I don't know how to paste triggers. I've been trying to figure this out for a bit of time now.:ogre_rage:
 
Level 3
Joined
Mar 20, 2010
Messages
40
It's a GUI trigger. I turned it into a custom text. But here.
JASS:
function Trig_Untitled_Trigger_004_Copy_Copy_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A00B' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Untitled_Trigger_004_Copy_Copy_Actions takes nothing returns nothing
    call PauseUnitBJ( true, GetTriggerUnit() )
    call SetUnitAnimation( GetTriggerUnit(), "spell one" )
    call PauseUnitBJ( false, GetTriggerUnit() )
    call CreateNUnitsAtLoc( 1, 'h000', GetOwningPlayer(GetTriggerUnit()), GetRandomLocInRect(GetEntireMapRect()), bj_UNIT_FACING )
    call IssuePointOrderLocBJ( GetLastCreatedUnit(), "rainoffire", GetUnitLoc(GetTriggerUnit()) )
    call UnitApplyTimedLifeBJ( 20.00, 'BTLF', GetLastCreatedUnit() )
    call CreateNUnitsAtLoc( 1, 'h002', GetOwningPlayer(GetTriggerUnit()), GetRandomLocInRect(GetEntireMapRect()), bj_UNIT_FACING )
    call IssuePointOrderLocBJ( GetLastCreatedUnit(), "rainoffire", GetUnitLoc(GetTriggerUnit()) )
    call UnitApplyTimedLifeBJ( 20.00, 'BTLF', GetLastCreatedUnit() )
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_004_Copy_Copy takes nothing returns nothing
    set gg_trg_Untitled_Trigger_004_Copy_Copy = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Untitled_Trigger_004_Copy_Copy, EVENT_PLAYER_UNIT_SPELL_FINISH )
    call TriggerAddCondition( gg_trg_Untitled_Trigger_004_Copy_Copy, Condition( function Trig_Untitled_Trigger_004_Copy_Copy_Conditions ) )
    call TriggerAddAction( gg_trg_Untitled_Trigger_004_Copy_Copy, function Trig_Untitled_Trigger_004_Copy_Copy_Actions )
endfunction

I fixed it. I replaced "rainoffire" with "rainofchaos".
 
Last edited by a moderator:
Status
Not open for further replies.
Top