initial commit
This commit is contained in:
40
scripts/vscripts/abilities/abilitymugiyousei.lua
Executable file
40
scripts/vscripts/abilities/abilitymugiyousei.lua
Executable file
@@ -0,0 +1,40 @@
|
||||
function OnMugiyousei01AttackLanded(keys)
|
||||
local caster = EntIndexToHScript(keys.caster_entindex)
|
||||
local target = keys.target
|
||||
|
||||
local powerDamage = 0
|
||||
local powerDuration = 0
|
||||
local pv = caster:GetAbilityPowerValue(keys.ability:GetAbilityName())
|
||||
if pv ~= nil then
|
||||
powerDamage = pv[1]
|
||||
powerDuration = pv[2]
|
||||
end
|
||||
|
||||
local damage = caster:THTD_GetAbilityPowerDamage(keys.ability) * (1 + powerDamage)
|
||||
local time = keys.damage_duration + powerDuration
|
||||
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 = keys.ability,
|
||||
victim = target,
|
||||
attacker = caster,
|
||||
damage = damage,
|
||||
damage_type = keys.ability:GetAbilityDamageType(),
|
||||
damage_flags = DOTA_DAMAGE_FLAG_NONE
|
||||
}
|
||||
UnitDamageTarget(DamageTable)
|
||||
|
||||
time = time - 1.0
|
||||
return 1.0
|
||||
end,
|
||||
0)
|
||||
end
|
||||
Reference in New Issue
Block a user