1 - 解决了第一次移动弹射球到目标跟下次弹射的衔接
2 - 弹射下次目标不重复
3 - 解决了用单位 - 伤害目标函数导致目标死亡出现不了效果的问题
4 - 因弹射中途目标单位死亡导致弹射球移动到地图中心点的Bug
设置一个备用目标。如果备用目标死亡那么就人品问题了(此问题尚未完美解决)
5 - 如何移植在模板中有清晰注释
6 - 需要1.24B以上魔兽版本
7 - 需要YDWE1.20以上编辑器
8 - 支持多人同时施法
9 - 100%排泄 90%高仿
[jass]
library SDXX
globals
hashtable hx = InitHashtable()
endglobals
function Distance takes real x1,real x2,real y1, real y2 returns real
local real s
local real dx = x2 - x1
local real dy = y2 - y1
set s = SquareRoot(dx*dx+dy*dy)
return s
endfunction
function fzq takes real y1,real y2,real x1,real x2 returns real
local real s =(bj_RADTODEG* Atan2(y1-y2,x1-x2 ))
return s
endfunction
function zbX takes real xx,real xxx,real xxxx returns real
local real x
set x = xx+xxx*Cos(xxxx*bj_DEGTORAD)
return x
endfunction
function zbY takes real xx,real xxx,real xxxx returns real
local real y
set y = xx+xxx*Sin(xxxx*bj_DEGTORAD)
return y
endfunction
function Hero_Bn_Skill_R2 takes nothing returns nothing
local integer i = GetHandleId(GetExpiredTimer())
local unit Hero = LoadUnitHandle(hx,i,1)
local unit u = LoadUnitHandle(hx,i,2)
local unit majia = LoadUnitHandle(hx,i,3)
local boolean Boo = LoadBoolean(hx,i,5)
local boolean Booo = LoadBoolean(hx,i,6)
local integer C = LoadInteger(hx,i,7)
local unit beiyong = LoadUnitHandle(hx,i,8)
local integer i2 = 0
local real x
local real y
local real s
local group g = CreateGroup()
local group g2 = CreateGroup()
local location d = GetUnitLoc(u)
local unit xm
local unit majia2
if C == 7 /*这里的7为最大弹射次数*/ then
call PauseTimer(GetExpiredTimer())
call RemoveUnit(majia)
call FlushChildHashtable(hx,i)
call DestroyTimer(GetExpiredTimer())
else
if Boo == false then
if IsUnitAliveBJ(u) == true then
set s =
fzq(GetUnitY(u),GetUnitY(majia),GetUnitX(u),GetUnitX(majia))
set x = zbX(GetUnitX(majia),13,s)//这里的13为冰霜球一开始飞行的移动速度
set y = zbY(GetUnitY(majia),13,s)//如上
call SetUnitX(majia,x)
call SetUnitY(majia,y)
if
Distance(GetUnitX(majia),GetUnitX(u),GetUnitY(majia),GetUnitY(u))<=10
then
set Boo = true
call SaveBoolean(hx,i,5,Boo)
endif
else
set C = 7
endif
else
if Booo == false then
set C = C +1
call SaveInteger(hx,i,7,C)
set majia2 = CreateUnit(GetOwningPlayer(Hero),/*这里的e000改为释放技能马甲ID*/'e000',GetUnitX(u),GetUnitY(u),0)
call UnitApplyTimedLife( majia2, 'BHwe', 2.00 )
call IssueTargetOrder( majia2, "frostnova", u )
set g = GetUnitsInRangeOfLocAll(600,d)//这里的600为弹射选取单位的范围
call GroupRemoveUnit(g,u)
loop
set xm = FirstOfGroup(g)
exitwhen xm == null
if IsUnitType(xm, UNIT_TYPE_STRUCTURE) == false /*
*/and IsUnitEnemy(xm, GetOwningPlayer(Hero)) == true /*
*/ and IsUnitAliveBJ(xm) == true then
call GroupAddUnit(g2,xm)
endif
call GroupRemoveUnit(g,xm)
endloop
if CountUnitsInGroup(g2) == 0 then
set C = 7
else
set u = GroupPickRandomUnit(g2)
call SaveUnitHandle(hx,i,2,u)
call GroupRemoveUnit(g2,u)
set beiyong = GroupPickRandomUnit(g2)
call SaveUnitHandle(hx,i,8,beiyong)
set Booo = true
call SaveBoolean(hx,i,6,Booo)
endif
else
if IsUnitAliveBJ(u) == true then
set s =
fzq(GetUnitY(u),GetUnitY(majia),GetUnitX(u),GetUnitX(majia))
set x = zbX(GetUnitX(majia),13,s) //这里的13为冰霜球弹射的时候的移动速度
set y = zbY(GetUnitY(majia),13,s)//如上
call SetUnitX(majia,x)
call SetUnitY(majia,y)
if
Distance(GetUnitX(majia),GetUnitX(u),GetUnitY(majia),GetUnitY(u))<=10
then
set Booo = false
endif
else
if IsUnitAliveBJ(beiyong) == true then
set u = beiyong
call SaveUnitHandle(hx,i,2,u)
else
set C = 7
endif
endif
call SaveBoolean(hx,i,6,Booo)
endif
endif
endif
call SaveInteger(hx,i,7,C)
call DestroyGroup(g2)
call DestroyGroup(g)
call RemoveLocation(d)
set Hero = null
set majia = null
set u = null
set majia2 = null
set g = null
set g2 = null
set d = null
set xm = null
set beiyong = null
endfunction
function Hero_Bv_Skill_R takes unit Hero returns nothing
local unit u = GetSpellTargetUnit()
local unit majia =
CreateUnit(GetOwningPlayer(Hero),/*这里的e001改为冰霜球马甲ID*/'e001',GetUnitX(Hero),GetUnitY(Hero),0)
local timer t = CreateTimer()
local integer i = GetHandleId(t)
call SaveUnitHandle(hx,i,1,Hero)
call SaveUnitHandle(hx,i,2,u)
call SaveUnitHandle(hx,i,3,majia)
call TimerStart(t,0.03,true,function Hero_Bn_Skill_R2)
set u = null
set majia = null
set Hero = null
endfunction
endlibrary
[/jass]
[通魔]米波 - 连环霜冻(纯Jass傻瓜移植版).w3x
(23 KB, 下载次数: 216)
|