Добавить +20 к бонусных атак в радиусе 1750 после каждого 5 удара

  • Автор темы Автор темы dEN5
  • Дата начала Дата начала

dEN5

Пользователь
10 Фев 2019
25
0
steamcommunity.com
Проект
MADNESS: PROJECT ABADDON
Код:
        "hail"
        {
            "BaseClass"        "ability_datadriven"
            "AbilityBehavior"        "DOTA_ABILITY_BEHAVIOR_PASSIVE"
            "AbilityTextureName"        "custom\hail"
            "MaxLevel"        "4"
            "Modifiers"
            {
                "modifier_luanshe"
                {
                    "Passive"        "1"
                    "IsBuff"        "0"
                    "IsDebuff"        "0"
                    "IsHidden"        "1"
                    "IsPurgable"        "0"
    "OnAttackLanded"
    {
        "RemoveModifier"
        {
            "ModifierName"        "modifier_jingzhunsheji_effect"
            "Target"        "CASTER"
        }
        "RunScript"
        {
            "ScriptFile"        "npc_abilities\gyrocopter.lua"
            "Function"        "OnJingzhunshejiAttackLanded"
            "Target"        "TARGET"
                            {
                                "RunScript"
                                {
                                    "ScriptFile"        "npc_abilities\gyrocopter.lua"
                                    "Function"        "LaunShe"
                                    "Target"
                                    {
                                        "Center"        "CASTER"
                                        "Radius"        "%radius"
                                        "Teams"        "DOTA_UNIT_TARGET_TEAM_ENEMY"
                                        "Types"        "DOTA_UNIT_TARGET_HERO | DOTA_UNIT_TARGET_BASIC"
                                        "MaxTargets"        "%bonus_attack_count"
                                        "Random"        "1"
                                    }
                                }
                            }
                        }
                    }
                }
                "item_ordinary_sword_state"
                {
                    "Passive"        "1"
                    "IsBuff"        "1"
                    "IsDebuff"        "0"
                    "IsHidden"        "1"
                    "IsPurgable"        "0"
                    "Attributes"        "MODIFIER_ATTRIBUTE_MULTIPLE"
                    "IsPurgble"        "0"
                    "Properties"
                    {
                        "MODIFIER_PROPERTY_PREATTACK_BONUS_DAMAGE"        "%bonus_damage"
                    }
                    "OnAttackStart"
                    {
                        "RemoveModifier"
                        {
                            "ModifierName"        "item_ordinary_sword_buff"
                            "Target"        "CASTER"
                        }
                        "Random"
                        {
                            "Chance"        "%chance2"
                            "OnSuccess"
                            {
                                "ApplyModifier"
                                {
                                    "ModifierName"        "item_ordinary_sword_buff"
                                    "Target"        "CASTER"
                                }
                            }
                        }
                    }
                }
                "item_ordinary_sword_buff"
                {
                    "Passive"        "0"
                    "IsBuff"        "0"
                    "IsDebuff"        "0"
                    "IsHidden"        "1"
                    "IsPurgable"        "0"
                    "Properties"
                    {
                        "MODIFIER_PROPERTY_PREATTACK_CRITICALSTRIKE"        "%crit"
                    }
                    "OnAttackLanded"
                    {
                        "RemoveModifier"
                        {
                            "ModifierName"        "item_ordinary_sword_buff"
                            "Target"        "CASTER"
                        }
                    }
                    "AbilitySpecial"
                    {
                        "01"
                        {
                            "var_type"        "FIELD_INTEGER"
                            "chance"        "15 20 25 30"
                        }
                        "02"
                        {
                            "var_type"        "FIELD_INTEGER"
                            "bonus_attack_count"        "20"
                        }
                        "03"
                        {
                            "var_type"        "FIELD_INTEGER"
                            "radius"        "1750"
                        }
                        "04"
                        {
                            "var_type"        "FIELD_INTEGER"        effect_trigger_stack
                            "crit"        "150 200 250 300 350"
                        }
                        "05"
                        {
                            "var_type"        "FIELD_INTEGER"
                            "chance2"        "15 20 25 30"
                                        {
                            "var_type"    "FIELD_INTEGER"
                            "effect_trigger_stack"    "5 4 3 2"                          
                        }
                    }
                }
            }
        }
    }
}
Lua:
function LaunShe(keys)
    local caster = keys.caster
    local targets = keys.target_entities
    for _, target in pairs(targets) do
        caster:PerformAttack(target,true,false,true,false,true,false,false)
    end
end

function OnJingzhunshejiAttackLanded(keys)
    local caster = keys.caster
    local ability = keys.ability

    local effect_trigger_stack = ability:GetLevelSpecialValueFor("effect_trigger_stack", ability:GetLevel() - 1)

    if not caster:HasModifier("modifier_jingzhunsheji_stacker") then
        ability:ApplyDataDrivenModifier(caster, caster, "modifier_jingzhunsheji_stacker", {})
    end

    local stack_count = caster:GetModifierStackCount("modifier_jingzhunsheji_stacker", caster)
    if not caster:HasModifier("modifier_jingzhunsheji_effect") then -- 拥有精准射击效果的那一下攻击不叠加,到底是这个先执行还是下面的先执行呢?
        caster:SetModifierStackCount("modifier_jingzhunsheji_stacker", caster, stack_count + 1)
    end
    if stack_count + 1 >= effect_trigger_stack then
        caster:SetModifierStackCount("modifier_jingzhunsheji_stacker", caster, 0)
        ability:ApplyDataDrivenModifier(caster, caster, "modifier_jingzhunsheji_effect", {})
    end
end
пожайлуста помогите с этим я не знаю как сделать
мне нужно чтобы после 5 атак срабатывал
"bonus_attack_count" "20"
}
"03"
{
"var_type" "FIELD_INTEGER"
"radius" "1750"
спасибо заранее !
 
Последнее редактирование модератором:
bonus_attack_count сколько ударов? Если да поменяй на 5
 
Реклама: