找回密码
 点一下
查看: 1242|回复: 1

请问这段问题出在哪

[复制链接]
发表于 2014-8-11 11:52:50 | 显示全部楼层 |阅读模式
  1. function Trig_ZhuaS_Conditions takes nothing returns boolean
  2.     if ( not ( GetSpellAbilityId() == 'A006' ) ) then
  3.         return false
  4.     endif
  5.     return true
  6. endfunction


  7. function Zhua takes nothing returns nothing
  8.     local location up = GetUnitLoc(udg_ZhuaU)
  9.     call PauseUnitBJ( true, udg_ZhuaU )
  10.     call ReviveHeroLoc( udg_ZhuaU, up, false )
  11.     call RemoveLocation( up )
  12.     call SetUnitLifePercentBJ( udg_ZhuaU, 1.00 )
  13.     call SetUnitOwner( udg_ZhuaU, Player(0), true )
  14.     call SetUnitAnimation( udg_ZhuaU, "death" )
  15.     set up = null
  16. endfunction

  17. function ZhuaSFaDong takes code f , unit su returns trigger
  18.     local trigger t = CreateTrigger()
  19.     call TriggerAddAction( t, f )
  20.     call TriggerRegisterUnitEvent( t, su, EVENT_UNIT_DEATH )
  21.     return t
  22. endfunction   

  23. function Trig_ZhuaS_Actions takes nothing  returns nothing
  24.     local trigger t = ZhuaSFaDong(function Zhua,udg_ZhuaU)
  25.     set udg_ZhuaU = GetSpellTargetUnit()
  26.     call PolledWait(4)
  27.     call DestroyTrigger(t)
  28.     set t = null
  29. endfunction
  30.      

  31. //=================================================================   
  32. function InitTrig_ZhuaS takes nothing returns nothing
  33.     set gg_trg_ZhuaS = CreateTrigger(  )
  34.     call TriggerRegisterAnyUnitEventBJ( gg_trg_ZhuaS, EVENT_PLAYER_UNIT_SPELL_EFFECT )
  35.     call TriggerAddCondition( gg_trg_ZhuaS, Condition( function Trig_ZhuaS_Conditions ) )
  36.     call TriggerAddAction( gg_trg_ZhuaS, function Trig_ZhuaS_Actions )
  37. endfunction                        
复制代码


我想做一个施放目标身上,然后在持续时间内打死目标那么他就变成我的人了,但是完全没有效果。请问问题出在哪里。
发表于 2014-8-12 20:15:49 | 显示全部楼层
call SetUnitOwner( udg_ZhuaU, Player(0), true )
这1行出错了 不起效果
应该是改变单位所有者给施法单位的所有者(需要全局变量先定义)
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-25 04:19 , Processed in 0.160291 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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