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:

Code: c#
  1. local Buff = import('/lua/sim/buff.lua')
  2. #################################################################################################################
  3. # Non-Demigod Heal - This heal is used on non-demigods
  4. #################################################################################################################
  5. BuffBlueprint {
  6.     Name = 'HighPriest01Heal01',
  7.     Debuff = false,
  8.     DisplayName = 'Heal',
  9.     BuffType = 'HIGHPRIESTHEALTH',
  10.     Stacks = 'ALWAYS',
  11.     Duration = 0,
  12.     DamageFriendly = true,
  13.     DamageSelf = true,
  14.     Affects = {
  15.         Health = {Add = 200},
  16.     },
  17. }
  18. #################################################################################################################
  19. # Healing Improved by Sedna's Healing Wind I
  20. #################################################################################################################
  21. BuffBlueprint {
  22.     Name = 'HighPriest01HealHealingWindBuff01',
  23.     Debuff = false,
  24.     DisplayName = 'Heal',
  25.     BuffType = 'HIGHPRIESTHEALTH',
  26.     Stacks = 'ALWAYS',
  27.     Duration = 0,
  28.     DamageFriendly = true,
  29.     DamageSelf = true,
  30.     Affects = {
  31.         Health = {Add = 300},
  32.     },
  33. }
  34. #################################################################################################################
  35. # Demigod Heal - This heal is used on demigods
  36. #################################################################################################################
  37. BuffBlueprint {
  38.     Name = 'HighPriest01HeroHeal01',
  39.     Debuff = false,
  40.     DisplayName = 'Heal',
  41.     BuffType = 'HIGHPRIESTHEALTH',
  42.     Stacks = 'ALWAYS',
  43.     Duration = 0,
  44.     DamageFriendly = true,
  45.     DamageSelf = true,
  46.     Affects = {
  47.         Health = {MaxHealthPercent = 0.10},
  48.     },
  49. }
  50. #################################################################################################################
  51. # Demigod Heal w/ Sedna Healing Wind I - this heal is used on demigods when the priest is boosted by Sedna's
  52. # healing wind ability
  53. #################################################################################################################
  54. BuffBlueprint {
  55.     Name = 'HighPriest01HeroHealHealingWindBuffl01',
  56.     Debuff = false,
  57.     DisplayName = 'Heal',
  58.     BuffType = 'HIGHPRIESTHEALTH',
  59.     Stacks = 'ALWAYS',
  60.     Duration = 0,
  61.     DamageFriendly = true,
  62.     DamageSelf = true,
  63.     Affects = {
  64.         Health = {MaxHealthPercent = 0.15},
  65.     },
  66. }
  67. #################################################################################################################
  68. # Cooldown Buff - This is applied on a healed target to prevent the target from being healed by a priest
  69. # for the duration of the buff
  70. #################################################################################################################
  71. BuffBlueprint {
  72.     Name = 'HighPriest01HealCooldown01',
  73.     Debuff = false,
  74.     DisplayName = 'HealCooldown',
  75.     BuffType = 'HIGHPRIESTHEALCOOLDOWN',
  76.     Stacks = 'ALWAYS',
  77.     Duration = 7.95,
  78.     Affects = {},
  79. }
  80. ###############################################################
  81. # Ability - Heal
  82. # After healing someone, this spell applies a debuff to them
  83. # which prevents them from being healed. Debuff - "HighPriest01HealCooldown01"
  84. ###############################################################
  85. AbilityBlueprint {
  86.     Name = 'HighPriest01Heal01',
  87.     DisplayName = 'Heal',
  88.     AbilityType = 'Aura',
  89.     TargetAlliance = 'Ally',
  90.     TargetCategory = 'MOBILE - UNTARGETABLE',
  91.     AffectRadius = 10,
  92.     AuraPulseTime = 5,      # This is the "cooldown" of the ability to cast the heal spell
  93.     OnAreaAbility = function(self, unit, params)
  94.         local heal = false
  95.         local priestBuff = 'HighPriest01Heal01'
  96.         # ==== Try to heal a hero first ==== #
  97.         # Hero units in range
  98.         local heroes = EntityCategoryFilterDown(categories.HERO, params.Targets)
  99.         #If we can heal a hero unit and we didn't heal him last, heal him.
  100.         #If the hero is the only thing we can heal in the area, heal him.
  101.         if table.getn(heroes) > 0 then
  102.             for k, hero in heroes do
  103.                 # Unit has the cooldown buff
  104.                 if Buff.HasBuff(hero, 'HighPriest01HealCooldown01') then
  105.                     continue
  106.                 end
  107.                 # Do not heal heroes flagged not to be healed
  108.                 if hero.PriestsDoNotHeal then
  109.                     continue
  110.                 end
  111.                 # Do not heal heroes that are near full health
  112.                 local hpercent = hero:GetHealth() / hero:GetMaxHealth()
  113.                 if hpercent >= 1.0 then
  114.                     continue
  115.                 end
  116.                 heal = hero
  117.                 #Check to see if the priest is affected by Healing Wind II
  118.                 if Buff.HasBuff(unit, 'HSednaHealingWindPriest02') then
  119.                     priestBuff = 'HighPriest01HeroHealHealingWindBuffl01'
  120.                 else
  121.                     priestBuff = 'HighPriest01HeroHeal01'
  122.                 end
  123.                 break
  124.             end
  125.         end
  126.         # ==== Heal other units ==== #
  127.         # No heroes found; grab nearby units based on priorities and try to heal em
  128.         if not heal then
  129.             #Non-hero units that can be healed.
  130.             for k, target in params.Targets do
  131.                 # Don't heal heroes in this body section
  132.                 if EntityCategoryContains( categories.HERO, target ) then
  133.                     continue
  134.                 end
  135.                 # Don't heal units with 50% or more health
  136.                 local hlthpct = target:GetHealth() / target:GetMaxHealth()
  137.                 if hlthpct >= 1.0 then
  138.                     continue
  139.                 end
  140.                 # Unit has the cooldown buff
  141.                 if Buff.HasBuff(target, 'HighPriest01HealCooldown01') then
  142.                     continue
  143.                 end
  144.                 heal = target
  145.                 # Priest is affected by Healing Wind II, use the more powerful heal.
  146.                 if Buff.HasBuff(unit, 'HSednaHealingWindPriest02') then
  147.                     priestBuff = 'HighPriest01HealHealingWindBuff01'
  148.                 end
  149.                 break
  150.             end
  151.         end
  152.         # ==== Healing here ==== #
  153.         # Hey we found someone to heal; apply both the heal and cooldown buffs and make pretty effects
  154.         if heal then
  155.             if unit.Character.IsMoving then
  156.                 unit.Character:PlayAction("HealMove")
  157.             else
  158.                 unit.Character:PlayAction("Heal")
  159.             end
  160.             #LOG("*DEBUG: Healing: "..heal:GetUnitId().." with: "..priestBuff)
  161.             Buff.ApplyBuff(heal, priestBuff, unit)
  162.             Buff.ApplyBuff(heal, 'HighPriest01HealCooldown01', unit)
  163.             # Create Priest heal casting effects
  164.             AttachCharacterEffectsAtBone( unit, 'priest', 'CastHeal01', -1 )
  165.             # Create Heal effect on actor being healed
  166.             AttachBuffEffectAtBone( heal, 'Heal01', 0, heal.Trash );
  167.             return
  168.         end
  169.     end,
  170. }

 

 

