• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Drop item if hero was item already

Status
Not open for further replies.
Level 11
Joined
May 2, 2009
Messages
650
I need a trigger for when a hero picks up an item, and he already has that item OR another type of item, he will drop the item he was picking up and a message pops up saying Blah blah blah to that player.


Will rep and give credit anyone who can create me it first, i tried several times and fail :(


Event
Unit - A unit aqcuires an item

Condition
(Item class of (Item being Manipulated)) Equal to Artifact

Action
If ((((Triggering unit) has an item of type (Random level -1 Artifact item-type)) Equal to True) and (((Triggering unit) is A Hero) Equal to True)) then do (Hero - Drop (Item being manipulated) from (Triggering unit)
^^
Code fail.

Need help.
 
Last edited:
Level 7
Joined
Jun 14, 2009
Messages
235
Event
Unit - A unit aqcuires an item

Condition
(Item class of (Item being Manipulated)) Equal to Artifact

Action
If ((((Triggering unit) has an item of type (Random level -1 Artifact item-type)) Equal to True) and (((Triggering unit) is A Hero) Equal to True)) then do (Hero - Drop (Item being manipulated) from (Triggering unit)
^^
Code fail.

Need help.

I used this

  • Events - A unit acquires an item
  • Conditions - Item type is an artifact
  • Actions -
    • If "herohasweapon" = true
    • Then - drop item being manipulated
  • Else - set "herohasweapon" = true
and

  • Events - A unit losses an item
  • Conditions - Item type is an artifact
  • Actions - Set "herohasweapon" =true"
If your using it fore more than one unit, then use arrays
'
  • Weapon
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Permanent
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HeroHasWeapon[(Player number of (Owner of (Hero manipulating item)))] Equal to True
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
          • Player Group - Add (Owner of (Hero manipulating item)) to MessageGroup
          • Game - Display to MessageGroup the text: (You may not have more than one weapon at a time! |cffffcc00 + ((Name of (Item being manipulated)) + |r has been dropped!))
          • Player Group - Remove all players from MessageGroup
        • Else - Actions
          • Set HeroHasWeapon[(Player number of (Owner of (Hero manipulating item)))] = True
and this for loss of weapon

  • Weapon Loss
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Permanent
    • Actions
      • Set HeroHasWeapon[(Player number of (Owner of (Hero manipulating item)))] = False
 
Status
Not open for further replies.
Top