|
楼主 |
发表于 2012-7-8 12:10:51
|
显示全部楼层
回 chyj4747 的帖子
。。。奇怪。。。我实在想不出了。。。
有空的话能不能帮忙看一下。。。谢谢了
解决了。。。我自己脑残。。。填错了单位代码。。。- function RunTimer takes nothing returns nothing
- local string table = I2S(YDWEGetTimerID(GetExpiredTimer()))
- local unit source = YDWEGetUnitByString( table, "source")
- local unit knight = YDWEGetUnitByString( table, "knight")
- local real angle = YDWEGetRealByString( table, "angle")
- local location loc1 = GetUnitLoc(knight)
- local group gro2 = CreateGroup()
-
- local location loc2 = PolarProjectionBJ(loc1, 20, angle )
- local group gro = GetUnitsInRangeOfLocAll(200.00, loc2)
- local integer N = CountUnitsInGroup(gro)
- local integer i = 1
- local unit tem_u
- local integer record = YDWEGetIntegerByString( table, "record")
-
- //call SetUnitAnimation( knight, "walk" )
- call DisplayTimedTextToForce( GetPlayersAll(), 30, table )
- call SetUnitAnimationByIndex( knight, 0 )
- set record = record + 1
- call YDWESaveIntegerByString( table, "record", record )
- call SetUnitPositionLocFacingBJ( knight, loc2, angle )
-
- loop
- exitwhen i > N
- set tem_u = GroupPickRandomUnit(gro)
- call GroupRemoveUnitSimple( tem_u, gro )
- if((IsUnitDeadBJ(tem_u) == false) and (IsUnitAlly(tem_u, GetOwningPlayer(source)) == false) and (IsUnitType(tem_u, UNIT_TYPE_FLYING) == false)) then
- call GroupAddUnitSimple( tem_u, gro2 )
- endif
- set i = i + 1
- endloop
- if(IsUnitGroupEmptyBJ(gro2) == false) then
- set tem_u = GroupPickRandomUnit(gro2)
- call DestroyEffect( AddSpecialEffectTarget("Abilities\\\\Spells\\\\Other\\\\Stampede\\\\StampedeMissileDeath.mdl", tem_u, "origin") )
- call UnitDamageTarget( source, tem_u, 60.00, true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
- call RemoveUnit( knight )
- call PauseTimer(GetExpiredTimer())
- call YDWEFlushMissionByString( table )
- call DestroyTimer(GetExpiredTimer())
- else
- if(record > 100) then
- call RemoveUnit( knight )
- call PauseTimer(GetExpiredTimer())
- call YDWEFlushMissionByString( table )
- call DestroyTimer(GetExpiredTimer())
- endif
- endif
- call RemoveLocation(loc1)
- call RemoveLocation(loc2)
- call DestroyGroup( gro )
- call DestroyGroup(gro2)
-
- set table = null
- set source = null
- set knight = null
- set loc1 = null
- set loc2 = null
- set gro = null
- set gro2 = null
- set tem_u = null
- endfunction
复制代码- function run takes location tem,real angle,unit source returns nothing
- local string table
- local unit knight = CreateUnitAtLoc(GetOwningPlayer(source), 'h004', tem, angle)
- local timer t = CreateTimer()
-
- //call SetUnitAnimation( knight, "walk" )
- call SetUnitAnimationByIndex( knight, 0 )
- call SetUnitPathing( knight, false )
- set table = I2S(YDWEGetTimerID(t))
- call YDWESaveUnitByString( table, "source", source )
- call YDWESaveUnitByString( table, "knight", knight )
- call YDWESaveRealByString( table, "angle", angle )
- call YDWESaveIntegerByString( table, "record", 0 )
-
-
-
- call TimerStart(t,.05,true,function RunTimer)
- call RemoveLocation(tem)
- set table = null
- set knight = null
- set t = null
- endfunction
复制代码- function MoveTimer takes nothing returns nothing
- local string table = I2S(YDWEGetTimerID(GetExpiredTimer()))
- local unit source = YDWEGetUnitByString( table, "source")
-
- local real angle = YDWEGetRealByString( table, "angle")
- local location loc = GetUnitLoc(source)
- local integer flag
- local real distance
- local location loc2 = PolarProjectionBJ(loc, 1000.00, ( angle + 180.00 ))
- local integer i = 1
- local location tem
- call DisplayTimedTextToForce( GetPlayersAll(), 30, table )
- loop
- exitwhen i > 2
- set flag = GetRandomInt(1, 2)
- if(flag == 1) then
- set tem = PolarProjectionBJ(loc2, GetRandomReal(0, 1000.00), ( angle + 90.00 ))
- call run(tem,angle,source)
- else
- set tem = PolarProjectionBJ(loc2, GetRandomReal(0, 1000.00), ( angle - 90.00 ))
- call run(tem,angle,source)
- endif
-
- set i = i + 1
- endloop
- call RemoveLocation(loc)
- call RemoveLocation(loc2)
- if(GetUnitAbilityLevel(source, 'Aasl') == 0) then
- call PauseTimer(GetExpiredTimer())
- call YDWEFlushMissionByString( table )
- call DestroyTimer(GetExpiredTimer())
- endif
-
- set table = null
- set source = null
- set loc = null
- set loc2 = null
- set tem = null
- endfunction
复制代码- function Trig_knight_run_Actions takes nothing returns nothing
- local unit gtu = GetTriggerUnit()
- local location loc_gtu = GetUnitLoc(gtu)
- local string table
- local timer t = CreateTimer()
- local location gstl = GetSpellTargetLoc()
-
- local real angle = AngleBetweenPoints(loc_gtu, gstl)
- call UnitAddAbility( gtu, 'Aasl' )
- set table = I2S(YDWEGetTimerID(t))
- call DisplayTimedTextToForce( GetPlayersAll(), 30, I2S(YDWEGetTimerID(t)) )
- call YDWESaveUnitByString( table, "source", gtu )
- call YDWESaveRealByString( table, "angle", angle )
-
-
-
- call TimerStart(t,1.00,true,function MoveTimer)
- call RemoveLocation(loc_gtu)
- call RemoveLocation(gstl)
- set gstl = null
- set gtu = null
- set table = null
- set loc_gtu = null
- set t = null
- endfunction
复制代码 技能是模拟兽王的大招。。
init 和condition就不贴上来了。。那个没问题。。还有一段是单位结束施法后去除Asal的
多谢[s:190][s:190][s:190] |
|