4,777 views 9 replies
Reply #1 Top

NT

Reply #2 Top

after looking at this a bit more... it looks to me like there is no additional bonus for healing wind II... disagree modding follks?

Reply #3 Top

The 300 or 200 static heals are for when a monk heals another unit (typically itself but it will do other units too, like minotaurs that run into towers). 

 

  1. # Don't heal units with 50% or more health
  2.                 local hlthpct = target:GetHealth() / target:GetMaxHealth()
  3.                 if hlthpct >= 1.0 then
  4.                     continue
  5.                 end
End of quote

Your comment here is incorrectly. That simply prevents overhealing, not healing a unit that is only hurt a little. 

Reply #4 Top

I haven't added any comments to the code (if you are referring to #don't heal units with 50% or more health) - that's what's already baked in there by GPG. 


Ok  - so its like what i figured in reply 2 then.  There is no additional buff for healing wind 2... just healing wind 1, right?

Reply #5 Top

Short version:

Healing Wind 1 doesn't buff priests. Only Healing Wind 2 does.

Long version

First, here is the code for Healing Wind from Sedna's files.

Code: c++
  1. #################################################################################################################
  2. # Healing Wind I
  3. #################################################################################################################
  4. AbilityBlueprint {
  5.     Name = 'HSednaHealingWind01',
  6.     DisplayName = '<LOC ABILITY_Sedna_0030>Healing Wind I',
  7.     Description = '<LOC ABILITY_Sedna_0063>A soothing wind washes over nearby allies.\n\n+[GetRegenBuff] Health Per Second Aura.',
  8.     AbilityType = 'Aura',
  9.     AffectRadius = 15,
  10.     AuraPulseTime = 5,
  11.     TargetAlliance = 'Ally',
  12.     GetRegenBuff = function(self) return math.floor( Buffs[self.Name].Affects.Regen.Add ) end,
  13.     TargetCategory = 'MOBILE - UNTARGETABLE',
  14.     Buffs = {
  15.         BuffBlueprint {
  16.             Name = 'HSednaHealingWind01',
  17.             Debuff = false,
  18.             Duration = 5,
  19.             DisplayName = '<LOC ABILITY_Sedna_0031>Healing Wind',
  20.             Description = '<LOC ABILITY_Sedna_0032>Health Per Second increased.',
  21.             BuffType = 'HSEDNAHEALINGWIND',
  22.             Icon = '/DGSedna/NewSednaHealingWind01',
  23.             Stacks = 'REPLACE',
  24.             DamageSelf = true,
  25.             CanBeEvaded = false,
  26.             Affects = {
  27.                 Regen = {Add = 12},
  28.             },
  29.         },
  30.     },
  31.     CreateAbilityAmbients = function( self, unit, trash )
  32.         FxHealingWind01( unit, trash )
  33.     end,
  34. }
  35. #################################################################################################################
  36. # Healing Wind II
  37. #################################################################################################################
  38. AbilityBlueprint {
  39.     Name = 'HSednaHealingWind02',
  40.     DisplayName = '<LOC ABILITY_Sedna_0033>Healing Wind II',
  41.     Description = '<LOC ABILITY_Sedna_0072>A soothing wind washes over nearby allies and nearby priests have increased healing power.\n\n+[GetRegenBuff] Health Per Second Aura.',
  42.     AbilityType = 'Aura',
  43.     AffectRadius = 15,
  44.     AuraPulseTime = 5,
  45.     TargetAlliance = 'Ally',
  46.     GetRegenBuff = function(self) return math.floor( Buffs[self.Name].Affects.Regen.Add ) end,
  47.     TargetCategory = 'MOBILE - UNTARGETABLE',
  48.     Buffs = {
  49.         BuffBlueprint {
  50.             Name = 'HSednaHealingWind02',
  51.             Debuff = false,
  52.             Duration = 5,
  53.             DisplayName = '<LOC ABILITY_Sedna_0031>Healing Wind',
  54.             Description = '<LOC ABILITY_Sedna_0032>Health Per Second increased.',
  55.             BuffType = 'HSEDNAHEALINGWIND',
  56.             Icon = '/DGSedna/NewSednaHealingWind01',
  57.             Stacks = 'REPLACE',
  58.             DamageSelf = true,
  59.             CanBeEvaded = false,
  60.             Affects = {
  61.                 Regen = {Add = 24},
  62.             },
  63.         },
  64.         #While this is a dummy buff, the actual work is done in the priest script.
  65.         BuffBlueprint {
  66.             Name = 'HSednaHealingWindPriest02',
  67.             Debuff = false,
  68.             DisplayName = '<LOC ABILITY_Sedna_0031>Healing Wind',
  69.             Description = '<LOC ABILITY_Sedna_0035>Healing power increased.',
  70.             EntityCategory = 'PRIEST',
  71.             BuffType = 'HSEDNAPRIESTHEALBUFF',
  72.             Stacks = 'REPLACE',
  73.             Duration = 5,
  74.             Icon = '/DGSedna/NewSednaHealingWind01',
  75.             DoNotPulseIcon = true,
  76.             Affects = {
  77.                 Dummy = {Add = 0.1},
  78.             },
  79.         },
  80.     },
  81.     CreateAbilityAmbients = function( self, unit, trash )
  82.         FxHealingWind02( unit, trash )
  83.     end,
  84. }

