找回密码
 点一下
查看: 1598|回复: 5

问个J的问题

[复制链接]
发表于 2011-1-3 12:49:55 | 显示全部楼层 |阅读模式
  1. globals
  2.     hashtable HT=null
  3. endglobals
  4. function Init takes nothing returns nothing
  5.     call FlushParentHashtable(HT)
  6.     set HT=InitHashtable()
  7. endfunction
  8. function Voodoo_Restoration_Check takes nothing returns boolean
  9.     if(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE))then
  10.         return false
  11.     endif
  12.     if(not(IsUnitAlly(GetFilterUnit(),GetOwningPlayer(udg_Temp_unit))==true))then
  13.         return false
  14.     endif
  15.     return true
  16. endfunction
  17. function Voodoo_Restoration_Conditions takes nothing returns boolean
  18.     if (not(OrderId2StringBJ(GetIssuedOrderIdBJ())=="immolation"))then
  19.         return false
  20.     endif
  21.     if (not(OrderId2StringBJ(GetIssuedOrderIdBJ())=="unimmolation"))then
  22.         return false
  23.     endif
  24.     if (not(GetUnitTypeId(GetOrderTargetUnit())=='E000'))then
  25.         return false
  26.     endif
  27.     return true
  28. endfunction
  29. function Voodoo_Restoration_Main takes nothing returns nothing
  30.     local trigger vrt=GetTriggeringTrigger()
  31.     local unit hero=LoadUnitHandle(HT,1,1)
  32.     local integer level=GetUnitAbilityLevelSwapped('A002',hero)
  33.     local group team=CreateGroup()
  34.     local unit target
  35. &#160;&#160;&#160;&#160;if(GetUnitState(hero,UNIT_STATE_MANA)<(level*6+2))then
  36. &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;call DisableTrigger(vrt)
  37. &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;call DestroyTrigger(vrt)
  38. &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;set vrt=null
  39. &#160;&#160;&#160;&#160;endif
  40. &#160;&#160;&#160;&#160;set udg_Temp_unit=hero
  41. &#160;&#160;&#160;&#160;call GroupEnumUnitsInRange(team,GetUnitX(hero),GetUnitY(hero),340,Condition(function Voodoo_Restoration_Check))
  42. &#160;&#160;&#160;&#160;call GroupAddUnit(team,hero)
  43. &#160;&#160;&#160;&#160;loop
  44. &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;set target=FirstOfGroup(team)
  45. &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;exitwhen(target==null)
  46. &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;call SetUnitState(target,UNIT_STATE_LIFE,(GetUnitState(target,UNIT_STATE_LIFE)+(8*(level +1))))
  47. &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;call GroupRemoveUnit(team,target)
  48. &#160;&#160;&#160;&#160;endloop
  49. &#160;&#160;&#160;&#160;call DestroyGroup(team)
  50. &#160;&#160;&#160;&#160;set team=null
  51. &#160;&#160;&#160;&#160;set target=null
  52. &#160;&#160;&#160;&#160;set hero=null
  53. endfunction
  54. function Voodoo_Restoration_Actions takes nothing returns nothing
  55. &#160;&#160;&#160;&#160;local unit hero=GetOrderTargetUnit()
  56. &#160;&#160;&#160;&#160;local trigger actions=CreateTrigger()
  57. &#160;&#160;&#160;&#160;call TriggerRegisterTimerEventPeriodic(actions,.25)
  58. &#160;&#160;&#160;&#160;call TriggerAddAction(actions,function Voodoo_Restoration_Main)
  59. &#160;&#160;&#160;&#160;call SaveUnitHandle(HT,1,1,hero)
  60. &#160;&#160;&#160;&#160;if(GetIssuedOrderId()==OrderId("immolation"))then
  61. &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;call EnableTrigger(actions)
  62. &#160;&#160;&#160;&#160;else
  63. &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;call DisableTrigger(actions)
  64. &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;call DestroyTrigger(actions)
  65. &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;set actions=null
  66. &#160;&#160;&#160;&#160;endif
  67. &#160;&#160;&#160;&#160;set hero=null
  68. endfunction
  69. function InitTrig_Voodoo_Restoration takes nothing returns nothing
  70. &#160;&#160;&#160;&#160;local trigger Voodoo_Restoration=CreateTrigger()
  71. &#160;&#160;&#160;&#160;call TriggerRegisterAnyUnitEventBJ(Voodoo_Restoration,EVENT_PLAYER_UNIT_ISSUED_ORDER)
  72. &#160;&#160;&#160;&#160;call TriggerAddCondition(Voodoo_Restoration,Condition(function Voodoo_Restoration_Conditions))
  73. &#160;&#160;&#160;&#160;call TriggerAddAction(Voodoo_Restoration,function Voodoo_Restoration_Actions)
  74. &#160;&#160;&#160;&#160;set Voodoo_Restoration=null
  75. endfunction
复制代码
请问哪里错了,改怎么修改
是献祭类似的&#160;&#160;
发表于 2011-1-3 13:40:43 | 显示全部楼层
那出什么问题了呢?
回复

使用道具 举报

 楼主| 发表于 2011-1-3 15:27:51 | 显示全部楼层
引用第1楼希瓦于2011-01-03 13:40发表的  :
那出什么问题了呢?
运行没感觉
回复

使用道具 举报

发表于 2011-1-3 15:30:28 | 显示全部楼层
先逐行调试一下吧
回复

使用道具 举报

发表于 2011-1-4 17:50:08 | 显示全部楼层
我在想要不要放到Jass区
那里有点冷耶

还是放吧
回复

使用道具 举报

发表于 2011-1-4 19:49:48 | 显示全部楼层
没电脑……
最好单独发个图,不一定是j自身的问题……
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-28 23:23 , Processed in 0.136197 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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