| 07-13-2007, 07:24 PM | #1 |
Okay... Is there a way to DAMAGE a sleeping unit (Where the damage can kill the unit and give credit/exp to the caster) without waking it up? |
| 07-13-2007, 07:30 PM | #2 |
Trigger: Unit - Cause YourUnit to damage YourSleepingUnit dealing 100.00 damage of attack type Chaos and damage type UniversalIf you can figure out how to imitate sleep, as I posted a thread about earlier, it would easily be possible. |
| 07-13-2007, 07:40 PM | #3 |
I realize this isn't quite damage, but consider the following: JASS:if TheDamageAmount >= SleepingUnitsCurrentLife then //Deal damage directly to the target for kill credit call UnitDamageTarget(SourceUnit, SleepingUnit, TheDamageAmount, false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, null) else //Reduce their life instead of damage to not break sleep call SetUnitState(SleepingUnit, UNIT_STATE_LIFE, SleepingUnitsCurrentLife - TheDamageAmount) endif That could just as easily be done in GUI, and should work perfectly for your purposes. |
| 07-13-2007, 07:42 PM | #4 | |
sleep is actually order. monitor every order units recieve, it have only ID. damage and then order unit to sleep. i wont "wake up" Quote:
soo only normal-divine damage can be passed to function. |
| 07-13-2007, 07:46 PM | #5 |
Order a unit to cast the Necromancer spell, Unholy Frenzy, with no attack speed bonus. The unit will "lose" life every second, and it won't wake up. |
| 07-13-2007, 07:48 PM | #6 | |
Quote:
Though I imagine your method might work better. |
| 07-13-2007, 10:49 PM | #7 |
better or not, damage can be resisted its fact. |
| 07-13-2007, 10:51 PM | #8 |
Is there a way to make that if/then/else mui in gui? |
| 07-14-2007, 12:15 AM | #9 |
Rather simply, it is MUI already. Trigger: Set SleepingDamage = 120.00
![]() ----- Or whatever you want it to be set to, this is the amount of damage -----
![]() Set CurrentLife = (Current life of (TheUnitYouWantToDamage)
|
| 07-14-2007, 03:08 AM | #10 |
I'm confused... the tutorial in the GUI section says not to use if/then/else w/ array variables... Edit ~ Two more things... - The damage changes per level (15/20/25)... I suppose this makes it a little more complicated than the static damage that Pyrogasm uses. - I'll have to use a periodic timer for the damage? |
| 07-14-2007, 07:04 AM | #11 |
What tutorial? That makes absolutely no sense. If you want the damage to differ, simply change the damage amount: Trigger: Set SleepDamage = (10.00 + (5.00 x (Real(Level of (THEABILITY) for (Triggering Unit))))) |
| 07-14-2007, 07:32 AM | #12 |
This tutorial... 1. Your way of damaging only occurs once... I already asked if I'm going to need a periodic timer or something for that... Any responses at least? 2. Your variables seem rather pointless... Couldn't I just do the calculations w/o them? (SleepingDamage & CurrentLife). 3. This is going to be MUI with arrays, so if I have to use a periodic timer how will I pull up the which unit belongs to which for the correct damage? (Assuming the players will not all stay on the same level of the ability.) |
| 07-14-2007, 07:47 AM | #13 | |
Quote:
Yes, you could do it without the variables; they're just useful when you're explaining something to somebody and don't want to type "TheDamageYouWantToDeal" a billion times. Where have you said that you needed to do this periodically? And you won't need to use arrays for this, as the actions have no waits in them. Can you please explain why you need this to happen periodically? |
| 07-14-2007, 06:26 PM | #14 |
Problem solved... used the reduction method with a lot of if/then/else & actions. |
