Talenheim

Untitled

Jul 22nd, 2020
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.71 KB | None | 0 0
  1. // Dota Heroes File
  2. "DOTAAbilities"
  3. {
  4. "exampleability"
  5. {
  6. "BaseClass" "ability_lua"
  7. "ScriptFile" "abilities/exampleability"
  8. "AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_NO_TARGET | DOTA_ABILITY_BEHAVIOR_IMMEDIATE"
  9. "AbilityUnitDamageType" "DAMAGE_TYPE_PHYSICAL"
  10. "AbilityCastPoint" "0"
  11. "AbilityCooldown" "17.0 16.0 15.0 14.0"
  12. "AbilityManaCost" "100"
  13. "AbilityTextureName" "techies_focused_detonate" // steal the icon from this ability
  14. "MaxLevel" "1" // Maximum skillable level
  15. "AbilitySpecial"
  16. {
  17. // filling in some values with some names
  18. // the values can be shown inside the Tooltip if you edit game/resource/addon_english.txt
  19. "01"
  20. {
  21. "var_type" "FIELD_INTEGER"
  22. "ls_start" "100 200 300 400"
  23. }
  24. "02"
  25. {
  26. "var_type" "FIELD_INTEGER"
  27. "self_damage" "100 200 300 400"
  28. }
  29. "03"
  30. {
  31. "var_type" "FIELD_INTEGER"
  32. "damage_radius" "450"
  33. }
  34. "04"
  35. {
  36. "var_type" "FIELD_FLOAT"
  37. "duration" "10"
  38. }
  39. }
  40. }
  41.  
  42. "pixie_pixiebolt"
  43. {
  44. "BaseClass" "ability_lua"
  45. "ScriptFile" "abilities/pixiebolt"
  46. "AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_DIRECTIONAL | DOTA_ABILITY_BEHAVIOR_POINT | DOTA_ABILITY_BEHAVIOR_IGNORE_BACKSWING"
  47. "AbilityUnitTargetTeam" "DOTA_UNIT_TARGET_TEAM_ENEMY"
  48. "AbilityUnitDamageType" "DAMAGE_TYPE_MAGICAL"
  49. "AbilityCastPoint" "0.25"
  50. "AbilityCooldown" "16.0 15.0 14.0 13.0 12.0"
  51. "AbilityManaCost" "60 70 80 90 100"
  52. "AbilityTextureName" "vengefulspirit_magic_missile"
  53. "MaxLevel" "5"
  54. "AbilitySpecial"
  55. {
  56. "01"
  57. {
  58. "var_type" "FIELD_INTEGER"
  59. "spawn_distance" "10"
  60. }
  61. "02"
  62. {
  63. "var_type" "FIELD_INTEGER"
  64. "proj_radius" "100"
  65. }
  66. "03"
  67. {
  68. "var_type" "FIELD_INTEGER"
  69. "proj_speed" "1500"
  70. }
  71. "04"
  72. {
  73. "var_type" "FIELD_INTEGER"
  74. "vision_radius" "150"
  75. }
  76. "05"
  77. {
  78. "var_type" "FIELD_INTEGER"
  79. "proj_distance" "600 650 700 750 800"
  80. }
  81. "06"
  82. {
  83. "var_type" "FIELD_INTEGER"
  84. "damage" "200 250 300 350 400"
  85. }
  86. }
  87. }
  88.  
  89. "special_bonus_exampletalent" // start talent names with special_bonus_
  90. {
  91. "BaseClass" "special_bonus_undefined"
  92. "AbilityType" "DOTA_ABILITY_TYPE_ATTRIBUTES"
  93. "AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_PASSIVE"
  94. "AbilitySpecial"
  95. {
  96. "01"
  97. {
  98. "var_type" "FIELD_INTEGER"
  99. "value" "90"
  100. }
  101. }
  102. }
  103.  
  104. "seasonal_decorate_tree"
  105. {
  106. "AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_UNIT_TARGET | DOTA_ABILITY_BEHAVIOR_NOT_LEARNABLE | DOTA_ABILITY_BEHAVIOR_HIDDEN"
  107. "AssociatedConsumable" "0"
  108. }
  109.  
  110. }
  111.  
  112. \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  113.  
  114. //pixiebolt.lua
  115.  
  116. pixiebolt = class({})
  117.  
  118. function pixiebolt:GetAbilityTextureName()
  119. return "mirana_arrow"
  120. end
  121.  
  122. function pixiebolt:IsHiddenWhenStolen()
  123. return false
  124. end
  125.  
  126. function pixiebolt:OnSpellStart()
  127. -- Preventing projectiles getting stuck in one spot due to potential 0 length vector
  128. if self:GetCursorPosition() == self:GetCaster():GetAbsOrigin() then
  129. self:GetCaster():SetCursorPosition(self:GetCursorPosition() + self:GetCaster():GetForwardVector())
  130. end
  131.  
  132. -- Ability properties
  133. local caster = self:GetCaster()
  134. local ability = self
  135. local target_point = self:GetCursorPosition()
  136. local sound_cast = "Hero_Mirana.ArrowCast"
  137.  
  138. -- Ability specials
  139. local spawn_distance = ability:GetSpecialValueFor("spawn_distance")
  140.  
  141. -- Play cast sound
  142. EmitSoundOn(sound_cast, caster)
  143.  
  144. -- Set direction for main arrow
  145. local direction = (target_point - caster:GetAbsOrigin()):Normalized()
  146.  
  147. -- Get spawn point
  148. local spawn_point = caster:GetAbsOrigin() + direction * spawn_distance
  149.  
  150. -- Fire main arrow
  151. FireSacredArrow(caster, ability, spawn_point, direction)
  152.  
  153. end
  154.  
  155. function FireSacredArrow(caster, ability, spawn_point, direction)
  156. local particle_arrow = "particles/units/heroes/hero_mirana/mirana_spell_arrow.vpcf"
  157. -- Ability specials
  158.  
  159. local arrow_radius
  160. local arrow_speed
  161. local vision_radius
  162. local arrow_distance
  163.  
  164. -- If ability is not levelled, assign level 1 values
  165. if ability:GetLevel() == 0 then
  166. arrow_radius = ability:GetLevelSpecialValueFor("proj_radius", 1)
  167. arrow_speed = ability:GetLevelSpecialValueFor("proj_speed", 1)
  168. vision_radius = ability:GetLevelSpecialValueFor("vision_radius", 1)
  169. arrow_distance = ability:GetLevelSpecialValueFor("proj_distance", 1)
  170. else
  171. arrow_radius = ability:GetSpecialValueFor("proj_radius")
  172. arrow_speed = ability:GetSpecialValueFor("proj_speed")
  173. vision_radius = ability:GetSpecialValueFor("vision_radius")
  174. arrow_distance = ability:GetSpecialValueFor("proj_distance")
  175. end
  176.  
  177. -- Fire arrow in the set direction
  178. local arrow_projectile = {
  179. Ability = ability,
  180. EffectName = particle_arrow,
  181. vSpawnOrigin = spawn_point,
  182. fDistance = arrow_distance,
  183. fStartRadius = arrow_radius,
  184. fEndRadius = arrow_radius,
  185. Source = caster,
  186. bHasFrontalCone = false,
  187. bReplaceExisting = false,
  188. iUnitTargetTeam = DOTA_UNIT_TARGET_TEAM_ENEMY,
  189. iUnitTargetType = DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC,
  190. bDeleteOnHit = true,
  191. vVelocity = direction * arrow_speed * Vector(1, 1, 0),
  192. fExpireTime = GameRules:GetGameTime() + 10.0,
  193. bProvidesVision = true,
  194. iVisionRadius = vision_radius,
  195. iVisionTeamNumber = caster:GetTeamNumber(),
  196. ExtraData = {cast_loc_x = tostring(caster:GetAbsOrigin().x),
  197. cast_loc_y = tostring(caster:GetAbsOrigin().y),
  198. cast_loc_z = tostring(caster:GetAbsOrigin().z)}
  199. }
  200.  
  201. ProjectileManager:CreateLinearProjectile(arrow_projectile)
  202. end
  203.  
  204. function pixiebolt:OnProjectileHit_ExtraData(target, location, extra_data)
  205. -- If no target was hit, do nothing
  206. if not target then
  207. return nil
  208. end
  209.  
  210. -- Ability properties
  211. local caster = self:GetCaster()
  212. local ability = self
  213. local sound_impact = "Hero_Mirana.ArrowImpact"
  214.  
  215. -- Ability specials
  216. local dmg = ability:GetSpecialValueFor("damage")
  217.  
  218. --deal damage
  219. local damagetable = {victim = target, attacker = playerHero, damage = dmg, damage_type = DAMAGE_TYPE_MAGICAL,}
  220.  
  221. ApplyDamage(damageTable)
  222.  
  223. -- Play impact sound
  224. EmitSoundOn(sound_impact, target)
  225.  
  226. -- Recombine cast location vector
  227. local cast_location = Vector(tonumber(extra_data.cast_loc_x), tonumber(extra_data.cast_loc_y), tonumber(extra_data.cast_loc_z))
  228.  
  229. return true
  230. end
Add Comment
Please, Sign In to add comment