- Joined
- Jun 27, 2009
- Messages
- 10
Got a problem with this one. The sell-system works fine on one tower but when I select 2 or more towers. It only sell one tower by one tower instead of all of them straight. anything i have to adjust? 
function Trig_Sell_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A003'
endfunction
function Trig_Sell_Actions takes nothing returns nothing
local effect e
local unit shop = GetTriggerUnit()
set e = AddSpecialEffectLoc( "war3mapImported\\StarfallCaster.mdx" , GetUnitLoc( shop ))
call PauseUnit(shop, true)
call TriggerSleepAction( 2.50 )
call AdjustPlayerStateBJ( GetUnitPointValue(shop), GetOwningPlayer(shop), PLAYER_STATE_RESOURCE_GOLD )
call KillUnit( shop )
call DestroyEffect( e )
set e = null
set shop = null
endfunction
//===========================================================================
function InitTrig_Sell takes nothing returns nothing
set gg_trg_Sell = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Sell, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Sell, Condition( function Trig_Sell_Conditions ) )
call TriggerAddAction( gg_trg_Sell, function Trig_Sell_Actions )
endfunction
Oh and make sure to change the condition in your GUI trigger or that will fire the same time as the JASS one..