• 🏆 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!

How can I add upgrade abilities after an event?

Status
Not open for further replies.
Level 8
Joined
Dec 9, 2005
Messages
523
For instance, I want my townhall to be able to upgrade Masonry or whatever after I defeat a type of unit on the map. The upgrade shouldn't be available or even visible on the townhall until the unit is defeated, sort of like adding new items to marketplaces, but with ability.

I could think of a few complicated ways of doing this, but Im wondering if there are easier ways.

Thanks.
 
You can't make it look like researching it though (I speak of that training bar on the building), so, either go for the semi-visible one, which is unavailable until the upgrade runs or use an ability, which will make you face the problem in the parenthesis above.
  • Trigger
  • Events
    • Unit - A unit dies
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to X
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every units in (Units in (Playable Map Area) matching (((Matching unit) is a Town hall) Equal to True) and ((Owner of (Triggering unit)) Equal to (Owner of (Killing unit))) and do (Actions)
      • Loop - Actions
        • Unit - Add Masonry (fake upgrade) to (Picked unit)
So, Masonry is the fake upgrade, turned into an ability.
  • Tr
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Masonry
  • Actions
  • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every units in (Units in (Playable Map Area) matching (((Matching unit) is a Town hall) Equal to True) and ((Owner of (Triggering unit)) Equal to (Owner of (Killing unit))) and do (Actions)
      • Loop - Actions
        • Unit - Remove Masonry (fake upgrade) from (Picked unit)
    • Player - Set the current research level of Masonry (Upgrade) to 1 for (Owner of (Triggering unit))
 
Status
Not open for further replies.
Top