|
因为有人拜托我做..所以刚刚做了个
现在和大家分享一下....不过我其实玩DOTA没怎么仔细看过那个技能
有什么不对就请大家指出吧
[jass]//=============Returnbug=======================
function H2I takes handle I returns integer
return I
return 0
endfunction
function I2E takes integer I returns effect
return I
return null
endfunction
function I2U takes integer I returns unit
return I
return null
endfunction
//==============无敌斩=================
//参数1.释放单位2.释放X坐标3.释放点Y坐标4.杀伤范围5.移动最大范围5.杀伤次数6杀伤间隔7.伤害值
function The_invincible_Chopped_3 takes nothing returns boolean
if (IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false and GetUnitState(GetFilterUnit(),UNIT_STATE_LIFE)>0)then
return true
endif
return false
endfunction
function The_invincible_Chopped_2 takes nothing returns nothing
local timer Timer = GetExpiredTimer()
local unit DU
local unit U = I2U(GetStoredInteger(udg_cache,I2S(H2I(Timer)),"U"))
local real X = GetStoredReal(udg_cache,I2S(H2I(Timer)),"X")
local real Y = GetStoredReal(udg_cache,I2S(H2I(Timer)),"Y")
local real R1 = GetStoredReal(udg_cache,I2S(H2I(Timer)),"R1")
local real R2 = GetStoredReal(udg_cache,I2S(H2I(Timer)),"R2")
local real Ts = GetStoredReal(udg_cache,I2S(H2I(Timer)),"Ts")
local real D = GetStoredReal(udg_cache,I2S(H2I(Timer)),"D")
local boolexpr F = Condition(function The_invincible_Chopped_3)
local group G = CreateGroup()
local integer I =0
local integer I2 =0
local integer I3 =GetStoredInteger(udg_cache,I2S(H2I(Timer)),"I3")
local real AP = GetRandomReal(0, 360)
local real DP = GetRandomReal(0, R2/2)
local real SX = X + DP *Cos(AP * bj_DEGTORAD)
local real SY = Y + DP *Sin(AP * bj_DEGTORAD)
set I3=I3+1
call StoreInteger(udg_cache,I2S(H2I(Timer)),"I3",I3)
if (I3>Ts-1)then
set SX = GetStoredReal(udg_cache,I2S(H2I(Timer)),"SX")
set SY = GetStoredReal(udg_cache,I2S(H2I(Timer)),"SY")
call DestroyEffect( I2E(GetStoredInteger(udg_cache,I2S(H2I(Timer)),"E")) )
call FlushStoredMission(udg_cache,I2S(H2I(Timer)) )
call DestroyTimer( Timer )
call PauseUnit( U, false )
call SetUnitTimeScale(U, 1 )
call SetUnitPathing( U, true )
call SetUnitInvulnerable( U,false)
call SetUnitX( U,SX )
call SetUnitY( U,SY )
call SetUnitFacing(U,bj_RADTODEG * Atan2(Y - SY,X - SX))
else
call SetUnitAnimation( U, "attack" )
call SetUnitX( U, SX )
call SetUnitY( U, SY )
call SetUnitFacing(U,bj_RADTODEG * Atan2(SY - Y,SX - X))
call GroupEnumUnitsInRangeOfLoc(G,Location(SX,SY),R1,F)
set DU = GroupPickRandomUnit(G)
set I2 = CountUnitsInGroup(G)
loop
exitwhen(I>I2)
set I=I+1
if (IsUnitEnemy(DU, GetOwningPlayer(U)) == true )then
call UnitDamageTarget( U, DU, D, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
exitwhen(true)
endif
call GroupRemoveUnit(G,DU)
set DU = GroupPickRandomUnit(G)
endloop
endif
call DestroyBoolExpr(F)
call GroupClear( G )
set U =null
set DU = null
set G =null
set F =null
set Timer =null
endfunction
function The_invincible_Chopped takes unit U,real X,real Y,real R1,real R2,integer Ts,real T,real D returns nothing
local timer Timer = CreateTimer()
local effect E = AddSpecialEffectTarget("Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl",U,"weapon")
local real SX =GetUnitX(U)
local real SY =GetUnitY(U)
local boolexpr F = Condition(function The_invincible_Chopped_3)
local group G = CreateGroup()
local unit DU
local integer I =0
local integer I2 =0
call StoreInteger(udg_cache,I2S(H2I(Timer)),"U",H2I(U))
call StoreInteger(udg_cache,I2S(H2I(Timer)),"E",H2I(E))
call StoreReal(udg_cache,I2S(H2I(Timer)),"SX",SX)//释放位置
call StoreReal(udg_cache,I2S(H2I(Timer)),"SY",SY)//释放位置
call StoreReal(udg_cache,I2S(H2I(Timer)),"X",X)
call StoreReal(udg_cache,I2S(H2I(Timer)),"Y",Y)
call StoreReal(udg_cache,I2S(H2I(Timer)),"R1",R1)
call StoreReal(udg_cache,I2S(H2I(Timer)),"R2",R2)
call StoreReal(udg_cache,I2S(H2I(Timer)),"Ts",Ts)
call StoreReal(udg_cache,I2S(H2I(Timer)),"D",D)
call PauseUnit( U, true )
call SetUnitTimeScale(U, 1.8 )
call SetUnitPathing( U, false )
call SetUnitInvulnerable( U, true )
call SetUnitAnimation( U, "attack" )
call SetUnitX( U, X )
call SetUnitY( U, Y )
call SetUnitFacing(U,bj_RADTODEG * Atan2(Y - SY,X - SX))
call GroupEnumUnitsInRangeOfLoc(G,Location(X,Y),R1,F)
set DU = GroupPickRandomUnit(G)
set I2 = CountUnitsInGroup(G)
loop
exitwhen(I>I2)
set I=I+1
if (IsUnitEnemy(DU, GetOwningPlayer(U)) == true )then
call UnitDamageTarget( U, DU, D, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
exitwhen(true)
endif
call GroupRemoveUnit(G,DU)
set DU = GroupPickRandomUnit(G)
endloop
call TimerStart(Timer,T,true,function The_invincible_Chopped_2)
call DestroyBoolExpr(F)
call GroupClear( G )
set DU = null
set G =null
set F =null
set E =null
set Timer =null
endfunction[/jass]
似乎有点复杂....
不过是一个模块
可以改里面的数据
演示地图在下面 |
评分
-
查看全部评分
|