sven_god_strength = class({})
function sven_god_strength:GetBehavior()
return DOTA_ABILITY_BEHAVIOR_NO_TARGET + DOTA_ABILITY_BEHAVIOR_IGNORE_BACKSWING
end
function sven_god_strength:OnSpellStart()
local caster = self:GetCaster()
local buff_duration = self:GetSpecialValueFor("buff_duration")
caster:AddNewModifier(caster, self, "modifier_sven_god_strength", {duration = buff_duration})
EmitSoundOn("Hero_Sven.GodsStrength",caster)
local effect = "particles/units/heroes/hero_sven/sven_spell_gods_strength.vpcf"
local pfx = ParticleManager:CreateParticle(effect, PATTACH_ABSORIGIN_FOLLOW, caster)
ParticleManager:ReleaseParticleIndex(pfx)
end
modifier_sven_god_strength = class({
IsHidden = function(self) return false end,
IsPurgable = function(self) return false end,
IsDebuff = function(self) return false end,
IsBuff = function(self) return true end,
RemoveOnDeath = function(self) return false end,
DeclareFunctions = function(self) return
{
MODIFIER_PROPERTY_STATS_STRENGTH_BONUS,
MODIFIER_PROPERTY_BASEDAMAGEOUTGOING_PERCENTAGE,
MODIFIER_PROPERTY_OVERRIDE_ABILITY_SPECIAL,
MODIFIER_PROPERTY_OVERRIDE_ABILITY_SPECIAL_VALUE
} end,
})
function modifier_sven_god_strength:OnIntervalThink()
local ability = self:GetAbility()
if ability.passive_skill == false then
self:Destroy()
end
end
function modifier_sven_god_strength:GetPriority()
return 50
end
function modifier_sven_god_strength:OnCreated()
local caster = self:GetCaster()
local ability = self:GetAbility()
EmitSoundOn("Hero_Sven.GodsStrength",caster)
local effect = "particles/units/heroes/hero_sven/sven_spell_gods_strength.vpcf"
local pfx = ParticleManager:CreateParticle(effect, PATTACH_ABSORIGIN_FOLLOW, caster)
ParticleManager:ReleaseParticleIndex(pfx)
end
function modifier_sven_god_strength:GetModifierOverrideAbilitySpecial( params )
if self:GetParent() == nil or params.ability == nil then
return 0
end
local szAbilityName = params.ability:GetAbilityName()
local szSpecialValueName = params.ability_special_value
if szAbilityName == "sven_thirsty_blade" or szAbilityName == "sven_thirsty_blade_mega" then
if szSpecialValueName == "cleave_radius" then
return 1
end
if szSpecialValueName == "cleave_damage_pct" then
return 1
end
end
return 0
end
function modifier_sven_god_strength:GetModifierOverrideAbilitySpecialValue( params )
local szAbilityName = params.ability:GetAbilityName()
local szSpecialValueName = params.ability_special_value
if szAbilityName == "sven_thirsty_blade" or szAbilityName == "sven_thirsty_blade_mega" then
if szSpecialValueName == "cleave_radius" then
local nSpecialLevel = params.ability_special_level
local flBaseValue = params.ability:GetLevelSpecialValueNoOverride( szSpecialValueName, nSpecialLevel )
return flBaseValue * self:GetAbility():GetSpecialValueFor("splash_multiplier")
end
if szSpecialValueName == "cleave_damage_pct" then
local nSpecialLevel = params.ability_special_level
local flBaseValue = params.ability:GetLevelSpecialValueNoOverride( szSpecialValueName, nSpecialLevel )
return flBaseValue * self:GetAbility():GetSpecialValueFor("splash_multiplier")
end
end
return 0
end
function modifier_sven_god_strength:GetStatusEffectName()
return "particles/status_fx/status_effect_gods_strength.vpcf"
end
function modifier_sven_god_strength:GetPriority()
return 50
end
function modifier_sven_god_strength:GetModifierBonusStats_Strength()
return self:GetAbility():GetSpecialValueFor("bonus_str")
end
function modifier_sven_god_strength:GetModifierBaseDamageOutgoing_Percentage()
return self:GetAbility():GetSpecialValueFor("bonus_dmg")
end
sven_god_strength_mega = class(sven_god_strength)
LinkLuaModifier("modifier_sven_god_strength", "abilities/heroes/hero_sven/god_strength", LUA_MODIFIER_MOTION_NONE,[/SPOILER] modifier_sven_god_strength)
Если разберешься как это работает, то сам всё сможешь сделать...MODIFIER_PROPERTY_OVERRIDE_ABILITY_SPECIAL
GetModifierOverrideAbilitySpecial
MODIFIER_PROPERTY_OVERRIDE_ABILITY_SPECIAL_VALUE
GetModifierOverrideAbilitySpecialValue
Вот тебе пример из моей кастомки, ульта свена увеличивает радиус и процент сплеша на Х
Код:sven_god_strength = class({}) function sven_god_strength:GetBehavior() return DOTA_ABILITY_BEHAVIOR_NO_TARGET + DOTA_ABILITY_BEHAVIOR_IGNORE_BACKSWING end function sven_god_strength:OnSpellStart() local caster = self:GetCaster() local buff_duration = self:GetSpecialValueFor("buff_duration") caster:AddNewModifier(caster, self, "modifier_sven_god_strength", {duration = buff_duration}) EmitSoundOn("Hero_Sven.GodsStrength",caster) local effect = "particles/units/heroes/hero_sven/sven_spell_gods_strength.vpcf" local pfx = ParticleManager:CreateParticle(effect, PATTACH_ABSORIGIN_FOLLOW, caster) ParticleManager:ReleaseParticleIndex(pfx) end modifier_sven_god_strength = class({ IsHidden = function(self) return false end, IsPurgable = function(self) return false end, IsDebuff = function(self) return false end, IsBuff = function(self) return true end, RemoveOnDeath = function(self) return false end, DeclareFunctions = function(self) return { MODIFIER_PROPERTY_STATS_STRENGTH_BONUS, MODIFIER_PROPERTY_BASEDAMAGEOUTGOING_PERCENTAGE, MODIFIER_PROPERTY_OVERRIDE_ABILITY_SPECIAL, MODIFIER_PROPERTY_OVERRIDE_ABILITY_SPECIAL_VALUE } end, }) function modifier_sven_god_strength:OnIntervalThink() local ability = self:GetAbility() if ability.passive_skill == false then self:Destroy() end end function modifier_sven_god_strength:GetPriority() return 50 end function modifier_sven_god_strength:OnCreated() local caster = self:GetCaster() local ability = self:GetAbility() EmitSoundOn("Hero_Sven.GodsStrength",caster) local effect = "particles/units/heroes/hero_sven/sven_spell_gods_strength.vpcf" local pfx = ParticleManager:CreateParticle(effect, PATTACH_ABSORIGIN_FOLLOW, caster) ParticleManager:ReleaseParticleIndex(pfx) end function modifier_sven_god_strength:GetModifierOverrideAbilitySpecial( params ) if self:GetParent() == nil or params.ability == nil then return 0 end local szAbilityName = params.ability:GetAbilityName() local szSpecialValueName = params.ability_special_value if szAbilityName == "sven_thirsty_blade" or szAbilityName == "sven_thirsty_blade_mega" then if szSpecialValueName == "cleave_radius" then return 1 end if szSpecialValueName == "cleave_damage_pct" then return 1 end end return 0 end function modifier_sven_god_strength:GetModifierOverrideAbilitySpecialValue( params ) local szAbilityName = params.ability:GetAbilityName() local szSpecialValueName = params.ability_special_value if szAbilityName == "sven_thirsty_blade" or szAbilityName == "sven_thirsty_blade_mega" then if szSpecialValueName == "cleave_radius" then local nSpecialLevel = params.ability_special_level local flBaseValue = params.ability:GetLevelSpecialValueNoOverride( szSpecialValueName, nSpecialLevel ) return flBaseValue * self:GetAbility():GetSpecialValueFor("splash_multiplier") end if szSpecialValueName == "cleave_damage_pct" then local nSpecialLevel = params.ability_special_level local flBaseValue = params.ability:GetLevelSpecialValueNoOverride( szSpecialValueName, nSpecialLevel ) return flBaseValue * self:GetAbility():GetSpecialValueFor("splash_multiplier") end end return 0 end function modifier_sven_god_strength:GetStatusEffectName() return "particles/status_fx/status_effect_gods_strength.vpcf" end function modifier_sven_god_strength:GetPriority() return 50 end function modifier_sven_god_strength:GetModifierBonusStats_Strength() return self:GetAbility():GetSpecialValueFor("bonus_str") end function modifier_sven_god_strength:GetModifierBaseDamageOutgoing_Percentage() return self:GetAbility():GetSpecialValueFor("bonus_dmg") end sven_god_strength_mega = class(sven_god_strength) LinkLuaModifier("modifier_sven_god_strength", "abilities/heroes/hero_sven/god_strength", LUA_MODIFIER_MOTION_NONE,[/SPOILER] modifier_sven_god_strength)