|
发表于 2011-5-28 06:35:52
|
显示全部楼层
1.20YDWE开启CJ编译 希望可以帮到LZ.w3x
(20 KB, 下载次数: 4)
后来闲下来有空.就直接给你写了一个,也算是练习一下CJ.....如果你对J有兴趣的话.可以看看....如果没有的话...就算了...
不过需要1.20的YDWE开启CJ编译然后才可以使用....或者导出编译后的J文件..我就不直接帖了..
[jass]
#define gu = GetTriggerUnit()
#define gx =GetUnitX(gu)
#define gy = GetUnitY(gu)
#define gf = GetUnitFacing(gu)
#define gax = GetSpellTargetX()
#define gay = GetSpellTargetY()
function Trig_underfoot_one_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'AOsh' ) then
return true
endif
return false
endfunction
function Trig_underfoot_one_Actions takes nothing returns nothing
real ox = gx
real oy = gy
real ax = gax
real ay = gay
real face =Atan2((ay-oy),(ax-ox))
unit u = gu
unit m
real distance = 100
real x
real y
debug BJDebugMsg("哪里有问题?")
#for i(1,10)
distance = distance + 100
x = ox + distance *Cos(face)
y = oy + distance *Sin(face)
m =CreateUnit(GetTriggerPlayer(),'hfoo',x,y,face)
DestroyEffect(AddSpecialEffect("Abilities\\\\Spells\\\\Orc\\\\WarStomp\\\\WarStompCaster.mdl",x,y))
UnitApplyTimedLife(m,'BHwe',3)
TriggerSleepAction(0.2)
debug BJDebugMsg("哪里有问题?")
#endfor
flush locals
endfunction
//===========================================================================
function InitTrig_underfoot_one takes nothing returns nothing
set gg_trg_underfoot_one = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_underfoot_one, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_underfoot_one, Condition( function Trig_underfoot_one_Conditions ) )
call TriggerAddAction( gg_trg_underfoot_one, function Trig_underfoot_one_Actions )
endfunction
[/jass] |
|