• 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... my "Replace trigger" doesnt work properly

Status
Not open for further replies.
Level 8
Joined
Nov 21, 2008
Messages
316
(not the problem)This is the trigger which replaces the unit the first time. the second trigger is the problem. when the unit loses the item another unit is born from it and the item it was suppose to drop stays in inventory. thus making 2 troll survivors.
  • Troll Axethrower
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to |cffff8c00Battle Axe|r
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set Items[(Integer A)] = (Item-type of (Item carried by (Triggering unit) in slot (Integer A)))
      • Unit - Replace (Triggering unit) with a Troll Axe Thrower using The old unit's relative life and mana
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Hero - Create Items[(Integer A)] and give it to (Last replaced unit)
      • Selection - Select (Last replaced unit) for (Owner of (Last replaced unit))
The Bad Trigger
  • Axe Drop
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Unit-type of (Hero manipulating item)) Equal to Troll Axe Thrower
      • And - All (Conditions) are true
        • Conditions
          • (Item being manipulated) Equal to (Item carried by (Triggering unit) of type |cffff8c00Battle Axe|r)
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set Items[(Integer A)] = (Item-type of (Item carried by (Triggering unit) in slot (Integer A)))
      • Unit - Replace (Triggering unit) with a Troll Survivor using The old unit's relative life and mana
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Hero - Create Items[(Integer A)] and give it to (Last replaced unit)
      • Selection - Select (Last replaced unit) for (Owner of (Last replaced unit))
I need several things done. Why does it create another unit when axe is droped. Why do the troll survivors both have axes in inventory(it should have dropd) and can some1 write the new trigger so the axe can b removed and the unit turns back to normal
 
It might be a bug. Try this:
  • Axe Drop
  • Events
    • Unit - A unit Loses an item
  • Conditions
    • (Unit-type of (Hero manipulating item)) Equal to Troll Axe Thrower
    • (Item being manipulated) Equal to (|cffff8c00Battle Axe|r)
  • Actions
    • For each (Integer A) from 1 to 6, do (Actions)
      • Loop - Actions
        • If (All Conditions are true) then do (Actions) else do (Actions)
          • If - Conditions
            • (Item-type of (Item carried by (Triggering) in slot (IntegerA))) Not Equal to |cffff8c00Battle Axe|r
          • Then - Actions
            • Set Items[(Integer A)] = (Item-type of (Item carried by (Triggering unit) in slot (Integer A)))
          • Else - Actions
    • Unit - Replace (Triggering unit) with a Troll Survivor using The old unit's relative life and mana
    • For each (Integer B) from 1 to 6, do (Actions)
      • Loop - Actions
        • Hero - Create Items[(Integer B)] and give it to (Last replaced unit)
    • Selection - Select (Last replaced unit) for (Owner of (Last replaced unit))
 
Last edited:
Status
Not open for further replies.
Top