• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Spell] Armor for a few seconds

Status
Not open for further replies.
Level 6
Joined
Sep 19, 2006
Messages
191
  • Poison Protection
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
      • (Level of Poison Protection for (Summoning unit)) Greater than 0
      • (Unit-type of (Summoning unit)) Equal to Poison Elemental
    • Actions
      • Unit - Add Armor Increase to (Summoning unit)
      • Wait 5.00 seconds
      • Unit - Remove Armor Increase from (Summoning unit)
I'm sure: (Level of Poison Protection for (Summoning unit)) Greater than 0 is pointless.
The idea is I want to give 5 armor for my poison elemental for 5 seconds every time 10 seconds have passed. Any help here?
 
When the Poison Elemental is spawned, store it in a variable as Chaosium says.

  • spawn
    • Events
      • A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to <your ability>
    • Actions
      • Set poisonelemental = (Summoned unit)
If there are multiple Poison Elementals, use a repeating timer that expires every 5 seconds and an integer for your armor trigger.

  • armor
    • Events
      • Time - poisontimer expires
    • Conditions
    • Actions
      • Set poisoncount = (poisoncount + 1)
      • Set poisongroup = (Units of type Poison Elemental)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ---------- after 5 seconds have passed ----------
          • poisoncount Equal to 1
        • Then - Actions
          • Unit Group - Pick every unit in poisongroup and do (Actions)
            • Actions
              • Unit - Add Armor Increase to (Picked unit)
        • Else - Actions
          • ---------- after 10 seconds have passed ----------
          • Set poisoncount = 0
          • Unit Group - Pick every unit in poisongroup and do (Actions)
            • Actions
              • Unit - Remove Armor Increase from (Picked unit)
 
I'll have to figure a way to use this code, since the tower summons it via an edited version of Parasite.
 
I'll have to figure a way to use this code, since the tower summons it via an edited version of Parasite.
Afaik units summoned by parasite still fire the "a unit is summoned" event, the summoned & summoning unit event responses also work as they should.
Well you could use sth like this:
  • Events
    • Unit - Unit enters (Playable Map Area)
  • Conditions
    • (Unit-type of (Entering unit)) Equal to Poison Elemental
  • Actions
    • Set poisonelemental = (Entering unit)
Dunno if that work though. :p (Unit Event is recommended here 'coz it also detect thingies like this)
It's better to use the "a unit is summoned" "a unit spawns a summoned unit" event since this will also allow you to see which unit was the source/cast parasite in this case.

  • Untitled Trigger 001
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • (Unit-type of (Summoned unit)) Equal to Poison Elemental
    • Actions
      • Set summonerVar = (Summoning unit)
      • Set summonedVar = (Summoned unit)
 
Last edited:
If the elementals are spawned through Parasite, the second trigger I provided should work if that is what you want, since it does not need any ability to trigger and works on a time basis.
 
Status
Not open for further replies.
Back
Top