HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Best Dummy Spell For Periodic AoE DMG?

09-03-2009, 01:08 AM#1
thehellman
I'm looking for a spell like Permanent Immolation, except.. isn't Permanent immolation because it works on a very weird 'tick' system that I don't like.

Are there any alternatives?

Also, -unholy aura has a maximum of 10 so that's no good either.
09-03-2009, 01:22 AM#2
GetTriggerUnit-
Why don't you use triggers!

http://www.thehelper.net/forums/showthread.php?t=134744
09-03-2009, 01:45 AM#3
thehellman
I already have a custom periodic damage system in my map, what I'm asking is periodic area of effect damage.

I know I could do a timer loop, enum units in the area ever second and deal damage, but I was wondering if there was an alternative?
09-03-2009, 01:57 AM#4
GetTriggerUnit-
It's easy to do.

I TOLD HIM to do one. See last post.

You need a code now?

Not done don't have the time...

Collapse JASS:
library Hi requires TimerUtils

    struct Damage
         integer instances
         integer times
         timer timee
         unit damager
         real amount
         real radius
         real x
         real y
        
        static method DamageAreaTimed takes real X, real Y, real Radius, real Amount, unit Damager, integer Times, real wait returns nothing
            local thistype this = thistype.create()
            set this.instances = 0
            set this.damager = Damager
            set this.amount = Amount
            set this.radius = Radius
            set this.timee = NewTimer()
            set this.times = Times
            set this.x = X
            set this.y = Y
            call SetTimerData(this.timee, this)
            call TimerStart(this.timee, wait, true, function this.callback)
        endmethod

        method callback takes nothing returns nothing
            local thistype this = GetTimerData(GetExpiredTimer())
            local group g = CreateGroup()
            local unit u = null
            call GroupEnumUnitsInRange(g, this.radius, this.x, this.y, null)
            loop
                  set u = FirstOfGroup(g)
                  exitwhen u == null
                  call UnitDamageTarget(this.damager, this.amount, ....)
                  call GroupRemoveUnit(g, u)
            endloop
            call DestroyGroup(g)
            set g = null
            // MORE stuff here...
        endmethod
    endstruct

endlibrary

09-03-2009, 02:47 AM#5
Zerzax
That's gonna leak. Don't pass a null argument to the enum filter, either use a BOOLEXPR_TRUE type thing (Vexorian has one in the code resources) or sort through your units within a boolexpr function and never admit them to the group. The best group usage would either be with a group recycling system (easy to implement by just reusing already created groups within your struct instances), an actual group system (there are a few on the site), or a global group that you never admit units to.
09-03-2009, 03:18 AM#6
fX_
try tornado damage aura
09-03-2009, 08:51 AM#7
TheWye
Disease cloud maybe?
09-03-2009, 01:15 PM#8
Vexorian
what tick system?
09-03-2009, 01:18 PM#9
Vulcano
immolation damages every second instead of having constant degeneration ...

I can have -55 degen with unholy aura when i shift-doubleclick
09-03-2009, 01:40 PM#10
TKF
Quote:
Originally Posted by Vulcano
immolation damages every second instead of having constant degeneration ...
I know you can toggle it's duration to be shorter than 1 second. Giving it 0.01 duration makes it apply 100 times pr second.
09-03-2009, 07:31 PM#11
Vulcano
oh, i didn't know that

I guess problem solved then , just set duration to 0.01
09-03-2009, 09:21 PM#12
GetTriggerUnit-
Mine wasn't done, sorry

I had to go sleep.

I'd use TimerUtils. (PURPLE, PURPLE SIMPLY OWNS.)
09-03-2009, 10:05 PM#13
Vexorian
Using timerutils (any of them) for something like damage over time is a very bad solution.

Short intervals are not the job for TimerUtils, other things do better there.

Also, if permanent immolation does all you want, there is no reason to do something more complicated.
09-03-2009, 10:16 PM#14
GetTriggerUnit-
You'd prefer that I use TriggerSleepAction and a loop?
I hope no.

What then?
09-03-2009, 10:25 PM#15
Alevice
normal timers?