I'm trying to make my trap MUI but I'm having problems how to create it. I've read some guides but I can't really clear it up how to make it.
It's a simple trap spell. you set a unit to the ground. check for nearby enemies and if they are near trap activates dealing aoe damage for 5 seconds.
Here is what I have so far. I'm using custom value system. Hashtables don't work in my Jass New gen.
This 2nd trigger is kinda half work. Whatever I try to think doesn't work. Should I try to check first for. Not even sure shall I use the periodic timers or have my trap have a slow invisible attack so I check for trap to attack. Got really confused so need help
It's a simple trap spell. you set a unit to the ground. check for nearby enemies and if they are near trap activates dealing aoe damage for 5 seconds.
Here is what I have so far. I'm using custom value system. Hashtables don't work in my Jass New gen.
Trigger:
- Trap
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Trap
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- TrapCustomValue Less than 1000
- Then - Actions
- Set TrapCustomValue = (TrapCustomValue + 1)
- Else - Actions
- Set TrapCustomValue = 1
- Set TrapCaster[TrapCustomValue] = (Triggering unit)
- Set TrapPos[TrapCustomValue] = (Target point of ability being cast)
- Unit - Create 1 HunterTrap for (Owner of TrapCaster[TrapCustomValue]) at TrapPos[TrapCustomValue] facing Default building facing degrees
- Animation - Change (Last created unit)'s animation speed to 0.00% of its original speed
- Unit - Set the custom value of (Last created unit) to TrapCustomValue
- Set Trap[TrapCustomValue] = (Last created unit)
- Set TrapMaxDuration[TrapCustomValue] = 3
- Set TrapStartDuration[TrapCustomValue] = 0
- Unit Group - Add (Last created unit) to TrapGroup
Trigger:
- Trap activate
- Events
- Time - Every 0.50 seconds of game time
- Conditions
- (Number of units in TrapGroup) Greater than 0
- Actions
- Set TrapDamageGroup[TrapTmpInteger] = (Units within 250.00 of TrapPos[TrapCustomValue])
- Unit Group - Pick every unit in TrapDamageGroup[TrapTmpInteger] and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Picked unit) belongs to an ally of Player 1 (Red)) Equal to False
- Then - Actions
- Unit - Cause TrapCaster[TrapTmpInteger] to damage circular area after 0.00 seconds of radius 250.00 at TrapPos[TrapCustomValue], dealing 20.00 damage of attack type Normal and damage type Normal
- Unit Group - Pick every unit in TrapGroup and do (Actions)
- Loop - Actions
- Set TrapTmpInteger = (Custom value of (Picked unit))
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- TrapStartDuration[TrapTmpInteger] Greater than or equal to TrapMaxDuration[TrapTmpInteger]
- Then - Actions
- Unit - Remove (Picked unit) from the game
- Else - Actions
- Set TrapStartDuration[TrapTmpInteger] = (TrapStartDuration[TrapTmpInteger] + 0.50)
- Else - Actions
This 2nd trigger is kinda half work. Whatever I try to think doesn't work. Should I try to check first for. Not even sure shall I use the periodic timers or have my trap have a slow invisible attack so I check for trap to attack. Got really confused so need help