- Joined
- Aug 4, 2008
- Messages
- 279
Hey, i converted to custom script, understanded everything, BUT, still have a bug that i cant understand.
Says the problem is Expecting a name.Here is the line with the problem.
JASS:
function Trig_Green_Press_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A000' ) ) then
return false
endif
return true
endfunction
function Trig_Green_Press_Actions takes nothing returns nothing
local integer array greeninteger
local unit array greenunit
local integer array streaks
set greeninteger[1] = ( greeninteger[1] + 1 )
call CreateNUnitsAtLoc( 1, 'h000', GetTriggerPlayer(), GetRectCenter(gg_rct_Explode_Green), bj_UNIT_FACING )
set greenunit[greeninteger[1]] = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', greenunit[greeninteger[1]] )
set streaks[GetConvertedPlayerId(GetOwningPlayer(greenunit[greeninteger[1]]))] = (streaks[GetConvertedPlayerId(GetOwningPlayer(greenunit[greeninteger[1]]))] - 1 )
call LeaderboardSetPlayerItemValueBJ( GetOwningPlayer(udg_GreenUnit[greeninteger[1]]), GetLastCreatedLeaderboard(), streaks[GetConvertedPlayerId(GetOwningPlayer(greenunit[greeninteger[1]]))] )
call LeaderboardSortItemsBJ( GetLastCreatedLeaderboard(), bj_SORTTYPE_SORTBYVALUE, false )
endfunction
//===========================================================================
function InitTrig_Green_Press takes nothing returns nothing
set gg_trg_Green_Press = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Green_Press, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Green_Press, Condition( function Trig_Green_Press_Conditions ) )
call TriggerAddAction( gg_trg_Green_Press, function Trig_Green_Press_Actions )
endfunction
JASS:
call LeaderboardSetPlayerItemValueBJ( GetOwningPlayer(udg_GreenUnit[greeninteger[1]]), GetLastCreatedLeaderboard(), streaks[GetConvertedPlayerId(GetOwningPlayer(greenunit[greeninteger[1]]))] )