• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] AoE Heal/Damage ability

Status
Not open for further replies.
Level 3
Joined
Jun 23, 2007
Messages
28
Hi

I'm kind of new to this with custom abilities so please take that into account. I've made a trigger that's supposed to 'select' all units within range then damage them if they're hostile to the player, and heal those who are allies. Anyhow, it looks like this:
Code:
Holy Judgement
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Holy Judgement 
    Actions
        Set HolyJudgementCaster = (Position of (Casting unit))
        Animation - Play (Casting unit)'s spell animation
        Special Effect - Create a special effect at HolyJudgementCaster using Abilities\Spells\Orc\HealingWave\HealingWaveTarget.mdl
        Special Effect - Create a special effect at (HolyJudgementCaster offset by (200.00, 0.00)) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
        Special Effect - Create a special effect at (HolyJudgementCaster offset by (100.00, -100.00)) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
        Special Effect - Create a special effect at (HolyJudgementCaster offset by (0.00, -200.00)) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
        Special Effect - Create a special effect at (HolyJudgementCaster offset by (-100.00, -100.00)) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
        Special Effect - Create a special effect at (HolyJudgementCaster offset by (-200.00, 0.00)) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
        Special Effect - Create a special effect at (HolyJudgementCaster offset by (-100.00, 100.00)) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
        Special Effect - Create a special effect at (HolyJudgementCaster offset by (0.00, 200.00)) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
        Special Effect - Create a special effect at (HolyJudgementCaster offset by (100.00, 100.00)) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
        Unit Group - Pick every unit in (Units within 500.00 of HolyJudgementCaster matching ((Owner of (Picked unit)) Equal to (Random player from (All enemies of (Owner of (Casting unit)))))) and do (Actions)
            Loop - Actions
                Wait 0.10 seconds
                Unit - Cause (Casting unit) to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Divine
                Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Undead\CarrionSwarm\CarrionSwarmDamage.mdl
        Unit Group - Remove all units from (Last created unit group)
        Unit Group - Pick every unit in (Units within 500.00 of HolyJudgementCaster matching ((Owner of (Picked unit)) Equal to (Random player from (All allies of (Owner of (Casting unit)))))) and do (Actions)
            Loop - Actions
                Wait 0.10 seconds
                Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 500.00)
                Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Human\Heal\HealTarget.mdl

It's most likely something wrong with 'Picked unit' or something similar, wasn't sure if I choose the right "selection method".

Thanks for taking a peak :grin:
 
Level 3
Joined
Jun 23, 2007
Messages
28
I've come to a conclusion, I think. I should be able to use:
Code:
Unit Group - Pick every unit in (Units within 500.00 of HolyJudgementCaster matching (((Owner of (Matching unit)) is an ally of (Owner of Caster)) Equal to False)) and do (Actions)
Now the 'nooby'question comes, how do I get the "is an ally of (Owned of Caster))" there? I've been looking for a long time now but can't find that part of the triggers :/.
 
Level 3
Joined
May 6, 2007
Messages
66
Code:
Unit Group - Pick every unit in (Units within 500.00 of HolyJudgementCaster matching (((Owner of (Matching unit)) is an ally of (((Owner of (Triggering Unit)) Equal to True)) and do (Actions)

Actions -> Unit Group -> Do Multiple Actions -> Units in Range Matching Condition -> Boolean Comparison -> Player Is An Ally of Player -> Owner of respective units.
 
Level 3
Joined
Jun 23, 2007
Messages
28
Thanks, I got it to work. Atleast what I asked about :)

Anyhow, encountered a new problem. I've read through lots of forum threads here and found many of them saying 'use a new custom ability that doesn't do anything' when using triggered custom abilitys. I made my own based on e.g the Blizzard spell, the spell works fine with the triggers and all but when I fire of the spell it shoots out some sort of fireball-look-alike spell to the target area before doing the triggered animations and such. (Btw, it's not exactly the same spell as above, but here's the code:)
Code:
Meteor
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Meteor Crash 
    Actions
        Set MeteorCaster = (Position of (Casting unit))
        Set MeteorTarget = (Target point of ability being cast)
        Special Effect - Create a special effect attached to the overhead of (Casting unit) using Abilities\Spells\Human\Flare\FlareCaster.mdl
        Wait 1.00 seconds
        Special Effect - Create a special effect at MeteorTarget using Abilities\Spells\Orc\AncestralSpirit\AncestralSpiritCaster.mdl
        Wait 0.15 seconds
        Special Effect - Create a special effect at MeteorTarget using Units\Demon\Infernal\InfernalBirth.mdl
        Wait 0.60 seconds
        Environment - Create a 0.50 second Temporary crater deformation at MeteorTarget with radius 400.00 and depth 20.00
        Special Effect - Create a special effect at MeteorTarget using Abilities\Spells\Other\Doom\DoomDeath.mdl
        Special Effect - Create a special effect at MeteorTarget using Abilities\Spells\Human\FlameStrike\FlameStrikeTarget.mdl
        Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
            Loop - Actions
                Camera - Shake the camera for (Picked player) with magnitude 5.00
        Set TempUnitGroup = (Units within 400.00 of MeteorTarget matching (((Owner of (Matching unit)) is an ally of (Owner of (Casting unit))) Equal to False))
        Unit Group - Pick every unit in TempUnitGroup and do (Actions)
            Loop - Actions
                Unit - Make (Picked unit) Explode on death
                Unit - Cause (Casting unit) to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Divine
                Unit - Make (Picked unit) Die normally on death
        Custom script:   call DestroyGroup(udg_TempUnitGroup)
        Special Effect - Destroy (Last created special effect)
        Wait 0.60 seconds
        Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
            Loop - Actions
                Camera - Reset camera for (Picked player) to standard game-view over 3.00 seconds
 
Level 3
Joined
Jun 23, 2007
Messages
28
I know that, it's just that I wanted them at specific places placed around the caster. Not at the enemies affected by the spell.
 
Status
Not open for further replies.
Top