NightShade
Ultra Cool Member
- Reaction score
- 31
I made a all trigger spell which, when one presses and holds the up arrow key, damage is accumulated (4 a second) and when one releases the up arrow ket the damage is dealt to the surrounding enemy units( of my hero ). however, my spell seems to do too much damage, for instance, if I hold down for 0.25 sec and then let go five times I can kill footmen, but I should only do five damage. what's wrong?
I'll post the more related triggers.
I'll post the more related triggers.
Trigger:
- test
- Events
- Player - Player 1 (Red) Presses the Up Arrow key
- Conditions
- Actions
- Trigger - Turn on counting <gen>
- Special Effect - Create a special effect attached to the chest of hero using Abilities\Weapons\ChimaeraAcidMissile\ChimaeraAcidMissile.mdl
- Set acid_effect = (Last created special effect)
- Events
JASS:
function Trig_counting_Actions takes nothing returns nothing
set udg_damage_amount = udg_damage_amount+1
call DisplayTextToForce( GetPlayersAll(), "damage amount = "+R2S(udg_damage_amount) )
endfunction
//===========================================================================
function InitTrig_counting takes nothing returns nothing
set gg_trg_counting = CreateTrigger( )
call DisableTrigger( gg_trg_counting )
call TriggerRegisterTimerEventPeriodic( gg_trg_counting, 0.25 )
call TriggerAddAction( gg_trg_counting, function Trig_counting_Actions )
endfunction
Trigger:
- test 2
- Events
- Player - Player 1 (Red) Releases the Up Arrow key
- Conditions
- Actions
- Trigger - Turn off counting <gen>
- Unit Group - Add all units of (Units within 512.00 of (Position of hero) matching (((Triggering unit) belongs to an enemy of Player 1 (Red)) Equal to True)) to damaged_units
- Unit Group - Remove hero from damaged_units
- Unit Group - Pick every unit in damaged_units and do (Unit - Set life of (Picked unit) to ((Percentage life of (Picked unit)) - damage_amount))
- Special Effect - Destroy acid_effect
- Set damage_amount = 0.00
- Events