HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Detectable Damaging Aura

11-18-2008, 10:45 AM#1
StockBreak
Hi,
is there an aura ability which can damage targets (for example Unholy Aura with negative values) and which can be used to detect damage done (when a unit is damaged by a negative Unholy Aura the "Unit - Takes Damage" doesn't fire)?

Thanks!
11-18-2008, 12:07 PM#2
Chocobo
permanent immolation


unholy aura is not "damaging" units
11-18-2008, 12:18 PM#3
DioD
tornado damage aura
11-18-2008, 12:53 PM#4
StockBreak
Quote:
Originally Posted by DioD
tornado damage aura
This could be a nice start but does Tornado Damage Aura leave a buff on the target units (I need yes, just like a normal aura)?
I can't test it right now cause I'm at university :P

@Chocobo
Probably you missed my question's point since I would like an aura which damages units (imagine an unholy aura with negative values).
11-18-2008, 01:11 PM#5
Chocobo
permanent immolation is aura-looking
it damages enemies in a range
it is periodic

unholy aura is an aura
it is not periodic


unholy aura with negative value = life regeneration reduction = lowers HP slowly (= not damaging)


immolation does not leave a buff
immolation does damage
immolation is periodic
immolation fires a damage event
immolation sfxs can be changed
immolation just needs reset every learning to apply the correct level or use a dummy ability
use a dummy ability to add aura

unholy aura does leave a buff
unholy aura does not damage but lower regeneration hp
unholy aura is not periodic
unholy aura does not fire a damage event
11-18-2008, 01:30 PM#6
StockBreak
Quote:
Originally Posted by Chocobo
permanent immolation is aura-looking
it damages enemies in a range
it is periodic

unholy aura is an aura
it is not periodic


unholy aura with negative value = life regeneration reduction = lowers HP slowly (= not damaging)


immolation does not leave a buff
immolation does damage
immolation is periodic
immolation fires a damage event
immolation sfxs can be changed
immolation just needs reset every learning to apply the correct level or use a dummy ability
use a dummy ability to add aura

unholy aura does leave a buff
unholy aura does not damage but lower regeneration hp
unholy aura is not periodic
unholy aura does not fire a damage event
I can actually work on it but Immolation doesn't leave a buff on enemies. Thanks!
11-18-2008, 04:42 PM#7
Anitarf
Can't you just check if the damaging unit has the immolation ability instead of checking for the immolation buff?

You could also just trigger the range detection instead of bothering with damage detection.
11-18-2008, 04:51 PM#8
DioD
Use ability pair

Tornado damage + unholy aura, this will give you both buff and damage event.
11-18-2008, 04:55 PM#9
StockBreak
Well, Building Damage Aura (Tornado) works but (there is a but ) it can't be set to work with percents instead of real values...

P.S. the only motivation why I am searching an aura that can actually damage enemies is that it will give bounty if it kill units.

Quote:
Originally Posted by DioD
Use ability pair

Tornado damage + unholy aura, this will give you both buff and damage event.
I posted while you were posting
Anyway this is what I am going to do!
The only left problem are percents...
11-18-2008, 05:07 PM#10
xombie
So you want it to damage a unit based on a percentage of his max life?

If so then you're probably going to have to trigger it one way or another, I don't think there is any ability that deals damage based on a percent of a unit's maximum life.

Your best bet for that is probably going to be a base aura that gives a buff to nearby enemy units. Then have a timer that runs every period (1 second?) and picks units in the designated radius and check to see whether or not they have the buff. If so, then damage them based on a certain percentage of their maximum life.
11-18-2008, 05:26 PM#11
StockBreak
Quote:
Originally Posted by xombie
So you want it to damage a unit based on a percentage of his max life?

If so then you're probably going to have to trigger it one way or another, I don't think there is any ability that deals damage based on a percent of a unit's maximum life.

Your best bet for that is probably going to be a base aura that gives a buff to nearby enemy units. Then have a timer that runs every period (1 second?) and picks units in the designated radius and check to see whether or not they have the buff. If so, then damage them based on a certain percentage of their maximum life.
Yes, probably I will use fixed damage over time to simplify things
Unholy Aura works with %s but it does not really "damage" units...
The Undying on Dota maps has an ability which damages nearby enemy units dealing damage based on units' life.
Does someone know if it triggered?

Thanks!
11-18-2008, 06:23 PM#12
Zerzax
It must be, I haven't seen any non-triggered spell like it. Xombie's method is best, and all the better if you can do it in JASS. If you want help with that, I'd be glad to guide you through it.
11-18-2008, 07:37 PM#13
DioD
StockBreak
Unholy aura do not damage in percentage, this is editor typo.
11-18-2008, 08:31 PM#14
xombie
If you want I can give you the code for it in vJass but you'd have to create the necessary abilities in the Object Editor.

Regardless of whether you wanted me to or not, I wrote up some vJass code on my mac (unable to test) so there may be a few kinks but I'll fix 'em up for you when they arise.

Oh, one more thing, re-name the scope (currently Ability) to whatever the trigger-file is called (usually its the ability name).

vJass Code

Collapse Code:
scope Ability initializer init

    //========================================
    // You will need to make ABIL_ID and 
    // BUFF_ID the rawcodes to your aura's
    // ability ID and the associated buff ID.
    // It may still have some bugs, so PM me
    // if there are any kinks.

    globals
        private constant integer     ABIL_ID        = 'A000'
        private constant integer     BUFF_ID        = 'B000'

        private constant real         DAMAGE_INTERVAL        = 1.0
        private constant real         AURA_RANGE        = 350.0
        private constant real        PERCENT_PER_LEVEL    = 0.02
    endglobals

    private struct Data
        unit hero        = null
        integer level

        private timer t        = CreateTimer()
        private trigger    onDeath    = CreateTrigger()
    
        method start takes nothing returns nothing
            call TimerStart(.t, DAMAGE_INTERVAL, true, function Data.Loop)
        endmethod

        method stop takes nothing returns nothing
            call PauseTimer(.t)
        endmethod

        static method Loop takes nothing returns nothing
            local Data data = 1

            local group gEnum = CreateGroup()
            local unit uEnum

            local real damage

            loop
                exitwhen data.t == GetExpiredTimer()
                set data = data + 1
            endloop
            
            call GroupEnumUnitsInRange(gEnum, GetUnitX(data.hero), GetUnitY(data.hero), AURA_RANGE, null)
            loop
                set uEnum = FirstOfGroup(gEnum)
                exitwhen uEnum == null
                if GetUnitAbilityLevel(uEnum, BUFF_ID) > 0.0 then
                    set damage = (data.level * PERCENT_PER_LEVEL) * GetUnitState(uEnum, UNIT_STATE_MAX_LIFE)
                    call UnitDamageTarget(data.hero, uEnum, damage, false, false, ATTACK_TYPE_SPELL, DAMAGE_TYPE_NORMAL, null)
                    call DestroyEffect(AddSpecialEffect(GetAbilityEffect(ABIL_ID, EFFECT_TYPE_SPECIAL, 0), uEnum, "origin"))
                endif
                call GroupRemoveUnit(gEnum, uEnum)
            endloop
            call DestroyGroup(gEnum)
            set gEnum = null
            set uEnum = null
        endmethod
            
        static method OnDeath takes nothing returns nothing
            local Data data = 1
            loop
                exitwhen data.onDeath == GetTriggeringTrigger()
                set data = data + 1
            endloop
            call data.stop()
        endmethod

        static method create takes unit hero, integer level returns Data
            local Data data = Data.allocate()
            set data.hero = hero
            set data.level = level

            call TriggerRegisterUnitEvent(data.onDeath, hero, EVENT_UNIT_DEATH)
            call TriggerAddAction(data.onDeath, function Data.OnDeath)

            call TimerStart(data.t, DAMAGE_INTERVAL, true, function Data.Loop)
            return data
        endmethod

        method onDestroy takes nothing returns nothing
            call PauseTimer(.t)
            call DestroyTimer(.t)
            set .hero = null    // So that the hero is recycled if the struct is destroyed.
        endmethod
    endstruct

    private function filter takes nothing returns nothing
        return GetSpellAbilityId()==ABIL_ID
    endfunction

    private function main takes nothing returns nothing
        local unit caster = GetTriggerUnit()
        local Data data    = 1

        loop
            exitwhen data.hero == null
            exitwhen data.hero == caster
            set data = data + 1
        endloop
        
        if data.hero == caster then
            call data.destroy()
        endif
        call data.create(caster, GetUnitAbilityLevel(caster, ABIL_ID))
        set caster = null
    endfunction

    private function check takes nothing returns boolean
        local Data data = 1
        loop
            exitwhen data.hero == GetTriggerUnit()
            exitwhen data.hero == null
            set data = data + 1
        endloop
        return data.hero == GetTriggerUnit()
    endfunction

    private function OnEnter takes nothing returns nothing
        local Data data = 1
        loop
            exitwhen data.hero == GetTriggerUnit()
            set data = data + 1
        endloop
        call data.start()
    endfunction

    private function init takes nothing returns nothing
        local trigger t = CreateTrigger()
        local integer i = 0

        local trigger onEnter = CreateTrigger()
        local region regMap = CreateRegion()

        loop
            exitwhen i == 12
            call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_HERO_LEARN, null)
            set i = i + 1
        endloop
        call TriggerAddCondition(t, Filter(function filter))
        call TriggerAddAction(t, function main)

        call RegionAddRect(regMap, GetWorldBounds())
        call TriggerRegisterEnterRegion(onEnter, regMap, null)
        call TriggerAddCondition(onEnter, Filter(function check))
        call TriggerAddAction(onEnter, function OnEnter)
    endfunction

endscope

11-18-2008, 10:17 PM#15
StockBreak
Thanks for your help guys!
Actually I know Jass quite well but I will make something like this:

Chilling Aura (Passive)
A chilling cold is surrounding the Banshee. Nearby enemy units will be slowed and will take damage based on how close to the Banshee they are.
Level 1 - 5% slow, 2 damage per second if units are far, 4 if they are close, 6 if they are really close to the Banshee.
Level 2 - 10% slow, 4 damage per second if units are far, 6 if they are close, 8 if they are really close to the Banshee.
Level 3 - 15% slow, 6 damage per second if units are far, 8 if they are close, 10 if they are really close to the Banshee.

Is it balanced for a normal pseudo-melee map?

Thanks!

See also this post for the hero that I am trying to make.