|
本帖最后由 RoyalFlare 于 2015-2-6 19:10 编辑
- 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
- private unit array s__KiritoAOE__data_c
- private real array s__KiritoAOE__data_targetx
- private real array s__KiritoAOE__data_targety
- 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 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)
- endfunction
- private function s__KiritoAOE__data_Boolean takes nothing returns boolean
- return true
- endfunction
- private function s__KiritoAOE__data_FinalTimer takes nothing returns nothing
- local timer z=GetExpiredTimer()
- local integer this=(LoadInteger(TimerUtils___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)
- endfunction
- private function s__KiritoAOE__data_TimerExpired takes nothing returns nothing
- local timer z=GetExpiredTimer()
- local integer this=(LoadInteger(TimerUtils___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
- endfunction
- private 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(TimerUtils___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
- endfunction
- 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中 按照论坛里的示例格式书写1个冲锋移动范围伤害技能 求大神帮忙看下是否有书写错误的地方 身边的电脑暂时无法测试 自己用EverEdit和NotePad Plus手打的 不知道能否通过JassHelper的语法检查 先谢过了
@ck5524210 @希瓦 @chyj4747 @zhuzeitou @actboy168 |
|