Advertisement
Guest User

Untitled

a guest
Feb 16th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. edgewalk_lua.lua
  2.  
  3. function concussive_shot_seek_target( keys )
  4.  
  5. local caster = keys.caster
  6. local ability = keys.ability
  7. local particle_name = "particles/units/heroes/hero_skywrath_mage/skywrath_mage_concussive_shot.vpcf"
  8. local radius = ability:GetLevelSpecialValueFor( "launch_radius", ability:GetLevel() - 1 )
  9. local speed = ability:GetLevelSpecialValueFor( "speed", ability:GetLevel() - 1 )
  10. local duration = ability:GetLevelSpecialValueFor( "duration", ability:GetLevel() - 1 )
  11. local targetTeam = DOTA_UNIT_TARGET_TEAM_ENEMY
  12. local targetType = DOTA_UNIT_TARGET_HERO
  13. local targetFlag = DOTA_UNIT_TARGET_FLAG_NO_INVIS + DOTA_UNIT_TARGET_FLAG_NOT_ILLUSIONS
  14.  
  15.  
  16. local units = FindUnitsInRadius(
  17. caster:GetTeamNumber(), caster:GetAbsOrigin(), caster, radius, targetTeam,
  18. targetType, targetFlag, FIND_CLOSEST, false
  19. )
  20.  
  21.  
  22. for k, v in pairs( units ) do
  23. if caster:CanEntityBeSeenByMyTeam(v) then
  24. local projTable = {
  25. EffectName = particle_name,
  26. Ability = ability,
  27. Target = v,
  28. Source = caster,
  29. bDodgeable = true,
  30. bProvidesVision = true,
  31. vSpawnOrigin = caster:GetAbsOrigin(),
  32. iMoveSpeed = speed,
  33. iVisionRadius = radius,
  34. iVisionTeamNumber = caster:GetTeamNumber(),
  35. iSourceAttachment = DOTA_PROJECTILE_ATTACHMENT_ATTACK_1
  36. }
  37. ProjectileManager:CreateTrackingProjectile( projTable )
  38. break
  39. end
  40. end
  41. end
  42.  
  43. redshift_lua.lua
  44.  
  45. function set_target( keys )
  46. redirect_target = keys.target
  47.  
  48.  
  49. end
  50.  
  51. function check_health_target( event )
  52. redirect_target.oldHealth = redirect_target:GetHealth()
  53. end
  54.  
  55. function check_health_allies( event )
  56. local target = event.target
  57.  
  58. u_oldHealth = target:GetHealth()
  59. end
  60.  
  61. function redirect_damage( event )
  62. local damage = event.DamageTaken
  63. local ability = event.ability
  64. unit = event.unit
  65.  
  66. -- Apply damage to the original target
  67. redirect_target.newHealth = redirect_target.oldHealth - damage
  68.  
  69. -- Restore health to his nearby allies
  70. unit.newHealth = u_oldHealth + damage
  71.  
  72.  
  73. redirect_target:SetHealth(redirect_target.newHealth)
  74. unit:SetHealth(unit.newHealth)
  75. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement