| 07-08-2004, 12:41 AM | #1 |
It's supposed to be simple, but for some reason i can't get it to work. Unit - A unit Begins casting an ability Conditions (Ability being cast) Equal to Unholy Armor (invulnerable) Actions If ((Level of Unholy Armor (invulnerable) for (Casting unit)) Equal to 1) then do (Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) - 75.00)%) else do (Do nothing) If ((Level of Unholy Armor (invulnerable) for (Casting unit)) Equal to 2) then do (Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) - 70.00)%) else do (Do nothing) If ((Level of Unholy Armor (invulnerable) for (Casting unit)) Equal to 3) then do (Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) - 65.00)%) else do (Do nothing) Unit - Make (Target unit of ability being cast) Invulnerable Wait 25.00 seconds Unit - Make (Target unit of ability being cast) Vulnerable So the problem is that the ability is supposed to make a unit invulnerable for 25 seconds and take away a percentage of it's current life (Level 1 75%, Level 2 70%...etc) but it will make the target invulnerable permanantly instead. does (Target unit of ability being cast) reset or change or something during the 25 second wait? what should i add or change here? |
| 07-08-2004, 01:10 AM | #2 |
Use start the effect of an abillity instead if it does not work Try adding the Invulnerable(Neutral) abillity to it, then remove after the 25 seconds instead of making it vulnerable\invulnerable. |
| 07-08-2004, 01:21 AM | #3 |
You could set a variable, like unholyarmortarget as a unit variable then in the trigger use set variable (event) and set that variable as the target unit before it makes it invulnerable and then instead of using (target of ability being cast) use the variable you just created. Unit - A unit Begins casting an ability Conditions (Ability being cast) Equal to Unholy Armor (invulnerable) Actions If ((Level of Unholy Armor (invulnerable) for (Casting unit)) Equal to 1) then do (Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) - 75.00)%) else do (Do nothing) If ((Level of Unholy Armor (invulnerable) for (Casting unit)) Equal to 2) then do (Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) - 70.00)%) else do (Do nothing) If ((Level of Unholy Armor (invulnerable) for (Casting unit)) Equal to 3) then do (Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) - 65.00)%) else do (Do nothing) Set unholyarmortarget as (target unit of ability being cast) Unit - Make (unholyarmortarget) Invulnerable Wait 25.00 seconds Unit - Make (unholyarmortarget) Vulnerable -Miningjrk |
| 07-08-2004, 01:25 AM | #4 |
If your still having this problem, change the target unit of ability being cast to triggering unit, that is only if the spell is meant to be cast on yourself and not your team-mates. So everywhere it says (target unit of ability being cast), simply change that to (triggering unit) and see if that helps you any. |
| 07-08-2004, 01:39 AM | #5 |
Thanks guys. Good ideas. I think the add invulnerable ability is the best option. The ability is usable on friendly units. The variable thing is also a good option, but since the cool down is like 4 seconds seting the variable and everything might overlap... unless I added target of ability being cast +1 with an array... but then would that interfer with the detection? err.. probably not. the other problem was: Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) - 75.00)%) I know that doesn't work at all. I had originally had something like: Unit - Set life of (Target unit of ability being cast) to ((percentage Life of (Target unit of ability being cast)) - 75.00)%) but that didn't use the current life of the target and if the target didn't have 75% of the life to use it died (without a death animation i might add). I need it to use 75% of the target's exsisting life without killing it. |
| 07-08-2004, 01:56 AM | #6 |
You can use local variables, to do this, insert this custom scrypt line: local unit udg_(your variable name) Then set the variable like you do normaly. |
