HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Could Anyone Help with convert formats

04-09-2016, 06:50 PM#1
Royalflare
Hello,I want to make some ability with vJass,I found A Part of Sourcecode about this ability,but I can't readable and understand them.Could anyone help me convert to standard formats? Thanks Very Much!
Collapse JASS:
library AISystem initializer init
globals
    constant boolean LIBRARY_AISystem=true
    private trigger AISystemTrig=CreateTrigger()
    private trigger AISystem__trig=CreateTrigger()
    private boolexpr AISystem__heroFilter
    private boolexpr AISystem__SMARTAI_FILTER
endglobals

function AISystem__heroFilterFunc takes nothing returns boolean
local unit t=GetFilterUnit()
if(IsUnitType(t,UNIT_TYPE_HERO)and GetUnitAbilityLevel(t,'Avul')!==0 and GetWidgetLife(t)>0.405)then
call UnitDamageTarget(tempUnit,t,tempReal,true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
endif
return false
endfunction
function AISystem__SmartAIFilterFunc takes nothing returns boolean
local unit t=GetFilterUnit()
return(GetWidgetLife(t)>0.405 and UnitHasBuffBJ(t,'Bvul')==false and IsUnitEnemy(t,Player($C))and IsUnitType(t,UNIT_TYPE_STRUCTURE))!=null
endfunction
function AISystem_SmartAITargetXY takes real x,real y,real distance returns unit
local group g=NewGroup()
call GroupEnumUnitsInRange(g,x,y,distance,AISystem__SMARTAI_FILTER)
set bj_groupRandomConsidered=0
set bj_groupRandomCurrentPick=null
call ForGroup(g,function GroupPickRandomUnitEnum)
call ReleaseGroup(g)
return bj_groupRandomCurrentPick
endfunction
function AISystem_SmartAITarget takes unit l__caster,real distance returns unit
local group g=NewGroup()
call GroupEnumUnitsInRange(g,GetUnitX(l__caster),GetUnitY(l__caster),distance,AISystem__SMARTAI_FILTER)
set bj_groupRandomConsidered=0
set bj_groupRandomCurrentPick=null
call ForGroup(g,function GroupPickRandomUnitEnum)
call ReleaseGroup(g)
return bj_groupRandomCurrentPick
endfunction
function AISystem_TargetAbility takes unit l__caster,unit l__target,integer spellId,string order returns nothing
local unit d=CreateUnit(GetOwningPlayer(l__caster),'h000',GetUnitX(l__caster),GetUnitY(l__caster),0)
call UnitAddAbility(d,spellId)
call IssueTargetOrder(d,order,l__target)
endfunction
function AISystem_TargetAbilityLevel takes unit l__caster,unit l__target,integer spellId,string order,integer level returns nothing
local unit d=CreateUnit(GetOwningPlayer(l__caster),'h000',GetUnitX(l__caster),GetUnitY(l__caster),0)
call UnitAddAbility(d,spellId)
call SetUnitAbilityLevel(d,spellId,level)
call IssueTargetOrder(d,order,l__target)
endfunction
function AISystem_PointAbility takes unit l__caster,real x,real y,integer spellId,string order returns nothing
local unit d=CreateUnit(GetOwningPlayer(l__caster),'h000',GetUnitX(l__caster),GetUnitY(l__caster),0)
call UnitAddAbility(d,spellId)
call IssuePointOrder(d,order,x,y)
set d=null
endfunction
function AISystem_PointAbilityId takes unit l__caster,real x,real y,integer spellId,integer order returns nothing
local unit d=CreateUnit(GetOwningPlayer(l__caster),'h000',GetUnitX(l__caster),GetUnitY(l__caster),0)
call UnitAddAbility(d,spellId)
call IssuePointOrderById(d,order,x,y)
set d=null
endfunction
function AISystem_PointAbilityLevel takes unit l__caster,real x,real y,integer spellId,string order,integer level returns nothing
local unit d=CreateUnit(GetOwningPlayer(l__caster),'h000',GetUnitX(l__caster),GetUnitY(l__caster),0)
call UnitAddAbility(d,spellId)
call SetUnitAbilityLevel(d,spellId,level)
call IssuePointOrder(d,order,x,y)
set d=null
endfunction
function CastSpellTarget takes unit l__caster,integer data,unit l__target returns nothing
local unit u=CreateUnit(GetOwningPlayer(l__caster),'h000',GetUnitX(l__target),GetUnitY(l__target),0)
call UnitAddAbility(u,s__AbilityData_abilityId[data])
call SetUnitAbilityLevel(u,s__AbilityData_abilityId[data],s__AbilityData_level[data])
call IssueTargetOrder(u,s__AbilityData_orderStr[data],l__target)
call UnitApplyTimedLife(u,'BTLF',2.5)
endfunction
function init takes nothing returns nothing
set AISystem__heroFilter=Condition(function AISystem__heroFilterFunc)
set AISystem__SMARTAI_FILTER=Condition(function AISystem__SmartAIFilterFunc)
call TriggerAddCondition(AISystemTrig,Condition(function AISystem_RunAI))
set AISystemTrig=null
endfunction

endlibrary
08-05-2016, 09:25 PM#2
Anitarf
What do you mean by standard formats? vJass is the standard.