HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Creating region in front of unit

07-30-2004, 06:31 PM#1
DisabledJew
Ok, I'm making an actual battle system, with slashes, thrusts, uppercuts, etc.

And I need to have it so when the player casts the ability Slash, it displays the animation slash, and subtracts *X* damage from all units in the region in front of him.

I got all the unit casts ability equal to slash, the animation, and the damage needed trigger, I just don't know how to make the region in front of the unit to make the damage to the unit, since it is a non-targeted ability.

I also need one to make a trigger for all the units around the unit, and if possible knocks them back a space or something.

I'm not sure the needed size of the regions cause I am not good with the units of length and stuff The WE uses. So make it sensible, like the normal length of a sword, so you don't have to be right next to him, but you can't be really far away.

thanks, Rep point to anyone who helps.
07-30-2004, 07:06 PM#2
mefist
Hmm, It would be easyer If you would target a unit. Otherwize try this:

Unit Group - Pick every unit in (Units within 50.00 of ((Position of (Casting unit)) offset by 80.00 towards (Facing of (Casting unit)) degrees)) and do (Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 1.00))

Im not sure it will work but ... also I think you need to adjust the proper range.
07-30-2004, 07:07 PM#3
mefist
And knock back thing is possible only on JASS
07-30-2004, 07:26 PM#4
DisabledJew
Well, I was thinking of doing just a targetted spell, I think I'll take a poll on it, thanks for help though. I don't know the offsets and stuff, they just confuse me.

For the spin attack would I just take off the offset by 80 thing?

Thanks, I gave the rep point already, if you could answer which you prefer in a RPG campaign, where you fight monsters by using different types of attacks which can goto combos and answer my last question, it would be helpful.

Thanks!
07-30-2004, 07:55 PM#5
mefist
For the spin attack its better to use the Bladestorm spell (if thats what you mean)

Sorry, cant help you on your last question. I saw it done it the Return of The Dragon campaign. You can see how its done there.

P.S. I prefer the targetted spell. =)
07-30-2004, 07:56 PM#6
Milkman
The only way to get the way the unit is facing and pick the unit around is to use the way mefist described. However, if you use the system he desribed you wont get any exp or bounty. So you'll have to do some kind of comparison to check it. Example:
Variables: SpellDmg = 150 (integer)
If SpellDmg greater then picked units current life then
create 1 CasterKiller for triggering player
order Caster Killer to attack picked unit
Caster Killer is a unit with enormous damage, which will kill the unit instantly, it has to have the Locust (Aloc) ability and preferably some dummy model which is nothing.
07-30-2004, 08:02 PM#7
DisabledJew
Could I not just use a trigger saying, a unit equal to zombie1 dies. Add 200 exp to *X* hero, and add 200 gold

Wouldn't that work, since the map is single player?
07-30-2004, 08:02 PM#8
mefist
Yup, forgot about that.
Istead of a dummy model you can just set the vertex color (or something like that) of the unit to 0 to make it comepletely transperant.
07-30-2004, 08:04 PM#9
Milkman
Wouldn't it be an enormous pain? For all units/unit-types?
Still, it will work.

EDIT: You would have to add some conditions, like killing player and such.
07-30-2004, 08:05 PM#10
mefist
I mean only for the Killer unit
07-30-2004, 08:13 PM#11
DisabledJew
Not really that much of a pain, just copy and paste, change unit type and unit exp and gold given, maybe take a little time, but I have plenty.

Ok, I have another question, I want it to show the damage of the ability used when it attacks if possible. Now I am going to be using 2 damage modifier abilities. The Units Strength (Determined by level and items) and the units weapon.

How would I make it show the damage done to the unit hit. (I think it has something to do with critical strike but I have no idea.)
07-31-2004, 01:03 AM#12
Milkman
If you were to do the whole damage and spell thing via triggers, you could do something like this:
Events: Slash is Cast
Conditions:
Actions:
set SlashModifier = Hero - Hero Attribute, Strenght
if Slash level equal to 1 then
set SlashDamage = 200+Slashmodifier*2
elseif Slash level equal to 2 then
set SlashDamage = 300+Slashmodifier*2
elseif Slash level equal to 3 then
set SlashDamage = 400+Slashmodifier*2
endif

Then you can do the damage via triggers, which can be quite hard. However, Lord Vexorians Caster Sytem provides a handy solution to this, It's available at the Download section. Look for the function DamageUnit. I don't want to paste it here since it feels like stealing his work if you know what i mean, also it calls a bunch of other functions and i don't wanna paste away like mad. If you don't understand the JASS code in the system, ask away.
07-31-2004, 05:58 PM#13
DisabledJew
Bah, I did mefist's trigger, and it works, it's just that it damages the casting unit to.... Any suggestions?
07-31-2004, 06:15 PM#14
mefist
Quote:
Unit Group - Pick every unit in (Units within 50.00 of ((Position of (Casting unit)) offset by 80.00 towards (Facing of (Casting unit)) degrees)) and do (Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 1.00))
Replace 50 with 81.
07-31-2004, 06:43 PM#15
DisabledJew
Didn't work, you mean the 50 as for the range within unit, I put at it 81, and it still damages my unit and I couldn't even damage the unit I was trying to hit even right next to him, so I set it back to 200, it still damages my unit but at least it will damage the other unit heh, 200 is about right range where you can't be too far away but you don't have to be humping the guy.