• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Teleport+AOE spell issues {teleport forward + damage}

Status
Not open for further replies.
Level 3
Joined
Feb 18, 2005
Messages
50
Hey yall!

So here's the deal, I'm trying to construct a skill called "Astral Assault." How it works is the hero teleports forward and does 300/450/600 dmg (dependent on level). I got that part to work, however I came accross an issue. The hero (and any allied units) also take damage from the trigger saying that he does that damage in an AOE. To solve this, I made the hero invulnerable during the damage and instantaneously vulnerable again so that no one would even be able to see the armor switch. That triggered a new problem: Now the cooldown doesn't get triggered on the spell, so he can just keep casting... ALSO the damage still gets dealt to any nearby allied units.

So now, what I need help with is a way to get the units of the controlling player and all his allies not to take damage from his aoe. Also, this map is similar to Rabbits versus Sheep, so the heroes of each team don't actually fight each other, they just compete for creep kills, so I might need a way for the other heroes from the opposing team not to take damage (to avoid people exploiting the skill to damage through the wall baracade).

Thanks in advance!
Mike
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I seriously hope you use variables for the unit groups, locations, ...
Not only will you need them, you have to clear the leaks ;)

Well, now I've made my point: just set the unit group to units in range of the casting unit, except the allies of the owner of the casting unit.

Well, it should be something like that... then it won't pick your allies, or your own units ;)
 
Level 3
Joined
Feb 18, 2005
Messages
50
I'm going to admit my complete and utter noobness at this.

so just create unit group and include any unit not allied within the range, then do damage to unit group? I'll see if I can manage not to screw that up.
 
Level 10
Joined
Sep 6, 2008
Messages
423
You set the unit group to units in range of the casting unit etc. (as ap0calypse said) then "Pick every unit in <your unit group> and do actions"
then you take the action "Unit - damage target" or what the name is and make the triggering unit deal damage to "Picked unit" :cute:
 
Level 3
Joined
Feb 18, 2005
Messages
50
awesome, thanks a lot guys.

And I can put an if statement in there to make sure its owned by a computer player, so that the trigger doesn't pick allies and such?
 
Level 16
Joined
Jul 21, 2008
Messages
1,121
Here you go:

  • AOE Damage
    • Events
    • Conditions
    • Actions
      • Set TempPoint = (Position of (YourCaster))
      • Set TempGroup = (Units within YourSpellAOE of TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Picked unit)) is an enemy of (Owner of (YourCaster))) Equal to True
            • Then - Actions
              • Unit - Cause (YourCaster) to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Normal
            • Else - Actions
      • Custom script: call DestroyGroup(udg_TempGroup)
 
Level 3
Joined
Feb 18, 2005
Messages
50
wow...

You make it seem so simple.

Thank you very much :D

{EDIT}
Thanks guys! That will solve my issue, as soon as I actually impliment it, I just don't know how to change my thread's thing from [unsolved] to [solved]
 
Last edited by a moderator:
Level 3
Joined
Feb 18, 2005
Messages
50
Wait I actually have a question, I was told to use variables, but I mean does it make a difference if I do:
  • Special Effect - Create a special effect attached to the chest of astral_cast[((Player number of (Owner of (Casting unit))) - 1)] using Abilities\Spells\Orc\AncestralSpirit\AncestralSpiritCaster.mdl
or
  • Special Effect - Create a special effect attached to the chest of (Casting unit) using Abilities\Spells\Orc\AncestralSpirit\AncestralSpiritCaster.mdl
They both address the same position, using variables just makes the trigger deeper than it needs to be.

EDIT: yes variables usually make this easier, but my map has a mirror match option... if I don't make it an array, isn't there an off chance if two people cast at the same time they will get teleported to the same spot?
 
Last edited:
Level 3
Joined
Feb 18, 2005
Messages
50
Yeah, um, that may have been the case with the first two triggers I posted, but I had to edit that >.< copied and pasted the wrong second trigger, can you take another look for me good sir? :D
 
Last edited:
Level 28
Joined
Jan 26, 2007
Messages
4,789
EDIT: yes variables usually make this easier, but my map has a mirror match option... if I don't make it an array, isn't there an off chance if two people cast at the same time they will get teleported to the same spot?

If you didn't put any timer or wait in the trigger, I would really lol when that happens.
The timing needs to be exactly the same, 0.01 sec difference and both units should teleport to the correct area.

Drowelf said:
Yeah, um, that may have been the case with the first two triggers I posted, but I had to edit that >.< copied and pasted the wrong second trigger, can you take another look for me good sir? :D
Umm, I need to look at... what exactly? :p
Tell me what you want to do ^^ (Child_0f_bodom already gave the correct trigger, right?)
 
Level 3
Joined
Feb 18, 2005
Messages
50
well, I am adding a special effect on the casting unit, I wanted to make sure I could just put the effect directly on (Casting Unit), or if I needed to use variables and such.
 
Status
Not open for further replies.
Top