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

[Solved] Class Item - Trigger Error

Status
Not open for further replies.
Level 2
Joined
Jun 9, 2013
Messages
18
Apologize in advance for the image. Don't know how to quote Triggers yet.

The Trigger works great except for the "Item - Remove" line. I can't seem to get the "Dragon's Heart" item to be removed upon buying the Ring of Armor. Everything else works perfect.

Any ideas?

Thanks in advance.
 

Attachments

  • trigger.jpg
    trigger.jpg
    52.2 KB · Views: 125
Level 2
Joined
Jun 9, 2013
Messages
18
Alright, thanks for the tip Doomlord. Here is the code:

  • Assassin Class Item
    • Events
      • Unit - Tinker 0021 <gen> Sells an item (from shop)
    • Conditions
      • ((Buying unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Sold Item)) Equal to Ring of Armor
          • ((Buying unit) has an item of type Dragon's Heart) Equal to True
          • (Unit-type of (Buying unit)) Equal to Illidan (Evil)
        • Then - Actions
          • Item - Remove (Item carried by (Triggering unit) of type Dragon's Heart)
        • Else - Actions
          • Item - Remove (Sold Item)
          • Player - Add 1000 to Player 1 (Red) Current gold
deathismyfriend - It only lets the character in the "If" conditions buy the item. For example, with this code here, it only lets Illidan (Evil) buy the item if he has a Dragon's Heart in his inventory - Which is what I want. But I would like it to remove the Dragon's Heart after buying the item - which it is NOT doing so far.

Thanks for replying!
 
Level 2
Joined
Jun 9, 2013
Messages
18
Yeah, it was Illidan.

"Buying Unit" was exactly what I needed.

Works perfectly now. Thanks so much!
 
Level 2
Joined
Jun 9, 2013
Messages
18
Hey Death,

I ran into a problem with the code. It works, but for some reason, if another hero class tries to buy the item it lets them. Is this because the "Unit Type of Buying Unit" (Illidan) - Is a Hero and so are they? I can't use Illidan as a specific unit because I have a Choose Class area, so I have to him as a Unit Type.

I have read about using variables like you said, but don't have complete knowledge how yet.
 
Status
Not open for further replies.
Top