|
发表于 2007-3-3 21:13:45
|
显示全部楼层
很久没遇到写轮眼拷贝不出来的技能了 乍一看我还以为是加了太极模型进去呢
精华一下 置顶一周
我把代码贴出来好了
[jass]
function Trig_xtj_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A000' ) ) then
return false
endif
return true
endfunction
function Trig_xtj_Actions takes nothing returns nothing
local location a = GetUnitLoc(GetTriggerUnit())
local real cx = GetLocationX(a)
local real cy = GetLocationY(a)
local real y = 500
local integer a = 0
loop
exitwhen y<=350
set y = y-5
set a = a+1
call AddLightningLoc( "MBUR", Location(-SquareRoot(250000.00-y*y)+cx, y+cy), Location(-SquareRoot(62500.00-(y-250)*(y-250))+cx, y+cy) )
call SetLightningColor( GetLastCreatedLightningBJ(), 0.00, 0.10, 0.90, 0.50 )
set udg_SD1[a] = GetLastCreatedLightningBJ()
call AddLightningLoc( "MBUR", Location(SquareRoot(250000.00-y*y)+cx, y+cy), Location(-SquareRoot(62500.00-(y-250)*(y-250))+cx, y+cy) )
call SetLightningColor( GetLastCreatedLightningBJ(), 0.90, 0.10, 0.00, 0.50 )
set udg_SD1[a+30] = GetLastCreatedLightningBJ()
endloop
set a = 0
loop
exitwhen y<=150
set y = y-5
set a = a+1
call AddLightningLoc( "MBUR", Location(-SquareRoot(250000.00-y*y)+cx, y+cy), Location(-SquareRoot(62500.00-(y-250)*(y-250))+cx, y+cy) )
call SetLightningColor( GetLastCreatedLightningBJ(), 0.00, 0.10, 0.90, 0.50 )
set udg_SD2[a] = GetLastCreatedLightningBJ()
call AddLightningLoc( "MBUR", Location(-SquareRoot(62500.00-(y-250)*(y-250))+cx, y+cy), Location(-SquareRoot(10000-(y-250)*(y-250))+cx, y+cy) )
call SetLightningColor( GetLastCreatedLightningBJ(), 0.90, 0.10, 0.00, 0.50 )
set udg_SD2[a+40] = GetLastCreatedLightningBJ()
call AddLightningLoc( "MBUR", Location(SquareRoot(250000.00-y*y)+cx, y+cy), Location(SquareRoot(10000-(y-250)*(y-250))+cx, y+cy) )
call SetLightningColor( GetLastCreatedLightningBJ(), 0.90, 0.10, 0.00, 0.50 )
set udg_SD2[a+80] = GetLastCreatedLightningBJ()
call AddLightningLoc( "MBUR", Location(-SquareRoot(10000-(y-250)*(y-250))+cx, y+cy), Location(SquareRoot(10000-(y-250)*(y-250))+cx, y+cy) )
call SetLightningColor( GetLastCreatedLightningBJ(), 0.00, 0.10, 0.90, 0.50 )
set udg_SD2[a+120] = GetLastCreatedLightningBJ()
endloop
set a = 0
loop
exitwhen y<=0
set y = y-5
set a = a+1
call AddLightningLoc( "MBUR", Location(-SquareRoot(250000.00-y*y)+cx, y+cy), Location(-SquareRoot(62500.00-(y-250)*(y-250))+cx, y+cy) )
call SetLightningColor( GetLastCreatedLightningBJ(), 0.00, 0.10, 0.90, 0.50 )
set udg_SD1[a+60] = GetLastCreatedLightningBJ()
call AddLightningLoc( "MBUR", Location(SquareRoot(250000.00-y*y)+cx, y+cy), Location(-SquareRoot(62500.00-(y-250)*(y-250))+cx, y+cy) )
call SetLightningColor( GetLastCreatedLightningBJ(), 0.90, 0.10, 0.00, 0.50 )
set udg_SD1[a+90] = GetLastCreatedLightningBJ()
endloop
set a = 0
loop
exitwhen y<=-150
set y = y-5
set a = a+1
call AddLightningLoc( "MBUR", Location(-SquareRoot(250000.00-y*y)+cx, y+cy), Location(SquareRoot(62500.00-(y+250)*(y+250))+cx, y+cy) )
call SetLightningColor( GetLastCreatedLightningBJ(), 0.00, 0.10, 0.90, 0.50 )
set udg_SD3[a] = GetLastCreatedLightningBJ()
call AddLightningLoc( "MBUR", Location(SquareRoot(250000.00-y*y)+cx, y+cy), Location(SquareRoot(62500.00-(y+250)*(y+250))+cx, y+cy) )
call SetLightningColor( GetLastCreatedLightningBJ(), 0.90, 0.10, 0.00, 0.50 )
set udg_SD3[a+30] = GetLastCreatedLightningBJ()
endloop
set a = 0
loop
exitwhen y<=-350
set y = y-5
set a = a+1
call AddLightningLoc( "MBUR", Location(SquareRoot(250000.00-y*y)+cx, y+cy), Location(SquareRoot(62500.00-(y+250)*(y+250))+cx, y+cy) )
call SetLightningColor( GetLastCreatedLightningBJ(), 0.90, 0.10, 0.00, 0.50 )
set udg_SD2[a+160] = GetLastCreatedLightningBJ()
call AddLightningLoc( "MBUR", Location(SquareRoot(62500.00-(y+250)*(y+250))+cx, y+cy), Location(SquareRoot(10000-(y+250)*(y+250))+cx, y+cy) )
call SetLightningColor( GetLastCreatedLightningBJ(), 0.00, 0.10, 0.90, 0.50 )
set udg_SD2[a+200] = GetLastCreatedLightningBJ()
call AddLightningLoc( "MBUR", Location(-SquareRoot(250000.00-y*y)+cx, y+cy), Location(-SquareRoot(10000-(y+250)*(y+250))+cx, y+cy) )
call SetLightningColor( GetLastCreatedLightningBJ(), 0.00, 0.10, 0.90, 0.50 )
set udg_SD2[a+240] = GetLastCreatedLightningBJ()
call AddLightningLoc( "MBUR", Location(-SquareRoot(10000-(y+250)*(y+250))+cx, y+cy), Location(SquareRoot(10000-(y+250)*(y+250))+cx, y+cy) )
call SetLightningColor( GetLastCreatedLightningBJ(), 0.90, 0.10, 0.00, 0.50 )
set udg_SD2[a+280] = GetLastCreatedLightningBJ()
endloop
set a = 0
loop
exitwhen y<=-500
set y = y-5
set a = a+1
call AddLightningLoc( "MBUR", Location(-SquareRoot(250000.00-y*y)+cx, y+cy), Location(SquareRoot(62500.00-(y+250)*(y+250))+cx, y+cy) )
call SetLightningColor( GetLastCreatedLightningBJ(), 0.00, 0.10, 0.90, 0.50 )
set udg_SD3[a+60] = GetLastCreatedLightningBJ()
call AddLightningLoc( "MBUR", Location(SquareRoot(250000.00-y*y)+cx, y+cy), Location(SquareRoot(62500.00-(y+250)*(y+250))+cx, y+cy) )
call SetLightningColor( GetLastCreatedLightningBJ(), 0.90, 0.10, 0.00, 0.50 )
set udg_SD3[a+90] = GetLastCreatedLightningBJ()
endloop
call PolledWait( 30.00 )
call TriggerExecute( gg_trg_xc )
endfunction
function InitTrig_xtj takes nothing returns nothing
set gg_trg_xtj = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_xtj, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_xtj, Condition( function Trig_xtj_Conditions ) )
call TriggerAddAction( gg_trg_xtj, function Trig_xtj_Actions )
endfunction
[/jass]
技能很漂亮,不过这代码有很多地方可以优化呢,比如
[jass]
local location a = GetUnitLoc(GetTriggerUnit())
local real cx = GetLocationX(a)
local real cy = GetLocationY(a)
local real y = 500
local integer a = 0
[/jass]
这里把a赋值为点 在后面又赋值为数字 这样不是很好哦
以后继续努力吧:)~~~ |
|