| 11-05-2003, 08:00 AM | #1 |
How do you make a spell such that when a hero casts it, the target unit dies. After the target dies, the targeted unit (which is dead) returns 50% of it's hit points to the casting unit. I've based it on StormBolt, clearing the issue which kills the targeted unit. But it seems I cannot be able to get the 50% life return to the hero. Thanks! |
| 11-05-2003, 08:47 AM | #2 |
Are we talking many types of units to kill or just one unit ? Cus if it's any type, then I can't help you . But if it's just one unit , then use the Event - Unit dies Condition - If triggering unit dies then do action else do nothing. Action - add (Number of HP) to unit The number of HP will be The original one /2 , Right ? EDIT : Oops Im sorry , I thought that you want it when Unit dies , not when a spell is cast |
| 11-05-2003, 09:38 AM | #3 |
If the enemy are undead then all you need is to edit deathpact and change the targets allowed to enemy, if not then you need to use triggers you need a 2 unit variable named ConsumeTarget and ConsumeCaster you also need a real variable named ConsumeReal E- Unit - A unit Is issued an order targeting an object C- (Issued order) Equal to (Order(thunderbolt)) A- Set ConsumeTarget = (Target unit of issued order) E- Unit - A unit Starts the effect of an ability C- (Ability being cast) Equal to Consume.......... A- Set ConsumeCaster = (Casting unit) A- Unit - Set life of ConsumeTarget to ((Life of ConsumeTarget) / 2.00) A- Set ConsumeReal = (Life of ConsumeTarget) A- Wait 0.50 seconds A- Unit - Set life of ConsumeCaster to ((Life of ConsumeCaster) + ConsumeReal) A- Unit - Kill ConsumeTarget If you still dont understand that.. I've made a demo illustrate how its done |
