永恒的灌水帝吧 关注:589贴子:1,694

【技能】极爆风暴 ~~~

只看楼主收藏回复

(无马甲可移植支持多人)


IP属地:北京1楼2010-09-18 19:51回复
    


    IP属地:北京2楼2010-09-18 19:54
    回复
      IP属地:北京3楼2010-09-18 19:55
      回复
        方法:直接复制代码到地图脚本


        IP属地:北京4楼2010-09-18 19:55
        回复
          library Storm initializer Init
          globals
                  constant integer StormAbility='A000'//目标点技能ID
                  constant real LightningRange=250//闪电范围
                  constant real LightningHeight=500//闪电高度
                  constant real PullRange=800//引力范围
                  constant real LightningDamage=150//闪电伤害
                  constant real PullDamage=20//吸引伤害
                  constant real PullSpeedMultiple=1//吸引速度倍率
                  constant real PushSpeedMultiple=1//反弹速度倍率
                  constant real DestructableDamage=200//可破坏物伤害
                  hashtable HT = null
          endglobals     
          function StormCondition takes nothing returns boolean
                if GetSpellAbilityId() == StormAbility then
                   return true
                endif
                return false
          endfunction
          function StormEnumDestructable takes nothing returns nothing
                call SetDestructableLife(GetEnumDestructable(),(GetDestructableLife(GetEnumDestructable())-DestructableDamage*0.25))
          endfunction
          function ReboundPush takes nothing returns nothing    
                local timer t=GetExpiredTimer()
                local integer k=GetHandleId(t)
                local real s=LoadReal(HT,k,4)+1
                local group g=CreateGroup()
                local unit u
                local real x=LoadReal(HT,k,2)
                local real y=LoadReal(HT,k,3)
                local unit e=LoadUnitHandle(HT,k,5)
                local integer i=1
                local real h
                local real a
                local boolean b=false
                call SaveReal(HT,k,4,s)
                call GroupEnumUnitsInRange(g,x,y,LightningRange*4,null)
                loop
                    set u=FirstOfGroup(g)
                    set b=LoadBoolean(HT,GetHandleId(u),2)
                    if u!=null and IsUnitType(u,UNIT_TYPE_DEAD)==false and IsUnitEnemy(u,GetOwningPlayer(e)) and b==true then
                        call UnitAddAbility(u,'Arav')
                        call UnitRemoveAbility(u,'Arav')
          


          IP属地:北京5楼2010-09-18 19:56
          回复
            if s>20 then
                             call SetUnitInvulnerable(u,false)
                             set h=LoadReal(HT,GetHandleId(u),1)
                             call SetUnitFlyHeight(u,h,10000)
                             call DestroyTimer(t)
                             call FlushChildHashtable(HT,GetHandleId(u))
                             call FlushChildHashtable(HT,k)
                          else   
                             call SetUnitInvulnerable(u,true)
                             call IssueImmediateOrder(u,"stop")
                             call SetUnitFlyHeight(u,((-2*Pow(s,2))+300),10000)
                             set a=Atan2(y-GetUnitY(u),x-GetUnitX(u))
                             call SetUnitX(u,GetUnitX(u)+(-6.2*5)*PushSpeedMultiple*Cos(a))
                             call SetUnitY(u,GetUnitY(u)+(-6.2*5)*PushSpeedMultiple*Sin(a))
                          endif
                      endif
                      set b=false
                      call GroupRemoveUnit(g,u)
                      exitwhen u==null
                  endloop
                  call GroupClear(g)
                  call DestroyGroup(g)
                  set e=null
                  set g=null
                  set u=null
                  set t=null
            endfunction   
            function CastRebound takes nothing returns nothing
                  local timer t=GetExpiredTimer()
                  local integer k=GetHandleId(t)
                  local timer c=CreateTimer()
                  local integer p=GetHandleId(c)
                  local timer m=LoadTimerHandle(HT,k,1)
                  local real s=0
                  local real x=LoadReal(HT,k,2)
                  local real y=LoadReal(HT,k,3)
                  local unit h=LoadUnitHandle(HT,k,4)
                  local group g=CreateGroup()
            


            IP属地:北京6楼2010-09-18 19:56
            回复
                    local unit u
                    local real r
                    local integer i=1
                    local real z=LightningHeight
                    local destructable d
                    local real a=0
                    call TimerStart(c,0.05,true,function ReboundPush)
                    call FlushChildHashtable(HT,GetHandleId(m))
                    call FlushChildHashtable(HT,k)
                    call DestroyTimer(m)
                    call DestroyTimer(t)
                    call SaveReal(HT,p,2,x)
                    call SaveReal(HT,p,3,y)
                    call SaveReal(HT,p,4,s)
                    call SaveUnitHandle(HT,p,5,h)
                    call GroupEnumUnitsInRange(g,x,y,LightningRange,null)
                    loop
                        set u=FirstOfGroup(g)
                        if IsUnitType(u,UNIT_TYPE_DEAD)==false and IsUnitEnemy(u,GetOwningPlayer(h)) then
                           set r=GetUnitFlyHeight(u)
                           call SaveBoolean(HT,GetHandleId(u),2,true)
                           call SaveReal(HT,GetHandleId(u),1,r)
                           call UnitDamageTarget(h,u,LightningDamage,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
                        endif
                        call GroupRemoveUnit(g,u)
                        exitwhen u==null
                    endloop
                    call GroupClear(g)
                    call DestroyGroup(g)
                    loop
                       exitwhen i>5
                       set d=CreateDestructableZ('OTis',x,y,z/i,0,1,0)
                       call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl",x,y))
                       call RemoveDestructable(d)
                       set i=i+1
                    endloop   
                    set i=1
                    loop
                       exitwhen i>12
                       call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl",x+LightningRange*0.5*Cos(a*bj_DEGTORAD),y+LightningRange*0.5*Sin(a*bj_DEGTORAD)))
                       set a=a+30
                       set i=i+1
                    endloop   
                    set d=null
                    set g=null
              


              IP属地:北京7楼2010-09-18 19:56
              回复
                     set u=null
                      set h=null
                      set t=null
                      set c=null
                      set m=null
                endfunction    
                function RemoveLightning takes nothing returns nothing
                      local timer t=GetExpiredTimer()
                      local integer k=GetHandleId(t)
                      local lightning array l
                      local integer n=LoadInteger(HT,k,1)
                      local integer i=1
                      loop
                         exitwhen i>n
                         set l[i]=LoadLightningHandle(HT,k,1+i)
                         call DestroyLightning(l[i])
                         set l[i]=null
                      set i=i+1
                      endloop
                      call DestroyTimer(t)
                      call FlushChildHashtable(HT,k)
                      set t=null
                endfunction    
                    
                function LightningMovement takes nothing returns nothing
                      local timer t=GetExpiredTimer()
                      local integer k=GetHandleId(t)
                      local integer i=1
                      local real array x
                      local real array y
                      local unit u
                      local unit h=LoadUnitHandle(HT,k,3)
                      local group g=CreateGroup()
                      local lightning array l
                      local timer c
                      set x[1]=LoadReal(HT,k,1)
                      set y[1]=LoadReal(HT,k,2)
                      call GroupEnumUnitsInRange(g,x[1],y[1],PullRange,null)
                      loop
                          set u=FirstOfGroup(g)
                          if u!=null and IsUnitType(u,UNIT_TYPE_DEAD)==false and IsUnitEnemy(u,GetOwningPlayer(h)) then
                             set x[2]=GetUnitX(u)
                             set y[2]=GetUnitY(u)
                             set l[i]=AddLightningEx("CLSB",false,x[1],y[1],LightningHeight,x[2],y[2],GetUnitFlyHeight(u))
                             call UnitDamageTarget(h,u,LightningDamage/i*(i/(LightningDamage/5)),false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
                             set c=CreateTimer()
                             call TimerStart(c,0.25,false,function RemoveLightning)
                             call SaveLightningHandle(HT,GetHandleId(c),i+1,l[i])
                


                IP属地:北京8楼2010-09-18 19:56
                回复
                            set i=i+1
                               call SaveInteger(HT,GetHandleId(c),1,i)
                               set c=null
                            endif
                            call GroupRemoveUnit(g,u)
                            exitwhen u==null
                        endloop
                        call GroupClear(g)
                        call DestroyGroup(g)
                        set u=null
                        set h=null
                        set g=null
                        set t=null
                        set c=null
                  endfunction    
                      
                  function ObjectDamage takes nothing returns nothing
                        local timer t=GetExpiredTimer()
                        local integer k=GetHandleId(t)
                        local unit u=LoadUnitHandle(HT,k,1)
                        local real x=LoadReal(HT,k,2)
                        local real y=LoadReal(HT,k,3)
                        local real z=LoadReal(HT,k,4)
                        local destructable d=CreateDestructableZ('OTis',x,y,z,0,1,0)
                        local integer i=1
                        local real a
                        local lightning array l
                        local group g
                        local unit h
                        local location p=Location(x,y)
                        local lightning e
                        loop
                           exitwhen i>20
                           set a=LoadReal(HT,k,24+i)+9
                           set l[i]=LoadLightningHandle(HT,k,4+i)
                           call MoveLightningEx(l[i],false,x,y,LightningHeight,x+LightningRange*Cos(a*bj_DEGTORAD),y+LightningRange*Sin(a*bj_DEGTORAD),0)
                           call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\Bolt\\BoltImpact.mdl",x+LightningRange*Cos(a*bj_DEGTORAD),y+LightningRange*Sin(a*bj_DEGTORAD)))
                           call SaveReal(HT,k,24+i,a)
                           set i=i+1
                           set l[i]=null
                        endloop   
                        set i=1
                        loop
                           exitwhen i>20
                           set a=LoadReal(HT,k,64+i)+9
                           set l[i]=LoadLightningHandle(HT,k,44+i)
                           call MoveLightningEx(l[i],false,x+(LightningRange+50)*(1-z/LightningHeight)*Cos(a*bj_DEGTORAD),y+(LightningRange+50)*(1-z/LightningHeight)*Sin(a*bj_DEGTORAD),z,x+(LightningRange+50)*(1-z/LightningHeight)*Cos((a+18)*bj_DEGTORAD),y+(LightningRange+50)*(1-z/LightningHeight)*Sin((a+18)*bj_DEGTORAD),z)
                  


                  IP属地:北京9楼2010-09-18 19:57
                  回复
                            call SaveReal(HT,k,64+i,a)
                             set i=i+1
                             set l[i]=null
                          endloop   
                          call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl",x,y))
                          call RemoveDestructable(d)
                          set z=z-LightningHeight/10
                          if z<=0 then
                             set z=LightningHeight
                             set g=CreateGroup()
                             call GroupEnumUnitsInRange(g,x,y,LightningRange,null)
                             loop
                                set h=FirstOfGroup(g)
                                if h!=null and IsUnitType(h,UNIT_TYPE_DEAD)==false and IsUnitEnemy(h,GetOwningPlayer(u)) then
                                   call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl",h,"overhead"))
                                   call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Orc\\LightningShield\\LightningShieldTarget.mdl",x,y))
                                   call UnitDamageTarget(u,h,LightningDamage,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
                                endif
                                call GroupRemoveUnit(g,h)
                                exitwhen h==null
                             endloop
                             call GroupClear(g)
                             call DestroyGroup(g)
                          endif   
                          call SaveReal(HT,k,4,z)
                          call EnumDestructablesInCircleBJ(LightningRange+50,p,function StormEnumDestructable)
                          call RemoveLocation(p)
                          set e=null
                          set d=null
                          set p=null
                          set u=null
                          set t=null
                          set g=null
                    endfunction
                    function PolePull takes nothing returns nothing    
                          local timer t=GetExpiredTimer()
                          local integer k=GetHandleId(t)
                          local unit u=LoadUnitHandle(HT,k,1)
                          local real x=LoadReal(HT,k,2)
                          local real y=LoadReal(HT,k,3)
                          local group g=CreateGroup()
                          local unit h
                          local location p=Location(x,y)
                    


                    IP属地:北京10楼2010-09-18 19:57
                    回复
                           local location l
                            local real d
                            local real a
                            call GroupEnumUnitsInRange(g,x,y,PullRange,null)
                            loop
                               set h=FirstOfGroup(g)
                               if h!=null and IsUnitType(h,UNIT_TYPE_DEAD)==false and IsUnitEnemy(h,GetOwningPlayer(u)) and IsUnitType(h,UNIT_TYPE_STRUCTURE) == false then
                                  set l=GetUnitLoc(h)
                                  set d=DistanceBetweenPoints(l,p)
                                  set a=Atan2(y-GetUnitY(h),x-GetUnitX(h))
                                  call UnitDamageTarget(u,h,PullDamage*0.05,false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
                                  if d>1000 then
                                     set d=d/3
                                  endif
                                  call SetUnitX(h,GetUnitX(h)+(1000-d)/50*PullSpeedMultiple*Cos(a))
                                  call SetUnitY(h,GetUnitY(h)+(1000-d)/50*PullSpeedMultiple*Sin(a))
                                  call RemoveLocation(l)
                                  call RemoveLocation(p)
                               endif
                               call GroupRemoveUnit(g,h)
                               exitwhen h==null
                            endloop
                            call GroupClear(g)
                            call DestroyGroup(g)
                            set t=null
                            set l=null
                            set p=null
                            set g=null
                            set u=null
                            set h=null
                      endfunction       
                      function StormEnd takes nothing returns nothing
                            local timer s=GetExpiredTimer()
                            local timer t=LoadTimerHandle(HT,GetHandleId(s),1)
                            local integer k=GetHandleId(t)
                            local timer c=LoadTimerHandle(HT,GetHandleId(s),2)
                            local lightning array l
                            local integer i=1
                            loop
                               exitwhen i>20
                               call DestroyLightning(LoadLightningHandle(HT,k,i+4) )
                               call DestroyLightning(LoadLightningHandle(HT,k,i+44) )
                               set i=i+1
                            endloop   
                      


                      IP属地:北京11楼2010-09-18 19:58
                      回复
                              set i=1
                              loop
                                 exitwhen i>5
                                 call DestroyLightning(LoadLightningHandle(HT,k,i+84) )
                                 set i=i+1
                              endloop   
                              set i=1
                              loop
                                 exitwhen i>5
                                 call DestroyLightning(LoadLightningHandle(HT,k,i+89) )
                                 set i=i+1
                              endloop   
                              call DestroyTimer(t)
                              call DestroyTimer(s)
                              call DestroyTimer(c)
                              call FlushChildHashtable(HT,k)
                              call FlushChildHashtable(HT,GetHandleId(s))
                              set c=null
                              set t=null
                              set s=null
                        endfunction    
                            
                        function StormCast takes nothing returns nothing
                              local unit u=GetTriggerUnit()
                              local real x=GetSpellTargetX()
                              local real y=GetSpellTargetY()
                              local real z=LightningHeight
                              local timer t=CreateTimer()
                              local integer k=GetHandleId(t)
                              local timer m=CreateTimer()
                              local integer p=GetHandleId(m)
                              local timer s=CreateTimer()
                              local timer b=CreateTimer()
                              local timer e=CreateTimer()
                              local integer i=1
                              local lightning array l
                              local real a=0
                              call TimerStart(t,0.25,true,function ObjectDamage)
                              call SaveUnitHandle(HT,k,1,u)
                              call SaveReal(HT,k,2,x)
                              call SaveReal(HT,k,3,y)
                              call SaveReal(HT,k,4,z)
                              call TimerStart(m,0.05,true,function PolePull)
                              call SaveUnitHandle(HT,p,1,u)
                              call SaveReal(HT,p,2,x)
                              call SaveReal(HT,p,3,y)
                              call TimerStart(s,10,false,function StormEnd)
                              call SaveTimerHandle(HT,GetHandleId(s),1,t)
                              call TimerStart(b,9,false,function CastRebound)
                              call SaveTimerHandle(HT,GetHandleId(b),1,m)
                              call SaveReal(HT,GetHandleId(b),2,x)
                              call SaveReal(HT,GetHandleId(b),3,y)
                              call SaveUnitHandle(HT,GetHandleId(b),4,u)
                              call TimerStart(e,1,true,function LightningMovement)
                        


                        IP属地:北京12楼2010-09-18 19:58
                        回复
                          400多行,好长


                          IP属地:浙江15楼2010-09-18 23:27
                          回复
                            不会用VJ的自重中


                            16楼2011-02-06 21:00
                            回复
                              这个还用不到VJ的1/10


                              IP属地:北京17楼2011-02-06 22:48
                              回复