Modding creature abilities
Hello , I'm working on a little mod and want to ask you how can I restrict creature abilities? The abilities must be available only when a certain condition is met. The condition I want most is - creature experience level in Red Sands, but morale, level of the hero are also good ones.
I found this for the chosha unit in addon_unit_features.lua :
function chosha_features(unit)
local i = unit
if i == nil then i = 0 end
if Attack.act_name(i)=="chosha" then
if Attack.act_size(i)> Attack.act_initsize(i)/2 then
Attack.act_enable_attack(i,"eat_all",false)
else
Attack.act_enable_attack(i,"eat_all")
end
end
return true
end
The condition here is stack size , but when I add this function for firemage's fire_shot ability it just does nothing.
Thank you!
|