CustomGames.ru - Dota 2 пользовательские игры

Как использовать готовые луа

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн remeercs

  • 73
  • Мощь: 1
Вот как мне реализовать этИ скриптЫ и добавить скиллы герою
Спойлер
function DummyThink(keys)
   local caster = keys.caster
   local dummy = keys.target
   local ability = keys.ability
   local level = ability:GetLevel() - 1
   local think_interval = ability:GetLevelSpecialValueFor("think_interval", level)
   local pull_speed = ability:GetLevelSpecialValueFor("pull_per_second", level) * think_interval
   local slow_min_pct = ability:GetLevelSpecialValueFor("slow_min_pct", level)
   local slow_max_pct = ability:GetLevelSpecialValueFor("slow_max_pct", level)
   local dummyPosition = dummy:GetAbsOrigin()
   local radius = ability:GetLevelSpecialValueFor("aoe_radius", level)
   for _,v in ipairs(FindUnitsInRadius(caster:GetTeam(), dummyPosition, nil, radius, ability:GetAbilityTargetTeam(), ability:GetAbilityTargetType(), ability:GetAbilityTargetFlags(), FIND_ANY_ORDER, false)) do
      if not v:IsMagicImmune() and not v:IsRooted() then
         local targetPosition = v:GetAbsOrigin()
         local len = (dummyPosition - targetPosition):Length2D()
         FindClearSpaceForUnit(v, len <= pull_speed and targetPosition or (targetPosition + (dummyPosition - targetPosition):Normalized() * pull_speed), false)
         local perMapUnit = (slow_max_pct - slow_min_pct) / radius
         local slow = slow_min_pct + perMapUnit * (radius - len)
         ability:ApplyDataDrivenModifier(caster, v, "modifier_poseidon_sea_hole_slow", nil)
         v:SetModifierStackCount("modifier_poseidon_sea_hole_slow", caster, math.abs(slow))
      end
   end
end
Спойлер
function DarkWhale(keys)
   local caster = keys.caster
   local ability = keys.ability
   local point = keys.target_points[1]
   local level = ability:GetLevel() - 1
   
   local damage_min = ability:GetLevelSpecialValueFor("damage_min", level)
   local damage_max = ability:GetLevelSpecialValueFor("damage_max", level)
   local stun_min = ability:GetLevelSpecialValueFor("stun_min", level)
   local stun_max = ability:GetLevelSpecialValueFor("stun_max", level)
   local radius = ability:GetLevelSpecialValueFor("aoe_radius", level)
   local pfx = ParticleManager:CreateParticle("particles/arena/units/heroes/hero_poseidon/dark_whale.vpcf", PATTACH_ABSORIGIN, caster)

   ParticleManager:SetParticleControl(pfx, 0, point)
   ParticleManager:SetParticleControl(pfx, 5, Vector(radius))
   EmitSoundOnLocationWithCaster(point, "Arena.Hero_Poseidon.DarkWhale", caster)
   
   for _,v in ipairs(FindUnitsInRadius(caster:GetTeam(), point, nil, radius, ability:GetAbilityTargetTeam(), ability:GetAbilityTargetType(), ability:GetAbilityTargetFlags(), FIND_ANY_ORDER, false)) do
      local targetPosition = v:GetAbsOrigin()
      local lenToBorder = radius - (point - targetPosition):Length2D()
      local damage = damage_min + (damage_max - damage_min) / radius * lenToBorder
      local stun = stun_min + (stun_max - stun_min) / radius * lenToBorder
      ApplyDamage({
         victim = v,
         attacker = caster,
         damage = damage,
         damage_type = ability:GetAbilityDamageType(),
         ability = ability
      })
      if not v:IsMagicImmune() then
         v:AddNewModifier(caster, ability, "modifier_stunned", {duration = stun})
      end
   end
end   

Спойлер
"poseidon_wave"
   {
      "BaseClass"                   "ability_datadriven"
      "AbilityTextureName"         "arena/poseidon_wave"
      "MaxLevel"                   "7"

      "AbilityBehavior"            "DOTA_ABILITY_BEHAVIOR_POINT"
      "AbilityUnitTargetTeam"         "DOTA_UNIT_TARGET_TEAM_ENEMY"
      "AbilityUnitTargetType"         "DOTA_UNIT_TARGET_HERO | DOTA_UNIT_TARGET_BASIC"
      "AbilityUnitDamageType"         "DAMAGE_TYPE_MAGICAL"

      "AbilityCooldown"            "16"
      "AbilityManaCost"            "90"
      "AbilityDamage"               "100 150 200 250 300 350 450"

      "AbilityCastRange"            "%range"
      "AbilityCastPoint"            "0.3 0.3 0.3 0.3 0.3 0.2 0.1"

      "AbilitySpecial"
      {
         "01"
         {
            "var_type"         "FIELD_FLOAT"
            "stun_duration"      "0.8 1.0 1.2 1.4 1.6 1.8 2.0"
         }
         "02"
         {
            "var_type"         "FIELD_INTEGER"
            "range"            "950"
         }
         "03"
         {
            "var_type"         "FIELD_INTEGER"
            "projectile_speed"   "1000"
         }
         "04"
         {
            "var_type"         "FIELD_INTEGER"
            "projectile_width"   "100"
         }
      }
вот еще это оно не работает
[свернуть]
[свернуть]
[свернуть]
« Последнее редактирование: 30-07-2017, 12:26:37 от remeercs »

Оффлайн Adam Smith

  • Друзья CG
  • 476
  • Мощь: 6
  • жрять жри его
By PG.Freeman

Оффлайн Илья

  • Супермодератор
  • 2131
  • Мощь: 21