Advertisement
krot

jass скил холод

Jul 7th, 2023
1,134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. скил "Холод"
  2.  
  3. function Trig_PL02_Conditions takes nothing returns boolean
  4. return GetSpellAbilityId() == 'A0DB'
  5. endfunction
  6.  
  7. function Trig_PL02_G takes nothing returns boolean
  8. return GetWidgetLife(GetFilterUnit()) > 0.405 and IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetSpellAbilityUnit()))
  9. endfunction
  10.  
  11. function PL02_End takes nothing returns nothing
  12. local timer t = GetExpiredTimer()
  13. local integer tID = GetHandleId(t)
  14. local unit c = LoadUnitHandle(udg_cache,1,tID)
  15. call KillUnit©
  16. call RemoveUnit©
  17. call DestroyTimer(t)
  18. set c = null
  19. set t = null
  20. endfunction
  21.  
  22. function DummyUnit takes player pl, location l, integer lvl returns nothing
  23. local timer t = CreateTimer()
  24. local unit c = CreateUnitAtLoc(pl,'h00P',l, 0)
  25. local integer tID = GetHandleId(t)
  26. call RemoveLocation(l)
  27. call UnitAddAbility(c,'A0DH')
  28. call SetUnitAbilityLevel(c,'A0DH',lvl)
  29. call IssueImmediateOrder(c,"creepthunderclap")
  30. call SaveUnitHandle(udg_cache, 1, tID, c)
  31. call TimerStart(t,.5, false, function PL02_End )
  32. set c = null
  33. set t = null
  34. endfunction
  35.  
  36. function Trig_PL02_Actions takes nothing returns nothing
  37. local unit uA = GetSpellAbilityUnit()
  38. local player p = GetOwningPlayer(uA)
  39. local location lT = GetSpellTargetLoc()
  40. local integer lvl = GetUnitAbilityLevel(uA,'A0DB')
  41. local group g = CreateGroup()
  42. local group g2 = CreateGroup()
  43. local real osDmg = 10 + 10*lvl
  44. local real dopDmg = 10*lvl
  45. local real dmg
  46. local real rad = 375
  47. local integer sec = 8
  48. local unit f
  49. local unit c
  50. local integer In
  51. set g = GetUnitsInRangeOfLocMatching(rad,lT, Condition(function Trig_PL02_G))
  52. call DummyUnit(p,lT,lvl)
  53. set In = 1
  54. loop
  55. exitwhen In > sec or FirstOfGroup(g) == null
  56. set g2 = CopyGroup(g)
  57. loop
  58. set f = FirstOfGroup(g2)
  59. exitwhen f == null
  60. if GetUnitAbilityLevel(f,'B02E') > 0 then
  61. set dmg = osDmg + dopDmg
  62. else
  63. set dmg = osDmg
  64. endif
  65. if GetWidgetLife(f) > 0.405 then
  66. call UnitDamageTarget(uA,f,dmg,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
  67. else
  68. call GroupRemoveUnitSimple(f,g)
  69. endif
  70. call GroupRemoveUnitSimple(f,g2)
  71. endloop
  72. call PolledWait(1)
  73. set In = In + 1
  74. endloop
  75. call DestroyGroup(g2)
  76. set uA = null
  77. set p = null
  78. set lT = null
  79. set g = null
  80. set g2 = null
  81. set f = null
  82. set c = null
  83. endfunction
  84.  
  85. function InitTrig_PL02 takes nothing returns nothing
  86. local integer temp = 0
  87. local integer max = bj_MAX_PLAYER_SLOTS
  88. set gg_trg_PL02 = CreateTrigger( )
  89. loop
  90. exitwhen temp == max
  91. call TriggerRegisterPlayerUnitEvent(gg_trg_PL02, Player(temp), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
  92. set temp = temp + 1
  93. endloop
  94. call TriggerAddCondition( gg_trg_PL02, Condition( function Trig_PL02_Conditions ) )
  95. call TriggerAddAction( gg_trg_PL02, function Trig_PL02_Actions )
  96. endfunction
  97.  
  98. Скил "Заморозка":
  99.  
  100. function Trig_PL03_Conditions takes nothing returns boolean
  101. return GetUnitAbilityLevel(GetTriggerUnit(),'A0D9') > 0 and GetUnitTypeId(GetTriggerUnit()) == 'U00A'
  102. endfunction
  103.  
  104. function PL03_End takes nothing returns nothing
  105. local timer t = GetExpiredTimer()
  106. local integer tID = GetHandleId(t)
  107. local unit c = LoadUnitHandle(udg_cache,1,tID)
  108. local effect e = LoadEffectHandle(udg_cache,2,tID)
  109. call DestroyEffect(e)
  110. call SetUnitTimeScale( c, 1.00 )
  111. call PauseUnit(c, false)
  112. call DestroyTimer(t)
  113. set c = null
  114. set t = null
  115. set e = null
  116. endfunction
  117.  
  118. function Trig_PL03_Actions takes nothing returns nothing
  119. local effect e
  120. local timer t = CreateTimer()
  121. local integer tID = GetHandleId(t)
  122. local unit u = GetTriggerUnit()
  123. local unit T = GetAttacker()
  124. local integer lvl = GetUnitAbilityLevel(u,'A0D9')
  125. local real time = 0.5*lvl
  126. local real dmg = 50*lvl
  127. local integer percent = 18
  128. local integer c = GetRandomInt(1,100)
  129. if c <= percent then
  130. call SetUnitTimeScale( T, 0.00 )
  131. call PauseUnit(T, true)
  132. call UnitDamageTarget(u,T,dmg,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
  133. if GetWidgetLife(T) <= 0.405 then
  134. set time = 0
  135. endif
  136. set e = AddSpecialEffectTarget("Abilities\\Spells\\Undead\\FreezingBreath\\FreezingBreathTargetArt.mdl", T, "origin" )
  137. call SaveUnitHandle(udg_cache, 1, tID, T)
  138. call SaveEffectHandle(udg_cache, 2, tID, e)
  139. call TimerStart(t,time, false, function PL03_End )
  140. endif
  141. set e = null
  142. set u = null
  143. set T = null
  144. set t = null
  145. endfunction
  146.  
  147. function InitTrig_PL03 takes nothing returns nothing
  148. local integer temp = 0
  149. local integer max = bj_MAX_PLAYER_SLOTS
  150. set gg_trg_PL03 = CreateTrigger( )
  151. loop
  152. exitwhen temp == max
  153. call TriggerRegisterPlayerUnitEvent(gg_trg_PL03, Player(temp), EVENT_PLAYER_UNIT_ATTACKED, null)
  154. set temp = temp + 1
  155. endloop
  156. call TriggerAddCondition( gg_trg_PL03, Condition( function Trig_PL03_Conditions ) )
  157. call TriggerAddAction( gg_trg_PL03, function Trig_PL03_Actions )
  158. endfunction
  159.  
  160. Скил "Льды":
  161.  
  162. function Trig_PL04_Conditions takes nothing returns boolean
  163. return GetSpellAbilityId() == 'A0DJ' or GetSpellAbilityId() == 'A0DG'
  164. endfunction
  165.  
  166. function Trig_PL04_G takes nothing returns boolean
  167. return GetWidgetLife(GetFilterUnit()) > 0.405 and IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetSpellAbilityUnit()))
  168. endfunction
  169.  
  170. function Trig_PL04_Actions takes nothing returns nothing
  171. local integer idspell = GetSpellAbilityId()
  172. local integer idsimple = 'A0DJ'
  173. local integer id_dummy_spell = 'A0DI'
  174. local group g = CreateGroup()
  175. local group g2 = CreateGroup()
  176. local group g3 = CreateGroup()
  177. local unit u = GetSpellAbilityUnit()
  178. local player p = GetOwningPlayer(u)
  179. local location locT = GetSpellTargetLoc()
  180. local integer lvl = GetUnitAbilityLevel(u,idspell)
  181. local integer time = 4+lvl
  182. local real dmg = 150.00 * I2R(lvl)
  183. local real dopdmg = 100.00
  184. local integer doptime = 1
  185. local real radiusOs = 500.00
  186. local real radiusDop = 190.00
  187. local real delta = 18.00
  188. local string eff = "Abilities\\Spells\\Undead\\FrostArmor\\FrostArmorTarget.mdl"
  189. local integer In = 1
  190. local unit f
  191. local location l
  192. local location ll
  193. local effect e
  194. local effect array e2
  195. local unit c
  196. local unit uu
  197. set ll = locT
  198. set e2[1] = AddSpecialEffectLoc(eff,ll)
  199. call MoveLocation(ll, GetLocationX(ll) - delta, GetLocationY(ll) - delta)
  200. set e2[2] = AddSpecialEffectLoc(eff,ll)
  201. call MoveLocation(ll, GetLocationX(ll), GetLocationY(ll) + 2*delta)
  202. set e2[3] = AddSpecialEffectLoc(eff,ll)
  203. call MoveLocation(ll, GetLocationX(ll) + 2*delta, GetLocationY(ll))
  204. set e2[4] = AddSpecialEffectLoc(eff,ll)
  205. call MoveLocation(ll, GetLocationX(ll), GetLocationY(ll) - 2*delta)
  206. set e2[5] = AddSpecialEffectLoc(eff,ll)
  207. if idspell == idsimple then
  208. set time = time + doptime
  209. set dmg = dmg + dopdmg
  210. endif
  211. loop
  212. exitwhen In > time or LoadBoolean( udg_cache, 1, StringHash("pr"))
  213. set g = GetUnitsInRangeOfLocMatching(radiusOs, locT, Condition(function Trig_PL04_G))
  214. set uu = GroupPickRandomUnit(g)
  215. set l = GetUnitLoc(uu)
  216. set g2 = GetUnitsInRangeOfLocMatching(radiusDop, l, Condition(function Trig_PL04_G))
  217. loop
  218. set f = FirstOfGroup(g2)
  219. exitwhen f == null
  220. if IsUnitEnemy(f,p) == true and GetWidgetLife(f) > 0.405 then
  221. call UnitDamageTarget(u,f,dmg,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
  222. if GetWidgetLife(f)>0.405 then
  223. set c = CreateUnitAtLoc(p,'h00P',GetUnitLoc(f),0.00)
  224. call GroupAddUnit(g3,c)
  225. call UnitAddAbility(c,id_dummy_spell)
  226. call IssueTargetOrder(c,"slow",f)
  227. endif
  228. endif
  229. call GroupRemoveUnit(g2,f)
  230. endloop
  231. call GroupClear(g)
  232. if IsUnitEnemy(uu,p) == true then
  233. set e = AddSpecialEffectLoc("Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl",l)
  234. endif
  235. call PolledWait(1)
  236. call DestroyEffect(e)
  237. loop
  238. set f = FirstOfGroup(g3)
  239. exitwhen f == null
  240. call KillUnit(f)
  241. call RemoveUnit(f)
  242. call GroupRemoveUnit(g3,f)
  243. endloop
  244. set In = In + 1
  245. endloop
  246. call DestroyEffect(e2[1])
  247. call DestroyEffect(e2[2])
  248. call DestroyEffect(e2[3])
  249. call DestroyEffect(e2[4])
  250. call DestroyEffect(e2[5])
  251. call DestroyGroup(g)
  252. call DestroyGroup(g2)
  253. call DestroyGroup(g3)
  254. call RemoveLocation(locT)
  255. call RemoveLocation(l)
  256. call RemoveLocation(ll)
  257. set g = null
  258. set g2 = null
  259. set g3 = null
  260. set f = null
  261. set u = null
  262. set uu = null
  263. set locT = null
  264. set l = null
  265. set ll = null
  266. set e = null
  267. set e2[1] = null
  268. set e2[2] = null
  269. set e2[3] = null
  270. set e2[4] = null
  271. set e2[5] = null
  272. set eff = null
  273. set c = null
  274. set p = null
  275. endfunction
  276.  
  277. function InitTrig_PL04 takes nothing returns nothing
  278. local integer temp = 0
  279. local integer max = bj_MAX_PLAYER_SLOTS
  280. set gg_trg_PL04 = CreateTrigger( )
  281. loop
  282. exitwhen temp == max
  283. call TriggerRegisterPlayerUnitEvent(gg_trg_PL04, Player(temp), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
  284. set temp = temp + 1
  285. endloop
  286. call TriggerAddCondition( gg_trg_PL04, Condition( function Trig_PL04_Conditions ) )
  287. call TriggerAddAction( gg_trg_PL04, function Trig_PL04_Actions )
  288. endfunction
  289.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement