Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "DOTAAbilities"
- {
- //=================================================================================================================
- // Generic boss resistance for % based damage
- //=================================================================================================================
- "boss_shielder_shield"
- {
- "ID" "9900"
- "BaseClass" "ability_lua"
- "ScriptFile" "abilities/shielder/boss_shielder_shield.lua"
- "AbilityTextureName" "tidehunter_kraken_shell"
- "AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_PASSIVE"
- "AbilityType" "DOTA_ABILITY_TYPE_ULTIMATE"
- "MaxLevel" "3"
- "RequiredLevel" "1"
- "LevelsBetweenUpgrades" "1"
- "AbilitySpecial"
- {
- "01"
- {
- "var_type" "FIELD_INTEGER"
- "percent_damage_reduce" "100"
- }
- "02"
- {
- "var_type" "FIELD_INTEGER"
- "sheild_width" "0.707 -0.173 -0.985" // In terms of cosine
- }
- }
- }
- }
- local parent = self:GetParent()
- local hero = keys.attacker
- local angleCos = 0
- --if hero and hero:IsRealHero and hero:IsRealHero() then
- local attackOrigin = hero:GetAbsOrigin()
- local parentOrigin = parent:GetAbsOrigin()
- local attackDirection = (attackOrigin - parentOrigin):Normalized()
- local parentFacing = (parent:GetForwardVector()):Normalized()
- angleCos = parentFacing:Dot(attackDirection)
- --end
- DebugPrint(angleCos .. ' : ' .. self:GetAbility():GetSpecialValueFor("sheild_width"))
- if (angleCos > (self:GetAbility():GetSpecialValueFor("sheild_width"))) then
- return 0 - self:GetAbility():GetSpecialValueFor("percent_damage_reduce")
- end
- return 0
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement