HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Swapping a unit and selecting it if its original was selected.

04-03-2006, 04:41 AM#1
Ares_WarBlade
So I was trying to make an ability for a boss in my RPG, and I was hoping I could use War Club, but that didn't work out so I had to make two identical units with different attacks. The problem is that when the monster is swapped if the previous monster was selected by a player, I have no idea how to detect if the monster was selected then to reselect it by the player/s whom have it detected.

Here's what my trigger looks like thusfar:

Trigger:
Collapse Events
Unit - A unit Is attacked
Collapse Conditions
(Unit-type of (Attacking unit)) Equal to Behemoth Turtle
((Unit-type of (Attacked unit)) Equal to Sheep) or (((Unit-type of Attacked unit)) Equal to Rabbit) or (((Unit-type of Attacked unit)) Equal to Pig)
Collapse Actions
Unit - Explode (Attacked unit)
Unit - Pause (Attacking unit)
Wait 1.00 seconds
Unit - Hide (Attacking unit)
Unit - (Create 1 Behemoth Turtle (Spitting) for (Owner of (Attacking unit)) facing (Facing of (Attacking unit)) degrees
Unit - Set life of (Last created unit) to (Life of (Attacking unit))
Unit - Remove (Attacking unit) from the game
04-03-2006, 04:49 AM#2
karukef
http://www.wc3campaigns.net/showthread.php?t=81742

Read about the ability called Chaos. It is a way of changing a unit into another unit without having to replace it and will not cause it to be deselected.
04-03-2006, 05:14 AM#3
Ares_WarBlade
Wow, that sure did the trick, I had skipped the Chaos part in that tutorial, now I know I shouldn't have! Thanks.