HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Aura Problems. Event?

02-16-2008, 02:49 PM#1
Death4ngel
My friend asked me this...

He wants to make an aura that will add % bonus damage with every unit in range of the aura. So example, 1 unit, 2% damage. 2 unit 4% damage and so on. However The only way to do such aura is by triggers.

And the problem is that I can't find a Event to do this.
The Unit within range event would require an existing unit to be placed, and no variable could be used.

There are a few solutions although, either by creating the unit in advance, or using a periodic timer.

However if there are many units using the same aura, then it wouldn't be feasible to use it.

And using a periodic timer would affect the game in terms of speed and memory.

Are there any ways to solving this problem?
And also what events could be used for Auras?

Thanks in advance.
02-17-2008, 11:57 AM#2
Vexorian
Quote:
However if there are many units using the same aura, then it wouldn't be feasible to use it.
Why?

Quote:
And using a periodic timer would affect the game in terms of speed and memory.
Even blizzard auras have a 1 second update interval, so you will be fine with a one second timer, memory depends on how badly you implement it.

Right now, I think that a timer + groupenum combo is the best way for auras, of course, you could do something crazy like range events with things attached to the trigger but it is proven that's slower and messier, so...
02-17-2008, 04:01 PM#3
Themerion
Quote:
And the problem is that I can't find a Event to do this.
The Unit within range event would require an existing unit to be placed, and no variable could be used.

You can always play around with Trigger - Add New Event (which will allow you to use variables with Gets Within Range)

Trigger:
Aura Apply
Collapse Events
Unit - A unit Learns a skill
Collapse Conditions
(Learned Hero Skill) Equal to Devotion Aura
Collapse Actions
Trigger - Add to Aura Trigger <gen> the event (Unit - A unit gets within 800.0 of (Learning Hero) )
02-18-2008, 04:54 AM#4
Pyrogasm
You'll need a periodic event (it really isn't that pricey) and a unit
group loop. You'll also need a dummy unit and a dummy ability based off of Inner Fire with each level of the spell corresponding to the bonus each unit should get for that number of units in the aura (so level 1 grants a 2% damge increase, level 2 a 4% increase, etc.) Then you'll need a trigger akin to this:
Trigger:
Collapse Events
Time - Every 0.30 seconds of game-time
Conditions
Collapse Actions
Custom script: set bj_wantDestroyGroup = true
Collapse Unit Group - Pick every unit in (Units in Playable Map Area matching ((Level of <Your Aura> for (Matching Unit)) greater than 0)) and do (Actions)
Collapse Loop - Actions
Set TempPoint = (Position of (Picked Unit))
Set TempGroup = (Units within <Your Radius> of TempPoint matching (<Your target-matching conditions here>))
Set NumInGroup = (Number of units in (TempGroup))
Set TempUnit = (No Unit)
Custom Script: loop
Custom script: set udg_TempUnit = FirstOfGroup(udg_TempGroup)
Custom script: exitwhen udg_TempUnit == null
----- Loop Actions -----
Unit - Create 1 <Your Dummy Unit> for (Owner of (Picked Unit))
Unit - Set level of <Your Dummy Ability> to NumInGroup
Unit - Order (Last created unit) to Human Priest - Inner Fire TempUnit
Unit - Add a 2.00 second expiration timer to (Last created unit)
Unit Group - Add TempUnit to AuraGroup
----- End Loop Actions -----
Unit Group - Remove TempUnit from TempGroup
Custom script: endloop
Collapse Unit Group - Pick every unit in (Units in Playable Map Area matching ((((Matching Unit) has buff <Your Inner Fire Buff>) equal to true)) and ((Matching Unit is in AuraGroup) equal to false)) and do (Actions)
Collapse Loop - Actions
Unit - Remove buff <Your Aura Buff> from (Picked Unit)
Unit Group - Remove all units from AuraGroup
Required Variables:
NameType
TempPointPoint
TempGroupUnit Group
NumInGroupInteger
TempUnitUnit