HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Spell Damage Based on Stats

09-16-2006, 04:26 PM#1
DurotarLord
Ok so im making a map where all spell damage is based on the hero's attributes. I know how to do that using triggers and all but theres one problem, the trigger:

Damage Area:
Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 500.00 at (Center of (Playable map area)), dealing 100.00 damage of attack type Spells and damage type Normal

does the damage to both allies of the casting unit and enemies. i know theres a jass code to do that same thing only it has the option to not damage allies. can someone please post that here for me? thanks.
09-16-2006, 06:47 PM#2
Captain Griffen
Use a unit group and pick every unit you want to damage, then use the function to damage a specific unit.

Alternatively, you can use my custom ability damge system (in the demo maps section), which gives a lot more options.
09-17-2006, 02:04 AM#3
DurotarLord
thanks. i thought i tried taht unit group one once before and it didnt work though. bah must not have. thanks! +rep

Post 2:

Ok so anyways i tried it the way u said and right now im working on a very simple spell were the hero leaps through the enemy forces dealing damage to them as he goes to test and see if that works. Heres the code for it:
Slash
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Slash
Actions
Custom script: local group udg_tempgroup
Custom script: local unit udg_tempunit
Set tempunit = (Casting unit)
For each (Integer A) from 1 to (Integer((Distance between (Position of tempunit) and (Target point of ability being cast)))), do (Actions)
Loop - Actions
Unit Group - Pick every unit in (Units in (Region centered at ((Position of tempunit) offset by (Real((Integer A))) towards (Facing of tempunit) degrees) with size (50.00, 50.00)) matching ((Owner of (Matching unit)) Not equal to (Random player from (All allies of (Owner of tempunit))))) and do (Unit Group - Add (Picked unit) to tempgroup)
Custom script: call SetUnitAnimationByIndex(udg_tempunit, 6)
Unit Group - Pick every unit in tempgroup and do (Unit - Cause tempunit to damage (Picked unit), dealing ((100000000.00 + (4.00 x (Real((Level of Slash for tempunit))))) + (0.10 x (Real((Agility of tempunit (Include bonuses)))))) damage of attack type Spells and damage type Normal)
Unit - Move tempunit instantly to (Target point of ability being cast)

That doesnt work though (as u can see i set the damage to 100000000.00 to see if it does any at all). it moves the caster the way it should, but it doesnt deal the damage! why?

Edited by Blade.dk. Reason: Double posting is not allowed.
09-17-2006, 06:39 AM#4
Captain Griffen
The local global trick only works for one unit. You don't even need the local trick there, as you have no waits.

You leak locations and groups there.
09-17-2006, 12:35 PM#5
DurotarLord
oh ya i know. this was just a test trigger, the final ones will be much more clean and precise. hmm. so i cant use the local trick for a group eh? thanks.
09-17-2006, 01:54 PM#6
Captain Griffen
When I said unit, I mean variable.
09-17-2006, 05:05 PM#7
DurotarLord
ah lol ty
09-19-2006, 02:06 AM#8
DurotarLord
EDIT:
Ok i fiannly found a way to get this to work in GUI so thanks for the help guys!