Advertisement
I_GRIN_I

Untitled

Apr 15th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.94 KB | None | 0 0
  1. KV
  2. "red_dragon_macrapyre"
  3. {
  4. "BaseClass" "ability_lua"
  5. "ScriptFile" "red_dragon_macrapyre.lua"
  6. "AbilityTextureName" "jakiro_macropyre"
  7. "AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_POINT|DOTA_ABILITY_BEHAVIOR_AOE"
  8. "MaxLevel" "1"
  9. "AbilityUnitTargetTeam" "DOTA_UNIT_TARGET_TEAM_ENEMY"
  10. "AbilityCooldown" "40.0"
  11. "AbilityManaCost" "150"
  12. "AbilityUnitDamageType" "DAMAGE_TYPE_MAGICAL"
  13. "AbilityCastRange" "600"
  14. "SpellImmunityType" "SPELL_IMMUNITY_ENEMIES_NO"
  15. "AbilityDamage" "50"
  16. "AbilityDuration" "10"
  17. "AoERadius" "400"
  18. "AbilitySharedCooldown" "dragon_first_ability"
  19. "AbilitySpecial"
  20. {
  21. "01"
  22. {
  23. "var_type" "FIELD_INTEGER"
  24. "damage" "500"
  25. }
  26. "02"
  27. {
  28. "var_type" "FIELD_INTEGER"
  29. "heal" "50"
  30. }
  31. "03"
  32. {
  33. "var_type" "FIELD_INTEGER"
  34. "radius" "400"
  35. }
  36. }
  37. }
  38. LUA
  39. LinkLuaModifier('red_dragon_macrapyre_thinker','red_dragon_macrapyre_thinker',LUA_MODIFIER_MOTION_NONE)
  40. if red_dragon_macrapyre == nil then
  41. red_dragon_macrapyre = class({})
  42. end
  43. function red_dragon_macrapyre:OnSpellStart()
  44. local caster = self:GetCaster()
  45. local point = self:GetCursorPosition()
  46. local radius = self:GetSpecialValueFor('radius')
  47. local duration = self:GetDuration()
  48. local thinker = CreateModifierThinker(caster,self,"red_dragon_macrapyre_thinker",{duration = duration},point,caster:GetTeamNumber(),false)
  49. local particleName = "particles/units/heroes/hero_jakiro/jakiro_macropyre.vpcf";
  50. local particle = ParticleManager:CreateParticle(particleName, PATTACH_ABSORIGIN, thinker);
  51. local forward = caster:GetForwardVector();
  52. ParticleManager:SetParticleControl(particle, 0, point - forward * radius/2);
  53. ParticleManager:SetParticleControl(particle, 1, point);
  54. ParticleManager:SetParticleControl(particle, 2, Vector(duration, 0, 0));
  55. ParticleManager:SetParticleControl(particle, 3, point + forward * radius/2);
  56. end
  57. THINKER
  58. if red_dragon_macrapyre_thinker == nil then
  59. red_dragon_macrapyre_thinker = class({})
  60. end
  61. function red_dragon_macrapyre_thinker:OnCreated(table)
  62. self:StartIntervalThink(0.1)
  63. self.radius = self:GetAbility():GetSpecialValueFor('radius')
  64. self.team = self:GetCaster():GetTeam()
  65. self.dmg = self:GetAbility():GetAbilityDamage()/10
  66. end
  67. function red_dragon_macrapyre_thinker:OnIntervalThink()
  68. local units = FindUnitsInRadius(self.team,self:GetParent():GetAbsOrigin(),nil,self.radius,DOTA_UNIT_TARGET_TEAM_BOTH,DOTA_UNIT_TARGET_ALL,DOTA_UNIT_TARGET_FLAG_NONE,FIND_ANY_ORDER,false)
  69. for _,unit in pairs(units) do
  70. if unit:GetTeam() ~= self.team then
  71. local dmg = {
  72. victim = unit,
  73. attacker = self:GetCaster(),
  74. damage = self.dmg,
  75. damage_type = self:GetAbility():GetAbilityDamageType(),
  76. damage_flags = DOTA_DAMAGE_FLAG_NONE,
  77. ability = self:GetAbility(),
  78. }
  79. ApplyDamage(dmg)
  80. elseif unit == self:GetCaster() then
  81. Heal(self.dmg,self:GetCaster())
  82. end
  83. end
  84. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement