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

[Spell] Advance Replace Unit from Xelephant

Status
Not open for further replies.
Level 6
Joined
Aug 14, 2016
Messages
174
Edit:I want to making an Advance Replace Unit like:
I using Spells throwing knife in map Afterlife Afterlife XD.jpeg
After then i change weapons to Uzi, throwing knife still cooldown and the buff blend still effect.
  • Change to Bereta 9000S
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Unit-type of (Hero manipulating item)) Not equal to Beretta 9000S
      • (Item-type of (Item being manipulated)) Equal to Beretta 9000S
    • Actions
      • Set effect[(Player number of (Owner of (Triggering unit)))] = pistol2.MDX
      • Set newHero[(Player number of (Owner of (Triggering unit)))] = Beretta 9000S
      • Custom script: set udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = ChangeUnit(GetManipulatingUnit(),udg_newHero[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))],udg_effect[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
      • Game - Display to (All players) the text: (|CFFC70000Your Teammate + (ColorStr[(Player number of (Owner of (Hero manipulating item)))] + ((Name of (Owner of (Triggering unit))) + ((|r|CFFC70000 + has equipped ) + (Name of (Item being manipulated))))))
This trigger change weapons i taking from map Afterlife for Xelephant , but non-effect on my map, cooldown has reset, skill level too.
 
Last edited:
Level 30
Joined
Aug 29, 2012
Messages
1,382
You can use call UnitMakeAbilityPermanent(unit, true, ability) , I once used it for that specific purpose, it should save the cooldown between replacements.

Not sure about the level, but you can easily store it in an integer variable and set your abilities back to that level each time you replace units.
 
If you want to update an unit and keep things, you shouldn't use replace use a transformation spell. Replace will remove the old unit and create a new one.
While with a transformation spell like bearform the unitType gets switched and all permanent abilities remain. For a oneway transformation set the permanent flag or use the reversed bearform trick. When removing a transformation spell the unitType is set to the normal Unit Type of that transformation spell -> set the wanted unittype = normal UnitType + Add & Remove the transformation; your unit is morphed.
Edit: But you can't change primary stat that way.
 
Last edited:
Status
Not open for further replies.
Top