请选择 进入手机版 | 继续访问电脑版

 找回密码
 点一下
查看: 1573|回复: 11

沟壑技能如何弄成属性伤害?

[复制链接]
发表于 2014-12-6 00:04:02 | 显示全部楼层 |阅读模式
本帖最后由 RoyalFlare 于 2014-12-6 17:07 编辑

  1. globals
  2.     gamecache udg_Titans_Cache=null
  3. endglobals
  4. function H2I takes handle H returns integer
  5.     return H
  6.     return 0
  7. endfunction
  8. function I2U takes integer I returns unit
  9.     return I
  10.     return null
  11. endfunction
  12. function H2S takes handle H returns string
  13.     return I2S(H2I(H))
  14.     return null
  15. endfunction
  16. function FlushEx takes string MissionKey returns nothing
  17.     call FlushStoredMission(udg_Titans_Cache,MissionKey)
  18. endfunction
  19. function SaveInteger takes string MissionKey,string Key,integer Value returns nothing
  20.     call StoreInteger(udg_Titans_Cache,MissionKey,Key,Value)
  21. endfunction
  22. function SaveReal takes string MissionKey,string Key,real Value returns nothing
  23.     call StoreReal(udg_Titans_Cache,MissionKey,Key,Value)
  24. endfunction
  25. function GetInteger takes string MissionKey,string Key returns integer
  26.     return GetStoredInteger(udg_Titans_Cache,MissionKey,Key)
  27. endfunction
  28. function GetReal takes string MissionKey,string Key returns real
  29.     return GetStoredReal(udg_Titans_Cache,MissionKey,Key)
  30. endfunction

  31. function BigCreviceRun takes nothing returns nothing
  32.     local real Face
  33.     local real x
  34.     local real y
  35.     local unit Unia
  36.     local unit Unib
  37.     local real NeedExtent=GetReal("BigCrevice"+H2S(GetExpiredTimer()),"NeedExtent")
  38.     local real HoofExtent=GetReal("BigCrevice"+H2S(GetExpiredTimer()),"HoofExtent")
  39.     if HoofExtent<NeedExtent then
  40.         set Face=GetReal("BigCrevice"+H2S(GetExpiredTimer()),"Face")
  41.         set x=GetReal("BigCrevice"+H2S(GetExpiredTimer()),"x")
  42.         set y=GetReal("BigCrevice"+H2S(GetExpiredTimer()),"y")
  43.         set Unia=I2U(GetInteger("BigCrevice"+H2S(GetExpiredTimer()),"Hero"))
  44.         set Unib=CreateUnit(GetOwningPlayer(Unia),'u00B',x,y,0)
  45.         call UnitAddAbility(Unib,'A0A0')
  46.         call SetUnitAbilityLevel(Unib,'A0A0',GetUnitAbilityLevel(Unia,'A07Y'))
  47.         call IssuePointOrderById(Unib,852224,x,y)
  48.         call UnitApplyTimedLife(Unib,'BHwe',2)
  49.         call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\TreantMissile\\TreantMissile.mdx",x,y))
  50.         call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdx",x,y))
  51.         set x=x+80*Cos(Face*(3.14159/180))
  52.         set y=y+80*Sin(Face*(3.14159/180))
  53.         call SaveReal("BigCrevice"+H2S(GetExpiredTimer()),"x",x)
  54.         call SaveReal("BigCrevice"+H2S(GetExpiredTimer()),"y",y)
  55.         call SaveReal("BigCrevice"+H2S(GetExpiredTimer()),"HoofExtent",HoofExtent+80)
  56.         set Unia=null
  57.         set Unib=null
  58.     else
  59.         call FlushEx("BigCrevice"+H2S(GetExpiredTimer()))
  60.         call PauseTimer(GetExpiredTimer())
  61.         call DestroyTimer(GetExpiredTimer())
  62.     endif
  63. endfunction
  64. function BigCrevice takes unit Unia,real x,real y returns nothing
  65.     local timer Tima=CreateTimer()
  66.     local real Face=(180/3.14159)*Atan2(y-GetUnitY(Unia),x-GetUnitX(Unia))
  67.     call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl",GetUnitX(Unia),GetUnitY(Unia)))
  68.     call SaveReal("BigCrevice"+H2S(Tima),"NeedExtent",(GetUnitAbilityLevel(Unia,'A07Y')*100)+800)
  69.     call SaveReal("BigCrevice"+H2S(Tima),"HoofExtent",0)
  70.     call SaveReal("BigCrevice"+H2S(Tima),"Face",Face)
  71.     call SaveReal("BigCrevice"+H2S(Tima),"x",GetUnitX(Unia)+64*Cos(Face*(3.14159/180)))
  72.     call SaveReal("BigCrevice"+H2S(Tima),"y",GetUnitY(Unia)+64*Sin(Face*(3.14159/180)))
  73.     call SaveInteger("BigCrevice"+H2S(Tima),"Hero",H2I(Unia))
  74.     call TimerStart(Tima,0.03,true,function BigCreviceRun)
  75.     set Tima=null
  76. endfunction
  77. //===========================================================================
  78. function InitTrig_Big_Crevice takes nothing returns nothing
  79. endfunction
复制代码

今天参考了louter的模拟火焰雨技能演示 照着格式摸索着写了1个撼地神牛的沟壑技能 如何捕捉马甲单位释放的技能命令并选取直线范围区域造成属性伤害?
游戏缓存真心伤不起
@希瓦 @chyj4747 @ckpig
 楼主| 发表于 2014-12-6 00:05:12 | 显示全部楼层
