Dirac
22710180
- Reaction score
- 147
Ok, this trigger was made so, when the hero is damaged it takes aditional damage from it based on an ability.
Also, when other ability is on (in this case Blood Ring) there is another action, the unit in the variable (BFtarget), takes damage...
The problem is in the event... Unit - Unit Takes Damage event only admits units that already are on the playable map area... so i modified the code on JASS, but is not working, idk why.
Also, when other ability is on (in this case Blood Ring) there is another action, the unit in the variable (BFtarget), takes damage...
The problem is in the event... Unit - Unit Takes Damage event only admits units that already are on the playable map area... so i modified the code on JASS, but is not working, idk why.
JASS:
function Trig_Takes_Damage_Func001C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped(039;A000039;, GetTriggerUnit()) >= 1 ) ) then
return false
endif
return true
endfunction
function Trig_Takes_Damage_Func002C takes nothing returns boolean
if ( not ( DistanceBetweenPoints(GetUnitLoc(udg_ShadowbloodMage), GetUnitLoc(udg_BRcircle)) <= 350.00 ) ) then
return false
endif
return true
endfunction
function Trig_Takes_Damage_Actions takes nothing returns nothing
if ( Trig_Takes_Damage_Func001C() ) then
call DisableTrigger( GetTriggeringTrigger() )
call UnitDamageTargetBJ( GetEventDamageSource(), GetTriggerUnit(), ( GetEventDamage() * ( 0.05 * I2R(GetUnitAbilityLevelSwapped(039;A000039;, GetTriggerUnit())) ) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call EnableTrigger( GetTriggeringTrigger() )
else
endif
if ( Trig_Takes_Damage_Func002C() ) then
call UnitDamageTargetBJ( udg_ShadowbloodMage, udg_BRtarget, ( GetEventDamage() * ( ( 0.20 * ( 1 + ( I2R(GetUnitAbilityLevelSwapped(039;A000039;, udg_ShadowbloodMage)) * 0.10 ) ) ) * I2R(GetUnitAbilityLevelSwapped(039;A00J039;, udg_ShadowbloodMage)) ) ), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL )
else
endif
endfunction
//===========================================================================
function InitTrig_Takes_Damage takes nothing returns nothing
set gg_trg_Takes_Damage = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Takes_Damage, udg_ShadowbloodMage, EVENT_UNIT_DAMAGED )
call TriggerAddAction( gg_trg_Takes_Damage, function Trig_Takes_Damage_Actions )
endfunction