• 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.

Upgrade which replaces a unit ability

Status
Not open for further replies.
Level 9
Joined
Apr 22, 2020
Messages
430
I think you guys already know my problem based on the thread title. Let's say i want the "Heal" spell of my priest to be replaced as the "Abolish Magic" spell so i create a custom upgrade which replaces the priest heal into abolish magic available in the arcane sanctum. So how do i trigger this?
 
Level 13
Joined
Feb 5, 2018
Messages
567
  • Events - A unit finishes an upgrade
  • Conditions - Upgrade equal to your upgrade
  • Actions
  • Set tempgroup = Unitsownedbyplayer(ownerfounit(triggeringunit)) of type priest
  • Pick every unit in tempgroup
  • Remove ability heal
  • Unit add abilty abolishmagic
  • call DestroyGroup (udg_tempgroup)
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
Adding to what DoomBlade said, you'll also want another trigger for newly created Priests. So when a priest enters the map, check if the upgrade is researched, and remove heal/add abolish.

Events;
A unit enters map
Conditions:
Unit-type of triggering unit equal to Priest
Research level of Upgrade >= 1
Actions:
Remove heal from triggering unit
Add abolish magic to triggering unit
 
Level 9
Joined
Apr 22, 2020
Messages
430
fvE6HIS.jpg


3Ozf1WT.jpg

Is this trigger correct guys? I just made a quick picture on my phone thats explains why it is blurry, sorry guys.
 
Level 9
Joined
Apr 22, 2020
Messages
430
That looks good, but your condition is only checking for Player 1's level of the research. Is that intentional? You might want to change Player 1 to Triggering Player, and if that doesn't work use Owner of Triggering Unit. That way the trigger works properly for every single player, not just Player 1.

How To Post Your Trigger
Hehehe sorry for the bad photo. By the way i tested it and researched the Orb of Pain but the units that are already in the map still has curse and when i trained the banshee's again they have them. Looks like the trigger where it replaces the the existing units ability "Curse" seems like there is a problem. Any idea?
 
Level 24
Joined
Feb 27, 2019
Messages
833
What about having both spells on the unit at the start of the game. Then disable one of them. When the research is completed disable the second one and enable the first agian. Although it wouldnt get work for passives.
  • Map Initialization
  • Player - Disable Abolish Magic for (Players)
  • Research complete
  • Player - Disable Heal for (Triggering Player)
  • Player - Enable Abolish Magic for (Triggering Player)
 
Last edited:
Level 9
Joined
Apr 22, 2020
Messages
430
What about having both spells on the unit at the start of the game. Then disable one of them. When the research is completed disable the second one and enable the first agian. Although it wouldnt get rid of passives.
  • Map Initialization
  • Player - Disable Abolish Magic for (Players)
  • Research complete
  • Player - Disable Heal for (Triggering Player)
  • Player - Enable Abolish Magic for (Triggering Player)
The trigger they made is completely fine and works well, but the only problem is the units that existed before the upgrade is finished researching doesn't get the ability at all. It seems like i have done a slight error here.
 
Level 9
Joined
Apr 22, 2020
Messages
430
You are using Triggering unit when picking units in unit group. Use Picked unit instead.
Oh wow i just thought the same thing like why is this triggering unit when it is picking unit in a group so it should be picked unit. So i changed it to picked unit and it works now the existing units now have the ability. The answer was so simple yet hard to figure out LOL!
 
Status
Not open for further replies.
Top