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

[Trigger] Its possible give unit same order then another one?

Status
Not open for further replies.
Level 2
Joined
Jan 7, 2013
Messages
13
Let me explain, i wanna replace some unit but i want the new unit have the same status - including buffs- and the same order than the old one.its possible do that?
Thanks at all,
Jamal XVI
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,220
I have not tested it but I belive it should work this way
  • swap
    • Events
    • Conditions
    • Actions
      • Custom script: local integer id = LoadInteger(hashtable, GetHandleId(unit), 1)
      • Custom script: local unit u = LoadUnitHandle(udg_hashtable, GetHandleId(unit), 2)
      • Set target = Paladin 0000 <gen>
      • Set target2 = (Target unit of issued order)
      • Set exp = (Hero experience of target)
      • Unit - Replace target with a Mountain King using The old unit's relative life and mana
      • Hero - Add exp experience to (Last created unit), Hide level-up graphics
      • Custom script: call IssueTargetOrder(bj_lastCreatedUnit, id, u)
  • order
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
    • Actions
      • Custom script: call SaveInteger(udg_hashtable, GetHandleId(udg_GetTriggeUnit()), 1, GetIssuedOrderId())
      • Custom script: call SaveUnitHandle(udg_hashtable, GetHandleId(udg_GetTriggeUnit()), 2,GetOrderTargetUnit() )
 
Status
Not open for further replies.
Top