Question about lua code for healing - modder assistance needed
I'm working on a write up that is going to be fairly in depth that covers how healing works as cast by minions, etc. I unfortunately don't have access to the modding forum from here, so I'm posting this in general DG chat. Any help would be appreciated.
I'm reviewing highpriest01_abilities.lua in dgdata.zip Units -> Minions -> HighPriest folder. I'm trying to understand exactly how the healing wind buff is applied. From what I'm seeing, the base heal of a monk is 10% of a dgs max HP. with the healing wind I modifier, I'm seeing a 15% heal of a dgs max health... and near as I can tell, the healing wind 2 buff provides a 15% heal of a dgs max health + 300 hp. Am I reading that right because I'm not all that sure I am? Thanks!
I'm wondering if there is no additional buff for healing wind 2 here... thanks
here's the entire code from the file i mentioned:
- local Buff = import('/lua/sim/buff.lua')
- #################################################################################################################
- # Non-Demigod Heal - This heal is used on non-demigods
- #################################################################################################################
- BuffBlueprint {
- Name = 'HighPriest01Heal01',
- Debuff = false,
- DisplayName = 'Heal',
- BuffType = 'HIGHPRIESTHEALTH',
- Stacks = 'ALWAYS',
- Duration = 0,
- DamageFriendly = true,
- DamageSelf = true,
- Affects = {
- Health = {Add = 200},
- },
- }
- #################################################################################################################
- # Healing Improved by Sedna's Healing Wind I
- #################################################################################################################
- BuffBlueprint {
- Name = 'HighPriest01HealHealingWindBuff01',
- Debuff = false,
- DisplayName = 'Heal',
- BuffType = 'HIGHPRIESTHEALTH',
- Stacks = 'ALWAYS',
- Duration = 0,
- DamageFriendly = true,
- DamageSelf = true,
- Affects = {
- Health = {Add = 300},
- },
- }
- #################################################################################################################
- # Demigod Heal - This heal is used on demigods
- #################################################################################################################
- BuffBlueprint {
- Name = 'HighPriest01HeroHeal01',
- Debuff = false,
- DisplayName = 'Heal',
- BuffType = 'HIGHPRIESTHEALTH',
- Stacks = 'ALWAYS',
- Duration = 0,
- DamageFriendly = true,
- DamageSelf = true,
- Affects = {
- Health = {MaxHealthPercent = 0.10},
- },
- }
- #################################################################################################################
- # Demigod Heal w/ Sedna Healing Wind I - this heal is used on demigods when the priest is boosted by Sedna's
- # healing wind ability
- #################################################################################################################
- BuffBlueprint {
- Name = 'HighPriest01HeroHealHealingWindBuffl01',
- Debuff = false,
- DisplayName = 'Heal',
- BuffType = 'HIGHPRIESTHEALTH',
- Stacks = 'ALWAYS',
- Duration = 0,
- DamageFriendly = true,
- DamageSelf = true,
- Affects = {
- Health = {MaxHealthPercent = 0.15},
- },
- }
- #################################################################################################################
- # Cooldown Buff - This is applied on a healed target to prevent the target from being healed by a priest
- # for the duration of the buff
- #################################################################################################################
- BuffBlueprint {
- Name = 'HighPriest01HealCooldown01',
- Debuff = false,
- DisplayName = 'HealCooldown',
- BuffType = 'HIGHPRIESTHEALCOOLDOWN',
- Stacks = 'ALWAYS',
- Duration = 7.95,
- Affects = {},
- }
- ###############################################################
- # Ability - Heal
- # After healing someone, this spell applies a debuff to them
- # which prevents them from being healed. Debuff - "HighPriest01HealCooldown01"
- ###############################################################
- AbilityBlueprint {
- Name = 'HighPriest01Heal01',
- DisplayName = 'Heal',
- AbilityType = 'Aura',
- TargetAlliance = 'Ally',
- TargetCategory = 'MOBILE - UNTARGETABLE',
- AffectRadius = 10,
- AuraPulseTime = 5, # This is the "cooldown" of the ability to cast the heal spell
- OnAreaAbility = function(self, unit, params)
- local heal = false
- local priestBuff = 'HighPriest01Heal01'
- # ==== Try to heal a hero first ==== #
- # Hero units in range
- local heroes = EntityCategoryFilterDown(categories.HERO, params.Targets)
- #If we can heal a hero unit and we didn't heal him last, heal him.
- #If the hero is the only thing we can heal in the area, heal him.
- if table.getn(heroes) > 0 then
- for k, hero in heroes do
- # Unit has the cooldown buff
- if Buff.HasBuff(hero, 'HighPriest01HealCooldown01') then
- continue
- end
- # Do not heal heroes flagged not to be healed
- if hero.PriestsDoNotHeal then
- continue
- end
- # Do not heal heroes that are near full health
- local hpercent = hero:GetHealth() / hero:GetMaxHealth()
- if hpercent >= 1.0 then
- continue
- end
- heal = hero
- #Check to see if the priest is affected by Healing Wind II
- if Buff.HasBuff(unit, 'HSednaHealingWindPriest02') then
- priestBuff = 'HighPriest01HeroHealHealingWindBuffl01'
- else
- priestBuff = 'HighPriest01HeroHeal01'
- end
- break
- end
- end
- # ==== Heal other units ==== #
- # No heroes found; grab nearby units based on priorities and try to heal em
- if not heal then
- #Non-hero units that can be healed.
- for k, target in params.Targets do
- # Don't heal heroes in this body section
- if EntityCategoryContains( categories.HERO, target ) then
- continue
- end
- # Don't heal units with 50% or more health
- local hlthpct = target:GetHealth() / target:GetMaxHealth()
- if hlthpct >= 1.0 then
- continue
- end
- # Unit has the cooldown buff
- if Buff.HasBuff(target, 'HighPriest01HealCooldown01') then
- continue
- end
- heal = target
- # Priest is affected by Healing Wind II, use the more powerful heal.
- if Buff.HasBuff(unit, 'HSednaHealingWindPriest02') then
- priestBuff = 'HighPriest01HealHealingWindBuff01'
- end
- break
- end
- end
- # ==== Healing here ==== #
- # Hey we found someone to heal; apply both the heal and cooldown buffs and make pretty effects
- if heal then
- if unit.Character.IsMoving then
- unit.Character:PlayAction("HealMove")
- else
- unit.Character:PlayAction("Heal")
- end
- #LOG("*DEBUG: Healing: "..heal:GetUnitId().." with: "..priestBuff)
- Buff.ApplyBuff(heal, priestBuff, unit)
- Buff.ApplyBuff(heal, 'HighPriest01HealCooldown01', unit)
- # Create Priest heal casting effects
- AttachCharacterEffectsAtBone( unit, 'priest', 'CastHeal01', -1 )
- # Create Heal effect on actor being healed
- AttachBuffEffectAtBone( heal, 'Heal01', 0, heal.Trash );
- return
- end
- end,
- }