Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.04 KB | None | 0 0
  1. -- abilities.lua
  2.  
  3. Abilities = {}
  4.  
  5. function Abilities.Initialize( ability )
  6.     local getBehavior = ability.GetBehavior
  7.  
  8.     --[[
  9.     function ability:GetBehavior()
  10.         if getBehavior then
  11.             return getBehavior(self)
  12.         end
  13.  
  14.         return self.BaseClass.GetBehavior(self)
  15.     end
  16.     ]]
  17.  
  18.     function ability:HasBehavior( behavior )
  19.         local behaviors = self:GetBehavior()--getBehavior and getBehavior(self) or self.BaseClass.GetBehavior(self)
  20.         return FlagExist(behaviors, behavior)
  21.     end
  22. end
  23.  
  24.  
  25. -- treant_basic_attack.lua
  26.  
  27. treant_basic_attack = class({})
  28.  
  29. LinkLuaModifier( "modifier_treant_natures_punishment", "abilities/heroes/treant/treant_shared_modifiers/modifier_treant_natures_punishment", LUA_MODIFIER_MOTION_NONE )
  30.  
  31. function treant_basic_attack:OnSpellStart()
  32.     if treant_basic_attack:HasBehavior( DOTA_ABILITY_BEHAVIOR_ROOT_DISABLES ) then  
  33.         print("DOTA_ABILITY_BEHAVIOR_ROOT_DISABLES")
  34.     end
  35. end
  36.  
  37. if IsClient() then require("abilities") end
  38. Abilities.Initialize( treant_basic_attack )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement