| 08-13-2007, 10:48 PM | #1 |
Hi, I'm new here and I'm starting my first Map. I am attempting to create two abilities for a hero of mine. The first is supposed to damage the target based on the percent health that target is already at, so here is the code. It makes sense to me. Events Unit - A unit Begins casting an ability Conditions (Ability being cast) Equal to Heaven's Wrath (Archimonde) Actions Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (200.00 / (Percentage life of (Target unit of ability being cast))) damage of attack type Hero and damage type Normal The other ability is supposed to be an aoe heal that heals all allied units based on the amount of allied units in the area Events Unit - A unit Begins casting an ability Conditions (Ability being cast) Equal to Allied Perseverance Actions Unit Group - Pick every unit in (Units in (Playable map area) matching (((Player 1 (Red) controller) Equal to ((Owner of (Picked unit)) controller)) or (((Player 2 (Blue) controller) Equal to ((Owner of (Picked unit)) controller)) or ((Player 3 (Teal) controller) Equal to ((Owner of (Picked and do (Actions) Loop - Actions Unit Group - Add all units of (Units of type (Unit-type of (Picked unit))) to (Last created unit group) Set Units = ((Number of units in (Last created unit group)) x 10) Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (Real(Units))) Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Real(Units))) I'd like to thank anyone who takes the time to look at this because it is really bugging me ><" |
| 08-17-2007, 11:04 PM | #2 | ||
Quote:
Trigger: Your Spell
In Unit - Cause Damage, you have made TRIGGERING UNIT damage another unit, triggering unit will not work for abilities, use casting unit instead and, this will not stuff up your ability but don't use Unit - A unit Begins casting an ability, use Unit - A unit Starts the effect of an ability Quote:
Trigger: Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) x 10.00)Trigger: Unit - Set life of (Casting unit) to ((Life of (Casting unit)) x 10.00) |
| 08-17-2007, 11:59 PM | #3 |
Wait a minute. I thought "Picked Unit" was only for Unit Groups? Unless I have been mistaken this entire time. By the way, instead of the event "Unit - A unit Begins casting an ability", you should use the event "Unit - A unit Begins the effect of an ability" or something. I believe casting refers to what happens when the unit is going to cast a spell, not when the actual effects of the spell happens. |
| 08-18-2007, 12:07 AM | #4 |
woops typed the wrong thing in the last trigger code( a typo ) *fixed* |
| 08-19-2007, 12:30 PM | #6 |
Nenner is the only one who got it right. Triggering Unit > Casting Unit in every possible situation. Triggering Unit works through waits while Casting Unit and many other event responses don't. |
| 08-22-2007, 02:10 AM | #7 |
Thanks alot for the help, really appreciate it. So I'll check out that healing ability, but I was able to fix the percent damage ability. I was working based on the assumption that when it said percent life that it meant say 75% and took it as .75. So I had to divide the total by 100 to get the dmg to work the way i wanted. |
| 08-22-2007, 02:48 AM | #8 |
To tell you now, fetch a tutorial on GUI memory leaks, since your original trigger had some. Also, use trigger tags ([trigger][/ trigger] <-- no space) next time. And welcome to wc3campaigns! |
