Alright this shouldn't be hard for experienced jass-users out there so all help is appreciated. I made this trigger in gui and want to convert it to jass to optimize, simplify, and make it faster. Rather, I already converted it to jass but it is the choppy editor conversion. So here is the code:
So any ideas to make this simpler? And a reason for why you change this and use that instead would be helpful, I am trying to learn here ;].
JASS:
function Trig_Masters_Influence_Conditions takes nothing returns boolean
if ( not ( UnitHasBuffBJ(GetAttacker(), 'B000') == true ) ) then
return false
endif
return true
endfunction
function Trig_Masters_Influence_Func002001003 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == false )
endfunction
function Trig_Masters_Influence_Func002Func001C takes nothing returns boolean
if ( not ( GetPlayerController(GetOwningPlayer(GetEnumUnit())) != MAP_CONTROL_USER ) ) then
return false
endif
return true
endfunction
function Trig_Masters_Influence_Func002A takes nothing returns nothing
if ( Trig_Masters_Influence_Func002Func001C() ) then
call IssueTargetOrderBJ( GetEnumUnit(), "attack", GetAttackedUnitBJ() )
call AddSpecialEffectTargetUnitBJ( "overhead", GetEnumUnit(), "Abilities\\Spells\\Other\\TalkToMe\\TalkToMe.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
else
endif
endfunction
function Trig_Masters_Influence_Actions takes nothing returns nothing
set udg_p = GetUnitLoc(GetAttacker())
call ForGroupBJ( GetUnitsInRangeOfLocMatching(250.00, udg_p, Condition(function Trig_Masters_Influence_Func002001003)), function Trig_Masters_Influence_Func002A )
endfunction
//===========================================================================
function InitTrig_Masters_Influence takes nothing returns nothing
set gg_trg_Masters_Influence = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Masters_Influence, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Masters_Influence, Condition( function Trig_Masters_Influence_Conditions ) )
call TriggerAddAction( gg_trg_Masters_Influence, function Trig_Masters_Influence_Actions )
endfunction
So any ideas to make this simpler? And a reason for why you change this and use that instead would be helpful, I am trying to learn here ;].