找回密码
 点一下
查看: 3384|回复: 9

剑圣无敌斩

  [复制链接]
发表于 2008-8-4 23:56:35 | 显示全部楼层 |阅读模式
因为有人拜托我做..所以刚刚做了个
现在和大家分享一下....不过我其实玩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]

似乎有点复杂....
不过是一个模块
可以改里面的数据

演示地图在下面

无敌斩.w3x

28 KB, 下载次数: 333

地图

评分

参与人数 1威望 +15 收起 理由
crazyforyou + 15

查看全部评分

发表于 2008-8-5 00:13:17 | 显示全部楼层
好像死的也砍了
回复

使用道具 举报

 楼主| 发表于 2008-8-5 00:15:32 | 显示全部楼层
会放过
[jass]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[/jass]
注意这里的条件

鉴于传递数据的问题
判断单位是否为敌人只能到LOOP里去做了
回复

使用道具 举报

发表于 2008-8-5 00:18:09 | 显示全部楼层
原来是在砍空气,无视我这句话吧
回复

使用道具 举报

 楼主| 发表于 2008-8-5 00:22:07 | 显示全部楼层
没有玩过DOTA么
回复

使用道具 举报

发表于 2008-8-5 01:59:23 | 显示全部楼层
秋天的童话TurtleRock娜迦遗迹后篇正式版2.w3x (3.97 MB, 下载次数: 129) 纯T版的要不
回复

使用道具 举报

 楼主| 发表于 2008-8-5 13:30:50 | 显示全部楼层
对比了一下DOTA的无敌斩发现很多地方都不一样..'
算了就当作 原创技能吧
回复

使用道具 举报

发表于 2008-8-5 18:10:29 | 显示全部楼层
我就是玩DOTA的 玩了一年    无敌斩是指定单位 造成随即150-250的伤害伤害 3级砍9次 攻击速度快的话 还夹带普通攻击 运气好技能伤害和普通暴击一起出  秒杀一个英雄
回复

使用道具 举报

 楼主| 发表于 2008-8-5 18:12:12 | 显示全部楼层
还夹带普通攻击 运气好技能伤害和普通暴击一起出
这些似乎是不是BUG的BUG
被默认了 就不认为是BUG了

我这个里 因为有暂停单位 所以不会有普通攻击了
回复

使用道具 举报

恶声恶气 该用户已被删除
发表于 2008-8-5 18:30:46 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-10-1 16:21 , Processed in 0.066230 second(s), 26 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表