• 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] Help w/new hero purchasing

Status
Not open for further replies.
Level 2
Joined
Sep 21, 2007
Messages
17
Hi, I need help making a trigger that makes it so when you purchase a new hero, your old one (the one purchasing the new) is removed, and the newly purchased hero has the same exp as the now removed on. Similar to the trigger in "Battle Ships" or "Battle Tanks" where you can purchase a new boat/tank and it will have the same exp as the unit you just used to purchase it, then the old unit is removed.
 
Level 18
Joined
May 27, 2007
Messages
1,689
Create an Integer Variable, called lets say "Hero_Exp" As long as your old hero is purchasing the new one this will be easy.
Then Use the Event "Unit-Acquires Item"
You will need a dummy item in a shop or w/e, but for condition use
"Item Type of (Manipulated Item) equal to (Your New Hero)"
Actions
Set Hero_Exp=Hero Experience of (Triggering Unit)
Remove (Triggering Unit)
Create 1 (Your Hero) at (Position of (Triggering Unit)) facing W/E degrees
Hero-Set Hero Experience equal to (Hero_Exp) <--- Your variable


And that should be everything
If something isn't working or you need more just tell me
 
Level 4
Joined
Aug 31, 2007
Messages
54
  • Buy/Sell Unit EXP
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Buying unit) is A Hero) Equal to True
      • ((Sold unit) is A Hero) Equal to True
    • Actions
      • Set Hero_Exp = (Hero experience of (Buying unit))
      • Unit - Remove (Buying unit) from the game
      • Hero - Set (Sold unit) experience to Hero_Exp, Hide level-up graphics
tat should work
 
Level 2
Joined
Sep 21, 2007
Messages
17
Thank you, it does work. Also, is there some way to make the items possed by the buying hero be transfered to the newly bought hero?
 
Status
Not open for further replies.
Top