|
发表于 2011-11-20 23:54:46
|
显示全部楼层
首先,贴触发请使用“WE复制插件”的说~
事先申明我是不懂YD那些动作的……也就是下面说的不一定全部正确。。另外,有些动作太长了自动换行了,看着不爽的话就切换到“宽版模式”,按钮在页面的最右上角~
[trigger]未命名触发器 001
事件
单位 - 任意单位 发动技能效果
条件
动作
逆天<YDWE> - 设置 [单位] loc_A_JLCJB_DW = (触发单位)
逆天<YDWE> - 设置 [点] loc_A_JLCJB_D = ((触发单位) 的位置)
逆天<YDWE> - 设置 [点] loc_A_JLCJB_D1 = (技能施放点)
逆天<YDWE> - 设置 [单位] loc_A_JLCJB_DW1 = (新建 (触发玩家) 的 小精灵 在 (loc_A_JLCJB_D) 面向角度:((loc_loc_A_JLCJB_DW) 的面向角度) 度)
单位 - 为 (loc_loc_A_JLCJB_DW1) 添加 腐臭蜂群
逆天<YDWE> - 立即运行 (新建的计时器) 时间设置: 0.01 秒,是否循环: 循环
Timer - 参数
逆天<YDWE> - 设置 [整数] loc_A_JLCJB_ZS = 0
逆天<YDWE> - 设置 [单位] loc_A_JLCJB_DW1 = (loc_A_JLCJB_DW1)
Timer - 动作
如果(所有的条件成立) 则运行 (Then - 动作) 否则运行 (Else - 动作)
If - 条件
(loc_loc_A_JLCJB_ZS) 等于 10
Then - 动作
单位 - 删除 (loc_loc_A_JLCJB_DW1)
存储<YDWE> - 清空目录-> (获取 (到期的计时器) 的整数地址)
计时器 - 删除 (到期的计时器)
Else - 动作
逆天<YDWE> - 设置 [整数] loc_A_JLCJB_ZS = ((loc_A_JLCJB_ZS) + 1)
单位 - 对 (loc_loc_A_JLCJB_DW1) 发布 不死族恐惧魔王 - 腐臭蜂群 命令到目标点: (loc_loc_A_JLCJB_D1)
[/trigger]
以上是T的部分,转换成J之后:
[jass]
function Trig____________________001_______uFunc007T takes nothing returns nothing
if ((YDTriggerGetEx(integer, YDTriggerH2I(GetExpiredTimer()), 0x2D623901) == 10)) then
call RemoveUnit( YDTriggerGetEx(unit, YDTriggerH2I(GetExpiredTimer()), 0x69651BEB) )
call YDWEFlushMissionByInteger( YDWEGetTimerID(GetExpiredTimer()) )
call DestroyTimer( GetExpiredTimer() )
else
call YDTriggerSetEx(integer, YDTriggerH2I(GetExpiredTimer()), 0x38DA8259, ( YDTriggerGetEx(integer, YDTriggerH2I(GetExpiredTimer()), 0x38DA8259) + 1 ))
call IssuePointOrderByIdLoc( YDTriggerGetEx(unit, YDTriggerH2I(GetExpiredTimer()), 0x69651BEB), 852218, YDTriggerGetEx(location, YDTriggerH2I(GetExpiredTimer()), 0x25C863CB) )
endif
endfunction
function Trig____________________001_______uActions takes nothing returns nothing
local timer ydl_timer
local integer ydl_localvar_step = YDTriggerGetEx(integer, YDTriggerH2I(GetTriggeringTrigger()), 0xCFDE6C76)
set ydl_localvar_step = ydl_localvar_step + 3
call YDTriggerSetEx(integer, YDTriggerH2I(GetTriggeringTrigger()), 0xCFDE6C76, ydl_localvar_step)
call YDTriggerSetEx(integer, YDTriggerH2I(GetTriggeringTrigger()), 0xECE825E7, ydl_localvar_step)
call YDTriggerSetEx(unit, YDTriggerH2I(GetTriggeringTrigger())*ydl_localvar_step, 0x31751601, GetTriggerUnit())
call YDTriggerSetEx(location, YDTriggerH2I(GetTriggeringTrigger())*ydl_localvar_step, 0xBF0AC331, GetUnitLoc(GetTriggerUnit()))
call YDTriggerSetEx(location, YDTriggerH2I(GetTriggeringTrigger())*ydl_localvar_step, 0x6DADAE71, GetSpellTargetLoc())
call YDTriggerSetEx(unit, YDTriggerH2I(GetTriggeringTrigger())*ydl_localvar_step, 0x47BC4774, CreateUnitAtLoc(GetTriggerPlayer(), 'ewsp', YDTriggerGetEx(location, YDTriggerH2I(GetTriggeringTrigger())*ydl_localvar_step, 0xBF0AC331), GetUnitFacing(YDTriggerGetEx(unit, YDTriggerH2I(GetTriggeringTrigger())*ydl_localvar_step, 0xD4A84013))))
call UnitAddAbility( YDTriggerGetEx(unit, YDTriggerH2I(GetTriggeringTrigger())*ydl_localvar_step, 0x69651BEB), 'A000' )
set ydl_timer = CreateTimer()
call YDTriggerSetEx(integer, YDTriggerH2I(ydl_timer), 0x38DA8259, 0)
call YDTriggerSetEx(unit, YDTriggerH2I(ydl_timer), 0x47BC4774, YDTriggerGetEx(unit, YDTriggerH2I(GetTriggeringTrigger())*ydl_localvar_step, 0x47BC4774))
call TimerStart(ydl_timer, 0.01, true, function Trig____________________001_______uFunc007T)
call YDTriggerClearTable(YDTriggerH2I(GetTriggeringTrigger())*ydl_localvar_step)
set ydl_timer = null
endfunction
//===========================================================================
function InitTrig____________________001_______u takes nothing returns nothing
set gg_trg____________________001_______u = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( gg_trg____________________001_______u, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction(gg_trg____________________001_______u, function Trig____________________001_______uActions)
endfunction[/jass]
可以看到在计时器运行之前的局部变量全都保存在这个触发器的索引下
[jass]YDTriggerH2I(GetTriggeringTrigger())[/jass]
但是对应的在“Timer参数”那里,那些局部变量是存在计时器索引下的
[jass]YDTriggerH2I(ydl_timer)[/jass]
最后这个计时器运行后,由于无法直接传参,所以需要用读取的方式,而让马甲施放技能到某点至少要两个参数,一是马甲本身,另一个就是技能释放点,LZ仅将马甲存入了计时器索引内,所以之后发布命令的时候技能释放点是无法从计时器索引里获取的
[jass]call IssuePointOrderByIdLoc( YDTriggerGetEx(unit, YDTriggerH2I(GetExpiredTimer()), 0x69651BEB), 852218, YDTriggerGetEx(location, YDTriggerH2I(GetExpiredTimer()), 0x25C863CB) )[/jass]
IssuePointOrderByIdLoc:发布点目标命令
YDTriggerGetEx(unit, YDTriggerH2I(GetExpiredTimer()), 0x69651BEB):这个是存的马甲
852218:腐臭蜂群的命令
YDTriggerGetEx(location, YDTriggerH2I(GetExpiredTimer()), 0x25C863CB) :???
WE说计时器索引下0x25C863CB这个位置是null。。。
然后。。其实我觉得loc_A_JLCJB_D和loc_A_JLCJB_D1这两个点没有排泄……
嘛。。我也不知道YD函数的内部机理。。这一点LZ去问别人吧~
最后。。表示去WOW8问YD问题也可以的啦~
果子也会偶尔出没……
至少来GA问YD的问题基本是没结果的。。 |
|