• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Poisoned Enemies (Infection Bomb =o)

Status
Not open for further replies.
Level 6
Joined
Aug 22, 2005
Messages
113
So I have a problem.

I want to make an item, where, when used, the enemy gets poisoned by it. Easy, right? I want to make it so as soon as the enemy is infected, they will die within 70 seconds no matter how much health they have. Preferably with the health decreasing as it goes along.

I thought about LIFE TIMER, but that makes it so the enemy is ''invincible'' while the timer is active. Like, they wont take damage, their health bar is the timer.

Is there anyway to get this to work? (I already have CUSTOM VALUES of Units being used for another item, so sadly, I cannot use Custom Values)
 
Level 2
Joined
May 24, 2007
Messages
12
If you want it to decrease health until it dies, try this...

  • Poison Trigger
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Set life of PoisonedUnit to ((Life of PoisonedUnit) - ((Max life of PoisonedUnit) / ((Real(TimeRemainingOnPoison)) + 1.00)))
      • If ((Life of PoisonedUnit) Equal to 0.00) then do (Trigger - Turn off (This trigger)) else do (Do nothing)
      • Set TimeRemainingOnPoison = (TimeRemainingOnPoison - 1)
This would prevent the unit from surviving it even if it was healed as when the remaining time hits zero, it divides the max life by one, causing it to lose 100% of its max life. This could also kill it before the time is up, hence the if/then/else statement.

The trigger would be initially off (unless you want it to be able to affect multiple enemies, in which case you'd need to set a flag on the unit somehow, either by putting a buff on it or setting a property of it, and then you would need a condition added to it to detect if it's poisoned) and would only be turned on if the item is used.

  • Use Poisonous Item
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Poisonous Item
    • Actions
      • Set PoisonedUnit = (Target unit of ability being cast)
      • Trigger - Turn on Poison Trigger <gen>
 
Level 6
Joined
Aug 22, 2005
Messages
113
If you want it to decrease health until it dies, try this...

  • Poison Trigger
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Set life of PoisonedUnit to ((Life of PoisonedUnit) - ((Max life of PoisonedUnit) / ((Real(TimeRemainingOnPoison)) + 1.00)))
      • If ((Life of PoisonedUnit) Equal to 0.00) then do (Trigger - Turn off (This trigger)) else do (Do nothing)
      • Set TimeRemainingOnPoison = (TimeRemainingOnPoison - 1)
This would prevent the unit from surviving it even if it was healed as when the remaining time hits zero, it divides the max life by one, causing it to lose 100% of its max life. This could also kill it before the time is up, hence the if/then/else statement.

The trigger would be initially off (unless you want it to be able to affect multiple enemies, in which case you'd need to set a flag on the unit somehow, either by putting a buff on it or setting a property of it, and then you would need a condition added to it to detect if it's poisoned) and would only be turned on if the item is used.

  • Use Poisonous Item
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Poisonous Item
    • Actions
      • Set PoisonedUnit = (Target unit of ability being cast)
      • Trigger - Turn on Poison Trigger <gen>

It's not that easy. It's possible for even 20 units to be poisoned at once, and even then, if the enemy was damaged, the poison could possibly even heal them, if i used your code. Your doing exactly what LIFE TIMER does. which is not what i want
 
Level 24
Joined
Nov 9, 2006
Messages
2,561
Create an invisible dummy unit that has 1 damage and 1 sec.
Event: A unit aquires an item
Condition: Item-Type equal to ....
Action: create unit (dummy unit) for neutral hostile at position of triggering unit
order last created unit to attack triggering unit
add expiration to last created unit lasting 69 seconds
wait 70 seconds
kill item-manupulating unit

If u have revieve stuff and such then i would suggest that you make an extra condition for the killing of the triggering unit.
 
Level 2
Joined
May 24, 2007
Messages
12
It's not that easy. It's possible for even 20 units to be poisoned at once, and even then, if the enemy was damaged, the poison could possibly even heal them, if i used your code. Your doing exactly what LIFE TIMER does. which is not what i want

I fail to see how it would be healed by the poison if it is SUBTRACTING health, nor do I see how it would make the unit invulnerable. And seeing as how you do want it to hit multiple targets, I suppose PurpleRoot's advice is probably the most useful. Mine would work properly under the assumption that only one target could be affected at any given time.
 
Status
Not open for further replies.
Top