|
发表于 2015-2-12 15:50:45
|
显示全部楼层
本帖最后由 RoyalFlare 于 2015-2-12 16:01 编辑
- scope KiritoAOE initializer KiritoAOE__init
- globals
- private constant real KiritoAOE__DISTANCE=18
- private constant real KiritoAOE__RADIUS=400
- private constant integer KiritoAOE__SPELLID='A012'
- private constant integer KiritoAOE__OODAMABALL='h0C9'
- private constant integer KiritoAOE__ICENOVA='h0A5'
- private constant integer KiritoAOE__ICENOVA1='h0A7'
- private constant integer KiritoAOE__EFFECTID='A0EC'
- private constant integer KiritoAOE__EFFECTID1='A0EB'
- private constant integer si__KiritoAOE__data=48
- private integer si__KiritoAOE__data_F=0
- private integer si__KiritoAOE__data_I=0
- private integer array si__KiritoAOE__data_V
- endglobals
- private function s__KiritoAOE__data__allocate takes nothing returns integer
- local integer this=si__KiritoAOE__data_F
- if(this!=0)then
- set si__KiritoAOE__data_F=si__KiritoAOE__data_V[this]
- else
- set si__KiritoAOE__data_I=si__KiritoAOE__data_I+1
- set this=si__KiritoAOE__data_I
- endif
- if(this>8190)then
- call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,1000.,"Unable to allocate id for an object of type: KiritoAOE__data")
- return 0
- endif
- set si__KiritoAOE__data_V[this]=-1
- return this
- endfunction
- private function s__KiritoAOE__data_deallocate takes integer this returns nothing
- if this==null then
- call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,1000.,"Attempt to destroy a null struct of type: KiritoAOE__data")
- return
- elseif(si__KiritoAOE__data_V[this]!=-1)then
- call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,1000.,"Double free of type: KiritoAOE__data")
- return
- endif
- set si__KiritoAOE__data_V[this]=si__KiritoAOE__data_F
- set si__KiritoAOE__data_F=this
- endfunction
- private struct data
- unit array s__KiritoAOE__data_c
- real array s__KiritoAOE__data_targetx
- real array s__KiritoAOE__data_targety
-
- method function s__KiritoAOE__data_destroy takes integer this returns nothing
- call UnitRemoveAbility(s__KiritoAOE__data_c[this],KiritoAOE__EFFECTID)
- call UnitRemoveAbility(s__KiritoAOE__data_c[this],KiritoAOE__EFFECTID1)
- call s__KiritoAOE__data_deallocate(this)
- endmethod
- static method function s__KiritoAOE__data_Boolean takes nothing returns boolean
- return true
- endmethod
- static method function s__KiritoAOE__data_FinalTimer takes nothing returns nothing
- local timer z=GetExpiredTimer()
- local integer this=(LoadInteger(ht,0,GetHandleId((z))))
- local group g
- local unit v
- local real a
- local real r=(GetUnitAbilityLevel(s__KiritoAOE__data_c[this],KiritoAOE__SPELLID)*100)
- call PauseUnit(s__KiritoAOE__data_c[this],false)
- call SetUnitInvulnerable(s__KiritoAOE__data_c[this],false)
- call SetUnitPathing(s__KiritoAOE__data_c[this],true)
- call SetUnitTimeScale(s__KiritoAOE__data_c[this],1)
- call DustWave(0.4,0.12,1.0,20,s__KiritoAOE__data_targetx[this],s__KiritoAOE__data_targety[this],155,255,255,30)
- set g=NewGroup()
- call GroupEnumUnitsInRange(g,s__KiritoAOE__data_targetx[this],s__KiritoAOE__data_targety[this],KiritoAOE__RADIUS,Filter(function s__KiritoAOE__data_Boolean))
- loop
- set v=FirstOfGroup(g)
- exitwhen v==null
- if FilterGeneral(s__KiritoAOE__data_c[this],v)then
- set a=Angle(s__KiritoAOE__data_targetx[this],s__KiritoAOE__data_targety[this],GetUnitX(v),GetUnitY(v))
- call DamageTarget(s__KiritoAOE__data_c[this],v,r,TAIJUTSU_DAMAGE)
- call SlideUnitAngle(v,0,0,a,"")
- call SetUnitAnimation(v,"death")
- endif
- call GroupRemoveUnit(g,v)
- endloop
- call ReleaseGroup(g)
- call SetUnitAnimation(s__KiritoAOE__data_c[this],"attack")
- call EffectUnitColor(s__KiritoAOE__data_c[this],s__KiritoAOE__data_targetx[this],s__KiritoAOE__data_targety[this],GetUnitFacing(s__KiritoAOE__data_c[this]),3,KiritoAOE__OODAMABALL,1,255,255,255,255)
- call EffectUnitColor(s__KiritoAOE__data_c[this],s__KiritoAOE__data_targetx[this],s__KiritoAOE__data_targety[this],GetUnitFacing(s__KiritoAOE__data_c[this]),2,KiritoAOE__ICENOVA,1,255,255,255,255)
- call EffectUnitColor(s__KiritoAOE__data_c[this],s__KiritoAOE__data_targetx[this],s__KiritoAOE__data_targety[this],GetUnitFacing(s__KiritoAOE__data_c[this]),3,KiritoAOE__ICENOVA1,1,255,255,255,255)
- call ReleaseTimer(z)
- call s__KiritoAOE__data_destroy(this)
- endmethod
- static method function s__KiritoAOE__data_TimerExpired takes nothing returns nothing
- local timer z=GetExpiredTimer()
- local integer this=(LoadInteger(ht,0,GetHandleId((z))))
- local real a=Angle(GetUnitX(s__KiritoAOE__data_c[this]),GetUnitY(s__KiritoAOE__data_c[this]),s__KiritoAOE__data_targetx[this],s__KiritoAOE__data_targety[this])
- local real x=(((GetUnitX(s__KiritoAOE__data_c[this]))*1.0)+((KiritoAOE__DISTANCE)*1.0)*Cos(((a)*1.0)*bj_DEGTORAD))
- local real y=(((GetUnitY(s__KiritoAOE__data_c[this]))*1.0)+((KiritoAOE__DISTANCE)*1.0)*Sin(((a)*1.0)*bj_DEGTORAD))
- local real r=50
- if IsTerrainPathable(x,y,PATHING_TYPE_FLYABILITY)==false then
- call SetUnitPosition(s__KiritoAOE__data_c[this],x,y)
- else
- call SetUnitAnimation(s__KiritoAOE__data_c[this],"attack")
- call TimerStart(z,0.1,false,function s__KiritoAOE__data_FinalTimer)
- endif
- if Distance(x,y,s__KiritoAOE__data_targetx[this],s__KiritoAOE__data_targety[this])<=100 then
- call SetUnitAnimation(s__KiritoAOE__data_c[this],"attack")
- call TimerStart(z,0.1,false,function s__KiritoAOE__data_FinalTimer)
- endif
- endmethod
- static method function s__KiritoAOE__data_create takes unit caster,real x,real y returns integer
- local timer z=(NewTimerEx(0))
- local integer this=s__KiritoAOE__data__allocate()
- set s__KiritoAOE__data_c[this]=caster
- set s__KiritoAOE__data_targetx[this]=x
- set s__KiritoAOE__data_targety[this]=y
- call PauseUnit(s__KiritoAOE__data_c[this],true)
- call SetUnitInvulnerable(s__KiritoAOE__data_c[this],true)
- call SetUnitPathing(s__KiritoAOE__data_c[this],false)
- call SetUnitAnimationByIndex(s__KiritoAOE__data_c[this],1)
- call SaveInteger(ht,0,GetHandleId((z)),(this))
- call SetUnitAnimation(s__KiritoAOE__data_c[this],"attack")
- call SetUnitTimeScale(s__KiritoAOE__data_c[this],0)
- call UnitAddAbility(s__KiritoAOE__data_c[this],KiritoAOE__EFFECTID)
- call UnitAddAbility(s__KiritoAOE__data_c[this],KiritoAOE__EFFECTID1)
- call SoundStart("war3mapImported\\KiritoWhak2.mp3",GetUnitX(s__KiritoAOE__data_c[this]),GetUnitY(s__KiritoAOE__data_c[this]))
- call TimerStart(z,0.02,true,function s__KiritoAOE__data_TimerExpired)
- return this
- endmethod
- endstruct
- private function KiritoAOE__Conditions takes nothing returns boolean
- return GetSpellAbilityId()==KiritoAOE__SPELLID
- endfunction
- private function KiritoAOE__Actions takes nothing returns nothing
- call s__KiritoAOE__data_create(GetTriggerUnit(),GetSpellTargetX(),GetSpellTargetY())
- endfunction
- private function KiritoAOE__init takes nothing returns nothing
- local trigger t=CreateTrigger()
- local integer index=0
- loop
- call TriggerRegisterPlayerUnitEvent(t,Player(index),EVENT_PLAYER_UNIT_SPELL_EFFECT,null)
- set index=index+1
- exitwhen index==bj_MAX_PLAYER_SLOTS
- endloop
- call TriggerAddCondition(t,Condition(function KiritoAOE__Conditions))
- call TriggerAddAction(t,function KiritoAOE__Actions)
- set t=null
- endfunction
- endscope
复制代码
疯人¢衰人 不知道你还记不记得vJass的基本书写格式? 论坛没有Jass语法高亮插件就是不方便 代码1长看起来就费劲.
难道GA都没人玩vJ和cJ了?
顺便1提JassCraft不支持vJass和cJass代码的语法检查 需要检查代码只能求助于JassHelper和AdicHelper 真是无奈 |
|