• 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] Buff event/infect ability

Status
Not open for further replies.
Level 1
Joined
Apr 26, 2008
Messages
2
Hello, sorry if this kind of question has already been asked but I could not find it using the search function and reading through the forum became somewhat tedious after page 17.

I'm trying to make a creature that has an ability to 'infect' other creatures which after a certain amount of time will then kill the infected creature and then spawn something depending on the type of unit killed.

I started by editing the parasite ability to get what I wanted, but the creatures it spawns are always the same regardless of the type of unit killed. So I tried making a trigger that is triggered by a unit receiving the infection buff, which will then check the unit type of the infected unit and then spawn the type of unit I want. However not only am I unable to find a way to make a unit receiving a buff/infection start a trigger, but I can't seem to specify which player gets the spawned unit.

I had partial success with making a trigger based on when a unit was attacked and then checking if it had the buff, but that trigger won't work soley on the ability being used - the units still need to be attacked. And whichever player gets the first attack in gets to control the unit. This map is going to be a multiplayer map so I can't have problems like that.

Can you guys suggest some way I can either create a trigger started by a buff, or edit the ability to spawn multiple types of units.
 
Level 4
Joined
Mar 6, 2007
Messages
73
You could use an event like "every x seconds of the game" with condition "unit have specific buff" and put the unit into a unit group or something like that. For the spawn of units depending on types, use as event "a unit dies" with some "if-then-else" and condition "unit type comparaison" to "create unit" at the "location of dying unit" depending on his unit type.
Hope this help.
 
Level 9
Joined
Oct 17, 2007
Messages
547
There is a long way of doing that:

-Make a dummy skill that has all the descriptions that you want in the real skill, make sure it has the same types of targets and that it doesn't do anything.
-Also make a dummy unit with locust.
-For every unit type you want the skill to spawn, create a diff version of parasite and change the spawning unit type to it.(change cool down/mana to 0)
-Write a trigger that activate whenever the dummy skill is cast.
-The actions should have a bunch of conditionals If/Then/Else that look something like this:
  • If - Unit type of (Target of ability being cast) equal Footman
  • Then - Create - Dummy Unit at (Location of (Target of ability being Cast) facing Default Building facing degrees.
    • Add - Parasite(Footman) to (Last Created Unit)
    • Order - (Last Created Unit) Cast Parasite at (Target of ability being cast)
  • Else -
I'm doing this from memory so i the phrases are a variation of whats in the trigger editor. Make sure you create a Temp location before creating the dummy unit and remove it afterwards to prevent leaks. Add an expiration timer to the dummy unit. The "order" action at the end won't be there in the Trigger editor, look in the drop down list for the order that matches the original parasite spell.
 
Status
Not open for further replies.
Top