Мультикаст с возможностью вписать абилки на которые он не будет срабатывать
При активации его - отключает мультикаст для направленных способностей
0 и 1 картинки, 0 - стандарт, 1 - без направленных способностей
Взят отсюда:
resource\flash3\images\spellicons\Сюда картинки из закрепа
scripts\vscripts\libraries\Сюда либы из закрепленного архива
Инжектим их через addon_game_mode.lua
require('libraries/pseudoRandom')
require('libraries/timers')
scripts\vscripts\ability\multicast.lua
scripts\npc\npc_abilities_custom.txt
resource\addon_english.txt
При активации его - отключает мультикаст для направленных способностей
0 и 1 картинки, 0 - стандарт, 1 - без направленных способностей
Взят отсюда:
Для просмотра содержимого вам необходимо авторизоваться.
scripts\vscripts\libraries\Сюда либы из закрепленного архива
Инжектим их через addon_game_mode.lua
require('libraries/pseudoRandom')
require('libraries/timers')
scripts\vscripts\ability\multicast.lua
Lua:
imba_ogre_magi_multicast = class({})
LinkLuaModifier("modifier_imba_multicast_passive", "ability/multicast", LUA_MODIFIER_MOTION_NONE)
modifier_multicast_attack_range = class({})
function modifier_multicast_attack_range:IsDebuff() return false end
function modifier_multicast_attack_range:IsHidden() return true end
function modifier_multicast_attack_range:IsPurgable() return false end
function modifier_multicast_attack_range:IsPurgeException() return false end
function modifier_multicast_attack_range:DeclareFunctions() return {MODIFIER_PROPERTY_ATTACK_RANGE_BONUS} end
function modifier_multicast_attack_range:GetModifierAttackRangeBonus() return 10000 end
function imba_ogre_magi_multicast:GetIntrinsicModifierName() return "modifier_imba_multicast_passive" end
function imba_ogre_magi_multicast:GetAbilityTextureName() return "ogre_magi_multicast_"..self:GetCaster():GetModifierStackCount("modifier_imba_multicast_passive", nil) end
function imba_ogre_magi_multicast:ResetToggleOnRespawn() return false end
function imba_ogre_magi_multicast:OnOwnerDied()
self.toggle = self:GetToggleState()
end
function imba_ogre_magi_multicast:OnOwnerSpawned()
if self.toggle == nil then
self.toggle = false
end
if self.toggle ~= self:GetToggleState() then
self:ToggleAbility()
end
end
function imba_ogre_magi_multicast:OnToggle()
if self:GetToggleState() then
self:GetCaster():FindModifierByName("modifier_imba_multicast_passive"):SetStackCount(1)
else
self:GetCaster():FindModifierByName("modifier_imba_multicast_passive"):SetStackCount(0)
end
self:EndCooldown()
self.toggle = self:GetToggleState()
end
modifier_imba_multicast_passive = class({})
function modifier_imba_multicast_passive:IsDebuff() return false end
function modifier_imba_multicast_passive:IsHidden() return true end
function modifier_imba_multicast_passive:IsPurgable() return false end
function modifier_imba_multicast_passive:IsPurgeException() return false end
function modifier_imba_multicast_passive:AllowIllusionDuplicate() return false end
function modifier_imba_multicast_passive:DeclareFunctions() return {MODIFIER_EVENT_ON_ATTACK_LANDED, MODIFIER_EVENT_ON_ABILITY_FULLY_CAST, MODIFIER_PROPERTY_COOLDOWN_PERCENTAGE} end
function modifier_imba_multicast_passive:GetModifierPercentageCooldown() return (self:GetAbility():GetSpecialValueFor("cdr_pct")) end
function modifier_imba_multicast_passive:OnAttackLanded(keys)
if not IsServer() then
return
end
if keys.attacker ~= self:GetParent() or self:GetParent():IsIllusion() or not self:GetAbility():IsCooldownReady() or not keys.target:IsAlive() then
return
end
if not self:GetParent().splitattack or (self:GetParent():FindAbilityByName("weaver_geminate_attack") and not self:GetParent():FindAbilityByName("weaver_geminate_attack"):IsCooldownReady()) then
return
end
local target = keys.target
local ability = self:GetAbility()
local multicast = 0
if PseudoRandom:RollPseudoRandom(self:GetAbility(), self:GetAbility():GetSpecialValueFor("multicast_4")) then
multicast = 4
elseif PseudoRandom:RollPseudoRandom(self:GetAbility(), self:GetAbility():GetSpecialValueFor("multicast_3")) then
multicast = 3
elseif PseudoRandom:RollPseudoRandom(self:GetAbility(), self:GetAbility():GetSpecialValueFor("multicast_2")) then
multicast = 2
end
if multicast > 0 then
self:GetAbility():StartCooldown(self:GetAbility():GetCooldown(-1) * self:GetParent():GetCooldownReduction())
self:DoMultiAttack(self:GetParent(), target, multicast)
end
end
function modifier_imba_multicast_passive:DoMultiAttack(caster, target, times)
for i = 1, times-1 do
Timers:CreateTimer(i * self:GetAbility():GetSpecialValueFor("multicast_delay"), function()
caster:StartGesture(ACT_DOTA_ATTACK)
caster.splitattack = false
caster:PerformAttack(target, false, true, true, true, false, false, false)
caster.splitattack = true
caster:EmitSound("Hero_OgreMagi.Fireblast.x"..i+1)
local pfx = ParticleManager:CreateParticle("particles/units/heroes/hero_ogre_magi/ogre_magi_multicast.vpcf", PATTACH_OVERHEAD_FOLLOW, caster)
ParticleManager:SetParticleControl(pfx, 1, Vector(i+1, 1, 0))
return nil
end
)
end
end
local NoMultiCastItems = {
--["invoker_quas"] = true, Отключить мультикаст на способности
--["invoker_exort"] = true, Отключить мультикаст на способности
--["invoker_wex"] = true, Отключить мультикаст на способности
--["invoker_invoke"] = true, Отключить мультикаст на способности
}
function modifier_imba_multicast_passive:OnAbilityFullyCast(keys)
if not IsServer() then
return
end
if self.nocast or keys.unit ~= self:GetParent() or not self:GetAbility():IsCooldownReady() then
return
end
if NoMultiCastItems[keys.ability:GetAbilityName()] or bit.band(keys.ability:GetBehavior(), DOTA_ABILITY_BEHAVIOR_CHANNELLED) == DOTA_ABILITY_BEHAVIOR_CHANNELLED then
return
end
local caster = self:GetParent()
local ability = keys.ability
local target = ability:GetCursorTarget()
local pos = ability:GetCursorPosition()
local multicast = 0
if PseudoRandom:RollPseudoRandom(self:GetAbility(), self:GetAbility():GetSpecialValueFor("multicast_4")) then
multicast = 4
elseif PseudoRandom:RollPseudoRandom(self:GetAbility(), self:GetAbility():GetSpecialValueFor("multicast_3")) then
multicast = 3
elseif PseudoRandom:RollPseudoRandom(self:GetAbility(), self:GetAbility():GetSpecialValueFor("multicast_2")) then
multicast = 2
end
if target then
if self:GetStackCount() == 0 then
self:DoMultiTargetAbility(caster, target, ability, multicast)
else
local units = FindUnitsInRadius(caster:GetTeamNumber(), caster:GetAbsOrigin(), nil, ability:GetCastRange(caster:GetAbsOrigin(), caster) + caster:GetCastRangeBonus(), ability:GetAbilityTargetTeam(), ability:GetAbilityTargetType(), ability:GetAbilityTargetFlags(), FIND_ANY_ORDER, false)
for i=2, multicast do
if units[i] then
self:DoMultiTargetAbility(caster, units[i], ability, 2)
end
end
end
return
end
if multicast > 0 then
if pos then
self:DoMultiPositionAbility(caster, pos, ability, multicast)
return
end
self:DoMultiNoTargetAbility(caster, ability, multicast)
end
end
function modifier_imba_multicast_passive:DoMultiTargetAbility(caster, target, ability, times)
self:GetAbility():StartCooldown(self:GetAbility():GetCooldown(-1) * self:GetParent():GetCooldownReduction())
for i = 1, times-1 do
Timers:CreateTimer(i * self:GetAbility():GetSpecialValueFor("multicast_delay"), function()
self.nocast = true
caster:SetCursorCastTarget(target)
ability:OnSpellStart()
self.nocast = false
caster:EmitSound("Hero_OgreMagi.Fireblast.x"..i+1)
local pfx = ParticleManager:CreateParticle("particles/units/heroes/hero_ogre_magi/ogre_magi_multicast.vpcf", PATTACH_OVERHEAD_FOLLOW, caster)
ParticleManager:SetParticleControl(pfx, 1, Vector(i+1, 1, 0))
return nil
end
)
end
end
function modifier_imba_multicast_passive:DoMultiPositionAbility(caster, pos, ability, times)
for i = 1, times-1 do
Timers:CreateTimer(i * self:GetAbility():GetSpecialValueFor("multicast_delay"), function()
self.nocast = true
caster:SetCursorPosition(pos)
ability:OnSpellStart()
self.nocast = false
caster:EmitSound("Hero_OgreMagi.Fireblast.x"..i+1)
local pfx = ParticleManager:CreateParticle("particles/units/heroes/hero_ogre_magi/ogre_magi_multicast.vpcf", PATTACH_OVERHEAD_FOLLOW, caster)
ParticleManager:SetParticleControl(pfx, 1, Vector(i+1, 1, 0))
return nil
end
)
end
end
function modifier_imba_multicast_passive:DoMultiNoTargetAbility(caster, ability, times)
for i = 1, times-1 do
Timers:CreateTimer(i * self:GetAbility():GetSpecialValueFor("multicast_delay"), function()
self.nocast = true
ability:OnSpellStart()
self.nocast = false
caster:EmitSound("Hero_OgreMagi.Fireblast.x"..i+1)
local pfx = ParticleManager:CreateParticle("particles/units/heroes/hero_ogre_magi/ogre_magi_multicast.vpcf", PATTACH_OVERHEAD_FOLLOW, caster)
ParticleManager:SetParticleControl(pfx, 1, Vector(i+1, 1, 0))
return nil
end
)
end
end
function modifier_imba_multicast_passive:OnCreated()
if IsServer() and not self:GetParent():IsIllusion() then
self:StartIntervalThink(1.0)
self.nocast_check = 0
self.noattack_check = 0
end
end
function modifier_imba_multicast_passive:OnIntervalThink()
if self.nocast then
self.nocast_check = self.nocast_check + 1
else
self.nocast_check = 0
end
if self.nocast_check >=5 then
self.nocast = false
end
end
Код:
"imba_ogre_magi_multicast"
{
// General
//-------------------------------------------------------------------------------------------------------------
"BaseClass" "ability_lua"
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_TOGGLE | DOTA_ABILITY_BEHAVIOR_NO_TARGET | DOTA_ABILITY_BEHAVIOR_IMMEDIATE | DOTA_ABILITY_BEHAVIOR_DONT_RESUME_ATTACK | DOTA_ABILITY_BEHAVIOR_IGNORE_CHANNEL"
"AbilityType" "DOTA_ABILITY_TYPE_ULTIMATE"
"AbilityCastAnimation" "ACT_INVALID"
"AbilityTextureName" "ogre_magi_multicast_0" // This is from LOD github.com/darklordabc/Legends-of-Dota-Redux/
"ScriptFile" "ability/multicast.lua"
"AbilityCooldown" "3.0 2.0 1.0"
// Data driven
//-------------------------------------------------------------------------------------------------------------
"precache"
{
"soundfile" "soundevents/game_sounds_heroes/game_sounds_ogre_magi.vsndevts"
"particle" "particles/units/heroes/hero_ogre_magi/ogre_magi_multicast.vpcf"
}
// Special
//-------------------------------------------------------------------------------------------------------------
"AbilitySpecial"
{
"01"
{
"var_type" "FIELD_FLOAT"
"multicast_2" "40 50 60"
}
"02"
{
"var_type" "FIELD_FLOAT"
"multicast_3" "20 25 30"
}
"03"
{
"var_type" "FIELD_FLOAT"
"multicast_4" "0 12.5 15"
}
"04"
{
"var_type" "FIELD_FLOAT"
"cdr_pct" "5 10 15"
}
"04"
{
"var_type" "FIELD_FLOAT"
"multicast_delay" "0.7"
}
}
}
Код:
"DOTA_Tooltip_ability_imba_ogre_magi_multicast" "Multicast"
"DOTA_Tooltip_ability_imba_ogre_magi_multicast_Description" "Enables Ogre Magi to <font color='#FF7800'>cast / attack / use items</font> multiple times.\nToggle On to cast on multiple targets.\n<font color='#FF7800'>Ogre Magi's Wisdom: </font>gain bonus cooldown reduction."
"DOTA_Tooltip_ability_imba_ogre_magi_multicast_Lore" "Despite being largely incapacitated by his IQ, the Ogre Magi's success in battle is attributed to pure skill."
"DOTA_Tooltip_ability_imba_ogre_magi_multicast_multicast_2" "%2X CHANCE:"
"DOTA_Tooltip_ability_imba_ogre_magi_multicast_multicast_3" "%3X CHANCE:"
"DOTA_Tooltip_ability_imba_ogre_magi_multicast_multicast_4" "%4X CHANCE:"
"DOTA_Tooltip_ability_imba_ogre_magi_multicast_cdr_pct" "%COOLDOWN REDUCTION:"
Вложения
Последнее редактирование: