- Joined
- Jul 18, 2010
- Messages
- 332
I'm actually just starting to learn vJass as of now and I wanted to convert some of the GUI triggers in my map that have lots of special effects and periodic events to make them run smoother and faster. My map is full of GUI triggers and I'm afraid I can't convert them all to Jass so I'm only concentrating on the ones that usually makes the map lag. This one is a projectile spell that damages any enemy unit that touches the projectile. This trigger ran most of the time. This always lags my map so if anyone can convert into vJass, I would be really happy.
-
projectile spell 2 Copy
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Crossflame Chaos Dummy
-
Actions
- Set projectileunit_Copy = (Triggering unit)
- Set projectilepoint_Copy = (Position of (Triggering unit))
- Set projectiletarget_Copy = (Target point of ability being cast)
- Set projectileangle_Copy = (Angle from projectilepoint_Copy to projectiletarget_Copy)
- Set projectiletime_Copy = 2.25
- Unit - Create 1 Crossfire Chaos for (Owner of (Triggering unit)) at projectilepoint_Copy facing (Facing of (Triggering unit)) degrees
- Unit Group - Add (Last created unit) to projectilegroup_Copy
- Unit - Add a 2.25 second Generic expiration timer to (Last created unit)
- Hashtable - Save projectiletime_Copy as 4 of (Key (Last created unit)) in projectilehashtable
- Hashtable - Save projectileangle_Copy as 5 of (Key (Last created unit)) in projectilehashtable
- Hashtable - Save Handle Ofprojectileunit_Copy as 6 of (Key (Last created unit)) in projectilehashtable
- Trigger - Turn on projectile spell Copy 2 <gen>
- Custom script: call RemoveLocation (udg_projectilepoint_Copy)
- Custom script: call RemoveLocation (udg_projectiletarget_Copy)
-
Events
-
projectile spell Copy 2 Copy
-
Events
- Time - Every 0.03 seconds of game time
- Conditions
-
Actions
-
Unit Group - Pick every unit in projectilegroup_Copy and do (Actions)
-
Loop - Actions
- Set projectiletime_Copy = (Load 4 of (Key (Picked unit)) from projectilehashtable)
- Set projectileangle_Copy = (Load 5 of (Key (Picked unit)) from projectilehashtable)
- Set projectileunit_Copy = (Load 6 of (Key (Picked unit)) in projectilehashtable)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Load 4 of (Key (Picked unit)) from projectilehashtable) Greater than 0.00
-
Then - Actions
- Set projectiletargetpoint_Copy_2 = (Position of (Picked unit))
- Set projectiletargetpoint_Copy_Copy = (projectiletargetpoint_Copy_2 offset by 50.00 towards projectileangle_Copy degrees)
- Unit - Move (Picked unit) instantly to projectiletargetpoint_Copy_Copy, facing (Facing of (Picked unit)) degrees
- Set projectiletargetgroup_Copy = (Units within 300.00 of projectiletargetpoint_Copy_Copy matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an ally of (Owner of (Picked unit))) Equal to False) and ((((
-
Unit Group - Pick every unit in projectiletargetgroup_Copy and do (Actions)
-
Loop - Actions
- Unit - Cause projectileunit_Copy to damage (Picked unit), dealing 4500.00 damage of attack type Chaos and damage type Normal
-
Loop - Actions
- Custom script: call DestroyGroup(udg_projectiletargetgroup_Copy)
- Custom script: call RemoveLocation (udg_projectiletargetpoint_Copy_2)
- Custom script: call RemoveLocation (udg_projectiletargetpoint_Copy_Copy)
- Hashtable - Save (projectiletime_Copy - 0.03) as 2 of (Key (Picked unit)) in projectilehashtable
-
Else - Actions
- Hashtable - Clear all child hashtables of child (Key (Picked unit)) in projectilehashtable
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Load 4 of (Key (Picked unit)) from projectilehashtable) Equal to 0.00
-
Then - Actions
- Animation - Reset (Picked unit)'s animation
- Unit Group - Remove (Picked unit) from projectilegroup_Copy
- Unit - Kill (Picked unit)
- Else - Actions
-
If - Conditions
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in projectilegroup_Copy) Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
-
Else - Actions
- Do nothing
-
If - Conditions
-
Unit Group - Pick every unit in projectilegroup_Copy and do (Actions)
-
Events
Last edited: