Jump to content
EleTD.com
Sign in to follow this  
Twilice

Unit - Damage Area

Recommended Posts

The triggered immolation is based on

Unit - Damage area

right? But how do you make it to only target enemies?

Share this post


Link to post

Think I don't need help with the post above anymore.

But how do I make my dummy caster cast a certian spell?

I want a tower to cast a customesid flamestrike, but I can only get it to cast the originall.

Edit: Fixed the Flamestrike but not the one above, how did you do?

Share this post


Link to post
Guest Timberwolf
The triggered immolation is based on
Unit - Damage area

right? But how do you make it to only target enemies?

Don't the towers in ele TD have armor that makes them invincible?

If so, maybe they never did make it target only enemies. :wink:

Share this post


Link to post

You cannot make "damage area," target only enemies as far as I know (at least in GUI). What you need to do instead is damage units individually. This can be accomplished by first picking all units within X range of what you specify (e.g. target point of spell being cast) matching conditions you want (e.g. are an enemy). Then, you want to use the damage unit function to cause specified unit (e.g. caster) to damage picked unit. If you are familiar with eliminating memory leaks, then I'm sure you know how to do so by modifying the steps above. If you have questions, let me know and I will post code (I didn't now because my computer is not hooked up yet).

Share this post


Link to post

I will in a couple of days when I got free time (dads weekend)<< Will be edited.

Btw What was the art model you used to the hydro tower? I just want the model not the trigger.

Share this post


Link to post
Guest emjlr3

this is what I use

requires NewGen:

// Damage enemies in an area
globals
    private group dam_grp = CreateGroup()
endglobals
function FilterIsEnemy takes nothing returns boolean
    return IsUnitEnemy(GetFilterUnit(), bj_groupEnumOwningPlayer) and GetUnitState(GetFilterUnit(),UNIT_STATE_LIFE)>.405
endfunction
function DamageEnemiesArea takes unit damageUnit, real radius, real x, real y, real amount, attacktype attackType, damagetype damageType returns nothing
    local unit u
    
    set bj_groupEnumOwningPlayer = GetOwningPlayer(damageUnit)
    call GroupEnumUnitsInRange(dam_grp, x, y, radius, Condition(function FilterIsEnemy))
    loop
        set u = FirstOfGroup(dam_grp)
        exitwhen u == null
        call GroupRemoveUnit(dam_grp,u)
        call UnitDamageTarget(damageUnit,u,amount,false,false,attackType,damageType,null)
    endloop
endfunction

Share this post


Link to post
Sign in to follow this  

×
×
  • Create New...