iiiram

Untitled

Mar 30th, 2019
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. function Trig_Warlocktrup_Conditions takes nothing returns boolean
  2. if ( not ( GetSpellAbilityId() == 'A01R' ) ) then
  3. return false
  4. endif
  5. return true
  6. endfunction
  7.  
  8. function ConSep takes nothing returns boolean
  9. return ( IsUnitAlly(GetTriggerUnit(), GetOwningPlayer(GetSpellAbilityUnit())) == false )
  10. endfunction
  11.  
  12. function Sep takes integer ii returns boolean
  13. local effect e
  14. local integer index=1
  15. local unit eu=GetEnumUnit()
  16. local real x1=GetUnitX(eu)
  17. local real y1=GetUnitY(eu)
  18. local location loc1=Location(x1,y1)
  19. loop
  20. exitwhen index > ii
  21. call UnitDamageTarget(GetSpellAbilityUnit(), eu, (GetHeroInt(GetSpellAbilityUnit(), true)*3.5), true, true, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC, null)
  22. call AddSpecialEffectLoc("Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl",loc1)
  23. set e=GetLastCreatedEffectBJ()
  24. call PolledWait(0.1)
  25. call DestroyEffect(e)
  26. set index = index+1
  27. endloop
  28. endfunction
  29.  
  30. function Trig_Warlocktrup_Actions takes nothing returns nothing
  31. local unit u=GetSpellAbilityUnit()
  32. local real x=GetUnitX(u)
  33. local real y=GetUnitY(u)
  34. local location loc=Location(x,y)
  35. local real i=GetHeroInt(u, true)
  36. local integer ii=R2I(i*0.05)
  37. local group g=CreateGroup()
  38. call CreateCorpse(GetOwningPlayer(u),'nssp',x,y, 270.0)
  39. call GroupEnumUnitsInRangeOfLocCounted(g, loc, 512.0, Condition(function ConSep), ii)
  40. call ForGroup(g,function Sep(ii))
  41. set u = null
  42. endfunction
  43.  
  44. //===========================================================================
  45. function InitTrig_Warlocktrup takes nothing returns nothing
  46. set gg_trg_Warlocktrup = CreateTrigger( )
  47. call TriggerRegisterAnyUnitEventBJ( gg_trg_Warlocktrup, EVENT_PLAYER_UNIT_SPELL_EFFECT )
  48. call TriggerAddCondition( gg_trg_Warlocktrup, Condition( function Trig_Warlocktrup_Conditions ) )
  49. call TriggerAddAction( gg_trg_Warlocktrup, function Trig_Warlocktrup_Actions )
  50. endfunction
Advertisement
Add Comment
Please, Sign In to add comment