| 07-11-2004, 03:14 PM | #1 |
We all know that when dealing damage for custom spells using the "Set life" function to deal damage, the player wouldn't get any bounty and xp if the unit is killed. The common way to overcome this is to detect if the spell kills the target unit, and if it does, create a dummy unit belonging to the player and have the dummy unit nuke the target unit for an incredible amount of damage, thus killing the target unit and earning bounty and xp for the player. I'm just wondering if there is any other way? I'm not a big fan of dummy units, and I try to minimize my spell's dependancy on them. Does anyone have another way to gain bounty and xp for a kill that is a result of a triggered spell? |
| 07-11-2004, 03:41 PM | #2 |
I know one way that only works though if you know the type of units that are to be killed. Just basically say if a unit of that type dies, add some number of gold to owner of triggering unit. Then if you are using WEU, you can use the simulate bounty option to make it look like there was a bounty going on. The best way to go about this is to ahead of time set up a integer array saying forexample: myArray(1) = 50 myArray(2) = 35 myArray(3) = 40 Customvalue of a unit: Rifleman = 1 Customvalue of unit: Footman = 2 Customvalue of unit: knight = 3 Set property of owner of triggering unit to add myArray(unit-type of triggering unit) amount of gold. I just thought of this and dont know if it works. |
