Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Problem: the lua modifier isnt being applied to creeps in the AOE. It is linked.
- // Datadriven Ability
- "hlw_antimage_cleavify"
- {
- // General
- //-------------------------------------------------------------------------------------------------------------
- "BaseClass" "ability_datadriven"
- "AbilityTextureName" "hlw_antimage_spell_shield"
- "AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_POINT | DOTA_ABILITY_BEHAVIOR_AOE"
- "AbilityUnitTargetTeam" "DOTA_UNIT_TARGET_TEAM_ENEMY"
- "AbilityUnitTargetType" "DOTA_UNIT_TARGET_BASIC | DOTA_UNIT_TARGET_HERO | DOTA_UNIT_TARGET_CREEP"
- //"AbilityCastAnimation" "ACT_DOTA_SPAWN"
- "AOERadius" "%inflicton_radius"
- // Casting
- //-------------------------------------------------------------------------------------------------------------
- "AbilityCastRange" "800"
- "AbilityCastPoint" "0.3"
- // Time
- //-------------------------------------------------------------------------------------------------------------
- "AbilityCooldown" "30.0 29.0 28.0 27.0"
- // Cost
- //-------------------------------------------------------------------------------------------------------------
- "AbilityManaCost" "200"
- "precache"
- {
- "particle" "particles/units/heroes/hero_phoenix/phoenix_supernova_death.vpcf"
- }
- "OnSpellStart"
- {
- "FireEffect"
- {
- "EffectName" "particles/units/heroes/hero_phoenix/phoenix_supernova_death.vpcf"
- "EffectAttachType" "start_at_customorigin"
- "TargetPoint" "POINT"
- "ControlPoints"
- {
- "00" "POINT"
- "01" "POINT"
- }
- }
- "ApplyModifier"
- {
- "ModifierName" "modifier_cleavable_lua"
- "Target"
- {
- "Center" "POINT"
- "Radius" "%radius"
- "Teams" "DOTA_UNIT_TARGET_TEAM_ENEMY"
- "Types" "DOTA_UNIT_TARGET_CREEP | DOTA_UNIT_TARGET_HERO | DOTA_UNIT_TARGET_BASIC"
- }
- "Duration" "%duration"
- }
- }
- // Special
- //-------------------------------------------------------------------------------------------------------------
- "AbilitySpecial"
- {
- "01"
- {
- "var_type" "FIELD_FLOAT"
- "duration" "20.0 21.0 22.0 23.0"
- }
- "02"
- {
- "var_type" "FIELD_FLOAT"
- "inflicton_radius" "350 450 550 650"
- }
- "03"
- {
- "var_type" "FIELD_FLOAT"
- "cleave_percent" "15 20 25 30"
- }
- "04"
- {
- "var_type" "FIELD_FLOAT"
- "cleave_radius" "300 325 350 375"
- }
- }
- }
- // modifier_cleavable_lua
- modifier_cleavable_lua = class({})
- LinkLuaModifier("modifier_cleavable_lua", "modifiers/modifier_cleavable", LUA_MODIFIER_MOTION_NONE)
- function modifier_cleavable_lua:DeclareFunctions()
- local funcs = {
- MODIFIER_EVENT_ON_ATTACKED
- }
- return funcs
- end
- function modifier_cleavable_lua:GetTexture()
- print("Modifier cleavify added.")
- return "beastmaster_wild_axes"
- end
- function modifier_cleavable_lua:OnAttacked()
- local caster = self:GetCaster()
- local ability = caster:FindAbilityByName("hlw_antimage_cleavify")
- local radius = ability:GetSpecialValueFor("cleave_radius")
- local attDamage = ability:GetSpecialValueFor("cleave_percent")
- local location = caster:GetForwardVector() * radius + caster:GetAbsOrigin()
- local units = FindUnitsInRadius(caster:GetTeamNumber(), location, nil, radius, ability:GetAbilityTargetTeam(), ability:GetAbilityDamageType(), ability:GetAbilityTargetFlags(), 0, false)
- for _, unit in pairs(units) do
- local damageTable =
- {
- victim = unit,
- attacker = caster,
- damage = attDamage,
- damage_type = DAMAGE_TYPE_PHYSICAL
- }
- ApplyDamage(damageTable)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement