Помогите сделать скилл

AstonishingGuy

Активный
28 Июн 2018
119
2
Проект
s
Как сделать пассивный скилл, который будет снимать ограничение 550 скорости(как у блуда) и давать доп. урон и ловкость зависящие в процентах от скорости? Желательно кодик)
З.Ы. Не надо ответов "руками", "ногами", "жопой" и т.д. и т.п.
 

AstonishingGuy

Активный
28 Июн 2018
119
2
Проект
s
Изучай SpellLibrary и там смотри. За тебя скиллы и кастомку никто делать не будет.
Ну некоторый из вас способны только ответить "Изучай", "Смотри", "Руками", "Жопой" и т .д. и т.п. А еще поставить крестик или дизлайк.
 

AstonishingGuy

Активный
28 Июн 2018
119
2
Проект
s
Изучай SpellLibrary и там смотри. За тебя скиллы и кастомку никто делать не будет.
Ладно. Ну вот я захотел сделать другой скилл. Беру оттуда datadriven хроносферу войда, беру 2 скрипта lua. Но нифига не работает.

KV:
    "chronosphere_datadriven"
    {
        // General
        //-------------------------------------------------------------------------------------------------------------
        "BaseClass"                "ability_datadriven"
        "AbilityBehavior"                "DOTA_ABILITY_BEHAVIOR_AOE | DOTA_ABILITY_BEHAVIOR_POINT"
        "AbilityType"                    "DOTA_ABILITY_TYPE_ULTIMATE"
        "SpellImmunityType"                "SPELL_IMMUNITY_ENEMIES_YES"
        "FightRecapLevel"                "2"
        "AbilityTextureName"            "flash\5"
        "AOERadius"                        "%radius"

        // Precache
        //-------------------------------------------------------------------------------------------------------------
        "precache"
        {
            "soundfile"            "soundevents/game_sounds_heroes/game_sounds_faceless_void.vsndevts"
            "particle"            "particles/units/heroes/hero_faceless_void/faceless_void_chronosphere.vpcf"
            "particle"            "particles/units/heroes/hero_faceless_void/faceless_void_chrono_speed.vpcf"
        }
        
        // Casting
        //-------------------------------------------------------------------------------------------------------------
        "AbilityCastRange"                "600"
        "AbilityCastPoint"                "0.35 0.35 0.35"

        // Time       
        //-------------------------------------------------------------------------------------------------------------
        "AbilityCooldown"                "130.0 115.0 100.0"

        // Cost
        //-------------------------------------------------------------------------------------------------------------
        "AbilityManaCost"                "150 225 300"

        // Stats
        //-------------------------------------------------------------------------------------------------------------
        "AbilityModifierSupportBonus"        "50"

        // Special
        //-------------------------------------------------------------------------------------------------------------
        "AbilitySpecial"
        {
            "01"
            {
                "var_type"                "FIELD_INTEGER"
                "radius"                "425"
            }
            "02"
            {
                "var_type"                "FIELD_FLOAT"
                "duration"                "4.0 4.5 5.0"
            }
            "03"
            {
                "var_type"                "FIELD_FLOAT"
                "duration_scepter"        "4.0 5.0 6.0"
            }
            "04"
            {
                "var_type"                "FIELD_FLOAT"
                "cooldown_scepter"        "60.0 60.0 60.0"
            }
            "05"
            {
                "var_type"                "FIELD_INTEGER"
                "vision_radius"            "475"
            }
            // Extra
            "06"
            {
                "var_type"                "FIELD_FLOAT"
                "aura_interval"            "0.1"
            }
            // If you want the Chronosphere to ignore Faceless Void then keep it at 1 otherwise set it to 0
            "07"
            {
                "var_type"                "FIELD_INTEGER"
                "ignore_void"            "1"
            }
            "08"
            {
                "var_type"                "FIELD_INTEGER"
                "speed"                    "1000"
            }
        }

        "OnSpellStart"
        {
            "FireSound"
            {
                "EffectName"        "Hero_FacelessVoid.Chronosphere"
                "Target"            "CASTER"
            }

            "RunScript"
            {
                "ScriptFile"        "scripts/vscripts/heroes/hero_faceless_void/chronosphere.lua"
                "Function"            "Chronosphere"
                "Target"            "POINT"
                "dummy_aura"        "modifier_chronosphere_aura_datadriven"
            }
        }

        "Modifiers"
        {
            // Cosmetic
            "modifier_chronosphere_tooltip_datadriven"
            {
                "IsDebuff"        "1"
                "IsPurgable"    "0"
            }

            "modifier_chronosphere_aura_datadriven"
            {
                "OnCreated"
                {
                    "AttachEffect"
                    {
                        "EffectName"    "particles/units/heroes/hero_faceless_void/faceless_void_chronosphere.vpcf"
                        "EffectAttachType"    "attach_origin"
                        "Target"        "TARGET"

                        "ControlPoints"
                        {
                            "01"    "%radius %radius 0"
                        }
                    }
                }
                
                "ThinkInterval"        "%aura_interval"

                "OnIntervalThink"
                {
                    "ActOnTargets"
                    {
                        "Target"
                        {
                            "Center"    "TARGET"
                            "Types"        "DOTA_UNIT_TARGET_ALL"
                            "Teams"        "DOTA_UNIT_TARGET_TEAM_FRIENDLY | DOTA_UNIT_TARGET_TEAM_ENEMY"
                            "Flags"     "DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES"
                            "Radius"    "%radius"
                        }

                        "Action"
                        {
                            "RunScript"
                            {
                                "ScriptFile"        "scripts/vscripts/heroes/hero_faceless_void/chronosphere.lua"
                                "Function"            "ChronosphereAura"
                                "Target"            "TARGET"
                                "aura_modifier"        "modifier_chronosphere_datadriven"
                            }
                        }
                    }
                }

                "States"
                {
                    "MODIFIER_STATE_INVULNERABLE"     "MODIFIER_STATE_VALUE_ENABLED"
                    "MODIFIER_STATE_NO_HEALTH_BAR"     "MODIFIER_STATE_VALUE_ENABLED"               
                    "MODIFIER_STATE_NOT_ON_MINIMAP" "MODIFIER_STATE_VALUE_ENABLED"
                    "MODIFIER_STATE_UNSELECTABLE"     "MODIFIER_STATE_VALUE_ENABLED"
                }
            }

            "modifier_chronosphere_datadriven"
            {
                "IsHidden"    "1"

                "OnCreated"
                {
                    "ApplyModifier"
                    {
                        "ModifierName"    "modifier_chronosphere_tooltip_datadriven"
                        "Target"        "TARGET"
                    }
                }

                "OnDestroy"
                {
                    "RemoveModifier"
                    {
                        "ModifierName"    "modifier_chronosphere_tooltip_datadriven"
                        "Target"        "TARGET"
                    }
                }

                "States"
                {
                    "MODIFIER_STATE_STUNNED"        "MODIFIER_STATE_VALUE_ENABLED"
                    "MODIFIER_STATE_FROZEN"            "MODIFIER_STATE_VALUE_ENABLED"
                }
            }
        }
    }

Lua:
LinkLuaModifier("modifier_chronosphere_speed_lua", "heroes/hero_faceless_void/modifiers/modifier_chronosphere_speed_lua.lua", LUA_MODIFIER_MOTION_NONE)

--[[Author: Pizzalol
    Date: 26.09.2015.
    Creates a dummy at the target location that acts as the Chronosphere]]
function Chronosphere( keys )
    -- Variables
    local caster = keys.caster
    local ability = keys.ability
    local target_point = keys.target_points[1]

    -- Special Variables
    local duration = ability:GetLevelSpecialValueFor("duration", (ability:GetLevel() - 1))
    local vision_radius = ability:GetLevelSpecialValueFor("vision_radius", (ability:GetLevel() - 1))

    -- Dummy
    local dummy_modifier = keys.dummy_aura
    local dummy = CreateUnitByName("npc_dummy_unit", target_point, false, caster, caster, caster:GetTeam())
    dummy:AddNewModifier(caster, nil, "modifier_phased", {})
    ability:ApplyDataDrivenModifier(caster, dummy, dummy_modifier, {duration = duration})

    -- Vision
    AddFOWViewer(caster:GetTeamNumber(), target_point, vision_radius, duration, false)

    -- Timer to remove the dummy
    Timers:CreateTimer(duration, function() dummy:RemoveSelf() end)
end

--[[Author: Pizzalol
    Date: 26.09.2015.
    Checks if the target is a unit owned by the player that cast the Chronosphere
    If it is then it applies the no collision and extra movementspeed modifier
    otherwise it applies the stun modifier]]
function ChronosphereAura( keys )
    local caster = keys.caster
    local target = keys.target
    local ability = keys.ability
    local ability_level = ability:GetLevel() - 1

    -- Ability variables
    local aura_modifier = keys.aura_modifier
    local ignore_void = ability:GetLevelSpecialValueFor("ignore_void", ability_level)
    local duration = ability:GetLevelSpecialValueFor("aura_interval", ability_level)

    -- Variable for deciding if Chronosphere should affect Faceless Void
    if ignore_void == 0 then ignore_void = false
    else ignore_void = true end

    -- Check if it is a caster controlled unit or not
    -- Caster controlled units get the phasing and movement speed modifier
    if (caster:GetPlayerOwner() == target:GetPlayerOwner()) or (target:GetName() == "npc_dota_hero_faceless_void" and ignore_void) then
        target:AddNewModifier(caster, ability, "modifier_chronosphere_speed_lua", {duration = duration})
    else
    -- Everyone else gets immobilized and stunned
        target:InterruptMotionControllers(false)
        ability:ApplyDataDrivenModifier(caster, target, aura_modifier, {duration = duration})
    end
end

Lua:
modifier_chronosphere_speed_lua = class({})

--[[Author: Perry,Noya
    Date: 26.09.2015.
    Removes the movement speed limit and applies the chronosphere effect]]
function modifier_chronosphere_speed_lua:DeclareFunctions()
    local funcs =
    {
        MODIFIER_PROPERTY_MOVESPEED_MAX,
        MODIFIER_PROPERTY_MOVESPEED_LIMIT,
        MODIFIER_PROPERTY_MOVESPEED_ABSOLUTE
    }

    return funcs
end

function modifier_chronosphere_speed_lua:GetModifierMoveSpeed_Limit()
    return self:GetAbility():GetSpecialValueFor("speed")
end

function modifier_chronosphere_speed_lua:GetModifierMoveSpeed_Max()
    return self:GetAbility():GetSpecialValueFor("speed")
end

function modifier_chronosphere_speed_lua:GetModifierMoveSpeed_Absolute()
    return self:GetAbility():GetSpecialValueFor("speed")
end

function modifier_chronosphere_speed_lua:CheckState()
    local state = {
    [MODIFIER_STATE_NO_UNIT_COLLISION] = true
    }

    return state
end

function modifier_chronosphere_speed_lua:IsHidden()
    return true
end

function modifier_chronosphere_speed_lua:OnCreated()
    if IsServer() then
        self.nFXIndex = ParticleManager:CreateParticle("particles/units/heroes/hero_faceless_void/faceless_void_chrono_speed.vpcf", PATTACH_ABSORIGIN_FOLLOW, self:GetParent())
        self:AddParticle(self.nFXIndex, false, false, -1, false, false)
    end
end
 
Реклама: