- Joined
- Mar 23, 2008
- Messages
- 942
I tried doing a custom holy light, but it only deals damage o.o
Edit: Only to check, Holy Light heals living unit and deals half of the heal as damage to undead.
JASS:
function Trig_Heal_Conditions takes nothing returns boolean
if (GetSpellAbilityId() == 'A02E') then
return true
endif
return false
endfunction
function Trig_Heal_Actions takes nothing returns nothing
// (Level * 2) + (SkillLevel * 40) + (Int / 2)
if ( IsUnitType(GetSpellTargetUnit(), UNIT_TYPE_UNDEAD) == true ) then
call UnitDamageTargetBJ( GetTriggerUnit(), GetSpellTargetUnit(), (-(I2R(GetUnitLevel(GetTriggerUnit())) * 2.00 ) + (I2R(GetUnitAbilityLevelSwapped('A02E', GetTriggerUnit())) * 40.00) + (I2R(GetHeroStatBJ(bj_HEROSTAT_INT, GetTriggerUnit(), true)) / 2.00)), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_DIVINE )
else
call UnitDamageTargetBJ( GetTriggerUnit(), GetSpellTargetUnit(), ((I2R(GetUnitLevel(GetTriggerUnit())) * 2.00 ) + (I2R(GetUnitAbilityLevelSwapped('A02E', GetTriggerUnit())) * 40.00) + (I2R(GetHeroStatBJ(bj_HEROSTAT_INT, GetTriggerUnit(), true)) / 2.00)/2), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_DIVINE )
endif
endfunction
//===========================================================================
function InitTrig_Heal takes nothing returns nothing
set gg_trg_Heal = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Heal, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Heal, Condition( function Trig_Heal_Conditions ) )
call TriggerAddAction( gg_trg_Heal, function Trig_Heal_Actions )
endfunction
Edit: Only to check, Holy Light heals living unit and deals half of the heal as damage to undead.


You still had those damn BJ functions in there... Get yourself JassCraft you can look them up, UnitDamageTargetBJ() just calls UnitDamageTarget(), so it's MUCH better to just do it yourself.
Don't forget to use variables...