本帖最后由 RoyalFlare 于 2014-12-6 17:12 编辑

真心想念猪头酱和actboy168 哦.还有louter Jass启蒙导师呢
如果他们还活跃在论坛的话
@zhuzeitou
回复

使用道具 举报

 楼主| 发表于 2014-12-6 01:04:54 | 显示全部楼层
本帖最后由 RoyalFlare 于 2014-12-6 17:42 编辑

  1. function SpellPitLordEstimate takes nothing returns boolean
  2.     local location Loca
  3.     local unit Unia=null
  4.     if GetSpellAbilityId()=='A07Y' then
  5.         set Loca=GetSpellTargetLoc()
  6.         set Unia=GetSpellTargetUnit()
  7.         if Unia!=null then
  8.             call BigCrevice(GetTriggerUnit(),GetUnitX(Unia),GetUnitY(Unia))
  9.         else
  10.             call BigCrevice(GetTriggerUnit(),GetLocationX(Loca),GetLocationY(Loca))
  11.         endif
  12.         call RemoveLocation(Loca)
  13.         set Unia=null
  14.         set Loca=null
  15. endfunction
  16. function SpellPitLord takes unit Unia returns nothing
  17.     local trigger Tria=CreateTrigger()
  18.     call TriggerRegisterUnitEvent(Tria,Unia,EVENT_UNIT_SPELL_EFFECT)
  19.     call TriggerAddCondition(Tria,Condition(function SpellPitLordEstimate))
  20.     set Tria=null
  21. endfunction
  22. function InitTrig_Spell_PitLord takes nothing returns nothing
  23. endfunction
复制代码
调用的方法= =

点评

请说明具体添加在哪1行 谢谢  发表于 2014-12-6 18:37
少了一个endif和return  发表于 2014-12-6 18:34
回复

使用道具 举报

发表于 2014-12-6 01:34:42 | 显示全部楼层
创建马甲那里选范围内单位造成伤害不就好了。。
英雄你也存了能取到
回复

使用道具 举报

 楼主| 发表于 2014-12-6 17:09:19 | 显示全部楼层
本帖最后由 RoyalFlare 于 2014-12-6 17:11 编辑

@chyj4747 JassHelper提示 Missing Endblock(缺少结束部分字符) 编译不通过
求解到底是哪1行的问题
顺便吐槽1下 为什麽在技能区发Jass相关的问题总是查看的人多回复的人少 大部分的帖子都这样

回复

使用道具 举报

发表于 2014-12-6 18:23:36 | 显示全部楼层
RoyalFlare 发表于 2014-12-6 17:09
@chyj4747 JassHelper提示 Missing Endblock(缺少结束部分字符) 编译不通过
求解到底是哪1行的问题
顺便 ...

板凳第15、16行看起来怪怪的哦

点评

=_=因为我精简了部分代码 调用的部分关联3个技能的ID 我去掉了2个部分 把A0A1和A0A1部分的条件抹杀了 保留A07Y部分 于是悲剧就这麽发生了  详情 回复 发表于 2014-12-6 18:35
回复

使用道具 举报

 楼主| 发表于 2014-12-6 18:35:39 | 显示全部楼层
本帖最后由 RoyalFlare 于 2014-12-6 19:09 编辑
zhuzeitou 发表于 2014-12-6 18:23
板凳第15、16行看起来怪怪的哦


  1. function SpellPitLordEstimate takes nothing returns boolean
  2.     local location Loca
  3.     local unit Unia=null
  4.     if GetSpellAbilityId()=='A07Y' then
  5.         set Loca=GetSpellTargetLoc()
  6.         set Unia=GetSpellTargetUnit()
  7.         if Unia!=null then
  8.             call BigCrevice(GetTriggerUnit(),GetUnitX(Unia),GetUnitY(Unia))
  9.         else
  10.             call BigCrevice(GetTriggerUnit(),GetLocationX(Loca),GetLocationY(Loca))
  11.         endif
  12.         call RemoveLocation(Loca)
  13.         set Unia=null
  14.         set Loca=null
  15.         endif
  16.         return false
  17. endfunction
  18. function SpellPitLord takes unit Unia returns nothing
  19.     local trigger Tria=CreateTrigger()
  20.     call TriggerRegisterUnitEvent(Tria,Unia,EVENT_UNIT_SPELL_EFFECT)
  21.     call TriggerAddCondition(Tria,Condition(function SpellPitLordEstimate))
  22.     set Tria=null
  23. endfunction
  24. //===========================================================================
  25. function InitTrig_SpellPitLord takes nothing returns nothing
  26. endfunction
复制代码


根据希瓦的提示添加了endif 和return false 然后...
Line 404:  Symbol udg_Titans_Cache multiply defined
于是悲剧就这麽发生了

点评

变量重定义了?用JassCraft检查一下语法吧,we的jass语法检查不靠谱啊  发表于 2014-12-10 01:38
回复

使用道具 举报

 楼主| 发表于 2014-12-6 18:38:36 | 显示全部楼层
本帖最后由 RoyalFlare 于 2014-12-6 19:36 编辑

智商不够用了XD 求帮忙的说
call UnitDamageTargetBJ应该写在哪1行里? call ForGroup呢?

点评

gamecache udg_Titans_Cache=null 删除这部分之后地图成功保存 全局变量不能重复定义 我又二逼了  发表于 2014-12-6 19:21
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-3-29 16:08 , Processed in 0.250099 second(s), 29 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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