找回密码
 点一下
查看: 1812|回复: 4

求把这段代码转成可以复制到war3map.j里面运行的形式

[复制链接]
发表于 2011-5-22 18:53:36 | 显示全部楼层 |阅读模式
function Trig_XSlash_Conditions takes nothing returns boolean
return ((GetSpellAbilityId()=='A904'))
endfunction
function Trig_XSlash_Actions takes nothing returns nothing
set udg_XSlash_Caster=GetSpellAbilityUnit()
set udg_XSlash_Target=GetSpellTargetUnit()
call CreateNUnitsAtLocFacingLocBJ(1,'H0AB',GetOwningPlayer(udg_XSlash_Caster),PolarProjectionBJ(GetUnitLoc(udg_XSlash_Target),256.00,(AngleBetweenPoints(GetUnitLoc(udg_XSlash_Target),GetUnitLoc(udg_XSlash_Caster))+45.00)),GetUnitLoc(udg_XSlash_Target))
set udg_XSlash_Mirror[0]=bj_lastCreatedUnit
call SetUnitAnimationWithRarity(udg_XSlash_Mirror[0],"attack",RARITY_RARE)
call SetUnitVertexColorBJ(udg_XSlash_Mirror[0],100,100,100,50.00)
call CreateNUnitsAtLocFacingLocBJ(1,'H0AB',GetOwningPlayer(udg_XSlash_Caster),PolarProjectionBJ(GetUnitLoc(udg_XSlash_Target),256.00,(AngleBetweenPoints(GetUnitLoc(udg_XSlash_Target),GetUnitLoc(udg_XSlash_Caster))-45.00)),GetUnitLoc(udg_XSlash_Target))
set udg_XSlash_Mirror[1]=bj_lastCreatedUnit
call SetUnitAnimationWithRarity(udg_XSlash_Mirror[1],"attack",RARITY_RARE)
call SetUnitVertexColorBJ(udg_XSlash_Mirror[1],100,100,100,50.00)
call PolledWait(GetRandomReal(0.40,0.70))
call AddSpecialEffectTargetUnitBJ("origin",udg_XSlash_Target,"Abilities\\Spells\\Orc\\AncestralSpirit\\AncestralSpiritCaster.mdl")
set bj_forLoopAIndex=0
set bj_forLoopAIndexEnd=1
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call SetUnitTimeScalePercent(udg_XSlash_Mirror[bj_forLoopAIndex],0.00)
call SetUnitPositionLoc(udg_XSlash_Mirror[bj_forLoopAIndex],PolarProjectionBJ(GetUnitLoc(udg_XSlash_Mirror[bj_forLoopAIndex]),512.00,GetUnitFacing(udg_XSlash_Mirror[bj_forLoopAIndex])))
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call AddSpecialEffectTargetUnitBJ("origin",udg_XSlash_Mirror[0],"Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl")
call AddSpecialEffectTargetUnitBJ("origin",udg_XSlash_Mirror[1],"Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl")
set bj_forLoopBIndex=6
set bj_forLoopBIndexEnd=10
loop
exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
call SetUnitVertexColorBJ(udg_XSlash_Mirror[0],100,100,100,((0.00+I2R(bj_forLoopBIndex))*10.00))
call SetUnitVertexColorBJ(udg_XSlash_Mirror[1],100,100,100,((0.00+I2R(bj_forLoopBIndex))*10.00))
call PolledWait(0.05)
set bj_forLoopBIndex=bj_forLoopBIndex+1
endloop
call RemoveUnit(udg_XSlash_Mirror[0])
call RemoveUnit(udg_XSlash_Mirror[1])
endfunction

//===========================================================================
function InitTrig_XSlash takes nothing returns nothing
set gg_trg_XSlash=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_XSlash,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_XSlash,Condition(function Trig_XSlash_Conditions))
call TriggerAddAction(gg_trg_XSlash,function Trig_XSlash_Actions)
endfunction

我复制这段代码放进war3map.j 结果地图运行不了了 高手帮忙则个 小弟万分感激
发表于 2011-5-23 12:11:25 | 显示全部楼层
这不是“转换”的问题~~
这不是VJ
全局变量的定义只能在放到globals里面
回复

使用道具 举报

发表于 2011-5-26 18:16:52 | 显示全部楼层
这个应该是T2J吧.
里面竟然还有.set bj_forLoopBIndexEnd=10这种东东...表示LZ应该去学J.然后你自然就明白.
表示我现在手头没有WE.无奈..
回复

使用道具 举报

发表于 2011-5-26 22:25:48 | 显示全部楼层
好吧.我又看了下.表示本来是想帮忙转一下的.不过我发现里面竟然有 'H0AB' 这种东东..表示这已经超出我的能力范围了...不知道这个j是用来干嘛的....所以帮不上什么忙了...
回复

使用道具 举报

发表于 2011-5-27 17:27:30 | 显示全部楼层
T2J。。。。
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-4 10:23 , Processed in 0.052616 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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