| 11-22-2003, 05:04 PM | #1 |
I hear there's a way to deal damage in JASS that gives someone exp/bounty for a kill by it. This would be very helpful for trigger-based spells; anyone know how it's done? |
| 11-22-2003, 05:14 PM | #2 |
Never heard of such a function... One way is to create a dummy unit that does the damage, that will let you get bounty and experience. |
| 11-22-2003, 06:29 PM | #3 |
There isn't. In my map I disabled normal experience gain and gave xp based on a unit's max life and max mana. |
| 11-22-2003, 06:34 PM | #4 |
Hmmm.. the only thing I can currently think of is the trigger action that adds experience to Hero characters. This only works for heros though, and doesn't give the hero the xp that's corresponding with the bounty of the target. |
| 11-22-2003, 08:12 PM | #5 |
In fact there isn't but you can easily create one, I have one in my map... ...let's say you have an unit with X hit points and you want to perform Y damage to it When X is greater than Y the function just substracts the damage from the life but in case X is less than or equal to Y then make the unit have 1 hit point, and kill it for the player you want to get experience / bounty. Of course now we have this problem how to kill an unit specifying the killing player? well just create a kind of mine with the ghost (visible) ability (owned by that player) at the unit's position and kill the mine. (just make sure the mine has an editted version of aoe damage upon dead) that has a really smalll area of effect) |
| 11-22-2003, 08:29 PM | #6 |
I think the simpliest way is to use associative arrays - one contains unit types, second contains expirience. It is very stupid way, but I can't guess anything better :) |
| 11-23-2003, 02:29 AM | #7 |
Thanks, Lord Vexorian; that helps :D Time for me to hijack my own topic: Is there a way to get a hero's level in a spell with JASS? I'm making a Reflection Shield based on Spell Shield, but reflected hero spells are the spell's level 1 counterparts. Any way to fix that would be handy. |
| 11-23-2003, 09:55 AM | #8 |
| 11-24-2003, 12:41 AM | #9 |
Oh, how I simply do not wish to record within variables/arrays every hero spell in a map... |
| 11-24-2003, 03:43 AM | #10 |
You don't have to YellowSubmarine. If you set each unit's Point Value equal to its level (or whatever exp amount you want it to give), you can make a function that incorporates the Unit's point value into giving experience. For Heroes you'd just use the integer Hero - Hero Level. (It's possible to make 2 separate functions here, one for units and one for Heroes, and mimic the normal WC3 exp. system). |
