• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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