• 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] Equipish help

Status
Not open for further replies.
Level 1
Joined
Oct 18, 2007
Messages
2
ok, what I want is to have a basic unit, then have it change in accordance to what's in it's first inventory slot. and when it has nothing in it's first inventory slot, it reverts back to the basic unit. Also, Whenever the unit changed, I'd want it to keep it's life an mana stats. The unit would not be a hero.
I'm not very good with triggers, but this is what I tried =(
events
Unit-A unit aquires an item
conditions
(Item-type of (Item carried by (Hero manipulating item) in slot 1)) Equal to Inferno Stone
Actions
Unit - Replace (Hero manipulating item) with a Blood Mage using The old unit's relative life and mana
Unit - Remove (Hero manipulating item) from the game

hehe..all that did was crash the game..
And that was just an example/test (I don't want to change to bloodmage..and inferno stone wouldn't be the item)
 
  • hero replace
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Inferno Stone
    • Actions
      • Set TempLocation = (Position of (Hero manipulating item))
      • Set TempReal = (Facing of (Hero manipulating item))
      • Unit - Remove (Hero manipulating item) from the game
      • Unit - Create 1 Blood Mage for (Owner of (Hero manipulating item)) at TempLocation facing TempReal degrees
      • Custom script: call RemoveLocation(udg_TempLocation)
You'd also need to include some code to set its HP and MP to the old unit's HP and MP. The Unit - Replace doesn't work for me either.
 
Level 6
Joined
Nov 28, 2007
Messages
203
  • Random Name
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Inferno Stone Equal to (Item-type of (Item being manipulated))
    • Actions
      • Set TempLoc = (Position of (Hero manipulating item))
      • Set TempFacing = (Facing of (Hero manipulating item))
      • Set TempMana[(Player number of (Owner of (Hero manipulating item)))] = (Integer((Mana of (Hero manipulating item))))
      • Set TempLife[(Player number of (Owner of (Hero manipulating item)))] = (Integer((Life of (Hero manipulating item))))
      • Unit - Remove (Hero manipulating item) from the game
      • Unit - Create 1 Blood Mage for (Owner of (Hero manipulating item)) at (Center of (Playable map area)) facing Default building facing degrees
      • Unit - Set mana of (Last created unit) to (Real(TempMana[(Player number of (Owner of (Hero manipulating item)))]))
      • Unit - Set life of (Last created unit) to (Real(TempLife[(Player number of (Owner of (Hero manipulating item)))]))
      • Custom script: call RemoveLocation(udg_TempLoc)
TempLife and TempMana are integer arrays.

[Offtopic]: lol, i just noticed that i have 1000 position leaks/sec in my map >.< still it doesn't lag even if i've played for 3h o_O does i have a super-comp? ^^
 
Last edited:
Status
Not open for further replies.
Top