restructure

This commit is contained in:
2021-11-10 08:48:00 -05:00
parent d3eac6b70e
commit aaa089715d
12018 changed files with 6424 additions and 135034 deletions

View File

@@ -0,0 +1,7 @@
thtd_hanadayousei_01 = class({})
LinkLuaModifier("modifier_hanadayousei_01", "abilities/ability_lua/modifier_hanadayousei_01", LUA_MODIFIER_MOTION_NONE)
function thtd_hanadayousei_01:GetIntrinsicModifierName()
return "modifier_hanadayousei_01"
end

View File

@@ -0,0 +1,8 @@
thtd_hourainingyou_01 = class({})
LinkLuaModifier("modifier_hourainingyou_01", "abilities/ability_lua/modifier_hourainingyou_01", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_hourainingyou_01_stun_lock", "abilities/ability_lua/modifier_hourainingyou_01_stun_lock", LUA_MODIFIER_MOTION_NONE)
function thtd_hourainingyou_01:GetIntrinsicModifierName()
return "modifier_hourainingyou_01"
end

View File

@@ -0,0 +1,83 @@
thtd_lily_01 = class({})
LinkLuaModifier("modifier_lily_01_effect_think", "abilities/ability_lua/modifier_lily_01_effect_think", LUA_MODIFIER_MOTION_NONE)
function thtd_lily_01:GetIntrinsicModifierName()
return "modifier_lily_01_effect_think"
end
function thtd_lily_01:GetAOERadius()
return self:GetSpecialValueFor("radius")
end
function thtd_lily_01:OnSpellStart()
if SpawnSystem.IsUnLimited then return end
if GameRules:GetCustomGameDifficulty() >= FUNNY_MODE then return end
local caster = self:GetCaster()
local ability = self
local targetPoint = self:GetCursorPosition()
local targets =
FindUnitsInRadius(
caster:GetTeamNumber(),
targetPoint,
nil,
ability:GetSpecialValueFor("radius"),
ability:GetAbilityTargetTeam(),
ability:GetAbilityTargetType(),
ability:GetAbilityTargetFlags(),
FIND_CLOSEST,
false
)
local exp = 1000 + caster:THTD_GetPower() * ability:GetSpecialValueFor("power_factor")
for k,v in pairs(targets) do
if v ~= nil and v:IsNull() == false and v:THTD_IsTower() and v ~= caster and v:GetOwner() == caster:GetOwner() and v:THTD_GetLevel() < THTD_MAX_LEVEL then
v:THTD_AddExp(exp)
end
end
local effectIndex = ParticleManager:CreateParticle("particles/heroes/lily/ability_lily_01_a.vpcf", PATTACH_CUSTOMORIGIN, caster)
ParticleManager:SetParticleControl(effectIndex, 0, targetPoint)
ParticleManager:DestroyParticleSystem(effectIndex,false)
end
thtd_lily_02 = class({})
LinkLuaModifier("modifier_lily_02_buff", "abilities/ability_lua/modifier_lily_02_buff", LUA_MODIFIER_MOTION_NONE)
function thtd_lily_02:OnSpellStart()
local caster = self:GetCaster()
caster:EmitSound("Sound_THTD.thtd_lily_02")
self.radius = self:GetSpecialValueFor("radius")
self.duration = self:GetSpecialValueFor("duration")
self.damage_up = self:GetSpecialValueFor("damage_up")
local targets =
FindUnitsInRadius(
caster:GetTeamNumber(),
caster:GetOrigin(),
nil,
self.radius,
self:GetAbilityTargetTeam(),
self:GetAbilityTargetType(),
self:GetAbilityTargetFlags(),
FIND_CLOSEST,
false
)
for k,v in pairs(targets) do
if not v:HasModifier("modifier_lily_02_buff") then
v:AddNewModifier(caster, self, "modifier_lily_02_buff", {Duration = self.duration})
end
end
local effectIndex = ParticleManager:CreateParticle("particles/heroes/lily/ability_lily_02.vpcf", PATTACH_CUSTOMORIGIN, caster)
ParticleManager:SetParticleControl(effectIndex, 0, caster:GetOrigin())
ParticleManager:SetParticleControl(effectIndex, 1, Vector(self.radius,self.radius,self.radius))
ParticleManager:DestroyParticleSystemTime(effectIndex,self.duration)
end

View File

@@ -0,0 +1,61 @@
modifier_hanadayousei_01 = class({})
local public = modifier_hanadayousei_01
--------------------------------------------------------------------------------
function public:IsDebuff()
return false
end
--------------------------------------------------------------------------------
function public:IsHidden()
return true
end
--------------------------------------------------------------------------------
function public:IsPurgable()
return false
end
function public:GetTexture()
return "touhoutd/thtd_hanadayousei_01"
end
--------------------------------------------------------------------------------
function public:DeclareFunctions()
local funcs = {
MODIFIER_EVENT_ON_ATTACK,
}
return funcs
end
function public:OnAttack( params )
if IsServer() then
if params.attacker ~= self:GetParent() or self:GetParent():IsIllusion() then return end
if self:GetParent():PassivesDisabled() then return end
local caster = params.attacker
local target = params.target
if caster.__hanadayousei_lock ~= true then
caster.__hanadayousei_lock = true
local targets = THTD_FindUnitsInRadius(caster,caster:GetOrigin(),800)
local count = 1
for i=1,#targets do
local unit = targets[i]
if unit~=nil and unit:IsNull()==false and unit~=target and unit:IsAlive() then
caster:PerformAttack(unit,true,false,true,false,true,false,true)
count = count + 1
end
if count > 3 then
break
end
end
caster.__hanadayousei_lock = false
end
end
end

View File

@@ -0,0 +1,61 @@
modifier_hourainingyou_01 = class({})
local public = modifier_hourainingyou_01
--------------------------------------------------------------------------------
function public:IsDebuff()
return false
end
--------------------------------------------------------------------------------
function public:IsHidden()
return true
end
--------------------------------------------------------------------------------
function public:IsPurgable()
return false
end
function public:GetTexture()
return "touhoutd/thtd_hourainingyou_01"
end
--------------------------------------------------------------------------------
function public:DeclareFunctions()
local funcs = {
MODIFIER_EVENT_ON_ATTACK_LANDED,
}
return funcs
end
function public:OnAttackLanded( params )
if IsServer() then
if params.attacker ~= self:GetParent() or self:GetParent():IsIllusion() then return end
if self:GetParent():PassivesDisabled() then return end
local caster = params.attacker
local target = params.target
local ability = self:GetAbility()
if RollPercentage(ability:GetSpecialValueFor("chance")) then
if not target:HasModifier("modifier_hourainingyou_01_stun_lock") then
target:AddNewModifier(caster, ability, "modifier_hourainingyou_01_stun_lock", {Duration = ability:GetSpecialValueFor("lock_time")})
UnitStunTarget(caster,target,ability:GetSpecialValueFor("stun_time"))
end
local DamageTable = {
ability = ability,
victim = target,
attacker = caster,
damage = caster:THTD_GetAbilityPowerDamage(ability),
damage_type = ability:GetAbilityDamageType(),
damage_flags = DOTA_DAMAGE_FLAG_NONE
}
UnitDamageTarget(DamageTable)
end
end
end

View File

@@ -0,0 +1,27 @@
modifier_hourainingyou_01_stun_lock = class({})
local public = modifier_hourainingyou_01_stun_lock
--------------------------------------------------------------------------------
function public:IsDebuff()
return false
end
--------------------------------------------------------------------------------
function public:IsHidden()
return false
end
--------------------------------------------------------------------------------
function public:IsPurgable()
return false
end
function public:GetTexture()
return "touhoutd/thtd_hourainingyou_01"
end
--------------------------------------------------------------------------------

View File

@@ -0,0 +1,50 @@
modifier_lily_01_effect_think = class({})
local public = modifier_lily_01_effect_think
function public:IsHidden()
return true
end
function public:IsDebuff()
return false
end
function public:IsPurgable()
return false
end
function public:GetAttributes()
return MODIFIER_ATTRIBUTE_IGNORE_INVULNERABLE
end
function public:OnIntervalThink()
if IsServer() then
local caster = self:GetParent()
local ability = self:GetAbility()
if ability:IsCooldownReady() and ability:IsFullyCastable() and SpawnSystem.IsUnLimited == false then
if caster.thtd_lily_01_effectIndex == nil then
caster.thtd_lily_01_effectIndex = ParticleManager:CreateParticle("particles/heroes/lily/ability_lily_01_ready.vpcf", PATTACH_CUSTOMORIGIN, caster)
ParticleManager:SetParticleControlEnt(caster.thtd_lily_01_effectIndex , 0, caster, 5, "follow_origin", Vector(0,0,0), true)
end
elseif caster.thtd_lily_01_effectIndex ~= nil then
ParticleManager:DestroyParticleSystem(caster.thtd_lily_01_effectIndex,true)
caster.thtd_lily_01_effectIndex = nil
end
end
end
function public:OnCreated(kv)
if IsServer() then
self:StartIntervalThink(self:GetAbility():GetSpecialValueFor("effect_tick"))
end
end
function public:OnDestroy(kv)
if IsServer() then
self:StartIntervalThink(-1)
end
end

View File

@@ -0,0 +1,51 @@
modifier_lily_02_buff = class({})
local public = modifier_lily_02_buff
--------------------------------------------------------------------------------
function public:IsDebuff()
return false
end
--------------------------------------------------------------------------------
function public:IsHidden()
return false
end
--------------------------------------------------------------------------------
function public:IsPurgable()
return false
end
function public:GetTexture()
return "touhoutd/thtd_lily_02"
end
--------------------------------------------------------------------------------
function public:OnCreated(kv)
if IsServer() then
local target = self:GetParent()
local ability_damage_up = self:GetAbility():GetSpecialValueFor("damage_up")
local playerid = self:GetCaster():GetPlayerOwnerID()
local crit = 1.0
if GameRules.player_bb_buff[playerid]["item_3029"] > 0 then
crit = 1 + GameRules.player_bb_buff[playerid]["item_3029"]/100
end
local bonus = math.floor(ability_damage_up * crit)
target:AddDamageOutgoingAll(bonus, "thtd_lily_02_damage_up")
end
end
--------------------------------------------------------------------------------
function public:OnDestroy(kv)
if IsServer() then
self:GetParent():AddDamageOutgoingAll("thtd_lily_02_damage_up")
end
end

View File

@@ -0,0 +1,74 @@
modifier_mugiyousei_01 = class({})
local public = modifier_mugiyousei_01
--------------------------------------------------------------------------------
function public:IsDebuff()
return false
end
--------------------------------------------------------------------------------
function public:IsHidden()
return true
end
--------------------------------------------------------------------------------
function public:IsPurgable()
return false
end
function public:GetTexture()
return "touhoutd/thtd_mugiyousei_01"
end
--------------------------------------------------------------------------------
function public:DeclareFunctions()
local funcs = {
MODIFIER_EVENT_ON_ATTACK_LANDED,
}
return funcs
end
function public:OnAttackLanded( params )
if IsServer() then
if params.attacker ~= self:GetParent() or self:GetParent():IsIllusion() then return end
if self:GetParent():PassivesDisabled() then return end
local caster = params.attacker
local target = params.target
local ability = self:GetAbility()
local damage = caster:THTD_GetAbilityPowerDamage(ability)
local time = ability:GetSpecialValueFor("damage_duration")
target:AddPoison(1, caster)
target:SetContextThink(DoUniqueString("thtd_mugiyousei01_attack"),
function()
if GameRules:IsGamePaused() then return 0.03 end
if time <= 0 or THTD_IsValid(target) == false then
if target ~= nil and target:IsNull() == false then
target:AddPoison(-1)
end
return nil
end
local DamageTable = {
ability = ability,
victim = target,
attacker = caster,
damage = damage,
damage_type = ability:GetAbilityDamageType(),
damage_flags = DOTA_DAMAGE_FLAG_NONE
}
UnitDamageTarget(DamageTable)
time = time - 1.0
return 1.0
end,
0)
end
end

View File

@@ -0,0 +1,102 @@
modifier_nazrin_01 = class({})
local public = modifier_nazrin_01
--------------------------------------------------------------------------------
function public:IsDebuff()
return false
end
--------------------------------------------------------------------------------
function public:IsHidden()
return true
end
--------------------------------------------------------------------------------
function public:IsPurgable()
return false
end
function public:GetTexture()
return "touhoutd/thtd_nazrin_01"
end
--------------------------------------------------------------------------------
function public:DeclareFunctions()
local funcs = {
MODIFIER_EVENT_ON_ATTACK_LANDED,
}
return funcs
end
function public:OnAttackLanded( params )
if IsServer() then
-- 必须加下下面判断否则会对所有单位攻击都有效因lua这个是按事件处理和KV的不同只要是攻击这个行为就会触发事件所以尽量不要使用lua的OnXXX事件方式
if params.attacker ~= self:GetParent() or self:GetParent():IsIllusion() then return end
if self:GetParent():PassivesDisabled() then return end
-- PrintTable(params)
-- [VScript] attacker:
-- [VScript] basher_tested: false
-- [VScript] cost: 0
-- [VScript] damage: 4
-- [VScript] damage_category: 1
-- [VScript] damage_flags: 0
-- [VScript] damage_type: 1
-- [VScript] diffusal_applied: false
-- [VScript] distance: 0
-- [VScript] do_not_consume: false
-- [VScript] fail_type: 0
-- [VScript] gain: 0
-- [VScript] heart_regen_applied: false
-- [VScript] ignore_invis: false
-- [VScript] issuer_player_index: 0
-- [VScript] mkb_tested: false
-- [VScript] new_pos: Vector 0000000003530FA8 [0.000000 0.000000 0.000000]
-- [VScript] no_attack_cooldown: false
-- [VScript] order_type: 0
-- [VScript] original_damage: 4
-- [VScript] process_procs: true
-- [VScript] ranged_attack: true
-- [VScript] record: 1
-- [VScript] reincarnate: false
-- [VScript] stout_tested: false
-- [VScript] target:
local caster = params.attacker
local target = params.target
local ability = self:GetAbility()
if SpawnSystem.IsUnLimited then
if caster:HasModifier("modifier_byakuren_03_buff") then
local targets = THTD_FindUnitsInRadius(caster,target:GetOrigin(),400)
local damage = caster:GetGold()*caster:THTD_GetStar()*caster.thtd_byakuren_buff_nazrin
for k,v in pairs(targets) do
local DamageTable = {
ability = ability,
victim = v,
attacker = caster,
damage = damage,
damage_type = DAMAGE_TYPE_PHYSICAL,
damage_flags = DOTA_DAMAGE_FLAG_NONE
}
UnitDamageTarget(DamageTable)
end
end
return
end
if GameRules:GetCustomGameDifficulty() >= FUNNY_MODE then return end
if RollPercentage(ability:GetSpecialValueFor("bonus_chance")) then
local gold = math.floor(caster:THTD_GetPower() * ability:GetSpecialValueFor("power_percent")/100 + ability:GetSpecialValueFor("bonus_gold"))
THTD_ModifyGoldEx(caster:GetPlayerOwnerID(), gold , true, DOTA_ModifyGold_CreepKill)
SendOverheadEventMessage(caster:GetPlayerOwner(), OVERHEAD_ALERT_GOLD, target, gold, caster:GetPlayerOwner() )
caster:EmitSound("Sound_THTD.thtd_nazrin_01")
end
end
end

View File

@@ -0,0 +1,7 @@
thtd_mugiyousei_01 = class({})
LinkLuaModifier("modifier_mugiyousei_01", "abilities/ability_lua/modifier_mugiyousei_01", LUA_MODIFIER_MOTION_NONE)
function thtd_mugiyousei_01:GetIntrinsicModifierName()
return "modifier_mugiyousei_01"
end

View File

@@ -0,0 +1,7 @@
thtd_nazrin_01 = class({})
LinkLuaModifier("modifier_nazrin_01", "abilities/ability_lua/modifier_nazrin_01", LUA_MODIFIER_MOTION_NONE)
function thtd_nazrin_01:GetIntrinsicModifierName()
return "modifier_nazrin_01"
end