• 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.

How to make unit lose health when attack or every x seconds? + droping item upon death

Status
Not open for further replies.
Level 6
Joined
Aug 31, 2018
Messages
167
1. I want to make mechanical unit/building that lose health each second or lose health with every attack, both gonna be usefull (Btw the mechanical unit gonna be a structure with duration and gonna be summoned, not builded [because i don't know how to build it and cost mana instead of resources, gonna be usefull if someone tell me how to do it])


2. Also how can i make the unit/structure drop item upon death? Because it gonna be summoned/builded thats why i dont know how to make it drop an item, i tried to do it with a trigger but i can't find a way to trigger that unit/structure, because like i said it gonna be summoned/builded, which means that its not existing before i summon/build it.




P.S Preffering the easiest way to do it, because i am not that good with triggers, Thanks.
 
Level 9
Joined
Sep 20, 2015
Messages
385
For the summoning ability, you can use any ability that create a unit. Water elemental, Spirit wolves, Pocket factory...etc You have to create your unit in the Object editor firist, give it a name and set all the fields as you want. Then in the ability you just change the spawned unit to your custom unit.


You can try to use the Human building item as base ability, and see if you can add mana cost.

All the stuff you want can be done with triggers.

for the Health losing you can create a looping timer, and set the unit health to (current health - x) .

For the item spawn


EVENT
A unit dies
CONDITION
Unit type of dying unit equal to YOUR UNIT
ACTIONS
Create item at position of Triggering Unit
 
Level 6
Joined
Aug 31, 2018
Messages
167
For the summoning ability, you can use any ability that create a unit. Water elemental, Spirit wolves, Pocket factory...etc You have to create your unit in the Object editor firist, give it a name and set all the fields as you want. Then in the ability you just change the spawned unit to your custom unit.


You can try to use the Human building item as base ability, and see if you can add mana cost.

All the stuff you want can be done with triggers.

for the Health losing you can create a looping timer, and set the unit health to (current health - x) .

For the item spawn


EVENT
A unit dies
CONDITION
Unit type of dying unit equal to YOUR UNIT
ACTIONS
Create item at position of Triggering Unit
Thank you buddy, it worked perfectly ^_^
 
Status
Not open for further replies.
Top