Well actually I had either posted wrong or just forgot the last part the first time, this is actually the entire trigger.
I added
to the globals, and added
Code: Select all
function InitTrig_greed takes nothing returns nothing
set gg_trg_greed = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_greed, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_greed, Condition( function Trig_greed_Conditions ) )
call TriggerAddAction( gg_trg_greed, function Trig_greed_Actions )
endfunction
in the functions
Than added the
Code: Select all
function Trig_greed_Conditions takes nothing returns boolean
if ( not ( GetItemOfTypeFromUnitBJ(GetTriggerUnit(), 'I00E') == GetManipulatedItem() ) ) then
return false
endif
return true
endfunction
function Trig_greed_Actions takes nothing returns nothing
call SetItemDroppableBJ( GetManipulatedItem(), true )
call UnitRemoveItemSwapped( GetManipulatedItem(), GetTriggerUnit() )
call UnitAddItemByIdSwapped( 'I00E', GetTriggerUnit() )
endfunction
part in, and when I saved and did a syntax check, I got 2 errors.
Line 488: Undefined function.
Line 489: Undefined function.
Line 488 being
Code: Select all
call TriggerRegisterAnyUnitEventBJ( gg_trg_greed, EVENT_PLAYER_UNIT_USE_ITEM )
Line 489 being
Code: Select all
call TriggerAddCondition( gg_trg_greed, Condition( function Trig_greed_Conditions ) )
This is probably something simple, to someone with even a little skill with JASS =S