Создал абилку с помощью lua, если играешь за редиант все норм золото тратиться, а за другие команды нет. В чем может быть проблема?
Код:
HP_UP = class ({})
x = {0,0,0,0,0}
function HP_UP:OnSpellStart()
x[5]=x[5]+2
local hCaster = self:GetCaster()
local team = hCaster:GetTeamNumber()
x[team-1] = x[team-1] + 5
end
function HP_UP:GetCooldown( nLevel )
return 0
end
function HP_UP:prost(i)
return x[i]
end
function HP_UP:GetGoldCost()
local baseGoldCost = 10
local extraGoldPerLevel = 5
local newGoldCost = baseGoldCost + x[5] * extraGoldPerLevel
if newGoldCost >= 1000 then
newGoldCost = 999
end
return (newGoldCost)
end
Последнее редактирование модератором: