Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- edgewalk_lua.lua
- function concussive_shot_seek_target( keys )
- local caster = keys.caster
- local ability = keys.ability
- local particle_name = "particles/units/heroes/hero_skywrath_mage/skywrath_mage_concussive_shot.vpcf"
- local radius = ability:GetLevelSpecialValueFor( "launch_radius", ability:GetLevel() - 1 )
- local speed = ability:GetLevelSpecialValueFor( "speed", ability:GetLevel() - 1 )
- local duration = ability:GetLevelSpecialValueFor( "duration", ability:GetLevel() - 1 )
- local targetTeam = DOTA_UNIT_TARGET_TEAM_ENEMY
- local targetType = DOTA_UNIT_TARGET_HERO
- local targetFlag = DOTA_UNIT_TARGET_FLAG_NO_INVIS + DOTA_UNIT_TARGET_FLAG_NOT_ILLUSIONS
- local units = FindUnitsInRadius(
- caster:GetTeamNumber(), caster:GetAbsOrigin(), caster, radius, targetTeam,
- targetType, targetFlag, FIND_CLOSEST, false
- )
- for k, v in pairs( units ) do
- if caster:CanEntityBeSeenByMyTeam(v) then
- local projTable = {
- EffectName = particle_name,
- Ability = ability,
- Target = v,
- Source = caster,
- bDodgeable = true,
- bProvidesVision = true,
- vSpawnOrigin = caster:GetAbsOrigin(),
- iMoveSpeed = speed,
- iVisionRadius = radius,
- iVisionTeamNumber = caster:GetTeamNumber(),
- iSourceAttachment = DOTA_PROJECTILE_ATTACHMENT_ATTACK_1
- }
- ProjectileManager:CreateTrackingProjectile( projTable )
- break
- end
- end
- end
- redshift_lua.lua
- function set_target( keys )
- redirect_target = keys.target
- end
- function check_health_target( event )
- redirect_target.oldHealth = redirect_target:GetHealth()
- end
- function check_health_allies( event )
- local target = event.target
- u_oldHealth = target:GetHealth()
- end
- function redirect_damage( event )
- local damage = event.DamageTaken
- local ability = event.ability
- unit = event.unit
- -- Apply damage to the original target
- redirect_target.newHealth = redirect_target.oldHealth - damage
- -- Restore health to his nearby allies
- unit.newHealth = u_oldHealth + damage
- redirect_target:SetHealth(redirect_target.newHealth)
- unit:SetHealth(unit.newHealth)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement