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

召唤技能技能命令ID无法捕捉问题

[复制链接]
发表于 2009-7-31 23:27:00 | 显示全部楼层 |阅读模式
今天在用JASS帮别人做个双重施法模版,所有技能都可以双重释放了,但是召唤技能就不行,
我把召唤技能的命令ID显示出来,发现所有召唤技能都是同一个ID,估计是为了召唤事件
所以郁闷了 问如何捕捉召唤技能的命令ID 是命令ID 不是技能ID
发表于 2009-7-31 23:34:44 | 显示全部楼层
你是怎么捕捉命令id的?
把触发帖上来看下吧
回复

使用道具 举报

 楼主| 发表于 2009-7-31 23:49:57 | 显示全部楼层
当然是用混合事件 用命令事件捕捉ID  技能事件捕捉技能
因为他才刚学JASS 我暂时还不想用retrn bug 1.24 中国啊... 有指望吗?
[codes=jass]
function Trig_DoubleSpell_Delete_Actions takes nothing returns nothing
call RemoveUnit(GetSpellAbilityUnit())
call DestroyTrigger(GetTriggeringTrigger())
endfunction

function Trigger_DoubleSpell_Conditions takes nothing returns boolean
if ( GetUnitAbilityLevel(GetTriggerUnit(),'Aloc') == 0 and IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO)) then
if ( GetTriggerEventId() == EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER ) then
call BJDebugMsg("指定目标命令事件 触发玩家ID:"+I2S(GetPlayerId(GetTriggerPlayer())))
set udg_AbilityOrder[GetPlayerId(GetTriggerPlayer())] = GetIssuedOrderId()
return false
elseif ( GetTriggerEventId() == EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER ) then
set udg_AbilityOrder[GetPlayerId(GetTriggerPlayer())] = GetIssuedOrderId()
return false
elseif ( GetTriggerEventId() == EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER ) then
set udg_AbilityOrder[GetPlayerId(GetTriggerPlayer())] = GetIssuedOrderId()
return false
elseif ( GetTriggerEventId() == EVENT_PLAYER_UNIT_SPELL_EFFECT ) then
call BJDebugMsg("技能效果发动事件 触发玩家ID:"+I2S(GetPlayerId(GetTriggerPlayer())))
return true
endif
endif
return false
endfunction

function Trig_DoubleSpell_Actions takes nothing returns nothing
local unit spellUnit = GetSpellAbilityUnit()
local location spellLoc = null
local unit helper = CreateUnit(GetTriggerPlayer(),'ewsp',GetUnitX(spellUnit),GetUnitY(spellUnit),0)
local integer abilityId = GetSpellAbilityId()
local integer orderId = udg_AbilityOrder[GetPlayerId(GetTriggerPlayer())]
local boolean suceess = false
local trigger tempTrigger = null
call BJDebugMsg(I2S(orderId))
call UnitAddAbility(helper, abilityId)
call SetUnitAbilityLevel(helper,abilityId,GetUnitAbilityLevel(spellUnit,abilityId))
if ( GetSpellTargetUnit() != null ) then
set suceess = IssueTargetOrderById(helper,orderId,GetSpellTargetUnit())
else
set spellLoc = GetSpellTargetLoc()
if ( spellLoc != null) then
call BJDebugMsg("点目标技能")
set suceess = IssuePointOrderById(helper,orderId,GetLocationX(spellLoc),GetLocationY(spellLoc))
call RemoveLocation(spellLoc)
set spellLoc = null
else
call BJDebugMsg("无目标目标技能")
set suceess = IssueImmediateOrderById(helper, orderId )
endif
endif
if (suceess) then
set tempTrigger = CreateTrigger()
call TriggerRegisterUnitEvent(tempTrigger,helper,EVENT_UNIT_SPELL_FINISH)
call TriggerRegisterUnitEvent(tempTrigger,spellUnit,EVENT_UNIT_SPELL_ENDCAST)
call TriggerAddAction(tempTrigger,function Trig_DoubleSpell_Delete_Actions)
set tempTrigger = null
else
call DisplayTextToPlayer(GetTriggerPlayer(),0,0,"双重施法失败")
endif
set spellUnit = null
set helper = null
endfunction

//===========================================================================
function InitTrig_DoubleSpell takes nothing returns nothing
local integer index = 0
set gg_trg_DoubleSpell = CreateTrigger( )
loop
call TriggerRegisterPlayerUnitEvent(gg_trg_DoubleSpell, Player(index), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_DoubleSpell, Player(index), EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_DoubleSpell, Player(index), EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_DoubleSpell, Player(index), EVENT_PLAYER_UNIT_ISSUED_ORDER, null)
set index = index + 1
exitwhen index == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddCondition( gg_trg_DoubleSpell, Condition(function Trigger_DoubleSpell_Conditions))
call TriggerAddAction( gg_trg_DoubleSpell, function Trig_DoubleSpell_Actions )
endfunction
[/codes]
回复

使用道具 举报

发表于 2009-8-1 00:44:59 | 显示全部楼层
请仔细看前两个判断条件……
你判断了两次目标命令,而没有判断无目标命令
if ( GetTriggerEventId() == EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER ) then

call BJDebugMsg("指定目标命令事件 触发玩家ID:"+I2S(GetPlayerId(GetTriggerPlayer())))

set udg_AbilityOrder[GetPlayerId(GetTriggerPlayer())] = GetIssuedOrderId()

return false

elseif ( GetTriggerEventId() == EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER ) then

set udg_AbilityOrder[GetPlayerId(GetTriggerPlayer())] = GetIssuedOrderId()

return false
回复

使用道具 举报

 楼主| 发表于 2009-8-1 12:52:11 | 显示全部楼层
额 ...................  又做出了愚蠢的事情 3Q
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-25 19:37 , Processed in 0.094811 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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