Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Actions - Unit set life of picked unit to (life of picked unit + (Hero inteligence of casting unit x3/4/5))
Pick them and use this:
That will heal them.
Actions - Unit set life of picked unit to (life of picked unit + (Hero inteligence of casting unit x3/4/5))
Sorry if you think i said the same thing xD.Schruke but you left out that part.
constant function MassHeal_AbilityID takes nothing returns integer
// The rawcode of the ability being casted, probably just a dummy ability
return 'Ahea'
endfunction
constant function MassHeal_CasterFX takes nothing returns string
// The effect created on a casting unit
// NOTE: Effect strings MUST double slash:
// "Abilities\\Spells\\Human\\Heal\\HealTarget.mdl" = GOOD
// "Abilities\Spells\Human\Heal\HealTarget.mdl" = EDITOR WILL CRASH ON SAVE!
return "Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl"
endfunction
constant function MassHeal_EffectFX takes nothing returns string
// The effect created on a healed unit
// NOTE: Effect strings MUST double slash:
// "Abilities\\Spells\\Human\\Heal\\HealTarget.mdl" = GOOD
// "Abilities\Spells\Human\Heal\HealTarget.mdl" = EDITOR WILL CRASH ON SAVE!
return "Abilities\\Spells\\Undead\\VampiricAura\\VampiricAuraTarget.mdl"
endfunction
constant function MassHeal_Caster_Bonus takes nothing returns real
// The fraction of healing that the caster gets 0-1
// More than 1 means that the caster gets bonus heal
// Less than 1 means that the caster gets less healing than everyone else
return 2.0
endfunction
constant function MassHeal_HealAmount takes nothing returns integer
// The beginning amount healed irrelevant of intelligence
return 100
endfunction
constant function MassHeal_HealAmount_Increment takes nothing returns integer
// The amount healed gained per level
return 100
endfunction
constant function MassHeal_HealAmount_Intelligence takes nothing returns integer
// The beginning amount healed per point of intelligence
return 3
endfunction
constant function MassHeal_HealAmount_Intelligence_Increment takes nothing returns integer
// The amount healed gained per level
return 1
endfunction
constant function MassHeal_Radius takes nothing returns integer
// The beginning radius of effect
return 500
endfunction
constant function MassHeal_Radius_Increment takes nothing returns integer
// The radius of effect gained per level
return 0
endfunction
function Trig_Mass_Heal_Conditions takes nothing returns boolean
return (GetSpellAbilityId() == MassHeal_AbilityID())
endfunction
function Trig_Mass_Heal_Actions takes nothing returns nothing
// Get the caster
local unit caster = GetSpellAbilityUnit()
// Get the caster's intellegence
local integer intelligence = GetHeroInt(caster, true)
// The Ability being casted
local integer abil_id = GetSpellAbilityId()
// The Level of THAT ability
local integer abil_lvl = GetUnitAbilityLevel(caster, abil_id) - 1
// The player that owns the caster (for filtering friendly units)
local player player_caster = GetOwningPlayer(caster)
// Group var, contain ALL units possibly effected
local group unitgroup = CreateGroup()
// The current unit selected from the group
local unit iterator
// Caster's position in world co-ordinates
local real x = GetUnitX(caster)
local real y = GetUnitY(caster)
// The AoE of the spell
local real radius = MassHeal_Radius() + (MassHeal_Radius_Increment() * abil_lvl)
// Current HP of the iterator
local real life
// Maximum HP of the iterator
local real max_life
// Special Effect Variable
local effect sfx
// The maximum amount healed (broken up onto 3 lines for readability)
local real heal_amount = MassHeal_HealAmount_Intelligence()
set heal_amount = heal_amount + (MassHeal_HealAmount_Intelligence_Increment() * abil_lvl)
set heal_amount = heal_amount * intelligence
set heal_amount = heal_amount + MassHeal_HealAmount()
set heal_amount = heal_amount + (MassHeal_HealAmount_Increment() * abil_lvl)
// The actual healing part (caster only)
set life = GetUnitState(caster, UNIT_STATE_LIFE)
set max_life = GetUnitState(caster, UNIT_STATE_MAX_LIFE)
set life = life + (heal_amount * MassHeal_Caster_Bonus())
call SetUnitState(caster, UNIT_STATE_LIFE, life)
// Create SFX where the target is
set sfx = AddSpecialEffectTarget(MassHeal_CasterFX(), caster, "origin")
call DestroyEffect(sfx)
set sfx = null
call GroupEnumUnitsInRange(unitgroup, x,y, radius, null)
loop
set iterator = FirstOfGroup(unitgroup)
exitwhen (iterator == null)
if (IsUnitAlly(iterator, player_caster) and iterator != caster) then
// The actual healing part
set life = GetUnitState(iterator, UNIT_STATE_LIFE)
set max_life = GetUnitState(iterator, UNIT_STATE_MAX_LIFE)
if (life > 0 and life < max_life) then
set life = life + heal_amount
call SetUnitState(iterator, UNIT_STATE_LIFE, life)
// Create SFX where the target is
set sfx = AddSpecialEffectTarget(MassHeal_EffectFX(), iterator, "origin")
call DestroyEffect(sfx)
set sfx = null
endif
endif
call GroupRemoveUnit(unitgroup, iterator)
set iterator = null
endloop
// Var cleanup
call DestroyGroup(unitgroup)
set unitgroup = null
set player_caster = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Mass_Heal takes nothing returns nothing
set gg_trg_Mass_Heal = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Mass_Heal, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_Mass_Heal, Condition(function Trig_Mass_Heal_Conditions))
call TriggerAddAction(gg_trg_Mass_Heal, function Trig_Mass_Heal_Actions)
endfunction
If the skill has more than one level I HIGHLY suggest including the Level of Ability Being Cast to the formula, doing something like this: Set Life of Picked Unit to (Life of Picked Unit + (Intelligence of Casting Hero * 4 + (25 * Level of Ability Being Cast)
Mess with the formula how you see fit, but that should work. Most people have hero skills that level, so I thought I'd toss that in.
BTW, what trigger picks all units in range? I can't seem to locate that trigger on the GUI :\
Use a typical spell being cast trigger.
Unit group, units within X range of caster matching condition belongs to allied player.
Set Life = Current life + integer(hero int*4/6/8/whatever)
Events - Unit starts the effect of an ability
Conditions - Ability being cast equal to *ability*
Actions

- Set variable *Unit_group* = units in within *x* range of casting unit matching condition (matching unit owner equal to ally of owner of casting unit)

- Set variable *heal integer* = unit level of *ability* for casting unit x100

- Unit group - Pick every unit in *Unit_group* and do actions


- Unit - Unit set life of picked unit to (unit life of picked unit + ( *heal integer* x (hero inteligence of casting unit x *y*)))

- Custom script: call DestroyGroup(udg_*Unit_group*)
First off all, that is an double post, delete that and edit your previous post.
Now use this trigger:
*x* = 335 + (15 x (unit level of *ability* for casting unit x 15))
Events - Unit starts the effect of an ability
Conditions - Ability being cast equal to *ability*
Actions
- Set variable *Unit_group* = units in within *x* range of casting unit matching condition (matching unit owner equal to ally of owner of casting unit)
- Set variable *heal integer* = unit level of *ability* for casting unit x100
- Unit group - Pick every unit in *Unit_group* and do actions
- Unit - Unit set life of picked unit to (unit life of picked unit + ( *heal integer* x (hero inteligence of casting unit x *y*)))
- Custom script: call DestroyGroup(udg_*Unit_group*)
*y* = inteligence modifier
constant function MassHeal_Radius takes nothing returns integer
// The beginning radius of effect
return 400
endfunction
constant function MassHeal_Radius_Increment takes nothing returns integer
// The radius of effect gained per level
return 50
endfunction
