Page 1 of 1

[Request] Tool For Separating GlobalsInit

Posted: October 19th, 2012, 3:15 pm
by JustANewbie
i'm requesting for a tool that can separate the trigger into part by part just like GUI trigger but in JASS

Re: [Request] Tool For Separating GlobalsInit

Posted: October 19th, 2012, 5:35 pm
by Bartimaeus
If you can read JASS, you won't really need this to begin with...

Re: [Request] Tool For Separating GlobalsInit

Posted: October 20th, 2012, 4:33 am
by JustANewbie
i can read but i can't write, i need this tool so that the script would not be too long that will confuse me and took me for hours for a trigger, for example a ability trigger

Re: [Request] Tool For Separating GlobalsInit

Posted: October 20th, 2012, 6:34 am
by Bartimaeus
I don't understand how this is going to help with that, exactly. You'll still have to either use the search function or look through the coding manually to find what you want, regardless if there's empty spaces between separate triggers...

Re: [Request] Tool For Separating GlobalsInit

Posted: October 20th, 2012, 2:00 pm
by JustANewbie
sometimes i don't even know when is a trigger start or end

Re: [Request] Tool For Separating GlobalsInit

Posted: October 20th, 2012, 9:57 pm
by Bartimaeus
function ...
endfunction

Re: [Request] Tool For Separating GlobalsInit

Posted: October 21st, 2012, 6:13 am
by JustANewbie
sometimes after endfunction just start action

Re: [Request] Tool For Separating GlobalsInit

Posted: October 21st, 2012, 8:44 am
by Bartimaeus
Really? For example?

Re: [Request] Tool For Separating GlobalsInit

Posted: October 21st, 2012, 12:51 pm
by JustANewbie
just a spell trigger

Spoiler:
function g7 takes nothing returns boolean
return(GetSpellAbilityId()=='A123')
endfunction

function G7 takes nothing returns boolean
return(IsUnitInGroup(GetTriggerUnit(),udg_group29)==false)
endfunction

function h7 takes nothing returns boolean
return(GetHeroStatBJ(1,udg_units08[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],true)>GetHeroStatBJ(1,udg_units09[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],true))
endfunction

function H7 takes nothing returns nothing
call GroupAddUnit(udg_group37,GetTriggerUnit())
set udg_units08[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=GetTriggerUnit()
set udg_units09[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=GetSpellTargetUnit()
call PauseUnit(udg_units08[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],true)
call PauseUnit(udg_units09[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],true)
call SetUnitInvulnerable(udg_units08[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],true)
call SetUnitInvulnerable(udg_units09[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],true)
set bj_forLoopBIndex=1
set bj_forLoopBIndexEnd=3
loop
exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
call SetUnitVertexColorBJ(udg_units08[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],100,100,100,100.)
call GF(.2)
call SetUnitPositionLocFacingLocBJ(udg_units08[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],GetRandomLocInRect(RectFromCenterSizeBJ(GetUnitLoc(udg_units09[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]),60.,60.)),GetUnitLoc(udg_units09[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]))
call GF(.2)
call SetUnitVertexColorBJ(udg_units08[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],100,100,100,.0)
call GF(.2)
set bj_forLoopBIndex=bj_forLoopBIndex+1
endloop
call SetUnitAnimation(udg_units08[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],"attack")
call GF(.2)
if(G7())then
call PauseUnit(udg_units08[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],false)
endif
call PauseUnit(udg_units09[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],false)
call GroupRemoveUnit(udg_group37,GetTriggerUnit())
call SetUnitInvulnerable(udg_units08[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],false)
call SetUnitInvulnerable(udg_units09[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],false)
if(h7())then
set udg_real01=((I2R(GetHeroStatBJ(1,udg_units08[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],true))-I2R(GetHeroStatBJ(1,udg_units09[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],true)))*(1.*I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(),udg_units08[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]))))
call UnitDamageTargetBJ(udg_units08[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],udg_units09[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],udg_real01,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_ENHANCED)
endif
endfunction