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

Units that transform losing "added" abilities? ie HH>Beserkers

Status
Not open for further replies.
Level 4
Joined
Jul 28, 2019
Messages
77
Player buys a unit. Unit goes into a storage area. Unit is given an ability so it can be sold. If player purchases a Troll Headhunter that has the beserker upgrade, it will be added to storage but will not have the "Sell This Unit" ability. What do?

  • New Unit
    • Events
      • Unit - A unit enters Unit Purchase Area <gen>
    • Conditions
      • ((Triggering unit) is in UNITG_playerDemoUnits_array[(Player number of (Owner of (Triggering unit)))]) Equal to False
      • ((Triggering unit) is A Hero) Equal to False
      • ((Triggering unit) is A structure) Equal to False
      • ((Triggering unit) is Summoned) Equal to False
    • Actions
      • Set TempInt = (Player number of (Owner of (Triggering unit)))
      • Set TempUnit = (Triggering unit)
      • Unit Group - Add TempUnit to UNITG_playerDemoUnits_array[TempInt]
      • Unit - Move TempUnit instantly to (Center of REGION_PlayerUnitStorage[TempInt]), facing Default building facing degrees
      • Unit - Add Sell This Unit to TempUnit
      • Game - Display to (All players) for 4.00 seconds the text: ((Name of TempUnit) + ( added to + ((Name of (Owner of TempUnit)) + ('s UNITG_playerunits. + (Name of (Random unit from UNITG_playerDemoUnits_array[TempInt]))))))
 
Level 4
Joined
Jul 28, 2019
Messages
77
I aint too good at JASS. I tried this, it complies, but doesn't work.
Code:
call UnitMakeAbilityPermanent(udg_TempUnit, true, 'ACro')
 
Level 4
Joined
Jul 28, 2019
Messages
77
  • New Unit
    • Events
      • Unit - A unit enters Unit Purchase Area <gen>
    • Conditions
      • ((Triggering unit) is in UNITG_playerDemoUnits_array[(Player number of (Owner of (Triggering unit)))]) Equal to False
      • ((Triggering unit) is A Hero) Equal to False
      • ((Triggering unit) is A structure) Equal to False
      • ((Triggering unit) is Summoned) Equal to False
    • Actions
      • Set TempInt = (Player number of (Owner of (Triggering unit)))
      • Set TempUnit = (Triggering unit)
      • Unit Group - Add TempUnit to UNITG_playerDemoUnits_array[TempInt]
      • Unit - Move TempUnit instantly to (Center of REGION_PlayerUnitStorage[TempInt]), facing Default building facing degrees
      • Unit - Add Sell This Unit to TempUnit
      • Custom script: call UnitMakeAbilityPermanent(udg_TempUnit, true, 'ACro')
      • Game - Display to (All players) for 4.00 seconds the text: ((Name of TempUnit) + ( added to + ((Name of (Owner of TempUnit)) + ('s UNITG_playerunits. + (Name of (Random unit from UNITG_playerDemoUnits_array[TempInt]))))))
ACro is of course the code for "Sell This Unit"
 
Status
Not open for further replies.
Top