Advertisement
warpdragon

Untitled

Apr 17th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. "DOTAAbilities"
  2. {
  3. //=================================================================================================================
  4. // Generic boss resistance for % based damage
  5. //=================================================================================================================
  6. "boss_shielder_shield"
  7. {
  8.  
  9. "ID" "9900"
  10. "BaseClass" "ability_lua"
  11. "ScriptFile" "abilities/shielder/boss_shielder_shield.lua"
  12. "AbilityTextureName" "tidehunter_kraken_shell"
  13. "AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_PASSIVE"
  14. "AbilityType" "DOTA_ABILITY_TYPE_ULTIMATE"
  15.  
  16.  
  17. "MaxLevel" "3"
  18. "RequiredLevel" "1"
  19. "LevelsBetweenUpgrades" "1"
  20.  
  21.  
  22. "AbilitySpecial"
  23. {
  24. "01"
  25. {
  26. "var_type" "FIELD_INTEGER"
  27. "percent_damage_reduce" "100"
  28. }
  29. "02"
  30. {
  31. "var_type" "FIELD_INTEGER"
  32. "sheild_width" "0.707 -0.173 -0.985" // In terms of cosine
  33. }
  34.  
  35. }
  36. }
  37. }
  38.  
  39. local parent = self:GetParent()
  40. local hero = keys.attacker
  41. local angleCos = 0
  42.  
  43. --if hero and hero:IsRealHero and hero:IsRealHero() then
  44. local attackOrigin = hero:GetAbsOrigin()
  45. local parentOrigin = parent:GetAbsOrigin()
  46. local attackDirection = (attackOrigin - parentOrigin):Normalized()
  47. local parentFacing = (parent:GetForwardVector()):Normalized()
  48. angleCos = parentFacing:Dot(attackDirection)
  49. --end
  50. DebugPrint(angleCos .. ' : ' .. self:GetAbility():GetSpecialValueFor("sheild_width"))
  51. if (angleCos > (self:GetAbility():GetSpecialValueFor("sheild_width"))) then
  52. return 0 - self:GetAbility():GetSpecialValueFor("percent_damage_reduce")
  53. end
  54. return 0
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement