hmmm it would be more complicate.. i do what you suggest, and.. nothing happend. but imho it must be more complicate.
what i do in code. on units script on end i add this code (its copypast from xsl0001 script):
- Code: Select all
################### CARRIER BUFF ###############
RegenBuffThread = function(self)
local bp = self:GetBlueprint().Enhancements.RegenAura
local unitCat = ParseEntityCategory( bp.UnitCategory or 'BUILTBYTIER3FACTORY + BUILTBYQUANTUMGATE + NEEDMOBILEBUILD')
while not self:IsDead() do
#Get friendly units in the area (including self)
local units = AIUtils.GetOwnUnitsAroundPoint(self:GetAIBrain(), unitCat, self:GetPosition(), bp.Radius)
#Give them a 5 second regen buff
for _,unit in units do
Buff.ApplyBuff(unit, 'SeraphimACURegenAura')
end
#Wait 5 seconds
WaitSeconds(5)
end
end,
CreateEnhancement = function(self, enh)
SWalkingLandUnit.CreateEnhancement(self, enh)
local bp = self:GetBlueprint().Enhancements[enh]
# Regenerative Aura
if enh == 'RegenAura' then
if not Buffs['SeraphimACURegenAura'] then # AURA BUFF
BuffBlueprint {
Name = 'SeraphimACURegenAura',
DisplayName = 'SeraphimACURegenAura',
BuffType = 'COMMANDERAURA',
Stacks = 'REPLACE',
Duration = 5,
Affects = {
RegenPercent = {
Add = 0,
Mult = bp.RegenPerSecond or 0.1,
Ceil = bp.RegenCeiling,
Floor = bp.RegenFloor,
},
},
}
end
on blue print under buff section add this:
- Code: Select all
BuffFields = {
RegenField = 'SeraphimACURegenBuffField',
},
It was nothing say about concrete buff, so i was think it would found data from another file what define bufffield what is on unit.lua. because nothing happend, so i also add this section, and put it under buffFields:
- Code: Select all
RegenAura = {
ACUAddHealth = 1000, #added
BuildCostEnergy = 4500,
BuildCostMass = 600,
BuildTime = 600,
Icon = 'nrf',
Name = '<LOC enhancements_0125>Restoration Field',
Radius = 22, # 15
RegenCeiling = 15, # 75
RegenFloor = 0,
RegenPerSecond = 0.02, # 0.0055555555
UnitCategory = 'BUILTBYTIER3FACTORY, BUILTBYQUANTUMGATE, NEEDMOBILEBUILD', #added
},
but still nothing happend. This was loking too easy, and dont work, or i do something dumb :/
on maintance, i probably need new toggle for new function. or use old toggle that loks similar I know how to set maintance, problem is that dont know how to set new function, to work, and where in .bp add new section about this function.