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

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

Status
Not open for further replies.
Level 6
Joined
Jul 28, 2019
Messages
99
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 6
Joined
Jul 28, 2019
Messages
99
I aint too good at JASS. I tried this, it complies, but doesn't work.
Code:
call UnitMakeAbilityPermanent(udg_TempUnit, true, 'ACro')
 
Level 6
Joined
Jul 28, 2019
Messages
99
  • 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