找回密码
 点一下
查看: 2562|回复: 7

这个算不算J?怎么修改?

[复制链接]
发表于 2009-10-31 02:11:22 | 显示全部楼层 |阅读模式
其实,怎么样滴J才算是纯J,具体是什么格式?我是新手····
[jass]
globals
    // User-defined
    integer                 udg_ll_s                   = 0
    integer                 udg_stop_x3                = 0
    integer                 udg_ll_t                   = 0
endglobals

function Trig_stop_x3_1_Conditions takes nothing returns boolean
if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("stop") ) ) then
return false
endif
return true
endfunction


function Trig_stop_x3_1_Actions takes nothing returns nothing
set udg_stop_x3=(udg_stop_x3+1)
if(udg_stop_x3==3)then
if GetUnitAbilityLevelSwapped('A004', GetTriggerUnit()) > 0 then
elseif GetUnitTypeId(GetTriggerUnit()) == 'Obla'then
call DisplayTextToPlayer( GetOwningPlayer(GetTriggerUnit()), 0, 0, ( "杀敌数量为|cff00FFFF" + ( I2S(udg_ll_s) + "|r!" ) ) )
endif
if GetUnitAbilityLevelSwapped('A000', GetTriggerUnit()) > 0 then
elseif GetUnitTypeId(GetTriggerUnit()) == 'O000'then
call DisplayTextToPlayer( GetOwningPlayer(GetTriggerUnit()), 0, 0, ( "杀敌数量为|cff00FFFF" + ( I2S(udg_ll_t) + "|r!" ) ) )
endif
set udg_stop_x3=0
else
call PolledWait(0.30)
set udg_stop_x3=0
endif
endfunction

//===========================================================================
function InitTrig_stop_x3_1 takes nothing returns nothing
set gg_trg_stop_x3_1 = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_stop_x3_1, Player(0), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerAddCondition( gg_trg_stop_x3_1, Condition( function Trig_stop_x3_1_Conditions ) )
call TriggerAddAction( gg_trg_stop_x3_1, function Trig_stop_x3_1_Actions )
endfunction
[/jass]

上面滴运行不了?条件合并不了?
其实只想做些纯J滴技能···还真难···


额,把这两个删掉就运行了!
[jass]
elseif GetUnitTypeId(GetTriggerUnit()) == 'Obla'then

elseif GetUnitTypeId(GetTriggerUnit()) == 'O000'then
[/jass]
发表于 2009-10-31 09:00:20 | 显示全部楼层
不用GUI的基本上都是J了
没有什么J的固定格式,只有语法
使用自定义代码是介于TJ之间的方式
那两句是判断单位的类型的
条件不满足自然无法运行
回复

使用道具 举报

发表于 2009-10-31 11:01:00 | 显示全部楼层
这个可以算是纯J了。不过写法有点土就是。
回复

使用道具 举报

 楼主| 发表于 2009-10-31 21:53:24 | 显示全部楼层
嗯嗯,明白了······· ,受教了!
回复

使用道具 举报

 楼主| 发表于 2009-10-31 21:57:13 | 显示全部楼层
有什么更好滴写法呢?
回复

使用道具 举报

发表于 2009-11-9 11:04:33 | 显示全部楼层
[jass]//触发条件
function Trig_stop_x3_1_Conditions takes nothing returns boolean
return GetIssuedOrderId()==String2OrderIdBJ("stop")
endfunction

//触发动作
function Trig_stop_x3_1_Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
local integer i=GetUnitTypeId(u)
set udg_stop_x3=udg_stop_x3+1
if udg_stop_x3==3 then
    if GetUnitAbilityLevel(u,'A004')<=0 and i=='Obla' then
        call DisplayTextToPlayer(GetOwningPlayer(u),0,0,"杀敌数量为|cff00FFFF"+I2S(udg_ll_s)+"|r!")
    endif
    if GetUnitAbilityLevel(u,'A000')<=0 and i=='O000' then
        call DisplayTextToPlayer(GetOwningPlayer(u),0,0,"杀敌数量为|cff00FFFF"+I2S(udg_ll_t)+"|r!")
    endif
    set udg_stop_x3=0
else
    call PolledWait(0.30)
    set udg_stop_x3=0
endif
set u=null
endfunction

//注册触发器
function InitTrig_stop_x3_1 takes nothing returns nothing
set gg_trg_stop_x3_1=CreateTrigger()
call TriggerRegisterPlayerUnitEvent(gg_trg_stop_x3_1,Player(0),EVENT_PLAYER_UNIT_ISSUED_ORDER,null)
call TriggerAddCondition(gg_trg_stop_x3_1,Condition(function Trig_stop_x3_1_Conditions))
call TriggerAddAction(gg_trg_stop_x3_1,function Trig_stop_x3_1_Actions)
endfunction[/jass]

这样才稍微算Jass,没有从触发转出来的多余的东西

。。。

优化完后才发现是个坟帖,况且那两个elseif竟然似乎在楼主看来是多余的
回复

使用道具 举报

发表于 2010-1-21 13:58:36 | 显示全部楼层
貌似是T转化的吧
回复

使用道具 举报

发表于 2010-1-31 21:19:44 | 显示全部楼层
是J文件里 拷贝的吧
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-27 14:43 , Processed in 0.074704 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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