wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 04-09-2016, 07:50 PM   #1
Royalflare
User
 
Join Date: Jan 2015
Posts: 3

Royalflare has little to show at this moment (0)

Question Could Anyone Help with convert formats

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
Royalflare is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 08-05-2016, 10:25 PM   #2
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

What do you mean by standard formats? vJass is the standard.
__________________
Anitarf is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 08:53 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services