| 07-31-2004, 10:05 PM | #1 |
I need an ability that essentially works like Charm, you cast it and take control of an enemy units, however, I want that unit to be able to break free of Charm. I want the Charmed unit to have a percentage chance to return to its original player every 5 seconds until it does. I have attempted to use a trigger where it detects that Charm has stopped being cast, it picks a random integer between 1 and 100 and if its greater than 75 then it transfers control back to the original player. This does not work for a number of reasons, firstly even if you set it to 100% chance for some reason the unit will not revert back to its original player, I believe this has something to do with Charms animation time and the trigger acts a split second before the unit is charmed, secondly its not repeating, can anyone help me triiger this ability? |
| 07-31-2004, 10:10 PM | #2 |
I'd make two triggers; one that runs when Charm is cast ans another that runs every 5 seconds. For the first one, make it set the custom value of the charmed unit to the player number of the previous owner. For the 5 second one, make it pick every unit with a custom value that isn't equal to 0. Then, if a random number is between x and Y, change the owner of the unit to its previous owner, else do nothing. I hope this helps! |
| 07-31-2004, 11:17 PM | #3 |
Yes it worked perfectly, better than I had hoped, thank you for your help =) |