The important part is that Healing Wind 1 has nothing about buffing priests. If you look at Healing Wind 2, you can see a buff that goes on units with the category PRIEST that are with 15 units of the Sedna. The buff is placed every 5 seconds and has a duration of 5 seconds. The buff by itself does nothing. However it works in conjunction with the Priest Heals.

Looking at the code pacov quoted check lines 131 and 165. These lines check for the presence of the Healing Wind Priest Buff (HSednaHealingWindPriest02: granted by Healing Wind 2). If it finds the buff on the priest, then the priest sets the healing buff to be used to the Enhanced healing version (HighPriest01HeroHealHealingWindBuffl01for Demigods or or HighPriest01HealHealingWindBuff01 for other units).

Any questions?

re:pacov can't access mod forum

What's up with that?

Reply #6 Top

re:pacov can't access mod forum

What's up with that?
End of quote

its just a from work thing... i go in through forums.impulsedriven.com... i can access the mod forums from home. 

 

will read your response soon - ty!

Reply #7 Top

just read your long version  -had more time than i thought atm. 

So, healing wind 1 does nothing to buff the priests?  So, line 21 in the code I listed should have a different label?

  1. #################################################################################################################
  2. # Healing Improved by Sedna's Healing Wind I
  3. #################################################################################################################

So that should read healing wind II?

 

The joys of decoding lua...

Reply #8 Top

Yeah.

I'm guessing the comment was from a previous version of the ability or was just typed wrong in the first place. There are a bunch of comment errors like this throughout the code.

Reply #9 Top

ok - thanks guys for chiming in and helping clear that up for me.