Advertisement
dEN5

Untitled

Jan 25th, 2020
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.70 KB | None | 0 0
  1. function projectile (keys)
  2. local caster = keys.caster
  3. local projectile_model = keys.particle_name
  4. caster:SetRangedProjectileName(projectile_model)
  5. end
  6.  
  7. function damage (keys)
  8. local target = keys.target
  9. local caster = keys.caster
  10. local ability = keys.ability
  11. local pos = target:GetAbsOrigin()
  12. local radius = ability:GetLevelSpecialValueFor("radius", ability:GetLevel() - 1)
  13. local damageTable = {
  14. attacker = caster,
  15. ability = ability,
  16. damage_type = DAMAGE_TYPE_PHYSICAL,
  17. damage = caster:GetAttackDamage()
  18. }
  19. local units = FindUnitsInRadius(caster:GetTeam(), pos, nil, radius, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_ALL, DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES, 0, false)
  20. for _,unit in ipairs(units) do
  21. if unit ~= target then
  22. damageTable.victim = unit
  23. ApplyDamage(damageTable)
  24. end
  25. local particleid = ParticleManager:CreateParticle(keys.particle_name, PATTACH_POINT, unit)
  26. ParticleManager:SetParticleControl(particleid, 0, unit:GetAbsOrigin())
  27. Timers:CreateTimer(0.01, function()
  28. ParticleManager:DestroyParticle(particleid, false)
  29. end)
  30. end
  31. end
  32.  
  33. "NPC_ability_shockwave"
  34. {
  35. "BaseClass" "ability_datadriven"
  36. "AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_PASSIVE"
  37. "AbilityTextureName" "custom/NPC_Tower_FireCannon"
  38. "MaxLevel" "1"
  39. "RequiredLevel" "1"
  40.  
  41. "AbilitySpecial"
  42. {
  43. "01"
  44. {
  45. "var_type" "FIELD_INTEGER"
  46. "radius" "225"
  47. }
  48. }
  49.  
  50. "precache"
  51. {
  52. "particle" "particles/base_attacks/ranged_tower_bad.vpcf"
  53. "particle" "particles/units/heroes/hero_techies/techies_blast_off_fire.vpcf"
  54. }
  55.  
  56. "Modifiers"
  57. {
  58. "NPC_Tower_ability_1_fire_state"
  59. {
  60. "Passive" "1"
  61. "IsHidden" "1"
  62. "OnCreated"
  63. {
  64. "RunScript"
  65. {
  66. "ScriptFile" "npc_abilities/shockwave"
  67. "Function" "projectile"
  68. "particle_name" "particles/units/heroes/hero_abaddon/abaddon_death_coil.vpcf"
  69. }
  70. }
  71. "OnAttackLanded"
  72. {
  73. "RunScript"
  74. {
  75. "ScriptFile" "npc_abilities/shockwave"
  76. "Function" "damage"
  77. "particle_name" "particles/units/heroes/hero_magnataur/magnataur_shockwave.vpcf"
  78. }
  79. }
  80. }
  81. }
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement