View Single Post
Old 01-22-2010, 08:28 PM   #8
Michael Peppers
Lepus?
 
Michael Peppers's Avatar
 
Join Date: Jan 2009
Posts: 1,308

Michael Peppers is a jewel in the rough (188)Michael Peppers is a jewel in the rough (188)Michael Peppers is a jewel in the rough (188)

Default

Quote:
Originally Posted by Sunwarrior25
Alright. Here's what I've got. Gonna test to see if it works:
Collapse JASS:
function Trig_Interact_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A600' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Interact_Actions takes nothing returns nothing

if GetSpellTargetDestructable() != null then

        call ConditionalTriggerExecute( gg_trg_DestCheck )

    elseif GetSpellTargetUnit() != null then

        call ConditionalTriggerExecute( gg_trg_UnitCheck )

    endif

endfunction

//===========================================================================
function InitTrig_Interact takes nothing returns nothing
    set gg_trg_Interact = CreateTrigger(  )
    call TriggerRegisterPlayerUnitEventSimple( gg_trg_Interact, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Interact, Condition( function Trig_Interact_Conditions ) )
    call TriggerAddAction( gg_trg_Interact, function Trig_Interact_Actions )
endfunction

EDIT: It works, but the ability itself is checking to see if destructibles (like crates) are occupied by owls... What should I set the 'targets allowed' to?

EDIT2: Should I use Channel instead of Purge as a base?

Uhm, can we see UnitCheck and DestCheck?
Targets allowed should be: "Air, Land, Neutral, Ally, Alive, Mechanical unit, Friend, Organic, Object (and *maybe* Enemy)" (if I got what you mean)

Anyway...
Collapse JASS:
function Trig_Interact_Conditions takes nothing returns boolean
return (GetSpellAbilityId() == 'A600')
endfunction
It's better this way
__________________
Projects:Tutorials: Competitive AI Step by Step with AI Editor (Pending)
Resources: [AI Script] Michael Peppers's Melee AI template (Pending)
Michael Peppers is offline   Reply With Quote